From: Marc Gonzalez <marc.w.gonzalez@free.fr>
To: Niklas Cassel <niklas.cassel@linaro.org>,
Stanimir Varbanov <svarbanov@mm-sol.com>,
Andy Gross <agross@kernel.org>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Bjorn Helgaas <bhelgaas@google.com>
Cc: PCI <linux-pci@vger.kernel.org>,
MSM <linux-arm-msm@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] PCI: qcom: Ensure that PERST is asserted for at least 100 ms
Date: Fri, 24 May 2019 14:43:00 +0200 [thread overview]
Message-ID: <5d743969-e763-95c5-6763-171a8ecf66d8@free.fr> (raw)
In-Reply-To: <20190523194409.17718-1-niklas.cassel@linaro.org>
On 23/05/2019 21:44, Niklas Cassel wrote:
> Currently, there is only a 1 ms sleep after asserting PERST.
>
> Reading the datasheets for different endpoints, some require PERST to be
> asserted for 10 ms in order for the endpoint to perform a reset, others
> require it to be asserted for 50 ms.
>
> Several SoCs using this driver uses PCIe Mini Card, where we don't know
> what endpoint will be plugged in.
>
> The PCI Express Card Electromechanical Specification specifies:
> "On power up, the deassertion of PERST# is delayed 100 ms (TPVPERL) from
> the power rails achieving specified operating limits."
>
> Add a sleep of 100 ms before deasserting PERST, in order to ensure that
> we are compliant with the spec.
>
> Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
> ---
> drivers/pci/controller/dwc/pcie-qcom.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> index 0ed235d560e3..cae24376237c 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> @@ -1110,6 +1110,8 @@ static int qcom_pcie_host_init(struct pcie_port *pp)
> if (IS_ENABLED(CONFIG_PCI_MSI))
> dw_pcie_msi_init(pp);
>
> + /* Ensure that PERST has been asserted for at least 100 ms */
> + msleep(100);
> qcom_ep_reset_deassert(pcie);
>
> ret = qcom_pcie_establish_link(pcie);
Currently, qcom_ep_reset_assert() and qcom_ep_reset_deassert() both include
a call to usleep_range() of 1.0 to 1.5 ms
Can we git rid of both if we sleep 100 ms before qcom_ep_reset_deassert?
Should the msleep() call be included in one of the two wrappers?
Regards.
next prev parent reply other threads:[~2019-05-24 12:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-23 19:44 [PATCH] PCI: qcom: Ensure that PERST is asserted for at least 100 ms Niklas Cassel
2019-05-24 12:43 ` Marc Gonzalez [this message]
2019-05-27 17:15 ` Niklas Cassel
2019-05-28 20:36 ` Stanimir Varbanov
2019-05-26 5:49 ` Bjorn Andersson
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=5d743969-e763-95c5-6763-171a8ecf66d8@free.fr \
--to=marc.w.gonzalez@free.fr \
--cc=agross@kernel.org \
--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=niklas.cassel@linaro.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