From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1F923EBF2A; Fri, 23 Jan 2026 18:46:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769194019; cv=none; b=kI2SSfKDfRcxPYO2Y34vZa4a47GBwnSzVtOpNgubCm2vizPKxF6J5RZxeyx5WT11sl1K5874Uj3uOi8YyM4nUE7DjA1AVyENZcSnMa8UbklP5L6yAsSaIAjdMy8Exxnv5crv301CYUr3eFetnrtGlpM1E7J0il0TURDQU4oMQO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769194019; c=relaxed/simple; bh=r6ZEYv1acM820A9Xate+DXThNCoFR1GIsc+2yX3WUZQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pTVOzgoqI1hoS06hS15UK2ZsspVcFesJhYS5outWkSl6F5JO5G8y82lm2KdcSrHZklfXQH7NsxU3dZYdsKeP68OHBrns42byLv/DwzCgM/+HE8oZ8OPVa7s3c9Gf6WnFcVEcMqoLVIdI/6DDWrvWSfQQOvBYf1GerudlVhlY5gw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nkaUsap7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nkaUsap7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F11DC4CEF1; Fri, 23 Jan 2026 18:46:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769194019; bh=r6ZEYv1acM820A9Xate+DXThNCoFR1GIsc+2yX3WUZQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=nkaUsap7XB9W5BuDpzbyA9TkQeBZjvTapc2IqDPv4vUElTGz4A+HNmb54tEyNF7RC SvyIw1PorPkJeSWbQ36XXNNLhnmDUhRarlbVrK51UYwmm0UyrR9whLAqoRxP/lz7xP V+EdFtlAKxXkiTkcmbG83gPy7K31hsKXe7zDen0YnAaovrJxMBbAGOl5aetNWVJLH/ Ne8QnoIoH51WMFm6uQr8ztruhDkW6pGexdp50Um4l5r00j/JBm8kz6vrOBPLrdO0Rg OsMi72Jm/EyNkc4W0c/6LGSV8Lq55ohQxKvSp/06wHaTQDLKpH0wxGSevPMClmikMt knPVU2EWOhg7g== Message-ID: Date: Sat, 24 Jan 2026 05:46:53 +1100 Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/4] PCI: dwc: Fix msg_atu_index assignment To: Niklas Cassel , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Frank Li Cc: Randolph Lin , Samuel Holland , Charles Mirabile , tim609@andestech.com, Krishna Chaitanya Chundru , "Maciej W. Rozycki" , stable@vger.kernel.org, Shawn Lin , Hans Zhang , linux-pci@vger.kernel.org References: <20260123182835.831710-6-cassel@kernel.org> <20260123182835.831710-7-cassel@kernel.org> Content-Language: en-US From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20260123182835.831710-7-cassel@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2026/01/24 5:28, Niklas Cassel wrote: > When dw_pcie_iatu_setup() configures outbound address translation > for both type PCIE_ATU_TYPE_MEM and PCIE_ATU_TYPE_IO, the iATU index > to use is incremented before calling dw_pcie_prog_outbound_atu(). > > However, for msg_atu_index the index is not incremented before use, > causing the iATU index to be the same as the last configured iATU > index, which means that it will incorrectly use the same iATU index > that is already in use, breaking outbound address translation. > > Fixes: e1a4ec1a9520 ("PCI: dwc: Add generic MSG TLP support for sending PME_Turn_Off when system suspend") > Cc: stable@vger.kernel.org > Reviewed-by: Frank Li > Reviewed-by: Shawn Lin > Reviewed-by: Hans Zhang > Signed-off-by: Niklas Cassel > --- > drivers/pci/controller/dwc/pcie-designware-host.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c > index b3d6a474fd16..ae5f2d8a3857 100644 > --- a/drivers/pci/controller/dwc/pcie-designware-host.c > +++ b/drivers/pci/controller/dwc/pcie-designware-host.c > @@ -982,7 +982,7 @@ static int dw_pcie_iatu_setup(struct dw_pcie_rp *pp) > dev_warn(pci->dev, "Ranges exceed outbound iATU size (%d)\n", > pci->num_ob_windows); > > - pp->msg_atu_index = i; > + pp->msg_atu_index = ++i; pp->msg_atu_index = i + 1; is a lot more readable in my opinion. Changing i itself is useless since it is reset to 0 below. > > i = 0; > resource_list_for_each_entry(entry, &pp->bridge->dma_ranges) { -- Damien Le Moal Western Digital Research