Re: [PATCH 03/32] PCI: pciehp: Fix deadlock on unplug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lukas,

On Sat, Jun 16, 2018 at 09:25:00PM +0200, Lukas Wunner wrote:
> When pciehp was conceived it apparently wasn't considered that one
> hotplug port may be the parent of another, but with Thunderbolt this is
> par for the course.
> 
> If the sysfs interface is used to initiate a simultaneous card removal
> of two hotplug ports where one is a parent of the other, or if the two
> ports simultaneously signal interrupts, e.g. because a link or presence
> change was detected on both, a deadlock may occur if:
> 
> - The parent acquires pci_lock_rescan_remove(), starts removal of the
>   child and waits for it to be unbound.
> - The child waits to acquire pci_lock_rescan_remove() in order to
>   service the pending sysfs command or interrupt before it can unbind.
> 
> Fix by using pci_dev_is_disconnected() as an indicator whether a parent
> is removing the child, and avoid acquiring the lock in the child if so.
> Should the child happen to acquire the lock first, there's no deadlock.

This patch got dropped from your pciehp series but I wonder if you have
any plans to re-send it or rework it?

I'm asking because this is pretty real issue if you have longer chains
of devices and I've been using this patch to make the issue go away. So
even if this is not solving all possible problems, I think it may be
good idea to get included.



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux