cascardo/linux.git
11 years agoCHROMIUM: drm/anx7808: Train link, config output.
Jeremy Thorpe [Tue, 14 May 2013 17:43:11 +0000 (10:43 -0700)]
CHROMIUM: drm/anx7808: Train link, config output.

Adds a function that manages the video pipleline through ANX7808.

Adds a timer to debounce the cable detect signal.

Adds a workqueue on which management function runs.

BUG=chrome-os-partner:16196
TEST=Plug in HDMI connector to external monitor, power up, and see video.

Change-Id: I45440b43033304e1703113ec2e949ca39ad17071
Signed-off-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49561

11 years agoCHROMIUM: drm/anx7808: Initialize video pipeline.
Jeremy Thorpe [Tue, 14 May 2013 00:34:40 +0000 (17:34 -0700)]
CHROMIUM: drm/anx7808: Initialize video pipeline.

Adds routines that initialize the video pipeline, HDMI receiver and DP
transmitter, in anx7808 chip.

BUG=chrome-os-partner:16196
TEST=With verbose logging, and HDMI cable plugged into monitor, see:
"Video resolution: 2200x1125"

On the console, do "xrandr -d :0" and see:

eDP-1 connected 1366x768+0+0 0mm x 0mm
  1366x768       59.9*+
HDMI-1 connected 1920x1080+0+768 553mm x 311mm
  1920x1080      60.0*+   50.0
  1920x1080i     30.0     25.0
  1680x1050      60.0
  1440x900       59.9
  1280x720       60.0     50.0
  720x576        50.0
  720x480        59.9
  640x480        60.0

Change-Id: I583ced0a331326e8251a18ee04157de261af7849
Signed-off-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49560

11 years agoCHROMIUM: drm/anx7808: Add Aux channel reading.
Jeremy Thorpe [Thu, 2 May 2013 17:52:12 +0000 (10:52 -0700)]
CHROMIUM: drm/anx7808: Add Aux channel reading.

Adds register writing functions and helper functions for setting and clearing
bits.

Adds aux channel read function.

Adds DPCD read function.

Adds a code to print the firmware version of an HDMI dongle, when debugging is
on.

BUG=chrome-os-partner:16196
TEST=With verbose logging, see "ANX7730 Firmware version 0x0d."

Change-Id: I71f0778b9226685d0645234466517818330e61f3
Signed-off-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48861

11 years agoCHROMIUM: drm/anx7808: Add cable detection IRQ.
Jeremy Thorpe [Thu, 2 May 2013 17:36:07 +0000 (10:36 -0700)]
CHROMIUM: drm/anx7808: Add cable detection IRQ.

Adds a function that detects when the cable is inserted.

BUG=chrome-os-partner:16196
TEST=Run on spring with verbose logging, plug in cable, and observe
"Detected cable insertion." in the logs.

Change-Id: I9a79e8755b6d4e402bf90d0f355b83762c270969
Signed-off-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48757

11 years agoCHROMIUM: drm/anx7808: Add hardware probe.
Jeremy Thorpe [Thu, 2 May 2013 17:29:11 +0000 (10:29 -0700)]
CHROMIUM: drm/anx7808: Add hardware probe.

Adds register definitions and functions to read registers.

Adds a hardware probe function that reads configuration registers to determine
whether hardware is present and responds as expected.

BUG=chrome-os-partner:16196
TEST=Run on spring with verbose logging, and observe "ANX7808 found." in logs.

Change-Id: I577bbb022e78f4a1c41be1096e740bd3a4463697
Signed-off-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48756

11 years agoCHROMIUM: drm/anx7808: Adds a skeleton driver for Analogix 7808 Chip.
Jeremy Thorpe [Thu, 18 Apr 2013 20:08:17 +0000 (13:08 -0700)]
CHROMIUM: drm/anx7808: Adds a skeleton driver for Analogix 7808 Chip.

Adds a driver that reads parameters from device tree, requests resources
(memory, GPIOs, regulator) from kernel.

BUG=chrome-os-partner:16196
TEST=With verbose logging, see "ANX7808 initialization successful."

Change-Id: I3b492096a776e18bec5bbb928b49c27d42b31f90
Signed-off-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48755
Reviewed-by: Sean Paul <seanpaul@chromium.org>
11 years agoCHROMIUM: Remove "DP Hotplug" in mach-exynos.
Jeremy Thorpe [Tue, 16 Apr 2013 20:55:01 +0000 (13:55 -0700)]
CHROMIUM: Remove "DP Hotplug" in mach-exynos.

Spring is not using the dedicated DP_HPD pin (but a vanilla GPIO)

The only difference between calling exynos_fimd_gpio_setup_24bpp() and calling
exynos_fimd_gpio_setup_24bpp() (which is actually called by the former) is the
pin muxing for DP_HPD pin (aka GPX0_7)

BUG=chrome-os-partner:16196
TEST=See that slimport driver gets through initialization.

Change-Id: I5d26228d4a3027f9669022dc3a12ead70cf202b4
Signed-off-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50538

11 years agoUPSTREAM: perf: Treat attr.config as u64 in perf_swevent_init()
Tommi Rantala [Sat, 13 Apr 2013 19:49:14 +0000 (22:49 +0300)]
UPSTREAM: perf: Treat attr.config as u64 in perf_swevent_init()

Trinity discovered that we fail to check all 64 bits of
attr.config passed by user space, resulting to out-of-bounds
access of the perf_swevent_enabled array in
sw_perf_event_destroy().

Introduced in commit b0a873ebb ("perf: Register PMU
implementations").

Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: davej@redhat.com
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Link: http://lkml.kernel.org/r/1365882554-30259-1-git-send-email-tt.rantala@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
BUG=chromium:240706
TEST=link build, exploit fails

Change-Id: I69496233eb3f1b8c5411685a5c546255c6e6be38
Signed-off-by: Kees Cook <keescook@chromium.org>
[upstream commit 8176cced706b5e5d15887584150764894e94e02f]
Reviewed-on: https://gerrit.chromium.org/gerrit/51134
Reviewed-by: Julien Tinnes <jln@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
11 years agoasoc: samsung: hdmi: Increase the initialization delay
Sean Paul [Tue, 14 May 2013 12:07:47 +0000 (08:07 -0400)]
asoc: samsung: hdmi: Increase the initialization delay

This patch increases the initialization wait time in the samsung hdmi
audio driver to 3 seconds. The wait time was previously 5ms which did
not leave enough time for the hdmi video driver to debounce hotplug and
initialize the hardware.

BUG=chromium:239641
TEST=Tested on snow, hotplug transferred audio between device & monitor

Change-Id: I86f7526923d77e753d0a5546fdeafbe7ee11e1fe
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/51118
Reviewed-by: Dylan Reid <dgreid@chromium.org>
11 years agoCHROMIUM: mwifiex: Dereference bss only if it is non-null
Bing Zhao [Mon, 13 May 2013 19:46:10 +0000 (12:46 -0700)]
CHROMIUM: mwifiex: Dereference bss only if it is non-null

Commit:
  0ec8d6f mwifiex: fix use-after-free in beacon_ie processing

introduced an issue where the "bss" pointer was dereferenced
in mwifiex_bss_start() before a NULL check.  Fix this.

Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chrome-os-partner:19392
TEST=Change AP SSID while associating.

Change-Id: Iff8e02719f2c2e4f6560fab2dcfc65620c15ac31
Reviewed-on: https://gerrit.chromium.org/gerrit/51015
Commit-Queue: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
11 years agoAvoid NULL master_priv access in i915 kernel driver
Stuart Abercrombie [Fri, 10 May 2013 22:11:02 +0000 (15:11 -0700)]
Avoid NULL master_priv access in i915 kernel driver

In several places, including the interrupt handler, the driver assumes
it can deref. dev->primary->master->driver_priv if dev->primary->master
is non-NULL.  This wasn't true if drm_open_helper was midway through, so
rearrange the initialization order.

It looks as if http://crbug.com/221684 was caused by this, although I
have no direct repro.  I can produce the same kernel crash by adding a
delay to drm_open_helper and unplugging the monitor at the right time.

v2: Address this in drm_open_helper instead of the various access points --
basically Stephane's fix.

BUG=chromium:221684
TEST=The monitor unplug scenario doesn't bring down Link
Change-Id: I545f79422577cfe4cdd96e430b6bc902ccb1cab3
Reviewed-on: https://gerrit.chromium.org/gerrit/50407
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stuart Abercrombie <sabercrombie@chromium.org>
Tested-by: Stuart Abercrombie <sabercrombie@chromium.org>
11 years agoCHROMIUM: config: exynos5: Enable s5m-rtc driver.
Todd Broch [Fri, 3 May 2013 15:32:30 +0000 (08:32 -0700)]
CHROMIUM: config: exynos5: Enable s5m-rtc driver.

Signed-off-by: Todd Broch <tbroch@chromium.org>
CQ-DEPEND=I2ce54c0a4bf6d6d00b011a41f43c4ba899f05dc8
BUG=chrome-os-partner:19036
TEST=manual, compiles & kernel boots.  Clock keeps time across reboots
and power off.

Change-Id: Ifd2ab0bc5ef78d3c9b9c4fc582767b48610ac1f2
Reviewed-on: https://gerrit.chromium.org/gerrit/50531
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
11 years agoCHROMIUM: rtc: s5m-rtc: Real-time clock driver for s5m8767.
Todd Broch [Fri, 3 May 2013 15:28:38 +0000 (08:28 -0700)]
CHROMIUM: rtc: s5m-rtc: Real-time clock driver for s5m8767.

Driver largely based off implementation in
  git://git.insignal.co.kr/samsung/exynos/android/kernel/samsung/exynos3.0

Although it would not backport cleanly.  Commits were:

  a781deb rtc: s5m: Modify read function for s5m8763
  e03092e rtc: Fix the minor bug for s5m8767a
  6f82705 rtc: Set initial time in s5m8767a rtc
  9e47078 mfd: Add wtsr and smpl function for s5m8767a
  49f0e86 rtc: Modify rtc_set_time for s5m rtc driver
  537c944 rtc: Modify s5m8767a EVT3 rtc driver
  4c0332b rtc: Add s5m rtc driver

Signed-off-by: Todd Broch <tbroch@chromium.org>
BUG=chrome-os-partner:19036
TEST=manual, compiles & kernel boots.

Change-Id: I06e01e0171bd2f044977c0f4dfe34cea7641a35f
Reviewed-on: https://gerrit.chromium.org/gerrit/50530
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
11 years agoCHROMIUM: mfd: s5m: Refactor regmap usage.
Todd Broch [Fri, 3 May 2013 15:23:52 +0000 (08:23 -0700)]
CHROMIUM: mfd: s5m: Refactor regmap usage.

Refactor s5m_bulk|reg_* functions usage of regmap to facilitate
multiple regmapped devices in preparation for using s5m-rtc.

Signed-off-by: Todd Broch <tbroch@chromium.org>
BUG=chrome-os-partner:19036
TEST=manual, compiles & kernel boots.

Change-Id: I4ac47de476cd6d94ebd751fa0aee7800f369b1ad
Reviewed-on: https://gerrit.chromium.org/gerrit/50529
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>

11 years agomwifiex: abort remaining scan commands when association started
Bing Zhao [Thu, 9 May 2013 18:57:11 +0000 (11:57 -0700)]
mwifiex: abort remaining scan commands when association started

A full-channel scan is split to multiple scan commands in driver
before they are sent to firmware. When each scan result is back
the SSID entries are parsed and informed to cfg80211 directly.

It's observed that sometimes userspace may initiate association
as soon as the target AP is found. During the 4-way handshake
firmware may go off-channel to scan the remaining channels.
This causes the 4-way handshake to fail.

Fix it by checking 'scan_block' flag and aborting the remaining
scan in this case. 'scan_block' flag is set after association
and before 4-way handshake. It gets cleared after 4-way handshake
is completed.

BUG=chrome-os-partner:18188
TEST=autotest against CrOS_chaos_WesternDigital_5 (Jason Abele)

Change-Id: Ibda61178f2aee7228989bedb511eb2abc5a40343
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/50687
Reviewed-by: Paul Stewart <pstew@chromium.org>
11 years agomwifiex: remove global user_scan_cfg variable
Bing Zhao [Thu, 9 May 2013 18:55:28 +0000 (11:55 -0700)]
mwifiex: remove global user_scan_cfg variable

As the variable is used only for preparation of internal scan
commands, we don't need to keep it allocated until the entire
scan completes. We will define it as a local variable and free
immediately after it's use.

New flag 'scan_aborting' is added to handle race between
mwifiex_close() and scan handler. Previously user_scan_cfg
pointer used to take care of this.

This patch fixes a memory leak in mwifiex_cfg80211_scan after
running "iwlist mlan0 scan & sleep 1; rmmod mwifiex_sdio".

BUG=None
TEST="iwlist mlan0 scan & sleep 1; rmmod mwifiex_sdio";
"echo scan > /sys/kernel/debug/kmemleak; cat /sys/kernel/debug/kmemleak"

Change-Id: I3ab5aacf1bec957c6279a784d9ed557bf0691f2c
Reported-by: Daniel Drake <dsd@laptop.org> [OLPC]
Tested-by: Daniel Drake <dsd@laptop.org> [OLPC]
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/50686
Reviewed-by: Paul Stewart <pstew@chromium.org>
11 years agomwifiex: scan delay timer cleanup in unload path
Bing Zhao [Thu, 9 May 2013 18:52:50 +0000 (11:52 -0700)]
mwifiex: scan delay timer cleanup in unload path

Return from scan delay timer routine if surprise_removed flag
is true. Also, cancel the timer in unload path.

This fixes a crash when scan delay timer accesses structures
that have been freed already.

Tested with "iwlist mlan0 scan & sleep 1; rmmod mwifiex_sdio"

BUG=None
TEST="iwlist mlan0 scan & sleep 1; rmmod mwifiex_sdio";
"echo scan > /sys/kernel/debug/kmemleak; cat /sys/kernel/debug/kmemleak"

Change-Id: Ia69b70ecc8b208fce4c2c3f39ec6e2d4042962f6
Reported-by: Daniel Drake <dsd@laptop.org> [OLPC]
Tested-by: Daniel Drake <dsd@laptop.org> [OLPC]
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/50685
Reviewed-by: Paul Stewart <pstew@chromium.org>
11 years agomwifiex: rename mwifiex_free_adapter() routine in init.c
Bing Zhao [Thu, 9 May 2013 18:51:23 +0000 (11:51 -0700)]
mwifiex: rename mwifiex_free_adapter() routine in init.c

We have two different static routines with name
mwifiex_free_adapter(). The routine in main.c actually frees the
adapter structure.

We will rename other routine in init.c to mwifiex_adapter_cleanup()
to avoid confusion.

BUG=None
TEST="iwlist mlan0 scan & sleep 1; rmmod mwifiex_sdio";
"echo scan > /sys/kernel/debug/kmemleak; cat /sys/kernel/debug/kmemleak"

Change-Id: I84933ea996d6d0f6568b2ae915ade5214e25790a
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/50684
Reviewed-by: Paul Stewart <pstew@chromium.org>
11 years agoUPSTREAM mwifiex: fix memory leak issue when driver unload
Bing Zhao [Thu, 9 May 2013 18:42:54 +0000 (11:42 -0700)]
UPSTREAM mwifiex: fix memory leak issue when driver unload

After unregister_netdevice() call the request is queued and
reg_state is changed to NETREG_UNREGISTERING.
As we check for NETREG_UNREGISTERED state, free_netdev() never
gets executed causing memory leak.

Initialize "dev->destructor" to free_netdev() to free device
data after unregistration.

BUG=None
TEST="iwlist mlan0 scan & sleep 1; rmmod mwifiex_sdio";
"echo scan > /sys/kernel/debug/kmemleak; cat /sys/kernel/debug/kmemleak"

Change-Id: I4ac505e2711770a2536dd5434e5dc2ff020e406b
Cc: <stable@vger.kernel.org>
Reported-by: Daniel Drake <dsd@laptop.org>
Tested-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/50683
Reviewed-by: Paul Stewart <pstew@chromium.org>
11 years agoCHROMIUM: ALSA: ASoC: exynos hdmi - disable audio in DVI mode
Yuly Novikov [Thu, 9 May 2013 22:47:53 +0000 (18:47 -0400)]
CHROMIUM: ALSA: ASoC: exynos hdmi - disable audio in DVI mode

exynos-hdmi-audio used to configure HDMI to send ACR and AUI infoframes
even when DVI sink was plugged using HDMI-DVI cable.
This would cause monitor to go to sleep.

So, don't configure audio if HDMI is in DVI mode,
assuming the graphics driver already disabled it.

Also, if HDMI audio jack hotplugging was previously reported,
report that it was unplugged when DVI mode is detected.

BUG=chromium:222145
TEST=Unplug/plug HDMI-DVI cable, observe monitor working properly.
     Boot with HDMI-HDMI cable plugged in, unplug/plug,
     play sound and hear it on monitor's speakers.

Signed-off-by: Yuly Novikov <ynovikov@chromium.org>
Change-Id: Ia6d677ff82beb64ff53ed7c4bfb09658668fbd9b
Reviewed-on: https://gerrit.chromium.org/gerrit/50726
Reviewed-by: Dylan Reid <dgreid@chromium.org>
11 years agoarm: exynos5: fix the number of GPIO groups on bank A
Vincent Palatin [Thu, 9 May 2013 21:37:31 +0000 (14:37 -0700)]
arm: exynos5: fix the number of GPIO groups on bank A

The GPIO bank A has 21 groups :
A0->A3, B0->B3, C0->C4, DO->D1, Y0->Y6

Let's update the constant to match the groups declare in the samsung
GPIO driver, else the GPIO irq driver won't find its babies.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=none
TEST=on Spring, try to get GPF0[0] as an interrupt.

Change-Id: I44396611d9da618dfe2a739892be4f0924a6f8cf
Reviewed-on: https://gerrit.chromium.org/gerrit/50710
Reviewed-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: USB: option: add Huawei E5331
Bjørn Mork [Wed, 27 Feb 2013 14:52:56 +0000 (15:52 +0100)]
UPSTREAM: USB: option: add Huawei E5331

Another device using CDC ACM with vendor specific protocol to mark
serial functions.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit daec90e7382cbd0e73eb6861109b3da91e5ab1f3)

Change-Id: Ib13e341a812af0619fdf4ffb809e6bb50d83a05e
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50574
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: USB: option: add Huawei "ACM" devices using protocol = vendor
Bjørn Mork [Wed, 13 Feb 2013 22:41:34 +0000 (23:41 +0100)]
UPSTREAM: USB: option: add Huawei "ACM" devices using protocol = vendor

The USB device descriptor of one identity presented by a few
Huawei morphing devices have serial functions with class codes
02/02/ff, indicating CDC ACM with a vendor specific protocol. This
combination is often used for MSFT RNDIS functions, and the CDC
ACM class driver will therefore ignore such functions.

The CDC ACM class driver cannot support functions with only 2
endpoints.  The underlying serial functions of these modems are
also believed to be the same as for alternate device identities
already supported by the option driver. Letting the same driver
handle these functions independently of the current identity
ensures consistent handling and user experience.

There is no need to blacklist these devices in the rndis_host
driver. Huawei serial functions will either have only 2 endpoints
or a CDC ACM functional descriptor with bmCapabilities != 0, making
them correctly ignored as "non RNDIS" by that driver.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 1f3f687722fd9b29a0c2a85b4844e3b2a3585c63)

Signed-off-by: Ben Chan <benchan@chromium.org>
Conflicts:
drivers/usb/serial/option.c

Change-Id: I8a020cb3cfac933200fb6b8b5581a51fe1ef1c09
Reviewed-on: https://gerrit.chromium.org/gerrit/50573
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
11 years agoUPSTREAM: USB: option: blacklist network interface on ZTE MF880
Bjørn Mork [Wed, 19 Dec 2012 14:15:17 +0000 (15:15 +0100)]
UPSTREAM: USB: option: blacklist network interface on ZTE MF880

The driver description files gives these names to the vendor specific
functions on this modem:

 diag: VID_19D2&PID_0284&MI_00
 nmea: VID_19D2&PID_0284&MI_01
 at:   VID_19D2&PID_0284&MI_02
 mdm:  VID_19D2&PID_0284&MI_03
 net:  VID_19D2&PID_0284&MI_04

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit fab38246f318edcd0dcb8fd3852a47cf8938878a)

Change-Id: If40a3ca9fffaa28660ea3982fef57ac0a4e4f53d
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50572
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: USB: option: blacklist network interface on Huawei E173
Bjørn Mork [Sun, 25 Nov 2012 16:05:10 +0000 (17:05 +0100)]
UPSTREAM: USB: option: blacklist network interface on Huawei E173

The Huawei E173 will normally appear as 12d1:1436 in Linux.  But
the modem has another mode with different device ID and a slightly
different set of descriptors. This is the mode used by Windows like
this:

  3Modem:      USB\VID_12D1&PID_140C&MI_00\6&3A1D2012&0&0000
  Networkcard: USB\VID_12D1&PID_140C&MI_01\6&3A1D2012&0&0001
  Appli.Inter: USB\VID_12D1&PID_140C&MI_02\6&3A1D2012&0&0002
  PC UI Inter: USB\VID_12D1&PID_140C&MI_03\6&3A1D2012&0&0003

All interfaces have the same ff/ff/ff class codes in this mode.
Blacklisting the network interface to allow it to be picked up by
the network driver.

Cc: stable <stable@vger.kernel.org>
Reported-by: Thomas Schäfer <tschaefer@t-online.de>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f36446cf9bbebaa03a80d95cfeeafbaf68218249)

Change-Id: I539d5879c3004f1a22532337c84cce8b2f47a2a7
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50571
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: USB: add new zte 3g-dongle's pid to option.c
li.rui27@zte.com.cn [Tue, 20 Nov 2012 06:31:47 +0000 (14:31 +0800)]
UPSTREAM: USB: add new zte 3g-dongle's pid to option.c

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Rui li <li.rui27@zte.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 31b6a1048b7292efff8b5b53ae3d9d29adde385e)

Change-Id: I34dab64e2a7c442a396cb21b554c57f6c48321a6
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50570
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: USB: option: add more ZTE devices
Bjørn Mork [Thu, 18 Oct 2012 15:14:17 +0000 (17:14 +0200)]
UPSTREAM: USB: option: add more ZTE devices

Cc: <stable@vger.kernel.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 4b35f1c52943851b310afb09047bfe991ac8f5ae)

Change-Id: Iaba97c0798546fb378d3913eb018a7bc52bd2950
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50569
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: USB: option: blacklist net interface on ZTE devices
Bjørn Mork [Thu, 18 Oct 2012 15:19:53 +0000 (17:19 +0200)]
UPSTREAM: USB: option: blacklist net interface on ZTE devices

Based on information from the ZTE Windows drivers.

Cc: <stable@vger.kernel.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 1452df6f1b7e396d89c2a1fdbdc0e0e839f97671)

Change-Id: Ic34ea8cf65c826766e7ef583411ce36e9182b6b6
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50568
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: USB: option: blacklist QMI interface on ZTE MF683
Bjørn Mork [Wed, 19 Sep 2012 20:02:12 +0000 (22:02 +0200)]
UPSTREAM: USB: option: blacklist QMI interface on ZTE MF683

Interface #5 on ZTE MF683 is a QMI/wwan interface.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Cc: stable <stable@vger.kernel.org>
Cc: Shawn J. Goff <shawn7400@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 160c9425ac52cb30502be2d9c5e848cec91bb115)

Change-Id: I9dad94c5bfab2c752d1b93cd177f70ab47726b3e
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50567
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: USB: option: replace ZTE K5006-Z entry with vendor class rule
Bjørn Mork [Tue, 11 Sep 2012 07:40:31 +0000 (09:40 +0200)]
UPSTREAM: USB: option: replace ZTE K5006-Z entry with vendor class rule

Fix the ZTE K5006-Z entry so that it actually matches anything

  commit f1b5c997 USB: option: add ZTE K5006-Z

added a device specific entry assuming that the device would use
class/subclass/proto == ff/ff/ff like other ZTE devices. It
turns out that ZTE has started using vendor specific subclass
and protocol codes:

T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  4 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=19d2 ProdID=1018 Rev= 0.00
S:  Manufacturer=ZTE,Incorporated
S:  Product=ZTE LTE Technologies MSM
S:  SerialNumber=MF821Vxxxxxxx
C:* #Ifs= 5 Cfg#= 1 Atr=c0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=86 Prot=10 Driver=(none)
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=02 Prot=05 Driver=(none)
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=01 Driver=(none)
E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=06 Prot=00 Driver=qmi_wwan
E:  Ad=85(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 4 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

We do not have any information on how ZTE intend to use these
codes, but let us assume for now that the 3 sets matching
serial functions in the K5006-Z always will identify a serial
function in a ZTE device.

Cc: Thomas Schäfer <tschaefer@t-online.de>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ba9edaa468869a8cea242a411066b0f490751798)

Change-Id: I684108af3b0ccd94c0909b5e43eaa0c0772d49c4
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50566
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: USB: option: add ZTE K5006-Z
Bjørn Mork [Wed, 15 Aug 2012 13:43:33 +0000 (15:43 +0200)]
UPSTREAM: USB: option: add ZTE K5006-Z

The ZTE (Vodafone) K5006-Z use the following
interface layout:

00 DIAG
01 secondary
02 modem
03 networkcard
04 storage

Ignoring interface #3 which is handled by the qmi_wwan
driver.

Cc: Thomas Schäfer <tschaefer@t-online.de>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f1b5c997e68533df1f96dcd3068a231bca495603)

Change-Id: Iac1d47ba7798ed27a903eb5c7266b98134f5d27b
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50565
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: USB: support the new interfaces of Huawei Data Card devices in option driver
fangxiaozhi [Wed, 8 Aug 2012 09:24:45 +0000 (09:24 +0000)]
UPSTREAM: USB: support the new interfaces of Huawei Data Card devices in option driver

In this patch, we add new declarations into option.c to support the new
interfaces of Huawei Data Card devices. And at the same time, remove the
redundant declarations from option.c.

Signed-off-by: fangxiaozhi <huananhu@huawei.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ee6f827df9107139e8960326e49e1376352ced4d)

Change-Id: I909c57e51b88891616d80df128dcd39e9d11c73b
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50564
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: USB: option: add ZTE MF821D
Bjørn Mork [Thu, 12 Jul 2012 10:37:32 +0000 (12:37 +0200)]
UPSTREAM: USB: option: add ZTE MF821D

Sold by O2 (telefonica germany) under the name "LTE4G"

Tested-by: Thomas Schäfer <tschaefer@t-online.de>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 09110529780890804b22e997ae6b4fe3f0b3b158)

Change-Id: I76097c70b04b835739dd7c49cbb227663aa40b82
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50563
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: USB: option: add ZTE MF60
Bjørn Mork [Mon, 2 Jul 2012 17:53:55 +0000 (19:53 +0200)]
UPSTREAM: USB: option: add ZTE MF60

Switches into a composite device by ejecting the initial
driver CD.  The four interfaces are: QCDM, AT, QMI/wwan
and mass storage.  Let this driver manage the two serial
interfaces:

T:  Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 28 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=19d2 ProdID=1402 Rev= 0.00
S:  Manufacturer=ZTE,Incorporated
S:  Product=ZTE WCDMA Technologies MSM
S:  SerialNumber=xxxxx
C:* #Ifs= 4 Cfg#= 1 Atr=c0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 3 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 8e16e33c168a6efd0c9f7fa9dd4c1e1db9a74553)

Change-Id: I82d92464ece3b9e5dbadf9b5637dd7ceae2cf81b
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50562
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: USB: option: clean up probe coding style
Johan Hovold [Wed, 30 May 2012 10:25:00 +0000 (12:25 +0200)]
UPSTREAM: USB: option: clean up probe coding style

Clean up option probe by introducing intermediate variables and fixing
up comments.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 378fac2a46decbcd16b42044303ba8a1a3f8001e)

Change-Id: I0ba9fbbabc05f314742cbdb58d231f5e12dc45c7
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50561
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: USB: option: Updated Huawei K4605 has better id
Andrew Bird [Mon, 28 May 2012 11:43:06 +0000 (12:43 +0100)]
UPSTREAM: USB: option: Updated Huawei K4605 has better id

Later firmwares for this device now have proper subclass and
protocol info so we can identify it nicely without needing to use
the blacklist. I'm not removing the old 0xff matching as there
may be devices in the field that still need that.

Signed-off-by: Andrew Bird <ajb@spheresystems.co.uk>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 42ca7da1c2363dbef4ba1b6917c4c02274b6a5e2)

Change-Id: I9baea88b9f9d3fb1de84a296f3fe1765b5f2f110
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50560
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: USB: option: Add Vodafone/Huawei K5005 support
Bjørn Mork [Sat, 19 May 2012 17:20:50 +0000 (19:20 +0200)]
UPSTREAM: USB: option: Add Vodafone/Huawei K5005 support

Tested-by: Thomas Schäfer <tschaefer@t-online.de>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 4cbbb039a9719fb3bba73d255c6a95bc6dc6428b)

Change-Id: Ibb164ad28a58da63eafb5d7b0ca3a1e46fe0a2dc
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50559
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoCHROMIUM: perf tools: fix -ldw/-lelf link test when static linking
Mike Frysinger [Wed, 8 May 2013 21:51:11 +0000 (17:51 -0400)]
CHROMIUM: perf tools: fix -ldw/-lelf link test when static linking

Since libelf sometimes uses libpthread, we have to list that after -lelf
when someone tries to build statically.  Else things go boom:
Makefile:479: *** No libelf.h/libelf found, please install \
libelf-dev/elfutils-libelf-devel.  Stop.

Similarly, the -ldw test fails as it often uses -lz:
Makefile:462: No libdw.h found or old libdw.h found or elfutils is older \
than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev

And if we add debugging to try-cc, we see:
+ echo '#include <dwarf.h>

int main(void)
{
        Dwarf *dbg = dwarf_begin(0, DWARF_C_READ);
        return (long)dbg;
}'
+ i686-pc-linux-gnu-gcc -x c - -O2 -pipe -march=atom -mtune=atom -mfpmath=sse -g \
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE \
-ldw -lelf -static -lpthread -lrt -lelf -lm -o .24368
/usr/lib/libdw.a(dwarf_begin_elf.o):function check_section.isra.1: error: undefined reference to 'inflateInit_'
/usr/lib/libdw.a(dwarf_begin_elf.o):function check_section.isra.1: error: undefined reference to 'inflate'
/usr/lib/libdw.a(dwarf_begin_elf.o):function check_section.isra.1: error: undefined reference to 'inflateReset'
/usr/lib/libdw.a(dwarf_begin_elf.o):function check_section.isra.1: error: undefined reference to 'inflateEnd'

+ echo '#include <libelf.h>

int main(void)
{
        Elf *elf = elf_begin(0, ELF_C_READ, 0);
        return (long)elf;
}'
+ i686-pc-linux-gnu-gcc -x c - -O2 -pipe -march=atom -mtune=atom -mfpmath=sse -g \
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE \
-static -lpthread -lrt -lelf -lm -o .19216
/usr/lib/libelf.a(elf_begin.o):function file_read_elf: error: undefined reference to 'pthread_rwlock_init'
/usr/lib/libelf.a(elf_begin.o):function __libelf_read_mmaped_file: error: undefined reference to 'pthread_rwlock_init'
/usr/lib/libelf.a(elf_begin.o):function __libelf_read_mmaped_file: error: undefined reference to 'pthread_rwlock_init'
/usr/lib/libelf.a(elf_begin.o):function read_file: error: undefined reference to 'pthread_rwlock_init'
/usr/lib/libelf.a(elf_begin.o):function lock_dup_elf.8072: error: undefined reference to 'pthread_rwlock_unlock'
/usr/lib/libelf.a(elf_begin.o):function lock_dup_elf.8072: error: undefined reference to 'pthread_rwlock_wrlock'
/usr/lib/libelf.a(elf_begin.o):function elf_begin: error: undefined reference to 'pthread_rwlock_rdlock'
/usr/lib/libelf.a(elf_begin.o):function elf_begin: error: undefined reference to 'pthread_rwlock_unlock'

BUG=None
TEST=`LDFLAGS=-static emerge-x86-alex perf` works

Change-Id: Idfa38ae36d22bcc669199bbd8e74f83eb97ddda9
Signed-off-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50498
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoCHROMIUM: drm/exynos: Fixup init failure cleanup path
Daniel Kurtz [Mon, 6 May 2013 17:36:42 +0000 (10:36 -0700)]
CHROMIUM: drm/exynos: Fixup init failure cleanup path

Backport from 3.8-rebase version of this patch.

Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
TEST=by hand
BUG=none

Original-Change-Id: Ia0c0de4f49efe0d6dca09507372add5d0d533028
Reviewed-on: https://gerrit.chromium.org/gerrit/49146
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
(cherry picked from commit fa2b424b2108697ee5a971bc00b9a8bb75f66b41)

Change-Id: I09d0d33a9499945e67fb8416c0074a440fd5b5a2
Reviewed-on: https://gerrit.chromium.org/gerrit/50188
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
11 years agoRevert "Add implementation of poll() to dma_buf using KDS"
Daniel Kurtz [Sat, 4 May 2013 04:11:11 +0000 (21:11 -0700)]
Revert "Add implementation of poll() to dma_buf using KDS"

This reverts commit 5d1bb28fa72400006b3956ab7d869dffd091af23.

There are no users of dma-buf poll(), this isn't upstream, and we aren't
carrying it forward to 3.8.

Revert from 3.4 to keep 3.8 & 3.4 more consistent.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=none
TEST=none

Change-Id: Ia6628aef06f5ee228f3ac479bfa0e75b45573f04
Reviewed-on: https://gerrit.chromium.org/gerrit/50187
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
11 years agoCHROMIUM: fix 800x600 resolution for exynos5 hdmi
Shirish S [Fri, 5 Apr 2013 11:52:00 +0000 (07:52 -0400)]
CHROMIUM: fix 800x600 resolution for exynos5 hdmi

800x600 resolution is not cleanly supported by the exynos5 mixer block.
Hw team suggested following workaround to enable the above resolution.

1) In MIXER_CFG register, set HD_SD and HD_MODE bits to 1.
2) In MIXER0_GRAPHIC0_DXY, set MIXER0_GRP0_DX to 32.
3) In MIXER_TVOUT_CFG, Change 3D one path mode to 3D two path AFTER 1 FRAME.

BUG=chrome-os-partner:12643 & chromium:225983
TEST:
1) Booted with HDMI Connectd to Sink that supports only 800x600
2) HDMI Unplug-plug scenarios
3) S2R by running powerd_dbus_suspend

Change-Id: Ic5952ff3982c4923eabb69febeabfeb445e7a79c
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Signed-off-by: Shirish S <s.shirish@samsung.com>
Signed-off-by: Akshay Saraswat <Akshay.s@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/47650
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Tested-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Shirish S <shirish@chromium.org>

11 years agoCHROMIUM: ARM: exynos: busfreq: Fix array-out-of-bound access.
Han Shen [Fri, 26 Apr 2013 00:06:14 +0000 (17:06 -0700)]
CHROMIUM: ARM: exynos: busfreq: Fix array-out-of-bound access.

In the 1st loop of
arch/arm/mach-exynos/busfreq_opp_exynos5.c:show_time_in_state, sprintf
accesses data->time_in_state[PPMU_MIF][i], where i ranges [0..6], but
time_in_state is defined as array[2][4]. Fixed by change time_in_state
definition.

BUG=None
TEST=Build successfully

Change-Id: I2d4cab59281509e33d34b55892f18635e8b7fa09
Signed-off-by: Han Shen <shenhan@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/49266
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agowireless-next: rtl8192c:dm: Properly initialize local array and set value.
Han Shen [Wed, 3 Apr 2013 21:36:38 +0000 (14:36 -0700)]
wireless-next: rtl8192c:dm: Properly initialize local array and set value.

GCC 4.8 is spitting out uninitialized-variable warnings against
"drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c".  This patch adds
initialization to the variable and properly sets its value.

Signed-off-by: Han Shen (shenhan@google.com)
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
(cherry picked from commit 7c8f0db0d024efda38976fc2acf7743f458e1d96)

Conflicts:
        drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c

TEST=Built using newest compiler.
BUG=None

Signed-off-by: Han Shen (shenhan@google.com)
Change-Id: Id7f48f33df1d5629ade21c67ede6960e73040e82
Reviewed-on: https://gerrit.chromium.org/gerrit/47279
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Han Shen <shenhan@google.com>
Commit-Queue: Han Shen <shenhan@google.com>

11 years agoCHROMIUM: usb: ehci: Only sleep for post-resume handover if devices use persist
Julius Werner [Sat, 20 Apr 2013 01:16:34 +0000 (18:16 -0700)]
CHROMIUM: usb: ehci: Only sleep for post-resume handover if devices use persist

The current EHCI code sleeps a flat 110ms in the resume path if there
was a USB 1.1 device connected to its companion controller during
suspend, waiting for the device to reappear and reset so that it can be
handed back to the companion. This is necessary if the device uses
persist, so that the companion controller can actually see it during its
own resume path.

However, if the device doesn't use persist, this is entirely
unnecessary. We might just as well ignore it and have the normal device
detection/reset/handoff code handle it asynchronously when it eventually
shows up. As USB 1.1 devices are almost exclusively HIDs these days (for
which persist has no value), this can allow distros to shave another
tenth of a second off their resume time.

BUG=chromium:222484
TEST=Suspend/resume Snow with a USB keyboard plugged in, make sure
keyboard still works afterwards.

Has been sent upstream, chances for merge were looking good...

Change-Id: I3bc9a86e464a70231cfdd1b013ef0a0cb98eff09
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48945
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>

11 years agodrm/exynos: Debounce gpio hotplug interrupts
Sean Paul [Fri, 26 Apr 2013 20:06:43 +0000 (16:06 -0400)]
drm/exynos: Debounce gpio hotplug interrupts

Debounce the gpio (external) hotplug interrupts. This patch debounces
hotplug interrupts generated while the HDMI block is off. The reason
this is needed is that we get multiple (5) interrupts every time a
monitor is inserted which causes us to needlessly enable and disable the
IP block.

BUG=chromium:220033
TEST=Tested using an HDMI analyzer. Many hotplugs without any 20s freeze

Change-Id: I9c5d61364790f4110fc758a93fabac48b646b3fa
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49349
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoFix display underruns on Pineview with 2048x1280 VGA display.
Stuart Abercrombie [Mon, 29 Apr 2013 22:07:29 +0000 (15:07 -0700)]
Fix display underruns on Pineview with 2048x1280 VGA display.

Higher dot clocks were working because pixel doubling was enabled.

Lower the apparently arbitrary threshold so it's enabled for 2048x1280.

Intel hasn't felt moved to document any of this, so this is purely empirical.

The original threshold was introduced here:
http://cgit.freedesktop.org/~anholt/xf86-video-intel/commit/?id=8fcf9a81179ee8577ddab5e904c58fbfd14cf59c

BUG=chromium:219562
TEST=All previously working U3011 modes + 2048x1280 work
Change-Id: I69f47b6ef292d65dc1a3ff6288c33eaa4c1cd894
Reviewed-on: https://gerrit.chromium.org/gerrit/49434
Reviewed-by: Stuart Abercrombie <sabercrombie@chromium.org>
Tested-by: Stuart Abercrombie <sabercrombie@chromium.org>
Commit-Queue: Stuart Abercrombie <sabercrombie@chromium.org>

11 years agoCHROMIUM: config: re-sync kernel config after dma-buf kds separation
Daniel Kurtz [Fri, 19 Apr 2013 09:23:38 +0000 (17:23 +0800)]
CHROMIUM: config: re-sync kernel config after dma-buf kds separation

Now, this is only set for exynos:
CONFIG_DMA_SHARED_BUFFER_USES_KDS=y

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium:232913
TEST=compile kernel for x86 and arm and verify it still boots

Change-Id: I7f5d9471a7fde4dd01a02ce5f383ab931c47353f
Reviewed-on: https://gerrit.chromium.org/gerrit/48630
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>

11 years agoCHROMIUM: dma-buf/kds: allow KDS to be compiled out if dma-buf is enabled
Daniel Kurtz [Wed, 24 Apr 2013 04:27:38 +0000 (12:27 +0800)]
CHROMIUM: dma-buf/kds: allow KDS to be compiled out if dma-buf is enabled

The original KDS patches added CONFIG_DMA_SHARED_BUFFER_USES_KDS but
didn't use it to guard the kds integration into dma-bufs in a way
that would allow dma-buf to be built with KDS compiled without
requiring KDS.

Fix this by more carefully guarding the integration points, and not
unconditionally selecting KDS when dma-buf is enabled.

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium:232913
TEST=compile kernel for x86 and arm and verify it still boots

Change-Id: I878d1313ce6b43477fd6c87d394728283ad4f9e6
Reviewed-on: https://gerrit.chromium.org/gerrit/48608
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>

11 years agoUPSTREAM: staging: gdm72xx: cancel work when driver unloads
Devendra Naga [Sat, 13 Apr 2013 14:46:51 +0000 (20:16 +0530)]
UPSTREAM: staging: gdm72xx: cancel work when driver unloads

cancel the work function at driver unload stage and remove
the function from the queue

Cc: Ben Chan <benchan@chromium.org>
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c0352cb71d3d573a33af92d320f29f1c79d71b8b)

Change-Id: I8c4e522270b4acad07d125398b1afe4a14810f16
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49427
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: staging/gdm72xx: Remove duplicated code in gdm_qos.c
Peter Huewe [Tue, 19 Feb 2013 17:50:20 +0000 (18:50 +0100)]
UPSTREAM: staging/gdm72xx: Remove duplicated code in gdm_qos.c

The first branch of the if statement is ended with a return thus there
is no need for an else if, and thus we can move the duplicated code to
the top and use it for the other two branches.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d38529100d0f2e844df5f06d67dae8dd32086ec1)

Change-Id: I9ad27e507f0f66a821dd9c2327dc67cc69bc8a10
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49426
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: staging/gdm72xx: Remove unused variable in gdm_qos.c
Peter Huewe [Tue, 19 Feb 2013 17:50:19 +0000 (18:50 +0100)]
UPSTREAM: staging/gdm72xx: Remove unused variable in gdm_qos.c

len is never read after assignment, thus can be removed.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit eb986df15c86b66a51f6e82f4706bc825444670b)

Change-Id: I23e845226e446fb1cbc8568949be0d956baf350b
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49425
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: staging/gdm72xx: Include corresponding header file (fix sparse warning)
Peter Huewe [Tue, 19 Feb 2013 17:50:18 +0000 (18:50 +0100)]
UPSTREAM: staging/gdm72xx: Include corresponding header file (fix sparse warning)

sdio_boot.c and netlink_k.c both have a corresponding header file with
their function prototypes but fail to include them, which leads to the
following sparse warnings:
sdio_boot.c:135:5: warning: symbol 'sdio_boot' was not declared. Should it be static?
netlink_k.c:89:13: warning: symbol 'netlink_init' was not declared. Should it be static?
netlink_k.c:109:6: warning: symbol 'netlink_exit' was not declared. Should it be static?
netlink_k.c:114:5: warning: symbol 'netlink_send' was not declared. Should it be static?

-> Add the include files and silence the warning

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a6000538e402ef2479a16ff789059c78a152be9d)

Change-Id: Id26144d3d78f9a0de1be70e5f3a2bed1fccae25f
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49424
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoCHROMIUM: dts: spring: Explicitly disable unused LDOs
Todd Broch [Wed, 1 May 2013 02:01:12 +0000 (19:01 -0700)]
CHROMIUM: dts: spring: Explicitly disable unused LDOs

Some LDO's are enabled by default at poweron but unused in Spring.
This CL disables them explicitly.

Signed-off-by: Todd Broch <tbroch@chromium.org>
BUG=chrome-os-partner:19067
TEST=manual
  ldo_base=0x5e
  for ldo in 4 5 11 13 17 ; do
    echo -n "LDO${ldo}: "
    i2cget -y -f 0 0x66 $(($ldo_base + $ldo))
  done

LDO4: 0x04
LDO5: 0x04
LDO11: 0x14
LDO13: 0x14
LDO17: 0x28
Note all bits <7:6> are zero'd

Change-Id: I9e8f6966a0a573f622f86cd07aeb7d61e495db1b
Reviewed-on: https://gerrit.chromium.org/gerrit/49718
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
11 years agoCHROMIUM: md: dm-bootcache: reinitialize bio structure
Paul Taysom [Thu, 25 Apr 2013 00:19:58 +0000 (17:19 -0700)]
CHROMIUM: md: dm-bootcache: reinitialize bio structure

The bootcache code does multiple large reads and was reusing the bio structure.
Some device drivers appear to leave some clutter in the bio structure.
Between large reads, the bootcache now frees and reallocates the bio structure.

BUG=chrome-os-partner:18830
TEST=POWER-ESC-F3 with USB stick, several times.
Signed-off-by: Paul Taysom <taysom@chromium.org>
Change-Id: I5b835b5f0606f6eb4116fc9719d96a48d0155f57
Reviewed-on: https://gerrit.chromium.org/gerrit/49121
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Paul Taysom <taysom@chromium.org>
Commit-Queue: Paul Taysom <taysom@chromium.org>

11 years agoCHROMIUM: add warning test to /proc/breakme
Luigi Semenzato [Mon, 29 Apr 2013 17:10:25 +0000 (10:10 -0700)]
CHROMIUM: add warning test to /proc/breakme

This is mainly for testing the Chrome OS warning collection
and analysis tools.

BUG=chromium:227080
TEST=manually tested

Change-Id: I0a99d2f87cf1e1354a0feaf3cd5386396d7da381
Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49488
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoCHROMIUM: input: mouse - Fix trackpoint re-probe on resume.
Shawn Nematbakhsh [Thu, 25 Apr 2013 21:30:04 +0000 (14:30 -0700)]
CHROMIUM: input: mouse - Fix trackpoint re-probe on resume.

During suspend, power may be cut to the trackpoint. If so, the
trackpoint will automatically begin its power-on diagnostics upon being
re-powered. If trackpoint_reconnect is called before the diagnostics
complete, the probe ID command will be lost, and reconnect will fail.
This will lead to re-probe, which takes several seconds on Stout due to
the trackpoint / trackpad pass-through design.

The fix here is to make a second attempt if the initial commands on
reconnect fail, which should give the trackpoint enough time to come out
of power-on diagnostics.

TEST=suspend/resume test for 3000 iterations without re-enumeration.
BUG=chromium:220389

Change-Id: I1ff8d3accdde86184864915d540b870ed33feee4
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49228
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
11 years agoCHROMIUM: ath: Add ATH_DEFER_EEPROM_REGULATORY option
Paul Stewart [Thu, 25 Apr 2013 14:39:54 +0000 (07:39 -0700)]
CHROMIUM: ath: Add ATH_DEFER_EEPROM_REGULATORY option

Add option to disable the internal regulatory mask
sourced from EEPROM data.  This does not affect CRDA
regulatory operation, but nevertheless this option
should not be used by default.

Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium:218911
TEST=Recompile with and without flag, ensure EEPROM
regulatory still works with this change disabled using
world regulatory EEPROM card an "iw reg set" command.

Change-Id: I20de00c7c6ea57124df1da8b052e573920579614
Reviewed-on: https://gerrit.chromium.org/gerrit/49176
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
11 years agodrm/exynos: Add 1024x768/1280x800 HDMI resolutions
Sean Paul [Mon, 22 Apr 2013 17:00:11 +0000 (13:00 -0400)]
drm/exynos: Add 1024x768/1280x800 HDMI resolutions

This patch adds 1024x768 and 1280x800 HDMI resolutions by redistributing
vertical lines to the blanking period from the active area. The result
is that userspace is exposed resolutions which fit into the mixer's
scanning guidelines (720 lines), and the monitor thinks it's getting the
full monty. For example, 1024x768 looks like 1024x720 from userspace's
perspective, but 1024x768 from the monitor's perspective.

BUG=chromium:221411, chrome-os-partner:14238
TEST=Tested by hand with 1024x768

Change-Id: I6dcfe6260504e38aa604c5b19abc2bd716bbf729
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48830
Reviewed-by: Mark Hayter <mdhayter@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agogoogle memconsole: use ioremap_cache()
Aaron Durbin [Fri, 19 Apr 2013 15:35:04 +0000 (10:35 -0500)]
google memconsole: use ioremap_cache()

The memconsole code was using ioremap() which defaults to using
an uncacheable mapping. When using PAT this creates a PAT entry
as uncached-minus. When a userspace program, such as cbmem,
wants to mmap() the memory area not using O_SYNC by way of /dev/mem
it creates a conflicting entry and fails. Correct this situation
by using ioreamp_cache() becaus the cbmem memconsole lives in memory
that is just reserved from the OS -- not in mmio space.

BUG=None
BRANCH=None
TEST=Tested on Pixel with new cbmem utlity. No errors.

Change-Id: Iff8a160205bf59e4c4d0e9508832901f8dbd1cde
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48654

11 years agoCHROMIUM: config: Disable USB persist by default
Julius Werner [Wed, 24 Apr 2013 00:54:20 +0000 (17:54 -0700)]
CHROMIUM: config: Disable USB persist by default

We had it this way before, this is just part of a patch series to move
from our hardcoded hack to the new upstream Kconfig method.

BUG=None
TEST=None

Change-Id: Id67bc7b618547f16a209dbf12c4e1f9ce7bde279
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49016
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
11 years agoUPSTREAM: usb: Make USB persist default configurable
Julius Werner [Wed, 13 Mar 2013 22:57:31 +0000 (15:57 -0700)]
UPSTREAM: usb: Make USB persist default configurable

Commit 9214d1d8 set the USB persist flag as a default for all devices.
This might be desirable for some distributions, but it certainly has its
trade-offs... most importantly, it can significantly increase system
resume time, because the kernel blocks on resuming (and sometimes
resetting) USB devices before it unfreezes userspace.

This patch introduces a new config option CONFIG_USB_DEFAULT_PERSIST,
which allows distributions to make this decision on their own without
the need to carry a custom patch or revert the kernel's setting in
userspace.

[edited the Kconfig help text a bit - gregkh]

Signed-off-by: Julius Werner <jwerner@chromium.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 4f48203881ce947a0cbd8ae7b1a1a1b04aaa3766)
Cherry picked from upstream's gregkh/usb.git/usb-next

Conflicts:
    drivers/usb/core/Kconfig (trivial merge with old deprecated configs)
    drivers/usb/core/quirks.c (renamed USB_QUIRK_RESET to the older
            USB_QUIRK_RESET_MORPHS)

BUG=None
TEST=None

Change-Id: Ib63d2ed955e2916598d5ecd2d75aab9260594368
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49015
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
11 years agoRevert "CHROMIUM: Disable USB persist system-wide by default."
Julius Werner [Tue, 23 Apr 2013 23:46:30 +0000 (16:46 -0700)]
Revert "CHROMIUM: Disable USB persist system-wide by default."

This reverts commit c3d39c8b090f77d253ef70a6bc747e3bd095347c.

Turns out the Kconfig version of this change did get picked up by gregkh
upstream after all. So we can revert this and roll with the upstream
version instead.

BUG=None
TEST=None

Change-Id: I96f74c914c75bd3c9b8a7cde0d682de157ee3e10
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49014
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
11 years agoCHROMIUM: uvcvideo: Handle status_start while status_stop is in progress.
Shawn Nematbakhsh [Tue, 23 Apr 2013 22:50:23 +0000 (15:50 -0700)]
CHROMIUM: uvcvideo: Handle status_start while status_stop is in progress.

While usb_kill_urb is in progress, calls to usb_submit_urb will fail
with -EPERM (documented in Documentation/usb/URB.txt). The UVC driver
does not correctly handle this case -- there is no synchronization
between uvc_v4l2_open / uvc_status_start and uvc_v4l2_release /
uvc_status_stop.

This patch adds a retry / timeout when uvc_status_open / usb_submit_urb
returns -EPERM. This usually means that usb_kill_urb is in progress, and
we just need to wait a while.

BUG=chromium:226216
TEST=Manual. Repeat suspend / resume on Stout many times, verify that
open() on /dev/video0 never fails.

Change-Id: I8a69dab345a18c89e175bd916aa943edd080b6cc
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48982
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years ago[media] v4l2: mem2mem: save irq flags correctly
John Sheu [Wed, 17 Apr 2013 05:24:39 +0000 (22:24 -0700)]
[media] v4l2: mem2mem: save irq flags correctly

<NO UPSTREAM MERGE REQUIRED>

Save flags correctly when taking spinlocks in v4l2_m2m_try_schedule.

BUG=None
TEST=local build, run on CrOS snow

Change-Id: I1705c3466dde52db7021fe1e79aef0bba2d68367
Signed-off-by: John Sheu <sheu@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48347
Reviewed-by: Pawel Osciak <posciak@chromium.org>
11 years agoUPSTREAM: usb: dwc3: debugfs: fix regdump offset
Jack Pham [Mon, 10 Dec 2012 22:28:13 +0000 (14:28 -0800)]
UPSTREAM: usb: dwc3: debugfs: fix regdump offset

As with dwc_readl/writel, the global registers are specified as
offsets starting from the beginning of the xHCI address space,
but the memory region pointed to by dwc->regs already maps to
the start of the global addresses. Fix by offsetting each of the
regs relative to DWC3_GLOBALS_REGS_START.

Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit 1604c1e760119ab3fe9f71679ebaeb058d3d8ae1)
Cherry pick from Linus' tree, applied cleanly

BUG=chromium:229725
TEST='cat /sys/kernel/debug/dwc3.0/regdump' should not crash on Snow.

Change-Id: Ic58153b9c3f4135355094a5dc49ad0fabb2fcd25
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48554
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoBACKPORT: TPM: Retry SaveState command in suspend path
Duncan Laurie [Mon, 22 Apr 2013 21:01:49 +0000 (14:01 -0700)]
BACKPORT: TPM: Retry SaveState command in suspend path

If the TPM has already been sent a SaveState command before the driver
is loaded it may have problems sending that same command again later.

This issue is seen with the Chromebook Pixel due to a firmware bug in
the legacy mode boot path which is sending the SaveState command
before booting the kernel.  More information is available at
http://crbug.com/203524

This change introduces a retry of the SaveState command in the suspend
path in order to work around this issue.  A future firmware update
should fix this but this is also a trivial workaround in the driver
that has no effect on systems that do not show this problem.

When this does happen the TPM responds with a non-fatal TPM_RETRY code
that is defined in the specification:

  The TPM is too busy to respond to the command immediately, but the
  command could be resubmitted at a later time.  The TPM MAY return
  TPM_RETRY for any command at any time.

It can take several seconds before the TPM will respond again.  I
measured a typical time between 3 and 4 seconds and the timeout is set
at a safe 7 seconds.  (note: upstream is 5 seconds right now)

It is also possible to reproduce this with commands via /dev/tpm0.
The bug linked above has a python script attached which can be used to
test for this problem.  I tested a variety of TPMs from Infineon,
Nuvoton, Atmel, and STMicro but was only able to reproduce this with
LPC and I2C TPMs from Infineon.

The TPM specification only loosely defines this behavior:

  TPM Main Level 2 Part 3 v1.2 r116, section 3.3. TPM_SaveState:
  The TPM MAY declare all preserved values invalid in response to any
  command other than TPM_Init.

  TCG PC Client BIOS Spec 1.21 section 8.3.1.
  After issuing a TPM_SaveState command, the OS SHOULD NOT issue TPM
  commands before transitioning to S3 without issuing another
  TPM_SaveState command.

  TCG PC Client TIS 1.21, section 4. Power Management:
  The TPM_SaveState command allows a Static OS to indicate to the TPM
  that the platform may enter a low power state where the TPM will be
  required to enter into the D3 power state.  The use of the term "may"
  is significant in that there is no requirement for the platform to
  actually enter the low power state after sending the TPM_SaveState
  command.  The software may, in fact, send subsequent commands after
  sending the TPM_SaveState command.

BUG=chrome-os-partner:18686
TEST=originally tested on pixel for crbug.com/203524

Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
(backported from commit 32d33b29ba077d6b45de35f2181e0a7411b162f4)

Change-Id: I023103b69e5253dc98b289c25853104a08f4787f
Reviewed-on: https://gerrit.chromium.org/gerrit/48812
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Tested-by: Duncan Laurie <dlaurie@chromium.org>
Commit-Queue: Duncan Laurie <dlaurie@chromium.org>

11 years agov4l2: dequeue buffers properly on VIDIOC_STREAMOFF
John Sheu [Wed, 17 Apr 2013 05:04:18 +0000 (22:04 -0700)]
v4l2: dequeue buffers properly on VIDIOC_STREAMOFF

<UPSTREAM MERGE NOT REQUIRED>

Instead of just marking all buffers as dequeued on STREAMOFF, properly
dequeue them -- this will, most notably, make sure that any mapped
DMABUF buffers will be properly unmapped.

BUG=chromium:232121
TEST=local build, run on CrOS snow

Change-Id: Ide111378caa70cf603b3edec65b4dedd0f1e1ea0
Signed-off-by: John Sheu <sheu@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48346
Reviewed-by: Pawel Osciak <posciak@chromium.org>
11 years agoCHROMIUM: mkbp: Optimize ghosting algorithm.
Todd Broch [Fri, 19 Apr 2013 23:48:03 +0000 (16:48 -0700)]
CHROMIUM: mkbp: Optimize ghosting algorithm.

Previous algorithm was a bit conservative and complicating with
respect to identifying key ghosting.  This CL uses the bitops hamming
weight function (hweight8) to count the number of matching rows for
colM & colN.  If that number is > 1 ghosting is present.

Additionally it removes NULL keys and our one virtual keypress
KEY_BATTERY from consideration as these inputs are never physical
keypresses.

Signed-off-by: Todd Broch <tbroch@chromium.org>
BUG=chrome-os-partner:18354
TEST=manual
1. using evtest I now see ctrl-U
2. escape sequence ctrl-U correctly display 'webpage source'
3. w/ #define DEBUG in mkbp.c no longer see below when ctrl-U pressed
   chromeos-ec-i2c 4-001e: ghost found ...

Change-Id: Ifc98b527c3ee4daffa9d8c726429fdd1b35970fa
Reviewed-on: https://gerrit.chromium.org/gerrit/48789
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
11 years agoRevert "CHROMIUM: Strengthen ghosting algorithm."
Todd Broch [Fri, 19 Apr 2013 23:44:22 +0000 (16:44 -0700)]
Revert "CHROMIUM: Strengthen ghosting algorithm."

This reverts commit 688c20f457b6111755cf1f9f1b1472693a4a4ed9.

Change-Id: Ifd0e81a8ffe58bc6c9ebe2eb01345f7f65e360a1
Reviewed-on: https://gerrit.chromium.org/gerrit/48788
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
11 years agoRevert "WORKAROUND: mkbp: Remove KEY_BATTERY from valid keys."
Todd Broch [Fri, 19 Apr 2013 23:43:45 +0000 (16:43 -0700)]
Revert "WORKAROUND: mkbp: Remove KEY_BATTERY from valid keys."

This reverts commit 20dd2301234bc0f57018e4b51380e53f652ac30c.

This temporary workaround eliminated bug introduced by commit:
  688c20f CHROMIUM: Strengthen ghosting algorithm.

That CL introduced a bug where the virtual key, KEY_BATTERY, falsely
ghosted to a bunch of other key sequences.  That change is also being
reverted.

Change-Id: I6e8959595cba088e6a55d45311fbe9534f3c75f5
Reviewed-on: https://gerrit.chromium.org/gerrit/48787
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
11 years agoWORKAROUND: mkbp: Remove KEY_BATTERY from valid keys.
Todd Broch [Fri, 19 Apr 2013 17:49:02 +0000 (10:49 -0700)]
WORKAROUND: mkbp: Remove KEY_BATTERY from valid keys.

  While previous ghosting fix:
    688c20f CHROMIUM: Strengthen ghosting algorithm.

  Did help rule out null keys it was thought it would also correctly
  identify 3 vs. 4 keypresses (sharing row/col) regardless of whether
  key was virtual (KEY_BATTERY) or real.  It does not however.

  This change migrates KEY_BATTERY to invalid key while algorithm is
  further refined.

BUG=chrome-os-partner:18814
TEST=manual
boot Spring plugged after an EC reset and see no ghosting issues for
sequences ctrl + u|w|n|t

Change-Id: I1038a18c353e84a52ad77e44e497c747d310addf
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48674
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: ALSA: hda: cirrus: Add pin configs for lumpy.
Chih-Chung Chang [Fri, 19 Apr 2013 03:56:24 +0000 (11:56 +0800)]
CHROMIUM: ALSA: hda: cirrus: Add pin configs for lumpy.

The SPDIF output pin on lumpy is not connected, but the lumpy BIOS
doesn't set the config for it correctly.

The only difference between the new verbs here and the verbs in BIOS is
to specify the SPDIF output is not connected.

BUG=chromium:233458
TEST=install new kernel on lumpy, and use "aplay -l" to verify the
"Cirrus Digital" device is gone.

Change-Id: Iab087a33f4fde84c16d73b7054663d051fba7391
Signed-off-by: Chih-Chung Chang <chihchung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48610
Reviewed-by: Dylan Reid <dgreid@chromium.org>
11 years agoCHROMIUM: drm/exynos: Remove panel_ops->commit
Daniel Kurtz [Fri, 12 Apr 2013 06:47:37 +0000 (14:47 +0800)]
CHROMIUM: drm/exynos: Remove panel_ops->commit

The explicit panel_ops->commit() functions are really just doing what
DPMS(On) should be doing.  In fact, hdmi_commit literally gets called
twice in the mode_set path: once in DPMS(On) and again in the explicitly
by exynos_drm_encoder_commit().

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium:189108
TEST=Sanity check LCD display
TEST=Sanity check HDMI attached monitor at Boot
TEST=Sanity check HDMI attached monitor hotplug 2 times
TEST=run_remote_tests.sh --board=daisy --remote=${IP} power_Resume/control$

Change-Id: I07ce63255d5d209b127babd24213f70e42131185
Reviewed-on: https://gerrit.chromium.org/gerrit/47755
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
11 years agoCHROMIUM: signal: stop info leak via the tkill and the tgkill syscalls
Emese Revfy [Wed, 17 Apr 2013 19:03:26 +0000 (12:03 -0700)]
CHROMIUM: signal: stop info leak via the tkill and the tgkill syscalls

This fixes a kernel memory contents leak via the tkill and tgkill syscalls
for compat processes.

This is visible in the siginfo_t->_sifields._rt.si_sigval.sival_ptr field
when handling signals delivered from tkill.

The place of the infoleak:

int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
{
        ...
        put_user_ex(ptr_to_compat(from->si_ptr), &to->si_ptr);
        ...
}

Signed-off-by: Emese Revfy <re.emese@gmail.com>
Reviewed-by: PaX Team <pageexec@freemail.hu>
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org
BUG=chromium:223444
TEST=link build, PoC fails to show leaks

[ sent to lkml: http://marc.info/?l=linux-kernel&m=136622640810847&w=2 ]
Change-Id: If7603776a2f5dc28dceef4034f80b6979d18ca80
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48390
Reviewed-by: Will Drewry <wad@chromium.org>
11 years agoCHROMIUM: config: enable errata 798181
Olof Johansson [Tue, 16 Apr 2013 22:16:17 +0000 (15:16 -0700)]
CHROMIUM: config: enable errata 798181

BUG=chromium:226280
TEST=none

Change-Id: Ifdfd073d93b02c3007233bdc91f11a2f7e861ceb
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48273
Reviewed-by: Doug Anderson <dianders@chromium.org>
11 years agoBACKPORT: r8169: fix auto speed down issue
hayeswang [Sun, 31 Mar 2013 17:02:04 +0000 (17:02 +0000)]
BACKPORT: r8169: fix auto speed down issue

It would cause no link after suspending or shutdowning when the
nic changes the speed to 10M and connects to a link partner which
forces the speed to 100M.

Check the link partner ability to determine which speed to set.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e2409d83434d77874b461b78af6a19cd6e6a1280)

BUG=chrome-os-partner:18211.
TEST=manual. Test ethernet plug/unplug, verify link status detection.

Change-Id: I3166710a102ab9c2aef6590717d500c02fca3cac
Reviewed-on: https://gerrit.chromium.org/gerrit/48361
Tested-by: Bowgo Tsai <bowgotsai@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Bowgo Tsai <bowgotsai@chromium.org>

11 years agoCHROMIUM: config: re-sync kernel config
Olof Johansson [Tue, 16 Apr 2013 22:15:27 +0000 (15:15 -0700)]
CHROMIUM: config: re-sync kernel config

TBR=sonnyrao,dianders
BUG=none

Change-Id: I60be015dc64c639ef5715b256a3d55298cdafdd7
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48272
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Commit-Queue: Sonny Rao <sonnyrao@chromium.org>

11 years agoBACKPORT: ASoC: max98088: Fix logging of hardware revision.
Dylan Reid [Wed, 17 Apr 2013 03:02:34 +0000 (20:02 -0700)]
BACKPORT: ASoC: max98088: Fix logging of hardware revision.

The hardware revision of the codec is based at 0x40.  Subtract that
before convering to ASCII.  The same as it is done for 98095.

BUG=chrome-os-partner:18551
TEST=check dmesg and see revision = 'A'

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
(cherry picked from commit 98682063549bedd6e2d2b6b7222f150c6fbce68c)

Change-Id: I942d832bceb9c42370a0dd8364040b157d7ffd77
Reviewed-on: https://gerrit.chromium.org/gerrit/48462
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
11 years agoRaises the limit of number of decodes in mfc_dec.
Owen Lin [Wed, 3 Apr 2013 07:26:48 +0000 (15:26 +0800)]
Raises the limit of number of decodes in mfc_dec.

BUG=chromium:221501
TEST=Run a modified video_decode_accelerator_unittest on daisy and link

Signed-off-by: Owen Lin <owenlin@chromium.org>
Change-Id: If047c5aee937c51cbe57bda4a1b5feca975e9b12
Reviewed-on: https://gerrit.chromium.org/gerrit/48215
Reviewed-by: John Sheu <sheu@chromium.org>
Tested-by: Owen Lin <owenlin@chromium.org>
Commit-Queue: Owen Lin <owenlin@chromium.org>

11 years agoCHROMIIM: ALSA: hda/ca0132 - Add AEC level control.
Chee Kin Cheong [Mon, 15 Apr 2013 22:25:49 +0000 (15:25 -0700)]
CHROMIIM: ALSA: hda/ca0132 - Add AEC level control.

When tuning controls are enabled, export a control to tune the level
of the echo canceller running on the ca0132 DSP.

Change-Id: Ie7717e88c8f5f10dc159f978f8fa5bff77e2a709
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48166
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
11 years ago[media] s5p-mfc: Fix frame skip bug
John Sheu [Wed, 27 Feb 2013 23:18:15 +0000 (15:18 -0800)]
[media] s5p-mfc: Fix frame skip bug

The issue was seen in VP8 decoding where the last frame was
skipped by the driver. This patch gets the correct frame_type value
to fix the bug.

Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Arun Mankuzhi <arun.m@samsung.com>
BUG=220645

Change-Id: I1784803e3b692afa22d4aa8c966c9f325a20aafd
Reviewed-on: https://gerrit.chromium.org/gerrit/44437
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>

11 years agoCHROMIUM: Strengthen ghosting algorithm.
Todd Broch [Tue, 26 Mar 2013 22:53:49 +0000 (15:53 -0700)]
CHROMIUM: Strengthen ghosting algorithm.

Previous commit added the interpretation of the virtual keystroke from
EC's MKBP, KEY_BATTERY, to allow EC to signal change in USB power for
Spring.

While the edit did address suppressing the input event the virtual
keystroke still plays into the ghosting calculation.  This exposed
that the ghosting algorithm was too conservative as ctrl + u +
KEY_BATTERY triggered ghosting logic.

New algorithm correctly identifies all ghosting (3 or more) keystrokes
by factoring in whether the ghost key is valid.

Signed-off-by: Todd Broch <tbroch@chromium.org>
BUG=chrome-os-partner:18354
TEST=manual
1. using evtest I now see ctrl-U
2. escape sequence ctrl-U correctly display 'webpage source'
3. w/ #define DEBUG in mkbp.c no longer see below when ctrl-U pressed
   chromeos-ec-i2c 4-001e: ghost found at: r7 c6, pressed 2, teeth 0x4

Change-Id: I693bee2d0e54081c267f449f4b2c7f20a20749ff
Reviewed-on: https://gerrit.chromium.org/gerrit/46585
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
11 years agoCHROMIUM: chromeos_laptop: Add MODULE_DEVICE_TABLE
Benson Leung [Wed, 30 Jan 2013 00:23:05 +0000 (16:23 -0800)]
CHROMIUM: chromeos_laptop: Add MODULE_DEVICE_TABLE

If chromeos_laptop is built as a module, this will register
this driver as handling the various systems by dmi match,
so input devices, light sensors, and keyboard backlight are
still autoloaded on boot.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:38363
TEST=Modify chromeos/config/x86_64/common.config to set
CONFIG_CHROMEOS_LAPTOP=m
build, load this kernel and modules onto Lumpy.
Check that on boot, trackpad works without modprobing
for chromeos_laptop.

Change-Id: Ib0a8f2b1228fc208e17c716d545818ab8b823952
Reviewed-on: https://gerrit.chromium.org/gerrit/42269
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
11 years agoCHROMIUM: drm/exynos: hdmi: remove unused enabled variable
Daniel Kurtz [Wed, 10 Apr 2013 17:43:28 +0000 (01:43 +0800)]
CHROMIUM: drm/exynos: hdmi: remove unused enabled variable

It is set but never checked.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium:189108
TEST=builds clean

Change-Id: I60c98a41138d5ae5c7d2876abd02b0cb8b3f57b8
Reviewed-on: https://gerrit.chromium.org/gerrit/47754
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>

11 years agoCHROMIUM: drm/exynos: Always DPMS Off in encoder prepare and train dp link in DPMS On
Daniel Kurtz [Wed, 10 Apr 2013 17:42:06 +0000 (01:42 +0800)]
CHROMIUM: drm/exynos: Always DPMS Off in encoder prepare and train dp link in DPMS On

In drm_crtc_helper_set_mode(), the basic sequence for encoders and crtcs
is:
->prepare()
->mode_set()
->commit()

For other drm drivers, .prepare does dpms(Off), and .commit does dpms(On).
Thus, the intention is for the .mode_set() callback is supposed to operate properly
in the dpms(Off) state.

For some reason, exynos was not doing dpms(Off) in .prepare, but it was
doing the dpms(On) in .commit, before calling an explicit
panel_ops->commit().

However, the dpms(On) in encoder .commit() never actually does anything,
since the .dpms routines call power on/off routines that are smart and
silently ignore requests that don't change the power state.
In particular, this dpms(On) wasn't able to actually commit changes,
such as enabling video and training the DP link.  Instead, we were
essentially relying on a explicit call to panel_ops->commit() in
encoder->commit() to do the commit.

Also, this means that when exynos_drm_encoder_mode_set calls
panel_ops->set_mode(), the current dpms/power state is whatever it was
before the call to drm_crtc_helper_set_mode().  This is almost always
DPMS(On).

DP link training uses the AUX channel which is only available when
DPMS(On).  A recent change to the dp driver to move link training to the
dp panel_ops->mode_set() seemed to work because, as noted above, we are
almost always in DPMS(On) for DP when we do mode_sets.

There is, however, one exception.  It is possible for userspace to explicit
turn DPMS(Off) the DP pipe.  To save power, for instance.  If this is
followed by a suspend/resume cycle, the resume path, will end up
calling DP mode_set() with dpms(Off).  This causes a soft lockup since the
AUX channel is not enabled when we try to do link training.

Instead, we just always do DPMS(Off) in .prepare(), get rid of the
explicit DP mode_set(), and let the encoder .commit call our DPMS(On)
which will train the link.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium:189108
TEST=(1) On daisy:
  set_short_powerd_timeouts ; echo 1 > /var/lib/power_manager/disable_idle_suspend
  wait ~20 seconds for powerd to turn off the LCD
  ./run_remote_tests.sh --board=daisy --remote=$IP power_Resume/control$
TEST=(2) Same as (1) but with HDMI monitor attached too
  => In this case powerd will switch to "presentation mode", so the turn
   LCD off time is ~45 seconds (and it takes two timeouts).
TEST=(3) suspend_stress_test   should survive even after LCD powers off

Change-Id: I3cd09d5b9555a9e05efc5a66478ab86f2216fc6b
Reviewed-on: https://gerrit.chromium.org/gerrit/47753
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>

11 years agoCHROMIUM: config: disable OABI support for exynos platforms
Mike Frysinger [Thu, 11 Apr 2013 18:03:45 +0000 (14:03 -0400)]
CHROMIUM: config: disable OABI support for exynos platforms

We've never shipped a device with userland code using OABI afaik, so
this is enabling code paths that is purely bloat.  Disable it like we
have for all other arm platforms.

BUG=None
TEST=`emerge-daisy chromeos-kernel` works and doesn't have OABI enabled
Change-Id: Ie8a67b3db7faba3ac430e1de678e60b1fba1ffb5
Signed-off-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47911
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoCHROMIUM: drm/i915: repin bound framebuffers on resume
Stéphane Marchesin [Fri, 12 Apr 2013 00:23:44 +0000 (17:23 -0700)]
CHROMIUM: drm/i915: repin bound framebuffers on resume

During suspend/resume all fences are reset, including their pin
count which is reset to 0. However a framebuffer can be bound across
suspend/resume, which means that after the buffer is unbound on
resume, the pin count for the buffer will be negative. Since the
fence pin count is now negative when available and zero when in use,
the buffer's fence will get recycled when the fence is in use which
is the opposite of what we want. The adverse effect is that since the
fence is recycled the tiling mode goes away while the buffer is being
displayed and we get lines/screens of garbage.

To fix this, we reallocate and repin the fences for all bound fbs on
resume, which ensures the pin count is right.

BUG=chromium:219172,chromium:225056
TEST=by hand, suspend/resume on alex, the artifacts are gone

Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Change-Id: I9113078b0eb56e671dcca8dc9557a0c0c37f12e0
Reviewed-on: https://gerrit.chromium.org/gerrit/47933

11 years agoCHROMIUM: config: turn off KDS and dma-buf on x86 systems
Sonny Rao [Wed, 10 Apr 2013 22:11:10 +0000 (15:11 -0700)]
CHROMIUM: config: turn off KDS and dma-buf on x86 systems

This is only required for Exynos based systems and makes no sense on
x86.  This should save some memory.

BUG=none
TEST=kernel builds, boots on lumpy

Change-Id: I929f4205c2c050dab070311e577b88d8c2e1a7fe
Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47784
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoCHROMIUM: config: disable rfkill
Mandeep Singh Baines [Wed, 10 Apr 2013 22:38:31 +0000 (15:38 -0700)]
CHROMIUM: config: disable rfkill

We don't use rfkill in ChromeOS.

The rfkill_poll causes 1 wakeup / 5 seconds / per device.

BUG=chromium:227114
TEST=More details in the bug.
TEST=But I verified that wifi still works and verified that wakeups are reduced.

Change-Id: I92aa7fe4e0dbf806fb63ead7f3ba883f79a1a213
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47808
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
11 years agoCHROMEOS: HACK: Work around bluetooth kernel panic.
Andrew de los Reyes [Tue, 9 Apr 2013 16:21:10 +0000 (09:21 -0700)]
CHROMEOS: HACK: Work around bluetooth kernel panic.

This patch is originally from Doron Keren <doronkeren@ti.com>
http://www.spinics.net/lists/linux-bluetooth/msg15564.html . Original
description:

The patch fixes kernel panic which is due to race condition
between the setup of incomming connection and clean-up of the
dead one. Observed in the following case: attached HID device
disconnects unexpectedly (without performing ACL disconnect ),
the device tries to connect again before the ACL link time-out
fires, this translates to the HCI_DISCONNECT, HCI_CONNECT_REQ
events on the same handle, since HCI_DISCONNECT trigers the clean
up of the HID device and handled in different context, the
linking/unlinking connection object to sysfs, may mess up.

BUG=chromium:228937

TEST=The following used to cause a panic reliably, but now doesn't:
- have Apple Magic Trackpad connected and working
- sleep/wake computer
- immediately click/rub fingers on trackpad

Change-Id: I63e0e37afe572641d7bda593887d2e3269043b5a
Signed-off-by: Ilia Kolominsky <iliak@ti.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/47653
Reviewed-by: Grant Grundler <grundler@chromium.org>
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
11 years agoAdjust the MIF ASV logic to set the voltage to either ASV group
Bernie Thompson [Wed, 10 Apr 2013 18:40:34 +0000 (11:40 -0700)]
Adjust the MIF ASV logic to set the voltage to either ASV group

In the case the U-Boot sets the MIF voltage to 1.05v we need to set the
MIF voltage to the 1.00v if the MIF ASV group allows for it. In this case
we can now handle either MIF ASV voltage setting used by U-Boot.

BUG=chrome-os-partner:16895
TEST=Manual, run new kernel on DUT, verify MIF voltage.

Change-Id: I589844034889f0e9ddd55a62226dd4963a4d0eb4
Signed-off-by: Bernie Thompson <bhthompson@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47757

11 years agoCHROMIUM: md: dm-verity fixed setting error_behavior
Paul Taysom [Wed, 10 Apr 2013 17:03:40 +0000 (10:03 -0700)]
CHROMIUM: md: dm-verity fixed setting error_behavior

Need to be able to set the error behavior from either the device table
or from the linux command line.

The code only handled setting from the linux command line which
broke the platform_DMVetiryCorruption test. This was not noticed
earlier because of another bug in error handling that was just
recently was fixed which exposed this problem.

Now the code defaults to the command line but overrides from
the device table.

BUG=chromium:229621
TEST=platform_DMVerityCorruption
Signed-off-by: Paul Taysom <taysom@chromium.org>
Change-Id: I32a516deb2bd564b599e73177e479cddec789dfb
Reviewed-on: https://gerrit.chromium.org/gerrit/47744
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Commit-Queue: Paul Taysom <taysom@chromium.org>

11 years agoBACKPORT: arm: errata: Workaround for Cortex-A15 erratum 798181 (TLBI/DSB operations)
Catalin Marinas [Fri, 5 Apr 2013 16:24:56 +0000 (09:24 -0700)]
BACKPORT: arm: errata: Workaround for Cortex-A15 erratum 798181 (TLBI/DSB operations)

On Cortex-A15 (r0p0..r3p2) the TLBI/DSB are not adequately shooting down
all use of the old entries. This patch implements the erratum workaround
which consists of:

1. Dummy TLBIMVAIS and DSB on the CPU doing the TLBI operation.
2. Send IPI to the CPUs that are running the same mm (and ASID) as the
   one being invalidated (or all the online CPUs for global pages).
3. CPU receiving the IPI executes a DMB and CLREX (part of the exception
   return code already).

The switch_mm() code includes a DMB operation since the IPI is only sent
to CPUs running the same ASID.

BUG=chromium:226280
TEST=There's unfortunately no simple test to trigger this bug, since it
normally manifests vaguely by random crashes or bad data later during
runtime. General testing to make sure it doesn't add new problems (i.e,
BVT, regression suites) is the best approach, followed by observations
of crash rates from the field.

Change-Id: I8fa68bdac9594a90d29079244efa93750f4319e3
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47427
Reviewed-by: Doug Anderson <dianders@chromium.org>
11 years agoRevert "UPSTREAM: ARM: Remove current_mm per-cpu variable"
Olof Johansson [Fri, 5 Apr 2013 17:08:36 +0000 (10:08 -0700)]
Revert "UPSTREAM: ARM: Remove current_mm per-cpu variable"

This originally removed some not-needed code, but the recent A15 errata
workaround actually needs current_mm still around. So for bring this
code back for that reason.

This reverts commit 696cfa01f12ec85ac7122eb57d77c8598f79ff71.

BUG=chromium:226280
TEST=build kernel for daisy

Change-Id: Ie44c6bfea7137ca185eb568f9047bca39f3e1b5c
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47426
Reviewed-by: Doug Anderson <dianders@chromium.org>
11 years agomwifiex: remove redundant initialization for bss_descriptor
Bing Zhao [Tue, 9 Apr 2013 21:23:29 +0000 (14:23 -0700)]
mwifiex: remove redundant initialization for bss_descriptor

Initialization of bss_descriptor is unnecessary as the entire
structure will be overwritten by a memcpy.

BUG=chrome-os-partner:18602
TEST=able to associate to AP with and without
slub_debug=FZPUA kernel option.

Change-Id: I4e8cecbf862b75f94fa717007111d0d9f9c0a2e3
Reported-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/47690
Reviewed-by: Doug Anderson <dianders@chromium.org>
11 years agomwifiex: fix use-after-free in beacon_ie processing
Bing Zhao [Tue, 9 Apr 2013 00:55:58 +0000 (17:55 -0700)]
mwifiex: fix use-after-free in beacon_ie processing

beacon_ie buffer is allocated in mwifiex_fill_new_bss_desc()
and the buffer pointer is saved in bss_desc->beacon_buf.

beacon_ie is freed before the function returns. However,
bss_desc->beacon_buf is still being accessed afterwards.

Fix it by allocating and freeing the beacon_ie buffer in
caller's scope.

BUG=chrome-os-partner:18602
TEST=able to associate to AP with and without
slub_debug=FZPUA kernel option.

Change-Id: If6ba90dc3a6d6890a4c891a0c4ab06d46f8cdcc9
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/47621
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
11 years agoAdd fallback power config values for Atmel T7
Charlie Mooney [Mon, 8 Apr 2013 17:16:36 +0000 (10:16 -0700)]
Add fallback power config values for Atmel T7

On suspend the atmel driver backs up the power configuration (T7) so
that it can restore it later on resume.  If the i2c transaction fails
when it's trying to read the current T7 config it sets a flag saying
that it was unable to back up the config, and then won't try to restore
it when the machine resumes.

A problem occurs if the i2c transaction to read the current config to
back it up on suspend fails, but the driver is still able to turn off
the touchpad.  Then on resume, it sees that it had failed to backup the
old values and never restores the T7 object.  As a result the
touchscreen/pad never wakes up.

Suspend:
 1) Read current T7 config and back it up
 2) Overwrite current config with suspend config
Resume
 3) restore value stored in step 1

So if step 1 fails, but step 2 succedes we run into a dead touch device
on resume.  Reboot fixes everything, however.

This patch adds in some default values in the event that a failed backup
config is detected and makes sure the device actually gets turned on no
matter what on resume.

BUG=chrome-os-partner:17621
TEST=manually tested on Link

Change-Id: I325efae0eb2d801d07898ad29a09e3162e5b79e5
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47564
Reviewed-by: Yufeng Shen <miletus@chromium.org>
11 years agoCHROMIUM: ALSA: hda/realtek - Check mic jack state when headphone jack state changes.
Chih-Chung Chang [Wed, 3 Apr 2013 08:39:12 +0000 (16:39 +0800)]
CHROMIUM: ALSA: hda/realtek - Check mic jack state when headphone jack state changes.

Usually the mic jack state changes will generate an unsol mic event,
and we can do auto-mic-switching at that time. But if the mic jack state
is gated by the headphone jack state, there may be no unsol mic event,
and we need to do auto-mic-switching in the unsol headphone event handler.

BUG=chromium:221938
TEST=plug/unplug 3.5mm headset and observe the capture source is switched correctly.
Signed-off-by: Chih-Chung Chang <chihchung@chromium.org>
Change-Id: If057cc20b951fff05af1d6842cbc8e197a93a3f3
Reviewed-on: https://gerrit.chromium.org/gerrit/47231

11 years agoCHROMIUM: md: dm-verity: error handling for bad block
Paul Taysom [Wed, 27 Mar 2013 17:59:26 +0000 (10:59 -0700)]
CHROMIUM: md: dm-verity: error handling for bad block

In the legacy version of dm-verity, verity_error handled
many different errors. Now it only has to handle bad
hash errors. Simplified to the code to handle only that
case.

BUG=chromium:222545
TEST=./run_remote_tests.sh --board=$B --remote=$IP platform_CorruptRootfs/control

Change-Id: Iaef19a17bd46429cae3589096a8b21ea2d6b70b7
Signed-off-by: Paul Taysom <taysom@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46652

11 years agoCHROMIUM: md: dm-verity: call to verity_error missing
Paul Taysom [Mon, 25 Mar 2013 02:58:17 +0000 (19:58 -0700)]
CHROMIUM: md: dm-verity: call to verity_error missing

The code path going through verity_work, was not calling
verity_error. This meant invalid block errors were not
being passed to the verity-chromeos error handler.

BUG=chromium:222545
TEST=manually corrupt root file system, reboot

Change-Id: I1f1c81feccc6ca5654dc81de3edfc97f240bea01
Signed-off-by: Paul Taysom <taysom@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46376
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>