From: sashiko-bot@kernel.org
To: "Gerd Bayer" <gbayer@linux.ibm.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH 2/5] arm/pci: Use official API to iterate over PCI buses
Date: Fri, 15 May 2026 14:59:40 +0000 [thread overview]
Message-ID: <20260515145940.E85AAC2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260515-priv_root_buses-v1-2-f8e393c57390@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Calling a sleepable lock from a hardware interrupt handler causes a 'scheduling while atomic' BUG.
--
commit f34de1e1be1288e13d00eee56b2fe60eb5f4ec85
Author: Gerd Bayer <gbayer@linux.ibm.com>
arm/pci: Use official API to iterate over PCI buses
This commit replaces iterating over pci_root_buses with pci_find_next_bus().
This change is intended to allow pci_root_buses to become private to the PCI
core.
> diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
> index ac0e890510daf..35642c9ba054c 100644
> --- a/arch/arm/kernel/bios32.c
> +++ b/arch/arm/kernel/bios32.c
> @@ -59,9 +59,9 @@ static void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, in
>
> void pcibios_report_status(u_int status_mask, int warn)
> {
> - struct pci_bus *bus;
> + struct pci_bus *bus = NULL;
>
> - list_for_each_entry(bus, &pci_root_buses, node)
> + while ((bus = pci_find_next_bus(bus)) != NULL)
Can calling pci_find_next_bus() from an interrupt handler lead to a
scheduling while atomic bug?
In arch/arm/mach-footbridge/dc21285.c, pcibios_report_status() is called
directly from primary hardware interrupt handlers, such as dc21285_abort_irq()
and dc21285_serr_irq(). These handlers execute in an atomic hardirq context
where sleeping is not permitted.
Since pci_find_next_bus() unconditionally acquires the pci_bus_sem read-write
semaphore using down_read(), this introduces a blocking operation into that
atomic path:
dc21285_abort_irq() [hardirq context]
pcibios_report_status()
pci_find_next_bus()
down_read(&pci_bus_sem) [sleeps]
Does this path need an alternative approach to safely iterate over the buses
without taking a sleeping lock?
> pcibios_bus_report_status(bus, status_mask, warn);
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260515-priv_root_buses-v1-0-f8e393c57390@linux.ibm.com?part=2
next prev parent reply other threads:[~2026-05-15 14:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 14:22 [PATCH 0/5] PCI: Finally make pci_root_buses private Gerd Bayer
2026-05-15 14:22 ` [PATCH 1/5] alpha/pci: Use official API to iterate over PCI buses Gerd Bayer
2026-05-15 14:22 ` [PATCH 2/5] arm/pci: " Gerd Bayer
2026-05-15 14:59 ` sashiko-bot [this message]
2026-05-18 15:45 ` Gerd Bayer
2026-05-15 14:22 ` [PATCH 3/5] powerpc/pci: " Gerd Bayer
2026-05-15 15:31 ` sashiko-bot
2026-05-15 14:22 ` [PATCH 4/5] x86/pci: " Gerd Bayer
2026-05-15 15:13 ` Dave Hansen
2026-05-18 12:01 ` Gerd Bayer
2026-05-15 14:22 ` [PATCH 5/5] PCI: Make pci_root_buses private to PCI core Gerd Bayer
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=20260515145940.E85AAC2BCB0@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=gbayer@linux.ibm.com \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.