From patchwork Wed Jan 8 23:41:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 3456721 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BF0C89F2E9 for ; Wed, 8 Jan 2014 23:41:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F084920171 for ; Wed, 8 Jan 2014 23:41:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 229482012F for ; Wed, 8 Jan 2014 23:41:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757734AbaAHXlz (ORCPT ); Wed, 8 Jan 2014 18:41:55 -0500 Received: from mail-ig0-f182.google.com ([209.85.213.182]:58630 "EHLO mail-ig0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757624AbaAHXlx (ORCPT ); Wed, 8 Jan 2014 18:41:53 -0500 Received: by mail-ig0-f182.google.com with SMTP id c10so6043250igq.3 for ; Wed, 08 Jan 2014 15:41:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=gxym7GOlK8PXsAPYaApm+pnuGGH2WoQWiTjGMr0/BUo=; b=x3TOQXWdOOMIZ0mDaX7rzTp1nfYtjM1GstvgO0hyYHBJWoQXyrNSDJLlPmjt4SQcBw t64I1y+j4it2wZPQYTh07u0weaR9bN9OJBmI888CR1ph4gcToM7YYNSVgLPDuWiVaUtg 2vz+GFoK4XaotzfKX25jMR6v7ZFdIEy0shoKak+KBy2HjS4O136ftFwL6NPLof2xQIhX 4Qm6iKhC9lmWNAUr+gnEkpD84UV6Fb1buKlInPdSJAhvy68RoVNrV4VXoFYlVXH0VQOd on6FVTBv4il/Hgr3hrHQoAfxwXQqI9NDPA5wdUsgamgukZW1UkhPV2RG9dVfOaxU+fDO Pbbg== MIME-Version: 1.0 X-Received: by 10.50.67.180 with SMTP id o20mr24229582igt.43.1389224512986; Wed, 08 Jan 2014 15:41:52 -0800 (PST) Received: by 10.64.235.70 with HTTP; Wed, 8 Jan 2014 15:41:52 -0800 (PST) In-Reply-To: <4679785.iPCX7mECEL@vostro.rjw.lan> References: <37552283.kG1L4S8Daa@vostro.rjw.lan> <2459491.HIKjAnF27k@vostro.rjw.lan> <4679785.iPCX7mECEL@vostro.rjw.lan> Date: Wed, 8 Jan 2014 15:41:52 -0800 X-Google-Sender-Auth: KJyq8wJUaWiTdh8ULpgihkNJgyA Message-ID: Subject: Re: [PATCH][tentative] PCI / ACPI: Rework PCI host bridge removal to avoid sysfs warnings From: Yinghai Lu To: "Rafael J. Wysocki" Cc: Bjorn Helgaas , Greg Kroah-Hartman , Linux PCI , ACPI Devel Maling List , LKML , Yasuaki Ishimatsu , Tejun Heo Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Jan 6, 2014 at 12:41 PM, Rafael J. Wysocki wrote: >> Not sure how that could happen. >> >> If it would really happen, we could set dev->match_driver to 0 in pci_stop_dev. > > Simply, run "modprobe -r driver && modprobe driver" in a loop and > remove the PCI host bridge the given device is on in parallel to that. Chances > are, you'll see some nice breakage. I would suggest using match_driver prevent driver from attaching again. --- drivers/pci/remove.c | 1 + 1 file changed, 1 insertion(+) > > Also what happens if somebody uses the "remove" sysfs attribute on a device > needed by ioapic/dmar? Good question, we will have problem in that case. To make it simple, we may hide the "remove" in sysfs for ioapic pci device ? Thanks Yinghai -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/drivers/pci/remove.c =================================================================== --- linux-2.6.orig/drivers/pci/remove.c +++ linux-2.6/drivers/pci/remove.c @@ -11,6 +11,7 @@ static void pci_stop_dev(struct pci_dev pci_proc_detach_device(dev); pci_remove_sysfs_dev_files(dev); device_release_driver(&dev->dev); + dev->match_driver = false; dev->is_added = 0; }