Re: [PATCH v5] PCI: dwc: Wait for link up only if link is started

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 14, 2025 at 10:38:30AM -0800, William McVicker wrote:
> Hi Mani and Johan,
> 
> On 02/14/2025, Manivannan Sadhasivam wrote:
> > On Fri, Feb 14, 2025 at 03:32:13PM +0530, Ajay Agarwal wrote:
> > > On Fri, Feb 14, 2025 at 03:12:55PM +0530, Manivannan Sadhasivam wrote:
> > > > On Fri, Feb 14, 2025 at 10:18:27AM +0100, Johan Hovold wrote:
> > > > > On Fri, Feb 14, 2025 at 02:45:03PM +0530, Ajay Agarwal wrote:
> > > > > 
> > > > > > Restarting this discussion for skipping the 1 sec of wait time if a
> > > > > > certain platform does not necessarily wish or expect to bring the link
> > > > > > up during probe time. I discussed with William and we think that a
> > > > > > module parameter can be added which if true, would lead to the skipping
> > > > > > of the wait time. By default, this parameter would be false, thereby
> > > > > > ensuring that the current behaviour to wait for the link is maintained.
> > > > > > 
> > > > > > Please let me know if this is worth exploring.
> > > > > 
> > > > > No, module parameters are a thing of the past (except possibly in vendor
> > > > > kernels). The default behaviour should just work.
> > > > > 
> > > > 
> > > > +1
> > > > 
> > > > Btw, you need to come up with a valid argument for not enabling the link during
> > > The argument for the link to not come up during probe is simply that the
> > > product does not need the link to be up during probe. The requirement is
> > > that the PCIe RC SW structures be prepared for link-up later, when there
> > > is a trigger from the userspace or the vendor kernel driver.
> > > 
> > 
> > This is the problem. You are fixing the behavior of the controller driver to
> > a single product line and this is not going to work if the same controller is
> > used in a different product. Instead you should fix the userspace.
> > 
> 
> Do you have an alternative suggestion on how to fix this in userspace without
> a module parameter?

For that you need to explain the requirement clearly. Why does the userspace
need to trigger the kernel?

> I'd argue that module parameters are very much still used
> in the upstream kernel to allow the userspace platform (Android in this case)
> to control driver behavior at module load time. Here are some recent examples
> I found on lore:
> 

These are not going to help. Greg himself has said in many threads that module
params are dead. It just makes the code messy. These are still used for some
exceptional cases though.

> https://lore.kernel.org/all/20250213142412.516309668@xxxxxxxxxxxxxxxxxxx/
> https://lore.kernel.org/all/20250213180317.3205285-1-coltonlewis@xxxxxxxxxx/
> 
> By default (without any module parameter set by userspace), the driver would
> behave as it does today and spin for 1s on probe waiting for the link to come
> up. That will work for both Android and other Linux distros. We are only
> proposing the parameter to allow userspace to optimize boot time by skipping
> the link up wait time on probe when the userspace knows how to properly handle
> this.
> 
> <snip>
> 
> > Same with DWC controllers as well, probe doesn't fail even if the link did not
> > come up. Previously you were trying to avoid the delay while waiting for the
> > link up during probe (for which I also asked you to probe the controller driver
> > asynchronously to mitigate the delay). Is this the same case still?
> 
> Async probing may work, but that is just hiding the problem we are trying to
> address -- unnecessarily spinning for 1s on probe. If userspace can handle
> bringing up the link later, then IMO it's a valid argument to allow the driver
> to skip the 1s delay.
> 

Again, you need to present us a full picture here and not provide a hint. How
does the userspace bring up the link? Why the kernel has to depend on it?

> > 
> > And what makes me nervous is the fact that you are trying to upstream a change
> > for your downstream driver, which is a big no-go.
> 
> As you may know, we (Google and Linaro) are actively upstreaming Pixel 6
> drivers and will be adding support for the gs101 PCIe driver in the near
> future. So this isn't just for a downstream driver running Android.
> 

But this patch is being proposed for more than 6 months (~1year?) without any
evidence of the controller driver in question. With GKI, who knows which vendor
driver is going to be a module.

- Mani

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




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux