All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergio Paracuellos <sergio.paracuellos@gmail.com>
To: linux-pci@vger.kernel.org
Cc: bhelgaas@google.com, lpieralisi@kernel.org, robh@kernel.org,
	kw@linux.com, matthias.bgg@gmail.com,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2] PCI: mt7621: Sleep a bit after power on the PCIs phy ports
Date: Sat, 31 Dec 2022 08:40:41 +0100	[thread overview]
Message-ID: <20221231074041.264738-1-sergio.paracuellos@gmail.com> (raw)

Some devices like ZBT WE1326 and ZBT WF3526-P and some Netgear models need
to sleep a bit after call to mt7621_pcie_init_port() driver function to get
into reliable boots for both warm and hard resets. The needed time for these
devices to always detect the ports seems to be from 75 to 100 milliseconds.
There is no datasheet or something similar to really understand why this
extra time is needed in these devices but not in most of the boards which
use mt7621 SoC. This issue has been reported by openWRT community and the
complete discussion is in [0]. The selected time of 100 milliseconds has
been also tested in these devices ending up in an always working platform.
Hence, properly add the extra 100 milliseconds msleep() function call to make
also these devices work.

[0]: https://github.com/openwrt/openwrt/pull/11220

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
Hi Bjorn / Lorenzo,

As per Lorenzo comments in v1[0] here it is the patch with changes in commit
message and introducing a new definition for this needed extra delay time.
I wish you the best new year for you both.

Changes in v2:
- Add a new define 'INIT_PORTS_DELAY_MS' avoiding to reuse 'PERST_DELAY_MS'.
- Rewrite commit message and add a link to openWRT discussion.

Previous patch lore link:
[0]: https://lore.kernel.org/lkml/20221209071703.2891714-1-sergio.paracuellos@gmail.com/T/

Thanks,
    Sergio Paracuellos

 drivers/pci/controller/pcie-mt7621.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pci/controller/pcie-mt7621.c b/drivers/pci/controller/pcie-mt7621.c
index ee7aad09d627..63a5f4463a9f 100644
--- a/drivers/pci/controller/pcie-mt7621.c
+++ b/drivers/pci/controller/pcie-mt7621.c
@@ -60,6 +60,7 @@
 #define PCIE_PORT_LINKUP		BIT(0)
 #define PCIE_PORT_CNT			3
 
+#define INIT_PORTS_DELAY_MS		100
 #define PERST_DELAY_MS			100
 
 /**
@@ -369,6 +370,7 @@ static int mt7621_pcie_init_ports(struct mt7621_pcie *pcie)
 		}
 	}
 
+	msleep(INIT_PORTS_DELAY_MS);
 	mt7621_pcie_reset_ep_deassert(pcie);
 
 	tmp = NULL;
-- 
2.25.1


             reply	other threads:[~2022-12-31  7:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-31  7:40 Sergio Paracuellos [this message]
2023-01-23  8:55 ` [PATCH v2] PCI: mt7621: Sleep a bit after power on the PCIs phy ports Sergio Paracuellos
2023-02-02 16:27   ` Lorenzo Pieralisi
2023-02-02 18:45     ` Sergio Paracuellos
2023-02-03  9:29 ` Lorenzo Pieralisi
2023-02-03  9:31   ` Sergio Paracuellos

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=20221231074041.264738-1-sergio.paracuellos@gmail.com \
    --to=sergio.paracuellos@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=matthias.bgg@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.