From: Marek Vasut <marek.vasut@mailbox.org>
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: "Niklas Cassel" <cassel@kernel.org>,
"Damien Le Moal" <dlemoal@kernel.org>,
"Marek Vasut" <marek.vasut+renesas@mailbox.org>,
linux-pci@vger.kernel.org,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Frank Li" <Frank.Li@nxp.com>,
"Kishon Vijay Abraham I" <kishon@kernel.org>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Wang Jiang" <jiangwang@kylinos.cn>,
linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] PCI: endpoint: pci-epf-test: Limit PCIe BAR size for fixed BARs
Date: Fri, 5 Sep 2025 13:38:12 +0200 [thread overview]
Message-ID: <a63db205-ca63-436e-a63a-871bb527f5b7@mailbox.org> (raw)
In-Reply-To: <1jjz2d4a5f.fsf@starbuckisacylon.baylibre.com>
On 9/5/25 9:43 AM, Jerome Brunet wrote:
Hello Jerome,
>>> pci_epf_alloc_space() works like this:
>>> If the user requests a BAR size that is smaller than the fixed-size BAR,
>>> it will allocate space matching the fixed-size.
>>> As in most cases, having a BAR larger than needed by an EPF driver is
>>> still acceptable.
>>> However, if the user requests a size larger than the fixed-size BAR,
>>> as in your case, we will return an error, as we cannot fulfill the
>>> user's request.
>>> I don't see any alternative other than your/Damien's proposal above.
>>> Unfortunately, all EPF drivers would probably need this same change.
>>
>> It seems that pci-epf-ntb and pci-epf-vntb only use BAR0 (BAR_CONFIG) and
>> BAR0+BAR1 (BAR_CONFIG and BAR_DB) , so those should be OK on this
>> controller. NVMe EPF also seems to use only BAR0 and it specifically
>> handles fixed size BAR. It seems everything that is in the tree so far
>> managed to sidestep hitting fixed-size BAR4 problems on this hardware,
>> except for the test driver.
>
> As it stands, a vNTB device needs 3 BARs minimum (CFG, DB and MW). The
> NTB one may get away with with 2 BARs, with DB and MW sharing one.
I clearly missed the MW, thanks for pointing this out.
> If you referring to Renesas about that BAR4, I did use it for vNTB.
> It is indeed not upstream ... yet [1]
>
> I think it is possible to have vNTB on 2 BARs with some tweaks, putting
> CFG and DB on the same one.
>
> [1]: https://lore.kernel.org/r/20250702-ntb-rcar-support-v3-2-4268d9c85eb7@baylibre.com
Nitpick, commit message, "Renesas R-Car Gen4" (Gen3 has a different PCIe
controller) . Please CC linux-renesas-soc@vger.kernel.org on V3 , thank
you !
--
Best regards,
Marek Vasut
next prev parent reply other threads:[~2025-09-05 11:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 2:37 [PATCH] PCI: endpoint: pci-epf-test: Limit PCIe BAR size for fixed BARs Marek Vasut
2025-09-04 2:40 ` Damien Le Moal
2025-09-04 3:32 ` Marek Vasut
2025-09-04 3:39 ` Damien Le Moal
2025-09-04 17:35 ` Marek Vasut
2025-09-04 12:28 ` Niklas Cassel
2025-09-04 21:29 ` Marek Vasut
2025-09-05 7:43 ` Jerome Brunet
2025-09-05 11:38 ` Marek Vasut [this message]
2025-09-05 7:32 ` Jerome Brunet
2025-09-05 8:36 ` Niklas Cassel
2025-09-05 12:14 ` Marek Vasut
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=a63db205-ca63-436e-a63a-871bb527f5b7@mailbox.org \
--to=marek.vasut@mailbox.org \
--cc=Frank.Li@nxp.com \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=jbrunet@baylibre.com \
--cc=jiangwang@kylinos.cn \
--cc=kishon@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mani@kernel.org \
--cc=marek.vasut+renesas@mailbox.org \
/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