Alan Stern [Wed, 27 May 2009 22:21:56 +0000 (18:21 -0400)]
USB: EHCI: update toggle state for linked QHs
This patch (as1245) fixes a bug in ehci-hcd. When an URB is queued
for an endpoint whose QH is already in the LINKED state, the QH
doesn't get refreshed. As a result, if usb_clear_halt() was called
during the time that the QH was linked but idle, the data toggle value
in the QH doesn't get reset.
The symptom is that after a clear_halt, data gets lost and transfers
time out. This problem is starting to show up now because the
"ehci-hcd unlink speedups" patch causes QHs with no queued URBs to
remain linked for a suitable time.
The patch utilizes the new endpoint_reset mechanism to fix the
problem. When an endpoint is reset, the new method forcibly unlinks
the QH (if necessary) and safely updates the toggle value. This
allows qh_update() to be simplified and avoids using usb_device's
toggle bits in a rather unintuitive way.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: David Brownell <david-b@pacbell.net> Tested-by: David <david@unsolicited.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
USB: r8a66597-hcd: use platform_data instead of module_param
CPU/board specific parameters (PLL clock, vif etc...) can be set
by platform_data instead of module_param.
v2: remove irq_sense member in platform_data because it can OR in
IRQF_TRIGGER_LOW or IRQF_TRIGGER_FALLING against IORESOURCE_IRQ in
the struct resource.
Josua Dietze [Sun, 24 May 2009 21:21:42 +0000 (23:21 +0200)]
USB: usb-storage: add filter to "option_ms" to leave unrecognized devices alone
Some unusual usb devices from the maker "Option" are switched from
storage to serial/modem mode by sending a SCSI REZERO command. In one
case a fairly common vendor/device ID is affected which led to problems
for users of other modems or phones which are not supposed to be
switched.
The patch adds a filter by reading the vendor name with the SCSI INQUIRY
command, and skips the switching code for all unrecognized entries.
Further changes are cleanups and corrections pointed out by Alan Stern.
Tested with two devices with the IDs 05c6:1000, one from "Option" and
switchable, and one from Samsung (cell phone).
Alan Stern [Fri, 22 May 2009 21:02:33 +0000 (17:02 -0400)]
USB: EHCI: stagger frames for interrupt transfers
This patch (as1243) tries to improve ehci-hcd's scheduling of
interrupt transfers. Instead of trying to cram all transfers with the
same period into the same frame, the new code will spread the
transfers out among lots of different frames. This should reduce the
periodic schedule load in any one frame -- some host controllers have
trouble when there's too much work to do.
A more thorough approach would stagger the uframe values as well. But
this is enough to make a big improvement.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Dwayne Fontenot <dwayne.fontenot@att.net> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Thu, 21 May 2009 21:37:58 +0000 (17:37 -0400)]
USB: usb-storage: fix return values from init functions
This patch (as1242) fixes the return values from the special
init functions in usb-storage. They are supposed to return 0 for
success, not USB_STOR_TRANSPORT_GOOD.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Niilo Minkkinen [Mon, 18 May 2009 14:54:16 +0000 (17:54 +0300)]
usb: musb: disable OTG AUTOIDLE only with omap3430
Omap3 MUSB AUTOIDLE functionality configured through OTG_SYSCONFIG
register prevents the device from going into retention.
This is a workaround (by Richard Woodruff/TI), as his comment :
> A new MUSB bug which is a match to data below was identified very
> recently (on hardware and in simulation).
> This bug is in 3430 and not 3630.
> As a priority test (and as new default) you should have engineers
> disable autoidle for MUSB block.
> This is the workaround which will show up in next errata.
Signed-off-by: Niilo Minkkinen <ext-niilo.1.minkkinen@nokia.com> Signed-off-by: Richard Woodruff <r-woodruff2@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Oliver Neukum [Sat, 16 May 2009 19:13:19 +0000 (21:13 +0200)]
USB: support for cdc-acm of single interface devices
This implement support in cdc-acm for acm devices another popular OS can handle
- adds support for autodetection of devices that use one interface
- autodetection of endpoints
- add a quirk for surpressing a setting that OS doesn't use
- autoassume that quirk for single interface devices
Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Andrew Morton [Tue, 12 May 2009 22:27:59 +0000 (15:27 -0700)]
+ drivers-usb-serial-sierrac-fix-printk-warning.patch added to -mm tree
drivers/usb/serial/sierra.c: In function 'sierra_write':
drivers/usb/serial/sierra.c:375: warning: format '%d' expects type 'int', but argument 5 has type 'size_t'
Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Elina Pasheva <epasheva@sierrawireless.com> Cc: Rory Filer <rfiler@SierraWireless.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Daniel Mack [Tue, 12 May 2009 20:50:34 +0000 (13:50 -0700)]
USB: imx_udc: fix leak in imx_ep_alloc_request()
cppcheck found another leak in drivers/usb/gadget/imx_udc.c
Cc: Mike Lee <eemike@gmail.com> Cc: Darius Augulis <augulis.darius@gmail.com> Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Kay Sievers [Mon, 4 May 2009 17:48:32 +0000 (19:48 +0200)]
usb: convert endpoint devices to bus-less childs of the usb interface
The endpoint devices look like simple attribute groups now, and no longer
like devices with a specific subsystem. They will also no longer emit uevents.
It also removes the device node requests for endpoint devices, which are not
implemented for now.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Elina Pasheva [Tue, 12 May 2009 20:12:54 +0000 (13:12 -0700)]
USB: serial: sierra driver sierra_calc_num_ports() fix
- Removed potential kernel oops from sierra_calc_num_ports() function.
Calling this function twice would likely have caused an oops because
the function releases allocated memory after the first call.
- Modified sierra_probe() function to reflect the changes in
sierra_calc_num_ports().
Signed-off-by: Elina Pasheva <epasheva@sierrawireless.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Elina Pasheva [Tue, 12 May 2009 20:12:37 +0000 (13:12 -0700)]
USB: serial: sierra driver interrupt urb resubmit fix
- Fixed a problem when re-submitting urb from interrupt callback in
function sierra_instat_callback(). This suppresses also issuing of
error messages in /var/log/kern.log
- Removed redundant debug message at the beginning of
sierra_instat_callback() function
- Changed a debug message to be an error message
Signed-off-by: Elina Pasheva <epasheva@sierrawireless.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Elina Pasheva [Tue, 12 May 2009 20:12:24 +0000 (13:12 -0700)]
USB: serial: sierra driver zero length packet fix
- Fixed a problem with transferring packets with size a multiple of Bulk
Xfer size in function sierra_write(). Added transfer flag
URB_ZERO_PACKET before submitting the urb to trigger Zero-length data
transfer when packet size is a multiple of Bulk Xfer.
Signed-off-by: Elina Pasheva <epasheva@sierrawireless.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jason Wessel [Mon, 11 May 2009 20:24:09 +0000 (15:24 -0500)]
USB: serial: usb_debug,usb_generic_serial: implement sysrq and serial break
The usb_debug driver was modified to implement serial break handling
by using a "magic" data packet comprised of the sequence:
0x00 0xff 0x01 0xfe 0x00 0xfe 0x01 0xff
When the tty layer requests a serial break the usb_debug driver sends
the magic packet. On the receiving side the magic packet is thrown
away or a sysrq is activated depending on what kernel .config options
have been set.
The generic serial driver was modified as well as the usb serial
headers to generically implement sysrq processing in the same way the
non usb uart based drivers implement the sysrq handling. This will
allow other usb serial devices to implement sysrq handling as desired.
The new usb serial functions are named similarly and implemented
similarly to the uart functions as follows:
Jason Wessel [Mon, 11 May 2009 20:24:07 +0000 (15:24 -0500)]
USB: usb_debug, usb_generic_serial: implement multi urb write
The usb_debug driver, when used as the console, will always fail to
insert the carriage return and new line sequence as well as randomly
drop console output. This is a result of only having the single
write_urb and that the tty layer will have a lock that prevents the
processing of the back to back urb requests.
The solution is to allow more than one urb to be outstanding and have
a slightly deeper transmit queue. The idea and some code is borrowed
from the ftdi_sio usb driver.
The generic usb serial driver was modified so as to allow the classic
method of 1 write urb, or a multi write urb scheme with N allowed
outstanding urbs where N is controlled by max_in_flight_urbs. When
max_in_flight_urbs in a "struct usb_serial_driver" is non zero the
multi write urb scheme will be used.
The size of 4000 was selected for the usb_debug driver so that the
driver lowers possibility of losing the queued console messages during
the kernel startup.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Elina Pasheva [Wed, 29 Apr 2009 17:29:21 +0000 (10:29 -0700)]
USB: serial: sierra driver read path bug fix
This patch fixes a problem in function sierra_indat_callback() which
would stop receiving traffic from a modem if a number of URB failures
occur. Failed URBs are not resubmitted for the next read and there is
only a limited number of URBs allocated for the IN path. After this
number of failures, the receive path stops working on a particular
interface.
Signed-off-by: Elina Pasheva <epasheva@sierrawireless.com>
Elina Pasheva [Wed, 29 Apr 2009 17:26:46 +0000 (10:26 -0700)]
USB: serial: sierra driver write path improvements
- Updated Copyright notice with new authors names
- Version number set to 1.3.6
- Added a MAX_TRANSFER constant following Greg Kroah-Hartman's
recommended setting of PAGE_SIZE-512 for USB transfer buffers and
modified accordingly sierra_write() function.
Signed-off-by: Elina Pasheva <epasheva@sierrawireless.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Paul Mundt [Thu, 30 Apr 2009 08:41:02 +0000 (17:41 +0900)]
wusb: hwa-hc: Drop unused pci_suspend/resume hooks.
CC drivers/usb/host/hwa-hc.o
drivers/usb/host/hwa-hc.c:601: warning: initialization from incompatible pointer type
drivers/usb/host/hwa-hc.c:602: warning: initialization from incompatible pointer type
The prototype for these changed, so the message itself was dropped. As the only
thing these hooks were doing was printing out the message for debugging, there
is not much point in keeping them around. So, just kill them off.
Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> Cc: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org> Acked-by: David Vrabel <david.vrabel@csr.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Hermann Kneissel [Sun, 26 Apr 2009 20:42:04 +0000 (22:42 +0200)]
USB: garmin_gps: removes usb_reset_device from garmin_close
The following patch removes the call to usb_reset_device which may occur
when closing the driver by implementing a new session initialization
code based on the method used by gpsbabel.
The patch is against linux-2.6.30-rc3-git1.
Signed-off-by: Hermann Kneissel herkne@users.sourceforge.net Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Mon, 27 Apr 2009 17:33:41 +0000 (13:33 -0400)]
USB: new flag for resume-from-hibernation
This patch (as1237) changes the way the PCI host controller drivers
avoid retaining bogus hardware states during resume-from-hibernation.
Previously we had reset the hardware as part of preparing to reinstate
the memory image. But we can do better now with the new PM framework,
since we know exactly which resume operations are from hibernation.
The pci_resume method is changed to accept a flag indicating whether
the system is resuming from hibernation. When this flag is set, the
drivers will reset the hardware to get rid of any existing state.
Similarly, the pci_suspend method is changed to remove the
pm_message_t argument. It's no longer needed, since no special action
has to be taken when preparing to reinstate the memory image.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Elina Pasheva [Tue, 28 Apr 2009 01:41:52 +0000 (18:41 -0700)]
USB: serial: sierra driver debug info visibility improvement
- Version number set to 1.3.5
- Added "\n" at the end of each string in dev_dbg() code to improve the debug
information visibility. Without this change the debug logs are very
difficult to read.
Signed-off-by: Elina Pasheva <epasheva@sierrawireless.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Elina Pasheva [Sat, 25 Apr 2009 01:41:49 +0000 (18:41 -0700)]
USB: serial: sierra driver performance improvements
- Version number set to 1.3.4
- Increased the number of input/output URBs for improved performance
(numbers based on an measurement study triggered by a user request).
We performed the testing using a network simulator that provided full
speeds in the uplink and downlink directions and this combination of
URBs provided the best throughput.
Signed-off-by: Elina Pasheva <epasheva@sierrawireless.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The usb_host class isn't used for anything anymore (it was used for
debug files, but they have moved to debugfs a few kernel releases ago),
so let's delete it before someone accidentally puts a file in it.
USB: OHCI: use the ohci structure directly in debugfs files.
Right now we jump through some hoops to get to the struct ohci_hcd
struct in the ohci debugfs files. Remove all of the fun casting around
and just use the pointer directly.
This is needed as the dev pointer in the hcd structure is going away,
and it makes the code simpler and smaller
Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Thu, 30 Apr 2009 14:08:18 +0000 (10:08 -0400)]
NLS: update handling of Unicode
This patch (as1239) updates the kernel's treatment of Unicode. The
character-set conversion routines are well behind the current state of
the Unicode specification: They don't recognize the existence of code
points beyond plane 0 or of surrogate pairs in the UTF-16 encoding.
The old wchar_t 16-bit type is retained because it's still used in
lots of places. This shouldn't cause any new problems; if a
conversion now results in an invalid 16-bit code then before it must
have yielded an undefined code.
Difficult-to-read names like "utf_mbstowcs" are replaced with more
transparent names like "utf8s_to_utf16s" and the ordering of the
parameters is rationalized (buffer lengths come immediate after the
pointers they refer to, and the inputs precede the outputs).
Fortunately the low-level conversion routines are used in only a few
places; the interfaces to the higher-level uni2char and char2uni
methods have been left unchanged.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Clemens Ladisch [Fri, 24 Apr 2009 08:11:56 +0000 (10:11 +0200)]
nls: utf8_wcstombs: fix buffer overflow
utf8_wcstombs forgot to include one-byte UTF-8 characters when
calculating the output buffer size, i.e., theoretically, it was possible
to overflow the output buffer with an input string that contains enough
ASCII characters.
In practice, this was no problem because the only user so far (VFAT)
always uses a big enough output buffer.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Clemens Ladisch [Fri, 24 Apr 2009 08:11:40 +0000 (10:11 +0200)]
nls: utf8_wcstombs: use correct buffer size in error case
When utf8_wcstombs encounters a character that cannot be encoded, we
must not decrease the remaining output buffer size because nothing has
been written to the output buffer.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
People are very used to the devices file in usbfs. Now that we have
moved usbfs to be an "embedded" option only, the developers miss the
file, they had grown quite attached to it over all of these years. This
patch brings it back and puts it in the usb debugfs directory, so that
the developers don't feel sad anymore.
Tony Cook [Sat, 18 Apr 2009 13:25:06 +0000 (22:55 +0930)]
USB: mos7840: fix debug log messages
This patch removes all the unnecessary "\n"s that the debug print
statements have, which result in everything appearing double spaced
and unreadable in the logs.
Signed-off-by: Tony Cook <tony-cook@bigpond.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Robert Jarzmik [Wed, 22 Apr 2009 03:41:03 +0000 (20:41 -0700)]
USB: pxa27x_udc: single-thread setup requests
Since the PXA 27x UDC automatically ACK's some control
packets such as SET_INTERFACE, the gadgets may not get a
chance to process the request before another control packet
is received. The Linux gadgets do not expect to receive
setup callbacks out of order. The file storage gadget only
saves the "highest" priority request.
The PXA27x UDC driver must make sure it only sends one up at
a time, allowing the gadget to make changes before
continuing. In theory, the host would be NACK'd while the
gadget processes the change but the UDC has already ACK'd
the request. If another request is sent by the host that is
not automatically ACK'd by the UDC, then the throttling
happens properly to regain sync.
The observed case was the file_storage gadget timing out on
a BulkReset request because the SET_INTERFACE was being
processed by the gadget. Since SET_INTERFACE is higher
priority than BulkReset, the BulkReset was dropped. This
was exacerbated by turning on the debug which delayed the
fsg signal processing thread.
This also fixes the "should never get in
WAIT_ACK_SET_CONF_INTERF state here!!!" warning.
Reported-by: Vernon Sauder <vernoninhand@gmail.com> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
index 51790b0..1937d8c 100644
Robert Jarzmik [Wed, 22 Apr 2009 03:34:44 +0000 (20:34 -0700)]
USB: pxa27x_udc: compatibility with pxa320 SoC
Got pxa27x_udc working on the pxa320 Nomad platform. The
problem was that the pxa3xx UDC is not quite compatible with
the pxa27x UDC in how it handles back-to-back control
packets. The pxa27x probably drops them by default, but the
pxa320 does not, and you have to detect it and set the OPC
bit to clear the zero-length packet.
Signed-off-by: Aric Blumer <aric@sdgsystems.com> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
David Brownell [Wed, 22 Apr 2009 03:34:24 +0000 (20:34 -0700)]
USB: pxa27x_udc: introduce pxa27x_clear_otgph()
Follow pxa27x change in OTGPH handling, and use the newly
defined pxa27x_clear_otgph().
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Acked-by: Eric Miao <eric.miao@marvell.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net>
USB: Ignore storage device in modem mode on DWN-652
D-Link DWN-652 in Modem mode exposes 3 interfaces
- First one is the USB storage one
- Second one is for both control and connection
- Third one is unknown
This patch avoids usb-storage trying to switch again when already in
modem mode, and exposes only 2 ttyUSB instead of 3 by not attaching
to the storage interface
USB: usbfs: deprecate and hide option for !embedded
Modern systems do not use usbfs; the entries within it are files,
not device nodes, and do not support ACLs which are the default way to
provide access to USB devices to untrusted users.
It is replaced by device-nodes maintained by udev in /dev/bus/usb,
libusb uses this device nodes.
Mark the option as deprecated, and hide entirely for non-embedded builds
(which may not be using udev but require raw USB device access).
Signed-off-by: Scott James Remnant <scott@canonical.com> Acked-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Thu, 16 Apr 2009 19:35:09 +0000 (15:35 -0400)]
USB: consolidate usb_unbind_interface and usb_driver_release_interface
This patch (as1230) consolidates code in usb_unbind_interface() and
usb_driver_release_interface(). In fact, it makes release_interface
call unbind_interface, thereby removing the need for duplicated code.
It works like this: If the interface has already been registered with
the driver core when a driver releases it, then the usual driver-core
mechanism will call unbind_interface. If it hasn't been unregistered
then we will make the call ourselves.
As a nice bonus, drivers now don't have to worry about whether their
disconnect method will get called when they release an interface -- it
always will. Previously it would be called only if the interface was
registered.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Added a function to set the packet size to be used based on the value from the
device endpoint descriptor. The FT2232H and FT4232H hi-speed devices will have
wMaxPacketSize of 512 bytes when connected to a USB 2.0 hi-speed host, but will
use alternative descriptors with wMaxPacketSize of 64 bytes if connected to a
USB 1.1 host or hub. All other FTDI devices have wMaxPacketSize of 64 bytes,
except some FT232R and FT245R devices which customers have mistakenly
programmed to have wMaxPacketSize of 0 - this is an error and will be
overridden to use wMaxPacketSize of 64 bytes. The packet size used is
important as it determines where the driver removes the status bytes from the
incoming data. If it is incorrect, it will lead to data corruption.
Signed-off-by: Mark J. Adamson <mark.adamson@ftdichip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Mark Adamson [Thu, 9 Apr 2009 14:03:09 +0000 (15:03 +0100)]
USB: serial: FTDI: add high speed device support
Added support for FTDI's USB 2.0 hi-speed devices - FT2232H (2
interfaces) and FT4232H (4 interfaces), including a new baud rate
calculation for these devices which can now achieve up to 12Mbaud by
turning off a divide by 2.5 in the baud rate generator of the chips. In
order to achieve baud rates of <1200 baud, the divide by 2.5 must be
active. The default product ID of the FT2232H is 0x6010 (same as the
FT2232C IC). The default PID of the FT4232H is 0x6011.
Signed-off-by: Mark J. Adamson <mark.adamson@ftdichip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Tested on OMAP3 host side with Creative (Live! Cam Optia) USB camera
which uses high bandwidth isochronous IN endpoints. FIFO mode 4 is
updated to provide the needed 4K endpoint buffer without breaking
the g_nokia composite gadget configuration. (This is the only
gadget driver known to use enough endpoints to notice the change.)
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
musb: use dma mode 1 for TX if transfer size equals maxpacket (v2)
Currently, with Inventra DMA, we use Mode 0 if transfer size is less
than or equal to the endpoint's maxpacket size. This requires that
we explicitly set TXPKTRDY for that transfer.
However the musb_g_tx code will not set TXPKTRDY twice if the last
transfer is exactly equal to maxpacket, even if request->zero is set.
Using Mode 1 will solve this; a better fix might be in musb_g_tx().
Without this change, musb will not correctly send out a ZLP if the
last transfer is the maxpacket size and request->zero is set.
David Brownell [Tue, 31 Mar 2009 19:35:09 +0000 (12:35 -0700)]
musb: support disconnect after HNP roleswitch
Adjust HNP state machines in MUSB driver so that they handle the
case where the cable is disconnected. The A-side machine was
very wrong (unrecoverable); the B-Side was much less so.
- A_PERIPHERAL ... as usual, the non-observability of the ID
pin through Mentor's registers makes trouble. We can't go
directly to A_WAIT_VFALL to end the session and start the
disconnect processing. We can however sense link suspending,
go to A_WAIT_BCON, and from there use OTG timeouts to finally
trigger that A_WAIT_VFALL transition. (Hoping that nobody
reconnects quickly to that port and notices the wrong state.)
- B_HOST ... actually clear the Host Request (HR) bit as the
messages say, disconnect the peripheral from the root hub,
and don't detour through a suspend state. (In some cases
this would eventually have cleaned up.)
Also adjust the A_SUSPEND transition to respect the A_AIDL_BDIS
timeout, so if HNP doesn't trigger quickly enough the A_WAIT_VFALL
transition happens as it should.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
David Brownell [Thu, 2 Apr 2009 17:16:11 +0000 (10:16 -0700)]
musb: make initial HNP roleswitch work (v2)
Minor HNP bugfixes, so the initial role switch works:
- A-Device:
* disconnect-during-suspend enters A_PERIPHERAL state
* kill OTG timer after reset as A_PERIPHERAL ...
* ... and also pass that reset to the gadget
* once HNP succeeds, clear the "ignore_disconnect" flag
* from A_PERIPHERAL, disconnect transitions to A_WAIT_BCON
- B-Device:
* kill OTG timer on entry to B_HOST state (HNP succeeded)
* once HNP succeeds, clear "ignore_disconnect" flag
* kick the root hub only _after_ the state is adjusted
Other state transitions are left alone. Notably, exit paths from
the "roles have switched" state ... A_PERIPHERAL handling of that
stays seriously broken.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
David Brownell [Tue, 31 Mar 2009 19:32:12 +0000 (12:32 -0700)]
musb: otg timer cleanup
Minor cleanup of OTG timer handling:
* unify decls for OTG time constants, in the core header
* set up and use that timer in a more normal way
* move to the driver struct, so it's usable outside core
And tighten use and setup of T(a_wait_bcon) so that if it's used,
it's always valid. (If that timer expires, the A-device will
stop powering VBUS. For non-OTG systems, that will be a surprise.)
No behavioral changes, other than more consistency when applying
that core HNP timeout.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
David Brownell [Tue, 31 Mar 2009 19:30:04 +0000 (12:30 -0700)]
musb: proper hookup to transceiver drivers
Let the otg_transceiver in MUSB be managed by an external driver;
don't assume it's integrated. OMAP3 chips need it to be external,
and there may be ways to interact with the transceiver which add
functionality to the system.
Platform init code is responsible for setting up the transeciver,
probably using the NOP transceiver for integrated transceivers.
External ones will use whatever the board init code provided,
such as twl4030 or something more hands-off.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
David Brownell [Tue, 31 Mar 2009 19:28:31 +0000 (12:28 -0700)]
USB: nop-usb-xceiv: behave when linked as a module
The NOP OTG transceiver driver needs to be usable from modules.
Make sure its symbols are always accessible at both compile and
link time, and make sure the device instance is allocated from
the heap so that device lifetime rules are obeyed.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
David Brownell [Tue, 31 Mar 2009 19:26:10 +0000 (12:26 -0700)]
USB: twl4030-usb: fix minor reporting goofage
Fix a reporting glitch in the twl4030 USB transceiver code.
It wasn't properly distinguishing the two types of active
USB link: ID grounded, vs not. In the current code that
distinction doesn't much matter; in the future this bugfix
should help support better USB controller communications.
Provide a comment sorting out some of the cryptic bits of
the manual: different sections use different names for
key signals, and the register definitions don't help much
without the explanations and diagrams.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Uwe Kleine-König [Fri, 27 Mar 2009 23:26:33 +0000 (00:26 +0100)]
USB: move orion-ehci's probe function to .devinit.text
A pointer to ehci_orion_drv_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded. Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.
An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Ronen Shitrit <rshitrit@marvell.com> Cc: Lennert Buytenhek <buytenh@marvell.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: David Brownell <david-b@pacbell.net> Cc: Nicolas Pitre <nico@marvell.com> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Tzachi Perelstein <tzachi@marvell.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Uwe Kleine-König [Fri, 27 Mar 2009 23:27:00 +0000 (00:27 +0100)]
USB: move r8a66597_hcd's probe function to .devinit.text
A pointer to r8a66597_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded. Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.
An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Cc: Magnus Damm <damm@igel.co.jp> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Uwe Kleine-König [Fri, 27 Mar 2009 23:27:13 +0000 (00:27 +0100)]
USB: move twl4030_usb's probe function to .devinit.text
A pointer to twl4030_usb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded. Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.
An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Jouni Hogander <jouni.hogander@nokia.com> Cc: Kalle Jokiniemi <kalle.jokiniemi@digia.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Tony Lindgren <tony@atomide.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Cc: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Sergei Shtylyov [Fri, 27 Mar 2009 19:59:46 +0000 (12:59 -0700)]
musb: split out CPPI interrupt handler
As DaVinci DM646x has a dedicated CPPI DMA interrupt, replace
cppi_completion() (which has always been kind of layering
violation) by a complete CPPI interrupt handler.
[ dbrownell@users.sourceforge.net: only cppi_dma.c needs platform
device header, not cppi_dma.h ]
Signed-off-by: Dmitry Krivoschekov <dkrivoschekov@ru.mvista.com> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Sergei Shtylyov [Fri, 27 Mar 2009 19:58:31 +0000 (12:58 -0700)]
musb_host: refactor URB giveback
As musb_advance_schedule() is now the only remaning
caller of musb_giveback() (and the only valid context
of such call), just fold the latter into the former
and then rename __musb_giveback() into musb_giveback().
This is a net minor shrink.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Sergei Shtylyov [Fri, 27 Mar 2009 19:57:50 +0000 (12:57 -0700)]
musb_host: streamline musb_cleanup_urb() calls
The argument for the 'is_in' parameter of musb_cleanup_urb()
is always extracted from an URB that's passed to the function.
So that parameter is superfluous; remove it.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Sergei Shtylyov [Fri, 27 Mar 2009 19:56:26 +0000 (12:56 -0700)]
musb_host: simplify check for active URB
The existance of the scheduling list shouldn't matter in
determining whether there's currectly an URB executing on a
hardware endpoint. What should actually matter is the 'in_qh'
or 'out_qh' fields of the 'struct musb_hw_ep' -- those are
set in musb_start_urb() and cleared in musb_giveback() when
the endpoint's URB list drains. Hence we should be able to
replace the big *switch* statements in musb_urb_dequeue()
and musb_h_disable() with mere musb_ep_get_qh() calls...
While at it, do some more changes:
- add 'is_in' variable to musb_urb_dequeue();
- remove the unnecessary 'epnum' variable from musb_h_disable();
- fix the comment style in the vicinity.
This is a minor shrink of source and object code.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Sergei Shtylyov [Fri, 27 Mar 2009 19:55:16 +0000 (12:55 -0700)]
musb_host: factor out musb_ep_{get|set}_qh()
Factor out the often used code to get/set the active 'qh'
pointer for the hardware endpoint. Change the way the case
of a shared FIFO is handled by setting *both* 'in_qh' and
'out_qh' fields of 'struct musb_hw_ep'. That seems more
consistent and makes getting to the current 'qh' easy when
the code knows the direction beforehand.
While at it, turn some assignments into intializers and
fix declaration style in the vicinity.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Sergei Shtylyov [Fri, 27 Mar 2009 19:53:32 +0000 (12:53 -0700)]
musb_gadget: suppress "parasitic" TX interrupts with CPPI
Suppress "parasitic" endpoint interrupts in the DMA mode
when using CPPI DMA driver; they're caused by the MUSB gadget
driver using the DMA request mode 0 instead of the mode 1.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Sergei Shtylyov [Fri, 27 Mar 2009 19:52:43 +0000 (12:52 -0700)]
musb_gadget: fix unhandled endpoint 0 IRQs
The gadget EP0 code routinely ignores an interrupt at end of
the data phase because of musb_g_ep0_giveback() resetting the
state machine to "idle, waiting for SETUP" phase prematurely.
The driver also prematurely leaves the status phase on
receiving the SetupEnd interrupt.
As there were still unhandled endpoint 0 interrupts happening
from time to time after fixing these issues, there turned to
be yet another culprit: two distinct gadget states collapsed
into one.
The (missing) state that comes after STATUS IN/OUT states was
typically indiscernible from them since the corresponding
interrupts tend to happen within too little period of time
(due to only a zero-length status packet in between) and so
they got coalesced; yet this state is not the same as the next
one which is associated with the reception of a SETUP packet.
Adding this extra state seems to have fixed the rest of the
unhandled interrupts that generic_interrupt() and
davinci_interrupt() hid by faking their result and only
emitting a debug message -- so, stop doing that.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Daniel Suchy [Wed, 13 May 2009 08:05:48 +0000 (10:05 +0200)]
USB: FTDI-SIO new device ids
I would like to have added new device to usbserial/ftdi_sio driver.
These ids used USB track device (http://www.l-and-b.dk/access_alt.html).
They use differend device IDs, but it works as standard usb-serial
conventer.
From: Daniel Suchy <danny@danysek.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Linus Torvalds [Mon, 15 Jun 2009 17:06:19 +0000 (10:06 -0700)]
Merge branch 'timers-for-linus-migration' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-for-linus-migration' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
timers: Logic to move non pinned timers
timers: /proc/sys sysctl hook to enable timer migration
timers: Identifying the existing pinned timers
timers: Framework for identifying pinned timers
timers: allow deferrable timers for intervals tv2-tv5 to be deferred
Fix up conflicts in kernel/sched.c and kernel/timer.c manually
Linus Torvalds [Mon, 15 Jun 2009 16:58:50 +0000 (09:58 -0700)]
Merge branch 'timers-for-linus-clockevents' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-for-linus-clockevents' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
clockevent: export register_device and delta2ns
clockevents: tick_broadcast_device can become static
Linus Torvalds [Mon, 15 Jun 2009 16:58:33 +0000 (09:58 -0700)]
Merge branch 'timers-for-linus-clocksource' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-for-linus-clocksource' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
clocksource: prevent selection of low resolution clocksourse also for nohz=on
clocksource: sanity check sysfs clocksource changes
Linus Torvalds [Mon, 15 Jun 2009 16:32:52 +0000 (09:32 -0700)]
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (103 commits)
powerpc: Fix bug in move of altivec code to vector.S
powerpc: Add support for swiotlb on 32-bit
powerpc/spufs: Remove unused error path
powerpc: Fix warning when printing a resource_size_t
powerpc/xmon: Remove unused variable in xmon.c
powerpc/pseries: Fix warnings when printing resource_size_t
powerpc: Shield code specific to 64-bit server processors
powerpc: Separate PACA fields for server CPUs
powerpc: Split exception handling out of head_64.S
powerpc: Introduce CONFIG_PPC_BOOK3S
powerpc: Move VMX and VSX asm code to vector.S
powerpc: Set init_bootmem_done on NUMA platforms as well
powerpc/mm: Fix a AB->BA deadlock scenario with nohash MMU context lock
powerpc/mm: Fix some SMP issues with MMU context handling
powerpc: Add PTRACE_SINGLEBLOCK support
fbdev: Add PLB support and cleanup DCR in xilinxfb driver.
powerpc/virtex: Add ml510 reference design device tree
powerpc/virtex: Add Xilinx ML510 reference design support
powerpc/virtex: refactor intc driver and add support for i8259 cascading
powerpc/virtex: Add support for Xilinx PCI host bridge
...
Linus Torvalds [Mon, 15 Jun 2009 16:27:37 +0000 (09:27 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6:
regulator/max1586: fix V3 gain calculation integer overflow
regulator/max1586: support increased V3 voltage range
regulator: lp3971 - fix driver link error when built-in.
LP3971 PMIC regulator driver (updated and combined version)
regulator: remove driver_data direct access of struct device
regulator: Set MODULE_ALIAS for regulator drivers
regulator: Support list_voltage for fixed voltage regulator
regulator: Move regulator drivers to subsys_initcall()
regulator: build fix for powerpc - renamed show_state
regulator: add userspace-consumer driver
Maxim 1586 regulator driver
Rusty Russell [Sat, 13 Jun 2009 05:20:15 +0000 (14:50 +0930)]
[IA64] fix compile error in arch/ia64/mm/extable.c
ad6561dffa17f17bb68d7207d422c26c381c4313 ("module: trim exception table on init
free.") put a bogus trim_init_extable() function into ia64 which didn't compile.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Tony Luck <tony.luck@intel.com>
Linus Torvalds [Mon, 15 Jun 2009 16:13:49 +0000 (09:13 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2: (22 commits)
nilfs2: support contiguous lookup of blocks
nilfs2: add sync_page method to page caches of meta data
nilfs2: use device's backing_dev_info for btree node caches
nilfs2: return EBUSY against delete request on snapshot
nilfs2: modify list of unsupported features in caveats
nilfs2: enable sync_page method
nilfs2: set bio unplug flag for the last bio in segment
nilfs2: allow future expansion of metadata read out via get info ioctl
NILFS2: Pagecache usage optimization on NILFS2
nilfs2: remove nilfs_btree_operations from btree mapping
nilfs2: remove nilfs_direct_operations from direct mapping
nilfs2: remove bmap pointer operations
nilfs2: remove useless b_low and b_high fields from nilfs_bmap struct
nilfs2: remove pointless NULL check of bpop_commit_alloc_ptr function
nilfs2: move get block functions in bmap.c into btree codes
nilfs2: remove nilfs_bmap_delete_block
nilfs2: remove nilfs_bmap_put_block
nilfs2: remove header file for segment list operations
nilfs2: eliminate removal list of segments
nilfs2: add sufile function that can modify multiple segment usages
...
Philipp Zabel [Thu, 28 May 2009 19:00:03 +0000 (21:00 +0200)]
regulator/max1586: fix V3 gain calculation integer overflow
On Thu, May 28, 2009 at 10:59 AM, Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
> On Thu, May 28, 2009 at 07:15:16AM +0200, Philipp Zabel wrote:
>> The V3 regulator can be configured with an external resistor
>> connected to the feedback pin (R24 in the data sheet) to
>> increase the voltage range.
>>
>> For example, hx4700 has R24 = 3.32 kOhm to achieve a maximum
>> V3 voltage of 1.55 V which is needed for 624 MHz CPU frequency.
>>
>> Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
>
> Looks good.
>
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Thanks, but it turns out I hit a 32 bit integer overflow in
the gain calculation. I'd like to mend that with the following
patch. Now max_uV could be increased up to 4.294 V, enough to
charge LiPo cells.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Philipp Zabel [Thu, 28 May 2009 05:15:16 +0000 (07:15 +0200)]
regulator/max1586: support increased V3 voltage range
The V3 regulator can be configured with an external resistor
connected to the feedback pin (R24 in the data sheet) to
increase the voltage range.
For example, hx4700 has R24 = 3.32 kOhm to achieve a maximum
V3 voltage of 1.55 V which is needed for 624 MHz CPU frequency.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Marek Szyprowski [Tue, 19 May 2009 05:33:55 +0000 (07:33 +0200)]
LP3971 PMIC regulator driver (updated and combined version)
This patch adds regulator drivers for National Semiconductors LP3971 PMIC.
This LP3971 PMIC controller has 3 DC/DC voltage converters and 5 low
drop-out (LDO) regulators. LP3971 PMIC controller uses I2C interface.
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
regulator: remove driver_data direct access of struct device
In the near future, the driver core is going to not allow direct access
to the driver_data pointer in struct device. Instead, the functions
dev_get_drvdata() and dev_set_drvdata() should be used. These functions
have been around since the beginning, so are backwards compatible with
all older kernel versions.
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>