omap2430.c: Fix compile warning
usb: musb: musb_core.h: drop __deprecated flag
usb: musb: omap2430: musb_otg_notifier_work fix compile warning
musb_host.c: Fix musb_host_rx distinct pointer types lacks a cast
OMAP:MUSB:OTG: Disable MUSB DMA mode incase of DMA channel request failure

OMAP:MUSB:OTG: Disable MUSB DMA mode incase of DMA channel request failure

Currently in case of MUSB DMA channel request failure we are not
clearing MUSB_RXCSR_DMAENAB, MUSB_RXCSR_H_AUTOREQ and
MUSB_RXCSR_AUTOCLEAR bits of MUSB RXCSR of MUSB DMA. Which is
causing failure in receipt of data packets in next transfer.

Fix is to disable the MUSB DMA mode and related bits incase of
DMA channel request fails

Change-Id: Ie6caed6ef2a01ef647cc839c01724be32a247598
Signed-off-by: Mantesh Sarashetti <mantesh@ti.com>
USB: MUSB: Fix L3 error when USB-OTG plug/unplug to PC many times during Kernel boot.

L3 CUSTOM SRESP error appears on early stage of kernel boot and USB OTG repeating  plug/unplug  to PC.
Source:
[    2.258453] Master 0x0        MPU
[    2.258453] L4CFG OPCODE  0x00000002

Root cause is MUSB-OMAP2430 runtime suspending during PHY power on.

Fix:
pm_runtime_get_sync() is used.

modified:   drivers/usb/musb/omap2430.c

Change-Id: I59fa9db641caba811123f3724fbc17333f1458b1
Signed-off-by: x0169938 <vasyl.yushchyshen@ti.com>
USB: musb: do not proceed with interrupt completions if qh is not ready

It's not safe to modify hw_ep if qh is not ready.
This may corrupt data in musb_qh. In RX/TX completions this
may happen on SMP system with current musb host implementation
The main issue is with musb_giveback function. It unlocks and
and after that locks musb->lock so during this time
musb_qh data may be corrupted. This results in null-pointers
dereferences / programming of busy DMA channel / etc in
different places.

This often happens during unlinking URB for ISO and looks like:
CPU0                                  CPU1
...                                   musb_urb_dequeue
...                                      spin_lock_irqsave(&musb->lock)
...                                      (work with musb_qh)
...                                      musb_giveback
...                                         spin_unlock(&musb->lock)
generic_interrupt()                         ...
   spin_lock_irqsave(&musb->lock)           ...
   (work with musb_qh)                      ...
   spin_unlock_irqrestore(&musb->lock)      ...
...                                         spin_lock(&musb->lock)
...                                      (continues work with musb_qh)
...                                      spin_lock_irqrestore(&musb->lock)

Go out from completion if qh is not ready.

Change-Id: I9c9280a7ab7f8e89b2e8bf745800217f903108fc
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
(cherry picked from commit d0d4f29c2ac05a66a8b26c00ddd436e71519a1d5)
OMAP4+: HSI: hsi_char: fix write poll timeout issue

hsi_char driver may fail to return (POLLOUT | POLLWRNORM) after a write() has
occured. Instead it returns 0, causing the poll() to timeout.

This is due to a race condition between hsi_char_write() and if_hsi_notify().
Write callback can occur very fast in response to hsi_write() and may cause the
poll_event flag to be first set by if_hsi_notify() but then cleared by
hsi_char_write(), remaining to 0 forever and causing poll() timeout.

Fix is to clear the flag ahead of hsi_write to avoid this.

Change-Id: Iacd18f0448c1933a16b0a54db2204cd74fc259b2
Signed-off-by: Djamil Elaidi <d-elaidi@ti.com>
Reported-by: Christian Auby <christian.auby@stericsson.com>
(cherry picked from commit 690e59b8530d2f9335c764707c11d549ba089d09)
abe/abe_core.c: Fix sio_desc and sio_desc_address unused
omap-mcbsp.c: suggest explicit braces to avoid ambiguous 'else'
soc-dapm.c: Fix #warning need re-work
gpu: ion: export needed functions for PVR SGX

gpu: ion: export needed functions for PVR SGX

Make ion symbols visible to kernel modules. The SGX DDK
in modular form requires these symbols to be exported.

The reason for the code movement of ion structs is due to
EXPORT_SYMBOL’s requirement that the storage size of all
function parameters is known. This is so that the kernel can
sanity-check the size of data structures at module load time.

Change-Id: I2b9efe285557268da3baf258af09b56917add920
Signed-off-by: Rogelio Garcia <rgarcia@ti.com>
usb-host.c: Fix 'pads & pads_count'  may be used uninitialized in this function
mach-omap2/usb-musb.c: Fix usb_musb_mux_init defined but not used
governors/menu.c: Fix unused functions and variables
governors/menu.c: Reduce nr_iowait_cpu to 2 for Idle
cpuidle: Add module.h to drivers/cpuidle files as required.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
cpuidle: Remove CPUIDLE_FLAG_IGNORE and dev->prepare()

The cpuidle_device->prepare() mechanism causes updates to the
cpuidle_state[].flags, setting and clearing CPUIDLE_FLAG_IGNORE
to tell the governor not to chose a state on a per-cpu basis at
run-time. State demotion is now handled by the driver and it returns
the actual state entered. Hence, this mechanism is not required.
Also this removes per-cpu flags from cpuidle_state enabling
it to be made global.

Reference:
https://lkml.org/lkml/2011/3/25/52

Signed-off-by: Deepthi Dharwar <deepthi@linux.vnet.ibm>
Signed-off-by: Trinabh Gupta <g.trinabh@gmail.com>
Tested-by: Jean Pihet <j-pihet@ti.com>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bluetooth: Fix wrong memcpy size on LE start encryption

This patch fixes wrong memcpy size when copying rand value to
HCI_OP_LE_START_ENC command.
The compiler pretends that the array parameter was declared as a pointer
and sizeof reports the size of the pointer. [1]

[1] http://www.c-faq.com/aryptr/aryparmsize.html

Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
Signed-off-by: Anderson Lizardo <anderson.lizardo@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
(cherry picked from commit 51beabdf624df14d0805b001d3f939629b70d9db)
Bluetooth: use recommended LE connection parameters

The new connection parameters now match the recommended values for
Proximity and Health Thermometer profiles. The previous values were
ramdomly chosen, and are either too low or too high for most cases.

New values:

Scan Interval: 60 ms
Scan Window: 30 ms
Minimum Connection Interval: 50 ms
Maximum Connection Interval: 70 ms
Supervision Timeout: 420 ms

See "Table 5.2: Recommended Scan Interval and Scan Window Values" and
"Table 5.3: Recommended Connection Interval Values" for both profiles
for details. Note that the "fast connection" parameters were chosen,
because we do not support yet dynamically changing these parameters from
initiator side.

Additionally, the Proximity profile recommends (section "4.4 Alert on
Link Loss"):

"It is recommended that the Link Supervision Timeout (LSTO) is set to 6x
the connection interval."

Minimum_CE_Length and Maximum_CE_Length were also changed from 0x0001 to
0x0000 because they are informational and optional, and old value was
not reflecting reality.

Signed-off-by: Anderson Lizardo <anderson.lizardo@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
(cherry picked from commit 0e8339151fa85cb9b088abfb13e2dd5214a25429)