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=-16.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 7FCF4C47087 for ; Tue, 25 May 2021 21:18:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 635A561423 for ; Tue, 25 May 2021 21:18:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232488AbhEYVTh (ORCPT ); Tue, 25 May 2021 17:19:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:44690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231881AbhEYVTg (ORCPT ); Tue, 25 May 2021 17:19:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9E2F161429; Tue, 25 May 2021 21:18:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621977485; bh=AeBkEcxQxV+uktorBSzRzGwOfsqEOsQNS87LoS48g/o=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=BdNAAFtFb/I36Xt9VZ9KsOcpDgEalTVg60Yc0tYzgKHVgUWDF/+DLPLan7+AJk1UP p2lHGMAkvcskGGM/v9Cs7F8urRB78Ko6j5VeRTuOr1JkY9MqJUf1jlMNaBpX6cw1hM PaugW+JaQNs/zzrPNH0XChQnmN9CJ116gSrCtht96IuDSWrkPsUvpdtRq1Ap03a2OM 6IjG6bp4cfYGXQHLygUwRwZu9jg0g4msiNG1F1NdFoIc2N2oNFC+2co9kXb9AqIRQM /r1hk7f1kuX5yJOHf3xXMF5GK8dA780+aGzfvxGFJQPfCc3/rlL48tUP+zlf8xVAV1 WkfhhvnJiiUuQ== Date: Tue, 25 May 2021 16:18:04 -0500 From: Bjorn Helgaas To: Jim Quinlan Cc: linux-pci@vger.kernel.org, Bjorn Helgaas , Nicolas Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, james.quinlan@broadcom.com, Nicolas Saenz Julienne , Lorenzo Pieralisi , Rob Herring , Florian Fainelli , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , open list Subject: Re: [PATCH v1 4/4] PCI: brcmstb: add shutdown call to driver Message-ID: <20210525211804.GA1228022@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210427175140.17800-5-jim2101024@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Capitalize "Add" in the subject. On Tue, Apr 27, 2021 at 01:51:39PM -0400, Jim Quinlan wrote: > The shutdown() call is similar to the remove() call except the former does > not need to invoke pci_{stop,remove}_root_bus(), and besides, errors occur > if it does. This doesn't explain why shutdown() is necessary. "errors occur" might be a hint, except that AFAICT, many similar drivers do invoke pci_stop_root_bus() and pci_remove_root_bus() (several of them while holding pci_lock_rescan_remove()), without implementing .shutdown(). It is ... unfortunate that there's such a variety of implementations here. I don't believe these driver differences are all necessary consequences of hardware differences. > Signed-off-by: Jim Quinlan > --- > drivers/pci/controller/pcie-brcmstb.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c > index d3af8d84f0d6..a1fe1a2ada48 100644 > --- a/drivers/pci/controller/pcie-brcmstb.c > +++ b/drivers/pci/controller/pcie-brcmstb.c > @@ -1340,6 +1340,15 @@ static int brcm_pcie_remove(struct platform_device *pdev) > return 0; > } > > +static void brcm_pcie_shutdown(struct platform_device *pdev) > +{ > + struct brcm_pcie *pcie = platform_get_drvdata(pdev); > + > + if (pcie->has_err_report) > + brcm_unregister_die_notifiers(pcie); > + __brcm_pcie_remove(pcie); > +} > + > static const struct of_device_id brcm_pcie_match[] = { > { .compatible = "brcm,bcm2711-pcie", .data = &bcm2711_cfg }, > { .compatible = "brcm,bcm4908-pcie", .data = &bcm4908_cfg }, > @@ -1460,6 +1469,7 @@ static const struct dev_pm_ops brcm_pcie_pm_ops = { > static struct platform_driver brcm_pcie_driver = { > .probe = brcm_pcie_probe, > .remove = brcm_pcie_remove, > + .shutdown = brcm_pcie_shutdown, > .driver = { > .name = "brcm-pcie", > .of_match_table = brcm_pcie_match, > -- > 2.17.1 > 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=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,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 979D7C47086 for ; Tue, 25 May 2021 21:20:29 +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 5E1D26141C for ; Tue, 25 May 2021 21:20:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E1D26141C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=vII66hW4tHkiS6jGrXbVVqjRldqQzfZBCU0oqB5GTw8=; b=vDKW1YEatPlufI OPL8uJYUsjWe7xwPYJUIQ+uS6EBfvz8XHx9hr9TfH3MkUIz6aRhbpFHzlQf+A7tXzuTsPQ/MpKNRH Ste9qK/LLL574hV3azPzJmCHk6ItDxqCLEXLkEFHVnK8MTzYDfKBeZl6V+dxkQkt9nU3U8G8P3jtp dqLD+sUbTa6w3yRZ2MKn2b3rP5Lw3B6j+nrJ3S5viziPHEVNsOBwUV8W6AB/7OaknJM0iLhC1i3Dc JeVz9PZ/JRx0S9YMF4STUpx5jGW/rH/vP7/Kl+2hCpJJmY+/m1Eob5MDarI/d5UC+kQAwuYcfufNO suwYULr0B0vpidRsL/Ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lleRG-008NJT-5r; Tue, 25 May 2021 21:18:10 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lleRC-008NHL-A9; Tue, 25 May 2021 21:18:07 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9E2F161429; Tue, 25 May 2021 21:18:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621977485; bh=AeBkEcxQxV+uktorBSzRzGwOfsqEOsQNS87LoS48g/o=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=BdNAAFtFb/I36Xt9VZ9KsOcpDgEalTVg60Yc0tYzgKHVgUWDF/+DLPLan7+AJk1UP p2lHGMAkvcskGGM/v9Cs7F8urRB78Ko6j5VeRTuOr1JkY9MqJUf1jlMNaBpX6cw1hM PaugW+JaQNs/zzrPNH0XChQnmN9CJ116gSrCtht96IuDSWrkPsUvpdtRq1Ap03a2OM 6IjG6bp4cfYGXQHLygUwRwZu9jg0g4msiNG1F1NdFoIc2N2oNFC+2co9kXb9AqIRQM /r1hk7f1kuX5yJOHf3xXMF5GK8dA780+aGzfvxGFJQPfCc3/rlL48tUP+zlf8xVAV1 WkfhhvnJiiUuQ== Date: Tue, 25 May 2021 16:18:04 -0500 From: Bjorn Helgaas To: Jim Quinlan Cc: linux-pci@vger.kernel.org, Bjorn Helgaas , Nicolas Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, james.quinlan@broadcom.com, Nicolas Saenz Julienne , Lorenzo Pieralisi , Rob Herring , Florian Fainelli , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , open list Subject: Re: [PATCH v1 4/4] PCI: brcmstb: add shutdown call to driver Message-ID: <20210525211804.GA1228022@bjorn-Precision-5520> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210427175140.17800-5-jim2101024@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210525_141806_403167_70749D4D X-CRM114-Status: GOOD ( 21.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Capitalize "Add" in the subject. On Tue, Apr 27, 2021 at 01:51:39PM -0400, Jim Quinlan wrote: > The shutdown() call is similar to the remove() call except the former does > not need to invoke pci_{stop,remove}_root_bus(), and besides, errors occur > if it does. This doesn't explain why shutdown() is necessary. "errors occur" might be a hint, except that AFAICT, many similar drivers do invoke pci_stop_root_bus() and pci_remove_root_bus() (several of them while holding pci_lock_rescan_remove()), without implementing .shutdown(). It is ... unfortunate that there's such a variety of implementations here. I don't believe these driver differences are all necessary consequences of hardware differences. > Signed-off-by: Jim Quinlan > --- > drivers/pci/controller/pcie-brcmstb.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c > index d3af8d84f0d6..a1fe1a2ada48 100644 > --- a/drivers/pci/controller/pcie-brcmstb.c > +++ b/drivers/pci/controller/pcie-brcmstb.c > @@ -1340,6 +1340,15 @@ static int brcm_pcie_remove(struct platform_device *pdev) > return 0; > } > > +static void brcm_pcie_shutdown(struct platform_device *pdev) > +{ > + struct brcm_pcie *pcie = platform_get_drvdata(pdev); > + > + if (pcie->has_err_report) > + brcm_unregister_die_notifiers(pcie); > + __brcm_pcie_remove(pcie); > +} > + > static const struct of_device_id brcm_pcie_match[] = { > { .compatible = "brcm,bcm2711-pcie", .data = &bcm2711_cfg }, > { .compatible = "brcm,bcm4908-pcie", .data = &bcm4908_cfg }, > @@ -1460,6 +1469,7 @@ static const struct dev_pm_ops brcm_pcie_pm_ops = { > static struct platform_driver brcm_pcie_driver = { > .probe = brcm_pcie_probe, > .remove = brcm_pcie_remove, > + .shutdown = brcm_pcie_shutdown, > .driver = { > .name = "brcm-pcie", > .of_match_table = brcm_pcie_match, > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel