From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Oliver Neukum <oneukum@suse.com>
Cc: "Robert Foss" <robert.foss@collabora.com>,
tglx@linutronix.de,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Bjørn Mork" <bjorn@mork.no>,
"Alan Stern" <stern@rowland.harvard.edu>,
linux-usb@vger.kernel.org
Subject: [v2] USB: cdc-wdm: don't enable interrupts in USB-giveback
Date: Wed, 13 Jun 2018 22:28:09 +0200 [thread overview]
Message-ID: <20180613202809.v2ofsr2ahmf6neeh@linutronix.de> (raw)
On 2018-06-13 19:43:55 [+0200], Oliver Neukum wrote:
> On Mi, 2018-06-13 at 18:28 +0200, Sebastian Andrzej Siewior wrote:
> > The function service_outstanding_interrupt() will unconditionally enable
> > interrupts during unlock and invoke usb_submit_urb() with GFP_KERNEL.
> > If the HCD completes in BH (like ehci does) then the context remains
> > atomic due local_bh_disable() and enabling interrupts does not change
> > this.
>
> Hi,
Hi Oliver,
> I am just looking at your patch and I am wondering why
> wdm_in_callback() won't just call service_outstanding_interrupt()
> again and again? OK, maybe I am dense and it may well be present now,
> but it just looks to me that way.
But this part didn't change, did it? The user blocks in wdmw_read()
waiting for the WDM_READ to be set and a wakeup. After rhe wakeup it
clears the ->rerr.
| static ssize_t wdm_read
| (struct file *file, char __user *buffer, size_t count, loff_t *ppos)
| {
|…
| rv = wait_event_interruptible(desc->wait,
| test_bit(WDM_READ, &desc->flags));
|…
|
| if (desc->rerr) { /* read completed, error happened */
| rv = usb_translate_errors(desc->rerr);
| desc->rerr = 0;
| spin_unlock_irq(&desc->iuspin);
| goto err;
| }
Maybe we should delay the WDM_READ flag in the error case until the
worker is done (before the wakeup).
> Regards
> Oliver
Sebastian
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2018-06-13 20:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-13 20:28 Sebastian Andrzej Siewior [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-06-14 15:33 [v2] USB: cdc-wdm: don't enable interrupts in USB-giveback Oliver Neukum
2018-06-14 11:17 Sebastian Andrzej Siewior
2018-06-14 8:44 Oliver Neukum
2018-06-13 17:43 Oliver Neukum
2018-06-13 16:28 Sebastian Andrzej Siewior
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=20180613202809.v2ofsr2ahmf6neeh@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=bjorn@mork.no \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=oneukum@suse.com \
--cc=robert.foss@collabora.com \
--cc=stern@rowland.harvard.edu \
--cc=tglx@linutronix.de \
/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).