From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 In-Reply-To: References: <1332135996-13860-1-git-send-email-yinghai@kernel.org> <1332135996-13860-41-git-send-email-yinghai@kernel.org> <4F7F10C5.1050901@gmail.com> From: Bjorn Helgaas Date: Fri, 6 Apr 2012 10:07:03 -0600 Message-ID: Subject: Re: [PATCH -v3 40/47] PCI: Add pci bus removal through /sys/.../pci_bus/.../remove To: Yinghai Lu Cc: Jiang Liu , Jesse Barnes , x86 , Andrew Morton , Linus Torvalds , Greg Kroah-Hartman , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Randy Dunlap , linux-doc@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: On Fri, Apr 6, 2012 at 10:01 AM, Yinghai Lu wrote: > On Fri, Apr 6, 2012 at 8:50 AM, Jiang Liu wrote: >> Hi Yinghai, >>        I found many other drivers assume that a pci bus won't disappear if >> the corresponding PCI bridge device still exists. The sysfs interface proposed >> here breaks that assumption and may cause many access-after-free issues. >> So what's the purpose of this interface? Should we remove this interface or >> enhance other drivers to avoid invalid memory access issues? Can you point out some of the specifics about drivers making this assumption? I'm not thrilled about the idea of removing a pci_bus while the upstream bridge pci_dev still exists either. > ok, will make it only show up on root bus. OK. I'm still interested in the specifics because I don't like the way the pci_bus is exposed, even inside the kernel. The bus itself is not an active entity, and we can't really do anything with it except by touching a device connected to it. Bjorn