summaryrefslogtreecommitdiffstats
path: root/drivers/usb
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'compat-ioctl-merge' of ↵Linus Torvalds2009-12-111-11/+99
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground * 'compat-ioctl-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground: usbdevfs: move compat_ioctl handling to devio.c lp: move compat_ioctl handling into lp.c compat_ioctl: pass compat pointer directly to handlers compat_ioctl: simplify lookup table compat_ioctl: simplify calling of handlers compat_ioctl: inline all conversion handlers compat_ioctl: Remove BKL compat_ioctl: remove all VT ioctl handling
| * usbdevfs: move compat_ioctl handling to devio.cArnd Bergmann2009-12-101-11/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Half the compat_ioctl handling is in devio.c, the other half is in fs/compat_ioctl.c. This moves everything into one place for consistency. As a positive side-effect, push down the BKL into the ioctl methods. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Oliver Neukum <oliver@neukum.org> Cc: Alon Bar-Lev <alon.barlev@gmail.com> Cc: David Vrabel <david.vrabel@csr.com> Cc: linux-usb@vger.kernel.org
* | Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6Linus Torvalds2009-12-112-58/+32
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (58 commits) tty: split the lock up a bit further tty: Move the leader test in disassociate tty: Push the bkl down a bit in the hangup code tty: Push the lock down further into the ldisc code tty: push the BKL down into the handlers a bit tty: moxa: split open lock tty: moxa: Kill the use of lock_kernel tty: moxa: Fix modem op locking tty: moxa: Kill off the throttle method tty: moxa: Locking clean up tty: moxa: rework the locking a bit tty: moxa: Use more tty_port ops tty: isicom: fix deadlock on shutdown tty: mxser: Use the new locking rules to fix setserial properly tty: mxser: use the tty_port_open method tty: isicom: sort out the board init logic tty: isicom: switch to the new tty_port_open helper tty: tty_port: Add a kref object to the tty port tty: istallion: tty port open/close methods tty: stallion: Convert to the tty_port_open/close methods ...
| * | opticon: Fix resume logicAlan Cox2009-12-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opticon now takes the right mutex to check the port status but the status check is done wrongly for the modern serial code, so fix it. Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | usb_serial: Kill port mutexAlan Cox2009-12-112-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tty port has a port mutex used for all the port related locking so we don't need the one in the USB serial layer any more. Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | usb_serial: Use the shutdown() operationAlan Cox2009-12-111-28/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As Alan Stern pointed out - now we have tty_port_open the shutdown method and locking allow us to whack the other bits into the full helper methods and provide a shutdown op which the tty port code will synchronize with setup for us. Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | tty_port: add "tty_port_open" helperAlan Cox2009-12-111-29/+20
| |/ | | | | | | | | | | | | | | | | | | | | | | For the moment this just moves the USB logic over and fixes the 'what if we open and hangup at the same time' race noticed by Oliver Neukum. Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | Merge branch 'for_linus' of ↵Linus Torvalds2009-12-111-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6 * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6: (21 commits) ext3: PTR_ERR return of wrong pointer in setup_new_group_blocks() ext3: Fix data / filesystem corruption when write fails to copy data ext4: Support for 64-bit quota format ext3: Support for vfsv1 quota format quota: Implement quota format with 64-bit space and inode limits quota: Move definition of QFMT_OCFS2 to linux/quota.h ext2: fix comment in ext2_find_entry about return values ext3: Unify log messages in ext3 ext2: clear uptodate flag on super block I/O error ext2: Unify log messages in ext2 ext3: make "norecovery" an alias for "noload" ext3: Don't update the superblock in ext3_statfs() ext3: journal all modifications in ext3_xattr_set_handle ext2: Explicitly assign values to on-disk enum of filetypes quota: Fix WARN_ON in lookup_one_len const: struct quota_format_ops ubifs: remove manual O_SYNC handling afs: remove manual O_SYNC handling kill wait_on_page_writeback_range vfs: Implement proper O_SYNC semantics ...
| * | vfs: Implement proper O_SYNC semanticsChristoph Hellwig2009-12-101-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While Linux provided an O_SYNC flag basically since day 1, it took until Linux 2.4.0-test12pre2 to actually get it implemented for filesystems, since that day we had generic_osync_around with only minor changes and the great "For now, when the user asks for O_SYNC, we'll actually give O_DSYNC" comment. This patch intends to actually give us real O_SYNC semantics in addition to the O_DSYNC semantics. After Jan's O_SYNC patches which are required before this patch it's actually surprisingly simple, we just need to figure out when to set the datasync flag to vfs_fsync_range and when not. This patch renames the existing O_SYNC flag to O_DSYNC while keeping it's numerical value to keep binary compatibility, and adds a new real O_SYNC flag. To guarantee backwards compatiblity it is defined as expanding to both the O_DSYNC and the new additional binary flag (__O_SYNC) to make sure we are backwards-compatible when compiled against the new headers. This also means that all places that don't care about the differences can just check O_DSYNC and get the right behaviour for O_SYNC, too - only places that actuall care need to check __O_SYNC in addition. Drivers and network filesystems have been updated in a fail safe way to always do the full sync magic if O_DSYNC is set. The few places setting O_SYNC for lower layers are kept that way for now to stay failsafe. We enforce that O_DSYNC is set when __O_SYNC is set early in the open path to make sure we always get these sane options. Note that parisc really screwed up their headers as they already define a O_DSYNC that has always been a no-op. We try to repair it by using it for the new O_DSYNC and redefinining O_SYNC to send both the traditional O_SYNC numerical value _and_ the O_DSYNC one. Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Grant Grundler <grundler@parisc-linux.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Ingo Molnar <mingo@elte.hu> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Andreas Dilger <adilger@sun.com> Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by: Kyle McMartin <kyle@mcmartin.ca> Acked-by: Ulrich Drepper <drepper@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jan Kara <jack@suse.cz>
* | Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6Linus Torvalds2009-12-111-3/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (27 commits) Driver core: fix race in dev_driver_string Driver Core: Early platform driver buffer sysfs: sysfs_setattr remove unnecessary permission check. sysfs: Factor out sysfs_rename from sysfs_rename_dir and sysfs_move_dir sysfs: Propagate renames to the vfs on demand sysfs: Gut sysfs_addrm_start and sysfs_addrm_finish sysfs: In sysfs_chmod_file lazily propagate the mode change. sysfs: Implement sysfs_getattr & sysfs_permission sysfs: Nicely indent sysfs_symlink_inode_operations sysfs: Update s_iattr on link and unlink. sysfs: Fix locking and factor out sysfs_sd_setattr sysfs: Simplify iattr time assignments sysfs: Simplify sysfs_chmod_file semantics sysfs: Use dentry_ops instead of directly playing with the dcache sysfs: Rename sysfs_d_iput to sysfs_dentry_iput sysfs: Update sysfs_setxattr so it updates secdata under the sysfs_mutex debugfs: fix create mutex racy fops and private data Driver core: Don't remove kobjects in device_shutdown. firmware_class: make request_firmware_nowait more useful Driver-Core: devtmpfs - set root directory mode to 0755 ...
| * | firmware_class: make request_firmware_nowait more usefulJohannes Berg2009-12-111-3/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, one cannot hold on to the struct firmware that request_firmware_nowait() hands off, which is needed in some cases. Allow this by requiring the callback to free it (via release_firmware). Additionally, give it a gfp_t parameter -- all the current users call it from a GFP_KERNEL context so the GFP_ATOMIC isn't necessary. This also marks an API break which is useful in a sense, although that is obviously not the primary purpose of this change. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Marcel Holtmann <marcel@holtmann.org> Cc: Ming Lei <tom.leiming@gmail.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: David Woodhouse <David.Woodhouse@intel.com> Cc: Pavel Roskin <proski@gnu.org> Cc: Abhay Salunke <abhay_salunke@dell.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: mos7840: add device IDs for B&B electronics devicesCliff Brake2009-12-111-3/+21
| | | | | | | | | | | | | | Reviewed-by: John Pilles <jpilles@bb-elec.com> Signed-off-by: Cliff Brake <cbrake@bec-systems.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: ftdi_sio: add USB device ID's for B&B Electronics lineCliff Brake2009-12-112-0/+28
| | | | | | | | | | | | | | Reviewed-by: John Pilles <jpilles@bb-elec.com> Signed-off-by: Cliff Brake <cbrake@bec-systems.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: musb: musb_host: fix sparse warningFelipe Balbi2009-12-111-5/+5
| | | | | | | | | | | | | | | | | | | | Fix the following sparse warning: drivers/usb/musb/musb_host.c:1642:9: warning: symbol 'status' shadows an earlier one Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: musb: musb_gadget: fix sparse warningFelipe Balbi2009-12-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Fix the following sparse warnings: drivers/usb/musb/musb_gadget.c:1161:5: warning: symbol 'musb_gadget_set_halt' was not declared. Should it be static? drivers/usb/musb/musb_gadget.c:1244:5: warning: symbol 'musb_gadget_set_wedge' was not declared. Should it be static? Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: musb: omap2430: fix sparse warningFelipe Balbi2009-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | Fix the following sparse warning: drivers/usb/musb/omap2430.c:314:16: warning: Using plain integer as NULL pointer Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: core: message: fix sparse warningFelipe Balbi2009-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | Fix the following sparse warning: drivers/usb/core/message.c:1583:6: warning: symbol '__usb_queue_reset_device' was not declared. Should it be static? Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: core: hub: fix sparse warningFelipe Balbi2009-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | Fix the following sparse warning: drivers/usb/core/hub.c:1664:37: warning: Using plain integer as NULL pointer Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: core: fix sparse warning for static functionFelipe Balbi2009-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | Fix the following sparse warning: drivers/usb/core/usb.c:1033:15: warning: symbol 'usb_debug_devices' was not declared. Should it be static? Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: Added USB_ETH_RNDIS to use instead of CONFIG_USB_ETH_RNDISMichal Nazarewicz2009-12-113-10/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | If g_ether and g_multi are both built CONFIG_USB_ETH_RNDIS symbol may be redefined in the later and, whats even worse, g_ether's settings may affect g_multi's. This adds a USB_ETH_RNDIS symbol defined at the beginning of ether.c and multi.c according toproper KConfig settings. Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: Check bandwidth when switching alt settings.Sarah Sharp2009-12-114-22/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the USB core check the bandwidth when switching from one interface alternate setting to another. Also check the bandwidth when resetting a configuration (so that alt setting 0 is used). If this check fails, the device's state is unchanged. If the device refuses the new alt setting, re-instate the old alt setting in the host controller hardware. If a USB device doesn't have an alternate interface setting 0, install the first alt setting in its descriptors when a new configuration is requested, or the device is reset. Add a mutex per root hub to protect bandwidth operations: adding/reseting/changing configurations, and changing alternate interface settings. We want to ensure that the xHCI host controller and the USB device are set up for the same configurations and alternate settings. There are two (possibly three) steps to do this: 1. The host controller needs to check that bandwidth is available for a different setting, by issuing and waiting for a configure endpoint command. 2. Once that returns successfully, a control message is sent to the device. 3. If that fails, the host controller must be notified through another configure endpoint command. The mutex is used to make these three operations seem atomic, to prevent another driver from using more bandwidth for a different device while we're in the middle of these operations. While we're touching the bandwidth code, rename usb_hcd_check_bandwidth() to usb_hcd_alloc_bandwidth(). This function does more than just check that the bandwidth change won't exceed the bus bandwidth; it actually changes the bandwidth configuration in the xHCI host controller. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: Refactor code to find alternate interface settings.Sarah Sharp2009-12-112-10/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor out the code to find alternate interface settings into usb_find_alt_setting(). Print a debugging message and return null if the alt setting is not found. While we're at it, correct a bug in the refactored code. The interfaces in the configuration's interface cache are not necessarily in numerical order, so we can't just use the interface number as an array index. Loop through the interface caches, looking for the correct interface. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: xhci: Fix command completion after a drop endpoint.Sarah Sharp2009-12-111-16/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The xHCI driver issues a Configure Endpoint command for two reasons: - a new configuration or alternate interface setting is selected - a quirky Fresco Logic prototype requires the command after a Reset Endpoint command. The xHCI driver only waits on the command in the first case. When a configure endpoint command completes, the driver needs to know why the command was generated. When the driver only supported selecting an initial configuration, the check was simple. Unfortunately that check doesn't work now that the driver supports alternate interfaces. If an endpoint must be dropped (because it's not in the new alternate setting) and no new endpoints are added, the math involving xhci_last_valid_endpoint() will assign -1 to an unsigned integer and cause an out-of-bounds array access. Move the check for the quirky hardware sooner and avoid the bad array access. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: xhci: Make reverting an alt setting "unfailable".Sarah Sharp2009-12-113-18/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a driver wants to switch to a different alternate setting for an interface, the USB core will (soon) check whether there is enough bandwidth. Once the new alternate setting is installed in the xHCI hardware, the USB core will send a USB_REQ_SET_INTERFACE control message. That can fail in various ways, and the USB core needs to be able to reinstate the old alternate setting. With the old code, reinstating the old alt setting could fail if the there's not enough memory to allocate new endpoint rings. Keep around a cache of (at most 31) endpoint rings for this case. When we successfully switch the xHCI hardware to the new alt setting, the old alt setting's rings will be stored in the cache. Therefore we'll always have enough rings to satisfy a conversion back to a previous device setting. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: usbtmc: Use usb_clear_halt() instead of custom code.Sarah Sharp2009-12-111-28/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the USB Test & Measurement driver use usb_clear_halt() instead of usb_control_msg() to clear a stalled endpoint. This will allow devices to be tested under an xHCI host controller. The endpoint stall will not be cleared in the internal xHCI hardware state unless usb_clear_halt() is used. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: Steve Holland <sdh4@iastate.edu> Cc: Oliver Neukum <oliver@neukum.org> Cc: Jouni Ryno <Jouni.Ryno@fmi.fi> Cc: Gergely Imreh <imrehg@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: ehci-omap.c: introduce missing kfreeJulia Lawall2009-12-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Error handling code following a kzalloc should free the allocated data. The semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r exists@ local idexpression x; statement S; expression E; identifier f,f1,l; position p1,p2; expression *ptr != NULL; @@ x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...); ... if (x == NULL) S <... when != x when != if (...) { <+...x...+> } ( x->f1 = E | (x->f1 == NULL || ...) | f(...,x->f1,...) ) ...> ( return \(0\|<+...x...+>\|ptr\); | return@p2 ...; ) @script:python@ p1 << r.p1; p2 << r.p2; @@ print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: xhci-mem.c: introduce missing kfreeJulia Lawall2009-12-111-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Error handling code following a kzalloc should free the allocated data. The semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r exists@ local idexpression x; statement S; expression E; identifier f,f1,l; position p1,p2; expression *ptr != NULL; @@ x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...); ... if (x == NULL) S <... when != x when != if (...) { <+...x...+> } ( x->f1 = E | (x->f1 == NULL || ...) | f(...,x->f1,...) ) ...> ( return \(0\|<+...x...+>\|ptr\); | return@p2 ...; ) @script:python@ p1 << r.p1; p2 << r.p2; @@ print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: add remove_id sysfs attr for usb driversCHENG Renquan2009-12-111-9/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Accroding commit 0994375e, which is adding remove_id sysfs attr for pci drivers, for management tools dynamically bind/unbind a pci/usb devices to a specified drivers; with this patch, the management tools can be simplied. And the original code didn't handle the failure of usb_create_newid_file, fixed in this patch. Signed-off-by: CHENG Renquan <rqcheng@smu.edu.sg> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: g_multi kconfig: fix depends and help textRandy Dunlap2009-12-111-7/+7
| | | | | | | | | | | | | | | | | | | | | | USB_G_MULTI uses block and net interface functions, so make it depend on both of those. Otherwise there are lots of build errors. Fix USB_G_MULTI config help text typos and copy/paste error. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: option: add pid for ZTEzhao.ming9@zte.com.cn2009-12-111-0/+36
| | | | | | | | | | | | | | | | | | This patch adds ZTE modem devices. Signed-off-by: Ming Zhao <zhao.ming9@zte.com.cn> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: wusb: correctly check size of security descriptor.David Vrabel2009-12-111-3/+3
| | | | | | | | | | | | | | Reported-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: David Vrabel <david.vrabel@csr.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: wusb: don't leak urb in certain error casesDavid Vrabel2009-12-111-4/+3
| | | | | | | | | | | | | | | | | | Don't leak an urb in wusb_dev_alloc() if the following kmalloc() failed. Reported-by: Julia Lawall <julia@diku.dk> Signed-off-by: David Vrabel <david.vrabel@csr.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: whci-hcd: correctly handle sg lists longer than QTD_MAX_XFER_SIZE.David Vrabel2009-12-111-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | When building qTDs (sTDs) from a scatter-gather list, the length of the qTD must be a multiple of wMaxPacketSize if the transfer continues into another qTD. This also fixes a link failure on configurations for 32 bit processors with 64 bit dma_addr_t (e.g., CONFIG_HIGHMEM_64G). Signed-off-by: David Vrabel <david.vrabel@csr.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: usb-storage: fix bug in fill_inquiryAlan Stern2009-12-111-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1312) fixes a minor bug in usb-storage. The fill_inquiry() routine neglects to pre-load the inquiry data buffer with spaces. As a result, if the vendor name is shorter than 8 characters or the product name is shorter than 16, the remainder will be filled with garbage. The patch also removes some unnecessary calls to strlen(). Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: usb-storage: add BAD_SENSE flagAlan Stern2009-12-113-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1311) fixes a problem in usb-storage: Some devices are pretty broken when it comes to reporting sense data. The information they send back indicates that they have more than 18 bytes of sense data available, but when the system asks for more than 18 they fail or hang. The symptom is that probing fails with multiple resets. The patch adds a new BAD_SENSE flag to indicate that usb-storage should never ask for more than 18 bytes of sense data. The flag can be set in an unusual_devs entry or via the "quirks=" module parameter, and it is set automatically whenever a REQUEST SENSE command for more than 18 bytes fails or times out. An unusual_devs entry is added for the Agfa photo frame, which uses a Prolific chip having this bug. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Daniel Kukula <daniel.kuku@gmail.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: prepare for changover to Runtime PM frameworkAlan Stern2009-12-113-65/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1303) revises the USB Power Management infrastructure to make it compatible with the new driver-model Runtime PM framework: Drivers are no longer allowed to access intf->pm_usage_cnt directly; the PM framework manages its own usage counters. usb_autopm_set_interface() is eliminated, because it directly sets intf->pm_usage_cnt. usb_autopm_enable() and usb_autopm_disable() are eliminated, because they call usb_autopm_set_interface(). usb_autopm_get_interface_no_resume() and usb_autopm_put_interface_no_suspend() are added. They correspond to pm_runtime_get_noresume() and pm_runtime_put_noidle() in the PM framework. The power/level attribute no longer accepts "suspend", only "on" and "auto". The PM framework doesn't allow devices to be forced into a suspended mode. The hub driver contains the only code that violates the new guidelines. It is updated to use the new interface routines instead. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: add devpath sysfs attributeGreg Kroah-Hartman2009-12-111-1/+12
| | | | | | | | | | | | | | | | This is not exported from the usb core, yet we rely on it to create paths to interfaces for this device in sysfs. Export it to make userspace tools have an easier time to figure things out. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: twl4030: Enable USB regulators before enabling USB chargingAguilar Pena, Leed2009-12-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For TWL family of power management ICs, USB charging works only when USB regulators are in enabled state: 3v1, 1v5, 1v8 On a USB cable attach, twl4030_phy_resume(twl) function enables the regulators. Enable USB charging, only after all regulators are enabled. Its observed that enabling USB charging before regulators are enabled, causes USB charging to fail. Tested on: Zoom2: omap3430: ES3.1 + TWL5030 Needs T2-MADC and T2-BCI drivers which are still not upstreamed. Signed-off-by: Moiz Sonasath <m-sonasath@ti.com> Signed-off-by: Leed Aguilar <leed.aguilar@ti.com> Acked-by: Vikram Pandita <vikram.pandita@ti.com> Acked-by: Anand Gadiyar <gadiyar@ti.com> Acked-by: Nishanth Menon <nm@ti.com> Acked-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: usbtmc: repeat usb_bulk_msg until whole message is transferedAndre Herms2009-12-111-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | usb_bulk_msg() transfers only bytes up to the maximum packet size. It must be repeated by the usbtmc driver until all bytes of a TMC message are transfered. Without this patch, ETIMEDOUT is reported when writing TMC messages larger than the maximum USB bulk size and the transfer remains incomplete. The user will notice that the device hangs and must be reset by either closing the application or pulling the plug. Signed-off-by: Andre Herms <andre.herms@tec-venture.de> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: musb_gadget: remove pointless loopSergei Shtylyov2009-12-111-92/+82
| | | | | | | | | | | | | | | | | | Remove the pointless 'do () while (0)' loop from musb_g_tx() -- it makes this function symmetric to musb_g_rx()... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: musb_gadget_ep0: stop abusing musb_gadget_set_halt()Sergei Shtylyov2009-12-112-27/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | Stop playing with musb->lock and abusing musb_gadget_set_halt() in the code clearing the endpoint halt feature -- instead, manipulate the registers directly. While at it, get rid uf unneeded line breaks and over-indentation in the code setting the endpoint halt feature. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: musb_gadget: implement set_wedge() methodSergei Shtylyov2009-12-113-2/+26
| | | | | | | | | | | | | | | | | | Implement the driver's set_wedge() method by adding the 'wedged' flag to the 'struct musb_ep'. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: musb_gadget_ep0: fix unhandled endpoint 0 IRQs, againSergei Shtylyov2009-12-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit a5073b52833e4df8e16c93dc4cbb7e0c558c74a2 (musb_gadget: fix unhandled endpoint 0 IRQs) somehow missed its key change: "The gadget EP0 code routinely ignores an interrupt at end of the data phase because of musb_g_ep0_giveback() resetting the state machine to "idle, waiting for SETUP" phase prematurely." So, the majority of the cases of unhandled IRQs is still unfixed... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: MUSB: save hardware revision at initAnand Gadiyar2009-12-112-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MUSB: save hardware revision at init This can be used later to flag workarounds for issues affecting particular revisions. Saving this at init avoids having to read the HWVERS register multiple times in code. While at it, use macros to extract the version information instead of using hardcoded values. Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Cc: Ajay Kumar Gupta <ajay.gupta@ti.com> Acked-by: Felipe Balbi <felipe.balbi@nokia.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: musb: fix printf warning in debug codeMike Frysinger2009-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The debug code in the DMA ISR uses a %d for a size_t when it should be using %zu. Otherwise gcc whines with: drivers/usb/musb/musbhsdma.c: In function 'dma_controller_irq': drivers/usb/musb/musbhsdma.c:288: warning: format '%d' expects type 'int', but argument 7 has type 'size_t' Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: musb: Blackfin code needs NOP_USB_XCEIV tooCliff Cai2009-12-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we get the link failure: drivers/built-in.o: In function 'musb_platform_init': drivers/usb/musb/blackfin.c:300: undefined reference to 'usb_nop_xceiv_register' make: *** [.tmp_vmlinux1] Error 1 Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: musb: error out when anomaly 05000380 is applicableSonic Zhang2009-12-111-0/+10
| | | | | | | | | | | | | | | | | | | | | | Since we can't work around anomaly 05000380, throw a build error up and instruct the user to use a different mode. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: musb: clear the Blackfin interrupt pending bits early in the ISRCliff Cai2009-12-111-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | If we clear the interrupt pending bits at the end, we sometimes return too fast and have the same interrupt assert itself. There is no way in a Blackfin system to force a sync of this state, so the hardware manual instructs people to clear interrupt flags early in their ISR. Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: musb: fix musb_platform_set_mode() definitionBryan Wu2009-12-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | Update function definition to match latest MUSB framework. Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: musb: add work around for Blackfin anomaly 05000456Sonic Zhang2009-12-111-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Only allow USE_MODE1 when the Blackfin part is not affected by anomaly 05000456 (USB Receive Interrupt Is Not Generated in DMA Mode 1) since we can't support the mode in that case. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
OpenPOWER on IntegriCloud