Commit graph

9536 commits

Author SHA1 Message Date
Johan Hovold bcbec053d2 USB: serial: remove driver version information
Remove all MODULE_VERSION macros and driver-version information (except
for garmin_gps which uses it in a status reply).

It is the kernel version that matters and not some private version
scheme which rarely even gets updated.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31 12:48:06 -07:00
Sebastian Andrzej Siewior b18d26f6ad usb: musb: Perform only write access on MUSB_INTRTXE
This is part of the workaround for AM35x advisory Advisory 1.1.20.
The advisory says that the IPSS bridge can't handle 8 & 16 bit read
access. An 16bit read access to MUSB_INTRTXE results in an 32bit read
access which also reads INTRRX and therefore may lose interrupts.
This patch uses a shadow register of MUSB_INTRTXE so we only perform
write access to it.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:22:18 +02:00
Sebastian Andrzej Siewior af5ec14d40 usb: musb: Perform only write access on MUSB_INTRRXE
This is part of the workaround for AM35x advisory Advisory 1.1.20.
The advisory says that the IPSS bridge can't handle 8 & 16 bit read
access. An 16bit read access to MUSB_INTRRXE results in an 32bit read
access which also reads INTRUSB and therefore may lose interrupts.
This patch uses a shadow register of MUSB_INTRRXE so we only perform
write access to it.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:22:03 +02:00
Sebastian Andrzej Siewior 515ba29cd7 usb: musb: avoid FADDR read access
This is part of the workaround for AM35x advisory Advisory 1.1.20.
The advisory says that the IPSS bridge can't handle 8 & 16 bit read
access. An 8bit read access to FADDR results in an 32bit read
access which also reads INTRTX and therefore may lose interrupts.
This patch removes any reads to FADDR as they are not really required.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:21:01 +02:00
Sebastian Andrzej Siewior b11e94d037 usb: musb: read MUSB_POWER register only when required.
This is part of the workaround for AM35x advisory Advisory 1.1.20.
The advisory says that the IPSS bridge can't handle 8 & 16 bit read
access. An 8bit read access to MUSB_POWER results in an 32bit read
access which also reads INTRTX and therefore may lose interrupts.
This patch tries to minimize reads to MUSB_POWER and perform them only
when required.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:20:40 +02:00
Sebastian Andrzej Siewior 124dafde8f usb: dwc3: remove custom unique id handling
The lockless implementation of the unique id is quite impressive (:P)
but dirver's core can handle it, we can remove it and make our code a
little smaller.

Cc: Anton Tikhomirov <av.tikhomirov@samsung.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:18:52 +02:00
Sebastian Andrzej Siewior b100a2f34d usb: gadget: dummy_hcd: remove global the_controller variable
The one thing that makes two UDCs+HCDs impossible is the global
the_controller variable. This patch changes this. After device
allocation we allocate the "the_controller" variable and pass it as
platform_data to the UDC and its companion.
We can have now multiple instances dummy hcd and therefore I change the
limit from one to two. I was able to test this with g_ncm adn g_zero:

|# lsusb
|Bus 001 Device 002: ID 0525:a4a0 Netchip Technology, Inc. Linux-USB "Gadget Zero"
|Bus 002 Device 002: ID 0525:a4a1 Netchip Technology, Inc. Linux-USB Ethernet Gadget
|Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I was able to start testusb -a and ifconfig usb[01] up with no complains.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:18:01 +02:00
Sebastian Andrzej Siewior c7a1db457b usb: gadget: dummy_hcd: add setup / cleanup of multiple HW intances
This patch creates & adds multiple instances of the HCD and UDC. We have
a new module option "num" which says how many emulated UDCs + HCDs we
want. The default value is one and currently the maximum is one as well.
This will change soon.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:17:07 +02:00
Sebastian Andrzej Siewior b2113136a5 usb: gadget: dummy_hdc: prepare for multiple instances
This patch replaces the single pdev variable by an array. One change:
The device id is no longer -1 (i.e. none) but 0.
This is prepation work for multiple instances of the dummy_hcd + udc
which should help to test gadget framework with multiple UDCs.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:16:47 +02:00
Sebastian Andrzej Siewior 1616e99d42 usb: gadget: let f_* use usb_string_ids_tab() where it makes sense
Instead of calling usb_string_id() multiple times I replace it with one
usb_string_ids_tab(). The NULL pointer in struct usb_string with "" and
are not overwritten in fail or unbind case.

The conditional assignment remains because some gadgets recycle the string
ID because the same descriptor (and string ID) is used if we have more
than one config descriptor.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:11:47 +02:00
Sebastian Andrzej Siewior b36c347966 usb: gadget: uac2: use the strings directly
There is no need for this variable in between.

Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:10:37 +02:00
Sebastian Andrzej Siewior 4ce63571d6 usb: gadget: uac2: provide a variable for interface and alt settings
This patch removes the shifting and masking of interface and its alt
setting and provides its own variable.

This looks better and is smaller:
 text    data     bss     dec     hex filename
x86-32
 6940     956      56    7952    1f10 gadget/audio.o.old
 6908     956      56    7920    1ef0 gadget/audio.o.new
arm
 7914     956      56    8926    22de gadget/audio.o.old
 7886     956      56    8898    22c2 gadget/audio.o.new

Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:10:25 +02:00
Sebastian Andrzej Siewior b7c041aada usb: gadget: remove DMA_ADDR_INVALID from f_uac2 and gadgetfs
DMA_ADDR_INVALID is used by the UDC driver and the gadgets should
provide only a buffer address. Everything else should be taken core of
by the UDC and udc-core.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:10:06 +02:00
Sebastian Andrzej Siewior 10287baec7 usb: gadget: always update HS/SS descriptors and create a copy of them
HS and SS descriptors are staticaly created. They are updated during the
bind process with the endpoint address, string id or interface numbers.

After that, the descriptor chain is linked to struct usb_function which
is used by composite in order to serve the GET_DESCRIPTOR requests,
number of available configs and so on.

There is no need to assign the HS descriptor only if the UDC supports
HS speed because composite won't report those to the host if HS support
has not been reached. The same reasoning is valid for SS.

This patch makes sure each function updates HS/SS descriptors
unconditionally and uses the newly introduced helper function to create a
copy the descriptors for the speed which is supported by the UDC.

While at that, also rename f->descriptors to f->fs_descriptors in order
to make it more explicit what that means.

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:09:44 +02:00
Sebastian Andrzej Siewior 0f9df93938 usb: gadget: uvc: fix error path in uvc_function_bind()
The "video->minor = -1" assigment is done in V4L2 by
video_register_device() so it is removed here.
Now. uvc_function_bind() calls in error case uvc_function_unbind() for
cleanup. The problem is that uvc_function_unbind() frees the uvc struct
and uvc_bind_config() does as well in error case of usb_add_function().
Removing kfree() in usb_add_function() would make the patch smaller but
it would look odd because the new allocated memory is not cleaned up.
However it is not guaranteed that if we call usb_add_function() we also
get to the bind function.
Therefore the patch extracts the conditional cleanup from
uvc_function_unbind() applies to uvc_function_bind().
uvc_function_unbind() now contains only the complete cleanup which is
required once everything has been registrated.

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Bhupesh Sharma <bhupesh.sharma@st.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:07:00 +02:00
Sebastian Andrzej Siewior d0eca719dd usb: gadget: phonet: free requests in pn_bind()'s error path
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:05:55 +02:00
Sebastian Andrzej Siewior 7f2a9268b4 usb: gadget: midi: make FS and HS available
This function works only on FS or HS. If the gadget is HS capable only
HS descriptors are assigned. If we plug it to an 1.1 host it won't work
because we have only 2.0 descriptors. This patch changes the behavior to
provide both sets.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:05:37 +02:00
Sebastian Andrzej Siewior d185039f79 usb: gadget: midi: free hs descriptors
The HS descriptors are only created if HS is supported by the UDC but we
never free them.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:05:20 +02:00
Sebastian Andrzej Siewior 1377af2f75 usb: gadget: audio: remove c->highpseed = true from f_midi and uac1
Whether highspeed configuration is valid or not is something that
composite decides and not the gadget. That gadget can only provide the
required descriptors for it.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:05:00 +02:00
Sebastian Andrzej Siewior e79cc615a9 usb: gadget: network: fix bind() error path
I think this is wrong since 72c973dd ("usb: gadget: add
usb_endpoint_descriptor to struct usb_ep"). If we fail to allocate an ep
or bail out early we shouldn't check for the descriptor which is
assigned at ep_enable() time.

Cc: Tatyana Brokhman <tlinder@codeaurora.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:04:24 +02:00
Sebastian Andrzej Siewior 391aa852a3 usb: gadget: uac2: add some error recovery in afunc_bind()
In case something goes wrong here, don't leak memory / endpoints.

Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:03:27 +02:00
Sebastian Andrzej Siewior 64dce91445 usb: gadget storage: use a computation macro for INT endpoint interval
The 9 for HS means 32ms. Use the macro to make it easier to read.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:02:58 +02:00
Sebastian Andrzej Siewior bcb2f99c6c usb: gadget: use a computation macro for INT endpoint interval
The 5+4 magic for HS tries to aim 32ms which is also what is intended
with 1 << 5 for FS. This little macro should make this easier to
understand.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:01:15 +02:00
Sebastian Andrzej Siewior fad8deb274 usb: gadget: tcm_usb_gadget: NULL terminate the FS descriptor list
The descriptor list for FS speed was not NULL terminated. This patch
fixes this.

While here one of the twe two bAlternateSetting assignments for the BOT
interface. Both assign 0, one is enough.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:00:03 +02:00
Sebastian Andrzej Siewior 585e3931b9 usb: gadget: ecm: Add IAD descriptor in SS mode
Commit d11519 ("usb: gadget: Add Interface Association Descriptor to
ECM") added the IAD descriptor to FS and HS descriptors. The SS
descriptor has been left out probably because it has been added "just
recently".

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 14:59:27 +02:00
Kuninori Morimoto 87c2905fd8 usb: renesas_usbhs: add DMAEngine support on mod_host
This patch enabled dma mapping, and used dma transfer handler
on mod_host

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 14:50:29 +02:00
Kuninori Morimoto 3192fcb234 usb: renesas_usbhs: fixup unreadable macro
mod.h has irq_bempsts/irq_brdysts to keep each irq status,
but it was difficult to find where they were used
on renesas_usbhs driver by using "grep irq_xxxx" command,
since it used irq_##status macro.
This patch fixup them

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 14:50:25 +02:00
Kuninori Morimoto 797b4e145c usb: renesas_usbhs: use devm_request_irq()
This patch uses devm_request_irq() instead of request_irq(),
and removed free_irq() from driver

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 14:50:16 +02:00
Jingoo Han 806df3ac2a USB: ums_realtek: fix build warning
When rts51x_read_status() returns USB_STOR_TRANSPORT_ERROR,
an error happens. This patch fixes build warning as below:

drivers/usb/storage/realtek_cr.c: In function 'init_realtek_cr':
drivers/usb/storage/realtek_cr.c:476:33: warning: 'buf[15]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[15]' was declared here
drivers/usb/storage/realtek_cr.c:475:33: warning: 'buf[14]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[14]' was declared here
drivers/usb/storage/realtek_cr.c:474:50: warning: 'buf[13]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[13]' was declared here
drivers/usb/storage/realtek_cr.c:472:30: warning: 'buf[12]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[12]' was declared here
drivers/usb/storage/realtek_cr.c:471:31: warning: 'buf[11]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[11]' was declared here
drivers/usb/storage/realtek_cr.c:470:31: warning: 'buf[10]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[10]' was declared here
drivers/usb/storage/realtek_cr.c:469:30: warning: 'buf[9]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[9]' was declared here
drivers/usb/storage/realtek_cr.c:468:27: warning: 'buf[8]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[8]' was declared here
drivers/usb/storage/realtek_cr.c:468:43: warning: 'buf[7]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[7]' was declared here
drivers/usb/storage/realtek_cr.c:467:30: warning: 'buf[6]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[6]' was declared here
drivers/usb/storage/realtek_cr.c:466:30: warning: 'buf[5]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[5]' was declared here
drivers/usb/storage/realtek_cr.c:465:28: warning: 'buf[4]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[4]' was declared here
drivers/usb/storage/realtek_cr.c:464:24: warning: 'buf[3]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[3]' was declared here
drivers/usb/storage/realtek_cr.c:464:40: warning: 'buf[2]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[2]' was declared here
drivers/usb/storage/realtek_cr.c:463:24: warning: 'buf[1]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[1]' was declared here
drivers/usb/storage/realtek_cr.c:463:40: warning: 'buf[0]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[0]' was declared here

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:22:22 -07:00
Johan Hovold 5fb0432e64 USB: ftdi_sio: use ftdi_get_modem_status in chars_in_buffer
Use ftdi_get_modem_status to check hardware buffers in chars_in_buffer.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:32 -07:00
Johan Hovold 8da636d9b5 USB: ftdi_sio: optimise chars_in_buffer
No need to check hardware buffers when we know that the software
buffers are non-empty.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:32 -07:00
Johan Hovold 755b6040fa USB: ftdi_sio: use generic chars_in_buffer
Use generic chars_in_buffer rather than copying it's implementation.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:32 -07:00
Johan Hovold 428d998855 USB: serial: export usb_serial_generic_chars_in_buffer
Export generic chars_in_buffer implementation so it can be used in
subdrivers in combination with checks of any hardware buffers.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:30 -07:00
Johan Hovold a4afff6b32 USB: ftdi_sio: refactor modem-control status retrieval
Refactor modem-control status retrieval.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:30 -07:00
Johan Hovold 2c2ee54507 USB: ftdi_sio: fix tiocmget and tiocmset return values
Make sure we do not return USB-internal error codes to userspace.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:30 -07:00
Johan Hovold fef0b828a3 USB: ftdi_sio: fix tiocmget indentation
Align the modem-control status operands as was originally indented.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:30 -07:00
Johan Hovold 81e84424f9 USB: ftdi_sio: remove unused private port-data
Remove unused port field from private port data.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:30 -07:00
Jan Beulich 86effe5980 USB: fix build with XEN and EARLY_PRINTK_DBGP enabled but USB_SUPPORT disabled
Since there's no possible caller of dbgp_external_startup() and
dbgp_reset_prep() when !USB_EHCI_HCD, there's no point in building and
exporting these functions in that case. This eliminates a build error
under the conditions listed in the subject, introduced with the merge
f1c6872e49.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:30 -07:00
Johan Hovold d067a31553 USB: ftdi_sio: remove unnecessary memset
No need to memset a kzalloced struct.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:06:08 -07:00
Johan Hovold 4f2ab88874 USB: cp210x: fix whitespace issues
Fix missing and superfluous whitespace.
Fix misplaced brackets.
Fix indentation.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:06:08 -07:00
Jingoo Han 487c151a4a USB: iuu_phoenix: replace strict_strtoul() with kstrtoul()
The usage of strict_strtoul() is not preferred, because
strict_strtoul() is obsolete. Thus, kstrtoul() should be
used.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:06:08 -07:00
Jan Beulich d99e65bda8 USB: fix build with XEN and EARLY_PRINTK_DBGP enabled but USB_SUPPORT disabled
Since there's no possible caller of dbgp_external_startup() and
dbgp_reset_prep() when !USB_EHCI_HCD, there's no point in building and
exporting these functions in that case. This eliminates a build error
under the conditions listed in the subject, introduced with the merge
f1c6872e49.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:05:14 -07:00
Johan Hovold 8e493ca176 USB: usb_wwan: fix bulk-urb allocation
Make sure we do not allocate urbs if we do not have a bulk endpoint.

Legacy code used incorrect assumption to test for bulk endpoints.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 12:46:51 -07:00
Joe Perches f2ec522e78 usb: Convert dev_printk(KERN_<LEVEL> to dev_<level>(
dev_<level> calls take less code than dev_printk(KERN_<LEVEL>
and reducing object size is good.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 12:32:03 -07:00
Greg Kroah-Hartman 169b245a72 usb: fixes for v3.7-rc4
We're reverting MUSB Mode 1 DMA patch which caused many regressions. Meanwhile
 Roger is cooking a better version of that patch, which will hopefully be ready
 for v3.8 merge window.
 
 We also fix an undeclared error in ux5000_remove() and another build error
 when we try to build USB_MUSB_OMAP2PLUS as a module.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQj8prAAoJEIaOsuA1yqREHq8P/RYhQkCXdn9VqhhZGJwRWNve
 b46rNsWw0qWsGefi4yTRxzLSFpASI9dH+BMs8eC7DA5JrwbRlQsL8SeY41pxclyz
 yH/hFxsUen2oUMkoFQ6Ydm04VP0YDOplQ62HSIjtTYcE2eUqPKtxkXlZpIy80HD/
 9QI/R4bJNOR6LqtZSXOK3ySUkSiTCwxtrJh4bGIgxYaVxwXwuIoc2HTFVf3FkypD
 oT240npC+/xOUAFjs8a0b6AoAs6GEjePUvhX6J+cfdGIRylfro0/sEGfs4yt9dBi
 juKMje0h5VMtLHRUutBcEv2daDXd97htkYL2Qh/MaUIftJ5vCKtb+4/VjfZSainf
 +S5aLWfGgHxXc0+AscJbk45WOEBVEakL6IvuTScO2/wvxhwH+Ag9RHs6DeViGl27
 qU4i8MliF3zAeNt+ErDwLhMxslkbqekYUSVEgoAm7RQkqoW+VkAjSxVA0sBzhtVQ
 6PRF83WPgfLpUqbvuE8fA/qCCnGv8rpo66Ljd67BRZplUme5RVIMvsbvy9e9mBU4
 85Ujz3p8ouVAFRABHaYr/8aSKsdtF+lUQYdrthb5TMHbq2eW76xTWCZCRdjgOpsC
 kA/6I+h1rThA1VGlbyWUwYZSUSLrLWktCx/EZijI7IreVdpiLtWp3gd/YpKQbzq2
 ylZe/DoQMCND0wwT9sCE
 =caV/
 -----END PGP SIGNATURE-----

Merge tag 'fixes-for-v3.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus

usb: fixes for v3.7-rc4

We're reverting MUSB Mode 1 DMA patch which caused many regressions. Meanwhile
Roger is cooking a better version of that patch, which will hopefully be ready
for v3.8 merge window.

We also fix an undeclared error in ux5000_remove() and another build error
when we try to build USB_MUSB_OMAP2PLUS as a module.
2012-10-30 09:38:55 -07:00
Roger Quadros f6bc8c2938 usb: otg: Fix build errors if USB_MUSB_OMAP2PLUS is selected as module
TWL4030_USB & TWL6030_USB must depend on USB_MUSB_OMAP2PLUS in Kconfig else
we get build errors with

CONFIG_USB_MUSB_HDRC=m
CONFIG_USB_MUSB_OMAP2PLUS=m
CONFIG_TWL4030_USB=y
CONFIG_TWL6030_USB=y

LD      init/built-in.o
drivers/built-in.o: In function `twl4030_usb_irq':
drivers/usb/otg/twl4030-usb.c:518: undefined reference to `omap_musb_mailbox'
drivers/built-in.o: In function `twl4030_usb_phy_init':
drivers/usb/otg/twl4030-usb.c:540: undefined reference to `omap_musb_mailbox'

drivers/built-in.o: In function `twl6030_usb_irq':
drivers/usb/otg/twl6030-usb.c:230: undefined reference to `omap_musb_mailbox'
drivers/usb/otg/twl6030-usb.c:225: undefined reference to `omap_musb_mailbox'
drivers/built-in.o: In function `twl6030_usbotg_irq':
drivers/usb/otg/twl6030-usb.c:259: undefined reference to `omap_musb_mailbox'

CC: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-30 14:37:07 +02:00
Greg Kroah-Hartman b472b8e22f Merge 3.7-rc3 into usb-next.
This pulls in all of the USB changes in 3.7-rc3 into usb-next and
resolves the merge issue with:
	drivers/usb/misc/ezusb.c

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-29 09:04:39 -07:00
Wei Yongjun 9a65d162e4 usb: musb: ux500: fix 'musbid' undeclared error in ux500_remove()
commit 65b3d52d02
(usb: musb: add musb_ida for multi instance support)
used musbid in ux500_remove() but nerver declared it.

I found this in x86_64 platform, but not sure whether
this is a error on the correct ARCH.

$ make drivers/usb/musb/ux500.o
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `relocs'.
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CC      drivers/usb/musb/ux500.o
drivers/usb/musb/ux500.c: In function 'ux500_probe':
drivers/usb/musb/ux500.c:78:2: error: 'musbid' undeclared (first use in this function)
drivers/usb/musb/ux500.c:78:2: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [drivers/usb/musb/ux500.o] Error 1
make: *** [drivers/usb/musb/ux500.o] Error 2

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 11:11:21 +03:00
Wei Yongjun 4b0de6f383 usb: musb: ux500: use platform_device_unregister in ux500_remove()
platform_device_unregister() only calls platform_device_del() and
platform_device_put(), thus use platform_device_unregister() to
simplify the code.

Also the documents in platform.c shows that platform_device_del
and platform_device_put must _only_ be externally called in error
cases.  All other usage is a bug.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 11:10:39 +03:00
Wei Yongjun a81a01f9fe usb: musb: tusb6010: use platform_device_unregister in tusb_remove()
platform_device_unregister() only calls platform_device_del() and
platform_device_put(), thus use platform_device_unregister() to
simplify the code.

Also the documents in platform.c shows that platform_device_del
and platform_device_put must _only_ be externally called in error
cases.  All other usage is a bug.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 11:10:33 +03:00
Wei Yongjun b415c8fa9e usb: musb: dsps: use platform_device_unregister in dsps_delete_musb_pdev()
platform_device_unregister() only calls platform_device_del() and
platform_device_put(), thus use platform_device_unregister() to
simplify the code.

Also the documents in platform.c shows that platform_device_del
and platform_device_put must _only_ be externally called in error
cases.  All other usage is a bug.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 11:10:22 +03:00
Wei Yongjun 12a71f5b1c usb: musb: davinci: use platform_device_unregister in davinci_remove()
platform_device_unregister() only calls platform_device_del() and
platform_device_put(), thus use platform_device_unregister() to
simplify the code.

Also the documents in platform.c shows that platform_device_del
and platform_device_put must _only_ be externally called in error
cases.  All other usage is a bug.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 11:09:53 +03:00
Wei Yongjun b59e906c57 usb: musb: da8xx: use platform_device_unregister in da8xx_remove()
platform_device_unregister() only calls platform_device_del() and
platform_device_put(), thus use platform_device_unregister() to
simplify the code.

Also the documents in platform.c shows that platform_device_del
and platform_device_put must _only_ be externally called in error
cases.  All other usage is a bug.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 11:09:46 +03:00
Wei Yongjun 01e40da08c usb: musb: blackfin: use platform_device_unregister in bfin_remove()
platform_device_unregister() only calls platform_device_del() and
platform_device_put(), thus use platform_device_unregister() to
simplify the code.

Also the documents in platform.c shows that platform_device_del
and platform_device_put must _only_ be externally called in error
cases.  All other usage is a bug.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 11:09:36 +03:00
Wei Yongjun 5629151531 usb: musb: am35x: use platform_device_unregister in am35x_remove()
platform_device_unregister() only calls platform_device_del() and
platform_device_put(), thus use platform_device_unregister() to
simplify the code.

Also the documents in platform.c shows that platform_device_del
and platform_device_put must _only_ be externally called in error
cases.  All other usage is a bug.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 11:09:04 +03:00
Felipe Balbi 00a89180e5 Revert "usb: musb: use DMA mode 1 whenever possible"
This reverts commit 4f3e8d263d.

it turns out that current implementation of Mode 1
DMA added a few regressions to some users, so we
need to revert this patch and let author work on
a better version of Mode 1 DMA support.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 09:55:31 +03:00
Sarah Sharp df0379065b xhci: trivial: Remove assigned but unused ep_ctx.
Remove the variable ep_ctx from xhci_add_endpoint(), since it is
assigned but unused.  Caught by Coverity.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-10-25 13:13:48 -07:00
Sarah Sharp 7e5f77f9bc xhci: trivial: Remove assigned but unused slot_ctx.
Remove the variable slot_ctx from xhci_dbg_ctx(), since it is assigned
but unused.  Caught by Coverity.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-10-25 13:13:48 -07:00
Sarah Sharp b80313422a xhci: Fix missing break in xhci_evaluate_context_result.
Coverity complains that xhci_evaluate_context_result() is missing a
break statement after the COMP_EBADSLT switch case.  It's not a big
deal, since we wanted to return the same error code as the case
statement below it does.  The end result would be one that a Slot
Disabled error completion code would also print the warning message
associated with a Context State error code.  No other bad behavior would
result.

It's not worth backporting to stable kernels, since it only fixes an
issue with too much debugging.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-10-25 13:13:48 -07:00
Sarah Sharp 43a09f7fb0 xhci: Fix potential NULL ptr deref in command cancellation.
The command cancellation code doesn't check whether find_trb_seg()
couldn't find the segment that contains the TRB to be canceled.  This
could cause a NULL pointer deference later in the function when next_trb
is called.  It's unlikely to happen unless something is wrong with the
command ring pointers, so add some debugging in case it happens.

This patch should be backported to stable kernels as old as 3.0, that
contain the commit b63f4053cc "xHCI:
handle command after aborting the command ring".

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@vger.kernel.org
2012-10-25 13:13:47 -07:00
Nobuhiro Iwamatsu d124a60dbb USB: isp1760-if: Change to use irq_of_parse_and_map
This uses irq_of_parse_and_map instead of of_irq_map_one and
irq_create_of_mapping.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:51:52 -07:00
Ming Lei 596d789a21 USB: set hub's default autosuspend delay as 0
This patch sets hub device's default autosuspend delay as 0 to
speedup bus suspend, see comments in code for details.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:45:32 -07:00
Ming Lei e6f30deafe USB: check port changes before hub runtime suspend for some bug device
The hub status endpoint has a long 'bInterval', which is 255ms
for FS/LS device and 256ms for HS device according to USB 2.0 spec,
so the device connection change may be reported later more than 255ms
via status pipe.

The connection change in hub may have been happened already on the
downstream ports, but no status URB completes when it is killed
in hub_suspend(auto), so the connection change may be missed by some
buggy hub devices, which won't generate remote wakeup signal after
their remote wakeup is enabled and they are put into suspend state.

The problem can be observed at least on the below Genesys Logic, Inc.
hub devices:

	0x05e3,0x0606
	0x05e3,0x0608

In theory, there is no way to fix the problem completely, but we
can make it less likely to occur by this patch.

This patch introduces one quirk of HUB_QUIRK_CHECK_PORTS_AUTOSUSPEND
to check ports' change during hub_suspend(auto) for the buggy
devices. If ports' change is found, terminate the auto suspend and
return to working state.

So for the buggy hubs, if the connection change happend before
the ports' check, it can be handled correctly. If it happens between
the ports' check and enabling remote wakeup/entering suspend, it
will be missed. Considered the interval is quite short, it is very
less likely to happen during the window.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:45:32 -07:00
Anisse Astier 8daf8b6086 ehci: Add yet-another Lucid nohandoff pci quirk
Board name changed on another shipping Lucid tablet.

Signed-off-by: Anisse Astier <anisse@astier.eu>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:43:44 -07:00
Anisse Astier c323dc023b ehci: fix Lucid nohandoff pci quirk to be more generic with BIOS versions
BIOS vendors keep changing the BIOS versions. Only match the beginning
of the string to match all Lucid tablets with board name M11JB.

Signed-off-by: Anisse Astier <anisse@astier.eu>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:43:44 -07:00
Johan Hovold ae685effe7 USB: mos7840: fix port_probe flow
Remove temporary do-while(0) loop used to keep changes minimal.

Fixup indentation, remove some line breaks, and replace break with goto
to maintain flow.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:11:19 -07:00
Johan Hovold 80c00750f0 USB: mos7840: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that the indentation was kept intact using a do-while(0) in order
to facilitate review. A follow-up patch will remove it.

Compile-only tested.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:11:19 -07:00
Johan Hovold e681b66f2e USB: mos7840: remove invalid disconnect handling
Remove private zombie flag used to signal disconnect and to prevent
control urb from being submitted from interrupt urb completion handler.

The control urb will not be re-submitted as both the control urb and the
interrupt urb is killed on disconnect.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:11:19 -07:00
Johan Hovold 28c3ae9a8c USB: mos7840: remove NULL-urb submission
The private int_urb is never allocated so the submission from the
control completion handler will always fail. Remove this odd piece of
broken code.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:11:19 -07:00
Jarkko Huijts 6f602912c9 usb: serial: ftdi_sio: Add missing chars_in_buffer function
The driver does not wait until the hardware buffer (for data from the PC to the
UART line) is drained when tcdrain or close is called in an application.
Solution: Implement a chars_in_buffer function that checks both the software
and hardware buffer. If the TEMT (TX empty) bit of the line status register
indicates the hw buffer is not empty, let the function return at least 1. This
has been verified to work correctly with an FT232RL. The check on the hw buffer
can not be done for the original SIO device.

Signed-off-by: Jarkko Huijts <jarkko.huijts@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:42:26 -07:00
Johan Hovold 961be09e1e USB: qcserial: fix interface-data memory leak in error path
Move interface data allocation to attach so that it is deallocated
should usb-serial probe fail.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:39:38 -07:00
Johan Hovold c2dd4a8eac USB: option: fix interface-data memory leak in error path
Move interface data allocation to attach so that it is deallocated
should usb-serial probe fail.

Note that the usb device id is stored at probe so that it can be used
in attach to determine send-setup blacklisting.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:39:37 -07:00
Johan Hovold a997448c89 USB: ipw: fix interface-data memory leak in error path
Move interface data allocation to attach so that it is deallocated
should usb-serial probe fail.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:39:37 -07:00
Johan Hovold 3eb55cc4ed USB: mos7840: fix port-device leak in error path
The driver set the usb-serial port pointers to NULL on errors in attach,
effectively preventing usb-serial core from decrementing the port ref
counters and releasing the port devices and associated data.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:38:06 -07:00
Johan Hovold 65a4cdbb17 USB: mos7840: fix urb leak at release
Make sure control urb is freed at release.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:38:06 -07:00
Johan Hovold f525c05bab USB: sierra: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note also that urb-count for multi-port interfaces has not been changed
even though the usb-serial port number is now determined from the port
and interface minor numbers.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:37:13 -07:00
Johan Hovold 084817d793 USB: sierra: fix memory leak in probe error path
Move interface data allocation to attach so that it is deallocated on
errors in usb-serial probe.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:37:13 -07:00
Johan Hovold 7e41f9bcdd USB: sierra: fix memory leak in attach error path
Make sure port private data is deallocated on errors in attach.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:37:13 -07:00
Johan Hovold b8f0e82044 USB: usb-wwan: fix multiple memory leaks in error paths
Fix port-data memory leak in usb-serial probe error path by moving port
data allocation to port_probe.

Since commit a1028f0abf ("usb: usb_wwan: replace release and disconnect
with a port_remove hook") port data is deallocated in port_remove. This
leaves a possibility for memory leaks if usb-serial probe fails after
attach but before the port in question has been successfully registered.

Note that this patch also fixes two additional memory leaks in the error
path of attach should port initialisation fail for any port as the urbs
were never freed and neither was the data of any of the successfully
initialised ports.

Compile-only tested.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:37:13 -07:00
Johan Hovold f79b2d0fe8 USB: keyspan: fix NULL-pointer dereferences and memory leaks
Fix NULL-pointer dereference at release by moving port data allocation
and deallocation to port_probe and port_remove.

Fix NULL-pointer dereference at disconnect by stopping port urbs at
port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer accessible at
disconnect or release.

Note that this patch also fixes port and interface-data memory leaks in
the error path of attach should port initialisation fail for any port.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:37:13 -07:00
Johan Hovold 5260e458f5 USB: mct_u232: fix broken close
Make sure generic close is called at close.

The driver relies on the generic write implementation but did not call
generic close.

Note that the call to kill the read urb is not redundant, as mct_u232
uses an interrupt urb from the second port as the read urb and that
generic close therefore fails to kill it.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:37:09 -07:00
Johan Hovold a8f2ae7a3a USB: mct_u232: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that the write waitqueue was initialised but never used.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:37:04 -07:00
Johan Hovold acbf0e5263 USB: opticon: fix memory leak in error path
Fix memory leak in write error path.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:59 -07:00
Johan Hovold ea0dbebffe USB: opticon: fix DMA from stack
Make sure to allocate the control-message buffer dynamically as some
platforms cannot do DMA from stack.

Note that only the first byte of the old buffer was used.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:59 -07:00
Johan Hovold 2f0295adf6 USB: quatech2: fix io after disconnect
Make sure no control urb is submitted during close after a disconnect by
checking the disconnected flag.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:58 -07:00
Johan Hovold 8e512ab0b6 USB: quatech2: fix close and disconnect urb handling
Kill urbs unconditionally at close and disconnect.

Note that URB status is not valid outside of completion handler.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:58 -07:00
Johan Hovold 40d0473849 USB: quatech2: fix port-data memory leaks
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that this also fixes memory leaks in the error path of attach where
the write urbs were not freed on errors.

Make sure all interface-data deallocation is done in release by moving
the read urb deallocation from disconnect.

Note that the write urb is killed during close so that the call in
disconnect was superfluous.

Compile-only tested.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:58 -07:00
Johan Hovold b8a0055050 USB: quatech2: fix memory leak in error path
Fix memory leak in attach error path where the read urb was never freed.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:58 -07:00
Johan Hovold feffa7ca60 USB: omninet: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:58 -07:00
Johan Hovold 4230af572f USB: mos7720: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that this patch also fixes a second port-data memory leak in the
error path of attach, should parallel-port initialisation fail.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:58 -07:00
Johan Hovold fb44ff854e USB: digi_acceleport: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that the oob port is never registered as a port device and should
thus be handled in attach and release.

Compile-only tested.

Cc: Peter Berger <pberger@brimson.com>
Cc: Al Borchers <alborchers@steinerpoint.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:57 -07:00
Johan Hovold 456c5be56e USB: ch341: fix port-data memory leak
Fix port-data memory leak by moving port data allocation to port_probe
and actually implementing deallocation.

Note that this driver has never even bothered to try to deallocate it's
port data...

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:57 -07:00
Johan Hovold c467206ed6 USB: whiteheat: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that the fifth port (command port) is never registered as a
port device and thus should be handled in attach and release.

Compile-only tested.

Cc: <support@connecttech.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:57 -07:00
Johan Hovold c129197c99 USB: whiteheat: fix memory leak in error path
Make sure command buffer is deallocated in case of errors during attach.

Cc: <support@connecttech.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:57 -07:00
Johan Hovold 2ee44fbeac USB: metro-usb: fix io after disconnect
Make sure no control urb is submitted during close after a disconnect by
checking the disconnected flag.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:57 -07:00
Johan Hovold 50dde8686e USB: metro-usb: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that the call to metrousb_clean (close) in shutdown was redundant.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:57 -07:00
Tony Lindgren 6d02643d64 Merge branch 'omap-for-v3.8/cleanup-headers-usb' into omap-for-v3.8/cleanup-headers
Conflicts:
	arch/arm/mach-omap1/clock.c
	arch/arm/mach-omap2/board-2430sdp.c
	arch/arm/mach-omap2/board-4430sdp.c
	arch/arm/mach-omap2/board-cm-t35.c
	arch/arm/mach-omap2/board-igep0020.c
	arch/arm/mach-omap2/board-ldp.c
	arch/arm/mach-omap2/board-omap3beagle.c
	arch/arm/mach-omap2/board-omap3logic.c
	arch/arm/mach-omap2/board-omap4panda.c
	arch/arm/mach-omap2/board-overo.c
	arch/arm/mach-omap2/board-rm680.c
	arch/arm/mach-omap2/board-rx51.c
	arch/arm/mach-omap2/twl-common.c
	arch/arm/mach-omap2/usb-host.c
	arch/arm/mach-omap2/usb-musb.c
2012-10-24 15:05:45 -07:00
Michael Shigorin d7870af7e2 usb-storage: add unusual_devs entry for Casio EX-N1 digital camera
This commit sets removable subclass for Casio EX-N1 digital camera.

The patch has been tested within an ALT Linux kernel:
http://git.altlinux.org/people/led/packages/?p=kernel-image-3.0.git;a=commitdiff;h=c0fd891836e89fe0c93a4d536a59216d90e4e3e7

See also https://bugzilla.kernel.org/show_bug.cgi?id=49221

Signed-off-by: Oleksandr Chumachenko <ledest@gmail.com>
Signed-off-by: Michael Shigorin <mike@osdn.org.ua>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 15:00:11 -07:00
Justin P. Mattock bd066eef1a usb: "ehci-w90x900" Fix a typo and add some whitespace.
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:51:22 -07:00
Alan Stern bfd1e91013 USB: speed up usb_bus_resume()
This patch (as1620) speeds up USB root-hub resumes in the common case
where every enabled port has its suspend feature set (which currently
will be true for every runtime resume of the root hub).  If all the
enabled ports are suspended then resuming the root hub won't resume
any of the downstream devices.  In this case there's no need for a
Resume Recovery delay, because that delay is meant to give devices a
chance to get ready for active use.

To keep track of the port suspend features, the patch adds a
"port_is_suspended" flag to struct usb_device.  This has to be tracked
separately from the device's state; it's entirely possible for a USB-2
device to be suspended while the suspend feature on its parent port is
clear.  The reason is that devices will go into suspend whenever their
parent hub does.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Peter Chen <peter.chen@freescale.com>
Tested-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:51:22 -07:00
Alan Stern 969ddcfc95 USB: hub_for_each_child should skip unconnected ports
This patch (as1619) improves the interface to the "hub_for_each_child"
macro.  The name clearly suggests that the macro iterates over child
devices; it does not suggest that the loop will also iterate over
unnconnected ports.

The patch changes the macro so that it will skip over unconnected
ports and iterate only the actual child devices.  The two existing
call sites are updated to avoid testing for a NULL child pointer,
which is now unnecessary.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:51:21 -07:00
Alan Stern d39dbc8918 USB: EHCI: move ehci_update_device() to ehci-lpm.c
In preparation for splitting the ehci-hcd driver into a core library
and separate platform-specific driver modules, this patch (as1618)
moves ehci_update_device() from a couple of platform-specific source
files into ehci-lpm.c.  This is where it should have been all along,
since all it does is call a couple of other functions that are already
in ehci-lpm.c.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:45:17 -07:00
Alan Stern acc0850340 USB: EHCI: make ehci_read_frame_index platform independent
In preparation for splitting the ehci-hcd driver into a core library
and separate platform-specific driver modules, this patch (as1617)
changes the way ehci_read_frame_index() is handled.

Since the same core library will have to work with both PCI and
non-PCI platforms, the quirk handler routine will be compiled
unconditionally.  The decision about whether to call it or simply to
read the frame index register is made at run time, based on whether
the frame_index_bug quirk flag is set.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:45:17 -07:00
Alan Stern d6064aca82 USB: EHCI: move logging macros to ehci.h
In preparation for splitting the ehci-hcd driver into a core library
and separate platform-specific driver modules, this patch (as1616)
moves the console logging macros from ehci-dbg.c to ehci.h, where they
will be available to the platform drivers.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:45:17 -07:00
Peter Chen 6273f1810f USB: EHCI: add condition for delay during the resume
Without this condition, all controllers will do this delay,
and increase the resume time.

Only enabled and unsuspended port needs this delay, but
Some buggy hardware(like Synopsys usb controller) will
clear suspend bit once they receive/send resume signal,
so it takes resume bit as consideration.

Tested it at Freescale i.mx6q Sabrelite board.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:40:50 -07:00
Constantine Shulyupin e8cebb9cde USB: usb-skeleton.c: fix compilation error and restored kref_put on fail in skel_open
Fixing compilaton error.
Incrementing usage counter only on successful execution of skel_open.
Removing redundant locking

Some last changes in function skel_open and finally commit
52a7499 Revert "USB: usb-skeleton.c: fix open/disconnect race"
introduced a bug in function skel_open, which this patch fixes.

Changes since v2:
- refactoring
- Removing redundant mutex synchronization.

Changes since v1:
- Fixed accordingly feedback of Oliver Neukum oneukum@suse.de: also need to drop the lock.

Signed-off-by: Constantine Shulyupin <const@MakeLinux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:40:50 -07:00
Jingoo Han 801f006335 USB: ohci-s3c2410: use devm_ functions
The devm_ functions allocate memory that is released when a driver
detaches. This makes the code smaller and a bit simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:40:50 -07:00
Yuanhan Liu 30b1e495b8 USB: use bus_to_hdc instead of container_of
We defined bus_to_hdc for that, use it.

Signed-off-by: Yuanhan Liu <yliu.null@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:40:50 -07:00
Jingoo Han 60d80adbac USB: ohci-exynos: use devm_clk_get()
The devm_ functions allocate memory that is released when a driver
detaches. This patch uses devm_clk_get() for these functions.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:39:52 -07:00
Thomas Abraham c05c946c68 usb: ohci-exynos: use clk_prepare_enable and clk_disable_unprepare
Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare
calls as required by common clock framework.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:39:06 -07:00
Thomas Abraham e1deb56cb7 usb: ehci-s5p: use clk_prepare_enable and clk_disable_unprepare
Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare
calls as required by common clock framework.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:39:06 -07:00
Stephen Warren ffc7493df7 usb: phy: tegra remove include of <mach/iomap.h>
Almost nothing from this file is used, and the file will hopefully be
deleted soon. Copy the tiny portions that are used directly into
tegra_usb_phy.c. I believe that Venu Byravarasu is working on cleaning up
our USB driver, and those cleanups will remove the need for these
constants.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:35:44 -07:00
Stephen Warren 54388b281c usb: host: tegra remove include of <mach/iomap.h>
Almost nothing from this file is used, and the file will hopefully be
deleted soon. Copy the tiny portions that are used directly into
ehci-tegra.c. I believe that Venu Byravarasu is working on cleaning up
our USB driver, and those cleanups will remove the need for these
constants.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:35:44 -07:00
Felipe Balbi e8c4a7acc9 ARM: OMAP: move OMAP USB platform data to <linux/platform_data/omap-usb.h>
In order to make single zImage work for ARM architecture,
we need to make sure we don't depend on private headers.

Move USB platform_data to <linux/platform_data/omap-usb.h>
and add a minimal drivers/mfd/usb-omap.h.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Partha Basak <parthab@india.ti.com>
Cc: Keshava Munegowda <keshava_mgowda@ti.com>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Felipe Balbi <balbi@ti.com>
[tony@atomide.com: updated for local mfd/usb-omap.h]
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-24 14:26:55 -07:00
Greg Kroah-Hartman c30186e51e USB: ezusb: unexport some functions that aren't being used
When the ezusb code was split out, support was added for the fx2 chip
type, but no one is using these functions, so comment it out.  If
someone needs it, it can be added back in the future.

Also properly include <linux/usb/ezusb.h> into the ezusb.c file, to
ensure we catch any function prototype mis-matches

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: René Bürgel <rene.buergel@sohard.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:19:16 -07:00
Tony Lindgren 3e9a6321f9 This is the first set of omap cleanup patches for v3.8 merge
window to remove most of the remaining plat includes to get us
 closer to ARM common zImage support.
 
 To avoid a huge amount of trivial merge conflicts with includes,
 this branch is based on several small topic branches coordinated
 with the driver subsystem maintainers. These branches are based on
 v3.7-rc1 and can also be merged into the related driver subsystem
 branches as needed:
 
 omap-for-v3.8/cleanup-headers-prepare   few trivial driver changes
 omap-for-v3.8/cleanup-headers-dma       move of the DMA header
 omap-for-v3.8/cleanup-headers-gpmc      GPMC and MTD changes
 omap-for-v3.8/cleanup-headers-mmc       MMC related changes
 omap-for-v3.8/cleanup-headers-dss       DSS related changes
 omap-for-v3.8/cleanup-headers-asoc      ASoC related changes
 
 Note that for the dma-omap.h, it was decided that it should be
 is completed. For the related discussion, please see:
 
 https://patchwork.kernel.org/patch/1519591/#
 
 After these patches we still have a few plat headers remaining
 that will be handled in later pull requests.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQgLn6AAoJEBvUPslcq6VztJIQAMDLmUr4XRa0pV9ASPieMSnP
 LqXQ8Gpr8JP6I2A7mjj5K/PVvU2PCIgefX5/F7PssWeDzPs1p6T5eQc6/Oo88j+k
 6xIaPJtuU6aiMKiH4QJBU9mfFZN4tvKNX8sJZ4YhzAmkKshwSd2XdWQlkSWYV7Ii
 QFRXOdYdX3dgvt3Pv5LYhFMlRDzXlMtCNkdyO0C5yDc038FvT5kxcgpOJ99ndX1F
 aSpNPchDwEXP7WZl3O7uZs732hRHQbKraMkzalVJ5mgvLSwF7VsB+BLdjOgRqFfg
 edpAPt/izpTk7cg7RQiItrW3xz3eSiN/fiAg2wLvxr6ewzB5DguPLa6DNPF+uyup
 BlpQAvNsICIixfKb/qimQBOkB71TTRxqvBnG0Vt/cExS1dTuWlhyCYzA6dhZtl+w
 7ETCo7Mmj+L9T1EfzhMPgjWvMZ4Luli4NHSUYxMl5Cs8nu1y6ytIXxH9e0mnZAbK
 n4ANoIuFE3ZueXWnHAVCOs0YZj2F1OLB+mFkIFg3OVpB4WCXiOTgJuDNsAAQNS3/
 VsYVehNFRB/E/lMWkN293j95LRSwl/sIKbvlpxe7M3XQi4IWh1bDPwcg1YhGPxRV
 HIuQSSMIIzcsFoDqbQYv9qzpvslfee58fBV0L8BzMyXNd1lYzWJ5Af6A8ddSVVFS
 Hh+btZObC1zP/2IKbImk
 =HUTj
 -----END PGP SIGNATURE-----

Merge tag 'omap-for-v3.8/cleanup-headers-signed' into omap-for-v3.8/cleanup-headers-serial-take2

This is the first set of omap cleanup patches for v3.8 merge
window to remove most of the remaining plat includes to get us
closer to ARM common zImage support.

To avoid a huge amount of trivial merge conflicts with includes,
this branch is based on several small topic branches coordinated
with the driver subsystem maintainers. These branches are based on
v3.7-rc1 and can also be merged into the related driver subsystem
branches as needed:

omap-for-v3.8/cleanup-headers-prepare   few trivial driver changes
omap-for-v3.8/cleanup-headers-dma       move of the DMA header
omap-for-v3.8/cleanup-headers-gpmc      GPMC and MTD changes
omap-for-v3.8/cleanup-headers-mmc       MMC related changes
omap-for-v3.8/cleanup-headers-dss       DSS related changes
omap-for-v3.8/cleanup-headers-asoc      ASoC related changes

Note that for the dma-omap.h, it was decided that it should be
is completed. For the related discussion, please see:

https://patchwork.kernel.org/patch/1519591/#

After these patches we still have a few plat headers remaining
that will be handled in later pull requests.
2012-10-24 13:25:44 -07:00
Lennart Sorensen f7bc505166 USB: serial: Fix memory leak in sierra_release()
I found a memory leak in sierra_release() (well sierra_probe() I guess)
that looses 8 bytes each time the driver releases a device.

Signed-off-by: Len Sorensen <lsorense@csclub.uwaterloo.ca>
Acked-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 11:45:34 -07:00
Octavian Purdila 036546bf95 usb hub: use flush_work instead of flush_work_sync
flush_work_sync and flush_work are now the same and flush_work_sync
has been deprecated. This fixes the following warning:

drivers/usb/core/hub.c: In function hub_quiesce:
drivers/usb/core/hub.c:1216:3: warning: flush_work_sync is deprecated (declared at include/linux/workqueue.h:448) [-Wdeprecated-declarations]

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-23 19:58:07 -07:00
Dave Jones 197ef5ef37 USB: Add missing license tag to ezusb driver.
ezusb: module license 'unspecified' taints kernel

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-23 19:42:31 -07:00
Greg Kroah-Hartman 3a99ba53d1 xHCI fixes for 3.7-rc3
Hi Greg,
 
 Here's four bug fixes for 3.7.
 
 The first patch fixes a potential deadlock in the USB port power off code,
 and the last two patches fix bugs in the USB 3.0 Link PM patchset.  The
 second one is trivial and removes an unnecessary cast.
 
 Sarah Sharp
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQhx9VAAoJEBMGWMLi1Gc5pWkP/2tlO+vD+8HUr3bsdQT1Avmn
 yyrK2zRdvqQ2LWhQmuKySvbB5911Jm1WPCeU8OUvQF2VCO49XKsSKFIQ/mUM+TWd
 VaTAUyb+kdaxtulDIP6FiwXmb3SQavDSPek5kJ3W5nTZz32IQR7tODfwdhAv8Jla
 jcWDOnisc2OnxYNEGu72i7kngpKf88iZTIjKoH8+inXkZM5WQ1SNK6mtR4coRjvE
 HvoiivuIgdOL/326bdV6S3ysCRHUjEMlUWbJF9hyGjrCVBxTBg/r7sbNJGd39CMP
 zmRs/fUEfFr2asFB+jwSM8/Dj8bb11O88lwzD5E3FqdXbTjH8eDkgkxhrIYsHtrA
 /eB6TcTPXo7reeJUo5jLaKD3aBe69LR47YC7apL6+hgloqvIHsOD3rWpFoZZPusZ
 2F6WgNg21pNah3+PufnJepMYvm/T0yZAhoK05EePkPSoFvUUBiu+j485dwajO4vj
 387mmbFchXdj/QWgiMM2KXrxOskrijJVkLhg8rOV67nwl6DgoVzqh28q6edXxrfu
 +QhxdHioWF2AQm1l9AdrotWqSBoCFEVXoQjszfYK2ZRR5lfiXRK2b4pjDobnhLo+
 v+eQVCJerOuV32a3w16755AVejE6DBP3ouTq0eCRpr0Y0aL5dpi+xVJWvVxxJ6I1
 h1NcSn02ENZxMn3kF+hr
 =W4Wk
 -----END PGP SIGNATURE-----

Merge tag 'for-usb-linus-2012-10-23' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-linus

xHCI fixes for 3.7-rc3

Hi Greg,

Here's four bug fixes for 3.7.

The first patch fixes a potential deadlock in the USB port power off code,
and the last two patches fix bugs in the USB 3.0 Link PM patchset.  The
second one is trivial and removes an unnecessary cast.

Sarah Sharp
2012-10-23 19:25:52 -07:00
Greg Kroah-Hartman c24d1ce579 usb: fixes for v3.7-rc3
Here's a new set of fixes for v3.7-rc3. It's quite small, only
 four patches.
 
 There's one bug fix for the newly added musb-dsps glue layer where
 we could be overflowing a buffer when creating the instance name.
 
 NET2272 got a fix for a case where the lock would be left held
 when exiting the IRQ handler with error in case of Spurious IRQs.
 
 Renensas USBHS got a DMA stall fix which would cause transfers to
 stall forever and a NULL pointer deref fix in case of pipe detach.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQhkFgAAoJEIaOsuA1yqREDn4P/3I3h1F5Oee0F/G1OXFYVWid
 KD/d5S5I8bP3OESZcsnufn6sLD5zaeucdVh20gDjGuTH7QK6N2z+/i5A6RlgS++U
 eIIXMb7oLJ30NeGV8/wdtrRXT/+DKHq0RWLMWcdlc/KxH2jvbvD23pSA44gzWLdL
 GoaViXFAKJ6aEWoBo7AEPx9uzv4HRk+6uHPqmp6xlhNgFnlShR6oWDSO+0EdJyTI
 ADk22Qy9R15kSJZFxlWI7CizCF7VvPgSSfnIh38wKUS/qNEiUO5tuoxXkDq0J0x2
 csB+NJOv8zqF+ouRVB2ypNxwJyT+2hGyTRz8+QSbwnNtOFd42yy/KhzgxWoMqSXR
 F9EzzFWhYw+VLtJTq+EKSZ947rTLRbIGE0Mma1OZ4NvfVvaeiOUYKuHSRzsXsDQ2
 F4jhpqa1sAzUqHxmkCpb2j3mYbFmmvenpa7VYTdwCEclhzNN8wg6ReVrQdOTqlgs
 ry93yLLTCf7zb4DbqbYuK0xyJPjXysDxQfyVh9Iomiaqocf+06XdzGc1cUJsHom5
 3zVreQEqjnPHs3VJV65HDcuokCfEB4UsWM2aJQvTGZez8wCXn6LThbeE8o8oigq7
 qDHFfKKcfxWgBO4qDu3YBsIwsIhBml93Sb6wEgB1e2Xoly+3VPcJHX7/TujKX99/
 iFoxRZM/KhOwUJniVCE5
 =smxQ
 -----END PGP SIGNATURE-----

Merge tag 'fixes-for-v3.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus

usb: fixes for v3.7-rc3

Here's a new set of fixes for v3.7-rc3. It's quite small, only
four patches.

There's one bug fix for the newly added musb-dsps glue layer where
we could be overflowing a buffer when creating the instance name.

NET2272 got a fix for a case where the lock would be left held
when exiting the IRQ handler with error in case of Spurious IRQs.

Renensas USBHS got a DMA stall fix which would cause transfers to
stall forever and a NULL pointer deref fix in case of pipe detach.
2012-10-23 19:24:23 -07:00
Oliver Neukum 16b45fdf9c xhci: fix integer overflow
xhci_service_interval_to_ns() returns long long
to avoid an overflow. However, the type cast happens
too late. The fix is to force ULL from the beginning.

This patch should be backported to kernels as old as 3.5, that contain
the commit e3567d2c15 "xhci: Add Intel
U1/U2 timeout policy."

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
CC: stable@vger.kernel.org
2012-10-23 15:43:38 -07:00
Oliver Neukum 966e7a8541 xhci: endianness xhci_calculate_intel_u2_timeout
An le16 is accessed without conversion.

This patch should be backported to kernels as old as 3.5, that contain
the commit e3567d2c15 "xhci: Add Intel
U1/U2 timeout policy."

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
CC: stable@vger.kernel.org
2012-10-23 15:43:38 -07:00
Florian Fainelli 068b054fde USB: OHCI: sm501: fix build failure after ohci_finish_controller_resume removal
Commit cfa49b4b (USB: ohci: merge ohci_finish_controller_resume with
ohci_resume) merged ohci_finish_controller_resume with ohci_resume but forgot
to update the ohci-sm501 driver accordingly, thus causing the folllowing build
failure:

drivers/usb/host/ohci-sm501.c: In function 'ohci_sm501_resume':
drivers/usb/host/ohci-sm501.c:241:2: error: implicit declaration of function
'ohci_finish_controller_resume' [-Werror=implicit-function-declaration]

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-23 10:18:53 -07:00
Kuninori Morimoto 1cb60156de usb: renesas_usbhs: fixup dma transfer stall
renesas_usbhs driver can switch DMA/PIO transfer by using handler,
and each handler have push/pop direction.
But unfortunately, current dma push handler didn't a path
which calls usbhs_pipe_enable(). Thus, dma transfer never happened.
this patch fixes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-23 09:44:37 +03:00
Kuninori Morimoto 4f053a24ec usb: renesas_usbhs: fixup: avoid NULL access on error case pipe detach
If renesas_usbhs or DMAEngine interrupt didn't happen by a certain cause,
urb->ep will be NULL by usb time out.
Then, host mode will access to it and crash kernel.
This patch fixes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-23 09:44:08 +03:00
Wei Yongjun 000b7f5127 usb: gadget: net2272: fix missing unlock on error in net2272_irq()
Add the missing unlock on the error handle path in function
net2272_irq().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-23 09:42:50 +03:00
Daniel Mack ca749b2a2e usb: musb: dsps: fix res_name length
The res_name is used for the name construction of a DT property as
follows:

  sprintf(res_name, "port%d-mode", id);

Hence, res_name must be at least 11 characters long in order to store
the name including the terminating '\0'.

While at it, use to snprintf() rather than sprintf() when accessing this
buffer.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-23 09:42:29 +03:00
Lan Tianyu 27c411c95a usb/xhci: Remove (__force__ __u16) before assigning DeviceRemovable and assign directly.
Struct usb_hub_descriptor.ss.DeviceRemovable has been defined as __le16
and (__force__ __u16) doesn't need.

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-10-22 13:26:48 -07:00
Lan Tianyu 170ed80734 usb/xhci: release xhci->lock during turning on/off usb port's acpi power resource and checking the existence of port's power resource
When setting usb port's acpi power resource, there will be some xhci hub requests.
This will cause dead lock since xhci->lock has been held before setting acpi power
resource in the xhci_hub_control(). The usb_acpi_power_manageable() function might
fall into sleep so release xhci->lock before invoking it.

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-10-22 13:26:48 -07:00
Octavian Purdila 3b6054da68 usb hub: send clear_tt_buffer_complete events when canceling TT clear work
There is a race condition in the USB hub code with regard to handling
TT clear requests that can get the HCD driver in a deadlock. Usually
when an TT clear request is scheduled it will be executed immediately:

<7>[    6.077583] usb 2-1.3: unlink qh1-0e01/f4d4db00 start 0 [1/2 us]
<3>[    6.078041] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d82
<7>[    6.078299] hub_tt_work:731
<7>[    9.309089] usb 2-1.5: link qh1-0e01/f4d506c0 start 0 [1/2 us]
<7>[    9.324526] ehci_hcd 0000:00:1d.0: reused qh f4d4db00 schedule
<7>[    9.324539] usb 2-1.3: link qh1-0e01/f4d4db00 start 0 [1/2 us]
<7>[    9.341530] usb 1-1.1: link qh4-0e01/f397aec0 start 2 [1/2 us]
<7>[   10.116159] usb 2-1.3: unlink qh1-0e01/f4d4db00 start 0 [1/2 us]
<3>[   10.116459] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d82
<7>[   10.116537] hub_tt_work:731

However, if a suspend operation is triggered before hub_tt_work is
scheduled, hub_quiesce will cancel the work without notifying the HCD
driver:

<3>[   35.033941] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d80
<5>[   35.034022] sd 0:0:0:0: [sda] Stopping disk
<7>[   35.034039] hub 2-1:1.0: hub_suspend
<7>[   35.034067] usb 2-1: unlink qh256-0001/f3b1ab00 start 1 [1/0 us]
<7>[   35.035085] hub 1-0:1.0: hub_suspend
<7>[   35.035102] usb usb1: bus suspend, wakeup 0
<7>[   35.035106] ehci_hcd 0000:00:1a.0: suspend root hub
<7>[   35.035298] hub 2-0:1.0: hub_suspend
<7>[   35.035313] usb usb2: bus suspend, wakeup 0
<7>[   35.035315] ehci_hcd 0000:00:1d.0: suspend root hub
<6>[   35.250017] PM: suspend of devices complete after 216.979 msecs
<6>[   35.250822] PM: late suspend of devices complete after 0.799 msecs
<7>[   35.252343] ehci_hcd 0000:00:1d.0: wakeup: 1
<7>[   35.262923] ehci_hcd 0000:00:1d.0: --> PCI D3hot
<7>[   35.263302] ehci_hcd 0000:00:1a.0: wakeup: 1
<7>[   35.273912] ehci_hcd 0000:00:1a.0: --> PCI D3hot
<6>[   35.274254] PM: noirq suspend of devices complete after 23.442 msecs
<6>[   35.274975] ACPI: Preparing to enter system sleep state S3
<6>[   35.292666] PM: Saving platform NVS memory
<7>[   35.295030] Disabling non-boot CPUs ...
<6>[   35.297351] CPU 1 is now offline
<6>[   35.300345] CPU 2 is now offline
<6>[   35.303929] CPU 3 is now offline
<7>[   35.303931] lockdep: fixing up alternatives.
<6>[   35.304825] Extended CMOS year: 2000

When the device will resume the EHCI driver will get stuck in
ehci_endpoint_disable waiting for the tt_clearing flag to reset:

<0>[   47.610967] usb 2-1.3: **** DPM device timeout ****
<7>[   47.610972]  f2f11c60 00000092 f2f11c0c c10624a5 00000003 f4c6e880 c1c8a4c0 c1c8a4c0
<7>[   47.610983]  15c55698 0000000b f56b34c0 f2a45b70 f4c6e880 00000082 f2a4602c f2f11c30
<7>[   47.610993]  c10787f8 f4cac000 f2a45b70 00000000 f4cac010 f2f11c58 00000046 00000001
<7>[   47.611004] Call Trace:
<7>[   47.611006]  [<c10624a5>] ? sched_clock_cpu+0xf5/0x160
<7>[   47.611019]  [<c10787f8>] ? lock_release_holdtime.part.22+0x88/0xf0
<7>[   47.611026]  [<c103ed46>] ? lock_timer_base.isra.35+0x26/0x50
<7>[   47.611034]  [<c17592d3>] ? schedule_timeout+0x133/0x290
<7>[   47.611044]  [<c175b43e>] schedule+0x1e/0x50
<7>[   47.611051]  [<c17592d8>] schedule_timeout+0x138/0x290
<7>[   47.611057]  [<c10624a5>] ? sched_clock_cpu+0xf5/0x160
<7>[   47.611063]  [<c103e560>] ? usleep_range+0x40/0x40
<7>[   47.611070]  [<c1759445>] schedule_timeout_uninterruptible+0x15/0x20
<7>[   47.611077]  [<c14935f4>] ehci_endpoint_disable+0x64/0x160
<7>[   47.611084]  [<c147d1ee>] ? usb_hcd_flush_endpoint+0x10e/0x1d0
<7>[   47.611092]  [<c1165663>] ? sysfs_add_file+0x13/0x20
<7>[   47.611100]  [<c147d5a9>] usb_hcd_disable_endpoint+0x29/0x40
<7>[   47.611107]  [<c147fafc>] usb_disable_endpoint+0x5c/0x80
<7>[   47.611111]  [<c147fb57>] usb_disable_interface+0x37/0x50
<7>[   47.611116]  [<c1477650>] usb_reset_and_verify_device+0x4b0/0x640
<7>[   47.611122]  [<c1474665>] ? hub_port_status+0xb5/0x100
<7>[   47.611129]  [<c147a975>] usb_port_resume+0xd5/0x220
<7>[   47.611136]  [<c148877f>] generic_resume+0xf/0x30
<7>[   47.611142]  [<c14821a3>] usb_resume+0x133/0x180
<7>[   47.611147]  [<c1473b10>] ? usb_dev_thaw+0x10/0x10
<7>[   47.611152]  [<c1473b1d>] usb_dev_resume+0xd/0x10
<7>[   47.611157]  [<c13baa60>] dpm_run_callback+0x40/0xb0
<7>[   47.611164]  [<c13bdb03>] ? pm_runtime_enable+0x43/0x70
<7>[   47.611171]  [<c13bafc6>] device_resume+0x1a6/0x2c0
<7>[   47.611177]  [<c13ba940>] ? dpm_show_time+0xe0/0xe0
<7>[   47.611183]  [<c13bb0f9>] async_resume+0x19/0x40
<7>[   47.611189]  [<c10580c4>] async_run_entry_fn+0x64/0x160
<7>[   47.611196]  [<c104a244>] ? process_one_work+0x104/0x480
<7>[   47.611203]  [<c104a24c>] ? process_one_work+0x10c/0x480
<7>[   47.611209]  [<c104a2c0>] process_one_work+0x180/0x480
<7>[   47.611215]  [<c104a244>] ? process_one_work+0x104/0x480
<7>[   47.611220]  [<c1058060>] ? async_schedule+0x10/0x10
<7>[   47.611226]  [<c104c15c>] worker_thread+0x11c/0x2f0
<7>[   47.611233]  [<c104c040>] ? manage_workers.isra.27+0x1f0/0x1f0
<7>[   47.611239]  [<c10507f8>] kthread+0x78/0x80
<7>[   47.611244]  [<c1750000>] ? timer_cpu_notify+0xd6/0x20d
<7>[   47.611253]  [<c1050780>] ? __init_kthread_worker+0x60/0x60
<7>[   47.611258]  [<c176357e>] kernel_thread_helper+0x6/0xd
<7>[   47.611283] ------------[ cut here ]------------

This patch changes hub_quiesce behavior to flush the TT clear work
instead of canceling it, to make sure that no TT clear request remains
uncompleted before suspend.

Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:34:41 -07:00
Dan Carpenter da31fe451a WUSB: remove an unnused variable
The "wusb_cap_descr_default" is never used.  GCC doesn't complain about
it because we have that line ".bLength = sizeof(wusb_cap_descr_default)"
inside the definition itself.  Clang complains though.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:33:34 -07:00
Florian Fainelli be7ac70b9b USB: OHCI: make ohci-platform use devm_request_and_ioremap helper
This patch changes the ohci-platform driver to use the device managed helper
function for requesting memory region and ioremapping memory resources.
As a result the error path in the probe function is simplified, and the
platform driver remove callback does no longer need to release and iounmap
memory resources. devm_request_and_ioremap() will use either the ioremap()
or ioremap_nocache() handler depending on the resource's CACHEABLE flag, so
we are good with this change.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:30:26 -07:00
Florian Fainelli 61ff2745e5 USB: EHCI: make ehci-platform use devm_request_and_ioremap helper
This patch changes the ehci-platform driver to use the device managed helper
function for requesting memory region and ioremapping memory resources.
As a result the error path in the probe function is simplified, and the
platform driver remove callback does no longer need to release and iounmap
memory resources. devm_request_and_ioremap() will use either the ioremap()
or ioremap_nocache() handler depending on the resource's CACHEABLE flag, so
we are good with this change.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:30:26 -07:00
Florian Fainelli ac0e3c04eb USB: OHCI: fix typo in ohci-platform driver on the word "resource"
We meant to write "resource" instead of "recourse", this patch fixes this
typo.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:30:26 -07:00
Florian Fainelli 5c9b2b28e5 USB: EHCI: fix typo in ehci-platform driver on the word "resource"
Fix the obvious typo in the error message, we meant to write "resource"
instead of "recourse".

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:30:26 -07:00
Florian Fainelli 976baf6e96 USB: OHCI: make ohci-platform use dev_err() instead of pr_err()
This patch converts the ohci-platform driver to use dev_err() functions
instead of pr_err().

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:30:26 -07:00
Florian Fainelli 2350cb0cc1 USB: EHCI: make ehci-platform use dev_err() instead of pr_err()
This patch converts the ehci-platform driver to make use of the dev_err()
functions instead of pr_err().

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:30:25 -07:00
Florian Fainelli 216d0fded4 USB: move common alchemy USB routines to arch/mips/alchemy/common.c
A previous patch converted the Alchemy platform to use the OHCI and EHCI
platform drivers. As a result, all the common logic to handle USB present in
drivers/usb/host/alchemy-common.c has no reason to remain here, so we move it
to arch/mips/alchemy/common/usb.c which is a more appropriate place. This
change was suggested by Manuel Lauss.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:29:12 -07:00
Florian Fainelli bb5da43e45 USB: OHCI: remove Alchemy OHCI platform driver.
All users have been converted to use the OHCI platform driver instead, thus
making ohci-au1xxx obsolete, remove it.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:29:12 -07:00
Florian Fainelli 231a72e03a USB: OHCI: remove OHCI SH platform driver
All users have been converted to use the OHCI platform driver instead, thus
making ohci-sh obsolete, so remove it.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:26:55 -07:00
Florian Fainelli c2e91e046d USB: OHCI: remove Netlogic XLS OHCI platform driver
All users have been converted to use the OHCI platform driver instead, thus
making ohci-xls obsolete, remove it.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:26:20 -07:00
Florian Fainelli c23920b05b USB: OHCI: remove CNS3xxx OHCI platform driver
All users have been converted to use the OHCI platform driver instead, thus
making ohci-cns3xxx, so remove it.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:26:20 -07:00
Florian Fainelli 60da65f966 USB: OHCI: remove PNX8550 OHCI driver
The users have been converted to use the platform OHCI driver instead, thus
making the ohci-pnx8550 driver obsolete, so remove it.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:26:19 -07:00
Florian Fainelli cfa49b4b88 USB: ohci: merge ohci_finish_controller_resume with ohci_resume
Merge ohci_finish_controller_resume with ohci_resume as suggested by Alan
Stern. Since ohci_finish_controller_resume no longer exists, update the
various OHCI drivers to call ohci_resume() instead. Some drivers used to set
themselves the bit HCD_FLAG_HW_ACCESSIBLE, which is now handled by
ohci_resume().

Acked-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:23:59 -07:00
Florian Fainelli d4ae47dc56 USB: ohci: remove check for RH already suspended in ohci_suspend
As suggested by Alan Stern, the code checking for the OHCI RH already
suspended is no longer required since the bug it fixes has not been seen in
ages. Remove that check making ohci_suspend much simpler.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:23:59 -07:00
Florian Fainelli cd1965db05 USB: ohci: move ohci_pci_{suspend,resume} to ohci-hcd.c
As suggested by Alan Stern, move the ohci-pci.c ohci_pci_{suspend,resume}
routines to ohci-hcd.c. Due to their move, also rename them to
ohci_{suspend,resume} to make it clear they operate on ohci_hcd. Since they
are not necessarily called, annotate them with __maybe_unused, and make them
enclosed within an #ifdef CONFIG_PM / #endif section.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:23:59 -07:00
Florian Fainelli 2b16e39ee0 USB: ohci: allow platform driver to specify the number of ports
This patch modifies the ohci platform driver to accept the num_ports
parameter to be set via platform_data. Setting the number of ports must be
done after the call to ohci_hcd_init().

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:23:59 -07:00
Florian Fainelli f3a958d30d USB: EHCI: remove CNS3xxx EHCI platform driver
The users have been converted to use the ehci platform driver instead, thus
making the ehci-cns3xxx driver obsolete, so remove it.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:23:58 -07:00
Florian Fainelli 1de7d89c76 USB: EHCI: remove Alchemy EHCI driver
The platform code has been converted to use the ehci-platform driver instead
thus obsoleting the ehci-au1xxx driver, which can be removed.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:23:57 -07:00
Florian Fainelli 4534874a87 USB: EHCI: add no_io_watchdog platform_data parameter to ehci-platform
Enhance the ehci-platform driver to also accept no_io_watchdog as a platform
data parameter. When no_io_watchdog is set to 1, the ehci controller will set
ehci->need_io_watchdog to 0. Since most EHCI controllers do need the I/O
watchdog to be on, only let those which need it to turn the watchdog off.

Make sure that we change need_io_watchdog after the call to ehci_setup()
because ehci_setup() will unconditionnaly set need_io_watchdog to 1.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:15:47 -07:00
Florian Fainelli 6d39944ee8 USB: EHCI: remove Netlogic XLS EHCI driver
The platform code has been migrated to register the ehci-platform driver, thus
obsoleting the ehci-xls driver, which can be removed.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:15:47 -07:00
Florian Fainelli ead92fae12 USB: EHCI: remove Loongson 1B EHCI driver.
The platform code registering the Loongson 1B EHCI driver has now been
converted to register the ehci-platform driver instead, thus obsoleting the
ehci-ls1x driver, which can be removed.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:14:24 -07:00
Florian Fainelli 7bccfcd2eb USB: OHCI: remove ohci-pcc-soc driver.
This driver is not registered by any in-tree users, and if really needed by
some out of tree user, the same functionnality can be restored using the
ohci-platform driver using the following platform_data parameters:
	big_endian_desc = 1
	big_endian_mmio = 1
	no_big_frame_no = 1

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:14:24 -07:00
Florian Fainelli 6efd0f73cc USB: EHCI: remove IXP4xx EHCI driver
This driver is not registered by any in-tree user. If needed it the EHCI
driver can be reinstatied using the ehci-platform driver with caps_offset to
0x100.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:14:24 -07:00
Alan Stern 6a41b4d3fe OHCI: implement new semantics for URB_ISO_ASAP
This patch (as1614) updates the isochronous scheduling in ohci-hcd to
match the new semantics for URB_ISO_ASAP.  Testing revealed a hardware
bug in the way my OHCI controller handles expired isochronous TDs;
consequently the patch tries hard to avoid creating them (unlike the
ehci-hcd and uhci-hcd drivers).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:10:24 -07:00
Alan Stern c44b225077 UHCI: implement new semantics for URB_ISO_ASAP
This patch (as1613) updates the isochronous scheduling in uhci-hcd to
match the new semantics for URB_ISO_ASAP.  The amount of code
alteration is smaller than it looks because of a change in the
indentation level.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:10:24 -07:00
Alan Stern 4005ad4390 EHCI: implement new semantics for URB_ISO_ASAP
This patch (as1612) updates the isochronous scheduling and processing
in ehci-hcd to match the new semantics for URB_ISO_ASAP.  It also adds
a missing "unlikely" in sitd_complete() to match the corresponding
statement in itd_complete(), and it increments urb->error_count in a
couple of places that had been overlooked.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:10:24 -07:00
Alan Stern a03bede5c7 USB: update documentation for URB_ISO_ASAP
This patch (as1611) updates the USB documentation and kerneldoc to
give a more precise meaning for the URB_ISO_ASAP flag and to explain
more of the details of scheduling for isochronous URBs.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:10:24 -07:00
Alan Stern 7267547992 EHCI: replace mult/div with bit-mask operation
This patch (as1610) replaces multiplication and divison operations in
ehci-hcd's isochronous scheduling code with a bit-mask operation,
taking advantage of the fact that isochronous periods are always
powers of 2.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 08:57:43 -07:00
Alan Stern 98cae42d82 EHCI: use the isochronous scheduling threshold
This patch (as1609) changes the way ehci-hcd uses the "Isochronous
Scheduling Threshold" in its calculations.  Until now the code has
ignored the threshold except for certain Intel PCI-based controllers.
This violates the EHCI spec.

The new code takes the threshold into account always, removing the
need for the fs_i_thresh quirk flag.  In addition it implements the
"full frame cache" setting more efficiently, moving forward only as
far as the next frame boundary instead of always moving forward 8
microframes.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 08:57:43 -07:00
Alan Stern c3ee9b76aa EHCI: improved logic for isochronous scheduling
This patch (as1608) reworks the logic used by ehci-hcd for scheduling
isochronous transfers.  Now the modular calculations are all based on
a window that starts at the last frame scanned for isochronous
completions.  No transfer descriptors for any earlier frames can
possibly remain on the schedule, so there can be no confusion from
schedule wrap-around.  This removes the need for a "slop" region of
arbitrary size.

There's no need to check for URBs that are longer than the schedule
length.  With the old code they could throw things off by wrapping
around and appearing to end in the near future rather than the distant
future.  Now such confusion isn't possible, and the existing test for
submissions that extend too far into the future will also catch those
that exceed the schedule length.  (But there still has to be an
initial test to handle the case where the schedule already extends as
far into the future as possible.)

Delays caused by IRQ latency won't confuse the algorithm unless they
are ridiculously long (over 250 ms); they will merely reduce how far
into the future new transfers can be scheduled.  A few people have
reported problems caused by delays of 50 ms or so.  Now instead of
failing completely, isochronous transfers will experience a brief
glitch and then continue normally.

(Whether this is truly a good thing is debatable.  A latency as large
as 50 ms generally indicates a bug is present, and complete failure of
audio or video transfers draws people's attention pretty vividly.
Making the transfers more robust also makes it easier for such bugs to
remain undetected.)

Finally, ehci->next_frame is renamed to ehci->last_iso_frame, because
that better describes what it is: the last frame to have been scanned
for isochronous completions.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 08:57:43 -07:00
Linus Torvalds 37820108f3 ARM: soc: Fixes for 3.7-rc2
A set of fixes and some minor cleanups for -rc2:
 
 - A series from Arnd that fixes warnings in drivers and other code
   included by ARM defconfigs. Most have been acked by corresponding
   maintainers (and seem quite hard to argue not picking up anyway in the
   few exception cases).
 - A few misc patches from the list for integrator/vt8500/i.MX
 - A batch of fixes to OMAP platforms, fixing:
   - boot problems on beaglebone,
   - regression fixes for local timers
   - clockdomain locking fixes
   - a few boot/sparse warnings
 - For Tegra:
   - Clock rate calculation overflow fix
   - Revert a change that removed timer clocks and a fix for symbol name clashes
 - For Renesas:
   - IO accessor / annotation cleanups to remove warnings
 - For Kirkwood/Dove/mvebu:
   - Fixes for device trees for Dove (some minor cleanups, some fixes)
   - Fixes for the mvebu gpio driver
   - Fix build problem for Feroceon due to missing ifdefs
   - Fix lsxl DTS files
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQgembAAoJEIwa5zzehBx3tbwQAJVxDjt0bNFhPDmPVnh4O3qE
 qpmCQ4UZ3u153gkXO9973qZNso635yPYtiUA53TAr9kxX4La690IcBOLNMK2TwYZ
 enBeg0JtjV+25lkYcsFGnggj8YNXzsL47SVymFxqiu4s4XLuQfUlBWpYyLjYVa6p
 1zE5Q6oUVZMJxbqBEK3LaZ9ifV7RxG9xwpx6QiXQlPpZkKqDVYCs/efPXfXBoOeq
 KinO/p6fDOQoKrYt1Kdfw5AhmHBrSw/K630/IjZHaIc6j3nDU5UjP0zhO0CE3zDH
 NrYctUfJqR9VEKvrpO24RFFYiDaGK1Oge/GhmAAftiLoKK8qxTehKnxe3BUAsMnD
 wldxsBBym1rDbr0ehxC9pV6ZtJhA7KZLoPNZpqwSbBYqFnmEG3pZwQV9wToswpmw
 1jPJpzZOpe14edHvsixaPuaY3ACnzkkfUWu1wOlg33W5WhPInieMJuJ8hmL+1SVJ
 g6Z6/7pjpHhC5CEhVqc5FJjRk1Jk+WsFa1FICoDjnkRW1Hg9DLvdUReEl+8xYuvI
 oHqLvDrTabVs9ZDnyT5avBrovWVZjSxZ+TxwMIeQGU1QhW4b8hIjPx09EBb1Hy6F
 BiZO3Q9zqm0+C+P1S0Cb3npumwG16ry7f6+51QXRXWNcgWWjm1ggZpWpmPY+g0Ra
 BO6UABZwuUm8HzpJaEu1
 =alOZ
 -----END PGP SIGNATURE-----

Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM soc fixes from Olof Johansson:
 "A set of fixes and some minor cleanups for -rc2:

   - A series from Arnd that fixes warnings in drivers and other code
     included by ARM defconfigs.  Most have been acked by corresponding
     maintainers (and seem quite hard to argue not picking up anyway in
     the few exception cases).
   - A few misc patches from the list for integrator/vt8500/i.MX
   - A batch of fixes to OMAP platforms, fixing:
     - boot problems on beaglebone,
     - regression fixes for local timers
     - clockdomain locking fixes
     - a few boot/sparse warnings
   - For Tegra:
     - Clock rate calculation overflow fix
     - Revert a change that removed timer clocks and a fix for symbol
       name clashes
   - For Renesas:
     - IO accessor / annotation cleanups to remove warnings
   - For Kirkwood/Dove/mvebu:
     - Fixes for device trees for Dove (some minor cleanups, some fixes)
     - Fixes for the mvebu gpio driver
     - Fix build problem for Feroceon due to missing ifdefs
     - Fix lsxl DTS files"

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (31 commits)
  ARM: kirkwood: fix buttons on lsxl boards
  ARM: kirkwood: fix LEDs names for lsxl boards
  ARM: Kirkwood: fix disabling CACHE_FEROCEON_L2
  gpio: mvebu: Add missing breaks in mvebu_gpio_irq_set_type
  ARM: dove: Add crypto engine to DT
  ARM: dove: Remove watchdog from DT
  ARM: dove: Restructure SoC device tree descriptor
  ARM: dove: Fix clock names of sata and gbe
  ARM: dove: Fix tauros2 device tree init
  ARM: dove: Add pcie clock support
  ARM: OMAP2+: Allow kernel to boot even if GPMC fails to reserve memory
  ARM: OMAP: clockdomain: Fix locking on _clkdm_clk_hwmod_enable / disable
  ARM: s3c: mark s3c2440_clk_add as __init_refok
  spi/s3c64xx: use correct dma_transfer_direction type
  ARM: OMAP4: devices: fixup OMAP4 DMIC platform device error message
  ARM: OMAP2+: clock data: Add dev-id for the omap-gpmc dummy fck
  ARM: OMAP: resolve sparse warning concerning debug_card_init()
  ARM: OMAP4: Fix twd_local_timer_register regression
  ARM: tegra: add tegra_timer clock
  ARM: tegra: rename tegra system timer
  ...
2012-10-19 17:32:37 -07:00
Olof Johansson 068a565afa Merge branch 'testing/driver-warnings' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc into fixes
A collection of warning fixes on non-ARM code from Arnd Bergmann:

* 'testing/driver-warnings' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  ARM: s3c: mark s3c2440_clk_add as __init_refok
  spi/s3c64xx: use correct dma_transfer_direction type
  pcmcia: sharpsl: don't discard sharpsl_pcmcia_ops
  USB: EHCI: mark ehci_orion_conf_mbus_windows __devinit
  mm/slob: use min_t() to compare ARCH_SLAB_MINALIGN
  SCSI: ARM: make fas216_dumpinfo function conditional
  SCSI: ARM: ncr5380/oak uses no interrupts
2012-10-19 15:40:18 -07:00
Linus Torvalds 42bf3e27e8 USB fixes for 3.7-rc2
Here are the USB patches against your 3.7-rc1 tree.
 
 There are the usual UABI header file movements, and we finally are now
 able to remove the dbg() macro that is over 15 years old (that had to
 wait for after some other trees got merged into yours during the big
 3.7-rc1 merge window.)
 
 Other than that, nothing major, just a number of bugfixes and new device
 ids.  It turns out that almost all of the usb-serial drivers had bugs in
 how they were handling their internal data, leaking memory, hence all of
 those fixups.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iEYEABECAAYFAlCBmLkACgkQMUfUDdst+yn8uACg2QF+GZm1DZvCjBHMSuiaNM3Q
 jxEAnA8LkdQWb0wr55RFiPQl/uB0rD0E
 =nNHn
 -----END PGP SIGNATURE-----

Merge tag 'usb-3.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg Kroah-Hartman:
 "Here are the USB patches against your 3.7-rc1 tree.

  There are the usual UABI header file movements, and we finally are now
  able to remove the dbg() macro that is over 15 years old (that had to
  wait for after some other trees got merged into yours during the big
  3.7-rc1 merge window.)

  Other than that, nothing major, just a number of bugfixes and new
  device ids.  It turns out that almost all of the usb-serial drivers
  had bugs in how they were handling their internal data, leaking
  memory, hence all of those fixups.

  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

* tag 'usb-3.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (42 commits)
  USB: option: add more ZTE devices
  USB: option: blacklist net interface on ZTE devices
  usb: host: xhci: New system added for Compliance Mode Patch on SN65LVPE502CP
  USB: io_ti: fix sysfs-attribute creation
  USB: iuu_phoenix: fix sysfs-attribute creation
  USB: spcp8x5: fix port-data memory leak
  USB: ssu100: fix port-data memory leak
  USB: ti_usb_3410_5052: fix port-data memory leak
  USB: oti6858: fix port-data memory leak
  USB: iuu_phoenix: fix port-data memory leak
  USB: kl5kusb105: fix port-data memory leak
  USB: io_ti: fix port-data memory leak
  USB: keyspan_pda: fix port-data memory leak
  USB: f81232: fix port-data memory leak
  USB: io_edgeport: fix port-data memory leak
  USB: kobil_sct: fix port-data memory leak
  USB: cypress_m8: fix port-data memory leak
  usb: acm: fix the computation of the number of data bits
  usb: Missing dma_mask in ehci-vt8500.c when probed from device-tree
  usb: Missing dma_mask in uhci-platform.c when probed from device-tree
  ...
2012-10-19 11:28:10 -07:00
Ben Collins d479c91178 USB: ehci-fsl: Return valid error in ehci_fsl_setup_phy
ehci_fsl_setup_phy is supposed to return an int, but had a void return
value in the case of controller_ver being invalid.

Introduced by commit 3735ba8db8 ("powerpc/usb: fix bug of CPU hang
when missing USB PHY clock"), which missed one return.

Signed-off-by: Ben Collins <ben.c@servergy.com>
Cc: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-10-19 10:54:30 -07:00
Felipe Balbi 6f115e45a0 usb: dwc3: drop HAVE_CLK dependency from Exynos glue layer
commit 93abe8e (clk: add non CONFIG_HAVE_CLK routines)
added clk API stubs when !defined(CONFIG_HAVE_CLK).

This allows us to remove the HAVE_CLK dependency from
Exynos' glue layer and let it compile always.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-19 11:13:47 +03:00
Bjørn Mork 4b35f1c529 USB: option: add more ZTE devices
Cc: <stable@vger.kernel.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-18 08:27:21 -07:00
Bjørn Mork 1452df6f1b USB: option: blacklist net interface on ZTE devices
Based on information from the ZTE Windows drivers.

Cc: <stable@vger.kernel.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-18 08:27:20 -07:00
Greg Kroah-Hartman 6b7ced68f3 usb: fixes for v3.7-rc2
Here's the first set of fixes for v3.7-rc cycle.
 
 DesignWare Core USB3 Driver (dwc3) got two fixes. The first one fixes a long
 standing bug which would keep endpoint with BUSY flag set forever if we cancel
 a transfer which has already been started by the controller. The second fix
 will just switch PHYs back off when DWC3 driver is removed.
 
 MUSB fixed a bug which would cause a Kernel Oops at least on AM3517 when
 removing a device. For some reason that particular device can fall into a
 situation where you have both Disconnect and Endpoint IRQs happen
 simultaneously (have both bits set in IRQ_STATUS register) and, because
 Disconnect Interrupt is handled before Endpoint Interrupts, we would try to
 transfer data over a disconnected device, thus generating a kernel oops.
 
 Renensas' USB DRD driver got two fixes which are a) fixing an off-by-one bug on
 the pipe iterator implementation and b) fixing Interrupt Status Clear procedure
 in order to properly clear a single Interrupt event without clearing (and
 masking) other events we didn't handle yet.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQfTjDAAoJEIaOsuA1yqREB4cQAJRCe193d6GjuIeXKuZoMYPI
 0+dQs080fLzLTraQMVdqc84VUj+8/n9ThA7I89GivziQIwbx+hMjhoebcvteC6P/
 sn7RsWUTxVYrusXf2sE4bSCzvU8SPM/8HfW37oahFJLK2omcaiFSX/7Kpb6KdXPc
 fh92/heQIlTqU0kSgNYzxZ/hPFWwqAcMMX97K4Dcsg14jD65tC0NPSXeRyRNETPY
 Sn0Sarv7xR+swQ72u+Wu27En0GvT6e9Y58bNxHGL5lMgbDGLOnEyZf2BVowbYBpQ
 jXp8P31VRDl/VkPWFft6bLmNjdacX0Hftkad2a4QlB3lyKBxelAvrTS5wkSBT0OM
 lnkgk/j7k31jhI3+5QzxZpTOTZFrprkMKfEncrH6ay/zbO8K1mFP2jmaBN33pBji
 06aCoL83Y+u1ditAUGySYg1eTSEtMXHL8cKInf+DcMypP88RekRNUNFUJKF2rLDw
 TZoT2cE+MyMXwNlVM9TxCuHe3MU2C5YEyNSLtlKSI4RSgFinS5u7aeXHn6VCSByO
 cvj5Sd8kqqXc4BMHWLxB5o09svSOpwaC2CZ5vf7dnbj+QXckPqL+eYOJIcQI0clo
 rHXKI36YUlxSmhal3hr4eN5hHbab5kPqYIEYH+D2lisz4mGq0ODazxRQsaKo2cfr
 r9NFM8bKwKBJ2j97lG4Y
 =IlgT
 -----END PGP SIGNATURE-----

Merge tag 'fixes-for-v3.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus

usb: fixes for v3.7-rc2

Here's the first set of fixes for v3.7-rc cycle.

DesignWare Core USB3 Driver (dwc3) got two fixes. The first one fixes a long
standing bug which would keep endpoint with BUSY flag set forever if we cancel
a transfer which has already been started by the controller. The second fix
will just switch PHYs back off when DWC3 driver is removed.

MUSB fixed a bug which would cause a Kernel Oops at least on AM3517 when
removing a device. For some reason that particular device can fall into a
situation where you have both Disconnect and Endpoint IRQs happen
simultaneously (have both bits set in IRQ_STATUS register) and, because
Disconnect Interrupt is handled before Endpoint Interrupts, we would try to
transfer data over a disconnected device, thus generating a kernel oops.

Renensas' USB DRD driver got two fixes which are a) fixing an off-by-one bug on
the pipe iterator implementation and b) fixing Interrupt Status Clear procedure
in order to properly clear a single Interrupt event without clearing (and
masking) other events we didn't handle yet.
2012-10-18 08:14:10 -07:00
Alexis R. Cortes 470809741a usb: host: xhci: New system added for Compliance Mode Patch on SN65LVPE502CP
This minor change adds a new system to which the "Fix Compliance Mode
on SN65LVPE502CP Hardware" patch has to be applied also.

System added:
Vendor: Hewlett-Packard. System Model: Z1

Signed-off-by: Alexis R. Cortes <alexis.cortes@ti.com>
Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-18 08:13:04 -07:00
Johan Hovold 5d8c61bc28 USB: io_ti: fix sysfs-attribute creation
Make sure port data is initialised before creating sysfs attributes to
avoid a race.

A recent patch ("USB: io_ti: fix port-data memory leak") got the
sysfs-attribute creation and port-data initialisation ordering wrong.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-18 08:08:47 -07:00
Johan Hovold 0978c94999 USB: iuu_phoenix: fix sysfs-attribute creation
Make sure sysfs attributes are created at port probe.

A recent patch ("USB: iuu_phoenix: fix port-data memory leak") removed
the sysfs-attribute creation by mistake.

Reported-by: Yuanhan Liu <yuanhan.liu@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-18 08:08:47 -07:00
Johan Hovold bf90ff5f3b USB: spcp8x5: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-17 13:48:00 -07:00
Johan Hovold 638b9e1523 USB: ssu100: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-17 13:47:59 -07:00
Johan Hovold 51ef847df7 USB: ti_usb_3410_5052: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-17 13:47:59 -07:00
Johan Hovold 289b076f89 USB: oti6858: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-17 13:47:59 -07:00
Johan Hovold 53636555b9 USB: iuu_phoenix: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-17 13:47:59 -07:00
Johan Hovold 99a6f73c49 USB: kl5kusb105: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that the write waitqueue was initialised but never used.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-17 13:47:59 -07:00
Johan Hovold 003615302a USB: io_ti: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-17 13:47:58 -07:00
Johan Hovold 94ab71ce28 USB: keyspan_pda: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that the write waitqueue was initialised but never used.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-17 13:47:58 -07:00
Johan Hovold 3124d1d71d USB: f81232: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-17 13:47:58 -07:00
Johan Hovold c27f3efc56 USB: io_edgeport: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-17 13:47:58 -07:00
Johan Hovold 95940a04bf USB: kobil_sct: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-17 13:47:58 -07:00
Johan Hovold 5c1a0f418d USB: cypress_m8: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-17 13:47:57 -07:00
Nicolas Boullis 301a29da6e usb: acm: fix the computation of the number of data bits
The current code assumes that CSIZE is 0000060, which appears to be
wrong on some arches (such as powerpc).

Signed-off-by: Nicolas Boullis <nboullis@debian.org>
Acked-by: Oliver Neukum <oneukum@suse.de>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-17 13:45:49 -07:00
Tony Prisk 6e1babb3ff usb: Missing dma_mask in ehci-vt8500.c when probed from device-tree
Device-tree probed devices don't get a dev.dma_mask set. This patch
sets a default 32bit mask on arch-vt8500 when using devicetree.

Without this patch, arch-vt8500 cannot detect ehci attached devices.

Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-17 13:42:29 -07:00
Tony Prisk 09eeffb70c usb: Missing dma_mask in uhci-platform.c when probed from device-tree
Device-tree probed devices don't get a dev.dma_mask set. This patch
sets a default 32bit mask on platforms using devicetree.

Without this patch, arch-vt8500 cannot detect uhci attached devices.

Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-17 13:42:29 -07:00
Ming Lei c5211187f7 USB: cdc-acm: fix pipe type of write endpoint
If the write endpoint is interrupt type, usb_sndintpipe() should
be passed to usb_fill_int_urb() instead of usb_sndbulkpipe().

Cc: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-17 13:41:34 -07:00
Henrik Rydberg 014639003c usbdevfs: Fix broken scatter-gather transfer
The handling of large output bulk transfers is broken; the same user
page is read over and over again. Fixed with this patch.

Cc: stable <stable@vger.kernel.org>
Acked-by: Peter Stuge <peter@stuge.se>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-17 13:41:34 -07:00
Tony Lindgren 4c98dc6b8e ARM: OMAP: Make plat/fpga.h local to arch/arm/plat-omap
There's no need to have this file in plat/fpga.h. We can
make it local to plat-omap replacing fpga_read/write
functions directly with readb/writeb as that's how
they are already defined in fpga.h.

Note that 2420 based H4 is also using the fpga, so let's
keep the led support around in plat-omap until we flip
over mach-omap2 to device tree.

Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: linux-fbdev@vger.kernel.org
Cc: Felipe Balbi <balbi@ti.com>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-17 11:36:37 -07:00
Alan Stern db5c8b5244 USB: fix port probing and removal in garmin_gps
This patch (as1615) fixes a bug in the Garmin USB serial driver.  It
uses attach, disconnect, and release routines to carry out actions
that should be handled by port_probe and port_remove routines, because
they access port-specific data.

The bug causes an oops when the device in unplugged, because the
private data for each port structure now gets erased when the port is
unbound from the driver, resulting in a null-pointer dereference.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported--by: Markus Schauler <mschauler@gmail.com>
Tested-by: Markus Schauler <mschauler@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-16 10:25:55 -07:00
Johan Hovold 8bf769eb5f USB: pl2303: fix port-data memory leak
Fix port-data memory leak by allocating and freeing port data in
port_probe/remove rather than in attach/release, and by introducing
serial private data to store the device type which is interface rather
than port specific.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-16 10:25:54 -07:00
Johan Hovold 4295fe7791 USB: cp210x: fix port-data memory leak
Fix port data memory leak by replacing port private data with serial
private data.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at
release.

The private data is used to store the control interface number, but as
this is the same for all ports on an interface it should be stored as
usb-serial data anyway.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-16 10:25:54 -07:00
Johan Hovold fa919751a2 USB: belkin_sa: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that the write waitqueue was initialised but never used.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-16 10:25:54 -07:00
Johan Hovold a955604011 USB: cyberjack: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that the write waitqueue was initialised but never used.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-16 10:25:54 -07:00
Johan Hovold 7bdce71822 USB: ark3116: fix NULL-pointer dereference
Fix NULL-pointer dereference at release by replacing attach and release
with port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is NULL when release is called.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-16 10:25:54 -07:00
Alexandre Pereira da Silva 69da85edba usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04
The STOTG04 is an replacement for ISP1301.

Most of the registers on STOTG04 are the same as on ISP1301, but the
register ISP1301_I2C_OTG_CONTROL_2 (address 0x10) doesn't exist on the
ST part.

This is a work around for this by using the interrupt source register that
should behave the same on both parts and has the needed information.

Tested-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-16 13:11:27 +03:00
Alexandre Pereira da Silva 0696f92970 usb: gadget: lpc32xx_udc: Disable setup request error
This message is an debugging message. It's useful for finding protocol
details but it's not necessarily an error.

Acked-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-16 13:10:02 +03:00
kuninori.morimoto.gx@renesas.com 4cd2f59987 usb: renesas_usbhs: gadget: add usb_gadget_ops :: pullup support
This patch adds usbhs_sys_function_pullup() to control
D+ line for USB function, and enabled pullup support on mod_gadget.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-16 13:09:50 +03:00