]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
13 years agoUSB host: Move AMD PLL quirk to pci-quirks.c
Andiry Xu [Tue, 1 Mar 2011 06:57:05 +0000 (14:57 +0800)]
USB host: Move AMD PLL quirk to pci-quirks.c

This patch moves the AMD PLL quirk code in OHCI/EHCI driver to pci-quirks.c,
and exports the functions to be used by xHCI driver later.

AMD PLL quirk disable the optional PM feature inside specific
SB700/SB800/Hudson-2/3 platforms under the following conditions:

1. If an isochronous device is connected to OHCI/EHCI/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.

Without AMD PLL quirk, USB isochronous stream may stutter or have breaks
occasionally, which greatly impair the performance of audio/video streams.

Currently AMD PLL quirk is implemented in OHCI and EHCI driver, and will be
added to xHCI driver too. They are doing similar things actually, so move
the quirk code to pci-quirks.c, which has several advantages:

1. Remove duplicate defines and functions in OHCI/EHCI (and xHCI) driver and
   make them cleaner;
2. AMD chipset information will be probed only once and then stored.
   Currently they're probed during every OHCI/EHCI initialization, move
   the detect code to pci-quirks.c saves the repeat detect cost;
3. Build up synchronization among OHCI/EHCI/xHCI driver. In current
   code, every host controller enable/disable PLL only according to
   its own status, and may enable PLL while there is still isoc transfer on
   other HCs. Move the quirk to pci-quirks.c prevents this issue.

Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alex He <alex.he@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoarm: omap: usb: clock entries for omap3 and omap4
Keshava Munegowda [Tue, 1 Mar 2011 14:38:22 +0000 (20:08 +0530)]
arm: omap: usb: clock entries for omap3 and omap4

The devices of clocks are set to usbhs, so that
only usbhs common driver can invoke these clocks.
The dummy per port clocks are added to omap3
clock data base. This helps to invoke common
clock get APIs for omap3 and omap4.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: host: omap: ehci and ohci simplification
Keshava Munegowda [Tue, 1 Mar 2011 14:38:21 +0000 (20:08 +0530)]
usb: host: omap: ehci and ohci simplification

The ehci and ohci drivers are simplified; Since
UHH and TLL initialization, clock handling are
done by common usbhs core driver, these functionalities
are removed from ehci and ohci drivers.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agoarm: omap: usb: cleanup ehci and ohci resources and devices
Keshava Munegowda [Tue, 1 Mar 2011 14:38:20 +0000 (20:08 +0530)]
arm: omap: usb: cleanup ehci and ohci resources and devices

The prototype and defination of functions usb_ehci_init and
usb_ohci_init are removed. The ehci and ohci devices are
removed since usbhs device contains both ehci and ohci details.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agoarm: omap: usb: Invoke usbhs core device initialization
Keshava Munegowda [Tue, 1 Mar 2011 14:38:19 +0000 (20:08 +0530)]
arm: omap: usb: Invoke usbhs core device initialization

The usbhs intialization is invoked by all omap3 and omap4
variant board files.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agoarm: omap: usb: usbhs core device initialization
Keshava Munegowda [Tue, 1 Mar 2011 14:38:18 +0000 (20:08 +0530)]
arm: omap: usb: usbhs core device initialization

A new usbhs platform device is defined;
this device will be the parent device of ehci and
ohci platform devices. the usbhs_init function
is defined which does the usbhs device initialization
and I/O mux of ehci and ohci.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: host: omap: common usb host core driver
Keshava Munegowda [Tue, 1 Mar 2011 14:38:17 +0000 (20:08 +0530)]
usb: host: omap: common usb host core driver

enabling and disabling the common clocks for ehci
and ohci is implemented. usbhs is a common parent
platform driver for EHCI and OHCI driver. This driver
receives the clock enable and disable requests
from ehci and ohci drivers.The UHH and TLL
initialization is also performed.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agoarm: omap: usb: create common enums and structures for ehci and ohci
Keshava Munegowda [Tue, 1 Mar 2011 14:38:16 +0000 (20:08 +0530)]
arm: omap: usb: create common enums and structures for ehci and ohci

Create the ehci and ohci specific platform data structures.
The port enum values are made common for both ehci and ohci.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agoarm: omap2: usb: rename usb-ehci.c to usb-host.c
Felipe Balbi [Tue, 1 Mar 2011 14:38:15 +0000 (20:08 +0530)]
arm: omap2: usb: rename usb-ehci.c to usb-host.c

We already have both EHCI and OHCI there, so let's
rename to be sure everybody will understand the entire
USB HOST functionality is setup on this file.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: host: omap: switch to platform_get_resource_byname
Felipe Balbi [Tue, 1 Mar 2011 14:38:14 +0000 (20:08 +0530)]
usb: host: omap: switch to platform_get_resource_byname

now that we have names on all memory bases, we can
switch to use platform_get_resource_byname() which
will make it simpler when we move to a setup where
OHCI and EHCI on OMAP play well together.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agoarm: omap: usb: host: add names to resources
Felipe Balbi [Tue, 1 Mar 2011 14:38:13 +0000 (20:08 +0530)]
arm: omap: usb: host: add names to resources

add names to EHCI and OHCI resources. That will help us
identify the resource correctly when moving to a setup
where OHCI and EHCI play well together.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: ehci: omap: add support for TLL mode on OMAP4
Anand Gadiyar [Wed, 16 Feb 2011 10:13:14 +0000 (15:43 +0530)]
usb: ehci: omap: add support for TLL mode on OMAP4

The EHCI controller in OMAP4 supports a transceiver-less link
mode (TLL mode), similar to the one in OMAP3. On the OMAP4
however, there are an additional set of clocks that need
to be turned on to get this working.

Request and configure these for each port if that port
is connected in TLL mode.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: tusb: Fix possible null pointer dereference in tusb6010_omap.c
Huzaifa Sidhpurwala [Tue, 1 Mar 2011 10:24:22 +0000 (15:54 +0530)]
usb: musb: tusb: Fix possible null pointer dereference in tusb6010_omap.c

tusb_dma was being dereferenced when it was nul

Signed-off-by: Huzaifa Sidhpurwala <huzaifas@redhat.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: OMAP3xxx: Fix device detection in otg & host mode
Hema HK [Mon, 28 Feb 2011 09:35:29 +0000 (15:05 +0530)]
usb: musb: OMAP3xxx: Fix device detection in otg & host mode

In OMAP3xxx with OTG mode or host only mode, When the device
is inserted after the gadget driver loading the enumeration was not
through. This is because the mentor controller will start sensing the
ID PIN only after setting the session bit.
So after ID-GND, need to set the session bit for mentor to get it
configured as A device.

This is a fix to set the session bit again in ID_GND notification handler.
Tested with OMAP3630Zoom3 platform.

Signed-off-by: Hema HK <hemahk@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: OMAP4430: Power down the PHY during board init
Hema HK [Mon, 28 Feb 2011 08:49:35 +0000 (14:19 +0530)]
usb: musb: OMAP4430: Power down the PHY during board init

Powerdown the internal PHY during board init for OMAP44xx.
So that when musb is disabled core transition to retention/off
is not blocked.

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: otg: OMAP4430: Save/restore the context
Hema HK [Mon, 28 Feb 2011 08:49:36 +0000 (14:19 +0530)]
usb: otg: OMAP4430: Save/restore the context

Add the context save/restore for the control module register
used for OMAP4430 musb with UTMI embedded PHY interface.

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: otg: TWL4030: Update the last_event variable.
Hema HK [Mon, 28 Feb 2011 08:49:32 +0000 (14:19 +0530)]
usb: otg: TWL4030: Update the last_event variable.

Update the last_event variable of otg_transceiver. This will be used in
the musb platform glue driver for runtime idling the device.

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: Idle path retention and offmode support for OMAP3
Hema HK [Mon, 28 Feb 2011 08:49:34 +0000 (14:19 +0530)]
usb: musb: Idle path retention and offmode support for OMAP3

This patch supports the retention and offmode support in the idle path for
musb driver using runtime pm APIs.

This is restricted to support offmode and retention only when device not
connected.When device/cable connected with gadget driver loaded,configured
to no idle/standby which will not allow the core transition to retention
or off.

There is no context save/restore done by hardware for musb in OMAP3
and OMAP4,driver has to take care of saving and restoring the context
during offmode.

Musb has a requirement of configuring sysconfig register to force
idle/standby mode and set the ENFORCE bit in module STANDBY register
for retention and offmode support.

Runtime pm and hwmod frameworks will take care of configuring to force
idle/standby when pm_runtime_put_sync is called and back to no
idle/standby when pm_runeime_get_sync is called.

Compile, boot tested and also tested the retention in the idle path on
OMAP3630Zoom3. And tested the global suspend/resume with offmode enabled.
Usb basic functionality tested on OMAP4430SDP.

There is some problem with idle path offmode in mainline, I could not test
with offmode. But I have tested this patch with resetting the controller
in the idle path when wakeup from retention just to make sure that the
context is lost, and restore path is working fine.

Removed .suspend/.resume fnction pointers and functions because there
is no need of having these functions as all required work is done
at runtime in the driver.

There is no need to call the runtime pm api with glue driver device
as glue layer device is the parent of musb core device, when runtime apis
are called for the child, parent device runtime functionality
will be invoked.

Design overview:

pm_runtime_get_sync: When called with musb core device takes care of
enabling the clock, calling runtime callback function of omap2430 glue
layer, runtime call back of musb driver and configure the musb sysconfig
to no idle/standby

pm_runtime_put: Takes care of calling runtime callback function of omap2430
glue layer, runtime call back of musb driver, Configure the musb sysconfig
to force idle/standby and disable the clock.

During musb driver load: Call pm_runtime_get_sync.

End of musb driver load: Call pm_runtime_put

During gadget driver load: Call pm_runtime_get_sync,
End of gadget driver load: Call pm_runtime_put if there is no device
or cable is connected.

During unload of the gadget driver:Call pm_runtime_get_sync if cable/device
is not connected.
End of the gadget driver unload : pm_runtime_put

During unload of musb driver : Call pm_runtime_get_sync
End of unload: Call pm_runtime_put

On connect of usb cable/device -> transceiver notification(VBUS and ID-GND):
pm_runtime_get_sync only if the gadget driver loaded.

On disconnect of the cable/device -> Disconnect Notification:
pm_runtime_put if the gadget driver is loaded.

Signed-off-by: Hema HK <hemahk@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: Remove platform context save/restore API
Hema HK [Mon, 28 Feb 2011 08:49:33 +0000 (14:19 +0530)]
usb: musb: Remove platform context save/restore API

For OMAP3 and OMAP4 for offmode and retention support, musb
sysconfig is configured to force idle and standby with ENABLE_FORCE bit
of OTG_FORCESTNDBY set.
And on wakeup configure to no ilde/standby with resetting the ENABLE_FORCE
bit. There is not need to save and restore of this register anymore
so removed omap2430_save_context/omap2430_restore_context functions.
and also removed otg_forcestandby member of musb_context_registers
structure

Signed-off-by: Hema HK <hemahk@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: gadget: fix list_head usage
Felipe Balbi [Mon, 28 Feb 2011 08:44:50 +0000 (10:44 +0200)]
usb: musb: gadget: fix list_head usage

commit ad1adb89a0d9410345d573b6995a1fa9f9b7c74a
(usb: musb: gadget: do not poke with gadget's list_head)
fixed a bug in musb where it was corrupting the list_head
which is supposed to be used by gadget drivers. While
doing that, I forgot to fix the usage in musb_gadget_dequeue()
method. Fix that.

Reported-by: Pavol Kurina <pavol.kurina@emsys.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agoUSB: ffs-test: fix header path
Davidlohr Bueso [Sun, 27 Feb 2011 07:58:48 +0000 (04:58 -0300)]
USB: ffs-test: fix header path

When compiling this program the functionfs.h header cannot be found, producing:
ffs-test.c:40: fatal error: linux/usb/functionfs.h: No such file or directory

This patch also fixes the following warning:
ffs-test.c:453: warning: format ‘%4d’ expects type ‘int’, but argument 3 has type ‘size_t’

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: serial/kobil_sct, fix potential tty NULL dereference
Jiri Slaby [Mon, 28 Feb 2011 09:34:06 +0000 (10:34 +0100)]
USB: serial/kobil_sct, fix potential tty NULL dereference

Make sure that we check the return value of tty_port_tty_get.
Sometimes it may return NULL and we later dereference that.

The only place here is in kobil_read_int_callback, so fix it.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: serial/keyspan_pda, fix potential tty NULL dereferences
Jiri Slaby [Mon, 28 Feb 2011 09:34:05 +0000 (10:34 +0100)]
USB: serial/keyspan_pda, fix potential tty NULL dereferences

Make sure that we check the return value of tty_port_tty_get.
Sometimes it may return NULL and we later dereference that.

There are several places to check. For easier handling,
tty_port_tty_get is moved directly to the palce where needed in
keyspan_pda_rx_interrupt.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb/isp1760: Handle toggle bit in queue heads only
Arvid Brodin [Sat, 26 Feb 2011 21:08:47 +0000 (22:08 +0100)]
usb/isp1760: Handle toggle bit in queue heads only

Remove redundant "toggle" member from struct isp1760_qtd, and store toggle
status in struct isp1760_qh only.

Signed-off-by: Arvid Brodin <arvid.brodin@enea.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb/isp1760: Replace period calculation for INT packets with something readable
Arvid Brodin [Sat, 26 Feb 2011 21:07:35 +0000 (22:07 +0100)]
usb/isp1760: Replace period calculation for INT packets with something readable

Replace the period calculation for INT packets with something readable. Seems
to fix a rare bug with quickly repeated insertion/removal of several USB
devices simultaneously (hub control INT packets).

Signed-off-by: Arvid Brodin <arvid.brodin@enea.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb/isp1760: Consolidate printouts and remove unused code
Arvid Brodin [Sat, 26 Feb 2011 21:06:37 +0000 (22:06 +0100)]
usb/isp1760: Consolidate printouts and remove unused code

Consolidate printouts to use dev_XXX functions instead of an assortment of
printks and driver specific macros. Remove some unused code snippets and struct
members. Remove some unused function parameters and #defines. Change the
"queue_entry" variable name which has different but related meanings in
different places and use "slot" only.

Signed-off-by: Arvid Brodin <arvid.brodin@enea.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb/isp1760: Remove redundant "data_buffer" member from struct inter_packet_info
Arvid Brodin [Sat, 26 Feb 2011 21:05:26 +0000 (22:05 +0100)]
usb/isp1760: Remove redundant "data_buffer" member from struct inter_packet_info

Signed-off-by: Arvid Brodin <arvid.brodin@enea.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb/isp1760: Clean up payload address handling
Arvid Brodin [Sat, 26 Feb 2011 21:04:40 +0000 (22:04 +0100)]
usb/isp1760: Clean up payload address handling

Encapsulate payload addresses within qtds.

Signed-off-by: Arvid Brodin <arvid.brodin@enea.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb/isp1760: Remove redundant variables and defines
Arvid Brodin [Sat, 26 Feb 2011 21:03:49 +0000 (22:03 +0100)]
usb/isp1760: Remove redundant variables and defines

Removes the redundant hw_next list pointer from struct isp1760_qtd, removes some
unused #defines, removes redundant "urb" member from struct inter_packet_info.

Signed-off-by: Arvid Brodin <arvid.brodin@enea.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb/isp1760: Move to native-endian ptds
Arvid Brodin [Sat, 26 Feb 2011 21:02:57 +0000 (22:02 +0100)]
usb/isp1760: Move to native-endian ptds

This helps users with platform-bus-connected isp176xs, big-endian cpu,
and missing byteswapping on the data bus. It does so by collecting all
SW byteswaps in one place and also fixes a bug with non-32-bit io
transfers on this hardware, where payload has to be byteswapped
instead of ptds.

Signed-off-by: Arvid Brodin <arvid.brodin@enea.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: core: hub.c Remove one to many n's in a word.
Justin P. Mattock [Sun, 27 Feb 2011 04:33:56 +0000 (20:33 -0800)]
usb: core: hub.c Remove one to many n's in a word.

The Patch below removes one to many "n's" in a word..

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
CC: Alan Stern <stern@rowland.harvard.edu>
CC: linux-usb@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: host: uhci-hcd.c Remove one to many n's in a word.
Justin P. Mattock [Sun, 27 Feb 2011 04:33:57 +0000 (20:33 -0800)]
usb: host: uhci-hcd.c Remove one to many n's in a word.

The Patch below removes one to many "n's" in a word..

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
CC: Alan Stern <stern@rowland.harvard.edu>
CC: linux-usb@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agodrivers:uwb:scan.c remove one to many l's in the word.
Justin P. Mattock [Fri, 25 Feb 2011 06:13:09 +0000 (22:13 -0800)]
drivers:uwb:scan.c remove one to many l's in the word.

The patch below removes an extra "l" in the word.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agodrivers:usb:wusbhc.h remove one to many l's in the word.
Justin P. Mattock [Fri, 25 Feb 2011 06:11:55 +0000 (22:11 -0800)]
drivers:usb:wusbhc.h remove one to many l's in the word.

The patch below removes an extra "l" in the word.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: opticon: add rts and cts support
Martin Jansen [Thu, 24 Feb 2011 13:50:16 +0000 (14:50 +0100)]
USB: opticon: add rts and cts support

Add support for RTS and CTS line status

Signed-off-by: Martin Jansen <martin.jansen@opticon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: fix unsafe USB_SS_MAX_STREAMS() definition
Dmitry Torokhov [Wed, 23 Feb 2011 22:38:20 +0000 (14:38 -0800)]
USB: fix unsafe USB_SS_MAX_STREAMS() definition

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: serial drivers need to use larger bulk-in buffers
Alan Stern [Wed, 23 Feb 2011 20:28:18 +0000 (15:28 -0500)]
USB: serial drivers need to use larger bulk-in buffers

When a driver doesn't know how much data a device is going to send,
the buffer size should be at least as big as the endpoint's maxpacket
value.  The serial drivers don't follow this rule; many of them
request only 256-byte bulk-in buffers.  As a result, they suffer
overflow errors if a high-speed device wants to send a lot of data,
because high-speed bulk endpoints are required to have a maxpacket
size of 512.

This patch (as1450) fixes the problem by using the driver's
bulk_in_size value as a minimum, always allocating buffers no smaller
than the endpoint's maxpacket size.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Flynn Marquardt <flynn@flynnux.de>
CC: <stable@kernel.org> [after .39-rc1 is out]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: EHCI bus glue for on-chip PMC MSP USB controller
Anoop [Thu, 24 Feb 2011 13:56:28 +0000 (19:26 +0530)]
USB: EHCI bus glue for on-chip PMC MSP USB controller

This patch add bus glue for USB controller commonly found in PMC-Sierra MSP71xx family of SoC's.

Signed-off-by: Anoop P A <anoop.pa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: gadget: composite: fix req->length in composite_setup()
Maulik Mankad [Tue, 22 Feb 2011 13:38:42 +0000 (19:08 +0530)]
usb: gadget: composite: fix req->length in composite_setup()

When USB CV MSC tests are run on f_mass_storage gadget
Bulk Only Mass Storage Reset fails since req->length
is set to USB_BUFSIZ=1024 in composite_setup().

Initialize req->length to zero to fix this.

Signed-off-by: Maulik Mankad <maulik@ti.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: use "device number" instead of "address"
Alan Stern [Tue, 22 Feb 2011 14:53:41 +0000 (09:53 -0500)]
USB: use "device number" instead of "address"

The USB stack historically has conflated device numbers (i.e., the
value of udev->devnum) with device addresses.  This is understandable,
because until recently the two values were always the same.

But with USB-3.0 they aren't the same, so we should start calling
these things by their correct names.  This patch (as1449b) changes many
of the references to "address" in the hub driver to "device number"
or "devnum".

The patch also removes some unnecessary or misleading comments.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Luben Tuikov <ltuikov@yahoo.com>
Reviewed-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: f_phonet: avoid pskb_pull(), fix OOPS with CONFIG_HIGHMEM
Rémi Denis-Courmont [Mon, 21 Feb 2011 14:16:53 +0000 (16:16 +0200)]
USB: f_phonet: avoid pskb_pull(), fix OOPS with CONFIG_HIGHMEM

This is similar to what we already do in cdc-phonet.c in the same
situation.

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: EHCI: Fix compiler warnings with MSM driver
Pavankumar Kondeti [Fri, 18 Feb 2011 12:00:11 +0000 (17:30 +0530)]
USB: EHCI: Fix compiler warnings with MSM driver

This patch fixes the following compile warnings

drivers/usb/host/ehci-dbg.c:45: warning: 'dbg_hcs_params' defined but not used
drivers/usb/host/ehci-dbg.c:89: warning: 'dbg_hcc_params' defined but not used

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: Add test mode support for ci13xxx_udc
Pavankumar Kondeti [Fri, 18 Feb 2011 12:13:18 +0000 (17:43 +0530)]
USB: gadget: Add test mode support for ci13xxx_udc

Implement the test modes mentioned in 7.1.20 section of USB 2.0
specification.  High-speed capable devices must support these test
modes to facilitate compliance testing.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: Implement remote wakeup in ci13xxx_udc
Pavankumar Kondeti [Fri, 18 Feb 2011 12:13:17 +0000 (17:43 +0530)]
USB: gadget: Implement remote wakeup in ci13xxx_udc

This patch adds support for remote wakeup.  The following things
are handled:

- Process SET_FEATURE/CLEAR_FEATURE control requests sent by host
for enabling/disabling remote wakeup feature.
- Report remote wakeup enable status in response to GET_STATUS
control request.
- Implement wakeup method defined in usb_gadget_ops for initiating
remote wakeup.
- Notify gadget driver about suspend and resume.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: Implement hardware queuing in ci13xxx_udc
Pavankumar Kondeti [Fri, 18 Feb 2011 12:13:16 +0000 (17:43 +0530)]
USB: gadget: Implement hardware queuing in ci13xxx_udc

Chipidea USB controller provides a means (Add dTD TripWire semaphore)
for safely adding a new dTD to an active endpoint's linked list.  Make
use of this feature to improve performance.  Dynamically allocate and
free dTD for supporting zero length packet termination.  Honor
no_interrupt flag set by gadget drivers.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: serial: mos7720: Fix possible null pointer dereference
Huzaifa Sidhpurwala [Mon, 21 Feb 2011 07:28:45 +0000 (12:58 +0530)]
USB: serial: mos7720: Fix possible null pointer dereference

Signed-off-by: Huzaifa Sidhpurwala <huzaifas@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: serial: keyspan: Fix possible null pointer dereference.
Huzaifa Sidhpurwala [Mon, 21 Feb 2011 07:28:44 +0000 (12:58 +0530)]
USB: serial: keyspan: Fix possible null pointer dereference.

Signed-off-by: Huzaifa Sidhpurwala <huzaifas@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: m66592-udc: Fixed bufnum of Bulk
Yusuke Goda [Mon, 21 Feb 2011 03:55:32 +0000 (12:55 +0900)]
usb: m66592-udc: Fixed bufnum of Bulk

Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Acked-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoehci: Check individual port status registers on resume
Matthew Garrett [Tue, 11 Jan 2011 17:26:48 +0000 (12:26 -0500)]
ehci: Check individual port status registers on resume

If a device plug/unplug is detected on an ATI SB700 USB controller in D3,
it appears to set the port status register but not the controller status
register. As a result we'll fail to detect the plug event. Check the port
status register on resume as well in order to catch this case.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: stable <stable@kernel.org> [after .39-rc1 is out]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: musb: gadget: DBG() already prints function name
Sergei Shtylyov [Fri, 18 Feb 2011 20:44:32 +0000 (23:44 +0300)]
usb: musb: gadget: DBG() already prints function name

In the gadget code, there are several DBG() macro invocations that explicitly
print the calling function's name while DBG() macro itself does this anyway;
most of these were added by commit f11d893de444965dfd3e55f726533ae1df5c6471
(usb: musb: support ISO high bandwidth for gadget mode). Remove the duplicated
printing, somewhat clarifying the messages at the same time...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: otg: notifier: switch to atomic notifier
Felipe Balbi [Wed, 29 Sep 2010 07:55:49 +0000 (10:55 +0300)]
usb: otg: notifier: switch to atomic notifier

most of our notifications, will be called from IRQ
context, so an atomic notifier suits the job better.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: OMAP4430: Fix usb device detection if connected during boot
Hema HK [Thu, 17 Feb 2011 06:36:10 +0000 (12:06 +0530)]
usb: musb: OMAP4430: Fix usb device detection if connected during boot

OMAP4430 is embedded with UTMI PHY. This PHY does not support the
OTG features like ID pin detection and VBUS detection. This function
is exported to an external companion chip TWL6030. Software must retrieve
the OTG HNP and SRP status from the TWL6030 and configure the bits inside
the control module that drive the related USBOTGHS UTMI interface signals.
It must also read back the UTMI signals needed to configure the TWL6030
OTG module.

Can find more details in the TRM[1].
[1]:http://focus.ti.com/pdfs/wtbu/OMAP4430_ES2.0_Public_TRM_vJ.pdf

In OMAP4430 musb driver VBUS and ID notifications are received from the
transceiver driver. If the cable/device is connected during boot,
notifications from transceiver driver will be missed till musb driver
is loaded.
Patch to configure the transceiver in the platform_enable/disable
functions and enable the vbus in the gadget driver based on the
last_event of the otg_transceiver.

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: otg: TWL6030 Save the last event in otg_transceiver
Hema HK [Thu, 17 Feb 2011 06:36:09 +0000 (12:06 +0530)]
usb: otg: TWL6030 Save the last event in otg_transceiver

Save the last event in the otg_transceiver so that it can used in the
musb driver and gadget driver to configure the musb and enable the
vbus for host mode and OTG mode, if the device is connected during boot.

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: otg: TWL6030: Introduce the twl6030_phy_suspend function.
Hema HK [Thu, 17 Feb 2011 06:36:08 +0000 (12:06 +0530)]
usb: otg: TWL6030: Introduce the twl6030_phy_suspend function.

Introduce the twl6030_phy_suspend function and assign to otg.set_suspend
function pointer.
This function is used by the musb-omap2430 platform driver
during suspend/resume.

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: otg: OMAP4430: Introducing suspend function for power management
Hema HK [Thu, 17 Feb 2011 06:36:07 +0000 (12:06 +0530)]
usb: otg: OMAP4430: Introducing suspend function for power management

Introduced the suspend/resume function for the OMAP4430 internal PHY.
This will be used by the twl6030-usb transceiver driver.
Moved the clock enable/disable function calls and power on/off of the PHY
code from power on/off functions to suspend/resume function.

Pass the suspend function through board data for OMAP4430sdp and OMAP4panda.
This will be used by the twl6030-usb transceiver driver.

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: otg: OMAP4430: Add phy_suspend function pointer to twl4030_usb_data
Hema HK [Thu, 17 Feb 2011 06:36:06 +0000 (12:06 +0530)]
usb: otg: OMAP4430: Add phy_suspend function pointer to twl4030_usb_data

Declare the .phy_suspend function pointer to twl4030_usb_data structure.
OMAP internal phy suspend function will be hooked though this function
pointer to use in the transceiver driver.

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: otg: Remove one unnecessary I2C read request.
Hema HK [Thu, 17 Feb 2011 06:36:05 +0000 (12:06 +0530)]
usb: otg: Remove one unnecessary I2C read request.

To get the ID status there was an I2C read transfer. Removed this I2C
read transfer as this info can be used from existing variable(linkstat).

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: otg: enable regulator only on cable/device connect
Hema HK [Thu, 17 Feb 2011 06:36:04 +0000 (12:06 +0530)]
usb: otg: enable regulator only on cable/device connect

Remove the regulator enable while driver loading and enable it only when
the cable/device is connected and disable it when disconnected.

Remove the configuration of config_state and config_trans register
configuration as these registers are programmed when regulator
enable/disable is called.

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: Using runtime pm APIs for musb.
Hema HK [Thu, 17 Feb 2011 06:37:22 +0000 (12:07 +0530)]
usb: musb: Using runtime pm APIs for musb.

Calling runtime pm APIs pm_runtime_put_sync() and pm_runtime_get_sync()
for enabling/disabling the clocks, sysconfig settings.

Enable clock, configure no-idle/standby when active and configure force idle/standby
and disable clock when idled. This is taken care by the runtime framework when
driver calls the pm_runtime_get_sync and pm_runtime_put_sync APIs.
Need to configure MUSB into force standby and force idle mode when usb not used

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Cousson, Benoit <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: gadget: do not poke with gadget's list_head
Felipe Balbi [Wed, 16 Feb 2011 10:40:05 +0000 (12:40 +0200)]
usb: musb: gadget: do not poke with gadget's list_head

struct usb_request's list_head is supposed to be
used only by gadget drivers, but musb is abusing
that. Give struct musb_request its own list_head
and prevent musb from poking into other driver's
business.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: gadget: beautify usb_gadget_probe_driver()/usb_gadget_unregister_driver
Felipe Balbi [Mon, 17 Jan 2011 08:34:38 +0000 (10:34 +0200)]
usb: musb: gadget: beautify usb_gadget_probe_driver()/usb_gadget_unregister_driver

Just a few cosmetic fixes to usb_gadget_probe_driver()
and usb_gadget_unregister_driver().

Decreased a few indentation levels with goto statements.

While at that, also add the missing call to musb_stop().
If we don't have OTG, there's no point of leaving
MUSB prepared for operation if a gadget driver fails
to probe. The same is valid for usb_gadget_unregister_driver(),
since we are removing the gadget driver and we don't have
OTG, we can completely unconfigure MUSB.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: do not error out if Kconfig doesn't match board mode
Felipe Balbi [Wed, 16 Feb 2011 10:27:54 +0000 (12:27 +0200)]
usb: musb: do not error out if Kconfig doesn't match board mode

During development, even though board is wired
to e.g. OTG, we might want to compile host-only
or peripheral-only configurations.

Let's allow that to happen.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: isp1362-hcd: use bitmap_clear() and bitmap_set()
Akinobu Mita [Wed, 16 Feb 2011 14:47:51 +0000 (23:47 +0900)]
usb: isp1362-hcd: use bitmap_clear() and bitmap_set()

Use bitmap_set()/bitmap_clear() to fill/zero a region of a bitmap
instead of doing set_bit()/clear_bit() each bit.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: make ehci msm driver use ehci_run.
Matthieu CASTET [Tue, 15 Feb 2011 17:41:54 +0000 (18:41 +0100)]
USB: make ehci msm driver use ehci_run.

Now that ehci_run don't call ehci_reset, we can use ehci_run.

Signed-off-by: Matthieu CASTET <castet.matthieu@parrot.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: don't run ehci_reset in ehci_run for tdi device
Matthieu CASTET [Tue, 15 Feb 2011 17:40:28 +0000 (18:40 +0100)]
USB: don't run ehci_reset in ehci_run for tdi device

TDI driver does the ehci_reset in their reset callback.
Don't reset in ehci_run because configuration settings done in
platform driver will be reset.

This will allow to make msm use ehci_run.

Signed-off-by: Matthieu CASTET <castet.matthieu@parrot.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: OTG: msm: Fix bug in msm_otg_mode_write
Pavankumar Kondeti [Tue, 15 Feb 2011 04:12:35 +0000 (09:42 +0530)]
USB: OTG: msm: Fix bug in msm_otg_mode_write

The driver private data is retrieved incorrectly which results
a crash when written into "mode" debugfs file.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: OTG: msm: Fix compiler warning with CONFIG_PM disabled
Pavankumar Kondeti [Tue, 15 Feb 2011 04:12:34 +0000 (09:42 +0530)]
USB: OTG: msm: Fix compiler warning with CONFIG_PM disabled

This patch fixes the below compiler warning

drivers/usb/otg/msm72k_otg.c:257: warning: 'msm_otg_suspend' defined but not used

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb_storage: realtek_cr patch: add const modifier
wwang [Tue, 15 Feb 2011 09:02:47 +0000 (17:02 +0800)]
usb_storage: realtek_cr patch: add const modifier

Add const modifier before global variable realtek_cr_ids.

Signed-off-by: wwang <wei_wang@realsil.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb_storage: realtek_cr patch: fix sparse warning
wwang [Tue, 15 Feb 2011 01:38:31 +0000 (09:38 +0800)]
usb_storage: realtek_cr patch: fix sparse warning

Fix some sparse warning for realtek_cr patch

Signed-off-by: wwang <wei_wang@realsil.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: usb.h: Make comment match the defines it describes
Paul Bolle [Mon, 14 Feb 2011 22:06:15 +0000 (23:06 +0100)]
USB: usb.h: Make comment match the defines it describes

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: sierra: error handling in runtime PM
Oliver Neukum [Fri, 11 Feb 2011 11:56:40 +0000 (12:56 +0100)]
USB: sierra: error handling in runtime PM

resumption of devices can fail. Errors must be handled.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb_wwan: fix error case in close()
Oliver Neukum [Thu, 10 Feb 2011 14:33:37 +0000 (15:33 +0100)]
usb_wwan: fix error case in close()

The device never needs to be resumed in close(). But the counters
must be balanced. As resumption can fail, but the counters must
be balanced, use the _no_resume() version which cannot fail.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb_wwan: error case of resume
Oliver Neukum [Thu, 10 Feb 2011 14:33:29 +0000 (15:33 +0100)]
usb_wwan: error case of resume

If an error happens during resumption.
The remaining data has to be cleanly discarded and the pm
counters have to be adjusted.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb_wwan: data consistency in error case
Oliver Neukum [Thu, 10 Feb 2011 14:33:23 +0000 (15:33 +0100)]
usb_wwan: data consistency in error case

As soon as the first error happens, the write must
be stopped, lest we send mutilated messages.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb_wwan: fix runtime PM in error case
Oliver Neukum [Thu, 10 Feb 2011 14:33:17 +0000 (15:33 +0100)]
usb_wwan: fix runtime PM in error case

An error in the write code path would permanently disable
runtime PM in this driver

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb_wwan: fix error in marking device busy
Oliver Neukum [Thu, 10 Feb 2011 14:33:10 +0000 (15:33 +0100)]
usb_wwan: fix error in marking device busy

This fixes two errors:
- the device is busy if a message was recieved even if resubmission fails
- the device is not busy if resubmission fails due to -EPERM

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: gadget: at91_udc: Fix error path
Rahul Ruikar [Wed, 9 Feb 2011 12:44:28 +0000 (13:44 +0100)]
usb: gadget: at91_udc: Fix error path

In function at91udc_probe()
call put_device() when device_register() fails.

Signed-off-by: Rahul Ruikar <rahul.ruikar@gmail.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: isp1760: Implement solution for erratum 2
Sebastian Andrzej Siewior [Tue, 8 Feb 2011 20:07:40 +0000 (21:07 +0100)]
USB: isp1760: Implement solution for erratum 2

The document says:
|2.1 Problem description
|    When at least two USB devices are simultaneously running, it is observed that
|    sometimes the INT corresponding to one of the USB devices stops occurring. This may
|    be observed sometimes with USB-to-serial or USB-to-network devices.
|    The problem is not noticed when only USB mass storage devices are running.
|2.2 Implication
|    This issue is because of the clearing of the respective Done Map bit on reading the ATL
|    PTD Done Map register when an INT is generated by another PTD completion, but is not
|    found set on that read access. In this situation, the respective Done Map bit will remain
|    reset and no further INT will be asserted so the data transfer corresponding to that USB
|    device will stop.
|2.3 Workaround
|    An SOF INT can be used instead of an ATL INT with polling on Done bits. A time-out can
|    be implemented and if a certain Done bit is never set, verification of the PTD completion
|    can be done by reading PTD contents (valid bit).
|    This is a proven workaround implemented in software.

Russell King run into this with an USB-to-serial converter. This patch
implements his suggestion to enable the high frequent SOF interrupt only
at the time we have ATL packages queued. It goes even one step further
and enables the SOF interrupt only if we have more than one ATL packet
queued at the same time.

Cc: <stable@kernel.org> # [2.6.35.x, 2.6.36.x, 2.6.37.x]
Tested-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: Mark EHCI LPM functions as __maybe_unused
Maksim Rayskiy [Tue, 8 Feb 2011 18:41:42 +0000 (10:41 -0800)]
USB: Mark EHCI LPM functions as __maybe_unused

ehci_lpm_set_da and ehci_lpm_check are EHCI 1.1 specific functions which
are not used on many platforms but do generate annoying gcc warnings

Signed-off-by: Maksim Rayskiy <mrayskiy@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: fusb300_udc: add more "ep%d" names
Dan Carpenter [Mon, 7 Feb 2011 17:01:36 +0000 (20:01 +0300)]
usb: fusb300_udc: add more "ep%d" names

We need FUSB300_MAX_NUM_EP (16) names otherwise the last 8 names get
initialized to garbage values in fusb300_probe().

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: s3c2410_udc: Add handling for S3C244X dual-packet mode
Fabian Godehardt [Mon, 7 Feb 2011 10:53:05 +0000 (12:53 +0200)]
USB: s3c2410_udc: Add handling for S3C244X dual-packet mode

This is a patch that seems to make the USB hangs on the S3C244X go away.
At least a good amount of ping torture didn't make them come back so far.

The issue is that, if there are several back-to-back packets, sometimes no
interrupt is generated for one of them. This seems to be caused by the
mysterious dual packet mode, which the USB hardware enters automatically
if the endpoint size is half that of the FIFO. (On the 244X, this is the
normal situation for bulk data endpoints.)

There is also a timing factor in this. It seems that what happens is that
the USB hardware automatically sends an acknowledgement if there is only one
packet in the FIFO (the FIFO has space for two). If another packet arrives
before the host has retrieved and acknowledged the previous one, no interrupt
is generated for that second one.

However, there may be an indication. There is one undocumented bit (none
of the 244x manuals document it), OUT_CRS1_REG[1], that seems to be set
suspiciously often when this condition occurs. There is also
CLR_DATA_TOGGLE, OUT_CRS1_REG[7], which may have a function related to
this. (The Samsung manual is rather terse on that, as usual.)

This needs to be examined further. For now, the patch seems to do the
trick.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: pch_udc: Fixed issue which does not work with g_ether
Toshiharu Okada [Mon, 7 Feb 2011 08:01:26 +0000 (17:01 +0900)]
usb: pch_udc: Fixed issue which does not work with g_ether

This PCH_UDC driver does not work normally when "Ethernet gadget" is used.

This patch fixed this issue.
The following was modified.
 - The FIFO flush process.
 - The descriptor creation process.
 - The adjustment of DMA buffer align.

Currently the PCH_UDC driver can work normally with "Ethernet gadget",
"Serial gadget" or "File-backed Storage Gadget".

Signed-off-by: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: tools: Add a Makefile
Davidlohr Bueso [Sun, 6 Feb 2011 17:13:37 +0000 (14:13 -0300)]
USB: tools: Add a Makefile

Build USB tools easier.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: Gadget: Reorder driver name assignment
Jassi Brar [Sun, 6 Feb 2011 09:47:18 +0000 (18:47 +0900)]
USB: Gadget: Reorder driver name assignment

Reorder the driver->name assignment so the 'iProduct' could be initialized
as well if both 'name' and 'iProduct' come as NULL by default.

Also, remove the misplaced 'extern' keyword.

Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: Gadget: Composite: Debug interface comparison
Jassi Brar [Sun, 6 Feb 2011 08:39:17 +0000 (17:39 +0900)]
USB: Gadget: Composite: Debug interface comparison

While checking valid interface number we should compare MAX_CONFIG_INTERFACES
with the variable 'intf' (which holds the lower 8bits of w_index) rather than
'w_index'

Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoMerge 2.6.38-rc5 into usb-next
Greg Kroah-Hartman [Thu, 17 Feb 2011 17:56:40 +0000 (09:56 -0800)]
Merge 2.6.38-rc5 into usb-next

This is needed to resolve some merge conflicts that were found
in the USB host controller patches, and reported by Stephen Rothwell.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoRevert "USB host: Move AMD PLL quirk to pci-quirks.c"
Greg Kroah-Hartman [Thu, 17 Feb 2011 17:54:16 +0000 (09:54 -0800)]
Revert "USB host: Move AMD PLL quirk to pci-quirks.c"

This reverts commit b7d5b439b7a40dd0a0202fe1c118615a3fcc3b25.
It conflicts with commit baab93afc2844b68d57b0dcca5e1d34c5d7cf411 "USB:
EHCI: ASPM quirk of ISOC on AMD Hudson" and merging the two just doesn't
work properly.

Cc: Andiry Xu <andiry.xu@amd.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alex He <alex.he@amd.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoLinux 2.6.38-rc5 v2.6.38-rc5
Linus Torvalds [Wed, 16 Feb 2011 03:23:45 +0000 (19:23 -0800)]
Linux 2.6.38-rc5

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu
Linus Torvalds [Wed, 16 Feb 2011 01:51:18 +0000 (17:51 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
  m68knommu: set flow handler for secondary interrupt controller of 5249
  m68knommu: remove use of IRQ_FLG_LOCK from 68360 platform support
  m68knommu: fix dereference of port.tty
  m68knommu: add missing linker __modver section
  m68knommu: fix mis-named variable int set_irq_chip loop
  m68knommu: add optimize memmove() function
  m68k: remove arch specific non-optimized memcmp()
  m68knommu: fix use of un-defined _TIF_WORK_MASK
  m68knommu: Rename m548x_wdt.c to m54xx_wdt.c
  m68knommu: fix m548x_wdt.c compilation after headers renaming
  m68knommu: Remove dependencies on nonexistent M68KNOMMU

13 years agom68knommu: set flow handler for secondary interrupt controller of 5249
Greg Ungerer [Wed, 9 Feb 2011 03:43:58 +0000 (13:43 +1000)]
m68knommu: set flow handler for secondary interrupt controller of 5249

The secondary interrupt controller of the ColdFire 5249 code is not
setting the edge triggered flow handler. Set it.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
13 years agom68knommu: remove use of IRQ_FLG_LOCK from 68360 platform support
Greg Ungerer [Tue, 8 Feb 2011 11:40:11 +0000 (21:40 +1000)]
m68knommu: remove use of IRQ_FLG_LOCK from 68360 platform support

The m68knommu arch does not define or use IRQ_FLG_LOCK in its irq
subsystem. Remove obsolete use of it.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
13 years agom68knommu: fix dereference of port.tty
Greg Ungerer [Tue, 8 Feb 2011 11:32:36 +0000 (21:32 +1000)]
m68knommu: fix dereference of port.tty

The struct_tty associated with a port is now a direct pointer
from within the local private driver info struct. So fix all uses
of it.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
13 years agom68knommu: add missing linker __modver section
Greg Ungerer [Tue, 8 Feb 2011 04:45:59 +0000 (14:45 +1000)]
m68knommu: add missing linker __modver section

Add missing linker section __modver to fix:

  LD      vmlinux
/usr/local/bin/../m68k-uclinux/bin/ld.real: error: no memory region specified for loadable section `__modver'

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
13 years agom68knommu: fix mis-named variable int set_irq_chip loop
Greg Ungerer [Tue, 8 Feb 2011 04:40:44 +0000 (14:40 +1000)]
m68knommu: fix mis-named variable int set_irq_chip loop

Compiling for 68360 targets gives:

  CC      arch/m68knommu/platform/68360/ints.o
arch/m68knommu/platform/68360/ints.c: In function ‘init_IRQ’:
arch/m68knommu/platform/68360/ints.c:135:16: error: ‘irq’ undeclared (first use in this function)
arch/m68knommu/platform/68360/ints.c:135:16: note: each undeclared identifier is reported only once for each function it appears in

Fix variable name used.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
13 years agom68knommu: add optimize memmove() function
Greg Ungerer [Thu, 3 Feb 2011 11:58:39 +0000 (21:58 +1000)]
m68knommu: add optimize memmove() function

Add an m68k/coldfire optimized memmove() function for the m68knommu arch.
This is the same function as used by m68k. Simple speed tests show this
is faster once buffers are larger than 4 bytes, and significantly faster
on much larger buffers (4 times faster above about 100 bytes).

This also goes part of the way to fixing a regression caused by commit
ea61bc461d09e8d331a307916530aaae808c72a2 ("m68k/m68knommu: merge MMU and
non-MMU string.h"), which breaks non-coldfire non-mmu builds (which is
the 68x328 and 68360 families). They currently have no memmove() fucntion
defined, since there was none in the m68knommu/lib functions.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
13 years agom68k: remove arch specific non-optimized memcmp()
Greg Ungerer [Thu, 3 Feb 2011 11:31:20 +0000 (21:31 +1000)]
m68k: remove arch specific non-optimized memcmp()

The m68k arch implements its own memcmp() function. It is not optimized
in any way (it is the most strait forward coding of memcmp you can get).
Remove it and use the kernels standard memcmp() implementation.

This also goes part of the way to fixing a regression caused by commit
ea61bc461d09e8d331a307916530aaae808c72a2 ("m68k/m68knommu: merge MMU and
non-MMU string.h"), which breaks non-coldfire non-mmu builds (which is
the 68x328 and 68360 families). They currently have no memcmp() function
defined, since there is none in the m68knommu/lib functions.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
13 years agoMerge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Tue, 15 Feb 2011 23:25:33 +0000 (15:25 -0800)]
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: (27 commits)
  drm/radeon/kms: hopefully fix pll issues for real (v3)
  drm/radeon/kms: add bounds checking to avivo pll algo
  drm: fix wrong usages of drm_device in DRM Developer's Guide
  drm/radeon/kms: fix a few more atombios endian issues
  drm/radeon/kms: improve 6xx/7xx CS error output
  drm/radeon/kms: check AA resolve registers on r300
  drm/radeon/kms: fix tracking of BLENDCNTL, COLOR_CHANNEL_MASK, and GB_Z on r300
  drm/radeon/kms: use linear aligned for evergreen/ni bo blits
  drm/radeon/kms: use linear aligned for 6xx/7xx bo blits
  drm/radeon: fix race between GPU reset and TTM delayed delete thread.
  drm/radeon/kms: evergreen/ni big endian fixes (v2)
  drm/radeon/kms: 6xx/7xx big endian fixes
  drm/radeon/kms: atombios big endian fixes
  drm/radeon: 6xx/7xx non-kms endian fixes
  drm/radeon/kms: optimize CS state checking for r100->r500
  drm: do not leak kernel addresses via /proc/dri/*/vma
  drm/radeon/kms: add connector table for mac g5 9600
  radeon mkregtable: Add missing fclose() calls
  drm/radeon/kms: fix interlaced modes on dce4+
  drm/radeon: fix memory debugging since d961db75ce86a84f1f04e91ad1014653ed7d9f46
  ...

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Tue, 15 Feb 2011 23:25:11 +0000 (15:25 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
  pci: use security_capable() when checking capablities during config space read

13 years agothp: prevent hugepages during args/env copying into the user stack
Andrea Arcangeli [Tue, 15 Feb 2011 18:02:45 +0000 (19:02 +0100)]
thp: prevent hugepages during args/env copying into the user stack

Transparent hugepages can only be created if rmap is fully
functional. So we must prevent hugepages to be created while
is_vma_temporary_stack() is true.

This also optmizes away some harmless but unnecessary setting of
khugepaged_scan.address and it switches some BUG_ON to VM_BUG_ON.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
Linus Torvalds [Tue, 15 Feb 2011 23:19:45 +0000 (15:19 -0800)]
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  ACPI / Video: Probe for output switch method when searching video devices.
  ACPI / Wakeup: Enable button GPEs unconditionally during initialization
  ACPI / ACPICA: Avoid crashing if _PRW is defined for the root object
  ACPI: Fix acpi_os_read_memory() and acpi_os_write_memory() (v2)