[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <caa01cf5-1ae4-439a-ab70-18cfcfce7a92@mailbox.org>
Date: Fri, 5 Sep 2025 14:14:44 +0200
From: Marek Vasut <marek.vasut@...lbox.org>
To: Niklas Cassel <cassel@...nel.org>, Jerome Brunet <jbrunet@...libre.com>
Cc: Damien Le Moal <dlemoal@...nel.org>,
Marek Vasut <marek.vasut+renesas@...lbox.org>, linux-pci@...r.kernel.org,
Krzysztof WilczyĆski <kwilczynski@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>, Frank Li <Frank.Li@....com>,
Kishon Vijay Abraham I <kishon@...nel.org>,
Manivannan Sadhasivam <mani@...nel.org>, Wang Jiang <jiangwang@...inos.cn>,
linux-kernel@...r.kernel.org, linux-renesas-soc@...r.kernel.org
Subject: Re: [PATCH] PCI: endpoint: pci-epf-test: Limit PCIe BAR size for
fixed BARs
On 9/5/25 10:36 AM, Niklas Cassel wrote:
> On Fri, Sep 05, 2025 at 09:32:03AM +0200, Jerome Brunet wrote:
>> On Thu 04 Sep 2025 at 14:28, Niklas Cassel <cassel@...nel.org> wrote:
>>>>
>>>> I think this can be simplified to:
>>>>
>>>> if (epc_features->bar[bar].type == BAR_FIXED)
>>>> test_bar_size = epc_features->bar[bar].fixed_size;
>>>> else
>>>> test_bar_size = bar_size[bar];
>>>
>>> +1
>>
>> It's what pci_epf_alloc_space() does too. so it makes sense but it also
>> means the side must stay aligned.
>
> Not really, pci_epf_alloc_space() will give you 'fixed_size'
> if you request size < fixed_size.
>
> If you request more, it will give you an error.
>
>>
>> If a rework is needed, maybe it would be better to get size from
>> pci_epf_alloc_space() instead of recomputing it ?
>
> The pci-epf-test driver is just a test driver and we can use whatever
> BAR size we want for each BAR.
>
> However, I don't think that pci_epf_alloc_space() can always give us
> a BAR size. Sure, for fixed_size BARs, there is only a single size
> that is possible. But for Programmable and Resizable BARs, there are
> many possible sizes, so which size should pci_epf_alloc_space() then
> return?
>
> And not all EPF drivers might be happy with an aribitrary BAR size
> (which is the case for pci-epf-test), some EPF drivers might have
> strict minimum sizes for a BAR.
>
> So, I still think this proposal is the best thing we can do.
>
> At least it appears that we only need to patch pci-epf-test.
In the meantime, I sent a tested V2, so it is on the list.
Thanks !
Powered by blists - more mailing lists