linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@kernel.org>
To: Pawel Laszczak <pawell@cadence.com>
Cc: rogerq@kernel.org, a-govindraju@ti.com,
	gregkh@linuxfoundation.org, felipe.balbi@linux.intel.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] usb: cdns3: Fix issue for clear halt endpoint
Date: Sat, 9 Apr 2022 10:35:31 +0800	[thread overview]
Message-ID: <20220409023531.GA3818@Peter> (raw)
In-Reply-To: <20220329084605.4022-1-pawell@cadence.com>

On 22-03-29 10:46:05, Pawel Laszczak wrote:
> Path fixes bug which occurs during resetting endpoint in

%s/Path/Patch, otherwise:

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

> __cdns3_gadget_ep_clear_halt function. During resetting endpoint
> controller will change HW/DMA owned TRB. It set Abort flag in
> trb->control and will change trb->length field. If driver want
> to use the aborted trb it must update the changed field in
> TRB.
> 
> Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
> cc: <stable@vger.kernel.org>
> Signed-off-by: Pawel Laszczak <pawell@cadence.com>
> ---
>  drivers/usb/cdns3/cdns3-gadget.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
> index 80aaab159e58..3a9f0968fd24 100644
> --- a/drivers/usb/cdns3/cdns3-gadget.c
> +++ b/drivers/usb/cdns3/cdns3-gadget.c
> @@ -2682,6 +2682,7 @@ int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep)
>  	struct usb_request *request;
>  	struct cdns3_request *priv_req;
>  	struct cdns3_trb *trb = NULL;
> +	struct cdns3_trb trb_tmp;
>  	int ret;
>  	int val;
>  
> @@ -2691,8 +2692,10 @@ int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep)
>  	if (request) {
>  		priv_req = to_cdns3_request(request);
>  		trb = priv_req->trb;
> -		if (trb)
> +		if (trb) {
> +			trb_tmp = *trb;
>  			trb->control = trb->control ^ cpu_to_le32(TRB_CYCLE);
> +		}
>  	}
>  
>  	writel(EP_CMD_CSTALL | EP_CMD_EPRST, &priv_dev->regs->ep_cmd);
> @@ -2707,7 +2710,7 @@ int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep)
>  
>  	if (request) {
>  		if (trb)
> -			trb->control = trb->control ^ cpu_to_le32(TRB_CYCLE);
> +			*trb = trb_tmp;
>  
>  		cdns3_rearm_transfer(priv_ep, 1);
>  	}
> -- 
> 2.25.1
> 

-- 

Thanks,
Peter Chen


      reply	other threads:[~2022-04-09  2:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29  8:46 [PATCH] usb: cdns3: Fix issue for clear halt endpoint Pawel Laszczak
2022-04-09  2:35 ` Peter Chen [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=20220409023531.GA3818@Peter \
    --to=peter.chen@kernel.org \
    --cc=a-govindraju@ti.com \
    --cc=felipe.balbi@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pawell@cadence.com \
    --cc=rogerq@kernel.org \
    --cc=stable@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).