From: Alan Stern <stern@rowland.harvard.edu>
To: Jozef Martiniak <jomajm@gmail.com>
Cc: Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jens Axboe <axboe@kernel.dk>, Hangyu Hua <hbh25y@gmail.com>,
"Darrick J. Wong" <djwong@kernel.org>,
Wei Ming Chen <jj251510319013@gmail.com>,
Ingo Molnar <mingo@kernel.org>,
Randy Dunlap <rdunlap@infradead.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gadgetfs: ep_io - wait until IRQ finishes
Date: Fri, 8 Jul 2022 10:39:06 -0400 [thread overview]
Message-ID: <YshBijUt6HgPeB0U@rowland.harvard.edu> (raw)
In-Reply-To: <20220708070645.6130-1-jomajm@gmail.com>
On Fri, Jul 08, 2022 at 09:06:44AM +0200, Jozef Martiniak wrote:
> after usb_ep_queue() if wait_for_completion_interruptible() is
> interrupted we need to wait until IRQ gets finished.
This should say "request" or "I/O request", not "IRQ". Not a big deal.
>
> Otherwise complete() from epio_complete() can corrupt stack.
>
> Signed-off-by: Jozef Martiniak <jomajm@gmail.com>
> ---
Acked-by: Alan Stern <stern@rowland.harvard.edu>
> drivers/usb/gadget/legacy/inode.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
> index 79990597c39f..01c3ead7d1b4 100644
> --- a/drivers/usb/gadget/legacy/inode.c
> +++ b/drivers/usb/gadget/legacy/inode.c
> @@ -362,6 +362,7 @@ ep_io (struct ep_data *epdata, void *buf, unsigned len)
> spin_unlock_irq (&epdata->dev->lock);
>
> DBG (epdata->dev, "endpoint gone\n");
> + wait_for_completion(&done);
> epdata->status = -ENODEV;
> }
> }
> --
> 2.25.1
>
prev parent reply other threads:[~2022-07-08 14:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-08 7:06 [PATCH] gadgetfs: ep_io - wait until IRQ finishes Jozef Martiniak
2022-07-08 7:19 ` Greg Kroah-Hartman
2022-07-08 7:29 ` Jozo M.
2022-07-08 14:39 ` Alan Stern [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=YshBijUt6HgPeB0U@rowland.harvard.edu \
--to=stern@rowland.harvard.edu \
--cc=axboe@kernel.dk \
--cc=balbi@kernel.org \
--cc=djwong@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hbh25y@gmail.com \
--cc=jj251510319013@gmail.com \
--cc=jomajm@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rdunlap@infradead.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