aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
Commit message (Collapse)AuthorAgeFilesLines
* USB: f_mass_storage: 2048 block size for cdrom devicesFrozenCow2013-03-032-10/+16
| | | | | | | | | | Bios will recognize the cdrom device like most other cdrom devices. This allows people to boot ISOs from their phone. Original by Andreas Kemnade: http://www.spinics.net/lists/linux-usb/msg25178.html Change-Id: Id8fba96e1683f6daa6330b1e59f4a4ca4fe5c271
* USB: f_mass_storage: Added cdrom option to UMS-lun-devicesFrozenCow2013-03-022-0/+42
| | | | | | | This patch allows programs to change the cdrom option at runtime through sysfs. Change-Id: I30a0ffc7f6e9a7f12d95ca1ab07949868aba440c
* Merge 3.0.60Pawit Pornkitprasan2013-01-222-6/+11
|\ | | | | | | Change-Id: I00b211aba537823b54ad68971ebb9032a6bf78f7
| * usb: gadget: dummy: fix enumeration with g_multiSebastian Andrzej Siewior2013-01-171-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 1d16638e3b9cc195bac18a8fcbca748f33c1bc24 upstream. If we do have endpoints named like "ep-a" then bEndpointAddress is counted internally by the gadget framework. If we do have endpoints named like "ep-1" then bEndpointAddress is assigned from the digit after "ep-". If we do have both, then it is likely that after we used up the "generic" endpoints we will use the digits and thus assign one bEndpointAddress to multiple endpoints. This theory can be proofed by using the completely enabled g_multi. Without this patch, the mass storage won't enumerate and times out because it shares endpoints with RNDIS. This patch also adds fills up the endpoints list so we have in total endpoints 1 to 15 in + out available while some of them are restricted to certain types like BULK or ISO. Without this change the nokia gadget won't load because the system does not provide enough (BULK) endpoints but it did before ep-a - ep-f were removed. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * usb: gadget: phonet: free requests in pn_bind()'s error pathSebastian Andrzej Siewior2013-01-111-2/+6
| | | | | | | | | | | | | | | | | | commit d0eca719dd11ad0619e8dd6a1f3eceb95b0216dd upstream. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Merge 3.0.52Pawit Pornkitprasan2012-11-202-6/+8
|\ \ | |/ | | | | | | | | | | | | | | | | Merge branch 'linux-3.0.y' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into jellybean-next Conflicts: drivers/net/tun.c kernel/time/timekeeping.c Change-Id: Iba7fc59ca05114d9e7bade8dfc5bb45229ebf075
| * usb: gadget: Fix g_ether interface link statusKevin Cernekee2012-08-091-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 31bde1ceaa873bcaecd49e829bfabceacc4c512d upstream. A "usb0" interface that has never been connected to a host has an unknown operstate, and therefore the IFF_RUNNING flag is (incorrectly) asserted when queried by ifconfig, ifplugd, etc. This is a result of calling netif_carrier_off() too early in the probe function; it should be called after register_netdev(). Similar problems have been fixed in many other drivers, e.g.: e826eafa6 (bonding: Call netif_carrier_off after register_netdevice) 0d672e9f8 (drivers/net: Call netif_carrier_off at the end of the probe) 6a3c869a6 (cxgb4: fix reported state of interfaces without link) Fix is to move netif_carrier_off() to the end of the function. Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * usb: gadget: fsl_udc_core: dTD's next dtd pointer need to be updated once ↵Peter Chen2012-06-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | written commit 4d0947dec4db1224354e2f6f00ae22ce38e62a43 upstream. dTD's next dtd pointer need to be updated once CPU writes it, or this request may not be handled by controller, then host will get NAK from device forever. This problem occurs when there is a request is handling, we need to add a new request to dTD list, if this new request is added before the current one is finished, the new request is intended to added as next dtd pointer at current dTD, but without wmb(), the dTD's next dtd pointer may not be updated when the controller reads it. In that case, the controller will still get Terminate Bit is 1 at dTD's next dtd pointer, that means there is no next request, then this new request is missed by controller. Signed-off-by: Peter Chen <peter.chen@freescale.com> Acked-by: Li Yang <leoli@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | USB: gadget: fascinatemtd only has one lunjt11342012-10-151-0/+4
| | | | | | | | Change-Id: I9ba97809da6fdc9ef4c278e50f8ecf6b644d1218
* | Merge branch 'android-samsung-3.0-jb-mr0' of ↵Pawit Pornkitprasan2012-10-152-28/+27
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | https://android.googlesource.com/kernel/samsung into HEAD Conflicts: drivers/gpu/pvr/pvrversion.h Change-Id: I93433944a5870a934ea7783df66994bffda2673e
| * | USB: gadget: f_audio_source: Fix compilation errorMike Lockwood2012-08-161-1/+1
| | | | | | | | | | | | | | | Change-Id: I1b785c47bda03208d396473a9d1c94631f5624d9 Signed-off-by: Mike Lockwood <lockwood@google.com>
| * | USB: gadget: f_audio_source: Fix use after free in audio_unbindMike Lockwood2012-08-161-21/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | When USB was disconnected, we were freeing our audio_dev struct in audio_unbind before the audio system had cleaned up, resulting in a hang in audio_pcm_close. We now statically allocate the audio_dev struct to avoid this problem. Change-Id: I58ad21eaa20dcf4aa74ee614ef3b6ed2c91d52a1 Signed-off-by: Mike Lockwood <lockwood@google.com>
| * | USB: gadget: f_audio_source: Fix error handling and increase packet sizeMike Lockwood2012-08-031-4/+2
| | | | | | | | | | | | | | | | | | | | | Fixes watchdog reset on USB disconnect Larger packet size fixes performance in fullspeed mode Signed-off-by: Mike Lockwood <lockwood@google.com>
| * | USB: gadget: s3c: Fix isochronous endpoint support in fullspeed modeMike Lockwood2012-08-021-2/+5
| | | | | | | | | | | | | | | | | | isochronous endpoints are not limited to 64 bytes Signed-off-by: Mike Lockwood <lockwood@google.com>
* | | USB: f_mass_storage: Disable write cache supportChiranjeevi Velempati2012-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | As part of mode sense CBW command, communicate to the host that write cache support is enabled and due to this during the write commnd, the host is asking for FUA and because of this write performance is degrading. Hence during mode sense command, intimate the host that write cache is not supported.
* | | Merge remote-tracking branch 'google/android-samsung-3.0-jb' into HEADPawit Pornkitprasan2012-07-2023-73/+1570
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reverted ad-hoc support for now Conflicts: drivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c drivers/net/wireless/bcmdhd/dhd_linux.c drivers/net/wireless/bcmdhd/wl_android.c drivers/net/wireless/bcmdhd/wl_cfg80211.c Change-Id: Ibaa7a841b177c86a235828e94be5b870f0ac090e
| * | Merge remote-tracking branch 'common/android-3.0' into ↵JP Abgrall2012-05-303-16/+16
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | android-samsung-30-wip-mergedown * common/android-3.0: USB: gadget: f_audio_source: Adjust packet timing to reduce glitches usb: gadget: android: Fix product name net: wireless: bcmdhd: Fix WPS PBC overlap failure usb: gadget: composite: Fix corruption when changing configuration
| | * | USB: gadget: f_audio_source: Adjust packet timing to reduce glitchesMike Lockwood2012-05-291-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Increase max packet size and clean up timing logic so we can better recover from not getting an interrupt in time for a SOF. Signed-off-by: Mike Lockwood <lockwood@google.com>
| | * | usb: gadget: android: Fix product nameBenoit Goby2012-05-291-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Product names may contain spaces and scanf %s only matches the 1st word. Use strlcpy instead. Change-Id: Ie8703fea9775f7fc17fe615a42597ca3816d36b0 Signed-off-by: Benoit Goby <benoit@android.com>
| | * | usb: gadget: composite: Fix corruption when changing configurationBenoit Goby2012-05-211-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the config from the configs list before releasing the spinlock. Otherwise the other cpu might be processing a SET_CONFIGURATION that will switch to the configuration that is being released. Bug: 6521576 Change-Id: Id4da0d0e18ead63e20cb236cd1d3e8e6d116acce Signed-off-by: Benoit Goby <benoit@android.com>
| * | | Merge branch 'android-3.0' into android-samsung-3.0-wipDmitry Shmidt2012-05-173-9/+1285
| |\ \ \ | | |/ /
| | * | USB: gadget: f_audio_source: New gadget driver for audio outputMike Lockwood2012-05-162-0/+887
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver presents a standard USB audio class interface to the host and an ALSA PCM device to userspace Signed-off-by: Mike Lockwood <lockwood@google.com>
| | * | USB: gadget: f_accessory: Add support for HID input devicesMike Lockwood2012-05-152-8/+388
| | | | | | | | | | | | | | | | Signed-off-by: Mike Lockwood <lockwood@google.com>
| | * | Add ACCESSORY_SET_AUDIO_MODE control request and ioctlMike Lockwood2012-05-151-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The control request will be used by the host to enable/disable USB audio and the ioctl will be used by userspace to read the audio mode Signed-off-by: Mike Lockwood <lockwood@google.com>
| * | | Merge remote-tracking branch 'common/android-3.0' into ↵JP Abgrall2012-05-084-4/+4
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | android-samsung-30-wip-mergedown * common/android-3.0: (49 commits) Linux 3.0.31 hfsplus: Fix potential buffer overflows sched: Fix nohz load accounting -- again! wl1251: fix crash on remove due to leftover work item wl1251: fix crash on remove due to premature kfree rtlwifi: Fix oops on unload mac80211: fix AP mode EAP tx for VLAN stations ipw2200: Fix race condition in the command completion acknowledge i2c: pnx: Disable clk in suspend libata: skip old error history when counting probe trials hwmon: (coretemp) fix oops on cpu unplug hwmon: (coretemp) Increase CPU core limit efivars: Improve variable validation efi: Validate UEFI boot variables efivars: fix warnings when CONFIG_PSTORE=n efivars: String functions efi: Add new variable attributes SCSI: libsas: fix false positive 'device attached' conditions SCSI: libsas: fix sas_find_bcast_phy() in the presence of 'vacant' phys ARM: 7403/1: tls: remove covert channel via TPIDRURW ...
| | * | Merge commit 'v3.0.31' into android-3.0Todd Poynor2012-05-084-4/+4
| | |\ \ | | | |/
| | | * usb gadget: uvc: uvc_request_data::length field must be signedLaurent Pinchart2012-05-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 6f6543f53f9ce136e01d7114bf6f0818ca54fb41 upstream. The field is used to pass the UVC request data length, but can also be used to signal an error when setting it to a negative value. Switch from unsigned int to __s32. Reported-by: Fernandez Gonzalo <gfernandez@copreci.es> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * USB: gadget: storage gadgets send wrong error code for unknown commandsAlan Stern2012-05-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit c85dcdac5852295cf6822f5c4331a6ddab72581f upstream. This patch (as1539) fixes a minor bug in the mass-storage gadget drivers. When an unknown command is received, the error code sent back is "Invalid Field in CDB" rather than "Invalid Command". This is because the bitmask of CDB bytes allowed to be nonzero is incorrect. When handling an unknown command, we don't care which command bytes are nonzero. All the bits in the mask should be set, not just eight of them. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | Merge remote-tracking branch 'common/android-3.0' into ↵JP Abgrall2012-05-043-11/+95
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | android-samsung-30-wip-mergedown * common/android-3.0: (135 commits) net: wireless: bcmdhd: Avoid turning radio UP twice on start cpufreq: interactive: add boost pulse interface net: wireless: bcmdhd: Set MMC_PM_KEEP_POWER flag on suspend net: wireless: bcmdhd: Update to Version 5.90.195.61 net: wireless: bcmdhd: Turn OFF wlan power if interface UP fails ARM: vfp: only clear vfp state for current cpu in vfp_pm_suspend arm: vfp: Fix memory corruption on PM suspend Linux 3.0.30 tcp: fix TCP_MAXSEG for established IPv6 passive sockets net ax25: Reorder ax25_exit to remove races. ksz884x: don't copy too much in netdev_set_mac_address() netns: do not leak net_generic data on failed init tcp: fix tcp_grow_window() for large incoming frames dummy: Add ndo_uninit(). net: usb: smsc75xx: fix mtu net_sched: gred: Fix oops in gred_dump() in WRED mode net/ethernet: ks8851_mll fix rx frame buffer overflow net: smsc911x: fix skb handling in receive path 8139cp: set intr mask after its handler is registered atl1: fix kernel panic in case of DMA errors ...
| | * | Merge commit 'v3.0.30' into android-3.0Todd Poynor2012-04-303-11/+95
| | |\ \ | | | |/
| | | * usb: gadget: eliminate NULL pointer dereference (bugfix)Andrzej Pietrasiewicz2012-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 92b0abf80c5c5f0e0d71d1309688a330fd74731b upstream. usb: gadget: eliminate NULL pointer dereference (bugfix) This patch fixes a bug which causes NULL pointer dereference in ffs_ep0_ioctl. The bug happens when the FunctionFS is not bound (either has not been bound yet or has been bound and then unbound) and can be reproduced with running the following commands: $ insmod g_ffs.ko $ mount -t functionfs func /dev/usbgadget $ ./null where null.c is: #include <fcntl.h> #include <linux/usb/functionfs.h> int main(void) { int fd = open("/dev/usbgadget/ep0", O_RDWR); ioctl(fd, FUNCTIONFS_CLEAR_HALT); return 0; } Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * USB: pch_udc: Support new device LAPIS Semiconductor ML7831 IOHTomoya MORINAGA2012-04-222-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 731ad81e2dd97e3f222361f7b3ff4b35639e46af upstream. ML7831 is companion chip for Intel Atom E6xx series. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com> Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * usb: gadget: pch_udc: Reduce redundant interruptTomoya MORINAGA2012-04-221-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 833310402c54ad9b676b465fc53ad276b13d36be upstream. ISSUE: USB Suspend interrupts occur frequently. CAUSE: When it is called pch_udc_reconnect() in USB Suspend, it repeats reset and Suspend. SOLUTION: pch_udc_reconnect() does not enable all interrupts. When an enumeration event occurred the driver enables all interrupts. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * usb: gadget: pch_udc: Fix usb/gadget/pch_udc: Fix ether gadget ↵Tomoya MORINAGA2012-04-221-4/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | connect/disconnect issue commit 1c575d2d2e3ff2a7cb3c2e2165064199cfd8ad32 upstream. ISSUE: After a USB cable is connect/disconnected, the system rarely freezes. CAUSE: Since the USB device controller cannot know to disconnect the USB cable, when it is used without detecting VBUS by GPIO, the UDC driver does not notify to USB Gadget. Since USB Gadget cannot know to disconnect, a false setting occurred when the USB cable is connected/disconnect repeatedly. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * usb: gadget: pch_udc: Fix USB suspend issueTomoya MORINAGA2012-04-221-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 84566abba058b2aae8d603dfa90b5a3778a6714f upstream. ISSUE: After USB Suspend, a system rarely freezes. CAUSE: When USB Suspend occurred, the driver is not notifying a gadget of the event. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * usb: gadget: pch_udc: Fix wrong return valueTomoya MORINAGA2012-04-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit c802672cd36cd063bfd54d54c8c34825ab5b2357 upstream. ISSUE: If the return value of pch_udc_pcd_init() is False, the return value of this function is unsettled. Since pch_udc_pcd_init() always returns 0, there is not actually the issue. CAUSE: If pch_udc_pcd_init() is True, the variable, retval, is not set for an appropriate value. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * usb: gadget: pch_udc: Fix disconnect issueTomoya MORINAGA2012-04-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit c50a3bff0edb0acd49d8033a12ea4668e09a31ad upstream. ISSUE: When the driver notifies a gadget of a disconnect event, a system rarely freezes. CAUSE: When the driver calls dev->driver->disconnect(), it is not calling spin_unlock(). Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | Merge remote-tracking branch 'common/android-3.0' into ↵JP Abgrall2012-04-245-15/+15
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | android-samsung-30-wip-mergedown * common/android-3.0: (1178 commits) cpufreq: interactive: remove unused target_validate_time_in_idle cpufreq: interactive: Boost frequency on touchscreen input cpufreq: Separate speed target revalidate time and initial set time cpufreq: interactive: based hispeed bump on target freq, not actual cpufreq: interactive: adjust code and documentation to match cpufreq: interactive: configurable delay before raising above hispeed sync: add poll support sw_sync: add fill_driver_data support sync: add ioctl to get fence data sw_sync: add debug support sync: add debugfs support sync: add timestamps to sync_pts sw_sync: add cpu based sync driver sync: Add synchronization framework Linux 3.0.28 Bluetooth: Fix l2cap conn failures for ssp devices TOMOYO: Fix mount flags checking order. iommu/amd: Make sure IOMMU interrupts are re-enabled on resume cred: copy_process() should clear child->replacement_session_keyring ASoC: ak4642: fixup: mute needs +1 step ... Conflicts: mm/compaction.c Change-Id: I3dc59225d2435eddbed0c639155179e580891ac8 Signed-off-by: JP Abgrall <jpa@google.com>
| | * | Merge linux-stable 3.0.28 into android-3.0Todd Poynor2012-04-195-15/+15
| | |\ \ | | | |/ | | | | | | | | | | | | Change-Id: Iee820738e53627f5d0447a87ceff34443aa72786 Signed-off-by: Todd Poynor <toddpoynor@google.com>
| | | * usb: fsl_udc_core: Fix scheduling while atomic dump messagePeter Chen2012-04-021-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit c5cc5ed86667d4ae74fe40ee4ed893f4b46aba05 upstream. When loading g_ether gadget, there is below message: Backtrace: [<80012248>] (dump_backtrace+0x0/0x10c) from [<803cb42c>] (dump_stack+0x18/0x1c) r7:00000000 r6:80512000 r5:8052bef8 r4:80513f30 [<803cb414>] (dump_stack+0x0/0x1c) from [<8000feb4>] (show_regs+0x44/0x50) [<8000fe70>] (show_regs+0x0/0x50) from [<8004c840>] (__schedule_bug+0x68/0x84) r5:8052bef8 r4:80513f30 [<8004c7d8>] (__schedule_bug+0x0/0x84) from [<803cd0e4>] (__schedule+0x4b0/0x528) r5:8052bef8 r4:809aad00 [<803ccc34>] (__schedule+0x0/0x528) from [<803cd214>] (_cond_resched+0x44/0x58) [<803cd1d0>] (_cond_resched+0x0/0x58) from [<800a9488>] (dma_pool_alloc+0x184/0x250) r5:9f9b4000 r4:9fb4fb80 [<800a9304>] (dma_pool_alloc+0x0/0x250) from [<802a8ad8>] (fsl_req_to_dtd+0xac/0x180) [<802a8a2c>] (fsl_req_to_dtd+0x0/0x180) from [<802a8ce4>] (fsl_ep_queue+0x138/0x274) [<802a8bac>] (fsl_ep_queue+0x0/0x274) from [<7f004328>] (composite_setup+0x2d4/0xfac [g_ether]) [<7f004054>] (composite_setup+0x0/0xfac [g_ether]) from [<802a9bb4>] (fsl_udc_irq+0x8dc/0xd38) [<802a92d8>] (fsl_udc_irq+0x0/0xd38) from [<800704f8>] (handle_irq_event_percpu+0x54/0x188) [<800704a4>] (handle_irq_event_percpu+0x0/0x188) from [<80070674>] (handle_irq_event+0x48/0x68) [<8007062c>] (handle_irq_event+0x0/0x68) from [<800738ec>] (handle_level_irq+0xb4/0x138) r5:80514f94 r4:80514f40 [<80073838>] (handle_level_irq+0x0/0x138) from [<8006ffa4>] (generic_handle_irq+0x38/0x44) r7:00000012 r6:80510b1c r5:80529860 r4:80512000 [<8006ff6c>] (generic_handle_irq+0x0/0x44) from [<8000f4c4>] (handle_IRQ+0x54/0xb4) [<8000f470>] (handle_IRQ+0x0/0xb4) from [<800085b8>] (tzic_handle_irq+0x64/0x94) r9:412fc085 r8:00000000 r7:80513f30 r6:00000001 r5:00000000 r4:00000000 [<80008554>] (tzic_handle_irq+0x0/0x94) from [<8000e680>] (__irq_svc+0x40/0x60) The reason of above dump message is calling dma_poll_alloc with can-schedule mem_flags at atomic context. To fix this problem, below changes are made: - fsl_req_to_dtd doesn't need to be protected by spin_lock_irqsave, as struct usb_request can be access at process context. Move lock to beginning of hardware visit (fsl_queue_td). - Change the memory flag which using to allocate dTD descriptor buffer, the memory flag can be from gadget layer. It is tested at i.mx51 bbg board with g_mass_storage, g_ether, g_serial. Signed-off-by: Peter Chen <peter.chen@freescale.com> Acked-by: Li Yang <leoli@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * USB: gadget: Make g_hid device class conform to spec.Orjan Friberg2012-04-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 33d2832ab0149a26418d360af3c444969a63fb28 upstream. HID devices should specify this in their interface descriptors, not in the device descriptor. This fixes a "missing hardware id" bug under Windows 7 with a VIA VL800 (3.0) controller. Signed-off-by: Orjan Friberg <of@flatfrog.com> Cc: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * usb: gadgetfs: return number of bytes on ep0 read requestThomas Faber2012-04-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 85b4b3c8c189e0159101f7628a71411af072ff69 upstream. A read from GadgetFS endpoint 0 during the data stage of a control request would always return 0 on success (as returned by wait_event_interruptible) despite having written data into the user buffer. This patch makes it correctly set the return value to the number of bytes read. Signed-off-by: Thomas Faber <thfabba@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * usb: gadget: zero: fix bug in loopback autoresume handlingTimo Juhani Lindfors2012-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 683da59d7b8ae04891636d4b59893cd4e9b0b7e5 upstream. ab943a2e125b (USB: gadget: gadget zero uses new suspend/resume hooks) introduced a copy-paste error where f_loopback.c writes to a variable declared in f_sourcesink.c. This prevents one from creating gadgets that only have a loopback function. Signed-off-by: Timo Juhani Lindfors <timo.lindfors@iki.fi> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * USB: g_printer: fix bug in unregistrationFabian Godehardt2011-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 8582d86143c690c68cc42f996def466a035bee34 upstream. The allocated chardevice region range is only 1 device but on unregister it currently tries to deregister 2. Found this while doing a insmod/rmmod/insmod/rm... of the module which seemed to eat major numbers. Signed-off-by: Fabian Godehardt <fg@emlix.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | | USB: gadget: s3c: iscochronous endpoint supportMike Lockwood2012-04-024-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix problems working with isochronous endpoints Configure the single remaining unallocated endpoint as isochronous IN Signed-off-by: Mike Lockwood <lockwood@google.com>
| * | | usb: gadget: s3c: Enable some debugging via pr_debug()+DYNAMIC_DEBUGJP Abgrall2012-03-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we have CONFIG_DYNAMIC_DEBUG=y it will allow us to enable ISR and setup debugging at runtime. This will help track down why the android gadget is doing work for no apparent reason some times. Work is only schedule by disconnect() and setup() calls from within the s3c_udc_otg code. Bug: 6188924 Change-Id: I796a30ebd8ce3f126201c46d56dae175875bc96b Signed-off-by: JP Abgrall <jpa@google.com>
| * | | Merge branch 'android-3.0' into android-samsung-3.0-wipBenoit Goby2012-03-232-9/+120
| |\ \ \ | | |/ /
| | * | usb: gadget: adb: Only enable the gadget when adbd is readyBenoit Goby2012-03-212-9/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When adb is enabled, only connect the gadget when adbd is ready. If adbd dies or is restarted (e.g. "adb root"), the gadget is disconnected when the adb device is close, and it is re-connected once adb re-open the device. - Add callbacks to adb, similar to FunctionFs callbacks, to notify the gadget when the daemon is ready or closed. - Refcount calls to android_enable/android_disable to enable the gadget only once all the function daemons are ready. - Add enable/disble to android_usb_function to notify the function when it is added/removed from the list of enabled functions. Change-Id: Id54ff85aec9cf8715c94b4f9bd6137a79ad58bfc Signed-off-by: Benoit Goby <benoit@android.com>
| * | | Merge remote-tracking branch 'common/android-3.0' into ↵JP Abgrall2012-02-063-11/+16
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | android-samsung-30-wip-mergedown * common/android-3.0: Input: evdev - fix variable initialisation Input: evdev - Add ioctl to block suspend while event queue is not empty. Input: evdev - Don't hold wakelock when no data is available to user-space net: wireless: bcmdhd: Increase pm_notify callback priority net: wireless: bcmdhd: Fix crash on dhdsdio_probe_attach() failure net: wireless: bcmdhd: Daemonize wl_event_handler net: wireless: bcmdhd: Update to Version 5.90.195.23 net: wireless: bcmdhd: Update to Version 5.90.195.22 net: wireless: bcmdhd: Update to Version 5.90.195.19 net: wireless: bcmdhd: Update to Version 5.90.195.15 net: wireless: bcmdhd: Add WIPHY_FLAG_SUPPORTS_FW_ROAM flag net: wireless: bcmdhd: Fake PNO event to wake up the wpa_supplicant usb: gadget: android: Honor CONFIG_USB_GADGET_VBUS_DRAW usb: gadget: Fix usb string id allocation nl80211/cfg80211: Make addition of new sinfo fields safer cfg80211/nl80211: Send AssocReq IEs to user space in AP mode misc: remove android pmem driver, it's obsolete. Revert "proc: enable writing to /proc/pid/mem" ram_console: set CON_ANYTIME console flag Conflicts: drivers/misc/Kconfig Change-Id: I7d64300b228a0fc05e700f283a02f830bcadd371
| | * | usb: gadget: android: Honor CONFIG_USB_GADGET_VBUS_DRAWScott Anderson2012-01-251-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The maximum current draw was hard coded to 500 mA. composite.c has code that uses CONFIG_USB_GADGET_VBUS_DRAW to set the bMaxPower and to set whether or not the device is self-powered if they haven't been set. This change removes the code in android.c to allow composite.c to set them. Change-Id: I9db37922e91ee86e9e5c0e14519e119e5c41ca48 Signed-off-by: Scott Anderson <saa@google.com>