Re: [PATCH v2 2/2] PCI: pciehp: Prevent deadlock on disconnect

2019-10-23 Thread Mika Westerberg
On Tue, Oct 22, 2019 at 06:00:06PM -0500, Bjorn Helgaas wrote: > On Mon, Aug 12, 2019 at 05:31:33PM +0300, Mika Westerberg wrote: > > If there are more than one PCIe switch with hotplug downstream ports > > hot-removing them leads to a following deadlock: > > > > INFO: task irq/126-pciehp:198 blo

Re: [PATCH v2 2/2] PCI: pciehp: Prevent deadlock on disconnect

2019-10-22 Thread Bjorn Helgaas
On Mon, Aug 12, 2019 at 05:31:33PM +0300, Mika Westerberg wrote: > If there are more than one PCIe switch with hotplug downstream ports > hot-removing them leads to a following deadlock: > > INFO: task irq/126-pciehp:198 blocked for more than 120 seconds. > "echo 0 > /proc/sys/kernel/hung_task_t

Re: [PATCH v2 2/2] PCI: pciehp: Prevent deadlock on disconnect

2019-10-18 Thread Kai-Heng Feng
Hi Mika, > On Sep 23, 2019, at 16:28, Mika Westerberg > wrote: > > On Mon, Sep 23, 2019 at 11:12:42AM +0300, Mika Westerberg wrote: >> Regarding suggestion of unbinding PCI drivers without >> pci_lock_rescan_remove() hold, I haven't looked it too closely but I >> think we need to take that lock

Re: [PATCH v2 2/2] PCI: pciehp: Prevent deadlock on disconnect

2019-09-23 Thread Mika Westerberg
On Mon, Sep 23, 2019 at 11:12:42AM +0300, Mika Westerberg wrote: > Regarding suggestion of unbinding PCI drivers without > pci_lock_rescan_remove() hold, I haven't looked it too closely but I > think we need to take that lock anyway because when we are unbinding a > hotplug driver it is supposed to

Re: [PATCH v2 2/2] PCI: pciehp: Prevent deadlock on disconnect

2019-09-23 Thread Lukas Wunner
On Mon, Sep 23, 2019 at 11:12:37AM +0300, Mika Westerberg wrote: > Regarding suggestion of unbinding PCI drivers without > pci_lock_rescan_remove() hold, I haven't looked it too closely but I > think we need to take that lock anyway because when we are unbinding a > hotplug driver it is supposed to

Re: [PATCH v2 2/2] PCI: pciehp: Prevent deadlock on disconnect

2019-09-23 Thread Mika Westerberg
Hi Lukas, On Mon, Sep 23, 2019 at 07:34:03AM +0200, Lukas Wunner wrote: > On Mon, Aug 12, 2019 at 05:31:33PM +0300, Mika Westerberg wrote: > > If there are more than one PCIe switch with hotplug downstream ports > > hot-removing them leads to a following deadlock: > > For the record, I think my c

Re: [PATCH v2 2/2] PCI: pciehp: Prevent deadlock on disconnect

2019-09-22 Thread Lukas Wunner
On Mon, Aug 12, 2019 at 05:31:33PM +0300, Mika Westerberg wrote: > If there are more than one PCIe switch with hotplug downstream ports > hot-removing them leads to a following deadlock: For the record, I think my comments on v1 of this patch still apply: https://patchwork.ozlabs.org/patch/111787

Re: [PATCH v2 2/2] PCI: pciehp: Prevent deadlock on disconnect

2019-08-19 Thread Sinan Kaya
On 8/19/2019 4:56 AM, Mika Westerberg wrote: >> There are PCI controllers that won't report presence detect correctly, >> but still report link active. > If that's the case then pciehp_card_present() returns false so we call > pciehp_check_link_active() which should work with those controllers. >

Re: [PATCH v2 2/2] PCI: pciehp: Prevent deadlock on disconnect

2019-08-19 Thread Mika Westerberg
On Sun, Aug 18, 2019 at 10:28:13PM -0400, Sinan Kaya wrote: > On 8/12/2019 10:31 AM, Mika Westerberg wrote: > > +int pciehp_card_present_or_link_active(struct controller *ctrl) > > { > > - return pciehp_card_present(ctrl) || pciehp_check_link_active(ctrl); > > + int ret; > > + > > + ret = pc

Re: [PATCH v2 2/2] PCI: pciehp: Prevent deadlock on disconnect

2019-08-18 Thread Sinan Kaya
On 8/12/2019 10:31 AM, Mika Westerberg wrote: > +int pciehp_card_present_or_link_active(struct controller *ctrl) > { > - return pciehp_card_present(ctrl) || pciehp_check_link_active(ctrl); > + int ret; > + > + ret = pciehp_card_present(ctrl); > + if (ret) > + return ret

[PATCH v2 2/2] PCI: pciehp: Prevent deadlock on disconnect

2019-08-12 Thread Mika Westerberg
If there are more than one PCIe switch with hotplug downstream ports hot-removing them leads to a following deadlock: INFO: task irq/126-pciehp:198 blocked for more than 120 seconds. "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. irq/126-pciehp D0 198 2 0x