Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1335742

Re: [PATCH] usb: check for signals in chaoskey read function

From Keith Packard <keithp@keithp.com>
Newsgroups linux.kernel
Subject Re: [PATCH] usb: check for signals in chaoskey read function
Date 2016-02-16 20:20 +0100
Message-ID <r2Tkf-3E0-33@gated-at.bofh.it> (permalink)
References <r2E1P-1z0-1@gated-at.bofh.it> <r2Jbc-5ii-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Oliver Neukum <oneukum@suse.com> writes:

> why is this needed? You are doing this right after a
> mutex_lock_interruptible().

When the device isn't contended, this mutex will never block and so
mutex_lock_interruptible will never check for a signal.

I had mistakenly assumed that usb_bulk_msg would abort when a signal was
delivered, but it doesn't.

I could be convinced that the driver should be using a different path
through the USB stack that would allow a signal to wake up while waiting
for the URB to complete, but this patch at least avoids needing to wait
for a huge read to finish. The other option would be to eliminate the
loop reading multiple URBs from the device, but that would reduce the
available bandwidth from the device pretty considerably.

-- 
-keith

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] usb: check for signals in chaoskey read function Keith Packard <keithp@keithp.com> - 2016-02-16 04:00 +0100
  Re: [PATCH] usb: check for signals in chaoskey read function Oliver Neukum <oneukum@suse.com> - 2016-02-16 09:30 +0100
    Re: [PATCH] usb: check for signals in chaoskey read function Keith Packard <keithp@keithp.com> - 2016-02-16 20:20 +0100
      Re: [PATCH] usb: check for signals in chaoskey read function Oliver Neukum <oneukum@suse.com> - 2016-02-17 16:10 +0100
        Re: [PATCH] usb: check for signals in chaoskey read function Keith Packard <keithp@keithp.com> - 2016-02-17 19:10 +0100
          Re: [PATCH] usb: check for signals in chaoskey read function Keith Packard <keithp@keithp.com> - 2016-02-17 19:30 +0100

csiph-web