All of lore.kernel.org
 help / color / mirror / Atom feed
From: Quentin Schulz <foss+kernel@0leil.net>
To: Minas Harutyunyan <hminas@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Quentin Schulz <quentin.schulz@theobroma-systems.com>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	William Wu <william.wu@rock-chips.com>,
	Bin Yang <yangbin@rock-chips.com>,
	Frank Wang <frank.wang@rock-chips.com>
Subject: [PATCH 1/3] usb: dwc2: disable lpm feature on Rockchip SoCs
Date: Wed,  7 Dec 2022 14:19:16 +0100	[thread overview]
Message-ID: <20221206-dwc2-gadget-dual-role-v1-1-36515e1092cd@theobroma-systems.com> (raw)
In-Reply-To: <20221206-dwc2-gadget-dual-role-v1-0-36515e1092cd@theobroma-systems.com>

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

LPM feature of DWC2 module integrated in Rockchip SoCs doesn't work
properly or needs some additional handling, so disable it for now.
Without disabling LPM feature, the USB ADB communication fail with
the following error log:

dwc2 ff580000.usb: new address 27
dwc2 ff580000.usb: Failed to exit L1 sleep state in 200us.
dwc2 ff580000.usb: dwc2_hsotg_send_reply: cannot queue req
dwc2 ff580000.usb: dwc2_hsotg_process_req_status: failed to send reply
dwc2 ff580000.usb: dwc2_hsotg_enqueue_setup: failed queue (-11)
dwc2 ff580000.usb: Failed to exit L1 sleep state in 200us.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
[diff vs vendor kernel: added lpm_clock_gating, besl and
 hird_threshold_en settings as seen in  commit 53febc956900 ("usb: dwc2:
 disable Link Power Management on STM32MP15 HS OTG")]
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 drivers/usb/dwc2/params.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index 8eab5f38b1101..9ed9fd9569404 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -113,6 +113,10 @@ static void dwc2_set_rk_params(struct dwc2_hsotg *hsotg)
 	p->ahbcfg = GAHBCFG_HBSTLEN_INCR16 <<
 		GAHBCFG_HBSTLEN_SHIFT;
 	p->power_down = DWC2_POWER_DOWN_PARAM_NONE;
+	p->lpm = false;
+	p->lpm_clock_gating = false;
+	p->besl = false;
+	p->hird_threshold_en = false;
 }
 
 static void dwc2_set_ltq_params(struct dwc2_hsotg *hsotg)

-- 
b4 0.10.1

  reply	other threads:[~2022-12-07 13:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 13:19 [PATCH 0/3] usb: dwc2: fix USB peripheral role in dual-role mode on PX30 Quentin Schulz
2022-12-07 13:19 ` Quentin Schulz [this message]
2022-12-07 13:19 ` [PATCH 2/3] usb: dwc2: power on/off phy for peripheral mode in dual-role mode Quentin Schulz
2022-12-07 13:19 ` [PATCH 3/3] usb: dwc2: prevent core phy initialisation Quentin Schulz
2022-12-08 15:30   ` Greg Kroah-Hartman
2022-12-08 15:53   ` Greg Kroah-Hartman
2022-12-09 11:15     ` Quentin Schulz
2022-12-09 12:13       ` Greg Kroah-Hartman
2022-12-09 12:38         ` Quentin Schulz

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=20221206-dwc2-gadget-dual-role-v1-1-36515e1092cd@theobroma-systems.com \
    --to=foss+kernel@0leil.net \
    --cc=frank.wang@rock-chips.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hminas@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=quentin.schulz@theobroma-systems.com \
    --cc=william.wu@rock-chips.com \
    --cc=yangbin@rock-chips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.