Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH v2] usb: dwc3: qcom: Provide stubs for dwc3_qcom_read_usb2_speed function
@ 2022-08-01  7:00 Krishna Kurapati
  2022-08-02 16:33 ` Johan Hovold
  2022-08-08 13:00 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 4+ messages in thread
From: Krishna Kurapati @ 2022-08-01  7:00 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Felipe Balbi,
	Greg Kroah-Hartman, Philipp Zabel
  Cc: Randy Dunlap, linux-arm-msm, linux-usb, linux-kernel,
	Krishna Kurapati

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.

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.

Fixes: 6895ea55c385 (usb: dwc3: qcom: Configure wakeup interrupts during suspend)
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Suggested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
---
v2: Updated commit text to include cases when CONFIG_USB=m as well.

 drivers/usb/dwc3/dwc3-qcom.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index c5e482f..bd8dc5a 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -299,6 +299,7 @@ static void dwc3_qcom_interconnect_exit(struct dwc3_qcom *qcom)
 	icc_put(qcom->icc_path_apps);
 }
 
+#ifdef CONFIG_USB
 static enum usb_device_speed dwc3_qcom_read_usb2_speed(struct dwc3_qcom *qcom)
 {
 	struct dwc3 *dwc = platform_get_drvdata(qcom->dwc3);
@@ -318,6 +319,12 @@ static enum usb_device_speed dwc3_qcom_read_usb2_speed(struct dwc3_qcom *qcom)
 
 	return udev->speed;
 }
+#else
+static enum usb_device_speed dwc3_qcom_read_usb2_speed(struct dwc3_qcom *qcom)
+{
+	return USB_SPEED_UNKNOWN;
+}
+#endif
 
 static void dwc3_qcom_enable_wakeup_irq(int irq, unsigned int polarity)
 {
-- 
2.7.4


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

end of thread, other threads:[~2022-08-08 13:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-01  7:00 [PATCH v2] usb: dwc3: qcom: Provide stubs for dwc3_qcom_read_usb2_speed function Krishna Kurapati
2022-08-02 16:33 ` Johan Hovold
2022-08-04 15:20   ` Johan Hovold
2022-08-08 13:00 ` Greg Kroah-Hartman

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