public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB: pci-quirks: Skip usb_early_handoff for Renesas PCI USB
@ 2024-05-21  7:46 Akash Kumar
  2024-05-21  8:05 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 6+ messages in thread
From: Akash Kumar @ 2024-05-21  7:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jing Leng, Felipe Balbi, Pratham Pratap ,
	Jack Pham, kernel, Wesley Cheng, Vijayavardhan Vennapusa,
	Krishna Kurapati
  Cc: linux-usb, linux-kernel, Akash Kumar

Skip usb_early_handoff for the Renesas PCI USB controller due to
the firmware not being loaded beforehand, which impacts the bootup
time.

Signed-off-by: Akash Kumar <quic_akakum@quicinc.com>
---
 drivers/usb/host/pci-quirks.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index 0b949acfa258..a0770ecc0861 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -1264,6 +1264,11 @@ static void quirk_usb_early_handoff(struct pci_dev *pdev)
 		}
 	}
 
+	/* Skip handoff for Renesas PCI USB controller on QCOM SOC */
+	if ((pdev->vendor == PCI_VENDOR_ID_RENESAS) &&
+			(pcie_find_root_port(pdev)->vendor == PCI_VENDOR_ID_QCOM))
+		return;
+
 	if (pdev->class != PCI_CLASS_SERIAL_USB_UHCI &&
 			pdev->class != PCI_CLASS_SERIAL_USB_OHCI &&
 			pdev->class != PCI_CLASS_SERIAL_USB_EHCI &&
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] USB: pci-quirks: Skip usb_early_handoff for Renesas PCI USB
  2024-05-21  7:46 [PATCH] USB: pci-quirks: Skip usb_early_handoff for Renesas PCI USB Akash Kumar
@ 2024-05-21  8:05 ` Greg Kroah-Hartman
       [not found]   ` <1ceae2a4-0715-4cea-9351-fd98a0017b85@quicinc.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Greg Kroah-Hartman @ 2024-05-21  8:05 UTC (permalink / raw)
  To: Akash Kumar
  Cc: Jing Leng, Felipe Balbi, Pratham Pratap , Jack Pham, kernel,
	Wesley Cheng, Vijayavardhan Vennapusa, Krishna Kurapati,
	linux-usb, linux-kernel

On Tue, May 21, 2024 at 01:16:35PM +0530, Akash Kumar wrote:
> Skip usb_early_handoff for the Renesas PCI USB controller due to
> the firmware not being loaded beforehand, which impacts the bootup
> time.
> 
> Signed-off-by: Akash Kumar <quic_akakum@quicinc.com>

What commit id does this fix?  Should it go to stable kernels?

> ---
>  drivers/usb/host/pci-quirks.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
> index 0b949acfa258..a0770ecc0861 100644
> --- a/drivers/usb/host/pci-quirks.c
> +++ b/drivers/usb/host/pci-quirks.c
> @@ -1264,6 +1264,11 @@ static void quirk_usb_early_handoff(struct pci_dev *pdev)
>  		}
>  	}
>  
> +	/* Skip handoff for Renesas PCI USB controller on QCOM SOC */
> +	if ((pdev->vendor == PCI_VENDOR_ID_RENESAS) &&
> +			(pcie_find_root_port(pdev)->vendor == PCI_VENDOR_ID_QCOM))

Why are all Renesas PCI devices on a QCOM host to be marked this way?
That's a very big hammer for potentially lots of devices.  Have you
tested them all?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] USB: pci-quirks: Skip usb_early_handoff for Renesas PCI USB
       [not found]   ` <1ceae2a4-0715-4cea-9351-fd98a0017b85@quicinc.com>
@ 2024-05-21  9:36     ` AKASH KUMAR
  2024-05-21  9:38     ` Greg Kroah-Hartman
  1 sibling, 0 replies; 6+ messages in thread
From: AKASH KUMAR @ 2024-05-21  9:36 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Felipe Balbi, Pratham Pratap, Jack Pham, kernel, Wesley Cheng,
	Vijayavardhan Vennapusa, Krishna Kurapati, linux-usb,
	linux-kernel

Hi Greg,On 5/21/2024 1:35 PM, Greg Kroah-Hartman wrote: > On Tue, May 21, 2024 
at 01:16:35PM +0530, Akash Kumar wrote: >> Skip usb_early_handoff for 
the Renesas PCI USB controller due to >> the firmware not being loaded 
beforehand, which impacts the bootup >> time. >> >> Signed-off-by: Akash 
Kumar <quic_akakum@quicinc.com> > What commit id does this fix? Should 
it go to stable kernels? yes it can go to stable kernels, issue is seen on every target with usb over pcie support. >> --- >> drivers/usb/host/pci-quirks.c | 5 +++++ >> 1 file changed, 5 
insertions(+) >> >> diff --git a/drivers/usb/host/pci-quirks.c 
b/drivers/usb/host/pci-quirks.c >> index 0b949acfa258..a0770ecc0861 
100644 >> --- a/drivers/usb/host/pci-quirks.c >> +++ 
b/drivers/usb/host/pci-quirks.c >> @@ -1264,6 +1264,11 @@ static void 
quirk_usb_early_handoff(struct pci_dev *pdev) >> } >> } >> >> + /* Skip 
handoff for Renesas PCI USB controller on QCOM SOC */ >> + if 
((pdev->vendor == PCI_VENDOR_ID_RENESAS) && >> + 
(pcie_find_root_port(pdev)->vendor == PCI_VENDOR_ID_QCOM)) > Why are all 
Renesas PCI devices on a QCOM host to be marked this way? > That's a 
very big hammer for potentially lots of devices. Have you > tested them 
all? firmware loading is being done in HLOS, not UEFI,
if firmware loading is done in UEFI, then calling early_handoff() API makes sense,
else it is checking for controller ready without firmware loaded which is impacting boot up time by 5 sec roughly.
We are seeing problem in all targets having usb over pcie support. > thanks, > > greg k-h Thanks,
Akash


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] USB: pci-quirks: Skip usb_early_handoff for Renesas PCI USB
       [not found]   ` <1ceae2a4-0715-4cea-9351-fd98a0017b85@quicinc.com>
  2024-05-21  9:36     ` AKASH KUMAR
@ 2024-05-21  9:38     ` Greg Kroah-Hartman
  2024-05-22  9:30       ` AKASH KUMAR
  1 sibling, 1 reply; 6+ messages in thread
From: Greg Kroah-Hartman @ 2024-05-21  9:38 UTC (permalink / raw)
  To: AKASH KUMAR
  Cc: Felipe Balbi, Pratham Pratap, Jack Pham, kernel, Wesley Cheng,
	Vijayavardhan Vennapusa, Krishna Kurapati, linux-usb,
	linux-kernel

On Tue, May 21, 2024 at 02:55:13PM +0530, AKASH KUMAR wrote:
> Hi Greg,
> 
> On 5/21/2024 1:35 PM, Greg Kroah-Hartman wrote:
> > On Tue, May 21, 2024 at 01:16:35PM +0530, Akash Kumar wrote:
> > > Skip usb_early_handoff for the Renesas PCI USB controller due to
> > > the firmware not being loaded beforehand, which impacts the bootup
> > > time.
> > > 
> > > Signed-off-by: Akash Kumar<quic_akakum@quicinc.com>
> > What commit id does this fix?  Should it go to stable kernels?
> > yes it can go to stable kernels, issue is seen on every target with usb
> > over pcie support.
> > > ---
> > >   drivers/usb/host/pci-quirks.c | 5 +++++
> > >   1 file changed, 5 insertions(+)
> > > 
> > > diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
> > > index 0b949acfa258..a0770ecc0861 100644
> > > --- a/drivers/usb/host/pci-quirks.c
> > > +++ b/drivers/usb/host/pci-quirks.c
> > > @@ -1264,6 +1264,11 @@ static void quirk_usb_early_handoff(struct pci_dev *pdev)
> > >   		}
> > >   	}
> > > +	/* Skip handoff for Renesas PCI USB controller on QCOM SOC */
> > > +	if ((pdev->vendor == PCI_VENDOR_ID_RENESAS) &&
> > > +			(pcie_find_root_port(pdev)->vendor == PCI_VENDOR_ID_QCOM))
> > Why are all Renesas PCI devices on a QCOM host to be marked this way?
> > That's a very big hammer for potentially lots of devices.  Have you
> > tested them all?
> 
> firmware loading is being done in HLOS, not UEFI, if firmware loading is
> done in UEFI, then calling early_handoff() API makes sense, else it is
> checking for controller ready without firmware loaded which is impacting
> boot up time by 5 sec roughly. We are seeing problem in all targets having
> usb over pcie support.

But the bootloader has nothing to do with the device type of the devices
here, right?  Why not properly trigger this off of the needed firmware
location instead of here?  What happens when you have a system using
UEFI that matches these two devices and the change causes them to break?

In other words, test the proper thing, and only for the specific devices
you need to have the change for, don't be overly broad like you are
doing here, as you might break other systems that you do not have in
front of you at the moment.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] USB: pci-quirks: Skip usb_early_handoff for Renesas PCI USB
  2024-05-21  9:38     ` Greg Kroah-Hartman
@ 2024-05-22  9:30       ` AKASH KUMAR
  2024-05-23  3:00         ` Bjorn Andersson
  0 siblings, 1 reply; 6+ messages in thread
From: AKASH KUMAR @ 2024-05-22  9:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Felipe Balbi, Pratham Pratap, Jack Pham, kernel, Wesley Cheng,
	Vijayavardhan Vennapusa, Krishna Kurapati, linux-usb,
	linux-kernel


On 5/21/2024 3:08 PM, Greg Kroah-Hartman wrote:

> On Tue, May 21, 2024 at 02:55:13PM +0530, AKASH KUMAR wrote:
>> Hi Greg, On 5/21/2024 1:35 PM, Greg Kroah-Hartman wrote:
>>> On Tue, May 21, 2024 at 01:16:35PM +0530, Akash Kumar wrote:
>>>> Skip usb_early_handoff for the Renesas PCI USB controller due to 
>>>> the firmware not being loaded beforehand, which impacts the bootup 
>>>> time. Signed-off-by: Akash Kumar<quic_akakum@quicinc.com>
>>> What commit id does this fix? Should it go to stable kernels? yes it 
>>> can go to stable kernels, issue is seen on every target with usb 
>>> over pcie support.
>>>> --- drivers/usb/host/pci-quirks.c | 5 +++++ 1 file changed, 5 
>>>> insertions(+) diff --git a/drivers/usb/host/pci-quirks.c 
>>>> b/drivers/usb/host/pci-quirks.c index 0b949acfa258..a0770ecc0861 
>>>> 100644 --- a/drivers/usb/host/pci-quirks.c +++ 
>>>> b/drivers/usb/host/pci-quirks.c @@ -1264,6 +1264,11 @@ static void 
>>>> quirk_usb_early_handoff(struct pci_dev *pdev) } } + /* Skip handoff 
>>>> for Renesas PCI USB controller on QCOM SOC */ + if ((pdev->vendor 
>>>> == PCI_VENDOR_ID_RENESAS) && + (pcie_find_root_port(pdev)->vendor 
>>>> == PCI_VENDOR_ID_QCOM))
>>> Why are all Renesas PCI devices on a QCOM host to be marked this 
>>> way? That's a very big hammer for potentially lots of devices. Have 
>>> you tested them all?
>> firmware loading is being done in HLOS, not UEFI, if firmware loading 
>> is done in UEFI, then calling early_handoff() API makes sense, else 
>> it is checking for controller ready without firmware loaded which is 
>> impacting boot up time by 5 sec roughly. We are seeing problem in all 
>> targets having usb over pcie support.
> But the bootloader has nothing to do with the device type of the 
> devices here, right? Why not properly trigger this off of the needed 
> firmware location instead of here? What happens when you have a system 
> using UEFI that matches these two devices and the change causes them 
> to break? In other words, test the proper thing, and only for the 
> specific devices you need to have the change for, don't be overly 
> broad like you are doing here, as you might break other systems that 
> you do not have in front of you at the moment.

yeah currently we don't have any uefi based targets, will add target specific check.

Thanks,

Akash


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] USB: pci-quirks: Skip usb_early_handoff for Renesas PCI USB
  2024-05-22  9:30       ` AKASH KUMAR
@ 2024-05-23  3:00         ` Bjorn Andersson
  0 siblings, 0 replies; 6+ messages in thread
From: Bjorn Andersson @ 2024-05-23  3:00 UTC (permalink / raw)
  To: AKASH KUMAR
  Cc: Greg Kroah-Hartman, Felipe Balbi, Pratham Pratap, Jack Pham,
	kernel, Wesley Cheng, Vijayavardhan Vennapusa, Krishna Kurapati,
	linux-usb, linux-kernel

On Wed, May 22, 2024 at 03:00:32PM +0530, AKASH KUMAR wrote:
> 
> On 5/21/2024 3:08 PM, Greg Kroah-Hartman wrote:
> 
> > On Tue, May 21, 2024 at 02:55:13PM +0530, AKASH KUMAR wrote:
> > > Hi Greg, On 5/21/2024 1:35 PM, Greg Kroah-Hartman wrote:
> > > > On Tue, May 21, 2024 at 01:16:35PM +0530, Akash Kumar wrote:
> > > > > Skip usb_early_handoff for the Renesas PCI USB controller
> > > > > due to the firmware not being loaded beforehand, which
> > > > > impacts the bootup time. Signed-off-by: Akash
> > > > > Kumar<quic_akakum@quicinc.com>
> > > > What commit id does this fix? Should it go to stable kernels?
> > > > yes it can go to stable kernels, issue is seen on every target
> > > > with usb over pcie support.
> > > > > --- drivers/usb/host/pci-quirks.c | 5 +++++ 1 file changed,
> > > > > 5 insertions(+) diff --git a/drivers/usb/host/pci-quirks.c
> > > > > b/drivers/usb/host/pci-quirks.c index
> > > > > 0b949acfa258..a0770ecc0861 100644 ---
> > > > > a/drivers/usb/host/pci-quirks.c +++
> > > > > b/drivers/usb/host/pci-quirks.c @@ -1264,6 +1264,11 @@
> > > > > static void quirk_usb_early_handoff(struct pci_dev *pdev) }
> > > > > } + /* Skip handoff for Renesas PCI USB controller on QCOM
> > > > > SOC */ + if ((pdev->vendor == PCI_VENDOR_ID_RENESAS) && +
> > > > > (pcie_find_root_port(pdev)->vendor == PCI_VENDOR_ID_QCOM))
> > > > Why are all Renesas PCI devices on a QCOM host to be marked this
> > > > way? That's a very big hammer for potentially lots of devices.
> > > > Have you tested them all?
> > > firmware loading is being done in HLOS, not UEFI, if firmware
> > > loading is done in UEFI, then calling early_handoff() API makes
> > > sense, else it is checking for controller ready without firmware
> > > loaded which is impacting boot up time by 5 sec roughly. We are
> > > seeing problem in all targets having usb over pcie support.
> > But the bootloader has nothing to do with the device type of the devices
> > here, right? Why not properly trigger this off of the needed firmware
> > location instead of here? What happens when you have a system using UEFI
> > that matches these two devices and the change causes them to break? In
> > other words, test the proper thing, and only for the specific devices
> > you need to have the change for, don't be overly broad like you are
> > doing here, as you might break other systems that you do not have in
> > front of you at the moment.
> 
> yeah currently we don't have any uefi based targets, will add target specific check.
> 

Sure we do.

And please fix your email client.

Regards,
Bjorn

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-23  3:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-21  7:46 [PATCH] USB: pci-quirks: Skip usb_early_handoff for Renesas PCI USB Akash Kumar
2024-05-21  8:05 ` Greg Kroah-Hartman
     [not found]   ` <1ceae2a4-0715-4cea-9351-fd98a0017b85@quicinc.com>
2024-05-21  9:36     ` AKASH KUMAR
2024-05-21  9:38     ` Greg Kroah-Hartman
2024-05-22  9:30       ` AKASH KUMAR
2024-05-23  3:00         ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox