linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejas Joglekar <Tejas.Joglekar@synopsys.com>
To: Felipe Balbi <balbi@kernel.org>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	John Youn <John.Youn@synopsys.com>
Subject: Re: [PATCH v3 3/4] usb: dwc3: Add device property sgl-trb-cache-size-quirk
Date: Mon, 6 Jul 2020 05:07:02 +0000	[thread overview]
Message-ID: <5534d9d6-5452-dade-e46e-f4b0910becdb@synopsys.com> (raw)
In-Reply-To: <83eba2e9f0069f20ccc94537e3b99cbaec209441.1590415123.git.joglekar@synopsys.com>

Hi Felipe,
On 5/27/2020 4:11 PM, Tejas Joglekar wrote:
> This commit adds the sgl-trb-cache-size-quirk property to enable
> quirk for the XHCI driver with Synopsys xHC. This property is
> enabled as initial property for the dwc3-haps driver.
> 
> Signed-off-by: Tejas Joglekar <joglekar@synopsys.com>
> ---
>  drivers/usb/dwc3/core.c      | 2 ++
>  drivers/usb/dwc3/core.h      | 2 ++
>  drivers/usb/dwc3/dwc3-haps.c | 1 +
>  drivers/usb/dwc3/host.c      | 6 +++++-
>  4 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 25c686a752b0..bc295477e1bc 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -1299,6 +1299,8 @@ static void dwc3_get_properties(struct dwc3 *dwc)
>  				"snps,usb3_lpm_capable");
>  	dwc->usb2_lpm_disable = device_property_read_bool(dev,
>  				"snps,usb2-lpm-disable");
> +	dwc->sgl_trb_cache_size_quirk = device_property_read_bool(dev,
> +				"snps,sgl-trb-cache-size-quirk");
>  	device_property_read_u8(dev, "snps,rx-thr-num-pkt-prd",
>  				&rx_thr_num_pkt_prd);
>  	device_property_read_u8(dev, "snps,rx-max-burst-prd",
> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> index 013f42a2b5dc..0dca0dbf4309 100644
> --- a/drivers/usb/dwc3/core.h
> +++ b/drivers/usb/dwc3/core.h
> @@ -1021,6 +1021,7 @@ struct dwc3_scratchpad_array {
>   *			not needed for DWC_usb31 version 1.70a-ea06 and below
>   * @usb3_lpm_capable: set if hadrware supports Link Power Management
>   * @usb2_lpm_disable: set to disable usb2 lpm
> + * @sgl_trb_cache_size_quirk: set to enable the SG list consolidation
>   * @disable_scramble_quirk: set if we enable the disable scramble quirk
>   * @u2exit_lfps_quirk: set if we enable u2exit lfps quirk
>   * @u2ss_inp3_quirk: set if we enable P3 OK for U2/SS Inactive quirk
> @@ -1220,6 +1221,7 @@ struct dwc3 {
>  	unsigned		dis_start_transfer_quirk:1;
>  	unsigned		usb3_lpm_capable:1;
>  	unsigned		usb2_lpm_disable:1;
> +	unsigned		sgl_trb_cache_size_quirk:1;
>  
>  	unsigned		disable_scramble_quirk:1;
>  	unsigned		u2exit_lfps_quirk:1;
> diff --git a/drivers/usb/dwc3/dwc3-haps.c b/drivers/usb/dwc3/dwc3-haps.c
> index 3cecbf169452..9311cbe5f264 100644
> --- a/drivers/usb/dwc3/dwc3-haps.c
> +++ b/drivers/usb/dwc3/dwc3-haps.c
> @@ -29,6 +29,7 @@ static const struct property_entry initial_properties[] = {
>  	PROPERTY_ENTRY_BOOL("snps,usb3_lpm_capable"),
>  	PROPERTY_ENTRY_BOOL("snps,has-lpm-erratum"),
>  	PROPERTY_ENTRY_BOOL("snps,dis_enblslpm_quirk"),
> +	PROPERTY_ENTRY_BOOL("snps,sgl-trb-cache-size-quirk"),
>  	PROPERTY_ENTRY_BOOL("linux,sysdev_is_parent"),
>  	{ },
>  };
> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
> index bef1c1ac2067..e0089c82728e 100644
> --- a/drivers/usb/dwc3/host.c
> +++ b/drivers/usb/dwc3/host.c
> @@ -44,7 +44,7 @@ static int dwc3_host_get_irq(struct dwc3 *dwc)
>  
>  int dwc3_host_init(struct dwc3 *dwc)
>  {
> -	struct property_entry	props[4];
> +	struct property_entry	props[5];
>  	struct platform_device	*xhci;
>  	int			ret, irq;
>  	struct resource		*res;
> @@ -95,6 +95,10 @@ int dwc3_host_init(struct dwc3 *dwc)
>  	if (dwc->usb2_lpm_disable)
>  		props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb2-lpm-disable");
>  
> +	if (dwc->sgl_trb_cache_size_quirk)
> +		props[prop_idx++] =
> +			PROPERTY_ENTRY_BOOL("sgl-trb-cache-size-quirk");
> +
>  	/**
>  	 * WORKAROUND: dwc3 revisions <=3.00a have a limitation
>  	 * where Port Disable command doesn't work.
> 
Does this implementation looks good to you? Rob has some concerned over the DT entries,
you suggested using compatible string with this quirk addition.
Can you please brief about how you would like to have this quirk implemented?
I can send the updated patch. My patch series is pending for merge just because of the
DT and quirk issue. Can you please help?

Thanks & Regards,
 Tejas Joglekar

  reply	other threads:[~2020-07-06  5:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 10:40 [PATCH v3 0/4] Add logic to consolidate TRBs for Synopsys xHC Tejas Joglekar
2020-05-27 10:40 ` [PATCH v3 1/4] dt-bindings: usb: Add documentation for SG trb cache size quirk Tejas Joglekar
2020-05-29 18:05   ` Rob Herring
2020-05-27 10:41 ` [PATCH v3 2/4] usb: xhci: Set quirk for XHCI_SG_TRB_CACHE_SIZE_QUIRK Tejas Joglekar
2020-05-27 10:41 ` [PATCH v3 3/4] usb: dwc3: Add device property sgl-trb-cache-size-quirk Tejas Joglekar
2020-07-06  5:07   ` Tejas Joglekar [this message]
2020-07-06  6:43     ` Felipe Balbi
2020-07-07 17:21       ` Tejas Joglekar
2020-07-12 13:45       ` Tejas Joglekar
2020-07-15  5:51       ` Tejas Joglekar
2020-07-21  9:47         ` Felipe Balbi
2020-07-21 16:57           ` Tejas Joglekar
2020-07-31 10:13             ` Tejas Joglekar
2020-08-04  0:44               ` Thinh Nguyen
2020-08-04  1:59                 ` Jun Li
2020-05-27 10:42 ` [PATCH v3 4/4] usb: xhci: Use temporary buffer to consolidate SG Tejas Joglekar
2020-06-08  4:32 ` [PATCH v3 0/4] Add logic to consolidate TRBs for Synopsys xHC Tejas Joglekar
2020-06-09  8:57   ` Mathias Nyman
2020-06-11 18:07     ` Tejas Joglekar
2020-06-30  6:28       ` Tejas Joglekar
2020-07-23 10:35 ` Jun Li
2020-07-24  0:15   ` Tejas Joglekar

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=5534d9d6-5452-dade-e46e-f4b0910becdb@synopsys.com \
    --to=tejas.joglekar@synopsys.com \
    --cc=John.Youn@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).