From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Ansuel Smith <ansuelsmth@gmail.com>
Cc: Stanimir Varbanov <svarbanov@mm-sol.com>,
stable@vger.kernel.org, Andy Gross <agross@kernel.org>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Rob Herring <robh@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI: qcom: Make sure PCIe is reset before init for rev 2.1.0
Date: Tue, 1 Sep 2020 11:55:34 -0500 [thread overview]
Message-ID: <20200901165534.GA3715@yoga> (raw)
In-Reply-To: <20200901124955.137-1-ansuelsmth@gmail.com>
On Tue 01 Sep 07:49 CDT 2020, Ansuel Smith wrote:
> Qsdk U-Boot can incorrectly leave the PCIe interface in an undefined
> state if bootm command is used instead of bootipq. This is caused by the
> not deinit of PCIe when bootm is called. Reset the PCIe before init
> anyway to fix this U-Boot bug.
>
Looks sensible.
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Regards,
Bjorn
> Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
> Fixes: 82a823833f4e ("PCI: qcom: Add Qualcomm PCIe controller driver")
> Cc: stable@vger.kernel.org # v4.19+
> ---
> drivers/pci/controller/dwc/pcie-qcom.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> index 3aac77a295ba..82336bbaf8dc 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> @@ -302,6 +302,9 @@ static void qcom_pcie_deinit_2_1_0(struct qcom_pcie *pcie)
> reset_control_assert(res->por_reset);
> reset_control_assert(res->ext_reset);
> reset_control_assert(res->phy_reset);
> +
> + writel(1, pcie->parf + PCIE20_PARF_PHY_CTRL);
> +
> regulator_bulk_disable(ARRAY_SIZE(res->supplies), res->supplies);
> }
>
> @@ -314,6 +317,16 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie)
> u32 val;
> int ret;
>
> + /* reset the PCIe interface as uboot can leave it undefined state */
> + reset_control_assert(res->pci_reset);
> + reset_control_assert(res->axi_reset);
> + reset_control_assert(res->ahb_reset);
> + reset_control_assert(res->por_reset);
> + reset_control_assert(res->ext_reset);
> + reset_control_assert(res->phy_reset);
> +
> + writel(1, pcie->parf + PCIE20_PARF_PHY_CTRL);
> +
> ret = regulator_bulk_enable(ARRAY_SIZE(res->supplies), res->supplies);
> if (ret < 0) {
> dev_err(dev, "cannot enable regulators\n");
> --
> 2.27.0
>
next prev parent reply other threads:[~2020-09-01 16:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-01 12:49 [PATCH] PCI: qcom: Make sure PCIe is reset before init for rev 2.1.0 Ansuel Smith
2020-09-01 14:31 ` Sasha Levin
2020-09-01 16:55 ` Bjorn Andersson [this message]
2020-09-07 11:02 ` 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=20200901165534.GA3715@yoga \
--to=bjorn.andersson@linaro.org \
--cc=agross@kernel.org \
--cc=ansuelsmth@gmail.com \
--cc=bhelgaas@google.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=stable@vger.kernel.org \
--cc=svarbanov@mm-sol.com \
/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).