linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: "Peter Geis" <pgwipeout@gmail.com>,
	"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Heiko Stuebner" <heiko@sntech.de>
Cc: linux-rockchip@lists.infradead.org, Marc Zyngier <maz@kernel.org>,
	linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 2/5] PCI: dwc: rockchip: reset core at driver probe
Date: Mon, 25 Apr 2022 11:20:50 +0200	[thread overview]
Message-ID: <25fbf4763c28af4c73162dec254af6111e05461b.camel@pengutronix.de> (raw)
In-Reply-To: <20220423152403.1681222-3-pgwipeout@gmail.com>

Hi Peter,

On Sa, 2022-04-23 at 11:24 -0400, Peter Geis wrote:
> The PCIe controller is in an unknown state at driver probe. This can
> lead to undesireable effects when the driver attempts to configure the
> controller.
> 
> Prevent issues in the future by resetting the core during probe.
> 
> Signed-off-by: Peter Geis <pgwipeout@gmail.com>
> ---
>  drivers/pci/controller/dwc/pcie-dw-rockchip.c | 22 +++++++------------
>  1 file changed, 8 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> index c9b341e55cbb..d67ed811e752 100644
> --- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> +++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> @@ -152,7 +152,13 @@ static int rockchip_pcie_resource_get(struct platform_device *pdev,
>  	if (IS_ERR(rockchip->rst_gpio))
>  		return PTR_ERR(rockchip->rst_gpio);
> 
> -	return 0;
> +	rockchip->rst = devm_reset_control_array_get_exclusive(&pdev->dev);
> +	if (IS_ERR(rockchip->rst))
> +		return dev_err_probe(&pdev->dev, PTR_ERR(rockchip->rst),
> +				     "failed to get reset lines\n");
> +
> +	return reset_control_assert(rockchip->rst);

This makes "rockchip_pcie_resource_get" a bit of a misnomer, maybe move
this out into rockchip_pcie_probe()?

> +

Superfluous whitespace.

regards
Philipp


  reply	other threads:[~2022-04-25  9:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-23 15:23 [PATCH v8 0/5] Enable rk356x PCIe controller Peter Geis
2022-04-23 15:23 ` [PATCH v8 1/5] dt-bindings: pci: remove fallback from Rockchip DesignWare binding Peter Geis
2022-04-23 15:24 ` [PATCH v8 2/5] PCI: dwc: rockchip: reset core at driver probe Peter Geis
2022-04-25  9:20   ` Philipp Zabel [this message]
2022-04-26 12:17     ` Peter Geis
2022-04-23 15:24 ` [PATCH v8 3/5] PCI: dwc: rockchip: add legacy interrupt support Peter Geis
2022-04-23 15:24 ` [PATCH v8 4/5] arm64: dts: rockchip: add rk3568 pcie2x1 controller Peter Geis
2022-04-23 15:24 ` [PATCH v8 5/5] arm64: dts: rockchip: enable pcie controller on quartz64-a Peter Geis
2022-04-25  1:45 ` [PATCH v8 0/5] Enable rk356x PCIe controller Bjorn Helgaas
2022-04-26 10:46 ` Nicolas Frattaroli

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=25fbf4763c28af4c73162dec254af6111e05461b.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=kw@linux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=maz@kernel.org \
    --cc=pgwipeout@gmail.com \
    --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).