UBUNTU: SAUCE: Bluetooth: Add support for BCM20702A0 [0a5c:21e1]

Add vendor specific ID for BCM20702A0.

usb-devices:
T:  Bus=02 Lev=02 Prnt=02 Port=05 Cnt=01 Dev#=  4 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0a5c ProdID=21e1 Rev=01.12
S:  Manufacturer=Broadcom Corp
S:  Product=BCM20702A0
S:  SerialNumber=60D819F03A6D
C:  #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
I:  If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)

BugLink: http://bugs.launchpad.net/bugs/906832

Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: James M. Leddy <james.leddy@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
ALSA: hda - Add the inverted digital mic workaround to Realtek codecs

Some laptops are equipped with ForteMedia digital mics that give the
differential input.  With such devices, summing stereo streams into a
mono (like PulseAudio does) results in almost silence.

This patch provides a workaround for this bug by adding a new mixer
switch to turn on/off the right channel of digital mic, just like a
similar fix for Conexant codecs.

When the new switch "Inverted Internal Mic Capture Switch" is off and
the current input source is the digital mic, the right channel of the
recording stream is muted.  When another input source is selected, the
right channel is restored.

Tested-by: Eliot Blennerhassett <eliot@blennerhassett.gen.nz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(backported from commit 125821ae539ab60f432b5e10dadfd7bbf069ca7a)

Conflicts:

	sound/pci/hda/patch_realtek.c

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
UBUNTU: SAUCE: Improve Amazon EBS performance for EC2

OriginalAuthor: Amazona from Ben Howard <behoward@amazon.com>
BugLink: http://bugs.launchpad.net/bugs/634316

The pv-ops kernel suffers from poor performance when using Amazon's
Elastic block storage (EBS).  This patch from Amazon improves pv-ops
kernel performance, and has not exhibited any regressions.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
UBUNTU: SAUCE: Improve Amazon EBS performance for EC2 -- fixes for v3.5-rc6

Signed-off-by: Andy Whitcroft <apw@canonical.com>
UBUNTU: SAUCE: Mask CR4 writes on older Xen hypervisors

Older Xen hypervisors (like RHEL5 versions found to be used
on Amazon's EC2) did have a bug which would crash the domain
when trying to write unsupported CR4 values.
Newer versions do handle this correctly. But some probes (in
particular one that tries to pass the OSXSAVE bit set) were
causing pv-ops kernels to crash early on boot when running on EC2.

We were using a patch that did always filter the OSXSAVE off the
values written to CR4 when running as Xen PV guest. While not
completely wrong this creates an inconsistency between the cpuid
bits a guest sees and the CR4 settings. And this did recently
cause problems because user-space was not testing all bits when
deciding to use certain features.

This patch will actually mask off the cpuid bits for XSAVE and
OSXSAVE, so generic code will not even try to set CR4. It is
limited to PV guests and (since we do not actually know the
exact version) Xen hypervisors before version 4.

[v2: make the version check an inline function]
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
REQ_META set during meta data write

Today, storage devices like eMMC has special features like data tagging
(introduced in MMC-4.5 version) in order to improve performance of some
specific writes. On MMC stack, data tagging is used for all writes which has
REQ_META flag set. On EXT4, however, currently REQ_META is set only for read.
This patch adds the capability to add REQ_META flag during meta data write.
This patch adds new function set_buffer_meta, which is used to set a bit
BH_Meta in the b_state field when meta data and super block is made dirty.

Signed-off-by: Saugata Das <saugata.das@linaro.org>
Acked-by: Arnd Bergmann <arnd.bergmann@linaro.org>

Changelog v2:
	- Removed check for WRITE when setting REQ_META in submit_bh
Changelog v1:
	- Introduction of REQ_META during write
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
sched: Enable might_sleep before initializing drivers.

This allows detection of init bugs in built-in drivers.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Add build option to to set the default panic timeout.

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Make /dev/mem configurable, as we don't want it.

Signed-off-by: Brian Swetland <swetland@google.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
mtd: nand: Allow NAND chip ids to be included standalone.

Lets non-standard NAND drivers take advantage of known NAND
chip information.

Change-Id: I87e2fcb40b07b2ec91e102f1fa7f419a4b4af0a3
Signed-off-by: Dima Zavin <dima@android.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
mmc_block: Allow more than 8 partitions per card

Set the GENHD_FL_EXT_DEVT flag, which will allocate minor numbers
in major 259 for partitions past disk->minors.

Also remove the use of disk_devt to determine devidx from md->disk.
md->disk->first_minor is always initialized from devidx and can
always be used to recover it.

Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers: power: Add watchdog timer to catch drivers which lockup during suspend.

Rather than hard-lock the kernel, dump the suspend thread stack and
BUG() when a driver takes too long to suspend.  The timeout is set
to 12 seconds to be longer than the usbhid 10 second timeout.

Exclude from the watchdog the time spent waiting for children that
are resumed asynchronously and time every device, whether or not they
resumed synchronously.

Change-Id: Ifd211c06b104860c2fee6eecfe0d61774aa4508a
Original-author: San Mehat <san@google.com>
Signed-off-by: Benoit Goby <benoit@android.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
process: Add display of memory around registers when displaying regs.

This is extremely useful in diagnosing remote crashes, and is based heavily
on original work by <md@google.com>.

Signed-off-by: San Mehat <san@google.com>
Cc: Michael Davidson <md@google.com>

[ARM] process: Use uber-safe probe_kernel_address() to read mem when dumping.

This prevents the dump from taking pagefaults / external aborts.

Signed-off-by: San Mehat <san@google.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
ARM: vfp: Move exception address fixup into vfphw.S

If the PC on the stack is updated in entry-armv.S,
do_undefinstr can get called after the fixup.  do_undefinstr
does its own fixup, and doing both causes the PC to point to
half way through an instruction.

Instead, do the fixup in do_vfp, where only the vfp code
can get called.

Change-Id: I6d966887adc8ed58d88bfe0cb3c0ba29213be488
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
printk: do not handle non-sleepable notification in console_cpu_notify

- CPU_DYING should not be handled in sleepable context

Signed-off-by: Minho Ban <mhban@samsung.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
PM: Print pending wakeup IRQ preventing suspend to dmesg

Prints the name of the first action for a pending wakeup IRQ.

Change-Id: I36f90735c75fb7c7ab1084775ec0d0ab02336e6e
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
panic: Add board ID to panic output

At times, it is necessary for boards to provide some additional information
as part of panic logs. Provide information on the board hardware as part
of panic logs.

It is safer to print this information at the very end in case something
bad happens as part of the information retrieval itself.

To use this, set global mach_panic_string to an appropriate string in the
board file.

Change-Id: Id12cdda87b0cd2940dd01d52db97e6162f671b4d
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
power: Add option to log time spent in suspend

Prints the time spent in suspend in the kernel log, and
keeps statistics on the time spent in suspend in
/sys/kernel/debug/suspend_time

Change-Id: Ia6b9ebe4baa0f7f5cd211c6a4f7e813aefd3fa1d
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
ARM: add option to flush console before reboot

If the console_lock was held while the system was rebooted, the messages
in the temporary logbuffer would not have propogated to all the console
drivers.

This force releases the console lock if it failed to be acquired.

Change-Id: I193dcf7b968be17966833e50b8b8bc70d5d9fe89
Signed-off-by: Dima Zavin <dima@android.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
cpuidle: governor: menu: don't use loadavg

get_loadavg doesn't work as intended.  According to the comments, it
should be returning an average over a few seconds, but it is actually
reading the instantaneous load.  It is almost always returning 0, but
can sometimes, depending on workload, spike very high into the hundreds
even when the average cpu load is under 10%.  Disable it for now.

Change-Id: I63ed100af1cf9463549939b8113ed83676db5f86
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>