From: Christian Bruel <christian.bruel@foss.st.com>
To: Koichiro Den <den@valinux.co.jp>
Cc: "Manivannan Sadhasivam" <mani@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Kishon Vijay Abraham I" <kishon@kernel.org>,
"Shuah Khan" <shuah@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Arnd Bergmann" <arnd@arndb.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Niklas Cassel" <cassel@kernel.org>,
fabrice.gasnier@foss.st.com, linux-pci@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] selftests: pci_endpoint: Skip subrange map test if iATU allocation fails
Date: Fri, 20 Mar 2026 15:19:15 +0100 [thread overview]
Message-ID: <8da9e382-bf85-431e-bcfe-0b9255e8db66@foss.st.com> (raw)
In-Reply-To: <nk2cc2ikag2ofpskmnnc7mqzsvtizwcjm6rlkrkuqesq673h3l@mamriu2gshit>
On 3/20/26 15:05, Koichiro Den wrote:
> On Fri, Mar 20, 2026 at 11:04:28AM +0100, Christian Bruel wrote:
>> Hello Koichiro, thank you for your comment
>>
>> On 3/19/26 02:28, Koichiro Den wrote:
>>> On Wed, Mar 18, 2026 at 03:46:27PM +0100, Christian Bruel wrote:
>>>> Handle -ENOSPC error. If the number of available inbound ATU entries is
>>>> insufficient to map the subrange, skip the test instead of failing.
>>>>
>>>> Link: https://lore.kernel.org/linux-pci/20260317152707.GA85951@bhelgaas/T/#m87e4c24173097a0ea70195b71aab294ad8d6c283
>>>> Signed-off-by: Christian Bruel <christian.bruel@foss.st.com>
>>>> ---
>>>> tools/testing/selftests/pci_endpoint/pci_endpoint_test.c | 2 ++
>>>> 1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c b/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c
>>>> index c417fb3a198b2d92c3060938c23807cc8bea5573..8ea2fda4539d11eb22b22800a7cb8bbaa99c91ba 100644
>>>> --- a/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c
>>>> +++ b/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c
>>>> @@ -88,6 +88,8 @@ TEST_F(pci_ep_bar, BAR_SUBRANGE_TEST)
>>>> SKIP(return, "Subrange map is not supported");
>>>> if (ret == -ENOBUFS)
>>>> SKIP(return, "BAR is reserved");
>>>> + if (ret == -ENOSPC)
>>>> + SKIP(return, "Not enough ATU entries to allocate subrange");
>>>
>>> Thank you for handling this!
>>>
>>> pci_endpoint_test_bar_subrange() can also return -ENOSPC locally:
>>> https://github.com/torvalds/linux/blob/v7.0-rc4/drivers/misc/pci_endpoint_test.c#L538
>>> While that is a different resource limit case, I think it would still be
>>> reasonable to treat it as SKIP as well.
>>
>> Regarding Niklas's feedback to use the local EINVAL instead of ENOSPC in
>> pci_endpoint_test_bar_subrange(), I prefer to leave this for you to handle.
>> That will cover this case.
>
> So could you consider the following tiny patch as a prerequisite for your
> series?
> https://lore.kernel.org/linux-pci/20260320140139.2415480-1-den@valinux.co.jp/
sure, thank you
>
>>
>>>
>>> If you agree and keep your current approach, then I think the SKIP message
>>> might be better phrased more generically, e.g. "Insufficient resources".
>>
>> OK I agree, the error message should be less specific to DWC terminology,
>> even though this case can currently only occur on it.
>
> Yes, I agree. As mentioned in my reply to Niklas, the other -ENOSPC is better
> replaced with -EINVAL, so I just submitted a tiny patch. That concern should be
> resolved.
>
>>
>>>
>>> If you prefer to keep that local case as FAIL (or at least distinguish it
>>> with a different SKIP message), that would likely require a bit more
>>> changes overall. Note: Niklas' earlier feedback on the SKIP message would
>>> still apply.
>>
>> OK, as Niklas also suggested, I will not set an additional local bit besides
>> the fail bit. The question is whether we should name it SKIP or NOSPC. I
>> slightly prefer NOSPC, as this is what is used in the selftest to indicate
>> skipping.
>
> Personally, Niklas' "errno in struct pci_epf_test_reg" idea sounds the best
> among the options discussed so far.
It is a good solution but does not match very well with the other
existing API (See the STATUS_SRC/DST_ADDR_INVALID bits). Thus, we will
keep the existing method of reporting errors using a second bit
alongside the FAIL bit.
>
> Best regards,
> Koichiro
>
>>
>> thank you
>>
>> Christian
>>
>>>
>>> Best regards,
>>> Koichiro
>>>
>>>> EXPECT_FALSE(ret) TH_LOG("Test failed for BAR%d", variant->barno);
>>>> }
>>>>
>>>> --
>>>> 2.34.1
>>>>
>>
next prev parent reply other threads:[~2026-03-20 14:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 14:46 [PATCH 0/3] Skip subrange map tests on DWC iATU allocation failure Christian Bruel
2026-03-18 14:46 ` [PATCH 1/3] selftests: pci_endpoint: Skip subrange map test if iATU allocation fails Christian Bruel
2026-03-18 15:32 ` Niklas Cassel
2026-03-19 1:28 ` Koichiro Den
2026-03-19 8:47 ` Niklas Cassel
2026-03-20 13:41 ` Koichiro Den
2026-03-20 10:04 ` Christian Bruel
2026-03-20 14:05 ` Koichiro Den
2026-03-20 14:19 ` Christian Bruel [this message]
2026-03-20 15:33 ` Koichiro Den
2026-03-18 14:46 ` [PATCH 2/3] PCI: endpoint: pci-epf-test: Handle -ENOSPC in subrange map test Christian Bruel
2026-03-18 15:50 ` Niklas Cassel
2026-03-18 14:46 ` [PATCH 3/3] misc: pci_endpoint_test: Handle -ENOSPC in subrange mapping test case Christian Bruel
2026-03-18 16:03 ` Niklas Cassel
2026-03-20 9:35 ` Christian Bruel
2026-03-20 11:16 ` Niklas Cassel
2026-03-20 13:25 ` Christian Bruel
2026-03-20 13:43 ` 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=8da9e382-bf85-431e-bcfe-0b9255e8db66@foss.st.com \
--to=christian.bruel@foss.st.com \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=den@valinux.co.jp \
--cc=fabrice.gasnier@foss.st.com \
--cc=gregkh@linuxfoundation.org \
--cc=kishon@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mani@kernel.org \
--cc=shuah@kernel.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