lkml.org 
[lkml]   [2022]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] usb: dwc3: qcom: Provide stubs for dwc3_qcom_read_usb2_speed function
On Mon, Aug 01, 2022 at 12:30:15PM +0530, Krishna Kurapati wrote:
> Dwc3 Qcom driver makes use of usb_hub_find_child API in its efforts
> to get speed of connected devices (HS/LS/FS) and enable interrupts
> accordingly.

> usb_hub_find_child API is a part of usb core compiled
> either into the kernel or as a module (CONFIG_USB= Y or M). In some
> builds (make randconfig for i386) CONFIG_USB is not enabled and the
> usb core is not compiled resulting in linking errors.

Please replace the above with something more succinct. Whether USB core
is built as a module or not is completely irrelevant. The problem is
that the qcom dwc3 driver can be built and used without host support.

> Provide stubs for dwc3_qcom_read_usb2_speed function to use
> usb_hub_find_child API only if CONFIG_USB is enabled. Else return
> USB_SPEED_UNKNOWN.

The fact that you need to do this is an indication that something is
wrong with the current implementation. The glue driver shouldn't be
touching the host driver internal state directly like this.

As pointed out here:

https://lore.kernel.org/all/20220802151404.1797-4-johan+linaro@kernel.org/

dwc3_qcom_read_usb2_speed() is indeed broken and currently triggers a
NULL-pointer dereference when the controller is used in peripheral mode.

But for now I guess something like this is needed even if we try to
avoid stubs in implementation files.

Johan

\
 
 \ /
  Last update: 2022-08-02 18:34    [W:0.084 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site