linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Jim Quinlan <jim2101024@gmail.com>
Cc: linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
	Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
	bcm-kernel-feedback-list@broadcom.com,
	james.quinlan@broadcom.com,
	Nicolas Saenz Julienne <nsaenz@kernel.org>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Rob Herring <robh@kernel.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" 
	<linux-rpi-kernel@lists.infradead.org>,
	"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" 
	<linux-arm-kernel@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 4/4] PCI: brcmstb: add shutdown call to driver
Date: Tue, 25 May 2021 16:18:04 -0500	[thread overview]
Message-ID: <20210525211804.GA1228022@bjorn-Precision-5520> (raw)
In-Reply-To: <20210427175140.17800-5-jim2101024@gmail.com>

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 <jim2101024@gmail.com>
> ---
>  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
> 

  parent reply	other threads:[~2021-05-25 21:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27 17:51 [PATCH v1 0/4] PCI: brcmstb: Add panic handler and shutdown func Jim Quinlan
2021-04-27 17:51 ` [PATCH v1 1/4] PCI: brcmstb: Check return value of clk_prepare_enable() Jim Quinlan
2021-04-27 17:51 ` [PATCH v1 2/4] PCI: brcmstb: Give 7216 SOCs their own config type Jim Quinlan
2021-04-27 17:51 ` [PATCH v1 3/4] PCI: brcmstb: Add panic/die handler to RC driver Jim Quinlan
2021-05-25 20:40   ` Bjorn Helgaas
2021-05-25 21:05     ` Jim Quinlan
2021-05-25 21:17       ` Bjorn Helgaas
2021-04-27 17:51 ` [PATCH v1 4/4] PCI: brcmstb: add shutdown call to driver Jim Quinlan
2021-04-27 19:35   ` Florian Fainelli
2021-05-25 21:18   ` Bjorn Helgaas [this message]
2021-05-25 21:40     ` Jim Quinlan
2021-05-26 16:11     ` Rob Herring
2021-05-26 17:03     ` Florian Fainelli
2021-06-03 17:23       ` Bjorn Helgaas
2021-06-03 17:30         ` Florian Fainelli
2021-06-03 20:58           ` Bjorn Helgaas
2021-06-03 21:01             ` Florian Fainelli
2021-05-25 18:01 ` [PATCH v1 0/4] PCI: brcmstb: Add panic handler and shutdown func Florian Fainelli
2021-06-03 16:32 ` Lorenzo Pieralisi
2021-06-03 17:31   ` Jim Quinlan
2021-06-04  9:22     ` Lorenzo Pieralisi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210525211804.GA1228022@bjorn-Precision-5520 \
    --to=helgaas@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bhelgaas@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=james.quinlan@broadcom.com \
    --cc=jim2101024@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=nsaenz@kernel.org \
    --cc=nsaenzjulienne@suse.de \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).