linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@kernel.org>
To: Manish Narani <manish.narani@xilinx.com>
Cc: gregkh@linuxfoundation.org, michal.simek@xilinx.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	git@xilinx.com, Piyush Mehta <piyush.mehta@xilinx.com>
Subject: Re: [PATCH 6/6] usb: chipidea: udc: Add xilinx revision support
Date: Thu, 7 Oct 2021 13:02:07 +0800	[thread overview]
Message-ID: <20211007050207.GE4653@Peter> (raw)
In-Reply-To: <1629825378-8089-7-git-send-email-manish.narani@xilinx.com>

On 21-08-24 22:46:18, Manish Narani wrote:
> From: Piyush Mehta <piyush.mehta@xilinx.com>
> 
> Issue: Adding a dTD to a Primed Endpoint May Not Get Recognized with
> revision 2.20a.
> 
> There is an issue with the add dTD tripwire semaphore (ATDTW bit in
> USBCMD register) that can cause the controller to ignore a dTD that is
> added to a primed endpoint. When this happens, the software can read
> the tripwire bit and the status bit at '1' even though the endpoint is
> unprimed.
> This issue observed with the Windows host machine.
> 
> Workaround:
> The software must implement a periodic cycle, and check for each dTD
> pending on execution (Active = 1), if the endpoint is primed. It can do
> this by reading the corresponding bits in the ENDPTPRIME and ENDPTSTAT
> registers. If these bits are read at 0, the software needs to re-prime
> the endpoint by writing 1 to the corresponding bit in the ENDPTPRIME
> register.
> 
> Added conditional revision check of 2.20[CI_REVISION_22] along with 2.40.
> 
> Signed-off-by: Piyush Mehta <piyush.mehta@xilinx.com>
> Signed-off-by: Manish Narani <manish.narani@xilinx.com>
> ---
>  drivers/usb/chipidea/udc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
> index 8834ca6..b440205 100644
> --- a/drivers/usb/chipidea/udc.c
> +++ b/drivers/usb/chipidea/udc.c
> @@ -680,7 +680,8 @@ static int _hardware_dequeue(struct ci_hw_ep *hwep, struct ci_hw_req *hwreq)
>  		if ((TD_STATUS_ACTIVE & tmptoken) != 0) {
>  			int n = hw_ep_bit(hwep->num, hwep->dir);
>  
> -			if (ci->rev == CI_REVISION_24)
> +			if (ci->rev == CI_REVISION_24 ||
> +			    ci->rev == CI_REVISION_22)

Add indent for it, otherwise:

Acked-by: Peter Chen <peter.chen@kernel.org>

>  				if (!hw_read(ci, OP_ENDPTSTAT, BIT(n)))
>  					reprime_dtd(ci, hwep, node);
>  			hwreq->req.status = -EALREADY;
> -- 
> 2.1.1
> 

-- 

Thanks,
Peter Chen


  reply	other threads:[~2021-10-07  5:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-24 17:16 [PATCH 0/6] Chipidea USB driver Enhancements and Bug Fixes Manish Narani
2021-08-24 17:16 ` [PATCH 1/6] usb: chipidea: Add support for VBUS control with PHY Manish Narani
2021-10-07  4:44   ` Peter Chen
2021-10-08  4:59   ` Jun Li
2021-08-24 17:16 ` [PATCH 2/6] usb: chipidea: Use usb2 phy for Zynq platform Manish Narani
2021-10-07  4:52   ` Peter Chen
2021-08-24 17:16 ` [PATCH 3/6] usb: chipidea: Check usb_phy exists before using it Manish Narani
2021-10-07  4:54   ` Peter Chen
2021-08-24 17:16 ` [PATCH 4/6] usb: chipidea: Fix return value handling Manish Narani
2021-08-24 17:16 ` [PATCH 5/6] usb: chipidea: core: Add return value function check Manish Narani
2021-10-07  5:00   ` Peter Chen
2021-08-24 17:16 ` [PATCH 6/6] usb: chipidea: udc: Add xilinx revision support Manish Narani
2021-10-07  5:02   ` Peter Chen [this message]
2021-10-07  5:03   ` Peter Chen
2021-10-07  5:12 ` [PATCH 0/6] Chipidea USB driver Enhancements and Bug Fixes Peter Chen

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=20211007050207.GE4653@Peter \
    --to=peter.chen@kernel.org \
    --cc=git@xilinx.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=manish.narani@xilinx.com \
    --cc=michal.simek@xilinx.com \
    --cc=piyush.mehta@xilinx.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).