Merge Upstream's stable 3.0.21 branch into msm-3.0
This consists 814 commits and some merge conflicts.
The merge conflicts are because of some local changes to
msm-3.0 as well as some conflicts between google's tree and
the upstream tree.
Conflicts:
arch/arm/kernel/head.S
drivers/bluetooth/ath3k.c
drivers/bluetooth/btusb.c
drivers/mmc/core/core.c
drivers/tty/serial/serial_core.c
drivers/usb/host/ehci-hub.c
drivers/usb/serial/qcserial.c
fs/namespace.c
fs/proc/base.c
Change-Id: I62e2edbe213f84915e27f8cd6e4f6ce23db22a21
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Allow automatic power management by the USB core by enabling
autosuspend in the DIAG Bridge driver. This allows the MDM device
to be suspended and draw minimal power when idle.
In the diagfwd_hsic driver, register suspend and resume callbacks
to know when to temporarily halt queuing read or write requests to
the bridge which would otherwise prevent the HSIC device from
triggering an autosuspend.
Similarly, close the bridge when the USB cable is disconnected to
signify that it is done using it, or else there would forever be a
pending read or write on the bridge that would keep the HSIC active.
Revert allocation flags in diag_bridge_read() and diag_bridge_write()
to GFP_KERNEL, as they now can only be called in process context.
Change-Id: I124460bbc90ff10a1a7f8e6ab94dab0fbfc5d0df
Signed-off-by: Jack Pham <jackp@codeaurora.org>
As ctrl_bridge_write() calls usb_autopm_get asynchronously, ensure that
the HSIC MDM device is out of suspend before attempting to write
control packets. Do this by deferring the URBs if the device is still
suspended and submit them in the resume callback.
In ctrl_bridge_start_read(), before submitting the interrupt URB the
device needs to be active. However, since this function may also be
called from the resume callback, it cannot call usb_autopm_get_interface
synchronously, so move the call to ctrl_bridge_open().
Eliminate ctrl_bridge_stop_read() by anchoring the interrupt and control
URBs along with the other write URBs. This simplifies when we need to
cancel them all en masse. Having them anchored also lets us know they
are in flight to avoid resubmitting them.
Finally, fix the suspend/resume callback functions to not rely on the
bridge being open and instead use the data_bridge's ID field to figure
out which ctrl_bridge device to call. This fixes inconsistent suspend
behavior when the bridge is closed, i.e. when the host tethered USB cable
is disconnected.
Change-Id: I9372f9a880639451b8b687dbb630172d7f5ef2d8
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Add a debugfs entry to display the number of bytes transfered
between the HSIC host and the MDM DIAG interface to aid in debugging.
The debugfs entry is created at /sys/kernel/debug/diag_bridge/status.
Reading it will display the counters, while writing to it will reset.
Change-Id: I325c3af0a0490cc4a628d87b81db223c945834c5
Signed-off-by: Jack Pham <jackp@codeaurora.org>
commit 1097ccebe630170080c41df0edcf88e0626e9c75 upstream.
This changes the max length for the usb seven segment delcom device to 8
from 6. Delcom has both 6 and 8 variants and having 8 works fine with
devices which are only 6.
Signed-off-by: Harrison Metzger <harrisonmetz@gmail.com>
Signed-off-by: Stuart Pook <stuart@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This change adds support to keep track of total time spent by a SKB in
UL and DL directions. Timestamps are recorded per SKB for the complete
life cycle at following stages:-
1) Creation: At the time of SKB allocation.
2) Submission: While SKB being submitted to HSIC HW by bridge driver/
HSUSB Core by rmnet gadget driver.
3) Completion: In completion handler of the driver(bridge driver/
gadget rmnet driver).
4) Sent: While sending SKB to bridge driver/rmnet gadget driver.
5) Queued: While SKB being queued to HSIC HW by bridge driver/
HSUSB Core by rmnet gadget driver.
6) Done: In completion handler while freeing the SKB.
debugfs node /sys/kernel/debug/data_hsic_bridge/timestamp represents the
listing of timestamp for last 34 SKBs submitted in UL direction.
debugfs node /sys/kernel/debug/ghsic_data_xport/timestamp represents the
listing of timestamp for last 34 SKBs submitted in DL direction.
Recording of the time stamp is controlled by the module parameter in
rmnet bridge driver and rmnet gadget driver.
To enable the recording of timestamp in rmnet bridge driver
echo 1 > /sys/module/mdm_bridge/parameters/record_timestamp
To enable the recording of timestamp in rmnet gadget driver
echo 1 > /sys/module/g_android/parameters/record_timestamp
Change-Id: I10e7c171eec6a01afbd48328ba006f776370ac92
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Rmnet bridge driver sets IOC bit for every URB having IP
packet data in TX direction. This causes the driver to spend
more time in servicing interrupts which degrades the over all
performance of the driver. Hence reduce the number of interrupts
in TX data path by setting URB_NO_INTERRUPT flag for certain number
of urbs submitted.
Change-Id: I784ffca6d97acffd6eed49f68f0b8c30a9b2f0e4
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
When a write callback returns -EPROTO, treat it as if the device is
disconnected and disallow further calls to write. This will allow the
caller to gracefully handle the error until a disconnect event finally
comes and is able to notify the caller via a platform_device removal.
Change-Id: Ic780281cb5486cb5177cd642d244d2451fde1d07
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
mdm bridge control driver increments the PM usage counter before
submitting the tx URB, but counter was never decremented after that,
which prevents the device from entering suspend.
Change-Id: I3bf9cf0de876a53c21cc0edd8fdeeb0fe20a4905
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
commit 59bf5cf94f0fa3b08fb1258b52649077b7d0914d upstream.
We were sending data on the stack when uploading firmware, which causes
some machines fits, and is not allowed. Fix this by using the buffer we
already had around for this very purpose.
Reported-by: Wouter M. Koolen <wmkoolen@cwi.nl>
Tested-by: Wouter M. Koolen <wmkoolen@cwi.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
mdm_data bridge driver maintains a list of idle rx URBs. Instead of
immediately freeing the URB upon failure in submit_rx_urb(), which
would decrease the number of available requests, put it back in the idle
rx list to allow for later attempts.
Change-Id: I14c42d25e224a40ebd733c94fe3579156d9e5ab8
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
mdm_bridge driver currently supports PID 0x9048 for DUN and tethered
rmnet interfaces. Add support to handle multiple PIDs (i.e. 0x9001
and 0x9034).
Change-Id: Id6135d1df282f82c4646af4a0435211c62e87ac7
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Add support for relaying the MDM 9k diag traffic over HSIC
to the USB DIAG MDM channel and vice versa. Also modify usb
diag_bridge to use signed parameters for buffer sizes. This
is especially needed for the final parameter of the read
and write callbacks, wherein a negative errno value may be
passed to convey an error.
Change-Id: Ifa516356a5d72597d82929a56d714f8dfb2964de
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
mdm9x15 default composition changed from 0x9001 to 0x9048 to include
new serial interfaces and additional rmnet interfaces. Hence update the
PID for mdm_bridge, diag_bridge, embedded rmnet drivers to support new
composition.
Change-Id: I5c3778ef6b8fddd07d1a0789213e4b289ccc7567
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
rx_done queue length was checked only when rx throttle condition was true.
rx throttle condition is asynchronous because of which sometimes queue
length value becomes much larger than stop_submit_urb_limit when rx
throttled condition is false. Hence check the queue length irrespective of
the rx throttle condition before submitting the rx urb. Also increase the
stop_submit_urb_limit to same as the flow control enable threshold value
in downlink direction.
Change-Id: I3dd915b04bfe7640a98e40809831a7b45c39dfd7
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Bridge driver probe was returning 0 (success) for unsupported
interfaces. This caused probe for other interface drivers
not getting called. Hence return -ENODEV for unsupported interfaces.
Change-Id: I88fef382d378e4c71488983f134b680e7003be77
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
This gives platform drivers a chance to do proper cleanup, especially
if they call ctrl_bridge_close which needs to access several of the
structure's members.
Change-Id: I56f36ff105ec131e560ea8a436a89316f6f88974
Signed-off-by: Jack Pham <jackp@codeaurora.org>
When a read or write callback returns -EPROTO, treat it as if the
device is disconnected and disallow further calls to read and write
by returning -ESHUTDOWN. This will allow the caller to gracefully
handle the error until a disconnect event finally comes and is able
to notify the caller via a platform_device removal.
Change-Id: I65cab1ea94e529743cba695e3c510c501a0e388e
Signed-off-by: Jack Pham <jackp@codeaurora.org>
diag_bridge_read and diag_bridge_write can potentially be called within
interrupt context so change allocation flags to GFP_ATOMIC to accommodate
those cases.
Change-Id: I065efea3264038670745ad6c51fc5def72ac3b76
Signed-off-by: Jack Pham <jackp@codeaurora.org>
The id_table array passed to usb_register was missing a terminating entry.
This caused this driver's probe function to be called whenever any device
was hotplugged.
Change-Id: I290f0e1d609ffc08b740d736dcbe7fcea339fb88
Signed-off-by: Jack Pham <jackp@codeaurora.org>
This host driver will be used to communicate with modem devices
with dial up network and RMNET interfaces. This driver works as
a bridge to pass control and data packets between the modem and
peripheral usb gadget driver. Driver currently supports
modem devices (vendor ID 0x05c6) with PIDs 0x9001
Change-Id: Id85b552b39d061528a1c3c90a354d73580c9b631
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
This will hopefully disambiguate naming clashes between this bridge
driver and existing DIAG drivers.
* Rename diag_usb.c to diag_bridge.c
* Rename diag_{open,close,read,write} to diag_bridge_*
* Rename Kconfig symbol
* Fix module build
Change-Id: Ia5b4884a7d85e2fa8f8c3865044a074a51e84adc
Signed-off-by: Jack Pham <jackp@codeaurora.org>
qcserial driver provides generic interface for gobi serial
drivers(diag, dun, nmea, etc). For Fusion 3/2.5, most of the
serial drivers are bridged directly to peripheral usb drivers
and default pid being used is 9001. Remove 9001 from qcserial
pid list till a new pid is supported for fusion 3/2.5 platform.
Change-Id: Iff8769677b093199b9ed21bd736d1d0c9a8364de
Signed-off-by: Vamsi Krishna <vskrishn@codeaurora.org>
This host driver will be used to connect directly to the modem
interface of Qualcomm devices. This will provide a bridge to
the gadget serial driver to enable dial-up networking. Though it
resembles the existing qcserial driver, this is intended only for
inter-driver usage and does not expose any interface to userland.
Change-Id: I8534a2eb0c6b747ff593f7e2efdb56da9ea6dddc
Signed-off-by: Jack Pham <jackp@codeaurora.org>
USB diag host driver will be used to connect diag interface
exposed by Qualcomm devices. This driver currently supports
usb qualcomm devices with product id: 9001 and vendor id:
0x5c6. Also add simple unit test driver to test diag host
driver.
Signed-off-by: Vamsi Krishna <vskrishn@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
* 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (205 commits)
USB: EHCI: Remove SPARC_LEON {read,write}_be definitions from ehci.h
USB: UHCI: Support big endian GRUSBHC HC
sparc: add {read,write}*_be routines
USB: UHCI: Add support for big endian descriptors
USB: UHCI: Use ACCESS_ONCE rather than using a full compiler barrier
USB: UHCI: Add support for big endian mmio
usb-storage: Correct adjust_quirks to include latest flags
usb/isp1760: Fix possible unlink problems
usb/isp1760: Move function isp1760_endpoint_disable() within file.
USB: remove remaining usages of hcd->state from usbcore and fix regression
usb: musb: ux500: add configuration and build options for ux500 dma
usb: musb: ux500: add dma glue layer for ux500
usb: musb: ux500: add dma name for ux500
usb: musb: ux500: add ux500 specific code for gadget side
usb: musb: fix compile error
usb-storage: fix up the unusual_realtek device list
USB: gadget: f_audio: Fix invalid dereference of initdata
EHCI: don't rescan interrupt QHs needlessly
OHCI: fix regression caused by nVidia shutdown workaround
USB: OTG: msm: Free VCCCX regulator even if we can't set the voltage
...
On amd64 unsigned is not as wide as pointer and this causes a compiler
warning. Switching to unsigned long corrects the problem.
Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Added several new devices to ldusb and excluded them from the HID driver.
Signed-off-by: Michael Hund <mhund@ld-didactic.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as1452b) adds a new test case to the usbtest driver. Test
24 exercises the unlink-from-queue pathways in the host. It queues a
user-specified number of bulk-OUT URBs of user-specified size, unlinks
the fourth- and second-from-last URBs in the queue, and then waits to
see if all the URBs complete in the expected way (except of course
that the unlinked URBs might complete normally, if they weren't
unlinked soon enough).
This new test has confirmed the existence of a bug in the ehci-hcd
driver, to be fixed by a separate patch.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
My testprog do a lot of bitbang - after hours i got following warning and my machine lockups:
WARNING: at /build/buildd/linux-2.6.38/lib/kref.c:34
After debugging uss720 driver i discovered that the completion callback was called before
usb_submit_urb returns. The callback frees the request structure that is krefed on return by
usb_submit_urb.
Signed-off-by: Peter Holik <peter@holik.at>
Acked-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>