From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04A42C43381 for ; Wed, 13 Mar 2019 11:31:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C80372147C for ; Wed, 13 Mar 2019 11:31:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PngphMcM"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Dy4izkK8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="EWmTK3JK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C80372147C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bbRKp/Irqkyy4v4b330cLeSn2jRSOL0IoSfKrYrc+AE=; b=PngphMcMpQ83Ah QPYN9EeQBKAnGV5pmInCdIK2xFKr6Mkuo0FikT3D5rWw4UQZR2wJmZEVxxi+0CsEWQfaXgm7ej1pu Mr7r2cck87TzTeXCbyUog1jNhznALj4E8RUQps1VU2EfK04vzhpUAzAoMx2xdpZ0UAj18EpmKGvnJ sKc9G3o1n+G9ElJ73QWbA7DKgG6nKI/CGHg54ys6MRJNWXWuj9dPkdNFIdL88zkmgyILRnmu2UreK 3K/xgpUCBFEzLS++3TTvNwhs8DdMQACRlsnzMZLn//O2QyGKDC7GOzPovW58+4nMQAQU/il9Ga/xA XvKMchu92CtlnCQGIZgg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h426F-0000D4-Vn; Wed, 13 Mar 2019 11:31:07 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h4267-0008SO-8X for linux-arm-kernel@bombadil.infradead.org; Wed, 13 Mar 2019 11:30:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:CC:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=pmXsP3+6D66jVVY6Tsu2xHDdAyPuADr3f4W1TlG/2EA=; b=Dy4izkK8i9wHtcRXssNElkj1w6 oBsEy6cIwHf5OsMgiE75xdAzQbBluSbh74rM8GGjkg8Z9+9a4JPWiEu5JzgLLoWf0z1a6FNW6iBxD ozuuO07F8mM+zXeMINrB+a4ZwSgXsJjMYXmZD6ier/dje10B0aWGSUhe7Jt5wMe9B2nFpWuUDv1Jr /E55UHYUNVdG34Sp3WhsrGJHdLADocqdMzsV+tsQa2m4iARm2DNKL/3t2k3BaMKcSXlzOR2kRM2VD d0xBxEW5KbFLI70gQqlXK8kNNzPj4ZccmxNU09tz/2VaCOv/1G9fQmCZrrbd1WOIHhsPBcJ+PNte6 W+Fuz7GQ==; Received: from smtprelay2.synopsys.com ([198.182.60.111] helo=smtprelay.synopsys.com) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h41CQ-0000Sx-4g for linux-arm-kernel@lists.infradead.org; Wed, 13 Mar 2019 10:33:27 +0000 Received: from mailhost.synopsys.com (dc8-mailhost1.synopsys.com [10.13.135.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtprelay.synopsys.com (Postfix) with ESMTPS id 78D0910C25F8; Wed, 13 Mar 2019 03:33:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1552473202; bh=hZJ5siwkYRrtUpNGM0+G4sTCKZ5j4X5UCoWae5UxQSc=; h=Subject:To:CC:References:From:Date:In-Reply-To:From; b=EWmTK3JKGjwRNGp6X0Ds6sNMmZbR5RQDPGWm/eSKS4UJwjuL28hWnCQGg+d0hEEeF 5d0LBarwh/MJH0/NB18fhWjMtnV9xjvNSLLnUh6Q8zki2T/6RvBG8w7O8SYIX4ECc4 smZZogV20n3Oor+FR0nl5gvVfbRzyS5vWLGtaXzihEgseheY/j3MxctXjvvWoDtlFA ZZTcXhhc4Kd9UyD5zIolXuLiew3dQ4ab54jRhKuLy+GevLQTzRCqlXYC39XNqFoAgc 58xZWdaJjrqMYiyyPBvbPB4XZFGBikyD7PrpD9oIBEevtVWjmFuMpdz3M0z/ivat03 lTvb2AvRu7MHA== Received: from US01WXQAHTC1.internal.synopsys.com (us01wxqahtc1.internal.synopsys.com [10.12.238.230]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPS id 51451A0087; Wed, 13 Mar 2019 10:33:22 +0000 (UTC) Received: from DE02WEHTCB.internal.synopsys.com (10.225.19.94) by US01WXQAHTC1.internal.synopsys.com (10.12.238.230) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 13 Mar 2019 03:33:17 -0700 Received: from DE02WEHTCA.internal.synopsys.com (10.225.19.92) by DE02WEHTCB.internal.synopsys.com (10.225.19.94) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 13 Mar 2019 11:33:15 +0100 Received: from [10.107.19.55] (10.107.19.55) by DE02WEHTCA.internal.synopsys.com (10.225.19.80) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 13 Mar 2019 11:33:15 +0100 Subject: Re: [PATCH v2 5/5] PCI: dwc: Save root bus for driver remove To: Jisheng Zhang , Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , Bjorn Helgaas References: <20190301125510.4e2ee985@xhacker.debian> <20190301125943.47adae82@xhacker.debian> From: Gustavo Pimentel Message-ID: <962065dc-6e9d-d481-ca56-a2045ca7fef0@synopsys.com> Date: Wed, 13 Mar 2019 10:33:13 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20190301125943.47adae82@xhacker.debian> Content-Language: en-US X-Originating-IP: [10.107.19.55] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190313_063326_413540_641E0391 X-CRM114-Status: GOOD ( 17.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On 01/03/2019 05:06, Jisheng Zhang wrote: > Currently dwc host doesn't support the remove, but nothing prevent us > from supporting it. Save the root bus for clean up work in driver > remove code path. > > After this patch, the dwc host users could implement its remove as: > > static int foo_pcie_remove(struct platform_device *pdev) > { > ... > pci_stop_root_bus(pp->root_bus); > pci_remove_root_bus(pp->root_bus); > dw_pcie_free_msi(pp); > ... > } > > Signed-off-by: Jisheng Zhang > --- > drivers/pci/controller/dwc/pcie-designware-host.c | 1 + > drivers/pci/controller/dwc/pcie-designware.h | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c > index 4831c12fee93..ca45a4471ca0 100644 > --- a/drivers/pci/controller/dwc/pcie-designware-host.c > +++ b/drivers/pci/controller/dwc/pcie-designware-host.c > @@ -496,6 +496,7 @@ int dw_pcie_host_init(struct pcie_port *pp) > goto err_free_msi; > > bus = bridge->bus; > + pp->root_bus = bus; Why you don't use from the begging the pp->root_bus variable instead of bus variable? That way we can remove the bus variable. Regards, Gustavo > > if (pp->ops->scan_bus) > pp->ops->scan_bus(pp); > diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h > index 3be7ca9f1fc3..cd92ded606c6 100644 > --- a/drivers/pci/controller/dwc/pcie-designware.h > +++ b/drivers/pci/controller/dwc/pcie-designware.h > @@ -182,6 +182,7 @@ struct pcie_port { > struct page *msi_page; > u32 num_vectors; > u32 irq_mask[MAX_MSI_CTRLS]; > + struct pci_bus *root_bus; > raw_spinlock_t lock; > DECLARE_BITMAP(msi_irq_in_use, MAX_MSI_IRQS); > }; > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel