From: Frank Li <Frank.li@nxp.com>
To: Niklas Cassel <cassel@kernel.org>
Cc: "Manivannan Sadhasivam" <mani@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Kishon Vijay Abraham I" <kishon@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Manikanta Maddireddy" <mmaddireddy@nvidia.com>,
"Koichiro Den" <den@valinux.co.jp>,
"Damien Le Moal" <dlemoal@kernel.org>,
linux-pci@vger.kernel.org
Subject: Re: [PATCH v2 4/9] PCI: endpoint: Introduce pci_epc_bar_type BAR_DISABLED
Date: Wed, 25 Feb 2026 15:24:47 -0500 [thread overview]
Message-ID: <aZ9aj4YFDSLvepDw@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20260225170324.4033466-15-cassel@kernel.org>
On Wed, Feb 25, 2026 at 06:03:27PM +0100, Niklas Cassel wrote:
> Add a pci_epc_bar_type BAR_DISABLED to more clearly differentiate from
> BAR_RESERVED.
>
> This BAR type will only be used to describe a BAR that the EPC driver
> should disable, and will thus never be available to an EPF drive.
> (Unlike BAR_RESERVED, which will never be disabled by default by an EPC
> driver.)
>
> Tested-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
> Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
> Co-developed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
> Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
> Signed-off-by: Niklas Cassel <cassel@kernel.org>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/pci/endpoint/pci-epc-core.c | 5 +++--
> include/linux/pci-epc.h | 12 ++++++++++--
> 2 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c
> index 1ad2f62963c8..32cf9a9bc365 100644
> --- a/drivers/pci/endpoint/pci-epc-core.c
> +++ b/drivers/pci/endpoint/pci-epc-core.c
> @@ -103,9 +103,10 @@ enum pci_barno pci_epc_get_next_free_bar(const struct pci_epc_features
> bar++;
>
> for (i = bar; i < PCI_STD_NUM_BARS; i++) {
> - /* If the BAR is not reserved, return it. */
> + /* If the BAR is not reserved or disabled, return it. */
> if (epc_features->bar[i].type != BAR_RESERVED &&
> - epc_features->bar[i].type != BAR_64BIT_UPPER)
> + epc_features->bar[i].type != BAR_64BIT_UPPER &&
> + epc_features->bar[i].type != BAR_DISABLED)
> return i;
> }
>
> diff --git a/include/linux/pci-epc.h b/include/linux/pci-epc.h
> index f7f48f43d370..63a24ebf144c 100644
> --- a/include/linux/pci-epc.h
> +++ b/include/linux/pci-epc.h
> @@ -191,7 +191,14 @@ struct pci_epc {
> * @BAR_RESIZABLE: The BAR implements the PCI-SIG Resizable BAR Capability.
> * NOTE: An EPC driver can currently only set a single supported
> * size.
> - * @BAR_RESERVED: The BAR should not be touched by an EPF driver.
> + * @BAR_RESERVED: Used for HW-backed BARs (e.g. MSI-X table, DMA regs). The BAR
> + * should not be disabled by an EPC driver. The BAR should not be
> + * reprogrammed by an EPF driver. An EPF driver is allowed to
> + * disable the BAR if absolutely necessary. (However, right now
> + * there is no EPC operation to disable a BAR that has not been
> + * programmed using pci_epc_set_bar().)
> + * @BAR_DISABLED: The BAR should be disabled by an EPC driver. The BAR will be
> + * unavailable to an EPF driver.
> * @BAR_64BIT_UPPER: Should only be set on a BAR if the preceding BAR is marked
> * as only_64bit.
> */
> @@ -200,6 +207,7 @@ enum pci_epc_bar_type {
> BAR_FIXED,
> BAR_RESIZABLE,
> BAR_RESERVED,
> + BAR_DISABLED,
> BAR_64BIT_UPPER,
> };
>
> @@ -238,7 +246,7 @@ struct pci_epc_bar_rsvd_region {
> *
> * only_64bit should not be set on a BAR of type BAR_RESERVED.
> * (If BARx is a 64-bit BAR that an EPF driver is not allowed to
> - * touch, then both BARx and BARx+1 must be set to type
> + * reprogram, then both BARx and BARx+1 must be set to type
> * BAR_RESERVED.)
> * @nr_rsvd_regions: number of fixed subregions described for BAR_RESERVED
> * @rsvd_regions: fixed subregions behind BAR_RESERVED
> --
> 2.53.0
>
next prev parent reply other threads:[~2026-02-25 20:24 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 17:03 [PATCH v2 0/9] PCI: endpoint: Differentiate between disabled and reserved BARs Niklas Cassel
2026-02-25 17:03 ` [PATCH v2 1/9] PCI: endpoint: Introduce pci_epc_bar_type BAR_64BIT_UPPER Niklas Cassel
2026-02-25 17:03 ` [PATCH v2 2/9] PCI: endpoint: Describe reserved subregions within BARs Niklas Cassel
2026-02-25 20:22 ` Frank Li
2026-02-25 17:03 ` [PATCH v2 3/9] PCI: dw-rockchip: Describe RK3588 BAR4 DMA ctrl window Niklas Cassel
2026-02-25 20:23 ` Frank Li
2026-03-01 13:30 ` Koichiro Den
2026-02-25 17:03 ` [PATCH v2 4/9] PCI: endpoint: Introduce pci_epc_bar_type BAR_DISABLED Niklas Cassel
2026-02-25 20:24 ` Frank Li [this message]
2026-02-25 17:03 ` [PATCH v2 5/9] PCI: dwc: Replace certain BAR_RESERVED with BAR_DISABLED in glue drivers Niklas Cassel
2026-02-25 20:26 ` Frank Li
2026-02-25 17:03 ` [PATCH v2 6/9] PCI: dwc: Disable BARs in common code instead of in each glue driver Niklas Cassel
2026-02-25 20:27 ` Frank Li
2026-03-01 13:11 ` Koichiro Den
2026-02-25 17:03 ` [PATCH v2 7/9] PCI: endpoint: pci-epf-test: Advertise reserved BARs Niklas Cassel
2026-02-25 20:28 ` Frank Li
2026-02-25 17:03 ` [PATCH v2 8/9] misc: pci_endpoint_test: Give reserved BARs a distinct error code Niklas Cassel
2026-02-25 20:29 ` Frank Li
2026-02-25 17:03 ` [PATCH v2 9/9] selftests: pci_endpoint: Skip reserved BARs Niklas Cassel
2026-03-01 13:38 ` [PATCH v2 0/9] PCI: endpoint: Differentiate between disabled and " Koichiro Den
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=aZ9aj4YFDSLvepDw@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=den@valinux.co.jp \
--cc=dlemoal@kernel.org \
--cc=kishon@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mani@kernel.org \
--cc=mmaddireddy@nvidia.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