Squashed commits from P4

cpufreq: interactive: sync with google (android.googlesource.com, common android-3.0)

-retain/port some nvidia changes

Change-Id: I7efc79b9c8e80ab4b635c9aaa655725392734ecb

cpufreq: interactive: take idle notifications only when active

Register an idle notifier only when the governor is active.  Also
short-circuit work of idle end if the governor is not enabled.

Signed-off-by: Sam Leffler <sleffler@chromium.org>
Change-Id: I4cae36dd2e7389540d337d74745ffbaa0131870f

ext4: add missing save_error_info() to ext4_error()

The ext4_error() function is missing a call to save_error_info().
Since this is the function which marks the file system as containing
an error, this oversight (which was introduced in 2.6.36) is quite
significant, and should be backported to older stable kernels with
high urgency.

Change-Id: Ia1eb8d91f37ceb67faf3b79d6bc79b899f1d6bfc
Reported-by: Ken Sumrall <ksumrall@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: ksumrall@google.com
Cc: stable@kernel.org
Signed-off-by: Ken Sumrall <ksumrall@android.com>
(cherry picked from commit 9d8a0e5b42c03e2dc8dffc7eebff45ec6665fdf1)

USB: gadget: storage gadgets send wrong error code for unknown commands

commit c85dcdac5852295cf6822f5c4331a6ddab72581f upstream.

This patch (as1539) fixes a minor bug in the mass-storage gadget
drivers.  When an unknown command is received, the error code sent
back is "Invalid Field in CDB" rather than "Invalid Command".  This is
because the bitmask of CDB bytes allowed to be nonzero is incorrect.

When handling an unknown command, we don't care which command bytes
are nonzero.  All the bits in the mask should be set, not just eight
of them.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb gadget: uvc: uvc_request_data::length field must be signed

commit 6f6543f53f9ce136e01d7114bf6f0818ca54fb41 upstream.

The field is used to pass the UVC request data length, but can also be
used to signal an error when setting it to a negative value. Switch from
unsigned int to __s32.

Reported-by: Fernandez Gonzalo <gfernandez@copreci.es>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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>

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>

USB: gadget: f_audio_source: Fix error handling and increase packet size

Fixes watchdog reset on USB disconnect
Larger packet size fixes performance in fullspeed mode

Signed-off-by: Mike Lockwood <lockwood@google.com>

USB: gadget: f_audio_source: Fix use after free in audio_unbind

When USB was disconnected, we were freeing our audio_dev struct in audio_unbind
before the audio system had cleaned up, resulting in a hang in audio_pcm_close.
We now statically allocate the audio_dev struct to avoid this problem.

Change-Id: I58ad21eaa20dcf4aa74ee614ef3b6ed2c91d52a1
Signed-off-by: Mike Lockwood <lockwood@google.com>

video: tegra: dc: allow 6 underflows before reset

Comment for regulator_has_full_constraints()

Change-Id: Id6cad17f67bf4b9ac0472b98ace0097224321397

mmc: add logging

Change-Id: Iebe786efc4130d0a347770f4cdf0ac3621f9f6f8
video: Squashed commits form P4

    video: tegra: host: Do not panic on hardware timeout

    nvhost panics if hardware does not respond within 30 seconds. Remove
    this behavior, as it causes problems in emulation and simulation.
    Panic should be used only to prevent corruption.

    Submits are now given a default timeout of 30 seconds. The clients
    can still override with their own timeout value.

    MPE doesn't provide the number of slots for context save/restore.
    This information is needed to be able to use the submit timeout for
    MPE.

    Bug 982946

    Change-Id: I0f54d639df0fb726cc3163b317bf9c90bf56798b
    Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
    Reviewed-on: http://git-master/r/100246
    Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
    Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

    Conflicts:

    	drivers/video/tegra/host/nvhost_syncpt.c
    	drivers/video/tegra/host/nvhost_syncpt.h

    video: tegra: host: Yield in case of race of waits

    If two threads need to wait for CDMA to become quiet at the same
    time, the second one will cause a BUG(). Replace the BUG() with a
    code to yield and try again.

    Change-Id: I7925ad0cc0e8292919e54d0fa45f7837f453358d
    Reviewed-on: http://git-master/r/102437
    Reviewed-by: Automatic_Commit_Validation_User
    Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
    Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
    Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
    GVS: Gerrit_Virtual_Submit

    video: tegra: host: Improve timing of syncpt wait

    nvhost_syncpt_wait_timeout() relies on sync point interrupt to
    signal reaching the sync point value. With low timeout values, the
    resolution is not good enough and an error is returned even when
    the value is reached.

    Update syncpoint value from hardware when doing a sync point wait and
    do an explicit check for reaching the value even if wait returns a
    timeout.

    bug 984166
    bug 986788
    bug 987597

    Change-Id: I640e32cdcdfa66b8977eac273dd32f62bd72abd6
    Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
    Reviewed-on: http://git-master/r/103827
    Reviewed-by: Automatic_Commit_Validation_User
    Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
    Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>

    Conflicts:

    	drivers/video/tegra/host/nvhost_syncpt.c

    -add sp to syncpt_op() in syncpt_update_min_is_expired

    video: tegra: host: Remove error case panics

    Remove BUG_ON()s in error cases:
    * If IOCTL size is too large, return error instead
    * If sync point id is out of range, return error. Prevents panics in
      sanity checks nvhost_cdma.

    Bug 993642

    Change-Id: I3cfa7a23dc557c811e20b726885f82666437de7f
    Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
    Reviewed-on: http://git-master/r/106232
    Reviewed-by: Prajakta Gudadhe <pgudadhe@nvidia.com>
    Tested-by: Prajakta Gudadhe <pgudadhe@nvidia.com>

Change-Id: I6883d3ce9507e7c65da47e17308d419bbde54f18