From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753657Ab3KTBVP (ORCPT ); Tue, 19 Nov 2013 20:21:15 -0500 Received: from mail-ie0-f182.google.com ([209.85.223.182]:54032 "EHLO mail-ie0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752903Ab3KTBVN (ORCPT ); Tue, 19 Nov 2013 20:21:13 -0500 MIME-Version: 1.0 In-Reply-To: <528C0CF9.3020906@huawei.com> References: <20131015024452.GA31951@srcf.ucam.org> <20131016202123.GA17866@google.com> <20131115115235.GA2281@intel.com> <20131119013343.GA17294@google.com> <528AC4F2.40708@huawei.com> <20131119171850.GA4261@google.com> <528C0CF9.3020906@huawei.com> From: Bjorn Helgaas Date: Tue, 19 Nov 2013 18:20:51 -0700 Message-ID: Subject: Re: [3.11.4] Thunderbolt/PCI unplug oops in pci_pme_list_scan To: Yijing Wang Cc: Mika Westerberg , Yinghai Lu , Andreas Noever , Matthew Garrett , "linux-kernel@vger.kernel.org" , "Rafael J. Wysocki" , "linux-pci@vger.kernel.org" , "Kirill A. Shutemov" Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 19, 2013 at 6:14 PM, Yijing Wang wrote: >>>> [bhelgaas: changelog, tag for stable] >>>> Reported-by: David Bulkow >>>> Reported-by: Mika Westerberg >>>> Signed-off-by: Yinghai Lu >>>> Signed-off-by: Bjorn Helgaas >>>> CC: stable@vger.kernel.org # v2.6.32+ >>> >>> Hi Bjorn, >>> This issue in X86 seems to be introduced after commit 928bea9 "PCI: Delay enabling bridges until they're needed" >>> So this patch needs to back port to 2.6.32+ ? >> >> 928bea9 might have made it more visible, but the underlying problem is that >> we enable the device once in the probe path, and disable it twice in the >> remove path. That problem exists in 2.6.32.61: >> >> pcie_portdrv_probe # .probe() method >> pcie_port_device_register >> pci_enable_device <-- enable >> >> pcie_portdrv_remove # .remove() method >> pcie_port_device_remove >> pci_disable_device <-- disable #1 >> pci_disable_device <-- disable #2 > > During assign unassigned resources, we also enable the port device, > > fs_initcall(pcibios_assign_resources); > pci_assign_unassigned_resources; > pci_enable_bridges() > pci_enable_device() > > > So I think before the commit 928bea9 , the pci bridge device enable and disable is symmetrical. > After the commit 928bea9, we only enable bridge once, but still remove twice. The port driver should be symmetrical, regardless of what happens outside it. We have to be able to bind/unbind/bind/unbind indefinitely. Do you think the patch is a problem for current upstream, or are you just saying it doesn't need to be backported as far as 2.6.32? I frankly don't care that much if those old kernels pick it up or not. All I'm saying is that the problem this fixes is present that far back. I'm not really interested in doing a lot more digging about ancient kernels, unless you think it's going to break something if applied to them. Bjorn