Re: [PATCH v1] PCI: cpqphp: Check pci_hp_add_bridge() return value
From: Fahmy Hassan
Date: Tue Sep 08 2026 - 22:18:18 EST
On Tue, Sep 08, 2026 at 07:41 PM -0600, Bjorn Helgaas wrote:
> The patch doesn't seem to remove the TODO.
Sorry about that -- the patch you received was generated before I
amended the commit to actually include the TODO removal; the archived
patch file was stale on my end, not something dropped from the actual
fix. Fixed in v2.
> There are four other drivers that call pci_hp_add_bridge(), and none
> of them check the return value either. We should leave it alone or
> fix them all, so the review effort can be applied to all of them at
> once.
Makes sense. I've turned this into a v2 series that checks the return
value the same way in cpqphp, cpcihp, ibmphp, pciehp, and shpchp,
logging via each driver's existing error macro.
One more correction, from an automated review I also got on v1: my
commit message said the failure "goes completely unreported", which
overstated it -- pci_hp_add_bridge() already logs the "no bus number
available" case via pci_err(). It only stays silent for the other
failure path (subordinate bus not created after scanning). Since the
function returns a bare -1 for either case, the caller can't tell
which one happened, so the new per-driver log will occasionally
overlap with that existing message for the bus-number case
specifically. I've reworded the v2 commit messages to describe this
accurately instead.
v2 coming shortly.
Thanks,
Fahmy