public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pci: make reset_subordinate hotplug safe
@ 2026-01-14 18:58 Keith Busch
  2026-01-14 19:18 ` Bjorn Helgaas
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Keith Busch @ 2026-01-14 18:58 UTC (permalink / raw)
  To: linux-pci, bhelgaas; +Cc: Keith Busch

From: Keith Busch <kbusch@kernel.org>

Use the slot reset method when resetting the bridge if the bus contains
hotplug slots. This fixes spurious hotplug events the secondary bus
reset triggers by utilizing slot's specific reset callback that ignores
link events.

Signed-off-by: Keith Busch <kbusch@kernel.org>
---
The new function introduced here is essentially the same as
pci_bus_error_reset, except it uses the reset functions that save and
restore the device. This is the same as before if not resetting a
hotplug slot.

 drivers/pci/pci-sysfs.c |  3 +--
 drivers/pci/pci.c       | 27 +++++++++++++++++++++++++++
 drivers/pci/pci.h       |  2 +-
 3 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 3881359440b1a..5c7c6f0c435f3 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -553,7 +553,6 @@ static ssize_t reset_subordinate_store(struct device *dev,
 				const char *buf, size_t count)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
-	struct pci_bus *bus = pdev->subordinate;
 	unsigned long val;
 
 	if (!capable(CAP_SYS_ADMIN))
@@ -563,7 +562,7 @@ static ssize_t reset_subordinate_store(struct device *dev,
 		return -EINVAL;
 
 	if (val) {
-		int ret = __pci_reset_bus(bus);
+		int ret = pci_reset_bridge(pdev);
 
 		if (ret)
 			return ret;
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index b14dd064006cc..ca426ff68c820 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -5747,6 +5747,33 @@ int __pci_reset_bus(struct pci_bus *bus)
 	return rc;
 }
 
+int pci_reset_bridge(struct pci_dev *bridge)
+{
+	struct pci_bus *bus = bridge->subordinate;
+	struct pci_slot *slot;
+
+	if (!bus)
+		return -ENOTTY;
+
+	mutex_lock(&pci_slot_mutex);
+	if (list_empty(&bus->slots))
+		goto bus_reset;
+
+	list_for_each_entry(slot, &bus->slots, list)
+		if (pci_probe_reset_slot(slot))
+			goto bus_reset;
+
+	list_for_each_entry(slot, &bus->slots, list)
+		if (__pci_reset_slot(slot))
+			goto bus_reset;
+
+	mutex_unlock(&pci_slot_mutex);
+	return 0;
+bus_reset:
+	mutex_unlock(&pci_slot_mutex);
+	return __pci_reset_bus(bus);
+}
+
 /**
  * pci_reset_bus - Try to reset a PCI bus
  * @pdev: top level PCI device to reset via slot/bus
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 36f8c0985430a..f216e7a37d726 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -197,7 +197,7 @@ bool pci_reset_supported(struct pci_dev *dev);
 void pci_init_reset_methods(struct pci_dev *dev);
 int pci_bridge_secondary_bus_reset(struct pci_dev *dev);
 int pci_bus_error_reset(struct pci_dev *dev);
-int __pci_reset_bus(struct pci_bus *bus);
+int pci_reset_bridge(struct pci_dev *dev);
 
 struct pci_cap_saved_data {
 	u16		cap_nr;
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] pci: make reset_subordinate hotplug safe
  2026-01-14 18:58 [PATCH] pci: make reset_subordinate hotplug safe Keith Busch
@ 2026-01-14 19:18 ` Bjorn Helgaas
  2026-01-14 19:24   ` Keith Busch
  2026-01-15 10:45 ` kernel test robot
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Bjorn Helgaas @ 2026-01-14 19:18 UTC (permalink / raw)
  To: Keith Busch
  Cc: linux-pci, bhelgaas, Keith Busch, Alex Williamson, Lukas Wunner

[+cc Alex, Lukas]

On Wed, Jan 14, 2026 at 10:58:21AM -0800, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
> 
> Use the slot reset method when resetting the bridge if the bus contains
> hotplug slots. This fixes spurious hotplug events the secondary bus
> reset triggers by utilizing slot's specific reset callback that ignores
> link events.

What do these spurious events look like in dmesg?

> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> The new function introduced here is essentially the same as
> pci_bus_error_reset, except it uses the reset functions that save and
> restore the device. This is the same as before if not resetting a
> hotplug slot.
> 
>  drivers/pci/pci-sysfs.c |  3 +--
>  drivers/pci/pci.c       | 27 +++++++++++++++++++++++++++
>  drivers/pci/pci.h       |  2 +-
>  3 files changed, 29 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
> index 3881359440b1a..5c7c6f0c435f3 100644
> --- a/drivers/pci/pci-sysfs.c
> +++ b/drivers/pci/pci-sysfs.c
> @@ -553,7 +553,6 @@ static ssize_t reset_subordinate_store(struct device *dev,
>  				const char *buf, size_t count)
>  {
>  	struct pci_dev *pdev = to_pci_dev(dev);
> -	struct pci_bus *bus = pdev->subordinate;
>  	unsigned long val;
>  
>  	if (!capable(CAP_SYS_ADMIN))
> @@ -563,7 +562,7 @@ static ssize_t reset_subordinate_store(struct device *dev,
>  		return -EINVAL;
>  
>  	if (val) {
> -		int ret = __pci_reset_bus(bus);
> +		int ret = pci_reset_bridge(pdev);
>  
>  		if (ret)
>  			return ret;
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index b14dd064006cc..ca426ff68c820 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -5747,6 +5747,33 @@ int __pci_reset_bus(struct pci_bus *bus)
>  	return rc;
>  }
>  
> +int pci_reset_bridge(struct pci_dev *bridge)
> +{
> +	struct pci_bus *bus = bridge->subordinate;
> +	struct pci_slot *slot;
> +
> +	if (!bus)
> +		return -ENOTTY;
> +
> +	mutex_lock(&pci_slot_mutex);
> +	if (list_empty(&bus->slots))
> +		goto bus_reset;
> +
> +	list_for_each_entry(slot, &bus->slots, list)
> +		if (pci_probe_reset_slot(slot))
> +			goto bus_reset;
> +
> +	list_for_each_entry(slot, &bus->slots, list)
> +		if (__pci_reset_slot(slot))
> +			goto bus_reset;
> +
> +	mutex_unlock(&pci_slot_mutex);
> +	return 0;
> +bus_reset:
> +	mutex_unlock(&pci_slot_mutex);
> +	return __pci_reset_bus(bus);
> +}
> +
>  /**
>   * pci_reset_bus - Try to reset a PCI bus
>   * @pdev: top level PCI device to reset via slot/bus
> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
> index 36f8c0985430a..f216e7a37d726 100644
> --- a/drivers/pci/pci.h
> +++ b/drivers/pci/pci.h
> @@ -197,7 +197,7 @@ bool pci_reset_supported(struct pci_dev *dev);
>  void pci_init_reset_methods(struct pci_dev *dev);
>  int pci_bridge_secondary_bus_reset(struct pci_dev *dev);
>  int pci_bus_error_reset(struct pci_dev *dev);
> -int __pci_reset_bus(struct pci_bus *bus);
> +int pci_reset_bridge(struct pci_dev *dev);
>  
>  struct pci_cap_saved_data {
>  	u16		cap_nr;
> -- 
> 2.47.3
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pci: make reset_subordinate hotplug safe
  2026-01-14 19:18 ` Bjorn Helgaas
@ 2026-01-14 19:24   ` Keith Busch
  0 siblings, 0 replies; 6+ messages in thread
From: Keith Busch @ 2026-01-14 19:24 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Keith Busch, linux-pci, bhelgaas, Alex Williamson, Lukas Wunner

On Wed, Jan 14, 2026 at 01:18:28PM -0600, Bjorn Helgaas wrote:
> [+cc Alex, Lukas]
> 
> On Wed, Jan 14, 2026 at 10:58:21AM -0800, Keith Busch wrote:
> > From: Keith Busch <kbusch@kernel.org>
> > 
> > Use the slot reset method when resetting the bridge if the bus contains
> > hotplug slots. This fixes spurious hotplug events the secondary bus
> > reset triggers by utilizing slot's specific reset callback that ignores
> > link events.
> 
> What do these spurious events look like in dmesg?

Sure, after starting the reset_subordinate:

 # echo 1 > /sys/bus/pci/devices/0000:00:03.1/reset_subordinate

Kernel dmesg currently show something like this:

  pci 0000:01:03.4: save config 0x30: 0x00000000
  pci 0000:01:03.4: save config 0x34: 0x00000040
  pci 0000:01:03.4: save config 0x38: 0x00000000
  pci 0000:01:03.4: save config 0x3c: 0x000001ff
  pcieport 0000:00:03.1: pciehp: pending interrupts 0x0100 from Slot Status
  pcieport 0000:00:03.1: pciehp: Slot(33): Link Down
  pci 0000:01:03.4: PME# disabled
  pcieport 0000:00:03.1: waiting 100 ms for downstream link, after activation
  pcieport 0000:00:03.1: pciehp: pending interrupts 0x0008 from Slot Status
  pcieport 0000:00:03.1: pciehp: pending interrupts 0x0008 from Slot Status
  pcieport 0000:00:03.1: pciehp: pending interrupts 0x0100 from Slot Status
  pci 0000:01:00.0: disconnected; not waiting
  pci 0000:01:00.0: restore config 0x3c: 0xffffffff -> 0x000001ff

The desirable behavior we'd expect to see instead would inclue this
message:

  pcieport 0000:00:03.1: pciehp: Slot(33): Link Down/Up ignored

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pci: make reset_subordinate hotplug safe
  2026-01-14 18:58 [PATCH] pci: make reset_subordinate hotplug safe Keith Busch
  2026-01-14 19:18 ` Bjorn Helgaas
@ 2026-01-15 10:45 ` kernel test robot
  2026-01-15 11:29 ` kernel test robot
  2026-01-15 17:38 ` kernel test robot
  3 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2026-01-15 10:45 UTC (permalink / raw)
  To: Keith Busch, linux-pci, bhelgaas; +Cc: oe-kbuild-all, Keith Busch

Hi Keith,

kernel test robot noticed the following build warnings:

[auto build test WARNING on pci/next]
[also build test WARNING on pci/for-linus linus/master v6.19-rc5 next-20260115]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Keith-Busch/pci-make-reset_subordinate-hotplug-safe/20260115-030004
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git next
patch link:    https://lore.kernel.org/r/20260114185821.704089-1-kbusch%40meta.com
patch subject: [PATCH] pci: make reset_subordinate hotplug safe
config: alpha-allnoconfig (https://download.01.org/0day-ci/archive/20260115/202601151808.EGC5maN5-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260115/202601151808.EGC5maN5-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601151808.EGC5maN5-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/pci/pci.c:5585:5: warning: no previous prototype for '__pci_reset_bus' [-Wmissing-prototypes]
    5585 | int __pci_reset_bus(struct pci_bus *bus)
         |     ^~~~~~~~~~~~~~~


vim +/__pci_reset_bus +5585 drivers/pci/pci.c

9a3d2b9beefd5b0 Alex Williamson 2013-08-14  5578  
090a3c5322e900f Alex Williamson 2013-08-08  5579  /**
c6a44ba950d147e Sinan Kaya      2018-07-19  5580   * __pci_reset_bus - Try to reset a PCI bus
090a3c5322e900f Alex Williamson 2013-08-08  5581   * @bus: top level PCI bus to reset
090a3c5322e900f Alex Williamson 2013-08-08  5582   *
61cf16d8bd38c3d Alex Williamson 2013-12-16  5583   * Same as above except return -EAGAIN if the bus cannot be locked
090a3c5322e900f Alex Williamson 2013-08-08  5584   */
2fa046449a82a7d Keith Busch     2024-10-25 @5585  int __pci_reset_bus(struct pci_bus *bus)
090a3c5322e900f Alex Williamson 2013-08-08  5586  {
090a3c5322e900f Alex Williamson 2013-08-08  5587  	int rc;
090a3c5322e900f Alex Williamson 2013-08-08  5588  
9bdc81ce440ec6e Amey Narkhede   2021-08-17  5589  	rc = pci_bus_reset(bus, PCI_RESET_PROBE);
090a3c5322e900f Alex Williamson 2013-08-08  5590  	if (rc)
090a3c5322e900f Alex Williamson 2013-08-08  5591  		return rc;
090a3c5322e900f Alex Williamson 2013-08-08  5592  
61cf16d8bd38c3d Alex Williamson 2013-12-16  5593  	if (pci_bus_trylock(bus)) {
ddefc033eecf23f Alex Williamson 2019-02-18  5594  		pci_bus_save_and_disable_locked(bus);
61cf16d8bd38c3d Alex Williamson 2013-12-16  5595  		might_sleep();
381634cad15b711 Sinan Kaya      2018-07-19  5596  		rc = pci_bridge_secondary_bus_reset(bus->self);
ddefc033eecf23f Alex Williamson 2019-02-18  5597  		pci_bus_restore_locked(bus);
61cf16d8bd38c3d Alex Williamson 2013-12-16  5598  		pci_bus_unlock(bus);
61cf16d8bd38c3d Alex Williamson 2013-12-16  5599  	} else
61cf16d8bd38c3d Alex Williamson 2013-12-16  5600  		rc = -EAGAIN;
090a3c5322e900f Alex Williamson 2013-08-08  5601  
090a3c5322e900f Alex Williamson 2013-08-08  5602  	return rc;
090a3c5322e900f Alex Williamson 2013-08-08  5603  }
8dd7f8036c12329 Sheng Yang      2008-10-21  5604  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pci: make reset_subordinate hotplug safe
  2026-01-14 18:58 [PATCH] pci: make reset_subordinate hotplug safe Keith Busch
  2026-01-14 19:18 ` Bjorn Helgaas
  2026-01-15 10:45 ` kernel test robot
@ 2026-01-15 11:29 ` kernel test robot
  2026-01-15 17:38 ` kernel test robot
  3 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2026-01-15 11:29 UTC (permalink / raw)
  To: Keith Busch, linux-pci, bhelgaas; +Cc: llvm, oe-kbuild-all, Keith Busch

Hi Keith,

kernel test robot noticed the following build warnings:

[auto build test WARNING on pci/next]
[also build test WARNING on pci/for-linus linus/master v6.19-rc5 next-20260115]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Keith-Busch/pci-make-reset_subordinate-hotplug-safe/20260115-030004
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git next
patch link:    https://lore.kernel.org/r/20260114185821.704089-1-kbusch%40meta.com
patch subject: [PATCH] pci: make reset_subordinate hotplug safe
config: loongarch-allnoconfig (https://download.01.org/0day-ci/archive/20260115/202601151946.zSD1T6Tn-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 9b8addffa70cee5b2acc5454712d9cf78ce45710)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260115/202601151946.zSD1T6Tn-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601151946.zSD1T6Tn-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/pci/pci.c:5585:5: warning: no previous prototype for function '__pci_reset_bus' [-Wmissing-prototypes]
    5585 | int __pci_reset_bus(struct pci_bus *bus)
         |     ^
   drivers/pci/pci.c:5585:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    5585 | int __pci_reset_bus(struct pci_bus *bus)
         | ^
         | static 
   1 warning generated.


vim +/__pci_reset_bus +5585 drivers/pci/pci.c

9a3d2b9beefd5b0 Alex Williamson 2013-08-14  5578  
090a3c5322e900f Alex Williamson 2013-08-08  5579  /**
c6a44ba950d147e Sinan Kaya      2018-07-19  5580   * __pci_reset_bus - Try to reset a PCI bus
090a3c5322e900f Alex Williamson 2013-08-08  5581   * @bus: top level PCI bus to reset
090a3c5322e900f Alex Williamson 2013-08-08  5582   *
61cf16d8bd38c3d Alex Williamson 2013-12-16  5583   * Same as above except return -EAGAIN if the bus cannot be locked
090a3c5322e900f Alex Williamson 2013-08-08  5584   */
2fa046449a82a7d Keith Busch     2024-10-25 @5585  int __pci_reset_bus(struct pci_bus *bus)
090a3c5322e900f Alex Williamson 2013-08-08  5586  {
090a3c5322e900f Alex Williamson 2013-08-08  5587  	int rc;
090a3c5322e900f Alex Williamson 2013-08-08  5588  
9bdc81ce440ec6e Amey Narkhede   2021-08-17  5589  	rc = pci_bus_reset(bus, PCI_RESET_PROBE);
090a3c5322e900f Alex Williamson 2013-08-08  5590  	if (rc)
090a3c5322e900f Alex Williamson 2013-08-08  5591  		return rc;
090a3c5322e900f Alex Williamson 2013-08-08  5592  
61cf16d8bd38c3d Alex Williamson 2013-12-16  5593  	if (pci_bus_trylock(bus)) {
ddefc033eecf23f Alex Williamson 2019-02-18  5594  		pci_bus_save_and_disable_locked(bus);
61cf16d8bd38c3d Alex Williamson 2013-12-16  5595  		might_sleep();
381634cad15b711 Sinan Kaya      2018-07-19  5596  		rc = pci_bridge_secondary_bus_reset(bus->self);
ddefc033eecf23f Alex Williamson 2019-02-18  5597  		pci_bus_restore_locked(bus);
61cf16d8bd38c3d Alex Williamson 2013-12-16  5598  		pci_bus_unlock(bus);
61cf16d8bd38c3d Alex Williamson 2013-12-16  5599  	} else
61cf16d8bd38c3d Alex Williamson 2013-12-16  5600  		rc = -EAGAIN;
090a3c5322e900f Alex Williamson 2013-08-08  5601  
090a3c5322e900f Alex Williamson 2013-08-08  5602  	return rc;
090a3c5322e900f Alex Williamson 2013-08-08  5603  }
8dd7f8036c12329 Sheng Yang      2008-10-21  5604  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pci: make reset_subordinate hotplug safe
  2026-01-14 18:58 [PATCH] pci: make reset_subordinate hotplug safe Keith Busch
                   ` (2 preceding siblings ...)
  2026-01-15 11:29 ` kernel test robot
@ 2026-01-15 17:38 ` kernel test robot
  3 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2026-01-15 17:38 UTC (permalink / raw)
  To: Keith Busch, linux-pci, bhelgaas; +Cc: oe-kbuild-all, Keith Busch

Hi Keith,

kernel test robot noticed the following build warnings:

[auto build test WARNING on pci/next]
[also build test WARNING on pci/for-linus linus/master v6.19-rc5 next-20260115]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Keith-Busch/pci-make-reset_subordinate-hotplug-safe/20260115-030004
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git next
patch link:    https://lore.kernel.org/r/20260114185821.704089-1-kbusch%40meta.com
patch subject: [PATCH] pci: make reset_subordinate hotplug safe
config: loongarch-randconfig-r112-20260115 (https://download.01.org/0day-ci/archive/20260116/202601160154.HvY4PSd3-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 12.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260116/202601160154.HvY4PSd3-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601160154.HvY4PSd3-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   drivers/pci/pci.c:1155:36: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted pci_power_t [usertype] current_state @@     got int @@
   drivers/pci/pci.c:1155:36: sparse:     expected restricted pci_power_t [usertype] current_state
   drivers/pci/pci.c:1155:36: sparse:     got int
   drivers/pci/pci.c:1334:15: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted pci_power_t [assigned] [usertype] state @@     got int @@
   drivers/pci/pci.c:1334:15: sparse:     expected restricted pci_power_t [assigned] [usertype] state
   drivers/pci/pci.c:1334:15: sparse:     got int
   drivers/pci/pci.c:1336:50: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:1336:69: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:1389:28: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted pci_power_t [usertype] current_state @@     got int @@
   drivers/pci/pci.c:1389:28: sparse:     expected restricted pci_power_t [usertype] current_state
   drivers/pci/pci.c:1389:28: sparse:     got int
   drivers/pci/pci.c:1479:16: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:1479:35: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:1479:52: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:1479:70: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:1504:15: sparse: sparse: invalid assignment: |=
   drivers/pci/pci.c:1504:15: sparse:    left side has type unsigned short
   drivers/pci/pci.c:1504:15: sparse:    right side has type restricted pci_power_t
   drivers/pci/pci.c:1516:28: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted pci_power_t [usertype] current_state @@     got int @@
   drivers/pci/pci.c:1516:28: sparse:     expected restricted pci_power_t [usertype] current_state
   drivers/pci/pci.c:1516:28: sparse:     got int
   drivers/pci/pci.c:1533:13: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:1533:21: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:1535:18: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:1535:26: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:1558:13: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:1558:22: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:1863:38: sparse: sparse: array of flexible structures
   drivers/pci/pci.c:2341:44: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:2660:60: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:2661:30: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:2832:20: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:2832:38: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:2855:49: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:2855:67: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/pci/pci.c:4454:13: sparse: sparse: invalid assignment: |=
   drivers/pci/pci.c:4454:13: sparse:    left side has type unsigned short
   drivers/pci/pci.c:4454:13: sparse:    right side has type restricted pci_power_t
   drivers/pci/pci.c:4459:13: sparse: sparse: invalid assignment: |=
   drivers/pci/pci.c:4459:13: sparse:    left side has type unsigned short
   drivers/pci/pci.c:4459:13: sparse:    right side has type restricted pci_power_t
>> drivers/pci/pci.c:5585:5: sparse: sparse: symbol '__pci_reset_bus' was not declared. Should it be static?
   drivers/pci/pci.c:1110:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted pci_power_t [usertype] @@
   drivers/pci/pci.c:1110:24: sparse:     expected int
   drivers/pci/pci.c:1110:24: sparse:     got restricted pci_power_t [usertype]
   drivers/pci/pci.c:1110:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted pci_power_t [usertype] @@
   drivers/pci/pci.c:1110:24: sparse:     expected int
   drivers/pci/pci.c:1110:24: sparse:     got restricted pci_power_t [usertype]

vim +/__pci_reset_bus +5585 drivers/pci/pci.c

9a3d2b9beefd5b Alex Williamson 2013-08-14  5578  
090a3c5322e900 Alex Williamson 2013-08-08  5579  /**
c6a44ba950d147 Sinan Kaya      2018-07-19  5580   * __pci_reset_bus - Try to reset a PCI bus
090a3c5322e900 Alex Williamson 2013-08-08  5581   * @bus: top level PCI bus to reset
090a3c5322e900 Alex Williamson 2013-08-08  5582   *
61cf16d8bd38c3 Alex Williamson 2013-12-16  5583   * Same as above except return -EAGAIN if the bus cannot be locked
090a3c5322e900 Alex Williamson 2013-08-08  5584   */
2fa046449a82a7 Keith Busch     2024-10-25 @5585  int __pci_reset_bus(struct pci_bus *bus)
090a3c5322e900 Alex Williamson 2013-08-08  5586  {
090a3c5322e900 Alex Williamson 2013-08-08  5587  	int rc;
090a3c5322e900 Alex Williamson 2013-08-08  5588  
9bdc81ce440ec6 Amey Narkhede   2021-08-17  5589  	rc = pci_bus_reset(bus, PCI_RESET_PROBE);
090a3c5322e900 Alex Williamson 2013-08-08  5590  	if (rc)
090a3c5322e900 Alex Williamson 2013-08-08  5591  		return rc;
090a3c5322e900 Alex Williamson 2013-08-08  5592  
61cf16d8bd38c3 Alex Williamson 2013-12-16  5593  	if (pci_bus_trylock(bus)) {
ddefc033eecf23 Alex Williamson 2019-02-18  5594  		pci_bus_save_and_disable_locked(bus);
61cf16d8bd38c3 Alex Williamson 2013-12-16  5595  		might_sleep();
381634cad15b71 Sinan Kaya      2018-07-19  5596  		rc = pci_bridge_secondary_bus_reset(bus->self);
ddefc033eecf23 Alex Williamson 2019-02-18  5597  		pci_bus_restore_locked(bus);
61cf16d8bd38c3 Alex Williamson 2013-12-16  5598  		pci_bus_unlock(bus);
61cf16d8bd38c3 Alex Williamson 2013-12-16  5599  	} else
61cf16d8bd38c3 Alex Williamson 2013-12-16  5600  		rc = -EAGAIN;
090a3c5322e900 Alex Williamson 2013-08-08  5601  
090a3c5322e900 Alex Williamson 2013-08-08  5602  	return rc;
090a3c5322e900 Alex Williamson 2013-08-08  5603  }
8dd7f8036c1232 Sheng Yang      2008-10-21  5604  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-01-15 17:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-14 18:58 [PATCH] pci: make reset_subordinate hotplug safe Keith Busch
2026-01-14 19:18 ` Bjorn Helgaas
2026-01-14 19:24   ` Keith Busch
2026-01-15 10:45 ` kernel test robot
2026-01-15 11:29 ` kernel test robot
2026-01-15 17:38 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox