[PATCH 0/3] PCI: Locking related improvements

Ilpo Järvinen posted 3 patches 3 weeks, 1 day ago
drivers/pci/pci.c | 120 ++++++++++++++++++++++++----------------------
1 file changed, 63 insertions(+), 57 deletions(-)
[PATCH 0/3] PCI: Locking related improvements
Posted by Ilpo Järvinen 3 weeks, 1 day ago
Hi all,

Here are a few locking related coding quality improvements, none of
them aims to introduce any function changes. First two convert "must be
asserted" comments into lockdep asserts for easier detection of
violations. The last patch consolidates almost duplicated code in the
bus/slot locking function.

This series based is based on top of the fix (the last change would
obviously conflict with it):

https://patchwork.kernel.org/project/linux-pci/patch/20251212145528.2555-1-guojinhui.liam@bytedance.com/


Ilpo Järvinen (3):
  PCI: Use lockdep_assert_held(pci_bus_sem) to verify lock is held
  PCI: Use device_lock_assert() to verify device lock is held
  PCI: Consolidate pci_bus/slot_lock/unlock/trylock()

 drivers/pci/pci.c | 120 ++++++++++++++++++++++++----------------------
 1 file changed, 63 insertions(+), 57 deletions(-)


base-commit: 270f0a8620a2d8fac3bcab3779df782d85b3b4bf
-- 
2.39.5

Re: [PATCH 0/3] PCI: Locking related improvements
Posted by Bjorn Helgaas 17 hours ago
On Fri, Jan 16, 2026 at 02:57:39PM +0200, Ilpo Järvinen wrote:
> Hi all,
> 
> Here are a few locking related coding quality improvements, none of
> them aims to introduce any function changes. First two convert "must be
> asserted" comments into lockdep asserts for easier detection of
> violations. The last patch consolidates almost duplicated code in the
> bus/slot locking function.
> 
> This series based is based on top of the fix (the last change would
> obviously conflict with it):
> 
> https://patchwork.kernel.org/project/linux-pci/patch/20251212145528.2555-1-guojinhui.liam@bytedance.com/
> 
> 
> Ilpo Järvinen (3):
>   PCI: Use lockdep_assert_held(pci_bus_sem) to verify lock is held
>   PCI: Use device_lock_assert() to verify device lock is held
>   PCI: Consolidate pci_bus/slot_lock/unlock/trylock()
> 
>  drivers/pci/pci.c | 120 ++++++++++++++++++++++++----------------------
>  1 file changed, 63 insertions(+), 57 deletions(-)

Applied the first two to pci/virtualization along with the other reset
changes for v6.20, thanks!

The last is a great idea but will need some rebase/rework on top of
Keith's changes.
Re: [PATCH 0/3] PCI: Locking related improvements
Posted by Ilpo Järvinen 3 weeks, 1 day ago
On Fri, 16 Jan 2026, Ilpo Järvinen wrote:

> Hi all,
> 
> Here are a few locking related coding quality improvements, none of
> them aims to introduce any function changes. First two convert "must be

s/function change/functional change/

--
 i.

> asserted" comments into lockdep asserts for easier detection of
> violations. The last patch consolidates almost duplicated code in the
> bus/slot locking function.
> 
> This series based is based on top of the fix (the last change would
> obviously conflict with it):
> 
> https://patchwork.kernel.org/project/linux-pci/patch/20251212145528.2555-1-guojinhui.liam@bytedance.com/
> 
> 
> Ilpo Järvinen (3):
>   PCI: Use lockdep_assert_held(pci_bus_sem) to verify lock is held
>   PCI: Use device_lock_assert() to verify device lock is held
>   PCI: Consolidate pci_bus/slot_lock/unlock/trylock()
> 
>  drivers/pci/pci.c | 120 ++++++++++++++++++++++++----------------------
>  1 file changed, 63 insertions(+), 57 deletions(-)
> 
> 
> base-commit: 270f0a8620a2d8fac3bcab3779df782d85b3b4bf
>