]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
13 years agoRevert "usb: usb_storage: do not align length of request for CBW to maxp size"
Greg Kroah-Hartman [Thu, 14 Apr 2011 20:42:46 +0000 (13:42 -0700)]
Revert "usb: usb_storage: do not align length of request for CBW to maxp size"

This reverts commit 806e8f8fcc27e1753947bd9f059ba2316cf8f92a.

To quote Alan Stern:
The necessity for this patch has been under discussion.

It turns out the UDC that Mian has been working on and Felipe's
UDC have contradictory requirements.  Mian's UDC driver wants a
bulk-OUT transfer length to be shorter than the maxpacket size
if a short packet is expected, whereas Felipe's UDC hardware
always needs bulk-OUT transfer lengths to be evenly divisible by
the maxpacket size.

Mian has agreed to go back over the driver to resolve this
conflict.  This means we probably will not want this patch after
all.  (In fact, we may ultimately decide to change the gadget
framework to require that bulk-OUT transfer lengths _always_ be
divisible by the maxpacket size -- only the g_file_storage and
g_mass_storage gadgets would need to be changed.)

Cc: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Cc: Michal Nazarewicz <mina86@mina86.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoRevert "USB: isp1760-hcd: move imask clear after pending work is done"
Greg Kroah-Hartman [Thu, 14 Apr 2011 20:37:07 +0000 (13:37 -0700)]
Revert "USB: isp1760-hcd: move imask clear after pending work is done"

This reverts commit 5808544690300071f09eef9ab83a0fb1f60cf1cd.

To quote Richard:
I don't think this should be mainlined. It was a
misunderstanding on my part.  If you see all the other hdc
drivers in the same location, they all do the same thing (i.e.
clear the interrupt status first, then do the work) that
"glitch" I think I saw was actually two back-to-back
interrupts.

Sebastian (the original author of isp1760) explained it to me a
few days after my submission.

sorry for the confusion

Cc: Richard Retanubun <RichardRetanubun@ruggedcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoARM: 6879/1: fix personality test wrt usage of domain handlers
Nicolas Pitre [Wed, 13 Apr 2011 04:01:52 +0000 (05:01 +0100)]
ARM: 6879/1: fix personality test wrt usage of domain handlers

There are optional bits that may complement a personality ID.  It is
therefore wrong to simply test against the absolute current->personality
value to determine the effective personality.  The PER_LINUX_32BIT is
itself just PER_LINUX with one of those optional bits set.

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
13 years agoARM: 6878/1: fix personality flag propagation across an exec
Nicolas Pitre [Wed, 13 Apr 2011 03:59:36 +0000 (04:59 +0100)]
ARM: 6878/1: fix personality flag propagation across an exec

Our SET_PERSONALITY() implementation was overwriting all existing
personality flags, including ADDR_NO_RANDOMIZE, making them unavailable
to processes being exec'd after a call to personality() in user space.
This prevents the gdb test suite from running successfully.

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
13 years agoARM: 6877/1: the ADDR_NO_RANDOMIZE personality flag should be honored with mmap()
Nicolas Pitre [Wed, 13 Apr 2011 03:57:17 +0000 (04:57 +0100)]
ARM: 6877/1: the ADDR_NO_RANDOMIZE personality flag should be honored with mmap()

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
13 years agoARM: 6876/1: Kconfig.debug: Remove unused CONFIG_DEBUG_ERRORS
Stephen Boyd [Mon, 11 Apr 2011 18:06:26 +0000 (19:06 +0100)]
ARM: 6876/1: Kconfig.debug: Remove unused CONFIG_DEBUG_ERRORS

This config option isn't actually used anywhere and can be safely
removed. The last user was traps.c before commit 082f47a ([ARM]
always allow dump_stack() to produce a backtrace, 2007-07-05).

Reviewed-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
13 years agoARM: SAMSUNG: Fix warning 's3c_pm_show_resume_irqs' defined but not used
Maurus Cuelenaere [Sat, 2 Apr 2011 01:50:22 +0000 (10:50 +0900)]
ARM: SAMSUNG: Fix warning 's3c_pm_show_resume_irqs' defined but not used

s3c_pm_show_resume_irqs() is used by some s3c_pm_arch_show_resume_irqs()
implementations, which get included through mach/pm-core.h. Add __maybe_unused
to silence warnings when it isn't used (e.g. on S3C64XX platforms).

Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
13 years agoARM: SAMSUNG: Fix build failure in PM CRC check code
Abhilash Kesavan [Fri, 25 Mar 2011 08:45:19 +0000 (17:45 +0900)]
ARM: SAMSUNG: Fix build failure in PM CRC check code

This patch fixes build error that occurs on enabling the Samsung
specific PM CRC check code. Missed removing this reference of
s3c_sleep_save_phys during move to generic cpu suspend/resume
support.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
13 years agoARM: S5P: Remove unused s3c_pm_check_resume_pin
Abhilash Kesavan [Fri, 25 Mar 2011 08:00:48 +0000 (17:00 +0900)]
ARM: S5P: Remove unused s3c_pm_check_resume_pin

The s3c_pm_check_resume_pin() is not being used and can be safely
removed to fix the build warning.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
13 years agousb: gadget: storage_common: use kstrto*()
Michal Nazarewicz [Wed, 13 Apr 2011 22:37:00 +0000 (00:37 +0200)]
usb: gadget: storage_common: use kstrto*()

This commit replaces the usage of strict_strtoul() (which
became deprecated after commit 33ee3b2e) with kstrtouint().

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ohci: add bus glue for the Atheros AR71XX/AR7240 SoCs
Gabor Juhos [Wed, 13 Apr 2011 08:54:24 +0000 (10:54 +0200)]
USB: ohci: add bus glue for the Atheros AR71XX/AR7240 SoCs

The Atheros AR71XX/AR7240 SoCs have a built-in OHCI controller.
This patch adds the necessary glue code to make the generic OHCI
driver usable for them.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ehci: add workaround for Synopsys HC bug
Gabor Juhos [Wed, 13 Apr 2011 08:54:23 +0000 (10:54 +0200)]
USB: ehci: add workaround for Synopsys HC bug

A Synopsys USB core used in various SoCs has a bug which might cause
that the host controller not issuing ping.

When software uses the Doorbell mechanism to remove queue heads, the
host controller still has references to the removed queue head even
after indicating an Interrupt on Async Advance. This happens if the last
executed queue head's Next Link queue head is removed.

Consequences of the defect:
The Host controller fetches the removed queue head, using memory that
would otherwise be deallocated.This results in incorrect transactions on
both the USB and system memory. This may result in undefined behavior.

Workarounds:

1) If no queue head is active (no Status field's Active bit is set)
after removing the queue heads, the software can write one of the valid
queue head addresses to the ASYNCLISTADDR register and deallocate the
removed queue head's memory after 2 microframes.

If one or more of the queue heads is active (the Active bit is set in
the Status field) after removing the queue heads, the software can delay
memory deallocation after time X, where X is the time required for the
Host Controller to go through all the queue heads once. X varies with
the number of queue heads and the time required to process periodic
transactions: if more periodic transactions must be performed, the Host
Controller has less time to process asynchronous transaction processing.

2) Do not use the Doorbell mechanism to remove the queue heads. Disable
the Asynchronous Schedule Enable bit instead.

The bug has been discussed on the linux-usb-devel mailing-list
four years ago, the original thread can be found here:
http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg45345.html

This patch implements the first workaround as suggested by David Brownell.

The built-in USB host controller of the Atheros AR7130/AR7141/AR7161 SoCs
requires this to work properly.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ehci: add bus glue for the Atheros AR71XX/AR724X/AR91XX SoCs
Gabor Juhos [Wed, 13 Apr 2011 08:54:22 +0000 (10:54 +0200)]
USB: ehci: add bus glue for the Atheros AR71XX/AR724X/AR91XX SoCs

The Atheros AR71XX/AR91XX SoCs have a built-in EHCI controller.
This patch adds the necessary glue code to make the generic EHCI
driver usable for them.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoxHCI: Implement AMD PLL quirk
Andiry Xu [Tue, 22 Mar 2011 09:08:14 +0000 (17:08 +0800)]
xHCI: Implement AMD PLL quirk

This patch disable the optional PM feature inside the Hudson3 platform under
the following conditions:

1. If an isochronous device is connected to xHCI port and is active;
2. Optional PM feature that powers down the internal Bus PLL when the link is
   in low power state is enabled.

The PM feature needs to be disabled to eliminate PLL startup delays when the
link comes out of low power state. The performance of DMA data transfer could
be impacted if system delay were encountered and in addition to the PLL start
up delays. Disabling the PM would leave room for unpredictable system delays
in order to guarantee uninterrupted data transfer to isochronous audio or
video stream devices that require time sensitive information. If data in an
audio/video stream was interrupted then erratic audio or video performance
may be encountered.

AMD PLL quirk is already implemented in OHCI/EHCI driver. After moving the
quirk code to pci-quirks.c and export them, xHCI driver can call it directly
without having the quirk implementation in itself.

Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
13 years agoxhci: Tell USB core both roothubs lost power.
Sarah Sharp [Wed, 13 Apr 2011 00:43:19 +0000 (17:43 -0700)]
xhci: Tell USB core both roothubs lost power.

On a resume, when the power is lost during hibernate, the USB core will
call hub_reset_resume for the xHCI USB 2.0 roothub, but not for the USB
3.0 roothub:

[  164.748310] usb usb1: root hub lost power or was reset
[  164.748353] usb usb2: root hub lost power or was reset
[  164.748487] usb usb3: root hub lost power or was reset
[  164.748488] xhci_hcd 0000:01:00.0: Stop HCD
...
[  164.870039] hub 4-0:1.0: hub_resume
...
[  164.870054] hub 3-0:1.0: hub_reset_resume

This causes issues later, because the USB core assumes the USB 3.0 hub
attached to the USB 3.0 roothub is still active.  It attempts to queue a
control URB for the external hub, which fails because all the device
slot contexts were released when the USB 3.0 roothub lost power:

[  164.980044] hub 4-1:1.0: hub_resume
[  164.980047] xhci_hcd 0000:01:00.0: Get port status returned 0x10101
[  164.980049] xHCI xhci_urb_enqueue called with unaddressed device
[  164.980053] hub 3-0:1.0: port 1: status 0101 change 0001
[  164.980056] hub 4-1:1.0: hub_port_status failed (err = -22)
[  164.980060] xhci_hcd 0000:01:00.0: `MEM_WRITE_DWORD(3'b000, 32'hffffc90008948440, 32'h202e1, 4'hf);
[  164.980062] xHCI xhci_urb_enqueue called with unaddressed device
[  164.980066] xhci_hcd 0000:01:00.0: clear port connect change, actual port 0 status  = 0x2e1
[  164.980069] hub 4-1:1.0: hub_port_status failed (err = -22)
[  164.980072] xhci_hcd 0000:01:00.0: get port status, actual port 1 status  = 0x2a0
[  164.980074] xHCI xhci_urb_enqueue called with unaddressed device
[  164.980077] xhci_hcd 0000:01:00.0: Get port status returned 0x100
[  164.980079] hub 4-1:1.0: hub_port_status failed (err = -22)
[  164.980082] xHCI xhci_urb_enqueue called with unaddressed device
[  164.980085] hub 4-1:1.0: hub_port_status failed (err = -22)
[  164.980088] hub 4-1:1.0: port 4: status 0000 change 0000
[  164.980091] xHCI xhci_urb_enqueue called with unaddressed device
[  164.980094] hub 4-1:1.0: activate --> -22
[  164.980113] xHCI xhci_urb_enqueue called with unaddressed device
[  164.980117] hub 4-1:1.0: hub_port_status failed (err = -22)
[  164.980119] xHCI xhci_urb_enqueue called with unaddressed device
[  164.980123] hub 4-1:1.0: can't resume port 4, status -22
[  164.980126] hub 4-1:1.0: port 4 status ffff.ffff after resume, -22
[  164.980129] usb 4-1.4: can't resume, status -22
[  164.980131] hub 4-1:1.0: logical disconnect on port 4

This causes issues when a USB 3.0 hard drive is attached to the external
USB 3.0 hub when the system is hibernated:

[ 6249.849653] sd 8:0:0:0: [sdb] Unhandled error code
[ 6249.849659] sd 8:0:0:0: [sdb]  Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 6249.849663] sd 8:0:0:0: [sdb] CDB: Read(10): 28 00 00 00 2a 08 00 00 02 00
[ 6249.849671] end_request: I/O error, dev sdb, sector 10760

Make sure to inform the USB core that *both* xHCI roothubs lost power.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
13 years agousbcore: Bug fix: system can't suspend with USB3.0 device connected to USB3.0 hub
Andiry Xu [Thu, 31 Mar 2011 06:56:50 +0000 (14:56 +0800)]
usbcore: Bug fix: system can't suspend with USB3.0 device connected to USB3.0 hub

This patch clear PORT_POWER when suspend a USB3.0 device behind a USB3.0
external hub, so the system can suspend and resume.

Note USB3.0 device may not work after system resume and this is a temporary
workaround. The correct fix will be in future patches.

Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
13 years agoUSB: Fix unplug of device with active streams
Matthew Wilcox [Tue, 28 Sep 2010 04:57:32 +0000 (00:57 -0400)]
USB: Fix unplug of device with active streams

If I unplug a device while the UAS driver is loaded, I get an oops
in usb_free_streams().  This is because usb_unbind_interface() calls
usb_disable_interface() which calls usb_disable_endpoint() which sets
ep_out and ep_in to NULL.  Then the UAS driver calls usb_pipe_endpoint()
which returns a NULL pointer and passes an array of NULL pointers to
usb_free_streams().

I think the correct fix for this is to check for the NULL pointer
in usb_free_streams() rather than making the driver check for this
situation.  My original patch for this checked for dev->state ==
USB_STATE_NOTATTACHED, but the call to usb_disable_interface() is
conditional, so not all drivers would want this check.

Note from Sarah Sharp: This patch does avoid a potential dereference,
but the real fix (which will be implemented later) is to set the
.soft_unbind flag in the usb_driver structure for the UAS driver, and
all drivers that allocate streams.  The driver should free any streams
when it is unbound from the interface.  This avoids leaking stream rings
in the xHCI driver when usb_disable_interface() is called.

This should be queued for stable trees back to 2.6.35.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
13 years agoUSB: xhci - also free streams when resetting devices
Dmitry Torokhov [Wed, 13 Apr 2011 06:06:28 +0000 (23:06 -0700)]
USB: xhci - also free streams when resetting devices

Currently, when resetting a device, xHCI driver disables all but one
endpoints and frees their rings, but leaves alone any streams that
might have been allocated. Later, when users try to free allocated
streams, we oops in xhci_setup_no_streams_ep_input_ctx() because
ep->ring is NULL.

Let's free not only rings but also stream data as well, so that
calling free_streams() on a device that was reset will be safe.

This should be queued for stable trees back to 2.6.35.

Reviewed-by: Micah Elizabeth Scott <micah@vmware.com>
Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
13 years agoARM: EXYNOS4: Add usb ehci device to the NURI board
Joonyoung Shim [Fri, 8 Apr 2011 04:22:11 +0000 (13:22 +0900)]
ARM: EXYNOS4: Add usb ehci device to the NURI board

This patch is to support usb ehci device to the NURI board.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: Add initial S5P EHCI driver
Joonyoung Shim [Fri, 8 Apr 2011 05:08:50 +0000 (14:08 +0900)]
USB: Add initial S5P EHCI driver

This patch adds host USB high speed driver for samsung S5P series. This
is initial driver and we need additional implementation to support some
functions like power management.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoARM: EXYNOS4: Add usb host phy control
Joonyoung Shim [Fri, 8 Apr 2011 04:22:10 +0000 (13:22 +0900)]
ARM: EXYNOS4: Add usb host phy control

EXYNOS4 has 2 phys for usb host and usb device. This patch supports to
control usb host phy of EXYNOS4.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoARM: S5P: Add usb ehci device
Joonyoung Shim [Fri, 8 Apr 2011 04:22:09 +0000 (13:22 +0900)]
ARM: S5P: Add usb ehci device

This patch adds usb ehci device definition for samsung s5p cpus.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoRevert "USB: sam-ba: add driver for Atmel SAM Boot Assistant (SAM-BA)"
Johan Hovold [Mon, 4 Apr 2011 09:38:07 +0000 (11:38 +0200)]
Revert "USB: sam-ba: add driver for Atmel SAM Boot Assistant (SAM-BA)"

This reverts commit 90593899de83a6e6fdea563d058acd2f4334e3f9.

SAM-BA devices identify themselves CDC-ACM devices and should be using
the cdc-acm driver.

Since commit 5b239f0aebd4dd6f85b13decf5e18e86e35d57f0 (USB: cdc-acm: Add pseudo
modem without AT command capabilities) cdc-acm also binds to them.

Note that the Atmel SAM-BA tools expect to use a USB-serial driver and thus
require a symlink from /dev/ttyACMn to some /dev/ttyUSBm (with m < 30) to be
able to select the device. This is simply a UI-issue that should be
fixed by Atmel.

Tested with the SAM-BA 2.10 tools and an Atmel at91sam9260-ek.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: Sven Köhler <sven.koehler@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: twl4030-usb: Report correct vbus value for accessory charger adapters1
Matthias Kaehlcke [Fri, 1 Apr 2011 21:02:07 +0000 (23:02 +0200)]
USB: twl4030-usb: Report correct vbus value for accessory charger adapters1

The twl4030-usb driver exports the status of VBUS as sysfs attribute.
In case an accessory charger adapter (ACA) is connected to the OTG
transceiver the attribute is always 'off', even when the charger
provides VBUS. Added a variable to keep track of the status of VBUS
and report it correctly

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@tomtom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: Mark ehci_adjust_port_wakeup_flags as __maybe_unused
Fabio Estevam [Tue, 12 Apr 2011 12:31:54 +0000 (09:31 -0300)]
USB: Mark ehci_adjust_port_wakeup_flags as __maybe_unused

Mark ehci_adjust_port_wakeup_flags as __maybe_unused to avoid the following
warning when building the ehci-mxc driver:

  CC      drivers/usb/host/ehci-hcd.o
drivers/usb/host/ehci-hub.c:130: warning: 'ehci_adjust_port_wakeup_flags' defined but not used

Current ehci-mxc driver implementation does not support suspend/resume.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: fix a typo in a comment
Weiping Pan(潘卫平) [Mon, 11 Apr 2011 10:16:15 +0000 (18:16 +0800)]
usb: fix a typo in a comment

replace tranmitted with transmitted.

Signed-off-by: Weiping Pan(潘卫平) <panweiping3@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb/otg: fix twl6030 macro
Randy Dunlap [Fri, 8 Apr 2011 17:11:44 +0000 (10:11 -0700)]
usb/otg: fix twl6030 macro

Fix warning caused by stray semi-colon at end of macro:

drivers/usb/otg/twl6030-usb.c:183: warning: ISO C90 forbids mixed declarations and code

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Hema HK <hemahk@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: gadget: f_mass_storage: If 'ro'/'cdrom' specified, open file as read-only
Roger Quadros [Tue, 5 Apr 2011 15:36:39 +0000 (18:36 +0300)]
usb: gadget: f_mass_storage: If 'ro'/'cdrom' specified, open file as read-only

If we don't need Write access then attempt to open backing file in Read Only
mode instead of bailing out too soon.

Signed-off-by: Roger Quadros <roger.quadros@nokia.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: gadget: f_mass_storage: Fix Bulk-only RESET handling
Roger Quadros [Tue, 5 Apr 2011 15:36:38 +0000 (18:36 +0300)]
usb: gadget: f_mass_storage: Fix Bulk-only RESET handling

The ep0 request tag was not recorded thus resulting in phase
problems while sending status/response in handle_execption() handler.
This was resulting in MSC compliance test failures with USBCV tool.

With this patch, the Bulk-Only Mass storage RESET request is
handled correctly and the MSC compliance tests pass.

Signed-off-by: Roger Quadros <roger.quadros@nokia.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: u132-hcd: Drop __TIME__ usage
Michal Marek [Tue, 5 Apr 2011 14:59:11 +0000 (16:59 +0200)]
usb: u132-hcd: Drop __TIME__ usage

The kernel already prints its build timestamp during boot, no need to
repeat it in random drivers and produce different object files each
time.

Cc: Tony Olech <tony.olech@elandigitalsystems.com>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: ftdi-elan: Drop __TIME__ usage
Michal Marek [Tue, 5 Apr 2011 14:59:12 +0000 (16:59 +0200)]
usb: ftdi-elan: Drop __TIME__ usage

The kernel already prints its build timestamp during boot, no need to
repeat it in random drivers and produce different object files each
time.

Cc: Tony Olech <tony.olech@elandigitalsystems.com>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: UHCI: don't try to revive a dead controller
Alan Stern [Tue, 5 Apr 2011 17:35:53 +0000 (13:35 -0400)]
USB: UHCI: don't try to revive a dead controller

This patch (as1457) abandons the curious strategy of declaring a
controller dead following hibernation merely in order to reset and
then revive it.  The core no longer allow dead controllers to spring
back to life when the system resumes, so there's no reason to declare
a working controller temporarily dead.  Instead we do an explicit
reset.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: UHCI: remove uses of hcd->state
Alan Stern [Tue, 5 Apr 2011 17:36:04 +0000 (13:36 -0400)]
USB: UHCI: remove uses of hcd->state

This patch (as1456) removes all uses of hcd->state from the uhci-hcd
driver, as part of the overall strategy to eliminate hcd->state
completely.  Now when a controller dies we call usb_hc_died()
directly, instead of relying on the core interrupt handler to see that
hcd->state has changed to HC_STATE_HALT and make the call for us.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: don't enter usb subdirectories directly
Felipe Balbi [Thu, 7 Apr 2011 07:59:34 +0000 (10:59 +0300)]
usb: don't enter usb subdirectories directly

Instead, make we enter usb/ directory on all
needed cases and enter the subdirectories from
drivers/usb/Makefile.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoBlackfin: SMP: fix cache flush loop
Sonic Zhang [Tue, 12 Apr 2011 08:16:04 +0000 (08:16 +0000)]
Blackfin: SMP: fix cache flush loop

The recent commit (10774912647781) wasn't entirely correct.  While
it fixed some issues, it introduced others.  So pull in the fixes
from the public cache flush functions, and document why we need to
call things directly ourselves.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agoBlackfin: time-ts: ack gptimer sooner to avoid missing short ints
Mike Frysinger [Mon, 4 Apr 2011 15:26:11 +0000 (15:26 +0000)]
Blackfin: time-ts: ack gptimer sooner to avoid missing short ints

If the period of a gptimer is fairly low, we might miss an interrupt
by acking it too late (we end up acking the new int as well).

Reported-by: Isabelle Leonardi <i.leonardi@detracom.fr>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agoBlackfin: gptimers: fix thinko when disabling timers
Mike Frysinger [Mon, 4 Apr 2011 15:20:50 +0000 (15:20 +0000)]
Blackfin: gptimers: fix thinko when disabling timers

We only want to clear the run bit for this one timer, not all status bits.
So don't read the whole reg and then write all the bits back out.

Reported-by: Isabelle Leonardi <i.leonardi@detracom.fr>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agoBlackfin: SMP: make all barriers handle cache issues
Graf Yang [Thu, 7 Jan 2010 06:57:30 +0000 (06:57 +0000)]
Blackfin: SMP: make all barriers handle cache issues

When suspending/resuming, the common task freezing code will run in
parallel and freeze processes on each core.  This is because the code
uses the non-smp version of memory barriers (as well it should).

The Blackfin smp barrier logic at the moment contains the cache sync
logic, but the non-smp barriers do not.  This is incorrect as Rafel
summarized:
> ...
> The existing memory barriers are SMP barriers too, but they are more
> than _just_ SMP barriers.  At least that's how it is _supposed_ to be
> (eg. rmb() is supposed to be stronger than smp_rmb()).
> ...
> However, looking at the blackfin's definitions of SMP barriers I see
> that it uses extra stuff that should _also_ be used in the definitions
> of the mandatory barriers.
> ...

URL: http://lkml.org/lkml/2011/4/13/11
LKML-Reference: <BANLkTi=F-C-vwX4PGGfbkdTBw3OWL-twfg@mail.gmail.com>
Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agousb gadget: fix all Section mismatch warnings
Randy Dunlap [Fri, 1 Apr 2011 18:24:30 +0000 (11:24 -0700)]
usb gadget: fix all Section mismatch warnings

Fix 41 occurrences of this type of Section mismatch warning
in g_mass_storage, g_serial, g_cdc, g_multi, g_nokia, g_ether, g_ffs:
(the 75 number reported earlier contained some duplicates.)

WARNING: drivers/usb/gadget/g_mass_storage.o(.text+0x687a): Section mismatch in reference from the function fsg_bind() to the function .devinit.text:usb_ep_autoconfig()
The function fsg_bind() references
the function __devinit usb_ep_autoconfig().
This is often because fsg_bind lacks a __devinit
annotation or the annotation of usb_ep_autoconfig is wrong.

Also remove __devinit from usb_ep_autoconfig_reset() to prevent
possible section mismatch problems with it.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: sl811: add Kconfig option for ISOCHRONOUS mode
Mike Frysinger [Tue, 22 Mar 2011 19:35:39 +0000 (15:35 -0400)]
USB: sl811: add Kconfig option for ISOCHRONOUS mode

Some bluetooth dongles want ISO mode, and the limited support that the
sl811 offers today is sufficient.  So add a Kconfig option for people
to optionally get access to the partial functionality.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: g_file_storage: don't send padding when stall=n
Alan Stern [Fri, 25 Mar 2011 15:46:27 +0000 (11:46 -0400)]
USB: g_file_storage: don't send padding when stall=n

This patch (as1455) removes the extra padding sent by g_file_storage
and g_mass_storage when the gadget wants to send less data than
requested by the host and isn't allowed to halt the bulk-IN endpoint.

Although the Bulk-Only Transport specification requires the padding to
be present, it isn't truly needed since the transfer will be terminated
by a short packet anyway.  Furthermore, many existing devices don't
bother to send any padding.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-By: Michal Nazarewicz <mina86@mina86.com>
CC: Roger Quadros <roger.quadros@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: remove dead code from usb_deregister_dev()
Libor Pechacek [Fri, 25 Mar 2011 08:36:49 +0000 (09:36 +0100)]
USB: remove dead code from usb_deregister_dev()

The `name' variable is unused in usb_deregister_dev() since commit d6e5bcf
(devfs: Remove the mode field from usb_class_driver as it's no longer needed).

Signed-off-by: Libor Pechacek <lpechacek@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: usb_storage: do not align length of request for CBW to maxp size
Mian Yousaf Kaukab [Thu, 24 Mar 2011 11:20:13 +0000 (12:20 +0100)]
usb: usb_storage: do not align length of request for CBW to maxp size

Mass-storage and file-storage gadgets align the length to maximum-packet-size
when preparing the request to receive CBW. This is unnecessary and prevents the
controller driver from knowing that a short-packet is expected.

It is incorrect to set short_not_ok when preparing the request to receive CBW.
CBW will be a short-packet so short_not_ok must not be set.

This makes bh->bulk_out_intended_length unnecessary so it is also removed.

Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoxhci: Fix NULL pointer deref in handle_port_status()
Sarah Sharp [Thu, 24 Mar 2011 15:02:58 +0000 (08:02 -0700)]
xhci: Fix NULL pointer deref in handle_port_status()

When we get a port status change event, we need to figure out what type of
port it came from: a USB 3.0 port, or a USB 2.0/1.1 port.  We can't know
which usb_hcd to use until that point, so hcd will be NULL for part of the
function.  Unfortunately, if any of the sanity checks fail, we'll jump to
the cleanup label before hcd is set to a valid pointer, and then we'll
attempt to tell the USB core to kick the hcd, which is NULL.

Skip kicking the roothub if the sanity checks fail.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
13 years agoUSB: xhci - fix math in xhci_get_endpoint_interval()
Dmitry Torokhov [Thu, 24 Mar 2011 05:41:23 +0000 (22:41 -0700)]
USB: xhci - fix math in xhci_get_endpoint_interval()

When parsing exponent-expressed intervals we subtract 1 from the
value and then expect it to match with original + 1, which is
highly unlikely, and we end with frequent spew:

usb 3-4: ep 0x83 - rounding interval to 512 microframes

Also, parsing interval for fullspeed isochronous endpoints was
incorrect - according to USB spec they use exponent-based
intervals (but xHCI spec claims frame-based intervals). I trust
USB spec more, especially since USB core agrees with it.

This should be queued for stable kernels back to 2.6.31.

Reviewed-by: Micah Elizabeth Scott <micah@vmware.com>
Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
13 years agoUSB: xhci: simplify logic of skipping missed isoc TDs
Dmitry Torokhov [Thu, 24 Mar 2011 03:47:05 +0000 (20:47 -0700)]
USB: xhci: simplify logic of skipping missed isoc TDs

The logic of the handling Missed Service Error Events was pretty
confusing as we were checking the same condition several times.
In addition, it caused compiler warning since the compiler could
not figure out that event_trb is actually unused in case we are
skipping current TD.

Fix that by rearranging "skip" condition checks, and factor out
skip_isoc_td() so that it is called explicitly.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
13 years agoUSB: xhci - remove excessive 'inline' markings
Dmitry Torokhov [Sun, 20 Mar 2011 09:15:16 +0000 (02:15 -0700)]
USB: xhci - remove excessive 'inline' markings

Remove 'inline' markings from file-local functions and let compiler
do its job and inline what makes sense for given architecture.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
13 years agoUSB: xhci: unsigned char never equals -1
Dan Carpenter [Thu, 17 Mar 2011 19:39:49 +0000 (22:39 +0300)]
USB: xhci: unsigned char never equals -1

There were some places that compared port_speed == -1 where port_speed
is a u8.  This doesn't work unless we cast the -1 to u8.  Some places
did it correctly.

Instead of using -1 directly, I've created a DUPLICATE_ENTRY define
which does the cast and is more descriptive as well.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
13 years agoUSB: xhci - fix unsafe macro definitions
Dmitry Torokhov [Sun, 20 Mar 2011 09:15:17 +0000 (02:15 -0700)]
USB: xhci - fix unsafe macro definitions

Macro arguments used in expressions need to be enclosed in parenthesis
to avoid unpleasant surprises.

This should be queued for kernels back to 2.6.31

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
13 years agoUSB: cdc-acm: re-write read processing
Johan Hovold [Fri, 25 Mar 2011 10:06:02 +0000 (11:06 +0100)]
USB: cdc-acm: re-write read processing

Kill rx tasklet, which is no longer needed, and re-write read processing.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: cdc-acm: clean up read urb allocation
Johan Hovold [Tue, 22 Mar 2011 10:12:23 +0000 (11:12 +0100)]
USB: cdc-acm: clean up read urb allocation

Allocate read urbs and read buffers in the same loop during probe.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: cdc-acm: clean up open error handling
Johan Hovold [Tue, 22 Mar 2011 10:12:22 +0000 (11:12 +0100)]
USB: cdc-acm: clean up open error handling

No need to kill ctrl urb on errors as this is done later during close.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: cdc-acm: clean up rx_buflimit references
Johan Hovold [Tue, 22 Mar 2011 10:12:21 +0000 (11:12 +0100)]
USB: cdc-acm: clean up rx_buflimit references

Clean up references to rx_buflimit.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: cdc-acm: remove unused drain-delay code
Johan Hovold [Tue, 22 Mar 2011 10:12:20 +0000 (11:12 +0100)]
USB: cdc-acm: remove unused drain-delay code

The drain-delay code is no longer used, so remove it.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: cdc-acm: remove superfluous prototype
Johan Hovold [Tue, 22 Mar 2011 10:12:19 +0000 (11:12 +0100)]
USB: cdc-acm: remove superfluous prototype

Remove unnecessary acm_tty_chars_in_buffer prototype.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: cdc-acm: remove version information and changelog
Johan Hovold [Tue, 22 Mar 2011 10:12:18 +0000 (11:12 +0100)]
USB: cdc-acm: remove version information and changelog

Remove driver version and changelog which can be retrieved from git
history.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: cdc-acm: use dev_vdbg in read/write paths
Johan Hovold [Tue, 22 Mar 2011 10:12:17 +0000 (11:12 +0100)]
USB: cdc-acm: use dev_vdbg in read/write paths

Replace dev_dbg with verbose dev_vdbg in read/write paths where
appropriate.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: cdc-acm: clean up verbose debug
Johan Hovold [Tue, 22 Mar 2011 10:12:16 +0000 (11:12 +0100)]
USB: cdc-acm: clean up verbose debug

Clean up use of verbose debug.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: cdc-acm: replace dbg macros with dev_dbg
Johan Hovold [Tue, 22 Mar 2011 10:12:15 +0000 (11:12 +0100)]
USB: cdc-acm: replace dbg macros with dev_dbg

Replace all remaining instances of dbg with dev_dbg.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: cdc-acm: clean up dev_err and dev_dbg
Johan Hovold [Tue, 22 Mar 2011 10:12:14 +0000 (11:12 +0100)]
USB: cdc-acm: clean up dev_err and dev_dbg

Clean up some dev_err and dev_dbg messages and make sure that the
appropriate interface device is used for reporting consistently
throughout.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: cdc-acm: use dev_err to report failed allocations
Johan Hovold [Tue, 22 Mar 2011 10:12:13 +0000 (11:12 +0100)]
USB: cdc-acm: use dev_err to report failed allocations

Upgrade out-of-memory dev_dbg to dev_err.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: cdc-acm: add missing newlines to dev_dbg and dev_err
Johan Hovold [Tue, 22 Mar 2011 10:12:12 +0000 (11:12 +0100)]
USB: cdc-acm: add missing newlines to dev_dbg and dev_err

Add missing newline to two dev_dbg and dev_err messages.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: change the way we initialize format strings
Dmitry Torokhov [Sun, 20 Mar 2011 09:02:39 +0000 (02:02 -0700)]
USB: change the way we initialize format strings

Changing initialization from

static const char *string = "blah";

to

static const char string[] = "blah";

saves us one pointer per each string.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: fix formatting of SuperSpeed endpoints in /proc/bus/usb/devices
Dmitry Torokhov [Sat, 19 Mar 2011 04:29:01 +0000 (21:29 -0700)]
USB: fix formatting of SuperSpeed endpoints in /proc/bus/usb/devices

Isochronous and interrupt SuperSpeed endpoints use the same mechanisms
for decoding bInterval values as HighSpeed ones so adjust the code
accordingly.

Also bandwidth reservation for SuperSpeed matches highspeed, not
low/full speed.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: renesas_usbhs: Add Renesas USBHS Gadget
Kuninori Morimoto [Tue, 5 Apr 2011 02:40:54 +0000 (11:40 +0900)]
usb: renesas_usbhs: Add Renesas USBHS Gadget

This patch add usb gadget code to SuperH USBHS.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: renesas_usbhs: Add Renesas USBHS common code
Kuninori Morimoto [Mon, 4 Apr 2011 04:44:59 +0000 (13:44 +0900)]
usb: renesas_usbhs: Add Renesas USBHS common code

Renesas SuperH has USBHS IP which can switch Host / Function.
This driver is designed so that Host / Function may dynamically change.
This patch add usb/renesas_usbhs and common code for SuperH USBHS.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: isp1760-hcd: move imask clear after pending work is done
Richard Retanubun [Thu, 17 Mar 2011 21:39:28 +0000 (17:39 -0400)]
USB: isp1760-hcd: move imask clear after pending work is done

This patch moves the HcInterrupt register write to clear the
pending interrupt to after the isr work is done, doing this removes
glitches in the irq line.

Signed-off-by: Richard Retanubun <richardretanubun@ruggedcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: fsl_qe_udc: send ZLP when zero flag and length % maxpacket == 0
Valentin Longchamp [Wed, 23 Mar 2011 16:47:00 +0000 (17:47 +0100)]
USB: fsl_qe_udc: send ZLP when zero flag and length % maxpacket == 0

The driver did not take the zero flag in the USB request. If the
request length is the same as the endpoint's maxpacket, an additional
ZLP with no data has to be transmitted.

The method used here is inspired to what is done in fsl_udc_core.c
(and pxa27x_udc.c and at91_udc.c) where this is supported.

There already was a discussion about this topic with people from
Keymile, and I propose here a better implementation:

http://thread.gmane.org/gmane.linux.usb.general/38951

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: qcserial add missing errorpath kfrees
Steven Hardy [Mon, 4 Apr 2011 17:02:25 +0000 (18:02 +0100)]
usb: qcserial add missing errorpath kfrees

There are two -ENODEV error paths in qcprobe where the allocated private
data is not freed, this patch adds the two missing kfrees to avoid
leaking memory on the error path

Signed-off-by: Steven Hardy <shardy@redhat.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: qcserial avoid pointing to freed memory
Steven Hardy [Mon, 4 Apr 2011 16:59:55 +0000 (17:59 +0100)]
usb: qcserial avoid pointing to freed memory

Rework the qcprobe logic such that serial->private is not set when
qcprobe exits with -ENODEV, otherwise serial->private will point to freed
memory on -ENODEV

Signed-off-by: Steven Hardy <shardy@redhat.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: Fix qcserial memory leak on rmmod
Steven Hardy [Mon, 4 Apr 2011 16:57:37 +0000 (17:57 +0100)]
usb: Fix qcserial memory leak on rmmod

qcprobe function allocates serial->private but this is never freed, this
patch adds a new function qc_release() which frees serial->private, after
calling usb_wwan_release

Signed-off-by: Steven Hardy <shardy@redhat.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ftdi_sio: add ids for Hameg HO720 and HO730
Paul Friedrich [Fri, 18 Mar 2011 10:13:55 +0000 (11:13 +0100)]
USB: ftdi_sio: add ids for Hameg HO720 and HO730

usb serial: ftdi_sio: add two missing USB ID's for Hameg interfaces HO720
and HO730

Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: option: Added support for Samsung GT-B3730/GT-B3710 LTE USB modem.
Marius B. Kotsbak [Mon, 21 Mar 2011 23:01:53 +0000 (00:01 +0100)]
USB: option: Added support for Samsung GT-B3730/GT-B3710 LTE USB modem.

Bind only modem AT command endpoint to option.

Signed-off-by: Marius B. Kotsbak <marius@kotsbak.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: pch_udc: unlock on allocation failure
Dan Carpenter [Sun, 20 Mar 2011 11:09:50 +0000 (14:09 +0300)]
usb: pch_udc: unlock on allocation failure

There was an unlock missing on the error path.

Also I did a small cleanup by changing ep->dev->lock for just dev->lock.
They're the same lock, but dev->lock is shorter and that's how it is
used for the spin_unlock_irqrestore() call.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB host: Fix lockdep warning in AMD PLL quirk
Joerg Roedel [Wed, 13 Apr 2011 06:38:16 +0000 (08:38 +0200)]
USB host: Fix lockdep warning in AMD PLL quirk

Booting latest kernel on my test machine produces a lockdep
warning from the usb_amd_find_chipset_info() function:

 WARNING: at /data/lemmy/linux.trees.git/kernel/lockdep.c:2465 lockdep_trace_alloc+0x95/0xc2()
 Hardware name: Snook
 Modules linked in:
 Pid: 959, comm: work_for_cpu Not tainted 2.6.39-rc2+ #22
 Call Trace:
  [<ffffffff8103c0d4>] warn_slowpath_common+0x80/0x98
  [<ffffffff812387e6>] ? T.492+0x24/0x26
  [<ffffffff8103c101>] warn_slowpath_null+0x15/0x17
  [<ffffffff81068667>] lockdep_trace_alloc+0x95/0xc2
  [<ffffffff810ed9ac>] slab_pre_alloc_hook+0x18/0x3b
  [<ffffffff810ef227>] kmem_cache_alloc_trace+0x25/0xba
  [<ffffffff812387e6>] T.492+0x24/0x26
  [<ffffffff81238816>] pci_get_subsys+0x2e/0x73
  [<ffffffff8123886c>] pci_get_device+0x11/0x13
  [<ffffffff814082a9>] usb_amd_find_chipset_info+0x3f/0x18a
...

It turns out that this function calls pci_get_device under a spin_lock
with irqs disabled, but the pci_get_device function is only allowed in
preemptible context.

This patch fixes the warning by making all data-structure
modifications on temporal storage and commiting this back
into the visible structure at the end. While at it, this
patch also moves the pci_dev_put calls out of the spinlocks
because this function might sleep too.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb/gadget: don't leak hs_descriptors
Sebastian Andrzej Siewior [Mon, 11 Apr 2011 18:44:30 +0000 (20:44 +0200)]
usb/gadget: don't leak hs_descriptors

We should free both descriptors.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ohci-au1xxx: fix warning "__BIG_ENDIAN" is not defined
Yoichi Yuasa [Mon, 11 Apr 2011 12:56:39 +0000 (21:56 +0900)]
USB: ohci-au1xxx: fix warning "__BIG_ENDIAN" is not defined

In file included from drivers/usb/host/ohci-hcd.c:1028:0:
drivers/usb/host/ohci-au1xxx.c:36:7: warning: "__BIG_ENDIAN" is not defined

Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ftdi_sio: add PID for OCT DK201 docking station
Johan Hovold [Fri, 8 Apr 2011 15:38:22 +0000 (17:38 +0200)]
USB: ftdi_sio: add PID for OCT DK201 docking station

Add PID 0x0103 for serial port of the OCT DK201 docking station.

Reported-by: Jan Hoogenraad <jan@hoogenraad.net>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: musb: omap2430: fix build failure
Johan Hovold [Tue, 5 Apr 2011 17:50:34 +0000 (19:50 +0200)]
usb: musb: omap2430: fix build failure

Fix build failure introduced by commit
7acc6197b76edd0b932a7cbcc6cfad0a8a87f026 (usb: musb: Idle path retention
and offmode support for OMAP3) when building without gadget
support.

  CC      drivers/usb/musb/omap2430.o
drivers/usb/musb/omap2430.c: In function ‘musb_otg_notifications’:
drivers/usb/musb/omap2430.c:262: error: ‘struct musb’ has no member named ‘gadget_driver’

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: EHCI: unlink unused QHs when the controller is stopped
Alan Stern [Tue, 5 Apr 2011 17:36:15 +0000 (13:36 -0400)]
USB: EHCI: unlink unused QHs when the controller is stopped

This patch (as1458) fixes a problem affecting ultra-reliable systems:
When hardware failover of an EHCI controller occurs, the data
structures do not get released correctly.  This is because the routine
responsible for removing unused QHs from the async schedule assumes
the controller is running properly (the frame counter is used in
determining how long the QH has been idle) -- but when a failover
causes the controller to be electronically disconnected from the PCI
bus, obviously it stops running.

The solution is simple: Allow scan_async() to remove a QH from the
async schedule if it has been idle for long enough _or_ if the
controller is stopped.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-Tested-by: Dan Duval <dan.duval@stratus.com>
CC: <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: gadget: eem: fix echo command processing
Yauheni Kaliuta [Tue, 5 Apr 2011 13:55:25 +0000 (16:55 +0300)]
usb: gadget: eem: fix echo command processing

During processing of bunch of eem frames if "echo" command is found
skb is cloned and the cloned version should be used to send reply.
Unfortunately, the data of the original skb were actually used and
the cloned skb is never freed.

Using the cloned skb and freeing the skb in the completion callback
for usb request.

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@nokia.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ftdi_sio: Added IDs for CTI USB Serial Devices
Christian Simon [Mon, 28 Mar 2011 19:54:47 +0000 (21:54 +0200)]
USB: ftdi_sio: Added IDs for CTI USB Serial Devices

I added new ProdutIds for two devices from CTI GmbH Leipzig.

Signed-off-by: Christian Simon <simon@swine.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: r8a66597-udc: fix spinlock usage
Yoshihiro Shimoda [Mon, 4 Apr 2011 04:09:22 +0000 (13:09 +0900)]
usb: r8a66597-udc: fix spinlock usage

Because the disconnect function in the composite driver will call spin_lock,
this driver has to call spin_unlock before calling driver->disconnet().

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: Fix Kconfig unmet dependencies for Microblaze EHCI
Michal Simek [Mon, 4 Apr 2011 09:35:05 +0000 (11:35 +0200)]
usb: Fix Kconfig unmet dependencies for Microblaze EHCI

Disable USB_ARCH_HAS_EHCI in arch Kconfig and enable it in usb Kconfig

Warning log:
warning: (MICROBLAZE) selects USB_ARCH_HAS_EHCI which has unmet
direct dependencies (USB_SUPPORT)

Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: usb-gadget: unlock data->lock mutex on error path in ep_read()
Alexey Khoroshilov [Wed, 16 Mar 2011 19:54:05 +0000 (21:54 +0200)]
USB: usb-gadget: unlock data->lock mutex on error path in ep_read()

ep_read() acquires data->lock mutex in get_ready_ep() and releases it on
all paths except for one: when usb_endpoint_xfer_isoc() failed. The
patch adds mutex_unlock(&data->lock) at that path.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: fix ips1760-hcd printk format warning
Randy Dunlap [Wed, 16 Mar 2011 00:09:10 +0000 (17:09 -0700)]
usb: fix ips1760-hcd printk format warning

Fix printk format build warning and grammar typo on same line.

drivers/usb/host/isp1760-hcd.c:300: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'size_t'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoMerge branch 'fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux...
Russell King [Wed, 13 Apr 2011 22:32:13 +0000 (23:32 +0100)]
Merge branch 'fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6 into fixes

13 years agoMerge branch 'for-greg' of git://gitorious.org/usb/usb into usb-linus
Greg Kroah-Hartman [Wed, 13 Apr 2011 21:32:07 +0000 (14:32 -0700)]
Merge branch 'for-greg' of git://gitorious.org/usb/usb into usb-linus

* 'for-greg' of git://gitorious.org/usb/usb:
  USB: musb: blackfin: work around anomaly 05000450
  usb: musb: Fix the crash issue during reboot
  usb: musb: gadget: check the correct list_head
  usb: musb: temporarily make it bool
  USB: musb: dereferencing an iomem pointer
  USB: musb: silence printk format warning
  USB: musb: using 0 instead of NULL
  USB: musb: add missing unlock in cppi_interrupt()
  usb: musb: ux500: copy dma mask from platform device to musb device
  usb: musb: clear AUTOSET while clearing DMAENAB

13 years agoblock, blk-sysfs: Use the variable directly instead of a function call
Liu Yuan [Wed, 13 Apr 2011 20:14:54 +0000 (22:14 +0200)]
block, blk-sysfs: Use the variable directly instead of a function call

In the function blk_register_queue(), var _dev_ is already assigned by
disk_to_dev().So use it directly instead of calling disk_to_dev() again.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Modified by me to delete an empty line in the same function while
in there anyway.

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
13 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platf...
Linus Torvalds [Wed, 13 Apr 2011 16:15:55 +0000 (09:15 -0700)]
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86:
  x86 platform drivers: Build fix for intel_pmic_gpio

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt...
Linus Torvalds [Wed, 13 Apr 2011 16:15:40 +0000 (09:15 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/avr32-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/avr32-2.6:
  avr32: add ATAG_BOARDINFO
  don't check platform_get_irq's return value against zero
  avr32: init cannot ignore signals sent by force_sig_info()
  avr32: fix deadlock when reading clock list in debugfs
  avr32: Fix .size directive for cpu_enter_idle
  avr32: At32ap: pio fix typo "))" on gpio_irq_unmask prototype
  fix the wrong argument of the functions definition

13 years agoMerge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Wed, 13 Apr 2011 16:10:25 +0000 (09:10 -0700)]
Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (22 commits)
  Revert "i915: restore only the mode of this driver on lastclose"
  Revert "ttm: Utilize the DMA API for pages that have TTM_PAGE_FLAG_DMA32 set."
  i915: select VIDEO_OUTPUT_CONTROL for ACPI_VIDEO
  drm/radeon/kms: properly program vddci on evergreen+
  drm/radeon/kms: add voltage type to atom set voltage function
  drm/radeon/kms: fix pcie_p callbacks on btc and cayman
  drm/radeon/kms: fix suspend on rv530 asics
  drm/radeon/kms: clean up gart dummy page handling
  drm/radeon/kms: make radeon i2c put/get bytes less noisy
  drm/radeon/kms: pll tweaks for rv6xx
  drm/radeon: Fix KMS legacy backlight support if CONFIG_BACKLIGHT_CLASS_DEVICE=m.
  radeon: Fix KMS CP writeback on big endian machines.
  i915: restore only the mode of this driver on lastclose
  drm/nvc0: improve vm flush function
  drm/nv50-nvc0: remove some code that doesn't belong here
  drm/nv50: use "nv86" tlb flush method on everything except 0x50/0xac
  drm/nouveau: quirk for XFX GT-240X-YA
  drm/nv50-nvc0: work around an evo channel hang that some people see
  drm/nouveau: implement init table opcode 0x5c
  drm/nouveau: fix oops on unload with disabled LVDS panel
  ...

13 years agox86 platform drivers: Build fix for intel_pmic_gpio
Matthew Garrett [Wed, 13 Apr 2011 15:52:16 +0000 (11:52 -0400)]
x86 platform drivers: Build fix for intel_pmic_gpio

Fix an incorrect function name so the driver builds.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
13 years agoblock: don't flush plugged IO on forced preemtion scheduling
Linus Torvalds [Wed, 13 Apr 2011 15:08:20 +0000 (08:08 -0700)]
block: don't flush plugged IO on forced preemtion scheduling

We really only want to unplug the pending IO when the process actually
goes to sleep.  So move the test for flushing the plug up to the place
where we actually deactivate the task - where we have properly checked
for preemption and for the process really sleeping.

Acked-by: Jens Axboe <jaxboe@fusionio.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agovm: fix vm_pgoff wrap in stack expansion
Linus Torvalds [Wed, 13 Apr 2011 15:07:28 +0000 (08:07 -0700)]
vm: fix vm_pgoff wrap in stack expansion

Commit 982134ba6261 ("mm: avoid wrapping vm_pgoff in mremap()") fixed
the case of a expanding mapping causing vm_pgoff wrapping when you used
mremap.  But there was another case where we expand mappings hiding in
plain sight: the automatic stack expansion.

This fixes that case too.

This one also found by Robert Święcki, using his nasty system call
fuzzer tool.  Good job.

Reported-and-tested-by: Robert Święcki <robert@swiecki.net>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoavr32: add ATAG_BOARDINFO
Andreas Bießmann [Wed, 13 Apr 2011 08:07:35 +0000 (10:07 +0200)]
avr32: add ATAG_BOARDINFO

The ATAG_BOARDINFO is intended to hand over the information
bd->bi_board_number from u-boot to the kernel.

This piece of information can be used to implement some kind of board
identification while booting the kernel. Therefore it is placed in .initdata
section and can be accessed via the new symbol board_number only while
initializing the kernel.

Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
13 years agodon't check platform_get_irq's return value against zero
Uwe Kleine-König [Wed, 9 Feb 2011 10:28:04 +0000 (11:28 +0100)]
don't check platform_get_irq's return value against zero

platform_get_irq returns -ENXIO on failure, so !int_irq was probably
always true.  Better use (int)int_irq <= 0.  Note that a return value of
zero is still handled as error even though this could mean irq0.

This is a followup to 305b3228f9ff4d59f49e6d34a7034d44ee8ce2f0 that
changed the return value of platform_get_irq from 0 to -ENXIO on error.

Acked-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
13 years agoavr32: init cannot ignore signals sent by force_sig_info()
Matt Fleming [Mon, 4 Apr 2011 14:58:04 +0000 (15:58 +0100)]
avr32: init cannot ignore signals sent by force_sig_info()

We can delete the code that checks to see if we're sending an ignored
signal to init because force_sig_info() already handles this case.
force_sig_info() will kill init even if the signal handler is SIG_DFL
and the scenario described in the comment where init might "generate
the same exception over and over again" cannot occur (force_sig_info()
clears SIGNAL_UNKILLABLE to ensure that init will die).

Also, the use of is_global_init() is not correct in the multhreaded
case, as Oleg Nesterov explains,

"is_global_init() is not right in theory, /sbin/init can be
multithreaded. And, this doesn't cover the sub-namespace
inits... I'd suggest to check SIGNAL_UNKILLABLE, but looking
closer I think you can simply remove this code."

It seems this code was copied from arch/powerpc in March 2007 in commit

  623b0355d5b1 "[AVR32] Clean up exception handling code"

but the code was deleted from arch/powerpc in November 2009 in commit

  a0592d42fe3e "powerpc: kill the obsolete code under is_global_init()"

So catch up with powerpc and delete the bogus code.

Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
13 years agoavr32: fix deadlock when reading clock list in debugfs
Ole Henrik Jahren [Sun, 6 Mar 2011 19:42:39 +0000 (20:42 +0100)]
avr32: fix deadlock when reading clock list in debugfs

When writing out /sys/kernel/debug/at32ap_clk, clock list lock is being
held while clk_get() is called. clk_get() attempts to take the same
lock, which results in deadlock. Introduce and call lock free version,
__clk_get(), instead.

Signed-off-by: Ole Henrik Jahren <olehenja@alumni.ntnu.no>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
13 years agoavr32: Fix .size directive for cpu_enter_idle
Ben Hutchings [Wed, 9 Mar 2011 00:32:36 +0000 (00:32 +0000)]
avr32: Fix .size directive for cpu_enter_idle

gas used to accept (and ignore?) .size directives which referred to
undefined symbols, as this does.  In binutils 2.21 these are treated
as errors.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>