From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753500AbbCSLFP (ORCPT ); Thu, 19 Mar 2015 07:05:15 -0400 Received: from v094114.home.net.pl ([79.96.170.134]:59172 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751994AbbCSLFL (ORCPT ); Thu, 19 Mar 2015 07:05:11 -0400 From: "Rafael J. Wysocki" To: Jiang Liu , Bjorn Helgaas Cc: Alex Williamson , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Thomas Hellstrom , "bp @ alien8 . de" , Lv Zheng , "yinghai @ kernel . org" , "lenb @ kernel . org" , LKML , linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org Subject: Re: [Bugfix] x86/PCI: Release PCI IRQ resource only if PCI device is disabled when unbinding Date: Thu, 19 Mar 2015 12:29:06 +0100 Message-ID: <2835680.pSPaYk3eSL@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/3.19.0+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <550A7F8D.90404@linux.intel.com> References: <1426577832-23164-1-git-send-email-jiang.liu@linux.intel.com> <20150318221152.GA2495@google.com> <550A7F8D.90404@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, March 19, 2015 03:49:33 PM Jiang Liu wrote: > On 2015/3/19 6:11, Bjorn Helgaas wrote: > > On Tue, Mar 17, 2015 at 03:37:12PM +0800, Jiang Liu wrote: > >> To support IOAPIC hot-removal, we need to release PCI interrupt resource > >> when unbinding PCI device driver. But due to historical reason, > >> /* > >> * We would love to complain here if pci_dev->is_enabled is set, that > >> * the driver should have called pci_disable_device(), but the > >> * unfortunate fact is there are too many odd BIOS and bridge setups > >> * that don't like drivers doing that all of the time. > >> * Oh well, we can dream of sane hardware when we sleep, no matter how > >> * horrible the crap we have to deal with is when we are awake... > >> */ > > > > Quoting the comment here (especially the last two lines) is overkill and > > obscures the real point. The important thing is that some drivers have > > legitimate reasons for not calling pci_disable_device(). > Hi Bjorn, > Thanks for review. I will rewrite the commit message. > >> some drivers don't call pci_disable_device() when unloading, which > >> prevents us from reallocating PCI interrupt resource on reloading > >> PCI driver and causes regressions. > > > > This isn't very clear. I can believe that "drivers not calling > > pci_disable_device()" means we don't release IRQ resources, which might > > prevent you from hot-removing an IOAPIC. > > > > But "drivers not calling pci_disable_device()" doesn't cause regressions. > > > >> So release PCI interrupt resource only if PCI device is disabled when > >> unbinding. By this way, we could support IOAPIC hot-removal on latest > >> platforms and avoid regressions on old platforms. > > > > Does this mean you can only hot-remove IOAPICs if all drivers for devices > > using the IOAPIC call pci_disable_device()? If so, it seems sort of > > dubious that we have to rely on drivers for that. > This is a quickfix for v4.0 merging window. We will try to solve this > issue for next merging window. If that is the plan, then I'd rather revert the offending commit and try again in the next cycle. Bjorn, what do you think? -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.