linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@kernel.org>
To: Anurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>,
	gregkh@linuxfoundation.org
Cc: v.anuragkumar@gmail.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [v2] usb: dwc3: core: Add quirk for enabling AutoRetry feature in the controller
Date: Thu, 26 Jul 2018 15:41:43 +0300	[thread overview]
Message-ID: <87va92yxrs.fsf@linux.intel.com> (raw)

Hi,

Anurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com> writes:
> By default when core sees any transaction error(CRC or overflow)
> it replies with terminating retry ACK (Retry=1 and Nump == 0).
> Enabling this Auto Retry feature in controller, on seeing any
> transaction errors makes the core to send a non-terminating ACK
> transaction packet (that is, ACK TP with Retry=1 and Nump != 0).
> Doing so will give controller a chance to recover from the error
> condition.
>
> Signed-off-by: Anurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>
> ---
>  Changes in v2:
> 	1. As suggested by Rob Herring & Felipe Balbi removed the
> 	   quirk logic and setting the AutoRetry bits unconditionally
> 	   for hostmode
> ---
>  drivers/usb/dwc3/core.c | 14 ++++++++++++++
>  drivers/usb/dwc3/core.h |  3 +++
>  2 files changed, 17 insertions(+)
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 1038075..478c8a6 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -883,6 +883,20 @@ static int dwc3_core_init(struct dwc3 *dwc)
>  		dwc3_writel(dwc->regs, DWC3_GUCTL1, reg);
>  	}
>  
> +	if (dwc->dr_mode == USB_DR_MODE_HOST) {

almost there. You also wanna check for dr_mode == OTG. OTG
configurations can switch between device and host mode at will.

> +		reg = dwc3_readl(dwc->regs, DWC3_GUCTL);
> +
> +		/* Enable Auto retry Feature to make the controller operating in

match the multi-line comment style already in this file:

	/*
         * Enable Auto ....

             reply	other threads:[~2018-07-26 12:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26 12:41 Felipe Balbi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-07-27  7:29 [v2] usb: dwc3: core: Add quirk for enabling AutoRetry feature in the controller Anurag Kumar Vulisha
2018-07-26 12:37 Anurag Kumar Vulisha

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=87va92yxrs.fsf@linux.intel.com \
    --to=balbi@kernel.org \
    --cc=anurag.kumar.vulisha@xilinx.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=v.anuragkumar@gmail.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;
as well as URLs for NNTP newsgroup(s).