From: Peter Chen <peter.chen@kernel.org>
To: Pawel Laszczak <pawell@cadence.com>
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] usb: cdnsp: Fixes issue with dequeuing not queued requests
Date: Fri, 14 Jul 2023 10:14:36 +0800 [thread overview]
Message-ID: <20230714021436.GA2520702@nchen-desktop> (raw)
In-Reply-To: <20230713081429.326660-1-pawell@cadence.com>
On 23-07-13 04:14:29, Pawel Laszczak wrote:
> Gadget ACM while unloading module try to dequeue not queued usb
> request which causes the kernel to crash.
> Patch adds extra condition to check whether usb request is processed
> by CDNSP driver.
>
Why ACM does that?
> cc: <stable@vger.kernel.org>
> Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver")
> Signed-off-by: Pawel Laszczak <pawell@cadence.com>
> ---
> drivers/usb/cdns3/cdnsp-gadget.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/usb/cdns3/cdnsp-gadget.c b/drivers/usb/cdns3/cdnsp-gadget.c
> index fff9ec9c391f..3a30c2af0c00 100644
> --- a/drivers/usb/cdns3/cdnsp-gadget.c
> +++ b/drivers/usb/cdns3/cdnsp-gadget.c
> @@ -1125,6 +1125,9 @@ static int cdnsp_gadget_ep_dequeue(struct usb_ep *ep,
> unsigned long flags;
> int ret;
>
> + if (request->status != -EINPROGRESS)
> + return 0;
> +
Why not you use pending list which used at cdnsp_ep_enqueue to do this?
> if (!pep->endpoint.desc) {
> dev_err(pdev->dev,
> "%s: can't dequeue to disabled endpoint\n",
> --
> 2.37.2
>
--
Thanks,
Peter Chen
next prev parent reply other threads:[~2023-07-14 2:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-13 8:14 [PATCH] usb: cdnsp: Fixes issue with dequeuing not queued requests Pawel Laszczak
2023-07-14 2:14 ` Peter Chen [this message]
2023-07-14 7:19 ` Pawel Laszczak
2023-07-16 11:55 ` Peter Chen
2023-08-17 9:10 ` Pawel Laszczak
2023-08-25 1:10 ` 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=20230714021436.GA2520702@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox