mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Krishna Kurapati <quic_kriskura@quicinc.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"quic_ppratap@quicinc.com" <quic_ppratap@quicinc.com>,
	"quic_jackp@quicinc.com" <quic_jackp@quicinc.com>
Subject: Re: [PATCH] usb: dwc3: core: Set force_gen1 bit for all applicable SuperSpeed ports
Date: Tue, 12 Nov 2024 22:14:46 +0000	[thread overview]
Message-ID: <20241112221444.2hm3eb5swxjacthh@synopsys.com> (raw)
In-Reply-To: <20241112182018.199392-1-quic_kriskura@quicinc.com>

On Tue, Nov 12, 2024, Krishna Kurapati wrote:
> Currently if the maximum-speed is set to Super Speed for a 3.1 Gen2
> capable controller, the FORCE_GEN1 bit of LLUCTL register is set only
> for one SuperSpeed port (or the first port) present. Modify the logic
> to set the FORCE_GEN1 bit for all ports if speed is being limited to
> Gen-1.
> 
> Suggested-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
> Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
> ---
> Suggestion provided for the same at:
> https://urldefense.com/v3/__https://lore.kernel.org/all/20230517003037.i7hsg6k5fn4eyvgf@synopsys.com/__;!!A4F2R9G_pg!fxCYcGdwDaswO2QMGmJYPI2jJqusyiLy8LzeNmE9bgPoDMrwtEAjAIcGoKkQNUsuEF2ktPxCcoMawo3sSxCJBmlslgVv9g$ 
> 
> This patch has only been compile tested due to unavailability of
> hardware at the moment.
> 
>  drivers/usb/dwc3/core.c | 10 +++++++---
>  drivers/usb/dwc3/core.h |  2 +-
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 9b888d33e64d..67aefdbe1d5f 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -1470,9 +1470,13 @@ static int dwc3_core_init(struct dwc3 *dwc)
>  	if (hw_mode != DWC3_GHWPARAMS0_MODE_GADGET &&
>  	    (DWC3_IP_IS(DWC31)) &&
>  	    dwc->maximum_speed == USB_SPEED_SUPER) {
> -		reg = dwc3_readl(dwc->regs, DWC3_LLUCTL);
> -		reg |= DWC3_LLUCTL_FORCE_GEN1;
> -		dwc3_writel(dwc->regs, DWC3_LLUCTL, reg);
> +		int i;
> +
> +		for (i = 0; i < dwc->num_usb3_ports; i++) {
> +			reg = dwc3_readl(dwc->regs, DWC3_LLUCTL(i));
> +			reg |= DWC3_LLUCTL_FORCE_GEN1;
> +			dwc3_writel(dwc->regs, DWC3_LLUCTL(i), reg);
> +		}
>  	}
>  
>  	return 0;
> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> index eaa55c0cf62f..296cbe85a494 100644
> --- a/drivers/usb/dwc3/core.h
> +++ b/drivers/usb/dwc3/core.h
> @@ -179,7 +179,7 @@
>  #define DWC3_OEVTEN		0xcc0C
>  #define DWC3_OSTS		0xcc10
>  
> -#define DWC3_LLUCTL		0xd024
> +#define DWC3_LLUCTL(n)		(0xd024 + ((n) * 0x80))
>  
>  /* Bit fields */
>  
> -- 
> 2.34.1
> 

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

Thanks,
Thinh

      reply	other threads:[~2024-11-12 22:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-12 18:20 Krishna Kurapati
2024-11-12 22:14 ` Thinh Nguyen [this message]

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=20241112221444.2hm3eb5swxjacthh@synopsys.com \
    --to=thinh.nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=quic_jackp@quicinc.com \
    --cc=quic_kriskura@quicinc.com \
    --cc=quic_ppratap@quicinc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®