linux/drivers/usb/gadget
Michal Nazarewicz b894f60a23 USB: gadget: f_mass_storage: stale common->fsg value bug fix
On fsg_unbind the common->fsg pointer was not NULLed if the
unbound fsg_dev instance was the current one.  As an effect,
the incorrect pointer was preserved in all further operations
which caused do_set_interface to reference an invalid region.

This commit fixes this by raising an exception in fsg_bind
which will change the common->fsg pointer.  This also requires
an wait queue so that the thread in fsg_bind can wait till the
worker thread handles the exception.

This commit removes also a config and new_config fields of
fsg_common as they are no longer needed since fsg can be
used to determine whether function is active or not.

Moreover, this commit removes possible race condition where
the fsg field was modified in both the worker thread and
form various other contexts.  This is fixed by replacing
prev_fsg with new_fsg.  At this point, fsg is assigned only
in worker thread.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-30 08:16:07 -07:00
..
amd5536udc.c usb: amd5536udc: fixed shared interrupt bug and warning oops 2009-11-30 16:43:15 -08:00
amd5536udc.h
at91_udc.c Merge branch 'devel-stable' into devel 2010-05-17 17:24:04 +01:00
at91_udc.h
atmel_usba_udc.c USB: gadget: Use kmemdup 2010-05-20 13:21:49 -07:00
atmel_usba_udc.h USB: atmel uaba: Adding invert vbus_pin 2010-03-02 14:54:57 -08:00
audio.c USB: audio gadget: free alsa devices when unloading 2009-12-23 11:34:20 -08:00
cdc2.c USB: replace uses of __constant_{endian} 2009-03-24 16:20:33 -07:00
ci13xxx_udc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ci13xxx_udc.h USB: gadget: MIPS ci13xxx_udc 2009-01-07 09:59:58 -08:00
composite.c USB: gadget: Allow function access to device ID data during bind() 2010-05-20 13:21:43 -07:00
config.c USB: gadget: __init and __exit tags removed 2010-05-20 13:21:43 -07:00
dummy_hcd.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
epautoconf.c USB: gadget: __init and __exit tags removed 2010-05-20 13:21:43 -07:00
ether.c USB: Correct CONFIG variable typo. 2010-03-02 14:53:40 -08:00
f_acm.c USB: gadget: __init and __exit tags removed 2010-05-20 13:21:43 -07:00
f_audio.c usb/gadget: Replace the old USB audio FU definitions in f_audio.c 2010-06-01 07:42:03 +02:00
f_ecm.c USB: gadget: __init and __exit tags removed 2010-05-20 13:21:43 -07:00
f_eem.c USB: gadget eth: Fix calculate CRC32 in EEM 2010-06-30 08:16:06 -07:00
f_fs.c USB: gadget: f_fs.c needs to include pagemap.h 2010-05-20 13:21:44 -07:00
f_hid.c USB: gadget: add HID gadget driver 2010-05-20 13:21:35 -07:00
f_loopback.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
f_mass_storage.c USB: gadget: f_mass_storage: stale common->fsg value bug fix 2010-06-30 08:16:07 -07:00
f_obex.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
f_phonet.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
f_rndis.c USB: gadget: __init and __exit tags removed 2010-05-20 13:21:43 -07:00
f_serial.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
f_sourcesink.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
f_subset.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
f_uvc.c USB gadget: video class function driver 2010-05-20 13:21:41 -07:00
f_uvc.h USB gadget: video class function driver 2010-05-20 13:21:41 -07:00
file_storage.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2010-03-04 08:15:33 -08:00
fsl_mxc_udc.c USB: mxc: gadget: remove 60mhz clock requirement for freescale mx51 usb core 2010-05-20 13:21:44 -07:00
fsl_qe_udc.c of/usb: fsl_qe_udc.c: fix build breakage 2010-06-02 21:02:40 -06:00
fsl_qe_udc.h powerpc/qe&cpm: Implement static inline stubs for non-QE/CPM builds 2009-11-11 21:43:20 -06:00
fsl_udc_core.c USB: mxc: gadget: Fix bitfield for calculating maximum packet size 2010-05-20 13:21:40 -07:00
fsl_usb2_udc.h USB: gadget: Add i.MX3x support to the fsl_usb2_udc driver 2009-06-15 21:44:47 -07:00
g_ffs.c USB: gadget: g_fs: possible invalid pointer reference bug fixed 2010-06-30 08:16:05 -07:00
g_zero.h USB: gadget: gadget zero uses new suspend/resume hooks 2009-03-24 16:20:45 -07:00
gadget_chips.h USB: gadget: add gadget controller number for s3c-hsotg driver 2010-03-19 07:24:22 -07:00
gmidi.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
goku_udc.c USB: goku_udc: remove potential null dereference 2010-03-19 07:24:19 -07:00
goku_udc.h
hid.c USB: g_hid: unregister platform driver on probe/usb_composite_register errors 2010-05-20 13:21:40 -07:00
imx_udc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
imx_udc.h USB: imx_udc: Fix IMX UDC gadget general irq handling 2009-03-24 16:20:29 -07:00
inode.c usb: gadgetfs: Convert semaphore to mutex 2010-03-02 14:54:52 -08:00
Kconfig USB: s3c_hsotg: define USB_GADGET_DUALSPEED in Kconfig 2010-06-04 13:16:19 -07:00
langwell_udc.c headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
langwell_udc.h USB: Add Intel Langwell USB Device Controller driver 2009-06-15 21:44:47 -07:00
lh7a40x_udc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
lh7a40x_udc.h
m66592-udc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
m66592-udc.h usb: gadget: m66592-udc pio to mmio accessor conversion. 2010-06-02 16:26:13 +09:00
Makefile USB: mxc: gadget: remove 60mhz clock requirement for freescale mx51 usb core 2010-05-20 13:21:44 -07:00
mass_storage.c USB: mass_storage: eject LUNs on thread exit 2010-03-02 14:54:49 -08:00
multi.c USB: gadget/multi: cdc_do_config: remove redundant check 2010-03-19 07:24:24 -07:00
ndis.h
net2280.c USB: replace uses of __constant_{endian} 2009-03-24 16:20:33 -07:00
net2280.h
nokia.c USB: gadget: introduce g_nokia gadget driver 2010-03-02 14:54:02 -08:00
omap_udc.c omap1: omap_udc: Add clocking and disable vbus sense for omap7xx 2009-11-22 10:24:32 -08:00
omap_udc.h
printer.c USB: gadget/printer, fix sleep inside atomic 2010-06-30 08:16:06 -07:00
pxa25x_udc.c [ARM] pxa: move board board IRQ definitions out of irqs.h 2010-03-02 07:40:51 +08:00
pxa25x_udc.h USB: gadget: pxa25x: basic transceiver support 2009-09-23 06:46:23 -07:00
pxa27x_udc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pxa27x_udc.h USB: pxa27x_udc: use four bits to store endpoint addresses 2010-05-20 13:21:36 -07:00
r8a66597-udc.c usb: gadget: r8a66597-udc pio to mmio accessor conversion. 2010-06-02 16:31:02 +09:00
r8a66597-udc.h usb: gadget: r8a66597-udc pio to mmio accessor conversion. 2010-06-02 16:31:02 +09:00
rndis.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
rndis.h USB: gadget: Add EEM gadget driver 2009-09-23 06:46:35 -07:00
s3c2410_udc.c USB: s3c2410: deactivate endpoints before gadget unbinding 2010-06-30 08:16:06 -07:00
s3c2410_udc.h
s3c-hsotg.c USB: s3c-hsotg: Ensure FIFOs are fully flushed after layout 2010-06-04 13:16:19 -07:00
serial.c USB: replace uses of __constant_{endian} 2009-03-24 16:20:33 -07:00
storage_common.c sanitize vfs_fsync calling conventions 2010-05-21 18:31:21 -04:00
u_audio.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
u_audio.h USB: audio gadget: free alsa devices when unloading 2009-12-23 11:34:20 -08:00
u_ether.c USB: gadget: __init and __exit tags removed 2010-05-20 13:21:43 -07:00
u_ether.h USB: Remove unsupported usb gadget drivers 2010-03-02 14:54:57 -08:00
u_phonet.h Phonet: USB CDC Phonet function for gadget framework 2008-12-17 15:49:09 -08:00
u_serial.c USB: g_serial: fix tty cleanup on unload 2010-06-30 08:16:05 -07:00
u_serial.h
usbstring.c USB: Gadget: fix UTF conversion in the usbstring library 2009-05-08 19:34:56 -07:00
uvc_queue.c USB gadget: video class function driver 2010-05-20 13:21:41 -07:00
uvc_queue.h USB gadget: video class function driver 2010-05-20 13:21:41 -07:00
uvc_v4l2.c USB gadget: video class function driver 2010-05-20 13:21:41 -07:00
uvc_video.c USB gadget: video class function driver 2010-05-20 13:21:41 -07:00
uvc.h USB gadget: video class function driver 2010-05-20 13:21:41 -07:00
webcam.c USB gadget: Webcam device 2010-05-20 13:21:42 -07:00
zero.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00