Commit Graph

1354 Commits (da7822e5ad71ec9b745b412639f1e5e0ba795a20)

Author SHA1 Message Date
Sarah Sharp da13051cc7 USB: Remove bitmap #define from hcd.h
Using a #define to redefine a common variable name is a bad thing,
especially when the #define is in a header.  include/linux/usb/hcd.h
redefined bitmap to DeviceRemovable to avoid typing a long field in the
hub descriptor.  This has unintended side effects for files like
drivers/usb/core/devio.c that include that file, since another header
included after hcd.h has different variables named bitmap.

Remove the bitmap #define and replace instances of it in the host
controller code.  Cleanup the spaces around function calls and square
brackets while we're at it.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Cc: Tony Olech <tony.olech@elandigitalsystems.com>
Cc: "Robert P. J. Day" <rpjday@crashcourse.ca>
Cc: Max Vozeler <mvz@vozeler.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: Rodolfo Giometti <giometti@linux.it>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Anton Vorontsov <avorontsov@mvista.com>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: Lothar Wassmann <LW@KARO-electronics.de>
Cc: Olav Kongas <ok@artecdesign.ee>
Cc: Martin Fuzzey <mfuzzey@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <dbrownell@users.sourceforge.net>
2011-03-13 18:07:07 -07:00
Sarah Sharp 0b8ca72a23 xhci: Remove old no-op test.
The test of placing a number of command no-ops on the command ring and
counting the number of no-op events that were generated was only used
during the initial xHCI driver bring up.  This test is no longer used, so
delete it.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2011-03-13 18:07:07 -07:00
Russell King 8688a1a863 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-tcc into devel-stable 2011-03-12 20:33:51 +00:00
Robert Morell fbf9865c6d USB: ehci: tegra: Align DMA transfers to 32 bytes
The Tegra2 USB controller doesn't properly deal with misaligned DMA
buffers, causing corruption.  This is especially prevalent with USB
network adapters, where skbuff alignment is often in the middle of a
4-byte dword.

To avoid this, allocate a temporary buffer for the DMA if the provided
buffer isn't sufficiently aligned.

Signed-off-by: Robert Morell <rmorell@nvidia.com>
Signed-off-by: Benoit Goby <benoit@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-11 14:22:12 -08:00
Benoit Goby 79ad3b5add usb: host: Add EHCI driver for NVIDIA Tegra SoCs
The Tegra 2 SoC has 3 EHCI compatible USB controllers. This patch adds
the necessary glue to allow the ehci-hcd driver to work on Tegra 2
SoCs.

The platform data is used to configure board-specific phy settings and
to configure the operating mode, as one of the ports may be used as a otg
port. For additional power saving, the driver supports powering down the
phy on bus suspend when it is used, for example, to connect an internal
device that use an out-of-band remote wakeup mechanism (e.g. a gpio).

Signed-off-by: Benoit Goby <benoit@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-11 14:22:11 -08:00
Hubert Feurstein 0dfeefbc93 ehci-atmel: fix section mismatch warning
Fix the following section mismatch warning:

WARNING: drivers/usb/built-in.o(.data+0x74c): Section mismatch in reference from the variable ehci_atmel_driver to the function .init.text:ehci_atmel_drv_probe()
The variable ehci_atmel_driver references
the function __init ehci_atmel_drv_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-11 14:18:52 -08:00
Russell King 3afdb0f352 Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6 into devel-stable 2011-03-10 13:53:29 +00:00
Sergei Shtylyov fa417c369b USB: OHCI: use pci_dev->revision
Commit ab1666c136 (USB: quirk PLL power down mode)
added code that reads the revision ID from the PCI configuration register while
it's stored by PCI subsystem in the 'revision' field of 'struct pci_dev'...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07 12:15:21 -08:00
Pavankumar Kondeti dfb2130c45 USB: Rename "msm72k_otg.c" to "msm_otg.c"
This driver is used across all MSM SoCs.  Hence give a generic name.
All Functions and strutures are also using "msm_otg" as prefix.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07 12:15:21 -08:00
Arvid Brodin d3cf2a8d4d usb/isp1760: Fix crash when unplugging bug
This fixes a problem with my previous patch series where there's a great
risk that the kernel will crash when unplugging interrupt devices from
the USB port. These lines must have got missing when I rebased the
patches from the older kernel I was working with to 2.6.37 and 2.6-next:

This fixes a bug where the kernel may crash if you unplug a USB device
that has active interrupt transfers.

Signed-off-by: Arvid Brodin <arvid.brodin@enea.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07 12:14:07 -08:00
Michal Simek 337fc720d8 of: Add missing of_address.h to xilinx ehci driver
Build log:
In file included from drivers/usb/host/ehci-hcd.c:1208:
drivers/usb/host/ehci-xilinx-of.c: In function 'ehci_hcd_xilinx_of_probe':
drivers/usb/host/ehci-xilinx-of.c:168: error: implicit declaration of function 'of_address_to_resource'

Signed-off-by: John Williams <john.williams@petalogix.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-03-02 13:45:18 -07:00
Yoshihiro Shimoda 60b0bf0f11 usb: EHCI, OHCI: Add configuration for the SH USB controller
The SH EHCI/OHCI driver hardcoded the CPU type in {ehci,ohci}-hcd.c.
So if we will add the new CPU, we had to add to the hcd driver each time.
The patch adds the CONFIG_USB_{EHCI,OHCI}_SH configuration. So if we
want to use the SH EHCI/OHCI, we only enable the configuration.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-01 16:01:46 -05:00
Andiry Xu ad93562bde 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>
2011-03-01 16:01:45 -05:00
Keshava Munegowda 19403165c2 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>
2011-03-01 17:02:49 +02:00
Keshava Munegowda 181b250cf5 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>
2011-03-01 17:01:11 +02:00
Felipe Balbi 09f0607d8b 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>
2011-03-01 17:00:58 +02:00
Anand Gadiyar 87ecc73b3d 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>
2011-03-01 17:00:56 +02:00
Arvid Brodin 7adc14b14b 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>
2011-02-28 19:23:39 -08:00
Arvid Brodin 65f1b5255c 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>
2011-02-28 19:23:38 -08:00
Arvid Brodin 6bda21bc09 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>
2011-02-28 19:23:38 -08:00
Arvid Brodin bbaa387674 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>
2011-02-28 19:23:37 -08:00
Arvid Brodin a041d8e437 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>
2011-02-28 19:23:37 -08:00
Arvid Brodin fd436aee97 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>
2011-02-28 19:23:36 -08:00
Arvid Brodin bedc0c31ac 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>
2011-02-28 19:23:36 -08:00
Justin P. Mattock 06125beb41 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>
2011-02-28 19:19:56 -08:00
Grant Likely d35fb64176 dt/usb: Eliminate users of of_platform_{,un}register_driver
Get rid of users of of_platform_driver in drivers/usb.  The
of_platform_{,un}register_driver functions are going away, so the
users need to be converted to using the platform_bus_type directly.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-02-28 13:22:45 -07:00
Anoop 22ced6874f 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>
2011-02-25 11:37:31 -08:00
Pavankumar Kondeti 18f53461e7 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>
2011-02-25 11:34:35 -08:00
Matthew Garrett 294d95f2cb 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>
2011-02-25 11:32:13 -08:00
Dmitry Torokhov 8212a49d1c USB: xhci: mark local functions as static
Functions that are not used outsde of the module they are defined
should be marked as static.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2011-02-22 17:12:58 -08:00
Dmitry Torokhov c50a00f8fe USB: xhci: fix couple sparse annotations
There is no point in casting to (void *) when setting up xhci->ir_set
as it only makes us lose __iomem annotation and makes sparse unhappy.

OTOH we do need to cast to (void *) when calculating xhci->dba from
offset, but since it is IO memory we need to annotate it as such.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2011-02-20 07:07:07 -08:00
Dmitry Torokhov 09ece30e06 USB: xhci: rework xhci_print_ir_set() to get ir set from xhci itself
xhci->ir_set points to __iomem region, but xhci_print_ir_set accepts
plain struct xhci_intr_reg * causing multiple sparse warning at call
sites and inside the fucntion when we try to read that memory.

Instead of adding __iomem qualifier to the argument let's rework the
function so it itself gets needed register set from xhci and prints
it.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2011-02-20 07:07:05 -08:00
Paul Zimmerman bcd2fde053 xhci: Fix an error in count_sg_trbs_needed()
The expression

	while (running_total < sg_dma_len(sg))

does not take into account that the remaining data length can be less
than sg_dma_len(sg). In that case, running_total can end up being
greater than the total data length, so an extra TRB is counted.
Changing the expression to

	while (running_total < sg_dma_len(sg) && running_total < temp)

fixes that.

This patch should be queued for stable kernels back to 2.6.31.

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
2011-02-20 07:01:28 -08:00
Paul Zimmerman 5807795bd4 xhci: Fix errors in the running total calculations in the TRB math
Calculations like

	running_total = TRB_MAX_BUFF_SIZE -
		(sg_dma_address(sg) & (TRB_MAX_BUFF_SIZE - 1));
	if (running_total != 0)
		num_trbs++;

are incorrect, because running_total can never be zero, so the if()
expression will never be true. I think the intention was that
running_total be in the range of 0 to TRB_MAX_BUFF_SIZE-1, not 1
to TRB_MAX_BUFF_SIZE. So adding a

	running_total &= TRB_MAX_BUFF_SIZE - 1;

fixes the problem.

This patch should be queued for stable kernels back to 2.6.31.

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
2011-02-20 07:01:27 -08:00
Paul Zimmerman a249018701 xhci: Clarify some expressions in the TRB math
This makes it easier to spot some problems, which will be fixed by the
next patch in the series. Also change dev_dbg to dev_err in
check_trb_math(), so any math errors will be visible even when running
with debug disabled.

Note: This patch changes the expressions containing
"((1 << TRB_MAX_BUFF_SHIFT) - 1)" to use the equivalent
"(TRB_MAX_BUFF_SIZE - 1)". No change in behavior is intended for
those expressions.

This patch should be queued for stable kernels back to 2.6.31.

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
2011-02-20 07:01:27 -08:00
Paul Zimmerman 68e41c5d03 xhci: Avoid BUG() in interrupt context
Change the BUGs in xhci_find_new_dequeue_state() to WARN_ONs, to avoid
bringing down the box if one of them is hit

This patch should be queued for stable kernels back to 2.6.31.

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
2011-02-20 07:01:26 -08:00
Akinobu Mita 04b31c776f 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>
2011-02-17 11:00:24 -08:00
Matthieu CASTET 5c8d61bfcc 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>
2011-02-17 10:57:13 -08:00
Matthieu CASTET bcf40815e0 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>
2011-02-17 10:57:13 -08:00
Sebastian Andrzej Siewior b14e840d04 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>
2011-02-17 10:47:55 -08:00
Maksim Rayskiy 4f9e6c64d1 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>
2011-02-17 10:47:55 -08:00
Greg Kroah-Hartman 66b0835e2b 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>
2011-02-17 09:56:55 -08:00
Greg Kroah-Hartman 479b46b559 Revert "USB host: Move AMD PLL quirk to pci-quirks.c"
This reverts commit b7d5b439b7.
It conflicts with commit baab93afc2 "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>
2011-02-17 09:54:16 -08:00
Sascha Hauer 4bd597b633 ARM i.MX ehci: do ehci init in board specific functions
The mxc-ehci driver calls SoC specific phy initialization right after
calling board specific initialization. To offer greater flexibility for
boards to setup the phy and to get rid of some unnecessary flags in
platform data this patch lets the boards call the SoC specific phy
initialization and remove it from the driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-02-11 08:40:45 +01:00
Pavankumar Kondeti 8cf28f1f4d USB: Fix trout build failure with ci13xxx_msm gadget
This patch fixes the below compilation errors.

  CC      drivers/usb/gadget/ci13xxx_msm.o
  CC      net/mac80211/led.o
  drivers/usb/gadget/ci13xxx_msm.c: In function 'ci13xxx_msm_notify_event':
  drivers/usb/gadget/ci13xxx_msm.c:42: error: 'USB_AHBBURST' undeclared (first use in this function)
  drivers/usb/gadget/ci13xxx_msm.c:42: error: (Each undeclared identifier is reported only once
  drivers/usb/gadget/ci13xxx_msm.c:42: error: for each function it appears in.)
  drivers/usb/gadget/ci13xxx_msm.c:43: error: 'USB_AHBMODE' undeclared (first use in this function)
make[4]: *** [drivers/usb/gadget/ci13xxx_msm.o] Error 1
make[3]: *** [drivers/usb/gadget] Error 2

MSM USB driver is not supported on boards like trout (MSM7201) which
has an external PHY.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04 12:38:14 -08:00
Robert Morell c8cf203a1d USB: HCD: Add usb_hcd prefix to exported functions
The convention is to prefix symbols exported from the USB HCD core with
"usb_hcd".  This change makes unmap_urb_setup_for_dma() and
unmap_urb_for_dma() consistent with that.

Signed-off-by: Robert Morell <rmorell@nvidia.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04 11:48:18 -08:00
David Daney ac8d674178 USB: EHCI: Rearrange create_companion_file() to avoid GCC-4.6 warnings.
In create_companion_file() there is a bogus assignemt to i created for
the express purpose of avoiding an ignored return value warning.

With pre-release GCC-4.6, this causes a 'set but not used' warning.

Kick the problem further down the road by just returning i.  All the
callers of create_companion_file() ignore its return value, so all is
good:

o No warnings are issued.

o We still subvert the desires of the authors of device_create_file()
  by ignorning error conditions.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04 11:43:59 -08:00
David Daney eb34a90861 USB: EHCI: Rearrange EHCI_URB_TRACE code to avoid GCC-4.6 warnings.
With pre-release GCC-4.6, we get a 'set but not used' warning when
EHCI_URB_TRACE is not set because we set the qtd variable without
using it.

Rearrange the statements so that we only set qtd if it will be used.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04 11:43:59 -08:00
David Daney 9a1cadb9dd USB: EHCI: Cleanup and rewrite ehci_vdgb().
The vdbg macro is not used anywhere so it can be removed.

With pre-release GCC-4.6, there are several complaints of variables
that are 'set but not used' caused by the ehci_vdbg() macro expanding
to something that does not contain any of its arguments.  We can quiet
this warning by rewriting ehci_vdbg() as a variadic static inline that
does nothing.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04 11:43:58 -08:00
David Daney fc427a5a4b USB: EHCI: Remove dead code from ehci-sched.c
The pre-release GCC-4.6 now correctly flags this code as dead.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04 11:42:52 -08:00
Andiry Xu b7d5b439b7 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>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04 11:42:52 -08:00
Yin Kangkai 148fc55fd0 USB: EHCI: fix scheduling while atomic during suspend
There is a msleep with spin lock held during ehci pci suspend, which will
cause kernel BUG: scheduling while atomic. Fix that.

[  184.139620] BUG: scheduling while atomic: kworker/u:11/416/0x00000002
[  184.139632] 4 locks held by kworker/u:11/416:
[  184.139640]  #0:  (events_unbound){+.+.+.}, at: [<c104ddd4>] process_one_work+0x1b3/0x4cb
[  184.139669]  #1:  ((&entry->work)){+.+.+.}, at: [<c104ddd4>] process_one_work+0x1b3/0x4cb
[  184.139686]  #2:  (&__lockdep_no_validate__){+.+.+.}, at: [<c127cde3>] __device_suspend+0x2c/0x154
[  184.139706]  #3:  (&(&ehci->lock)->rlock){-.-...}, at: [<c132f3d8>] ehci_pci_suspend+0x35/0x7b
[  184.139725] Modules linked in: serio_raw pegasus joydev mrst_gfx(C) battery
[  184.139748] irq event stamp: 52
[  184.139753] hardirqs last  enabled at (51): [<c14fdaac>] mutex_lock_nested+0x258/0x293
[  184.139766] hardirqs last disabled at (52): [<c14fe7b4>] _raw_spin_lock_irqsave+0xf/0x3e
[  184.139777] softirqs last  enabled at (0): [<c10371c1>] copy_process+0x3d2/0x109d
[  184.139789] softirqs last disabled at (0): [<  (null)>]   (null)
[  184.139802] Pid: 416, comm: kworker/u:11 Tainted: G         C  2.6.37-6.3-adaptation-oaktrail #37
[  184.139809] Call Trace:
[  184.139820]  [<c102eeff>] __schedule_bug+0x5e/0x65
[  184.139829]  [<c14fbca5>] schedule+0xac/0xc4c
[  184.139840]  [<c11d4845>] ? string+0x37/0x8b
[  184.139853]  [<c1044f21>] ? lock_timer_base+0x1f/0x3e
[  184.139863]  [<c14fe7da>] ? _raw_spin_lock_irqsave+0x35/0x3e
[  184.139876]  [<c1061590>] ? trace_hardirqs_off+0xb/0xd
[  184.139885]  [<c14fccdc>] schedule_timeout+0x283/0x2d9
[  184.139896]  [<c104516f>] ? process_timeout+0x0/0xa
[  184.139906]  [<c14fcd47>] schedule_timeout_uninterruptible+0x15/0x17
[  184.139916]  [<c104566a>] msleep+0x10/0x16
[  184.139926]  [<c132f316>] ehci_adjust_port_wakeup_flags+0x69/0xf6
[  184.139937]  [<c132f3eb>] ehci_pci_suspend+0x48/0x7b
[  184.139946]  [<c1326587>] suspend_common+0x52/0xbb
[  184.139956]  [<c1326625>] hcd_pci_suspend+0x26/0x28
[  184.139967]  [<c11e7182>] pci_pm_suspend+0x5f/0xd0
[  184.139976]  [<c127ca3a>] pm_op+0x5d/0xf0
[  184.139986]  [<c127ceac>] __device_suspend+0xf5/0x154
[  184.139996]  [<c127d2c8>] async_suspend+0x16/0x3a
[  184.140006]  [<c1058f54>] async_run_entry_fn+0x89/0x111
[  184.140016]  [<c104deb6>] process_one_work+0x295/0x4cb
[  184.140026]  [<c1058ecb>] ? async_run_entry_fn+0x0/0x111
[  184.140036]  [<c104e3d0>] worker_thread+0x17f/0x298
[  184.140045]  [<c104e251>] ? worker_thread+0x0/0x298
[  184.140055]  [<c105277f>] kthread+0x64/0x69
[  184.140064]  [<c105271b>] ? kthread+0x0/0x69
[  184.140075]  [<c1002efa>] kernel_thread_helper+0x6/0x1a

Signed-off-by: Yin Kangkai <kangkai.yin@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
CC: David Brownell <dbrownell@users.sourceforge.net>
CC: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-03 16:57:43 -08:00
Greg Kroah-Hartman 4e8ed7e499 Merge branch 'for-greg' of git://gitorious.org/usb/usb into usb-next
* 'for-greg' of git://gitorious.org/usb/usb:
  usb: ehci-omap: Show fatal probing time errors to end user
  usb: musb: introduce api for dma code to check compatibility with usb request
  usb: musb: maintain three states for buffer mappings instead of two
  usb: musb: disable double buffering when it's broken
  usb: musb: hsdma: change back to use musb_read/writew
  usb: musb: core: fix IRQ check
  usb: musb: fix kernel panic during s2ram(v2)
2011-02-03 16:52:54 -08:00
Jesper Juhl 2bd15f1f49 USB SL811HS HCD: Fix memory leak in sl811h_urb_enqueue()
In drivers/usb/host/sl811-hcd.c::sl811h_urb_enqueue(), memory is allocated
with kzalloc() and assigned to 'ep'. If we leave via the 'fail' label due
to 'if (ep->maxpacket > H_MAXPACKET)', then 'ep' will go out of scope
without having been assigned to anything, so we'll leak the memory we
allocated.
This patch fixes the leak by simply calling kfree(ep); before jumping to
the 'fail' label.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-03 16:42:17 -08:00
Jarkko Nikula 3e434a86cb usb: ehci-omap: Show fatal probing time errors to end user
There are a few error paths in ehci_hcd_omap_probe that can be triggered
because of memory allocation or hw failure. Change those dev_dbg error
prints to dev_err with an error code printed so that the end users are able
to notice the issue.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-02-01 11:06:09 +02:00
Russell King 82e6923e18 ARM: lh7a40x: remove unmaintained platform support
lh7a40x has only been receiving updates for updates to generic code.
The last involvement from the maintainer according to the git logs was
in 2006.  As such, it is a maintainence burden with no benefit.

This gets rid of two defconfigs.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-01-24 19:05:19 +00:00
Greg Kroah-Hartman fd96d0d8d8 Merge branch 'for-usb-linus' of master.kernel.org:/pub/scm/linux/kernel/git/sarah/xhci into usb-linus
* 'for-usb-linus' of master.kernel.org:/pub/scm/linux/kernel/git/sarah/xhci:
  xhci: Remove more doorbell-related reads
  xHCI: fix printk_ratelimit() usage
  xHCI: replace dev_dbg() with xhci_dbg()
  xHCI: fix cycle bit set in giveback_first_trb()
  xHCI: remove redundant parameter in giveback_first_trb()
  xHCI: fix queue_trb in isoc transfer
  xhci: Use GFP_NOIO during device reset.
  usb: Realloc xHCI structures after a hub is verified.
  xhci: Do not run xhci_cleanup_msix with irq disabled
  xHCI: synchronize irq in xhci_suspend()
  xhci: Resume bus on any port status change.
2011-01-24 08:14:07 +09:00
Arnaud Patard (Rtp) a464dc4d40 USB: ehci-mxc: add work-around for efika mx/sb bug
Add support for setting CHRGVBUS to workaround a hardware bug on efika mx/sb
boards.
See http://lists.infradead.org/pipermail/linux-arm-kernel/2011-January/037341.html

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-22 18:48:10 -08:00
Eric Bénard 3bb8029a24 USB: unbreak ehci-mxc on otg port of i.MX27
commit 711669e5b8 fixed port 0 support
for i.MX51 but broke it for (at least) i.MX27 which doesn't have
a usb_phy1 clock but has a pdev->id 0.

Signed-off-by: Eric Bénard <eric@eukrea.com>
Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-22 18:48:08 -08:00
Peter Tyser cc604ddd11 USB: ehci-fsl: Fix 'have_sysif_regs' detection
Previously a check was done on an ID register at the base of a CPU's
internal USB registers to determine if system interface regsiters were
present.  The check looked for an ID register that had the format
ID[0:5] == ~ID[8:13] as described in the MPC5121 User's Manual to
determine if a MPC5121 or MPC83xx/85xx was being used.

There are two issues with this method:
- The ID register is not defined on the MPC83xx/85xx CPUs, so its
  unclear what is being checked on them.
- Newer CPUs such as the P4080 also don't document the ID register, but
  do share the same format as the MPC5121.  Thus the previous code did
  not set 'have_sysif_regs' properly which results in the P4080 not
  properly initializing its USB ports.

Using the device tree 'compatible' node is a cleaner way to determine if
'have_sysif_regs' should be set and resolves the USB initialization issue
seen on the P4080.

Tested on a P4080-based system and compile tested on mpc512x_defconfig
with Freescale EHCI driver enabled.

Cc: Anatolij Gustschin <agust@denx.de>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-22 18:38:58 -08:00
Alan Stern f75593ceaa USB: EHCI: fix DMA deallocation bug
This patch (as1440) fixes a bug in ehci-hcd.  ehci->periodic_size is
used to compute the size in a dma_alloc_coherent() call, but then it
gets changed later on.  As a result, the corresponding call to
dma_free_coherent() passes a different size from the original
allocation.  Fix the problem by adjusting ehci->periodic_size before
carrying out any of the memory allocations.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
CC: David Brownell <david-b@pacbell.net>
CC: <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-22 18:36:43 -08:00
Alex He baab93afc2 USB: EHCI: ASPM quirk of ISOC on AMD Hudson
AMD Hudson also needs the same ASPM quirk as SB800

Signed-off-by: Alex He <alex.he@amd.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-22 18:32:54 -08:00
Matthew Wilcox 50d64676d1 xhci: Remove more doorbell-related reads
The unused space in the doorbell is now marked as RsvdZ, not RsvdP, so
we can avoid reading the doorbell before writing it.

Update the doorbell-related defines to produce the entire doorbell value
from a single macro.  Document the doorbell format in a comment.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2011-01-14 15:52:00 -08:00
Andiry Xu 7961acd732 xHCI: fix printk_ratelimit() usage
printk_ratelimit() is misused in xhci-ring.c.

Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2011-01-14 15:51:58 -08:00
Andiry Xu f2c565e223 xHCI: replace dev_dbg() with xhci_dbg()
dev_dbg() is used to print ordinary transfer messages in xhci-ring.c.
System log messages will be flushed if CONFIG_USB_DEBUG is set. Replace the
dev_dbg() with xhci_dbg().

Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2011-01-14 15:51:57 -08:00
Andiry Xu 50f7b52a83 xHCI: fix cycle bit set in giveback_first_trb()
giveback_first_trb() controls the cycle bit set of the start_trb, to ensure
that the start_trb is written last and the host controller will receive a
whole td at a time.

However, if the ring is wrapped and cycle bit is toggled to zero, then
giveback_first_trb() will be of no effect. In this case, set the cycle bit of
start_trb to 1 at the beginning and clear it in giveback_first_trb().

Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2011-01-14 15:51:55 -08:00
Andiry Xu e1eab2e000 xHCI: remove redundant parameter in giveback_first_trb()
Parameter *td is not used in giveback_first_trb(). Remove it.

Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2011-01-14 15:51:54 -08:00
Andiry Xu 47cbf6925c xHCI: fix queue_trb in isoc transfer
Fix the more_trbs_coming field of queue_trb() in isoc transfer.

Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2011-01-14 15:51:53 -08:00
Sarah Sharp a6d940dd75 xhci: Use GFP_NOIO during device reset.
When xhci_discover_or_reset_device() is called after a host controller
power loss, the virtual device may need to be reallocated.  Make sure
xhci_alloc_dev() uses GFP_NOIO.  This avoid causing a deadlock by allowing
the kernel to flush pending I/O while reallocating memory for a virtual
device for a USB mass storage device that's holding the backing store for
dirty memory buffers.

This patch should be queued for the 2.6.37 stable tree.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
2011-01-14 15:51:51 -08:00
Zhang Rui 40a9fb17f3 xhci: Do not run xhci_cleanup_msix with irq disabled
when unloading xhci_hcd, I got:
[  134.856813] xhci_hcd 0000:02:00.0: remove, state 4
[  134.858140] usb usb3: USB disconnect, address 1
[  134.874956] xhci_hcd 0000:02:00.0: Host controller not halted, aborting reset.
[  134.876351] BUG: sleeping function called from invalid context at kernel/mutex.c:85
[  134.877657] in_atomic(): 0, irqs_disabled(): 1, pid: 1451, name: modprobe
[  134.878975] Pid: 1451, comm: modprobe Not tainted 2.6.37-rc5+ #162
[  134.880298] Call Trace:
[  134.881602]  [<ffffffff8104156a>] __might_sleep+0xeb/0xf0
[  134.882921]  [<ffffffff814763dc>] mutex_lock+0x24/0x50
[  134.884229]  [<ffffffff810a745c>] free_desc+0x2e/0x5f
[  134.885538]  [<ffffffff810a74c8>] irq_free_descs+0x3b/0x71
[  134.886853]  [<ffffffff8102584d>] free_irq_at+0x31/0x36
[  134.888167]  [<ffffffff8102723f>] destroy_irq+0x69/0x71
[  134.889486]  [<ffffffff8102747a>] native_teardown_msi_irq+0xe/0x10
[  134.890820]  [<ffffffff8124c382>] default_teardown_msi_irqs+0x57/0x80
[  134.892158]  [<ffffffff8124be46>] free_msi_irqs+0x8b/0xe9
[  134.893504]  [<ffffffff8124cd46>] pci_disable_msix+0x35/0x39
[  134.894844]  [<ffffffffa01b444a>] xhci_cleanup_msix+0x31/0x51 [xhci_hcd]
[  134.896186]  [<ffffffffa01b4b3a>] xhci_stop+0x3a/0x80 [xhci_hcd]
[  134.897521]  [<ffffffff81341dd4>] usb_remove_hcd+0xfd/0x14a
[  134.898859]  [<ffffffff813500ae>] usb_hcd_pci_remove+0x5c/0xc6
[  134.900193]  [<ffffffff8123c606>] pci_device_remove+0x3f/0x91
[  134.901535]  [<ffffffff812e7ea4>] __device_release_driver+0x83/0xd9
[  134.902899]  [<ffffffff812e8571>] driver_detach+0x86/0xad
[  134.904222]  [<ffffffff812e7d56>] bus_remove_driver+0xb2/0xd8
[  134.905540]  [<ffffffff812e8633>] driver_unregister+0x6c/0x74
[  134.906839]  [<ffffffff8123c8e4>] pci_unregister_driver+0x44/0x89
[  134.908121]  [<ffffffffa01b940e>] xhci_unregister_pci+0x15/0x17 [xhci_hcd]
[  134.909396]  [<ffffffffa01bd7d2>] xhci_hcd_cleanup+0xe/0x10 [xhci_hcd]
[  134.910652]  [<ffffffff8107fcd1>] sys_delete_module+0x1ca/0x23b
[  134.911882]  [<ffffffff81123932>] ? path_put+0x22/0x26
[  134.913104]  [<ffffffff8109a800>] ? audit_syscall_entry+0x2c/0x148
[  134.914333]  [<ffffffff8100ac82>] system_call_fastpath+0x16/0x1b
[  134.915658] xhci_hcd 0000:02:00.0: USB bus 3 deregistered
[  134.916465] xhci_hcd 0000:02:00.0: PCI INT A disabled

and the same issue when xhci_suspend is invoked.  (Note from Sarah: That's
fixed by Andiry's patch before this, by synchronizing the irqs rather than
freeing them on suspend.)

Do not run xhci_cleanup_msix with irq disabled.

This patch should be queued for the 2.6.37 stable tree.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
2011-01-14 15:28:52 -08:00
Andiry Xu 0029227f1b xHCI: synchronize irq in xhci_suspend()
Synchronize the interrupts instead of free them in xhci_suspend(). This will
prevent a double free when the host is suspended and then the card removed.

Set the flag hcd->msix_enabled when using MSI-X, and check the flag in
suspend_common(). MSI-X synchronization will be handled by xhci_suspend(),
and MSI/INTx will be synchronized in suspend_common().

This patch should be queued for the 2.6.37 stable tree.

Reported-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
2011-01-14 15:28:52 -08:00
Sarah Sharp 7111ebc97e xhci: Resume bus on any port status change.
The original code that resumed the USB bus on a port status change would
only do so when there was a device connected to the port.  If a device was
just disconnected, the event would be queued for khubd, but khubd wouldn't
run.  That would leave the connect status change (CSC) bit set.

If a USB device was plugged into that same port, the xHCI host controller
would set the current connect status (CCS) bit.  But since the CSC bit was
already set, it would not generate an interrupt for a port status change
event.  That would mean the user could "Safely Remove" a device, have the
bus suspend, disconnect the device, re-plug it in, and then the device
would never be enumerated.

Plugging in a different device on another port would cause the bus to
resume, and khubd would notice the re-connected device.  Running lsusb
would also resume the bus, leading users to report the problem "went away"
when using diagnostic tools.

The solution is to resume the bus when a port status change event is
received, regardless of the port status.

Thank you very much to Maddog for helping me track down this Heisenbug.

This patch should be queued for the 2.6.37 stable tree.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: Jon 'maddog' Hall <maddog@li.org>
Tested-by: Andiry Xu <andiry.xu@amd.com>
Cc: stable@kernel.org
2011-01-14 15:28:51 -08:00
Linus Torvalds 008d23e485 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits)
  Documentation/trace/events.txt: Remove obsolete sched_signal_send.
  writeback: fix global_dirty_limits comment runtime -> real-time
  ppc: fix comment typo singal -> signal
  drivers: fix comment typo diable -> disable.
  m68k: fix comment typo diable -> disable.
  wireless: comment typo fix diable -> disable.
  media: comment typo fix diable -> disable.
  remove doc for obsolete dynamic-printk kernel-parameter
  remove extraneous 'is' from Documentation/iostats.txt
  Fix spelling milisec -> ms in snd_ps3 module parameter description
  Fix spelling mistakes in comments
  Revert conflicting V4L changes
  i7core_edac: fix typos in comments
  mm/rmap.c: fix comment
  sound, ca0106: Fix assignment to 'channel'.
  hrtimer: fix a typo in comment
  init/Kconfig: fix typo
  anon_inodes: fix wrong function name in comment
  fix comment typos concerning "consistent"
  poll: fix a typo in comment
  ...

Fix up trivial conflicts in:
 - drivers/net/wireless/iwlwifi/iwl-core.c (moved to iwl-legacy.c)
 - fs/ext4/ext4.h

Also fix missed 'diabled' typo in drivers/net/bnx2x/bnx2x.h while at it.
2011-01-13 10:05:56 -08:00
Linus Torvalds 23d69b09b7 Merge branch 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
* 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: (33 commits)
  usb: don't use flush_scheduled_work()
  speedtch: don't abuse struct delayed_work
  media/video: don't use flush_scheduled_work()
  media/video: explicitly flush request_module work
  ioc4: use static work_struct for ioc4_load_modules()
  init: don't call flush_scheduled_work() from do_initcalls()
  s390: don't use flush_scheduled_work()
  rtc: don't use flush_scheduled_work()
  mmc: update workqueue usages
  mfd: update workqueue usages
  dvb: don't use flush_scheduled_work()
  leds-wm8350: don't use flush_scheduled_work()
  mISDN: don't use flush_scheduled_work()
  macintosh/ams: don't use flush_scheduled_work()
  vmwgfx: don't use flush_scheduled_work()
  tpm: don't use flush_scheduled_work()
  sonypi: don't use flush_scheduled_work()
  hvsi: don't use flush_scheduled_work()
  xen: don't use flush_scheduled_work()
  gdrom: don't use flush_scheduled_work()
  ...

Fixed up trivial conflict in drivers/media/video/bt8xx/bttv-input.c
as per Tejun.
2011-01-07 16:58:04 -08:00
Linus Torvalds 3e5b08cbbf Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (144 commits)
  USB: add support for Dream Cheeky DL100B Webmail Notifier (1d34:0004)
  USB: serial: ftdi_sio: add support for TIOCSERGETLSR
  USB: ehci-mxc: Setup portsc register prior to accessing OTG viewport
  USB: atmel_usba_udc: fix freeing irq in usba_udc_remove()
  usb: ehci-omap: fix tll channel enable mask
  usb: ohci-omap3: fix trivial typo
  USB: gadget: ci13xxx: don't assume that PAGE_SIZE is 4096
  USB: gadget: ci13xxx: fix complete() callback for no_interrupt rq's
  USB: gadget: update ci13xxx to work with g_ether
  USB: gadgets: ci13xxx: fix probing of compiled-in gadget drivers
  Revert "USB: musb: pm: don't rely fully on clock support"
  Revert "USB: musb: blackfin: pm: make it work"
  USB: uas: Use GFP_NOIO instead of GFP_KERNEL in I/O submission path
  USB: uas: Ensure we only bind to a UAS interface
  USB: uas: Rename sense pipe and sense urb to status pipe and status urb
  USB: uas: Use kzalloc instead of kmalloc
  USB: uas: Fix up the Sense IU
  usb: musb: core: kill unneeded #include's
  DA8xx: assign name to MUSB IRQ resource
  usb: gadget: g_ncm added
  ...

Manually fix up trivial conflicts in USB Kconfig changes in:
	arch/arm/mach-omap2/Kconfig
	arch/sh/Kconfig
	drivers/usb/Kconfig
	drivers/usb/host/ehci-hcd.c
and annoying chip clock data conflicts in:
	arch/arm/mach-omap2/clock3xxx_data.c
	arch/arm/mach-omap2/clock44xx_data.c
2011-01-07 13:16:28 -08:00
Russell King 404a02cbd2 Merge branch 'devel-stable' into devel
Conflicts:
	arch/arm/mach-pxa/clock.c
	arch/arm/mach-pxa/clock.h
2011-01-06 22:33:32 +00:00
Russell King 1051b9f0f9 Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6 into devel-stable 2011-01-05 10:23:38 +00:00
Justin P. Mattock 48e34d0f4f drivers: fix comment typo diable -> disable.
The below patch fixes a typo "diable" to "disable" and also fixes another typo in a comment.
Please let me know if this is correct or not.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-01-03 16:08:59 +01:00
Russell King 50401d77ee Merge branch 'master' of git://git.infradead.org/users/cbou/linux-cns3xxx into devel-stable 2011-01-03 10:31:38 +00:00
Arnaud Patard (Rtp) 711669e5b8 mx51: fix usb clock support
Current code doesn't really enable the usb clocks so if they're disabled
when booting linux, the kernel/machine will hang as soon as someone is trying
to read a usb register

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-03 10:20:23 +01:00
Tejun Heo 569ff2de2e usb: don't use flush_scheduled_work()
flush_scheduled_work() is being deprecated.  Directly flush or cancel
work items instead.

* u_ether, isp1301_omap, speedtch conversions are straight-forward.

* ochi-hcd should only flush when quirk_nec() is true as otherwise the
  work wouldn't have been initialized.

* In oti6858, cancel_delayed_work() + flush_scheduled_work() ->
  cancel_delayed_work_sync().

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Duncan Sands <duncan.sands@free.fr>
Cc: linux-usb@vger.kernel.org
2010-12-24 16:14:20 +01:00
Greg Kroah-Hartman 2af10844eb USB: Merge 2.6.37-rc5 into usb-next
This is to resolve the conflict in the file,
drivers/usb/gadget/composite.c that was due to a revert in Linus's tree
needed for the 2.6.37 release.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-22 12:25:34 -08:00
Jiri Kosina 4b7bd36470 Merge branch 'master' into for-next
Conflicts:
	MAINTAINERS
	arch/arm/mach-omap2/pm24xx.c
	drivers/scsi/bfa/bfa_fcpim.c

Needed to update to apply fixes for which the old branch was too
outdated.
2010-12-22 18:57:02 +01:00
Fabio Estevam 0247a7bcd4 USB: ehci-mxc: Setup portsc register prior to accessing OTG viewport
In order to read/write to the i.MX OTG viewport register it is necessary to setup
the PORTSCx register first.

By default i.MX OTG port is configured for USB serial PHY. In order to use a ULPI PHY
the PORTSCx register needs to be configured properly.

commit 724c852 (USB: ehci/mxc: compile fix) placed the PORTSC setup after the OTG
viewport is accessed and this causes ULPI read/write to fail.

Revert the PORTSC setup order.

Tested on a MX31PDK board with a ISP1504 transceiver:

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
mxc-ehci mxc-ehci.0: initializing i.MX USB Controller
ULPI transceiver vendor/product ID 0x04cc/0x1504
Found NXP ISP1504 ULPI transceiver.
ULPI integrity check: passed.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-16 13:37:48 -08:00
Anand Gadiyar 6ef9fc657b usb: ehci-omap: fix tll channel enable mask
The TLL channel enable code searches for the wrong mask, and
could end up enabling the wrong port. Fix this.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-16 13:36:12 -08:00
Keshava Munegowda a0c9e95dfc usb: ohci-omap3: fix trivial typo
This is the ohci-omap3 driver, not ehci-omap. Correct this
obvious typo.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-16 13:36:12 -08:00
Greg Kroah-Hartman 36facadd9e Merge branch 'usb-next' into musb-merge
* usb-next: (132 commits)
  USB: uas: Use GFP_NOIO instead of GFP_KERNEL in I/O submission path
  USB: uas: Ensure we only bind to a UAS interface
  USB: uas: Rename sense pipe and sense urb to status pipe and status urb
  USB: uas: Use kzalloc instead of kmalloc
  USB: uas: Fix up the Sense IU
  usb: musb: core: kill unneeded #include's
  DA8xx: assign name to MUSB IRQ resource
  usb: gadget: g_ncm added
  usb: gadget: f_ncm.c added
  usb: gadget: u_ether: prepare for NCM
  usb: pch_udc: Fix setup transfers with data out
  usb: pch_udc: Fix compile error, warnings and checkpatch warnings
  usb: add ab8500 usb transceiver driver
  USB: gadget: Implement runtime PM for MSM bus glue driver
  USB: gadget: Implement runtime PM for ci13xxx gadget
  USB: gadget: Add USB controller driver for MSM SoC
  USB: gadget: Introduce ci13xxx_udc_driver struct
  USB: gadget: Initialize ci13xxx gadget device's coherent DMA mask
  USB: gadget: Fix "scheduling while atomic" bugs in ci13xxx_udc
  USB: gadget: Separate out PCI bus code from ci13xxx_udc
  ...
2010-12-16 10:05:06 -08:00
Pavankumar Kondeti 8bb6a164b9 USB: EHCI: msm: Add support for power management
Enable runtime PM and mark no_callbacks flag.  OTG device, parent of
HCD takes care of putting hardware into low power mode.  Adjust port
power wakeup flags during system suspend and resume.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-10 14:23:32 -08:00
Pavankumar Kondeti b0848aea10 USB: EHCI: Add MSM Host Controller driver
This patch adds support for EHCI compliant HSUSB Host controller found
on MSM chips.  The root hub has a single port and TT is built into it.
This driver depends on OTG driver for PHY initialization, clock
management and powering up VBUS.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-10 14:23:32 -08:00
Alex He 05570297ec USB: EHCI: ASPM quirk of ISOC on AMD SB800
When ASPM PM Feature is enabled on UMI link, devices that use ISOC stream of
data transfer may be exposed to longer latency causing less than optimal per-
formance of the device. The longer latencies are normal and are due to link
wake time coming out of low power state which happens frequently to save
power when the link is not active.
The following code will make exception for certain features of ASPM to be by
passed and keep the logic normal state only when the ISOC device is connected
and active. This change will allow the device to run at optimal performance
yet minimize the impact on overall power savings.

Signed-off-by: Alex He <alex.he@amd.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-10 14:21:35 -08:00
Tobias Ollmann 16325f18ea USB: host: uhci-q: Fixed minor coding style issues
Fixed coding style issues (delete trailing whitespaces, break
long line)

Signed-off-by: Tobias Ollmann <tobias.ollmann@gmx.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-10 14:18:36 -08:00
Namhyung Kim 8170344cb8 USB: whci-hcd: fix compiler warning
Annotate whci_hcd_id_table as '__used' to fix following warning:

  CC      drivers/usb/host/whci/hcd.o
drivers/usb/host/whci/hcd.c:359: warning: ‘whci_hcd_id_table’ defined but not used

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-10 14:18:35 -08:00
Sarah Sharp f8bbeabc34 xhci: Fix issue with port array setup and buggy hosts.
Fix two bugs with the port array setup.

The first bug will only show up with broken xHCI hosts with Extended
Capabilities registers that have duplicate port speed entries for the same
port.  The idea with the original code was to set the port_array entry to
-1 if the duplicate port speed entry said the port was a different speed
than the original port speed entry.  That would mean that later, the port
would not be exposed to the USB core. Unfortunately, I forgot a continue
statement, and the port_array entry would just be overwritten in the next
line.

The second bug would happen if there are conflicting port speed registers
(so that some entry in port_array is -1), or one of the hardware port
registers was not described in the port speed registers (so that some
entry in port_array is 0).  The code that sets up the usb2_ports array
would accidentally claim those ports.  That wouldn't really cause any
user-visible issues, but it is a bug.

This patch should go into the stable trees that have the port array and
USB 3.0 port disabling prevention patches.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
2010-12-09 11:59:42 -08:00
Greg Kroah-Hartman fe4bfb30fe Merge branch 'sh/ehci' of master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6 into work
* 'sh/ehci' of master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: Convert to USB_ARCH_HAS_OHCI/EHCI selects.
  usb: ehci-sh: Add missing ehci helpers.
  usb: ehci-sh: Fix up fault in shutdown path.
  sh: Add EHCI support for SH7786.
  usb: ehci-hcd: Add support for SuperH EHCI.
  usb: ohci-sh: Set IRQ as shared.
2010-12-03 12:12:29 -08:00
Greg Kroah-Hartman 0ae86689d8 Merge branch 'omap4-ehci-for-greg' of git://dev.omapzoom.org/pub/scm/anand/linux-omap-usb into usb-next
* 'omap4-ehci-for-greg' of git://dev.omapzoom.org/pub/scm/anand/linux-omap-usb:
  omap4: 4430sdp: enable the ehci port on 4430SDP
  arm: omap4: select USB_ARCH_HAS_EHCI
  arm: omap4: usb: add platform init code for EHCI
  arm: omap4: add USBHOST and related base addresses
  usb: ehci-omap: Add OMAP4 support
  omap: usb: ehci: introduce HSIC mode
  usb: ehci-omap: add helpers for checking port mode
  usb: ehci-omap: use clkdev aliases for functional clocks
  omap: clock: add clkdev aliases for EHCI clocks
  usb: ehci: introduce CONFIG_USB_EHCI_HCD_OMAP
  usb: ehci-omap: don't hard-code TLL channel count
  usb: ehci-omap: update clock names to be more generic
2010-11-30 17:04:51 -08:00
Paul Mundt b48d7f50e6 usb: Add in missing EHCI helpers.
Several of the EHCI glue drivers either predate or were merged in the
same timeframe as API changes at the USB core level, resulting in some
missing endpoint_reset and clear_tt_buffer_complete callbacks.

This fixes up all of ehci-atmel, mxc, w90x900, and xilinx-of to tie in
the new helpers, which brings them in line with everyone else.

Reported-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-30 16:51:21 -08:00
Jesper Juhl 73f35c60d5 USB: Remove unnecessary casts of void ptr returning alloc function return values
Hi,

The [vk][cmz]alloc(_node) family of functions return void pointers which
it's completely unnecessary/pointless to cast to other pointer types since
that happens implicitly.

This patch removes such casts from drivers/usb/

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
2010-11-30 16:44:57 -08:00
Greg Kroah-Hartman 8244272341 Merge branch 'for-usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into work 2010-11-30 15:38:41 -08:00
Anand Gadiyar 4792a15bf0 usb: ehci-omap: Add OMAP4 support
Update the ehci-omap glue layer to support the controller in the
OMAP4. Major differences from OMAP3 is that the OMAP4 has per-port
clocking, and supports ULPI output clocking mode. The old input
clocking mode is not supported.

Also, there are only 2 externally available ports as against 3
in the OMAP3. The third port is internally tied off and should
not be used.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
2010-12-01 02:35:49 +05:30
Anand Gadiyar a42ccdc14d usb: ehci-omap: add helpers for checking port mode
Introduce helper functions to test port mode. These checks are
performed in several places in the driver, and these helpers
improve readability.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
2010-12-01 02:34:53 +05:30