linux-stable/drivers
Hans de Goede 0837e7e527 usbfs: Add a new disconnect-and-claim ioctl (v2)
Apps which deal with devices which also have a kernel driver, need to do
the following:
1) Check which driver is attached, so as to not detach the wrong driver
   (ie detaching usbfs while another instance of the app is using the device)
2) Detach the kernel driver
3) Claim the interface

Where moving from one step to the next for both 1-2 and 2-3 consists of
a (small) race window. So currently such apps are racy and people just live
with it.

This patch adds a new ioctl which makes it possible for apps to do this
in a race free manner. For flexibility apps can choose to:
1) Specify the driver to disconnect
2) Specify to disconnect any driver except for the one named by the app
3) Disconnect any driver

Note that if there is no driver attached, the ioctl will just act like the
regular claim-interface ioctl, this is by design, as returning an error for
this condition would open a new bag of race-conditions.

Changes in v2:
-Fix indentation of if blocks where the condition spans multiple lines

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10 11:10:37 -07:00
..
accessibility
acpi Merge branch 'drm-fixes-3.6' of git://people.freedesktop.org/~agd5f/linux into drm-fixes 2012-08-22 09:18:49 +10:00
amba Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2012-07-27 15:14:26 -07:00
ata ARM: arm-soc Marvell Orion device-tree updates 2012-08-02 11:50:24 -07:00
atm drivers/atm/iphase.c: fix error return code 2012-08-06 13:29:57 -07:00
auxdisplay
base dmesg fix for 3.6-rc3 2012-08-20 13:13:47 -07:00
bcma bcma: BCM43228 support 2012-08-02 13:51:46 -04:00
block block: remove the deprecated ub driver 2012-09-05 17:18:53 -07:00
bluetooth Bluetooth: add support for atheros 0489:e057 2012-08-06 15:33:05 -03:00
cdrom
char drm/i915: fix hsw uncached pte 2012-08-17 09:21:35 +02:00
clk clk: validate pointer in __clk_disable() 2012-07-30 17:25:13 -07:00
clocksource cs5535-clockevt: typo, it's MFGPT, not MFPGT 2012-08-21 16:45:02 -07:00
connector
cpufreq drivers/cpufreq/pcc-cpufreq.c: fix error return code 2012-08-08 20:49:25 +02:00
cpuidle cpuidle: Prevent null pointer dereference in cpuidle_coupled_cpu_notify 2012-08-17 19:37:08 +02:00
crypto This patch series contains a major revamp of how we collect entropy 2012-07-31 19:07:42 -07:00
dca
devfreq
dio
dma dma: tegra: enable/disable dma clock 2012-08-13 10:15:22 +05:30
edac Merge branch 'devel' 2012-07-29 21:11:05 -03:00
eisa
extcon extcon: extcon_gpio: Replace gpio_request_one by devm_gpio_request_one 2012-08-16 10:29:08 -07:00
firewire - Small fixes and optimizations. 2012-07-30 09:32:39 -07:00
firmware This patch series contains a major revamp of how we collect entropy 2012-07-31 19:07:42 -07:00
gpio GPIO: gpio-pxa: fix building without CONFIG_OF 2012-08-14 07:50:36 +03:00
gpu Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux 2012-08-22 10:45:13 -07:00
hid Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2012-07-31 18:47:44 -07:00
hsi
hv This patch series contains a major revamp of how we collect entropy 2012-07-31 19:07:42 -07:00
hwmon sections: Fix section conflicts in drivers/hwmon 2012-08-18 16:17:43 -07:00
hwspinlock
i2c i2c: tegra: protect suspend/resume callbacks with CONFIG_PM_SLEEP 2012-08-18 20:45:09 +02:00
ide
idle intel_idle: Check cpu_idle_get_driver() for NULL before dereferencing it. 2012-08-17 19:37:14 +02:00
ieee802154
iio iio: lm3533-als: Fix build warnings 2012-08-16 20:24:38 +01:00
infiniband Merge branches 'cma', 'ipoib', 'misc', 'mlx4', 'ocrdma', 'qib' and 'srp' into for-next 2012-08-16 09:38:39 -07:00
input Input: eeti_ts: pass gpio value instead of IRQ 2012-08-09 15:16:41 +02:00
iommu iommu/amd: Fix wrong check for ARRAY_SIZE() 2012-08-10 11:34:08 +02:00
isdn mISDN: Bugfix for layer2 fixed TEI mode 2012-08-06 13:22:50 -07:00
leds leds: renesas: fix error handling 2012-08-13 14:34:02 +08:00
lguest
macintosh
md md/raid10: fix problem with on-stack allocation of r10bio structure. 2012-08-18 09:51:42 +10:00
media Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2012-08-21 16:54:38 -07:00
memory
memstick
message drivers/message/i2o/i2o_config.c: bound allocation 2012-07-30 17:25:17 -07:00
mfd More USB patches for 3.6-rc3 2012-08-20 13:14:22 -07:00
misc drivers/misc/sgi-xp/xpc_uv.c: SGI XPC fails to load when cpu 0 is out of IRQ resources 2012-08-21 16:45:03 -07:00
mmc Merge branch 'dmaengine' of git://git.linaro.org/people/rmk/linux-arm 2012-08-01 16:41:07 -07:00
mtd arm-soc: bug fixes for v3.6-rc2 2012-08-12 21:31:44 +03:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-08-21 16:46:08 -07:00
nfc
nubus
of dt: introduce for_each_available_child_of_node, of_get_next_available_child 2012-08-20 02:16:00 -07:00
oprofile
parisc
parport
pci PCI: EHCI: Fix crash during hibernation on ASUS computers 2012-08-15 11:51:19 -06:00
pcmcia Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2012-07-27 15:14:26 -07:00
pinctrl pinctrl/nomadik: add kp_b_2 keyboard function group list 2012-08-17 11:09:58 +02:00
platform ideapad: add Lenovo IdeaPad Z570 support (part 3) 2012-08-20 12:44:41 -04:00
pnp
power Merge branch 'for-linus-3.6' of git://dev.laptop.org/users/dilinger/linux-olpc 2012-08-02 11:52:39 -07:00
pps pps: return PTR_ERR on error in device_create 2012-07-30 17:25:21 -07:00
ps3
ptp
pwm pwm: Improve Kconfig help text 2012-08-20 11:58:43 +02:00
rapidio rapidio/tsi721: fix unused variable compiler warning 2012-08-21 16:45:03 -07:00
regulator regulator: twl-regulator: fix up VINTANA1/VINTANA2 2012-08-15 17:19:01 +01:00
remoteproc A batch of remoteproc patches for 3.6: 2012-07-26 16:19:08 -07:00
rpmsg A batch of remoteproc patches for 3.6: 2012-07-26 16:19:08 -07:00
rtc drivers/rtc/rtc-rs5c348.c: fix hour decoding in 12-hour mode 2012-08-21 16:45:03 -07:00
s390 s390/sclp_sdias: Add missing break and "fall through" 2012-08-08 07:32:55 -07:00
sbus
scsi Merge branch 'for-3.6/core' of git://git.kernel.dk/linux-block 2012-08-01 09:02:41 -07:00
sfi
sh sh: intc: Handle domain association for sparseirq pre-allocated vectors. 2012-08-09 13:21:05 +09:00
sn
spi spi: Updates for 3.6 2012-08-20 13:05:27 -07:00
ssb
staging usb: remove libusual 2012-09-05 17:21:36 -07:00
target target: Remove unused se_cmd.cmd_spdtl 2012-08-21 14:27:35 -07:00
tc
thermal The tag contains just a few battery-related changes for v3.6. It's is 2012-07-31 18:08:25 -07:00
tty pmac_zilog,kdb: Fix console poll hook to return instead of loop 2012-08-16 12:20:20 -07:00
uio
usb usbfs: Add a new disconnect-and-claim ioctl (v2) 2012-09-10 11:10:37 -07:00
uwb
vfio vfio: grab vfio_device reference *before* exposing the sucker via fd_install() 2012-08-22 10:26:42 -04:00
vhost tcm_vhost: Fix vhost_scsi_target structure alignment 2012-08-20 14:52:11 -07:00
video fbcon: fix race condition between console lock and cursor timer (v1.1) 2012-08-22 14:00:35 +10:00
virt
virtio
vlynq
vme
w1 1-Wire: Add support for the maxim ds1825 temperature sensor 2012-08-16 12:33:59 -07:00
watchdog ARM: arm-soc Marvell Orion device-tree updates 2012-08-02 11:50:24 -07:00
xen
zorro
Kconfig vfio: VFIO core 2012-07-31 08:16:22 -06:00
Makefile vfio: VFIO core 2012-07-31 08:16:22 -06:00