From: Peter Chen <peter.chen@kernel.org>
To: Pawel Laszczak <pawell@cadence.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] usb: cdnsp: Fix incorrect usb_request status
Date: Thu, 5 Sep 2024 16:05:43 +0800 [thread overview]
Message-ID: <20240905080543.GC325295@nchen-desktop> (raw)
In-Reply-To: <PH7PR07MB95382F640BC61712E986895BDD9D2@PH7PR07MB9538.namprd07.prod.outlook.com>
On 24-09-05 07:31:10, Pawel Laszczak wrote:
> Fix changes incorrect usb_request->status returned during disabling
> endpoints. Before fix the status returned during dequeuing requests
> while disabling endpoint was ECONNRESET.
> Patch changes it to ESHUTDOWN.
Would you please explain why we need this change?
Peter
>
> Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver")
> cc: stable@vger.kernel.org
> Signed-off-by: Pawel Laszczak <pawell@cadence.com>
> ---
> drivers/usb/cdns3/cdnsp-ring.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/cdns3/cdnsp-ring.c b/drivers/usb/cdns3/cdnsp-ring.c
> index 1e011560e3ae..bccc8fc143d0 100644
> --- a/drivers/usb/cdns3/cdnsp-ring.c
> +++ b/drivers/usb/cdns3/cdnsp-ring.c
> @@ -718,7 +718,8 @@ int cdnsp_remove_request(struct cdnsp_device *pdev,
> seg = cdnsp_trb_in_td(pdev, cur_td->start_seg, cur_td->first_trb,
> cur_td->last_trb, hw_deq);
>
> - if (seg && (pep->ep_state & EP_ENABLED))
> + if (seg && (pep->ep_state & EP_ENABLED) &&
> + !(pep->ep_state & EP_DIS_IN_RROGRESS))
> cdnsp_find_new_dequeue_state(pdev, pep, preq->request.stream_id,
> cur_td, &deq_state);
> else
> @@ -736,7 +737,8 @@ int cdnsp_remove_request(struct cdnsp_device *pdev,
> * During disconnecting all endpoint will be disabled so we don't
> * have to worry about updating dequeue pointer.
> */
> - if (pdev->cdnsp_state & CDNSP_STATE_DISCONNECT_PENDING) {
> + if (pdev->cdnsp_state & CDNSP_STATE_DISCONNECT_PENDING ||
> + pep->ep_state & EP_DIS_IN_RROGRESS) {
> status = -ESHUTDOWN;
> ret = cdnsp_cmd_set_deq(pdev, pep, &deq_state);
> }
> --
> 2.43.0
>
next prev parent reply other threads:[~2024-09-05 8:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240905072541.332095-1-pawell@cadence.com>
2024-09-05 7:31 ` [PATCH] usb: cdnsp: Fix incorrect usb_request status Pawel Laszczak
2024-09-05 8:05 ` Peter Chen [this message]
2024-09-05 8:45 ` Pawel Laszczak
2024-09-06 1:12 ` 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=20240905080543.GC325295@nchen-desktop \
--to=peter.chen@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pawell@cadence.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.