Merge updates from android-tegra-moto-2.6.39-ics-mr1

ARM: tegra: stingray: Increase delay after enabling power ON to 300 ms

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

ARM: tegra: pm: keep a local cpu online mask for lp2 idle

Keep a local mask of cpus that are online, and mark a cpu
online before it is every brought out of reset.  Fixes a
problem when turning on the second cpu where the first cpu
may think that all cpus are idle while the second cpu is
still booting.  Locking around the online mask is
unnecessary because the the cpu that modifies the mask
must be outside of idle, so the online mask can never
equal the idle mask while it is being modified.

Change-Id: If703a16e5e7e3b0e316ab15083336fbe09814f36
Signed-off-by: Colin Cross <ccross@android.com>

mmc: sdhci-tegra: Add SDHCI_QUIRK_BROKEN_CARD_DETECTION

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

mmc: sdhci: Prevent sdhci irq handler to schedule card detect if it is broken

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

HACK: ARM: tegra: pm: disallow lp2 while hotplugging in suspend

Strange crashes occur during enable_nonboot_cpus if lp2 is
enabled.  Disable it in the platform prepare_late handler, and
enable it in the platform wake handler.

Change-Id: If2c91139499fcaa2011f973b57c4dc83d1ecae67
Signed-off-by: Colin Cross <ccross@android.com>

usb: gadget: f_usbnet: Do not enable intr_out ep

Using intr_out ep w/o specifying MaxPacketSize was causing
eventual USB enumeration failure.

Intr_out ep is actually no longer used so it will be disabled
now to avoid the failure. Function config will be kept same
to match with Windows driver for now.

Change-Id: I9c2ccde5ea4d38569304650e97cd84cba9a67781
Signed-off-by: Kazuhiro Ondo <kazuhiro.ondo@motorola.com>

ARM: tegra: Gadget USB optimization

- Added AHB shared clock to gadget usb controller.
- Increased inactivity timeout of memory pre-fetch.

Change-Id: Ie8a0df5a677c05543ab66fa0a2a404ad1649d073
Signed-off-by: Kazuhiro Ondo <kazuhiro.ondo@motorola.com>

usb: gadget: Gadget USB optimization

- Set AHB bus clock to 240Mhz when USB1 gadget is enabled.
- Set "stream disable" in USB mode.

Bug: 943259
Change-Id: I2c04655338e1e831ccdddef0480c162677714c7f
Signed-off-by: Kazuhiro Ondo <kazuhiro.ondo@motorola.com>

usb: gadget: fsl_udc_core: re-prime USB controller

USB controller might stop processing dTD list even if the list
is not exhaused. Make sure to re-prime controller if controller
is found to be stopped.

Bug: 6110002
Change-Id: I669f7833359c9d7d3dbc2a413047f8e3907b6bfd
Signed-off-by: Kazuhiro Ondo <kazuhiro.ondo@motorola.com>
Merge updates from android-2.6.39

Mainly WiFi related.

net: wireless: bcmdhd: Add 'wlan_ctrl_wake' wakelock

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcmdhd: Update to version 5.90.195.53

- Add retry to wl_cfg80211_mgmt_tx() for P2P
- Change singal pending return value from -512 to -110
- Minor cleaning

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcmdhd: Fix improper band handling

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcmdhd: Allow 80211_HT capability

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

netfilter: qtaguid: initialize a local var to keep compiler happy.

There was a case that might have seemed like new_tag_stat was not
initialized and actually used.
Added comment explaining why it was impossible, and a BUG()
in case the logic gets changed.

Change-Id: I1eddd1b6f754c08a3bf89f7e9427e5dce1dfb081
Signed-off-by: JP Abgrall <jpa@google.com>

netfilter: xt_qtaguid: fix ipv6 protocol lookup

When updating the stats for a given uid it would incorrectly assume
IPV4 and pick up the wrong protocol when IPV6.

Change-Id: Iea4a635012b4123bf7aa93809011b7b2040bb3d5
Signed-off-by: JP Abgrall <jpa@google.com>
ARM: vfp: only clear vfp state for current cpu in vfp_pm_suspend

vfp_pm_suspend runs on each cpu, only clear the hardware state
pointer for the current cpu.  Prevents a possible crash if one
cpu clears the hw state pointer when another cpu has already
checked if it is valid.

Change-Id: I997ab1554944eba86730818ff242d7ebe1b32736
Signed-off-by: Colin Cross <ccross@android.com>
net: wireless: bcmdhd: Turn OFF wlan power if interface UP fails

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
net: wireless: bcmdhd: Update to Version 5.90.195.61

- Deauth frame from p2p GO to client doesn't go from firmware
  if we do del_virtual_iface immediately. Putting a delay after
  sending deauth frame to allowed FW to send out deauth frame.
- IF_DEL operation was timing out due to wrong status check.
  Fixed it and added few debug prints.
- Sending Provision Discovery directly to GO instead of doing
  an internal scan. Also put the internal scan count to 3 to have
  better timings for GO-NEG.
- Increase beacon timeout only for concurrent mode. For STA only
  operation, use the default beacon timeout value (4).
- If scan abort is due to timeout, aborting the scan in FW is not
  required. Moreover, as this scan_timeout call is coming in timer
  interrupt context, all blocking calls such as fw scan abort will
  result in kernel panic : don’t call abort in Firmware.
- Add p2p_cancel_listen routine. Fix p2p_listen_complete related
  kernel crash seen while turning off WiFi.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
netfilter: xt_IDLETIMER: Add new netlink msg type

Send notifications when the label becomes active after an idle period.
Send netlink message notifications in addition to sysfs notifications.
Using a uevent with
  subsystem=xt_idletimer
  INTERFACE=...
  STATE={active,inactive}

This is backport from common android-3.0
commit: beb914e987cbbd368988d2b94a6661cb907c4d5a
with uevent support instead of a new netlink message type.

Change-Id: I31677ef00c94b5f82c8457e5bf9e5e584c23c523
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
Signed-off-by: JP Abgrall <jpa@google.com>
netfilter: xt_qtaguid: start tracking iface rx/tx at low level

qtaguid tracks the device stats by monitoring when it goes up and down,
then it gets the dev_stats().
But devs don't correctly report stats (either they don't count headers
symmetrically between rx/tx, or they count internal control messages).

Now qtaguid counts the rx/tx bytes/packets during raw:prerouting and
mangle:postrouting (nat is not available in ipv6).

The results are in
  /proc/net/xt_qtaguid/iface_stat_fmt
which outputs a format line (bash expansion):
  ifname  total_skb_{rx,tx}_{bytes,packets}

Added event counters for pre/post handling.
Added extra ctrl_*() pid/uid debugging.

Change-Id: Id84345d544ad1dd5f63e3842cab229e71d339297
Signed-off-by: JP Abgrall <jpa@google.com>
net: wireless: bcmdhd: Set MMC_PM_KEEP_POWER flag on suspend

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
net: wireless: bcmdhd: Avoid turning radio UP twice on start

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
bcmdhd: Fix IBSS (ad-hoc) network support

Based on 69274f020a9245c4f1079d602384d616f236568b and
e494632efcd9e24875e9a83230c514c51875cbe2 in
drivers/staging/brcm80211/brcmfmac

bcmdhd ships with broken ad-hoc network support and this patch
fixes it

includes fix for AP mode (broken in previous version of the patch)
net: wireless: bcmdhd: Fix filtering setting in case of P2P

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
net: wireless: bcmdhd: Change singal pending return value from -110 to -4

- ETIMEDOUT is interpreted as FW is not responding,
  so return EINTR instead

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
net: wireless: bcmdhd: Fix WARN_ON(!res->pub.channel)

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
net: wireless: bcmdhd: Check return value from dhd_dev_init_ioctl()

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

Conflicts:
	drivers/net/wireless/bcmdhd/wl_android.c

Change-Id: I68e0d42ce628532675b8289ead667598d5c4ef3b
net: wireless: bcmdhd: Ignore signal_pending() while waiting in IOCTL

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
usb: gadget: composite: Fix corruption when changing configuration

Remove the config from the configs list before releasing the spinlock.
Otherwise the other cpu might be processing a SET_CONFIGURATION that
will switch to the configuration that is being released.

Bug: 6521576
Change-Id: Id4da0d0e18ead63e20cb236cd1d3e8e6d116acce
Signed-off-by: Benoit Goby <benoit@android.com>
net: wireless: bcmdhd: Fix WPS PBC overlap failure

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
usb: gadget: android: Fix product name

Product names may contain spaces and scanf %s only matches the 1st word.
Use strlcpy instead.

Change-Id: Ie8703fea9775f7fc17fe615a42597ca3816d36b0
Signed-off-by: Benoit Goby <benoit@android.com>

Conflicts:
	drivers/usb/gadget/android.c
net: wireless: bcmdhd: Make responce waiting uninterruptible

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
net: wireless: bcmdhd: Fix P2P driver crash for MFG firmware

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>