public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: "Niklas Cassel" <cassel@kernel.org>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Manivannan Sadhasivam" <mani@kernel.org>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Krishna Chaitanya Chundru" <krishna.chundru@oss.qualcomm.com>
Cc: Randolph Lin <randolph@andestech.com>,
	Samuel Holland <samuel.holland@sifive.com>,
	Frank Li <Frank.Li@nxp.com>,
	Charles Mirabile <cmirabil@redhat.com>,
	tim609@andestech.com, "Maciej W. Rozycki" <macro@orcam.me.uk>,
	stable+noautosel@kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH v5 3/3] PCI: dwc: Fix missing iATU setup when ECAM is enabled
Date: Wed, 28 Jan 2026 15:40:03 +0900	[thread overview]
Message-ID: <b0921701-3ce1-4d03-9a55-436ba09b8eb2@kernel.org> (raw)
In-Reply-To: <20260127151038.1484881-8-cassel@kernel.org>

On 1/28/26 12:10 AM, Niklas Cassel wrote:
> From: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
> 
> When ECAM is enabled, the driver skipped calling dw_pcie_iatu_setup()
> before configuring ECAM iATU entries. This left IO and MEM outbound
> windows unprogrammed, resulting in broken IO transactions. Additionally,
> dw_pcie_config_ecam_iatu() was only called during host initialization,
> so ECAM-related iATU entries were not restored after suspend/resume,
> leading to failures in configuration space access
> 
> To resolve these issues, the ECAM iATU configuration is moved into
> dw_pcie_iatu_setup(), and dw_pcie_iatu_setup() is invoked when ECAM is
> enabled.
> 
> Furthermore, error checks are added in dw_pcie_prog_outbound_atu() and
> dw_pcie_prog_inbound_atu() such that an error is returned if trying to
> program an iATU that is outside the number of iATUs provided by the
> controller.
> 
> Fixes: f6fd357f7afb ("PCI: dwc: Prepare the driver for enabling ECAM mechanism using iATU 'CFG Shift Feature'")
> Cc: stable+noautosel@kernel.org # depends on Clean up iATU index usage in dw_pcie_iatu_setup()
> Reported-by: Maciej W. Rozycki <macro@orcam.me.uk>
> Closes: https://lore.kernel.org/all/alpine.DEB.2.21.2511280256260.36486@angie.orcam.me.uk/
> Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
> Co-developed-by: Niklas Cassel <cassel@kernel.org>
> Signed-off-by: Niklas Cassel <cassel@kernel.org>

Looks OK to me.
(one nit below)

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>



> @@ -915,8 +907,21 @@ static int dw_pcie_iatu_setup(struct dw_pcie_rp *pp)
>  	 * NOTE: For outbound address translation, outbound iATU at index 0 is
>  	 * reserved for CFG IOs (dw_pcie_other_conf_map_bus()), thus start at
>  	 * index 1.
> +	 *
> +	 * If using ECAM, outbound iATU at index 0 and index 1 is reserved for

s/is/are

> +	 * CFG IOs.
>  	 */
> -	ob_iatu_index = 1;
> +	if (pp->ecam_enabled) {
> +		ob_iatu_index = 2;
> +		ret = dw_pcie_config_ecam_iatu(pp);
> +		if (ret) {
> +			dev_err(pci->dev, "Failed to configure iATU in ECAM mode\n");
> +			return ret;
> +		}
> +	} else {
> +		ob_iatu_index = 1;
> +	}
> +
>  	resource_list_for_each_entry(entry, &pp->bridge->windows) {
>  		resource_size_t res_size;



-- 
Damien Le Moal
Western Digital Research

  parent reply	other threads:[~2026-01-28  6:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-27 15:10 [PATCH v5 0/3] PCI: dwc: Clean up iATU index mess Niklas Cassel
2026-01-27 15:10 ` [PATCH v5 1/3] PCI: dwc: Fix msg_atu_index assignment Niklas Cassel
2026-01-28  6:07   ` Hans Zhang
2026-01-28  6:36   ` Damien Le Moal
2026-02-04 16:04   ` Maciej W. Rozycki
2026-01-27 15:10 ` [PATCH v5 2/3] PCI: dwc: Clean up iATU index usage in dw_pcie_iatu_setup() Niklas Cassel
2026-01-27 18:14   ` Frank Li
2026-01-28  6:10   ` Hans Zhang
2026-01-28  6:37   ` Damien Le Moal
2026-02-04 16:05   ` Maciej W. Rozycki
2026-01-27 15:10 ` [PATCH v5 3/3] PCI: dwc: Fix missing iATU setup when ECAM is enabled Niklas Cassel
2026-01-27 18:16   ` Frank Li
2026-01-28  6:11   ` Hans Zhang
2026-01-28  6:40   ` Damien Le Moal [this message]
2026-02-04 16:05   ` Maciej W. Rozycki
2026-01-28  8:02 ` [PATCH v5 0/3] PCI: dwc: Clean up iATU index mess Manivannan Sadhasivam
2026-02-02 12:47   ` Niklas Cassel
2026-02-04 16:13     ` Maciej W. Rozycki
2026-02-05  8:04       ` Niklas Cassel
2026-02-05 12:56 ` Manivannan Sadhasivam
2026-02-05 13:23   ` Niklas Cassel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0921701-3ce1-4d03-9a55-436ba09b8eb2@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=Frank.Li@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=cassel@kernel.org \
    --cc=cmirabil@redhat.com \
    --cc=jingoohan1@gmail.com \
    --cc=krishna.chundru@oss.qualcomm.com \
    --cc=kwilczynski@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=macro@orcam.me.uk \
    --cc=mani@kernel.org \
    --cc=randolph@andestech.com \
    --cc=robh@kernel.org \
    --cc=samuel.holland@sifive.com \
    --cc=stable+noautosel@kernel.org \
    --cc=tim609@andestech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox