($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: vivsundar@gmail.com
To: meta-freescale@lists.yoctoproject.org
Subject: Pcie: Phy link never came up
Date: Thu, 06 Jul 2023 21:33:45 -0700	[thread overview]
Message-ID: <Jy13.1688704425746552756.gOJ4@lists.yoctoproject.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 2064 bytes --]

I am getting the following error message in the bootup sequence:

[ 6.494407] imx6q-pcie 1ffc000.pcie: Phy link never came up
[ 6.500013] imx6q-pcie 1ffc000.pcie: PHY DEBUG_R0=0x004abc43 DEBUG_R1=0x08000000

This issue happens intermittently

I am currently using the 5.10.y kernel source.  Prior to this I was using 3.10.17 kernel and I faced the same issue, and the issue was solved by adding a retry logic in the imx6_pcie_host_init function. Each time the init failed, the logic was to assert/deassert the Reset signal and try the  imx6_pcie_host_init again.  In this way we were able to solve the problem.

But when a similar kind of patch is done in kernel v5.10.y I face the same issue.

@@ -829,13 +829,48 @@ static int imx6_pcie_host_init(struct pcie_port *pp)
{
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
struct imx6_pcie *imx6_pcie = to_imx6_pcie(pci);
+       int retry = 0;
+       int ret = 0;
+
+       do {
imx6_pcie_assert_core_reset(imx6_pcie);
imx6_pcie_init_phy(imx6_pcie);
imx6_pcie_deassert_core_reset(imx6_pcie);
imx6_setup_phy_mpll(imx6_pcie);
dw_pcie_setup_rc(pp);
-        imx6_pcie_establish_link(imx6_pcie);
+        ret = imx6_pcie_establish_link(imx6_pcie);
+
+        if (ret == 0) {
+              break;
+        }
+        dev_info(imx6_pcie->pci->dev, "Pci reset retry: %d\n", retry);
+
+        if (gpio_is_valid(imx6_pcie->reset_gpio)) {
+                dev_info(imx6_pcie->pci->dev, "gpio reset: %d\n", imx6_pcie->reset_gpio);
+                gpio_set_value(imx6_pcie->reset_gpio, 0);
+        }
+
+        msleep (200);
+
+       } while (retry++ < 3);
+
dw_pcie_msi_init(pp);

return 0;

*The main problem is that there are boards in the field which use the current hardware design and in the 3.10.17 kernel the retry logic seems to solve the problem.  But the same retry logic is not working in the 5.10.y kernel with the same hardware*

Can anyone suggest me some workaround for this problem?

[-- Attachment #2: Type: text/html, Size: 6057 bytes --]

                 reply	other threads:[~2023-07-07  4:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=Jy13.1688704425746552756.gOJ4@lists.yoctoproject.org \
    --to=vivsundar@gmail.com \
    --cc=meta-freescale@lists.yoctoproject.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 read-only IMAP folder(s) and NNTP newsgroup(s).