linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: "Ajay Agarwal" <ajayagarwal@google.com>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Johan Hovold" <johan+linaro@kernel.org>,
	"Jon Hunter" <jonathanh@nvidia.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Rob Herring" <robh@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Manu Gautam" <manugautam@google.com>,
	"Doug Zobel" <zobel@google.com>,
	"William McVicker" <willmcvicker@google.com>,
	"Serge Semin" <fancer.lancer@gmail.com>,
	"Robin Murphy" <robin.murphy@arm.com>,
	linux-pci@vger.kernel.org,
	"Chuanhua Lei" <lchuanhua@maxlinear.com>
Subject: Re: [PATCH v5] PCI: dwc: Wait for link up only if link is started
Date: Thu, 1 Feb 2024 13:02:39 +0530	[thread overview]
Message-ID: <20240201073239.GA17027@thinkpad> (raw)
In-Reply-To: <20240201031413.GA614954@bhelgaas>

On Wed, Jan 31, 2024 at 09:14:13PM -0600, Bjorn Helgaas wrote:
> [+cc Chuanhua Lei, intel-gw maintainer, sorry I forgot this!]
> 
> On Wed, Jan 31, 2024 at 05:48:17PM -0600, Bjorn Helgaas wrote:
> > On Fri, Jan 19, 2024 at 01:22:19PM +0530, Manivannan Sadhasivam wrote:
> > > On Fri, Jan 12, 2024 at 03:00:06PM +0530, Ajay Agarwal wrote:
> > > > In dw_pcie_host_init() regardless of whether the link has been
> > > > started or not, the code waits for the link to come up. Even in
> > > > cases where start_link() is not defined the code ends up spinning
> > > > in a loop for 1 second. Since in some systems dw_pcie_host_init()
> > > > gets called during probe, this one second loop for each pcie
> > > > interface instance ends up extending the boot time.
> > > 
> > > Which platform you are working on? Is that upstreamed? You should mention the
> > > specific platform where you are observing the issue.
> > > 
> > > Right now, intel-gw and designware-plat are the only drivers not
> > > defining that callback. First one definitely needs a fixup and I do
> > > not know how the latter works.
> > 
> > What fixup do you have in mind for intel-gw?
> > 
> > It looks a little strange to me because it duplicates
> > dw_pcie_setup_rc() and dw_pcie_wait_for_link(): dw_pcie_host_init()
> > calls them first via pp->ops->init(), and then calls them a second
> > time directly:
> > 
> >   struct dw_pcie_host_ops intel_pcie_dw_ops = {
> >     .init = intel_pcie_rc_init
> >   }
> > 
> >   intel_pcie_probe
> >     pp->ops = &intel_pcie_dw_ops
> >     dw_pcie_host_init(pp)
> >       if (pp->ops->init)
> >       pp->ops->init
> >         intel_pcie_rc_init
> >           intel_pcie_host_setup
> >             dw_pcie_setup_rc                        # <--
> >             dw_pcie_wait_for_link                   # <--
> >       dw_pcie_setup_rc                              # <--
> >       dw_pcie_wait_for_link                         # <--
> > 
> > Is that what you're thinking?
> > 

Right. There is no need of this driver duplicating dw_pcie_setup_rc() and
dw_pcie_wait_for_link(). Perhaps those functions were added to
dw_pcie_host_init() after this driver got upstreamed and the author failed to
take this driver into account.

But my point was, the new drivers _should_not_ take inspiration from this driver
to not define start_link() callback at the first place (unless there is a real
requirement).

- Mani

-- 
மணிவண்ணன் சதாசிவம்

  reply	other threads:[~2024-02-01  7:32 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12  9:30 [PATCH v5] PCI: dwc: Wait for link up only if link is started Ajay Agarwal
2024-01-18 18:15 ` Ajay Agarwal
2024-01-19  7:52 ` Manivannan Sadhasivam
2024-01-19 17:59   ` Ajay Agarwal
2024-01-20 14:34     ` Manivannan Sadhasivam
2024-01-29  6:51       ` Ajay Agarwal
2024-01-29  7:10         ` Manivannan Sadhasivam
2024-01-29  8:04           ` Ajay Agarwal
2024-01-29  8:12             ` Manivannan Sadhasivam
2024-01-29 13:26               ` Ajay Agarwal
2024-01-30  6:45                 ` Manivannan Sadhasivam
2024-01-30  9:00                   ` Ajay Agarwal
2024-01-30 12:29                     ` Manivannan Sadhasivam
2024-01-30 17:18                       ` Ajay Agarwal
2024-01-30 18:36                         ` Manivannan Sadhasivam
2024-02-05 11:00                           ` Ajay Agarwal
2024-02-06 17:10                             ` Manivannan Sadhasivam
2024-02-14 22:02                               ` Bjorn Helgaas
2024-02-15 14:09                                 ` Manivannan Sadhasivam
2024-02-17  0:07                                   ` Bjorn Helgaas
2024-02-19 14:13                                     ` Manivannan Sadhasivam
2024-02-22  4:30                                   ` Ajay Agarwal
2024-02-28  2:55                                     ` Ajay Agarwal
2024-02-20 17:34                               ` Ajay Agarwal
2024-02-28 17:29                                 ` Manivannan Sadhasivam
2024-03-06 12:00                                   ` Ajay Agarwal
2024-03-10 13:51                                     ` Manivannan Sadhasivam
2025-02-14  9:15                                       ` Ajay Agarwal
2025-02-14  9:18                                         ` Johan Hovold
2025-02-14  9:42                                           ` Manivannan Sadhasivam
2025-02-14 10:02                                             ` Ajay Agarwal
2025-02-14 13:39                                               ` Manivannan Sadhasivam
2025-02-14 18:38                                                 ` William McVicker
2025-02-19 17:46                                                   ` Manivannan Sadhasivam
2024-01-31 23:48   ` Bjorn Helgaas
2024-02-01  3:14     ` Bjorn Helgaas
2024-02-01  7:32       ` Manivannan Sadhasivam [this message]
2024-02-01  8:37         ` Lei Chuan Hua
2024-01-19 20:42 ` Bjorn Helgaas
2024-01-24  9:24   ` Ajay Agarwal

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=20240201073239.GA17027@thinkpad \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=ajayagarwal@google.com \
    --cc=bhelgaas@google.com \
    --cc=fancer.lancer@gmail.com \
    --cc=helgaas@kernel.org \
    --cc=jingoohan1@gmail.com \
    --cc=johan+linaro@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=kw@linux.com \
    --cc=lchuanhua@maxlinear.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=manugautam@google.com \
    --cc=robh@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=willmcvicker@google.com \
    --cc=zobel@google.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).