From: Niklas Cassel <cassel@kernel.org>
To: Christian Bruel <christian.bruel@foss.st.com>
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>,
"Koichiro Den" <den@valinux.co.jp>,
fabrice.gasnier@foss.st.com, linux-pci@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] PCI: endpoint: pci-epf-test: Handle -ENOSPC in subrange map test
Date: Wed, 18 Mar 2026 16:50:53 +0100 [thread overview]
Message-ID: <abrJ3X7BIU3In-bm@ryzen> (raw)
In-Reply-To: <20260318-skip-bar_subrange-tests-if-enospc-v1-2-f1a49534ebea@foss.st.com>
On Wed, Mar 18, 2026 at 03:46:28PM +0100, Christian Bruel wrote:
> Report pci_epc_set_bar() -ENOSPC failure with the
> STATUS_BAR_SUBRANGE_SETUP_NOSPC status bit. This can be used to
> skip the subrange test if there is not enough iATU resources to
> allocate it.
>
> Link: https://lore.kernel.org/linux-pci/20260317152707.GA85951@bhelgaas/T/#m87e4c24173097a0ea70195b71aab294ad8d6c283
I would drop the link.
> Signed-off-by: Christian Bruel <christian.bruel@foss.st.com>
> ---
> drivers/pci/endpoint/functions/pci-epf-test.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
> index 14e61ebe1f116ce04789b6f4c3e965296701ec53..6437f08f0cd4bd4645e380c915b7cf81e66b7c35 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> @@ -54,6 +54,7 @@
> #define STATUS_BAR_SUBRANGE_SETUP_FAIL BIT(15)
> #define STATUS_BAR_SUBRANGE_CLEAR_SUCCESS BIT(16)
> #define STATUS_BAR_SUBRANGE_CLEAR_FAIL BIT(17)
> +#define STATUS_BAR_SUBRANGE_SETUP_NOSPC BIT(18)
Perhaps STATUS_BAR_SUBRANGE_SETUP_SKIP ?
>
> #define FLAG_USE_DMA BIT(0)
>
> @@ -903,6 +904,8 @@ static void pci_epf_test_bar_subrange_setup(struct pci_epf_test *epf_test,
> dev_err(&epf->dev, "pci_epc_set_bar() failed: %d\n", ret);
> bar->submap = old_submap;
> bar->num_submap = old_nsub;
> + if (ret == -ENOSPC)
> + status |= STATUS_BAR_SUBRANGE_SETUP_NOSPC;
> kfree(submap);
> goto err;
> }
Here you will have both STATUS_BAR_SUBRANGE_SETUP_NOSPC and
STATUS_BAR_SUBRANGE_SETUP_FAIL set.
Usually, we only have one bit set.
Perhaps something like:
diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index 582938b7b4f1..36e5d22f79ab 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -895,6 +895,10 @@ static void pci_epf_test_bar_subrange_setup(struct pci_epf_test *epf_test,
bar->submap = old_submap;
bar->num_submap = old_nsub;
kfree(submap);
+ if (ret == -ENOSPC) {
+ status |= STATUS_BAR_SUBRANGE_SETUP_SKIP;
+ goto err_status_set;
+ }
goto err;
}
kfree(old_submap);
@@ -918,6 +922,7 @@ static void pci_epf_test_bar_subrange_setup(struct pci_epf_test *epf_test,
err:
status |= STATUS_BAR_SUBRANGE_SETUP_FAIL;
+err_status_set:
reg->status = cpu_to_le32(status);
}
This patch should probably be 1/3.
Kind regards,
Niklas
next prev parent reply other threads:[~2026-03-18 15:50 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
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 [this message]
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=abrJ3X7BIU3In-bm@ryzen \
--to=cassel@kernel.org \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=christian.bruel@foss.st.com \
--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