From: "Pali Rohár" <pali@kernel.org>
To: qizhong cheng <qizhong.cheng@mediatek.com>
Cc: "Ryder Lee" <ryder.lee@mediatek.com>,
"Jianjun Wang" <jianjun.wang@mediatek.com>,
"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
"Krzysztof Wilczyiński" <kw@linux.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
"Chuanjia Liu" <chuanjia.liu@mediatek.com>,
"Jiey Yang" <ot_jiey.yang@mediatek.com>
Subject: Re: [PATCH] PCI: mediatek: Delay 100ms to wait power and clock to become stable
Date: Thu, 4 Nov 2021 12:41:08 +0100 [thread overview]
Message-ID: <20211104114108.mvhm5nhbc7hn2yld@pali> (raw)
In-Reply-To: <20211104062144.31453-1-qizhong.cheng@mediatek.com>
On Thursday 04 November 2021 14:21:44 qizhong cheng wrote:
> Described in PCIe CEM specification setctions 2.2 (PERST# Signal) and
> 2.2.1 (Initial Power-Up (G3 to S0)). The deassertion of PERST# should
> be delayed 100ms (TPVPERL) for the power and clock to become stable.
>
> Signed-off-by: qizhong cheng <qizhong.cheng@mediatek.com>
Acked-by: Pali Rohár <pali@kernel.org>
> ---
> drivers/pci/controller/pcie-mediatek.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c
> index 2f3f974977a3..b32acbac8084 100644
> --- a/drivers/pci/controller/pcie-mediatek.c
> +++ b/drivers/pci/controller/pcie-mediatek.c
> @@ -702,6 +702,14 @@ static int mtk_pcie_startup_port_v2(struct mtk_pcie_port *port)
> */
> writel(PCIE_LINKDOWN_RST_EN, port->base + PCIE_RST_CTRL);
>
> + /*
> + * Described in PCIe CEM specification setctions 2.2 (PERST# Signal)
> + * and 2.2.1 (Initial Power-Up (G3 to S0)).
> + * The deassertion of PERST# should be delayed 100ms (TPVPERL)
> + * for the power and clock to become stable.
> + */
> + msleep(100);
> +
I guess that this change is fixing detection of some PCIe cards, right?
This ad-hoc driver change is really required as kernel pci code does not
contain this delay functionality.
Note that this delay is required in every native pci controller driver
(not only mediatek), otherwise some PCIe cards may not be detected.
For future direction, some more general solution for these issues is
needed. I proposed something in following email:
https://lore.kernel.org/linux-pci/20211022183808.jdeo7vntnagqkg7g@pali/
If you have a time, I would like to hear some feedback...
> /* De-assert PHY, PE, PIPE, MAC and configuration reset */
> val = readl(port->base + PCIE_RST_CTRL);
> val |= PCIE_PHY_RSTB | PCIE_PERSTB | PCIE_PIPE_SRSTB |
> --
> 2.25.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-11-04 11:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-04 6:21 [PATCH] PCI: mediatek: Delay 100ms to wait power and clock to become stable qizhong cheng
2021-11-04 11:41 ` Pali Rohár [this message]
2021-12-06 11:35 ` Lorenzo Pieralisi
2021-12-07 1:53 ` Bjorn Helgaas
-- strict thread matches above, loose matches on Subject: below --
2021-12-07 6:05 qizhong cheng
2021-12-07 12:16 ` Bjorn Helgaas
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=20211104114108.mvhm5nhbc7hn2yld@pali \
--to=pali@kernel.org \
--cc=bhelgaas@google.com \
--cc=chuanjia.liu@mediatek.com \
--cc=jianjun.wang@mediatek.com \
--cc=kw@linux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=ot_jiey.yang@mediatek.com \
--cc=qizhong.cheng@mediatek.com \
--cc=ryder.lee@mediatek.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