Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Fahmy Hassan" <fahmymohammed@gmail.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v1] PCI: cpqphp: Check pci_hp_add_bridge() return value
Date: Wed, 09 Sep 2026 01:42:57 +0000	[thread overview]
Message-ID: <20260909014257.AD6E71F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260909013028.508870-1-fahmymohammed@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message inaccurately claims to remove a 'now-resolved TODO entry' and states that the failure goes 'completely unreported', resulting in duplicate logs and missing changes.
--

commit b0a51b9f884f314ded07cba26637065948174b4b
Author: Fahmy Hassan <fahmymohammed@gmail.com>

PCI: cpqphp: Check pci_hp_add_bridge() return value

This commit adds an error check and log for pci_hp_add_bridge() in
cpqhp_configure_device(). The commit message notes this fixes a completely
unreported failure and removes a resolved TODO entry.

>     cpqhp_configure_device() calls pci_hp_add_bridge() without checking
>     its return value. If pci_hp_add_bridge() fails (e.g. no bus number
>     is available for the hot-added bridge), dev->subordinate is left
>     unset, so the subsequent pci_bus_add_devices(child) call is
>     correctly skipped -- but the failure itself goes completely
>     unreported, making such problems very hard to diagnose in the field.
>     
>     Log an error via the driver's existing err() macro when
>     pci_hp_add_bridge() fails, and remove the now-resolved TODO entry.

[Severity: Medium]
Is the statement that the failure goes "completely unreported" accurate?

Looking at pci_hp_add_bridge() in drivers/pci/probe.c, it already explicitly
logs an error when no bus number is available:

	if (busnr-- > end) {
		pci_err(dev, "No bus number available for hot-added bridge\n");
		return -1;
	}

Additionally, the commit message mentions removing a "now-resolved TODO
entry," but the patch does not appear to remove any such entry from
cpqhp_configure_device() or the rest of the file. Could the commit message
be updated, or was a chunk of the patch accidentally dropped?

> diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c
> index 81c58b1ec200f..34803f36ba65c 100644
> --- a/drivers/pci/hotplug/cpqphp_pci.c
> +++ b/drivers/pci/hotplug/cpqphp_pci.c
> @@ -100,7 +100,9 @@ int cpqhp_configure_device(struct controller *ctrl, struct pci_func *func)
>  	}
>  
>  	if (func->pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
> -		pci_hp_add_bridge(func->pci_dev);
> +		if (pci_hp_add_bridge(func->pci_dev))
> +			err("bus/device/function %x/%x/%x: pci_hp_add_bridge() failed\n",
> +			    func->bus, func->device, func->function);

[Severity: Medium]
Does adding this err() call result in duplicate logs when
pci_hp_add_bridge() fails?

Since pci_hp_add_bridge() already logs its own error for the missing bus
number case, this new message will be printed immediately after the core PCI
error log, potentially duplicating the error reporting.

>  		child = func->pci_dev->subordinate;
>  		if (child)
>  			pci_bus_add_devices(child);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260909013028.508870-1-fahmymohammed@gmail.com?part=1

      parent reply	other threads:[~2026-09-09  1:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09  1:30 [PATCH v1] PCI: cpqphp: Check pci_hp_add_bridge() return value Fahmy Hassan
2026-09-09  1:41 ` Bjorn Helgaas
2026-09-09  2:17   ` Fahmy Hassan
2026-09-09  2:22   ` [PATCH v2 0/5] PCI: hotplug: " Fahmy Hassan
2026-09-09  2:22     ` [PATCH v2 1/5] PCI: cpqphp: " Fahmy Hassan
2026-09-09  2:22     ` [PATCH v2 2/5] PCI: cpcihp: " Fahmy Hassan
2026-09-09  2:22     ` [PATCH v2 3/5] PCI: ibmphp: " Fahmy Hassan
2026-09-09  2:22     ` [PATCH v2 4/5] PCI: pciehp: " Fahmy Hassan
2026-09-09  6:42       ` Lukas Wunner
2026-09-09  2:22     ` [PATCH v2 5/5] PCI: shpchp: " Fahmy Hassan
2026-09-09  1:42 ` sashiko-bot [this message]

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=20260909014257.AD6E71F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=fahmymohammed@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox