[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YshBijUt6HgPeB0U@rowland.harvard.edu>
Date: Fri, 8 Jul 2022 10:39:06 -0400
From: Alan Stern <stern@...land.harvard.edu>
To: Jozef Martiniak <jomajm@...il.com>
Cc: Felipe Balbi <balbi@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jens Axboe <axboe@...nel.dk>, Hangyu Hua <hbh25y@...il.com>,
"Darrick J. Wong" <djwong@...nel.org>,
Wei Ming Chen <jj251510319013@...il.com>,
Ingo Molnar <mingo@...nel.org>,
Randy Dunlap <rdunlap@...radead.org>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gadgetfs: ep_io - wait until IRQ finishes
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@...il.com>
> ---
Acked-by: Alan Stern <stern@...land.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
>
Powered by blists - more mailing lists