From: Niklas Cassel <cassel@kernel.org>
To: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Cc: "Frank Li" <Frank.li@nxp.com>,
"Richard Zhu" <hongxing.zhu@nxp.com>,
"Lucas Stach" <l.stach@pengutronix.de>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
"Marek Vasut" <marek.vasut+renesas@gmail.com>,
"Yoshihiro Shimoda" <yoshihiro.shimoda.uh@renesas.com>,
"Geert Uytterhoeven" <geert+renesas@glider.be>,
"Magnus Damm" <magnus.damm@gmail.com>,
"Thierry Reding" <thierry.reding@gmail.com>,
"Jonathan Hunter" <jonathanh@nvidia.com>,
"Kunihiko Hayashi" <hayashi.kunihiko@socionext.com>,
"Masami Hiramatsu" <mhiramat@kernel.org>,
"Koichiro Den" <den@valinux.co.jp>,
"Damien Le Moal" <dlemoal@kernel.org>,
linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
imx@lists.linux.dev, linux-renesas-soc@vger.kernel.org,
linux-tegra@vger.kernel.org
Subject: Re: [PATCH 5/9] PCI: dwc: Replace BAR_RESERVED with BAR_DISABLED in glue drivers
Date: Wed, 25 Feb 2026 15:56:34 +0100 [thread overview]
Message-ID: <aZ8Nom0TJKnYdIiJ@ryzen> (raw)
In-Reply-To: <bc3e8be5-8ffa-47f3-91e2-b3c0e9f8a28b@nvidia.com>
On Mon, Feb 23, 2026 at 10:16:51AM +0530, Manikanta Maddireddy wrote:
>
> On 18/02/26 3:45 am, Frank Li wrote:
> > On Tue, Feb 17, 2026 at 10:27:11PM +0100, Niklas Cassel wrote:
> > > Most DWC based EPC glue drivers that have BARs marked as BAR_RESERVED in
> > > epc_features also call dw_pcie_ep_reset_bar() for these reserved BARs in
> > > ep->ops->init().
> > >
> > > An EPF driver will be able to get/enable BARs that have been disabled/reset
> > > unless they are marked as BAR_RESERVED (see pci_epc_get_next_free_bar()).
> > >
> > > Thus all EPC drivers that have a BAR marked as BAR_RESERVED in epc_features
> > > AND call dw_pcie_ep_reset_bar() should really be marked as BAR_DISABLED.
> > >
> > > BARs that are marked as BAR_RESERVED in epc_features but for which
> > > dw_pcie_ep_reset_bar() is not called in ep->ops->init() are still kept as
> > > BAR_RESERVED.
> > combine the same condition together to make easy to read. like
> >
> > "For BAR_RESERVED bars, change to BAR_DISABLED if call dw_pcie_ep_reset_bar().
> > and keep as BAR_RESERVED if not dw_pcie_ep_reset_bar() in ep-ops-init()"
> >
> > Frank
> >
> > > No EPC drivers outside drivers/pci/controllers/dwc mark their BARs as
> > > BAR_RESERVED, so there is nothing to do in non-DWC based EPC drivers.
> > >
> > > Signed-off-by: Niklas Cassel <cassel@kernel.org>
Note: the proper tag is Tested-by.
(I noticed that b4 did not pick up your tags.)
> Tested by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
> > > ---
> > > drivers/pci/controller/dwc/pci-imx6.c | 12 ++++++------
> > > drivers/pci/controller/dwc/pcie-rcar-gen4.c | 6 +++---
> > > drivers/pci/controller/dwc/pcie-tegra194.c | 8 ++++----
> > > drivers/pci/controller/dwc/pcie-uniphier-ep.c | 4 ++--
> I see BAR_RESERVED in pci-keystone.c driver in linux-next branch.
> Do you have any patch which changed BAR_RESERVED to different type
> in pci-keystone.c driver?
No, I did not change keystone, because that is the only DWC base glue driver
that has never disabled these BARs by default.
I will add a TODO to the keystone driver:
diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c
index 20fa4dadb82a..576a78a9f6e5 100644
--- a/drivers/pci/controller/dwc/pci-keystone.c
+++ b/drivers/pci/controller/dwc/pci-keystone.c
@@ -933,6 +933,11 @@ static const struct pci_epc_features ks_pcie_am654_epc_features = {
DWC_EPC_COMMON_FEATURES,
.msi_capable = true,
.msix_capable = true,
+ /*
+ * TODO: BAR_RESERVED should either be replaced with BAR_DISABLED or,
+ * if the should continue to be enabled, then the driver should define
+ * what is behind the reserved BARs, see struct pci_epc_bar_rsvd_region.
+ */
.bar[BAR_0] = { .type = BAR_RESERVED, },
.bar[BAR_1] = { .type = BAR_RESERVED, },
.bar[BAR_2] = { .type = BAR_RESIZABLE, },
next prev parent reply other threads:[~2026-02-25 14:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-17 21:27 [PATCH 0/9] PCI: endpoint differentiate between disabled and reserved BARs Niklas Cassel
2026-02-17 21:27 ` [PATCH 1/9] PCI: endpoint: Introduce pci_epc_bar_type BAR_64BIT_UPPER Niklas Cassel
2026-02-17 21:57 ` Frank Li
[not found] ` <81af7f88-b9c1-457f-9a21-a7b15a13d374@nvidia.com>
2026-02-23 10:14 ` Geert Uytterhoeven
2026-02-24 13:54 ` Manikanta Maddireddy
2026-02-17 21:27 ` [PATCH 5/9] PCI: dwc: Replace BAR_RESERVED with BAR_DISABLED in glue drivers Niklas Cassel
2026-02-17 22:15 ` Frank Li
2026-02-23 4:46 ` Manikanta Maddireddy
2026-02-25 14:56 ` Niklas Cassel [this message]
2026-02-17 21:27 ` [PATCH 6/9] PCI: dwc: Disable BARs in common code instead of in each glue driver Niklas Cassel
2026-02-17 23:00 ` Frank Li
2026-02-23 3:49 ` [PATCH 0/9] PCI: endpoint differentiate between disabled and reserved BARs Manikanta Maddireddy
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=aZ8Nom0TJKnYdIiJ@ryzen \
--to=cassel@kernel.org \
--cc=Frank.li@nxp.com \
--cc=bhelgaas@google.com \
--cc=den@valinux.co.jp \
--cc=dlemoal@kernel.org \
--cc=festevam@gmail.com \
--cc=geert+renesas@glider.be \
--cc=hayashi.kunihiko@socionext.com \
--cc=hongxing.zhu@nxp.com \
--cc=imx@lists.linux.dev \
--cc=jonathanh@nvidia.com \
--cc=kernel@pengutronix.de \
--cc=kwilczynski@kernel.org \
--cc=l.stach@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=magnus.damm@gmail.com \
--cc=mani@kernel.org \
--cc=marek.vasut+renesas@gmail.com \
--cc=mhiramat@kernel.org \
--cc=mmaddireddy@nvidia.com \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=thierry.reding@gmail.com \
--cc=yoshihiro.shimoda.uh@renesas.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