cascardo/linux.git
11 years agoCHROMIUM: exynos: dts: do not use external PLL for USB3 on Spring
Vincent Palatin [Tue, 27 Nov 2012 00:17:06 +0000 (16:17 -0800)]
CHROMIUM: exynos: dts: do not use external PLL for USB3 on Spring

Move the enable gpio configuration for the USB3 PLL to the machine
device tree files, and do not define it on Spring, so the dwc3 driver
assumes that we only use the internal clock.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:16351
TEST=on Spring, plug on usb key on USB3 port and browse the content.

Change-Id: If8f91a34a0cadedada2ad627681a7fe83a6e5c12
Reviewed-on: https://gerrit.chromium.org/gerrit/38685
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>

11 years agodrm/exynos: do not support CONTIG gem buffer allocation
Prathyush K [Mon, 19 Nov 2012 07:36:54 +0000 (13:06 +0530)]
drm/exynos: do not support CONTIG gem buffer allocation

Currently, drm framework only supports allocation and mapping of
non-contig gem buffers. In the next versions of drm (v3.7),
this option to choose contig/non-contig is not supported. So for now,
we just return error in case user asks for contig gem buffers.

BUG=chrome-os-partner:15569
TEST=Built kernel and booted on snow.

Change-Id: Ibb164e812f4d175b6601145dffab1aaec28de4f5
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/38291
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Akshu Agrawal <akshu@chromium.org>
11 years agoUPSTREAM: perf tools: do not flush maps on COMM for perf report
Luigi Semenzato [Tue, 21 Aug 2012 21:52:20 +0000 (14:52 -0700)]
UPSTREAM: perf tools: do not flush maps on COMM for perf report

This fixes a long-standing bug caused by the lack of separate COMM and EXEC
record types, which makes "perf report" lose track of symbols when a process
renames itself.

With this fix (suggested by Stephane Eranian), a COMM (rename) no longer
flushes the maps, which is the correct behavior.  An EXEC also no longer
flushes the maps, but this doesn't matter because as new mappings are created
(for the executable and the libraries) the old mappings are automatically
removed.  This is not by accident: the functionality is necessary because DLLs
can be explicitly loaded at any time with dlopen(), possibly on top of existing
text, so "perf report" handles correctly the clobbering of new mappings on top
of old ones.

An alternative patch (which I proposed earlier) would be to introduce a
separate PERF_RECORD_EXEC type, but it is a much larger change (about 300
lines) and is not necessary.

Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Stephane Eranian <eranian@google.com>
Acked-by: Stephane Eranian <eranian@google.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Olof Johansson <olofj@chromium.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Robert Richter <robert.richter@amd.com>
Cc: Sonny Rao <sonnyrao@chromium.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Stephen Wilson <wilsons@start.ca>
Cc: Tejun Heo <tj@kernel.org>
Cc: Vasiliy Kulikov <segoon@openwall.com>
Link: http://lkml.kernel.org/r/1345585940-6497-1-git-send-email-semenzato@chromium.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from commit 9fdbf671ba7e8adb2cbb93d716232ebcab55f6bd)

BUG=chromium-os:26115
TEST=manual (see bug/original commit in 3.0)

Change-Id: Ie1fe97535430a989c3c925b30aa90e462e6eb37d
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38676
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
11 years agodrm/exynos: dp: Reduce video stream detection time
Sean Paul [Wed, 21 Nov 2012 17:38:40 +0000 (12:38 -0500)]
drm/exynos: dp: Reduce video stream detection time

Reduce the time we take for video stream detection by removing the
"done_count" wait of 1.1s since it's not blocking anything from
happening.

Also replace the msleep(100) with a usleep_range since we don't need to
wait 100ms to retry the detection.

BUG=chrome-os-partner:15261
TEST=Tested on snow, display on time reduced from 1.3s to 90ms

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: Ib4ef14352256b6b6627a3dff8bf77db2f368e547
Reviewed-on: https://gerrit.chromium.org/gerrit/38470
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agowatchdog: s3c2410: Avoid excessive petting during cpufreq
Doug Anderson [Fri, 7 Sep 2012 18:12:01 +0000 (11:12 -0700)]
watchdog: s3c2410: Avoid excessive petting during cpufreq

On more modern Samsung SoCs (like exynos5) the watchdog is
parented on a clock that doesn't change.  Avoid all of the extra
petting, disabling, and re-enabling of the watchdog in the case
that the clock never changes.

NOTE: As pointed out in
  <https://gerrit.chromium.org/gerrit/#/c/31465/>

...the proper way would be to register a notifier for the clock
directly, but CONFIG_COMMON_CLK isn't enabled.

BUG=chrome-os-partner:9403
TEST=If I open /dev/watchdog now it eventually dies.

Change-Id: I4f982dc85caf091444633aff94b90d524bdfe829
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32566
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Grant Grundler <grundler@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Tested-by: Grant Grundler <grundler@chromium.org>
11 years agoCHROMIUMOS: mwifiex: Disable transmit aggregation
Paul Stewart [Wed, 21 Nov 2012 22:28:44 +0000 (14:28 -0800)]
CHROMIUMOS: mwifiex: Disable transmit aggregation

Disable requesting transmit aggregation.  In situations where
the firmware receives a particular type of ADDBA response, it
enters a Block-Ack-Request loop and no further frames are
transmitted.  Until this larger issue is addressed, we cannot
safely request aggregation.

Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chrome-os-partner:12192
TEST=Associate with modified mac80211-based AP which returns
a Block-Ack-ADDBA response with only 1 buffer allowed.

Change-Id: Icb532a118bb90eca867784fd9b05bf850404e974
Reviewed-on: https://gerrit.chromium.org/gerrit/38483
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
11 years agoCHROMIUM: gobi: Fix qcusbnet leak in devqmi_open
Michael Spang [Tue, 13 Nov 2012 23:13:42 +0000 (18:13 -0500)]
CHROMIUM: gobi: Fix qcusbnet leak in devqmi_open

We're taking a reference to qcusbnet in devqmi_open and not releasing
it in the error path. This plugs that leak.

BUG=chrome-os-partner:16158
TEST=suspended the machine a few times, started and stopped cromo

Change-Id: I729aa5160baa4a64beaa1b7b92ac39e35319f799
Signed-off-by: Michael Spang <spang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37953
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: gobi: Fix qcusbnet leak in QMI_CLOSE ioctl
Michael Spang [Tue, 13 Nov 2012 23:13:42 +0000 (18:13 -0500)]
CHROMIUM: gobi: Fix qcusbnet leak in QMI_CLOSE ioctl

The handle cleanup path in the QMI_CLOSE ioctl leaks a reference to
qcusbnet (taken in devqmi_open). This patch unifies that cleanup code
with the code from devqmi_release and fixes the leak.

BUG=chrome-os-partner:16158
TEST=suspended the machine a few times, started and stopped cromo

Change-Id: I970a20fd67ebf8d1e65526ccca41f13c2aa97b44
Signed-off-by: Michael Spang <spang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37955
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
11 years agoCHROMIUM: gobi: Remove leaky replacement of fops in devqmi_write
Michael Spang [Wed, 14 Nov 2012 22:14:51 +0000 (17:14 -0500)]
CHROMIUM: gobi: Remove leaky replacement of fops in devqmi_write

The devqmi_write function sometimes overwrites devqmi_fops with
def_chr_fops. When that happens, the devqmi_fops reference is leaked,
and the file is never cleaned up because devqmi_release is not called.

It's not clear what this is for, and it looks like the other file
callbacks already check device_valid() before doing anything.
Therefore we can probably just remove this.

BUG=chrome-os-partner:16158
TEST=suspend_stress_test; stop cromo; cat /sys/module/gobi/refcnt

Change-Id: Ie8aecf98784165629864c90b60ee1c20d2106bef
Signed-off-by: Michael Spang <spang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38058
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
11 years agodrm/exynos: Clean up fimd mode handling
Sean Paul [Tue, 20 Nov 2012 15:56:54 +0000 (10:56 -0500)]
drm/exynos: Clean up fimd mode handling

FIMD has been using the panel timing data straight from the driver's
platform data instead of the data that is provided via the drm layer.
This makes things difficult if we want to use EDID data from the dp
driver, since it would be ignored. This patch changes FIMD to just
use the platform panel data as a seed to get_panel. From then on, we use
the overlay data that is set via modeset.

This patch also removes the panel array, since we only want one
resolution from platform data.

BUG=chrome-os-partner:11158
TEST=Tested on snow, no regressions noted

Change-Id: I345c3663509e6820a745b85c4b9a37f77f42c0d2
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38409
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agodrm/exynos: dp: Check hp gpio in hp detect function
Sean Paul [Mon, 19 Nov 2012 19:49:29 +0000 (14:49 -0500)]
drm/exynos: dp: Check hp gpio in hp detect function

Check the hotplug gpio in the hpd function so we know when it's
asserted. This fixes the return value of the is_connected callback.

BUG=chrome-os-partner:16280
TEST=None

Change-Id: I1ab0c7d830ecdc7b7f38ffd81895038978e4e57a
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38319
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agodrm/i2c: ptn3460: Add dev node check to ready wait
Sean Paul [Mon, 19 Nov 2012 19:41:09 +0000 (14:41 -0500)]
drm/i2c: ptn3460: Add dev node check to ready wait

Check for the ptn dev node in the ready wait function to avoid blocking
boards without ptn for 30 seconds.

BUG=chrome-os-partner:16280
TEST=None

Change-Id: I0057e7b72d9841447a56167617b9f081f5bbbe18
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38317
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: config: Add RT2800USB module
Paul Stewart [Wed, 24 Oct 2012 23:03:04 +0000 (16:03 -0700)]
CHROMIUM: config: Add RT2800USB module

Add support for the RT2800 USB WiFi device.

Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:35699
TEST=Boot system, do "ifconfig"
CQ-DEPEND=Iea82c1e6b1d7f9c5181cef11fcf25a5ee2da114b

Change-Id: Ic02543da81191c8e6bf39e9e90d8fc2c86128b39
Reviewed-on: https://gerrit.chromium.org/gerrit/36834
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
11 years agodrm/exynos: Let drm handle edid allocations
Sean Paul [Tue, 20 Nov 2012 19:19:00 +0000 (14:19 -0500)]
drm/exynos: Let drm handle edid allocations

There's no need to allocate edid twice and do a memcpy when drm helpers
exist to do just that. This patch cleans that interaction up, and
doesn't keep the edid hanging around in the connector.

BUG=chromium-os:36513
TEST=Tested on snow boot/hotplug/idle suspend/lid suspend

Change-Id: Ifb971a7a6c6ae66ce431b9a256886d9699adbd09
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38406

11 years agodrm/exynos: Add drm notification of hotplug to dp
Sean Paul [Tue, 20 Nov 2012 15:55:18 +0000 (10:55 -0500)]
drm/exynos: Add drm notification of hotplug to dp

Instead of polling the connector for hotplug, use the hotplug workqueue
to fire a drm hotplug notification when we detect a cable change.

This will also update userspace when the state has changed, and notify
fbdev.

At this point in time, the patch should be a no-op, but it's important
if we want to use EDID to mode set.

BUG=chrome-os-partner:11158
TEST=Tested on snow, no regressions detected

Change-Id: Ib6b0c789f6abc45a118a04dcb8a73e8e35fd4a85
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38408
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoRevert "DRM/exynos: Fix Memory Leak: free EDID block returned by drm_get_edid()."
Sean Paul [Tue, 20 Nov 2012 19:33:09 +0000 (11:33 -0800)]
Revert "DRM/exynos: Fix Memory Leak: free EDID block returned by drm_get_edid()."

This reverts commit e04984d087c95d7dd09be7cb6cb84e1f339c4f17. The patch causes kernel panic since it frees that memory twice once in the panel_op, and then again in the connector function.

Change-Id: I26173e1664733acea4abad9a731c4f7d98efe18a
Reviewed-on: https://gerrit.chromium.org/gerrit/38405
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Sean Paul <seanpaul@chromium.org>
Tested-by: Sean Paul <seanpaul@chromium.org>
11 years agoCHROMIUM: platform: rename nvram to vbc
Che-Liang Chiou [Fri, 9 Nov 2012 01:34:50 +0000 (17:34 -0800)]
CHROMIUM: platform: rename nvram to vbc

As we are actually accessing vboot context and vboot context is not
limited to be stored on nvram, it is clearer to just call it vbc.

This change also removes obsolete comments and makes API interface
consistent (all read/write should return number of bytes instead of zero
on success).

BUG=none
TEST=manual, add debugging sysfs entry to read/write vboot context and
     make sure it works.

Change-Id: Ifd097a1a8af9edb776eed83fe47cb332f8a3445d
Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37686
Reviewed-by: Simon Glass <sjg@chromium.org>
11 years agoCHROMIUM: vmx: control vmx correctly on resume
Ronald G. Minnich [Fri, 16 Nov 2012 22:13:51 +0000 (14:13 -0800)]
CHROMIUM: vmx: control vmx correctly on resume

On x86 chromeos systems with vmx support, the feature is controlled by
the disablevmx flag. There are several boot paths for the CPUs
and this patch ensures that the resume path for the BSP is covered.

Rename cpu_disable_vmx to cpu_control_vmx. It's a bit more
descriptive since it does not disable vmx in all cases.
Further, have the function itself test the variable; this
is more in keeping with how other such capabilities
are controlled anyway and it keeps the variable in
file scope. Finally, make it all conditional on
CONFIG_CHROMEOS.

We use the variable to control the enable/disable instead
of saved CPU context. I could add the FEATURES MSR
to the saved context and use that on restore but
that adds more changes, and I've seen no evidence that anyone
outside chromeos is interested in disabling VMX, so it
makes more sense to me to limit the footprint of this
patch.

BUG=chrome-os-partner:10449
TEST=apply and boot with this patch.
dmesg | grep Disabling.VMX
Note that all four CPUs have it disabled.
Also
rdmsr 0 0x3a
and see the value.
Suspend any way you want. (powerd_suspend, close the lid, whatever).
Repeat and notice the Disabling message appears again,
for all four cores this time,
and the 0x3a MSRs all have the correct value.

Change-Id: Ie0160db31a1a058ce4d3e4f8752cd0e5d696ea84
Signed-off-by: Ronald G. Minnich <rminnich@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38235
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
11 years agoDRM/exynos: Fix Memory Leak: free EDID block returned by drm_get_edid().
Stéphane Marchesin [Mon, 19 Nov 2012 23:01:46 +0000 (15:01 -0800)]
DRM/exynos: Fix Memory Leak: free EDID block returned by drm_get_edid().

This was just posted on the dri-devel list, and affects us also. It's
not a direct cherry-pick since we moved the code around.

BUG=none
TEST=by hand

Change-Id: Ibd76bc48094e466fe574af23d37c8df1e0262a8d
Signed-off-by: Egbert Eich <eich@suse.de>
Reviewed-on: https://gerrit.chromium.org/gerrit/38334
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoCHROMIUM: ath9k: do not schedule rx poll on invalid state
Rajkumar Manoharan [Thu, 8 Nov 2012 13:16:48 +0000 (18:46 +0530)]
CHROMIUM: ath9k: do not schedule rx poll on invalid state

During system suspend, the rx poll timer is cancelled at
the driver stop. But occasionally it will be scheduled again by
beacon reception before stopping rx. Since the timer is never
stopped again, it tries to queue work on suspend path.
This patch ensures that rx poll timer is cancelled on driver stop.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
BUG=chrome-os-partner:15168
TEST=Boot, run suspend-resume test with powersave ON.

Change-Id: I2eae50a4b35335249f0a530c9eb6161951abe5fc
Signed-off-by: Ashok Nagarajan <asnagarajan@chromium.org>
Tested-by: Ashok Nagarajan <asnagarajan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38316
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
11 years agoarm: exynos5: Add Adaptive Body Bias Control for exynos5
Abhilash Kesavan [Thu, 8 Nov 2012 12:02:40 +0000 (17:32 +0530)]
arm: exynos5: Add Adaptive Body Bias Control for exynos5

ABB improves operation voltage margin and reduces leakage current
of logic devices. ABB control depends on ASV group.

BUG=chrome-os-partner:15327
TEST=suspend_stress_test along with poweroffs and reboots

Change-Id: I6c7c405cacdf36d6a2e01d76b046e9dc2c112f60
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Jun Kim <junkim@samsung.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37619

11 years agoUPSTREAM: mwifiex: report error to MMC core if we cannot suspend
Bing Zhao [Thu, 15 Nov 2012 21:48:19 +0000 (13:48 -0800)]
UPSTREAM: mwifiex: report error to MMC core if we cannot suspend

When host_sleep_config command fails we should return error to
MMC core to indicate the failure for our device.

The misspelled variable is also removed as it's redundant.

Cc: "3.0+" <stable@vger.kernel.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chrome-os-partner:15129
TEST=Boot, associate, speed test, suspend, resume

Change-Id: I9d53425b29050274840030e63f95969601ee622f
Reviewed-on: https://gerrit.chromium.org/gerrit/38285
Reviewed-by: Bing Zhao <bzhao@marvell.com>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
11 years agoUPSTREAM: mwifiex: fix system hang issue in cmd timeout error case
Bing Zhao [Thu, 15 Nov 2012 20:29:42 +0000 (12:29 -0800)]
UPSTREAM: mwifiex: fix system hang issue in cmd timeout error case

Reported by Tim Shepard:
I was seeing sporadic failures (wedgeups), and the majority of those
failures I saw printed the printouts in mwifiex_cmd_timeout_func with
cmd = 0xe5 which is CMD_802_11_HS_CFG_ENH.  When this happens, two
minutes later I get notified that the rtcwake thread is blocked, like
this:
      INFO: task rtcwake:3495 blocked for more than 120 seconds.

To get the hung thread unblocked we wake up the cmd wait queue and
cancel the ioctl.

Cc: "3.4+" <stable@vger.kernel.org>
Reported-by: Tim Shepard <shep@laptop.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chrome-os-partner:15129
TEST=Boot, associate

Change-Id: Icdf3dd71b12b8110c5b13df5c5c9ebbb0820441c
Reviewed-on: https://gerrit.chromium.org/gerrit/38284
Reviewed-by: Bing Zhao <bzhao@marvell.com>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
11 years agoCHROMIUM: ASoC: samsung: fix error for hdmi-audio
Vincent Palatin [Fri, 12 Oct 2012 23:12:29 +0000 (16:12 -0700)]
CHROMIUM: ASoC: samsung: fix error for hdmi-audio

The result of the device tree look-up for the hdmi-audio device
was checked against the wrong variable.
As a consequence, if the hdmi-audio device is disabled, the kernel will
crash at startup instead of skipping the plugin.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:14489
TEST=boot on Spring with hdmi-audio disabled in the device tree
and see we are longer crashing in the max98095 probing.

Change-Id: I613b53633eb7814e63a7459704f3780ded62a2a0
Reviewed-on: https://gerrit.chromium.org/gerrit/38261
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
11 years agoDocumentation: mfd/max77686 devicetree bindings update
Will Drewry [Fri, 16 Nov 2012 23:00:24 +0000 (17:00 -0600)]
Documentation: mfd/max77686 devicetree bindings update

This change documents the enable/disable-low-jitter
bindings for the mfd/max77686.

Signed-off-by: Will Drewry <wad@chromium.org>
TEST=none
BUG=chrome-os-partner:15785

Change-Id: I0c980d5a2fa730c8d8681041a5627d84c3f1f4bb
Reviewed-on: https://gerrit.chromium.org/gerrit/38238
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Ready: Will Drewry <wad@chromium.org>
Tested-by: Will Drewry <wad@chromium.org>
11 years agoCHROMIUM: staging: gdm72xx: protect access of rx / tx structs
Ben Chan [Fri, 16 Nov 2012 01:57:54 +0000 (17:57 -0800)]
CHROMIUM: staging: gdm72xx: protect access of rx / tx structs

This patch applies spinlock to protect access to rx / tx structs in
certain call sites, which fixes the following crash in gdm_suspend.
It also fixes usb_set_intfdata() in gdm_usb_probe to avoid setting an
already freed phy_dev.

<5>[ 4996.815018] [<7f0074b0>] (gdm_suspend+0x1c/0x2b4 [gdmwm]) from [<803020a4>] (usb_suspend_both+0x80/0x1a0)
<5>[ 4996.815055] [<803020a4>] (usb_suspend_both+0x80/0x1a0) from [<80302c84>] (usb_runtime_suspend+0x38/0x64)
<5>[ 4996.815089] [<80302c84>] (usb_runtime_suspend+0x38/0x64) from [<802becc0>] (__rpm_callback+0x48/0x78)
<5>[ 4996.815118] [<802becc0>] (__rpm_callback+0x48/0x78) from [<802bf8dc>] (rpm_suspend+0x394/0x5ec)
<5>[ 4996.815145] [<802bf8dc>] (rpm_suspend+0x394/0x5ec) from [<802c0550>] (pm_runtime_work+0x8c/0xa4)
<5>[ 4996.815177] [<802c0550>] (pm_runtime_work+0x8c/0xa4) from [<800456cc>] (process_one_work+0x264/0x438)
<5>[ 4996.815209] [<800456cc>] (process_one_work+0x264/0x438) from [<80045acc>] (worker_thread+0x22c/0x3b8)
<5>[ 4996.815239] [<80045acc>] (worker_thread+0x22c/0x3b8) from [<8004a43c>] (kthread+0x9c/0xa8)
<5>[ 4996.815270] [<8004a43c>] (kthread+0x9c/0xa8) from [<8000f160>] (kernel_thread_exit+0x0/0x8)
<0>[ 4996.815295] Code: e92d4000 e8bd4000 e2800020 eb4ab9a1 (e5905000)

BUG=chrome-os-partner:16223
TEST=Run network_MobileSuspendResume.wimax_stress test.

Change-Id: I5a45f7e5fc3ca35681005fea40303f4c8c017ac0
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38172
Reviewed-by: Sameer Nanda <snanda@chromium.org>
11 years agoCHROMIUM: add DEVTMPFS_SAFE support
Elly Fong-Jones [Wed, 14 Nov 2012 23:04:54 +0000 (18:04 -0500)]
CHROMIUM: add DEVTMPFS_SAFE support

If DEVTMPFS_SAFE==y, automount devtmpfs with nosuid and noexec.

BUG=chromium-os:32629
TEST=adhoc
mount | grep devtmpfs

Change-Id: I7a330fb7bd1e0da7e42fe2194a958c6878c0ce68
Signed-off-by: Elizabeth Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38061
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoCHROMIUM: cros5250-common: add enable-low-jitter to max77686
Will Drewry [Fri, 16 Nov 2012 22:06:18 +0000 (16:06 -0600)]
CHROMIUM: cros5250-common: add enable-low-jitter to max77686

Signed-off-by: Will Drewry <wad@chromium.org>
BUG=chrome-os-partner:15785
TEST=boots with change 38180 and i2cget returns 0x0f as per that change.

Change-Id: I70f305c23ee8205f9af3e81addbcaa350434a27a
Reviewed-on: https://gerrit.chromium.org/gerrit/38229
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Ready: Will Drewry <wad@chromium.org>
Tested-by: Will Drewry <wad@chromium.org>
11 years agoCHROMIUM: mfd/max77686: enable low-jitter mode
Will Drewry [Fri, 16 Nov 2012 02:13:39 +0000 (20:13 -0600)]
CHROMIUM: mfd/max77686: enable low-jitter mode

This change adds three valid device-tree configured settings
for the max77686 "low jitter" mode:
* max77686,enable-low-jitter
* max77686,disable-low-jitter
* (no entry)

With either entry, the third bit of the 32KHZ register
is updated.

Low jitter mode is desirable on some platforms with components that are
sensitive to the clock signal.  The clock sometimes appears to stutter when
being updated.  For most uses, this is inconsequential, but if the RTC is
supplying a signal to more sensitive hardware, it can cause undesirable
results.

BUG=chrome-os-partner:15785
TEST=It boots :) semenzato@ has confirmed that if the register is set, the errors do not reproduce with the scope.

To check the register state:
  $ i2cget -f -y 0 0x9 0x7f
  0x0f

Reported-by: Luigi Semenzato <semenzato@chromium.org>
Suggested-by: Luigi Semenzato <semenzato@chromium.org>
Signed-off-by: Will Drewry <wad@chromium.org>
Change-Id: Ib40d1d0728535b10c8438eaa6eacd74fb83cb697
Reviewed-on: https://gerrit.chromium.org/gerrit/38180
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Ready: Will Drewry <wad@chromium.org>
Tested-by: Will Drewry <wad@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoCHROMIUM: ASoC: samsung: Spring is using max98095 codec
Vincent Palatin [Fri, 16 Nov 2012 17:28:50 +0000 (09:28 -0800)]
CHROMIUM: ASoC: samsung: Spring is using max98095 codec

Spring is also using the Maxim max98095 codec for audio.
Add it to the list of supported boards.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:14490
TEST=on Spring, plug a headset, play a video on Youtube and hear the
sound.

Change-Id: If17a3ba240943412acf03b24058218c40781944f
Reviewed-on: https://gerrit.chromium.org/gerrit/38205
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: md: bootcache save string args
Paul Taysom [Fri, 9 Nov 2012 19:49:02 +0000 (11:49 -0800)]
CHROMIUM: md: bootcache save string args

dm-bootcache now makes a separate copy of any string arguments
that are passed to it.

BUG=chromium-os:35683
TEST=ran bootcachetest on stumpy, arm

Change-Id: I48f62671377109a596eea150361c492fe19a96a7
Signed-off-by: Paul Taysom <taysom@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37736
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
11 years agodrm/exynos: Implement DPMS_STANDBY for HDMI
Sean Paul [Thu, 15 Nov 2012 16:24:27 +0000 (11:24 -0500)]
drm/exynos: Implement DPMS_STANDBY for HDMI

Enable the "blue screen" when we get a DPMS_STANDBY request for HDMI.
This allows us to turn off the mixer, but maintain audio over HDMI when
we turn the screen idle.

BUG=chrome-os-partner:15709
TEST=Tested on snow by ensuring audio continues to play during idle

Change-Id: I2639c0d1cd7384881b5fd651039fef71b27c76ed
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38122
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
11 years agoUPSTREAM: ath9k_hw: Fix wrong peak detector DC offset
Paul Stewart [Wed, 14 Nov 2012 01:21:55 +0000 (17:21 -0800)]
UPSTREAM: ath9k_hw: Fix wrong peak detector DC offset

An issue is reported in AR9462 that NF_cal_not_done is not observed
when HW peak detector calibration is disabled. At that state, the HW
is stuck at NF calibration which prevents tx output. The root cause
is wrong peak detector offset calibrated by HW. To resolve this issue,
peak detector calibration is done manually by SW for AR9462.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chrome-os-partner:36266
TEST=Boot and run bandwith tests

Change-Id: I9b79e9b51ef86cc73800b7bb3e80875b1c0e2705
Reviewed-on: https://gerrit.chromium.org/gerrit/38025
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
11 years agoCHROMIUM: mwifiex: Add SDIO register debugging
Paul Stewart [Wed, 14 Nov 2012 02:40:50 +0000 (18:40 -0800)]
CHROMIUM: mwifiex: Add SDIO register debugging

This patch retrieves firmware/hardware status upon tx watchdog
timeout or command timeout. Hopefully with this debug patch we
can get some clues on what is causing the timeout issue.

BUG=chrome-os-partner:15129
TEST=Boot, connect to network

Change-Id: I058fe07746e6a1ccd8debde0c0d3d8debd700502
Signed-off-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37972

11 years agoCHROMIUMOS: Revert "mwifiex: Set timeout for mwifiex_wait_queue_complete"
Paul Stewart [Wed, 14 Nov 2012 20:25:52 +0000 (12:25 -0800)]
CHROMIUMOS: Revert "mwifiex: Set timeout for mwifiex_wait_queue_complete"

This was meant to isolate issues with command timeouts for debugging
purposes.  We are proceeding with a different debugging path now.

This reverts commit e0514c155f95de286656a3d4306df852ea107987.

Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chrome-os-partner:15129
TEST=Boot, connect to network

Change-Id: I9b2fa79803605bc8b92d93a57fb0c850113c9fac
Reviewed-on: https://gerrit.chromium.org/gerrit/38119
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
11 years agoCHROMIUM: config: enable usb net drivers (dm9601/net1080/rtl8150) for all targets
Mike Frysinger [Fri, 2 Nov 2012 21:12:15 +0000 (17:12 -0400)]
CHROMIUM: config: enable usb net drivers (dm9601/net1080/rtl8150) for all targets

Some configs had these drivers enabled while others did not.  Update the
common arch configs to all enable these drivers.

BUG=chromium-os:35943
TEST=`emerge-daisy chromeos-kernel` included these three drivers
TEST=`emerge-stumpy chromeos-kernel` included these three drivers
TEST=`emerge-x86-alex chromeos-kernel` included these three drivers

Change-Id: I9615109a5b17af293855595ba8f06f397db360c4
Signed-off-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37296
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
11 years agoCHROMIUM: arm: exynos: fix math in ppmu driver
Olof Johansson [Thu, 15 Nov 2012 17:10:36 +0000 (09:10 -0800)]
CHROMIUM: arm: exynos: fix math in ppmu driver

The define doesn't wrap the argument properly so the math ends up wrong.

BUG=chromium-os:36402
TEST=check /proc/cpu/alignment and "perf top -G --symbols do_alignment_ldrstr" after applying

Change-Id: Ifd342de96c682bc2a2acaf7a9bfb73f0d5d2f516
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38123
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Bryan Freed <bfreed@chromium.org>
11 years agoCHROMIUM: mfd: chromeos_ec: support command version numbers
Che-Liang Chiou [Wed, 7 Nov 2012 00:45:06 +0000 (16:45 -0800)]
CHROMIUM: mfd: chromeos_ec: support command version numbers

ec supports versioned command and non-versioned command should be
deprecated.  To minimize changes to ec clients, driver will accept not
8-bits but 16-bits command code and interpret top 8-bits as version
number.  Because current ec clients all use commands of version-zero,
they will not be effected by this API change.

BUG=chrome-os-partner:15609
TEST=manual, add debugging sysfs entry to exercise kernel code path, and
     make sure ec driver still works on snow.

Change-Id: I640e7756baddd20d8bc14c7f8ba10c13e60ed8ff
Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37496
Reviewed-by: Simon Glass <sjg@chromium.org>
11 years agoCHROMIUM: Input: atmel_mxt_ts - recalibrate on system resume
Yufeng Shen [Wed, 14 Nov 2012 21:13:59 +0000 (16:13 -0500)]
CHROMIUM: Input: atmel_mxt_ts - recalibrate on system resume

In the suspend path, if we don't allow device wakeup, we put the
chip into deepsleep mode and the chip stops scanning during suspen.
On resume if the environment changes, the calibrated baseline before
suspend will no longer be valid.

In this patch we force a recalibration on resume if device wakeup is
disabled during suspend to handle the environment change.

Signed-off-by: Yufeng Shen <miletus@chromium.org>
BUG=chrome-os-partner:16171
TEST=I don't have a controlled environment to test this. So I only test
     normal suspend/resume to make sure no noise touches happen on resume
     and touch devices work as expected.
     1. With lid open, using powerd_suspend to suspend the system. Wakeup
     the system and make sure the touch device still works.
     Run "demsg | grep atmel"  to make sure no calibration message reported.
     2. Use lid close to suspend the system. Wakeup the system and make
     sure touch device still works.
     Run "demsg | grep atmel"  to make sure calibration message are reported.
     3. Also notice the case of lid open caused system resume, if something is
     on the touch surface (like opening the lid and quickly put the palm on the
     touch surface for a while), the system will get calibrated into a wrong
     baseline and touch device then won't work.

Change-Id: I62cb47fa1c97917a2c0f968e41ee4cd13f12187c
Reviewed-on: https://gerrit.chromium.org/gerrit/38051
Reviewed-by: Benson Leung <bleung@chromium.org>
Commit-Ready: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
11 years agoCHROMIUM: Input: cyapa - Remove CYAPA_CMD_GROUP_CTRL
Benson Leung [Tue, 6 Nov 2012 23:07:14 +0000 (15:07 -0800)]
CHROMIUM: Input: cyapa - Remove CYAPA_CMD_GROUP_CTRL

Remove CONTROL_BASE define and CYAPA_CMD_GROUP_CTRL
command class.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=builds clean.

Change-Id: I6f62508f70af2c0f91c8d3d5c97cc3cdd5439034
Reviewed-on: https://gerrit.chromium.org/gerrit/37741
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
11 years agoarm: exynos: Retry "wfi" on failure
Abhilash Kesavan [Wed, 14 Nov 2012 03:57:53 +0000 (09:27 +0530)]
arm: exynos: Retry "wfi" on failure

We are seeing suspend failures occuring once in a while. In case
there still exists a race with another interrupt let us retry "wfi"
a 100 times before failing.

BUG=chrome-os-partner:14956
TEST=suspend_stress_test with no suspend failures yet.

Change-Id: I1c59ae77e12be40dec1ee027f8f1d0e0a2a2f66c
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/37991
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
Commit-Ready: Jon Kliegman <kliegs@chromium.org>
Tested-by: Jon Kliegman <kliegs@chromium.org>
11 years agoCHROMIUM: pm-check: make pm-check sum function stronger
Sonny Rao [Wed, 14 Nov 2012 21:27:17 +0000 (13:27 -0800)]
CHROMIUM: pm-check: make pm-check sum function stronger

Add a rotate to the sum function and switch back to 32-bit.
The rotate seems to help in catching more instances of corruption than
a pure checksum.  So far we haven't seen sum + ror miss a corruption
in over 2000 known cases whereas pure sum misses 10 of those.  There
seems to be some kind of optimizer bug when I try to use 64-bit + ror
so let's go back to 32-bit and take a speed hit.  This code seems to
run in about 760 msec vs about 540 msec for the pure checksum.

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
BUG=chrome-os-partner:16148
TEST=run suspend_stress_test, ensure errors are still detected

Change-Id: I0adaec6f73d9acd752059840f37f707d5d2a2f59
Reviewed-on: https://gerrit.chromium.org/gerrit/38053
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
11 years agodrm/exynos: add the plumbing for drm debugfs
Mandeep Singh Baines [Mon, 12 Nov 2012 23:59:25 +0000 (15:59 -0800)]
drm/exynos: add the plumbing for drm debugfs

Also added simple gem object counting.

BUG=chromium-os:36060
TEST=Verified that the debugfs interface is present.

localhost ~ # cat /sys/kernel/debug/dri/0/exynos_gem_objects
5 objects, 12709888 bytes
localhost ~ # stop ui
ui stop/waiting
localhost ~ # cat /sys/kernel/debug/dri/0/exynos_gem_objects
1 objects, 4227072 bytes

Change-Id: I4652eedbdda5be68f055b45e316c999114d80b3b
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37858

11 years agoCHROMIUM: Input: cyapa - Remove CYAPA_MAX_TOUCHES define
Benson Leung [Wed, 24 Oct 2012 22:44:42 +0000 (15:44 -0700)]
CHROMIUM: Input: cyapa - Remove CYAPA_MAX_TOUCHES define

It's only used once in struct cyapa_reg_data, so lets just
hard code it there.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=builds clean.

Change-Id: I6d39e70f369b0825238022a38111e2fa42862c5e
Reviewed-on: https://gerrit.chromium.org/gerrit/37745
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
Commit-Ready: Benson Leung <bleung@chromium.org>

11 years agoCHROMIUM: Input: cyapa - compare return value of memcmp to 0
Benson Leung [Wed, 24 Oct 2012 22:16:05 +0000 (15:16 -0700)]
CHROMIUM: Input: cyapa - compare return value of memcmp to 0

Check the return value of memcmp for more clarity.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=builds clean

Change-Id: Ie2235a59df9347d938917e86d2c69d27af073338
Reviewed-on: https://gerrit.chromium.org/gerrit/37744
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
Commit-Ready: Benson Leung <bleung@chromium.org>

11 years agoCHROMIUM: Input: cyapa - change to xy_hi and x_lo y_lo
Benson Leung [Wed, 24 Oct 2012 21:29:45 +0000 (14:29 -0700)]
CHROMIUM: Input: cyapa - change to xy_hi and x_lo y_lo

Based on upstream feedback, change these variable names.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=builds clean.

Change-Id: Ieb16c22fcc95c657f493f9f8c69854aa475e391e
Reviewed-on: https://gerrit.chromium.org/gerrit/37743
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
Commit-Ready: Benson Leung <bleung@chromium.org>

11 years agoCHROMIUM: Input: cyapa - Remove gen enum
Benson Leung [Wed, 24 Oct 2012 22:33:24 +0000 (15:33 -0700)]
CHROMIUM: Input: cyapa - Remove gen enum

Remove the gen enum. The other two values of the enum
aren't used anywhere in this driver (we only support Gen3).

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=Builds clean.

Change-Id: If1f26dbccb64fc852151d8c5de6ea3577213f5f9
Reviewed-on: https://gerrit.chromium.org/gerrit/37742
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
Commit-Ready: Benson Leung <bleung@chromium.org>

11 years agoCHROMIUM: cpufreq_interactive: correct cpu idle time calculation
Sam Leffler [Mon, 12 Nov 2012 17:12:56 +0000 (09:12 -0800)]
CHROMIUM: cpufreq_interactive:  correct cpu idle time calculation

Each cpu has a timer that tracks load and decides whether to adjust the
clock for that processor.  The timer callback may, however, execute on
any cpu, not just the one it manages.  Fix the idle time calculation to
take this into consideration--it was assuming smp_processor_id() returned
the cpu id of the processor to manage, causing incorrect decisions.

Signed-off-by: sleffler@chromium.org
BUG=none
TEST=run cpu intensive benchmark like octane on a multi-core system; check trace results and note that sometimes v8 runs for extended times on cpu operating at low freq (contributing to poor score)

Change-Id: I2b5c21b5d8cae31679e844ac67037cc760c5dfc0
Reviewed-on: https://gerrit.chromium.org/gerrit/37830
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>

11 years agoCHROMIUM: ARM: MALI: add sysfs file which prints amount of memory allocated
Mandeep Singh Baines [Tue, 13 Nov 2012 00:55:32 +0000 (16:55 -0800)]
CHROMIUM: ARM: MALI: add sysfs file which prints amount of memory allocated

BUG=chromium-os:36060
TEST=Verified that the sysfs file is present.

localhost ~ # cat /sys/devices/platform/mali.0/memory
122068992 bytes
localhost ~ # stop ui
ui stop/waiting
localhost ~ # cat /sys/devices/platform/mali.0/memory
28672 bytes

Change-Id: Ic11cf2470a6e17676da48ce4aa3a73444a475942
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37862

11 years agodrm/exynos: make event parameter optional for page_flip
Mandeep Singh Baines [Wed, 7 Nov 2012 21:09:56 +0000 (13:09 -0800)]
drm/exynos: make event parameter optional for page_flip

We no longer need to enforce that event is non-NULL. We also need
to be able to call page_flip with a NULL event so that we can
call it from the mode_set paths.

BUG=chrome-os-partner:15349,chrome-os-partner:14965
TEST=Multiple VT switch, HDMI plug/unplug, sign in/out, suspend/resume,
     idle suspend/resume.

Change-Id: Ia139cd36a3f78fbf3c96651176a42289f07722e6
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37572

11 years agoRevert "drm/exynos: implement an optimized page_flip"
Mandeep Singh Baines [Wed, 7 Nov 2012 20:35:46 +0000 (12:35 -0800)]
Revert "drm/exynos: implement an optimized page_flip"

This reverts commit 69518a3c650de9186f345a5e7feaddbadfc394d0.

We want to be able to call page_flip from mode_set and mode_set_base
so that all functions which cause a buffer to be scanned out are
synchronized.

BUG=chrome-os-partner:15349,chrome-os-partner:14965
TEST=Multiple VT switch, HDMI plug/unplug, sign in/out, suspend/resume,
     idle suspend/resume.

Change-Id: I198962b65bb8a1ab5b885c053c19f7f8077cb9c6
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37571

11 years agoCHROMIUM: drm/i915: Propermy terminate DMI list
Stéphane Marchesin [Tue, 13 Nov 2012 19:21:59 +0000 (11:21 -0800)]
CHROMIUM: drm/i915: Propermy terminate DMI list

Not sure why this wasn't triggered by our testing, but
Intel reports that they had the issue.

BUG=chromium-os:36276
TEST=by hand

Change-Id: Iad63bca07eab05e750bb165387f028e1dbf3de54
Reviewed-on: https://gerrit.chromium.org/gerrit/37921
Reviewed-by: Stuart Abercrombie <sabercrombie@chromium.org>
Reviewed-by: Russell Webb <russell.webb@intel.com>
Tested-by: Russell Webb <russell.webb@intel.com>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>

11 years agodrm/exynos: move checks outside of exynos_drm_crtc_update
Mandeep Singh Baines [Wed, 31 Oct 2012 21:13:41 +0000 (14:13 -0700)]
drm/exynos: move checks outside of exynos_drm_crtc_update

Refactor the code so that exynos_drm_crtc_update cannot fail.

BUG=chrome-os-partner:15349,chrome-os-partner:14965
TEST=Multiple VT switch, HDMI plug/unplug, sign in/out, suspend/resume,
     idle suspend/resume.

Change-Id: I77335d6142f2363ca19b113ddcd5909c3a067121
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37570
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agodrm/exynos: remove NULL check from exynos_drm_overlay_update
Mandeep Singh Baines [Thu, 11 Oct 2012 01:30:23 +0000 (18:30 -0700)]
drm/exynos: remove NULL check from exynos_drm_overlay_update

We really shouldn't be handling this NULL pointer. If there
is a NULL pointer here, we've hit a kernel bug. No need for a
BUG_ON since the kernel will panic on any NULL dereference.

This allows us to make exynos_drm_overlay_update void.

BUG=chrome-os-partner:15349,chrome-os-partner:14965
TEST=Multiple VT switch, HDMI plug/unplug, sign in/out, suspend/resume,
     idle suspend/resume.

Change-Id: I39c4ee44260eaeb98594dfbe01f2b885039ab23c
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/35248
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoKDS: fix deadlock in early release path
Mandeep Singh Baines [Mon, 5 Nov 2012 21:31:46 +0000 (13:31 -0800)]
KDS: fix deadlock in early release path

We deadlock, under the following scenario:

1) A grabs lock non-exclusive
2) B grabs lock exclusive
3) C grabs lock non-exclusive
4) B releases lock before ever acquiring
5) A releases lock

After 5, C should acquire the lock but the current implementation
does not do this.

BUG=chromium-os:36071,chrome-os-partner:15349,chrome-os-partner:14965
TEST=I had some patches which were seeing the deadlock. After this fix,
     I no longer get a deadlock.
TEST=Multiple VT switch, HDMI plug/unplug, sign in/out, suspend/resume,
     idle suspend/resume.

Change-Id: I4df35f08f9f31ad95fbe686e48bf421e25f9930b
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37569
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agodrm/ptn-exynos: Synchronize PTN init with hotplug
Sean Paul [Mon, 29 Oct 2012 15:31:10 +0000 (11:31 -0400)]
drm/ptn-exynos: Synchronize PTN init with hotplug

Gate the DP hotplug work function on ptn3460 initailization if the
bridge chip is present. This ensures we can completely set up the
hardware before trying to read EDID and configure video.

BUG=chrome-os-partner:11158
TEST=Tested on snow, boot/suspend-resume/idle suspend-resume

Change-Id: I7f2ca812bdaaaba5350deed29939afec5d4e8a23
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36794

11 years agodrm/ptn3460: Remove free_me
Sean Paul [Thu, 1 Nov 2012 18:06:57 +0000 (14:06 -0400)]
drm/ptn3460: Remove free_me

This free_me variable is ugly and useless. Since we don't even define
the platform_data struct outside of this driver, it'd be hard for
arch-specific code to instantiate it.

BUG=None
TEST=Tested on snow

Change-Id: I87564b43d53c2ec02bdf6a4ef73cc7f69c4a2ce9
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37624

11 years agodrm/exynos: Consolidate suspend/resume
Sean Paul [Thu, 8 Nov 2012 14:26:21 +0000 (09:26 -0500)]
drm/exynos: Consolidate suspend/resume

Remove all of the pm_ops from the various platform devices and move to a
consolidated suspend/resume process from the drm driver. This allows us
to properly order operations when we suspend/resume. It also makes the
dpms tracking in exynos_drm_encoder meaningful.

BUG=None
TEST=Tested with/without hdmi & idle/lid suspend/resume. No regressions.

Change-Id: I25bab3843c87960416b1218a48c60c5124404aff
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37642
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agodrm/exynos: dp: Mask interrupts instead of disable
Sean Paul [Tue, 6 Nov 2012 17:14:36 +0000 (12:14 -0500)]
drm/exynos: dp: Mask interrupts instead of disable

Instead of running disable_irq on suspend, and subsequently enable_irq
on resume, just mask off the interrupt before suspending. This avoids
the ugly disable_irq in probe, and any future issues with mismatched irq
enable/disables.

BUG=None
TEST=Tested on snow idle suspend/lid suspend, boot, etc.

Change-Id: I0e913b1c563b3b0081c074eac52c8d887d5dca58
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37621
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agodrm/exynos: Convert dp driver to use panel_ops
Sean Paul [Thu, 25 Oct 2012 15:53:01 +0000 (11:53 -0400)]
drm/exynos: Convert dp driver to use panel_ops

This patch changes the dp driver to implement panel_ops. This gets
rid of the dp_dev hack that was introduced when dp moved into drm.

BUG=chrome-os-partner:11158, chrome-os-partner:9855,
    chrome-os-partner:10717
TEST=Tested on snow, no regressions detected

Change-Id: Ia0e2939f635a2406a1ac29e172cb1ae59d13acbe
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36701
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agodrm/exynos: Refactor manager/display/overlay
Sean Paul [Wed, 24 Oct 2012 21:28:49 +0000 (17:28 -0400)]
drm/exynos: Refactor manager/display/overlay

The exynos_drm_manager/display/overlay architecture wasn't really
serving its purpose. It attempted to split callbacks into logical
sections, but those sections didn't really make sense, and required us
to have a layer of abstraction such as exynos_drm_hdmi on top of the
controller and panel to call the appropriate functions.

This patch removes manager/display/overlay as well as exynos_drm_hdmi,
and adds a new abstraction which splits the callbacks to controller and
panel.

Right now, this just cleans things up, making the code a little more
readable. In the short term, it allows us to hook fimd into just
the controller side, and add dp/mipi as panel implementations. In the
long term, it removes all of the device pointers, so we should be able
to remove all of the various platform drivers more easily.

BUG=chrome-os-partner:11158,chrome-os-partner:10717
TEST=Tested on snow, hdmi hotplugged, booted with/without hdmi,
suspend/resume tested. No regressions detected.

Change-Id: Ia1bd6bbd67d49af2abecf36c43bfe765ae00f38d
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36477
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agodrm/exynos: Fix up encoder->dpms locking
Sean Paul [Thu, 8 Nov 2012 16:44:14 +0000 (11:44 -0500)]
drm/exynos: Fix up encoder->dpms locking

encoder->dpms was both being read and written without the struct mutex
lock. Fix this so we're synchronized.

BUG=None
TEST=Tested on snow, ensured we only called dpms once

Change-Id: I7d2b34e908273660c31c0290e3c6c632556297fc
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37643
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoCHROMIUM: Input: cyapa - Use static const for unique_str
Benson Leung [Wed, 7 Nov 2012 00:10:31 +0000 (16:10 -0800)]
CHROMIUM: Input: cyapa - Use static const for unique_str

Use static contst for unique_str "CYTRA" used to compare
with product_id.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=Builds clean.

Change-Id: I667cfe0dfef652e0a377079bfacedc41b8412891
Reviewed-on: https://gerrit.chromium.org/gerrit/37740
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
11 years agoCHROMIUM: Input: cyapa - Use u8 instead of unsigned char
Benson Leung [Tue, 6 Nov 2012 23:46:32 +0000 (15:46 -0800)]
CHROMIUM: Input: cyapa - Use u8 instead of unsigned char

Change type of cmd and len in cyapa_cmd_len to u8 for consistency
with the rest of the driver.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=Builds clean.

Change-Id: I726546c730e54db88d683e14199df83bc34b2311
Reviewed-on: https://gerrit.chromium.org/gerrit/37739
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
11 years agoCHROMIUM: Input: cyapa - Clean up whitespace and comments
Benson Leung [Wed, 24 Oct 2012 02:29:36 +0000 (19:29 -0700)]
CHROMIUM: Input: cyapa - Clean up whitespace and comments

Minor cleanup for preparation for upstreaming this driver.

* Add attribution for djkurtz and bleung for cleanup and restructuring
* Remove kernel_doc comments for i2c_reg_read and i2c_reg_write
* Fix comment for cyapa_poll_state for correct ms values and spellcheck.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=Builds clean

Change-Id: I75028fb0a674e3bb30aae4c5af4a8c581a734065
Reviewed-on: https://gerrit.chromium.org/gerrit/37738
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
11 years agoUPSTREAM: xhci: fix null-pointer dereference when destroying half-built segment rings
Julius Werner [Sat, 27 Oct 2012 00:34:03 +0000 (17:34 -0700)]
UPSTREAM: xhci: fix null-pointer dereference when destroying half-built segment rings

xhci_alloc_segments_for_ring() builds a list of xhci_segments and links
the tail to head at the end (forming a ring). When it bails out for OOM
reasons half-way through, it tries to destroy its half-built list with
xhci_free_segments_for_ring(), even though it is not a ring yet. This
causes a null-pointer dereference upon hitting the last element.

Furthermore, one of its callers (xhci_ring_alloc()) mistakenly believes
the output parameters to be valid upon this kind of OOM failure, and
calls xhci_ring_free() on them. Since the (incomplete) list/ring should
already be destroyed in that case, this would lead to a use after free.

This patch fixes those issues by having xhci_alloc_segments_for_ring()
destroy its half-built, non-circular list manually and destroying the
invalid struct xhci_ring in xhci_ring_alloc() with a plain kfree().

BUG=chrome-os-partner:15124
TEST=Hard to reproduce since the underlying bug was fixed already.

Has been accepted upstream by Sarah Sharp at
https://lkml.org/lkml/2012/11/12/313

Change-Id: I8035a390ab410873b97bce23dded5f0cfc14dcf6
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36745
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: tcp: Avoid merging segments on the OOO queue into a cloned SKB
Julius Werner [Thu, 8 Nov 2012 22:51:33 +0000 (14:51 -0800)]
CHROMIUM: tcp: Avoid merging segments on the OOO queue into a cloned SKB

TCP tries to merge socket buffers in the out-of-order queue when they
are sequential. This is generally a good thing to save memory and speed
up processing, but can lead to problems when it expands a buffer that
has previously been cloned.

We have encountered a bug with a confused/broken receive queue, that we
think might have been caused by this problem, as the smsc95xx driver
uses cloned buffers in its receive path. Thanks to edumazet for
pointing that out and suggesting this fix.

This patch makes sure that this code path only expands socket buffers
that have not been cloned and just enqueues them normally in the other
case. In upstream kernels starting with 3.5, the affected code has been
refactored into tcp_try_coalesce with commit 1402d36, which has later
been patched to fix this issue in commit 923dd34. The fix has not been
backported into the upstream 3.4 kernel.

BUG=chromium-os:35827
TEST=None

Change-Id: I2cdf09946a3cbb0cbff35b1ac09313352b8f1e94
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37666
Reviewed-by: Eric Dumazet <edumazet@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
11 years agoCHROMIUM: Input: atmel_mxt_ts - Return early from mxt_exit_bl on error
Benson Leung [Wed, 10 Oct 2012 20:55:56 +0000 (13:55 -0700)]
CHROMIUM: Input: atmel_mxt_ts - Return early from mxt_exit_bl on error

In the case that a firmware update fails, the driver
will try to proceed to mxt_input_dev_create, which will try to
dereference the NULL object table. Bail out early so this does
not happen.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chrome-os-partner:10688
TEST=The following instructions will write the wrong firmware to the
touchpad device.
1. cd /sys/bus/i2c/devices/1-004b
2. echo maxtouch-ts.fw > fw_file
3. echo 1 > update_fw
4. dmesg | tail
This will result in a failed touchpad update. Check that dmesg shows:
[  158.495164] atmel_mxt_ts 1-004b: bootloader version: 32
[  170.563491] atmel_mxt_ts 1-004b: mxt_read_reg: i2c read failed
[  170.563513] atmel_mxt_ts 1-004b: Failed to initialize on exit bl. error = -6
Check that the system does not panic in this situation.

To recover from this state, simply shut the machine down completely using
sudo shutdown -P now

Change-Id: Ib773efd8b76aced9f5faab0b51745db7192e78f9
Reviewed-on: https://gerrit.chromium.org/gerrit/37860
Reviewed-by: Yufeng Shen <miletus@chromium.org>
Commit-Ready: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
11 years agoCHROMIUM: mfd: chromeos_ec: update EC<->AP protocol
Che-Liang Chiou [Fri, 9 Nov 2012 00:27:09 +0000 (16:27 -0800)]
CHROMIUM: mfd: chromeos_ec: update EC<->AP protocol

The ec_commands.h file has been added quite a few new commands. Bring
the new version.

Sync ec_commands.h file of commit
  3c575ccb02ff58eaae3e7c3dd8e2e86ad25ac106

BUG=none
TEST=build kernel for daisy and link

Change-Id: If17bba42df105a92aa31d6ddfedc0cdae682c279
Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37677

11 years agoCHROMIUM: remove implementation details from public header
Che-Liang Chiou [Fri, 9 Nov 2012 00:42:33 +0000 (16:42 -0800)]
CHROMIUM: remove implementation details from public header

chromeos_platform_read_nvram() and chromeos_platform_write_nvram() are
implementation details of chromeos_set_need_recovery() that are not used
outside drivers/platform.  So remove them from public header.

BUG=none
TEST=build kernel

Change-Id: Ie3a67dbe05b9764dc680dd1e5cf15dd91160d61a
Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37685

11 years agoCHROMIUM: pm-check: optimize xor and sum for A-15
Sonny Rao [Fri, 9 Nov 2012 20:53:40 +0000 (12:53 -0800)]
CHROMIUM: pm-check: optimize xor and sum for A-15

This speeds up the xor and checksum functions in pm-check

before:
[  202.557153] s3c_pm_check: Suspend memory scan took 1135837 usecs
[  202.557153] s3c_pm_check: Resume memory scan took 1097304 usecs

after:
[   63.292634] s3c_pm_check: Suspend memory scan took 553787 usecs
[   63.292634] s3c_pm_check: Resume memory scan took 531468 usecs

BUG=chrome-os-partner:15655
TEST=run suspend_stress_test, ensure errors are still detected

Change-Id: Icf20432c107a25efde77271f3956e82fc8a3a7a2
Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37781

11 years agoCHROMIUM: Input: atmel_mxt_ts - make suspend power acquisition interval configurable
Yufeng Shen [Mon, 12 Nov 2012 19:21:10 +0000 (14:21 -0500)]
CHROMIUM: Input: atmel_mxt_ts - make suspend power acquisition interval configurable

Create sysfs for T7 IDLE/ACTV-ACQINT settings to have a configurable power
acquisition setting during system suspend.

Also change the default T7 IDLE/ACTV-ACQINT values during system suspend to be
32ms to have a sensitive wakeup-from-touch response.

Signed-off-by: Yufeng Shen <miletus@chromium.org>
BUG=chrome-os-partner:15968
TEST=1. go to touch device sysfs directory
        echo 254 > power/suspend_acq_interval_ms
        Try powerd_suspend and use very quick, gentle touch to wake up the system
        and notice that sometimes the system does not wake up from touch.
     2. go to touch device sysfs directory
        echo 32 > power/suspend_acq_interval_ms
        Try powerd_suspend and use very quick, gentle touch to wake up the system
        and make sure the system always wakes up.

Change-Id: Ib7ad7a6b81699b71bcb165df06f275e55a68e7c6
Reviewed-on: https://gerrit.chromium.org/gerrit/37836
Reviewed-by: Benson Leung <bleung@chromium.org>
Commit-Ready: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
11 years agoPM / Sleep: samsung: pm-check: Add ability to skip unallocated pages
Jonathan Kliegman [Fri, 9 Nov 2012 14:32:55 +0000 (09:32 -0500)]
PM / Sleep: samsung: pm-check: Add ability to skip unallocated pages

Memory corruption in unallocated pages isn't harmful and we can save
time by only checking allocated pages.

BUG=None
TEST=Ran with all memory allocated in userspace.
   Saw errors on machine with bad bios.  No errors on good bios.
   Timing tests:
  - Memory fully allocated: 4.428 second suspend, 1.154 resume.
  - Chrome on login screen: 0.995 suspend, 0.319 resume
  - Chrome UI stopped: 0.591 suspend, 0.195 resume
  - pm_check_skip_unused = 0: 4.510 suspend, 1.155 resume

Change-Id: I3b996b17b3f12885f86595684e2d0e14b11adbdc
Signed-off-by: Jonathan Kliegman <kliegs@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37716
Reviewed-by: Doug Anderson <dianders@chromium.org>
11 years agosamsung: snow: bitfix: Set interleaving based on corruption unit
Doug Anderson [Fri, 9 Nov 2012 17:57:54 +0000 (09:57 -0800)]
samsung: snow: bitfix: Set interleaving based on corruption unit

We'd like to process all pages with the same destination one after
another.  Tell pm-check about this.

BUG=chrome-os-partner:15655
TEST=Timed before and after and saw 500-600ms speedup.
Before:
 [   24.709808] s3c_pm_check: Suspend memory scan took 3947182 usecs
 [   24.709808] s3c_pm_check: Resume memory scan took 1098695 usecs
 [   37.209790] s3c_pm_check: Suspend memory scan took 4020150 usecs
 [   37.209790] s3c_pm_check: Resume memory scan took 1099690 usecs
 [   51.569801] s3c_pm_check: Suspend memory scan took 4017198 usecs
 [   51.569801] s3c_pm_check: Resume memory scan took 1099794 usecs
After:
 [   33.923909] s3c_pm_check: Suspend memory scan took 3493848 usecs
 [   33.923909] s3c_pm_check: Resume memory scan took 1104389 usecs
 [   44.273912] s3c_pm_check: Suspend memory scan took 3444726 usecs
 [   44.273912] s3c_pm_check: Resume memory scan took 1104217 usecs
 [   57.753915] s3c_pm_check: Suspend memory scan took 3429833 usecs
 [   57.753915] s3c_pm_check: Resume memory scan took 1104522 usecs

Change-Id: Id57e5c76788ec1cfb4d09d1a99e6b2e10a56f184
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37725
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
11 years agosamsung: pm-check: Add interleaving support
Doug Anderson [Thu, 8 Nov 2012 23:14:04 +0000 (15:14 -0800)]
samsung: pm-check: Add interleaving support

When pm-check is used in conjunction with bitfix we can get much
faster processing times if we change the order that we process chunks.
Add support for changing the order that we process pages in save so
that bitfix can use it.

BUG=chrome-os-partner:15655
TEST=Timed before and after and saw 500-600ms speedup.  See associated
bitfix change (dd13e37d3ca428eb89ee6d9afe3b258ec4ca0bfd) for details.

Change-Id: If2b720a75f5274df0e5dc11d77662d73a4581ffb
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37690
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
11 years agosamsung: snow: bitfix: Use linux xor code
Doug Anderson [Thu, 8 Nov 2012 21:27:10 +0000 (13:27 -0800)]
samsung: snow: bitfix: Use linux xor code

Linux already has some xor code that was optimized for RAID.  Include
it and use it for bitfix.  This appears to save 200-300 ms.

BUG=chrome-os-partner:15655
TEST=Timed before and after:
Before:
 [   28.344096] s3c_pm_check: Suspend memory scan took 4341511 usecs
 [   28.344096] s3c_pm_check: Resume memory scan took 1204971 usecs
 [   40.794096] s3c_pm_check: Suspend memory scan took 4372845 usecs
 [   40.794096] s3c_pm_check: Resume memory scan took 1205185 usecs
 [   53.689130] s3c_pm_check: Suspend memory scan took 4348640 usecs
 [   53.689130] s3c_pm_check: Resume memory scan took 1205305 usecs
After:
 [   34.604046] s3c_pm_check: Suspend memory scan took 4000453 usecs
 [   34.604046] s3c_pm_check: Resume memory scan took 1202673 usecs
 [   48.804021] s3c_pm_check: Suspend memory scan took 3991251 usecs
 [   48.804021] s3c_pm_check: Resume memory scan took 1202789 usecs
 [   62.234132] s3c_pm_check: Suspend memory scan took 4161455 usecs
 [   62.234132] s3c_pm_check: Resume memory scan took 1203661 usecs
 [   83.439127] s3c_pm_check: Suspend memory scan took 4002259 usecs
 [   83.439127] s3c_pm_check: Resume memory scan took 1205180 usecs

Change-Id: I17a6d6b8c072ac0fe04ae2fa8762374aafcae7ff
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37691
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
11 years agosamsung: snow: bitfix: Panic if too many bits fixed in 1 chunk
Doug Anderson [Thu, 8 Nov 2012 01:05:13 +0000 (17:05 -0800)]
samsung: snow: bitfix: Panic if too many bits fixed in 1 chunk

If we see too much corruption in a single chunk then that's a sign
that we're in a state that we can't recover from (either a bitfix
internal error or a corruption of some memory that can't be checked).
Panic in that case.

BUG=chrome-os-partner:15655
TEST=suspend_stress_test
TEST=In code change MAX_BYTES_TO_FIX to 3 and then re-run test.
See a reboot and see the panic in /var/spool/crash:
  <7>[  163.818802] s3c_pm_check: Restore CRC error at 71734000 (6da6143e vs 1d894763)
  <6>[  163.818802] bitfix_recover_chunk: Attempting recovery at 71734000
  <6>[  163.818802] ...fixed 0x71735644 from 0xbadc0de1 to 0x00000000 (4 bytes)
  <5>[  163.818802] ------------[ cut here ]------------
  <2>[  163.818802] kernel BUG at .../arch/arm/mach-exynos/bitfix-snow.c:504!
  <0>[  163.818802] Internal error: Oops - BUG: 0 [#1] SMP ARM
  <5>[  163.818802] Modules linked in: i2c_dev uinput isl29018(C) industrialio(C) sbs_battery rfcomm btmrvl_sdio btmrvl bluetooth fuse nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter xt_mark ip6_tables mwifiex_sdio mwifiex cfg80211 spidev uvcvideo videobuf2_vmalloc asix smsc95xx usbnet joydev
  <5>[  163.818802] CPU: 0    Tainted: G         C    (3.4.0 #4)
  <5>[  163.818802] PC is at bitfix_recover_chunk+0x220/0x244
  <5>[  163.818802] LR is at bitfix_recover_chunk+0x20c/0x244
  ...
  <5>[  163.818802] [<80024f5c>] (bitfix_recover_chunk+0x220/0x244) from [<8002786c>] (s3c_pm_runcheck+0x158/0x2a0)
  ...

Change-Id: Iaad53d821231f419cb1e44a9e1ef3c8ec36973d2
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37600
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
11 years agosamsung: pm-check: Speed up memory exclusion check
Doug Anderson [Thu, 8 Nov 2012 23:35:42 +0000 (15:35 -0800)]
samsung: pm-check: Speed up memory exclusion check

Changed the memory exclusion change to assume that we're working
on one page at a time.  This is mostly useful in bitfix which
can do a simple calculation instead of a loop.

BUG=chrome-os-partner:15655
TEST=Timed before and after:
Before:
 [   65.769646] s3c_pm_check: Suspend memory scan took 4304997 usecs
 [   65.769646] s3c_pm_check: Resume memory scan took 1176677 usecs
 [   80.684717] s3c_pm_check: Suspend memory scan took 4319001 usecs
 [   80.684717] s3c_pm_check: Resume memory scan took 1172676 usecs
 [  101.599638] s3c_pm_check: Suspend memory scan took 4331624 usecs
 [  101.599638] s3c_pm_check: Resume memory scan took 1173586 usecs

With samsung: pm-check: Change exclusions to be per page:
 [   83.759770] s3c_pm_check: Suspend memory scan took 4695243 usecs
 [   83.759770] s3c_pm_check: Resume memory scan took 1271669 usecs
 [   99.309735] s3c_pm_check: Suspend memory scan took 4695435 usecs
 [   99.309735] s3c_pm_check: Resume memory scan took 1270742 usecs
 [  115.154743] s3c_pm_check: Suspend memory scan took 4600779 usecs
 [  115.154743] s3c_pm_check: Resume memory scan took 1270537 usecs

With samsung: pm-check: Speed up memory exclusion check:
 [   28.344096] s3c_pm_check: Suspend memory scan took 4341511 usecs
 [   28.344096] s3c_pm_check: Resume memory scan took 1204971 usecs
 [   40.794096] s3c_pm_check: Suspend memory scan took 4372845 usecs
 [   40.794096] s3c_pm_check: Resume memory scan took 1205185 usecs
 [   53.689130] s3c_pm_check: Suspend memory scan took 4348640 usecs
 [   53.689130] s3c_pm_check: Resume memory scan took 1205305 usecs
TEST=suspend_stress_test

Change-Id: I71b6f84e12af6d2aa28373262650e8fa25abb1ea
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37679
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
11 years agosamsung: snow: bitfix: Fix missing kunmap_atomic() when bitfixing
Doug Anderson [Fri, 9 Nov 2012 21:04:32 +0000 (13:04 -0800)]
samsung: snow: bitfix: Fix missing kunmap_atomic() when bitfixing

A recent change ("samsung: pm-check: Change exclusions to be per
page") introduced a bug where pages wouldn't get unmapped after
bitfix.  Fix the bug.

BUG=chrome-os-partner:15655
TEST=suspend_stress_test

Change-Id: I25d86c5b583309e8ff1115daca436cc625fee9c7
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37754
Reviewed-by: Michael Spang <spang@chromium.org>
11 years agoarm: xor: Add prefetch options
Doug Anderson [Fri, 9 Nov 2012 01:02:28 +0000 (17:02 -0800)]
arm: xor: Add prefetch options

On my current system these options aren't faster than the assembly but
it doesn't hurt to try them.  This also avoids a warning about unused
statics.

BUG=None
TEST=No more warning.  'dmesg | grep xor' at bootup still shows
we're using the arm4regs function.

Change-Id: I4d566a79efb7bc7dbbbd7d766681b089ffe07326
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37687
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
11 years agoCHROMIUM: MALI: added stack traces for gpu faults
Gabriele Paoloni [Mon, 5 Nov 2012 09:37:43 +0000 (09:37 +0000)]
CHROMIUM: MALI: added stack traces for gpu faults

Add stack traces for gpu faults.  This is temporary for helping with
problems in the field.

Signed-off-by: Gabriele Paoloni <gabriele.paoloni@arm.com>
BUG=chrome-os-partner:1556
TEST=build and boot

Change-Id: Id79c6e4d339ae362df9497beb936ebdfd45931ea
Reviewed-on: https://gerrit.chromium.org/gerrit/37349
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
Reviewed-by: Anush Elangovan <anush@chromium.org>
11 years agoPM / Sleep: exynos: mct: Mark hi2 local static suspend_volatile_bss
Jonathan Kliegman [Fri, 9 Nov 2012 15:38:46 +0000 (10:38 -0500)]
PM / Sleep: exynos: mct: Mark hi2 local static suspend_volatile_bss

If ktime_get is called, the local static hi2 gets updated when clock->read()
is called.  As this is called when testing timings in pm-check, make sure to mark it
is marked as suspend_volatile_bss.

BUG=None
TEST=With timings on and bitfix enabled, saw hi2's address being fixed.
  After patch saw it no longer being affected.
Signed-off-by: Jonathan Kliegman <kliegs@chromium.org>
Change-Id: I060dbd6a46085def936a14b6dfbb051570c40a85
Reviewed-on: https://gerrit.chromium.org/gerrit/37711
Tested-by: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Ready: Jon Kliegman <kliegs@chromium.org>

11 years agoPM / Sleep: suspend_volatile: Remove spinlock in overlap check
Jonathan Kliegman [Fri, 9 Nov 2012 15:02:24 +0000 (10:02 -0500)]
PM / Sleep: suspend_volatile: Remove spinlock in overlap check

pm_does_overlap_suspend_volatile is only called when scheduling disabled
and can not be interrupted.  It is also called frequently.  Remove the
spinlock acquistion to speedup suspend/resume times.

BUG=None
TEST=Compared timings before and after.
  Ensured no warnings in log.
  Did cycle of 200 suspend/resumes on fixed bios successfully.
  Still caught errors on bad bios correctly.

Change-Id: Ifce238e223e25121b48c880407f712305cdde825
Signed-off-by: Jonathan Kliegman <kliegs@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37708
Reviewed-by: Doug Anderson <dianders@chromium.org>
11 years agosamsung: pm-check: Change exclusions to be per page
Jonathan Kliegman [Thu, 8 Nov 2012 20:57:09 +0000 (15:57 -0500)]
samsung: pm-check: Change exclusions to be per page

Increase granularity to page-level exclusions.  This helps
set the way for doing smarter exclusions based on if a page
is allocated or not.

BUG=None
TEST=Run on machines with and without bad memory
  Confirm 500 runs on good machine with no false positives
  Confirm bitfix and pm_check properly detect and correct errors

Change-Id: Ibeab83dbc822637dc0b4857bb9883acc5b6ab7c5
Signed-off-by: Jonathan Kliegman <kliegs@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37646
Reviewed-by: Doug Anderson <dianders@chromium.org>
11 years agoCHROMIUM: ath9k: dump_eep_power in debugfs only with eep_ops support
Jason Abele [Fri, 9 Nov 2012 18:17:08 +0000 (10:17 -0800)]
CHROMIUM: ath9k: dump_eep_power in debugfs only with eep_ops support

The ath9k driver is adding a dump_eep_power debugfs file
even when there is no corresponding eep_ops support for
dump_eep_power.

Accessing dump_eep_power on platforms without support for
dump_eep_power leads to kernel crashes, so do not add the
debugfs entry for those platforms.

Signed-off-by: Jason Abele <jabele@chromium.org>
BUG=None
TEST=Do the following:
ls /sys/kernel/debug/ieee80211/phy0/ath9k/
make sure dump_eep_power does not exist on mario
Change-Id: I10cc18c4322481efc49cea7d608852b60cdcf904
Reviewed-on: https://gerrit.chromium.org/gerrit/37726
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Jason Abele <jabele@chromium.org>
Tested-by: Jason Abele <jabele@chromium.org>
11 years agoCHROMIUM: md: bootcache if init fails, mark invalid
Paul Taysom [Wed, 17 Oct 2012 16:58:00 +0000 (09:58 -0700)]
CHROMIUM: md: bootcache if init fails, mark invalid

On any failure that doesn't fully initialize the bootcache,
it should set mark the cache as invalid so the bootcache
utility can rebuild the bootcache.

BUG=chromium-os:35378
TEST=ran bootcachetest on stumpy, arm

Change-Id: I3331ba0bc505445310c52a7c73a334106fd7141b
Signed-off-by: Paul Taysom <taysom@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/35837
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
11 years agoCHROMIUM: md: bootcache don't delete sys files
Paul Taysom [Wed, 17 Oct 2012 16:54:12 +0000 (09:54 -0700)]
CHROMIUM: md: bootcache don't delete sys files

Because the device mapper already deletes any sys files
created by dm-bootcache, it shouldn't delete them
when cleaning up.

BUG=chromium-os:35377
TEST=ran bootcachetest on stumpy, arm

Change-Id: I73d40a6de17b15827da2dd421a29294e286ebc1a
Signed-off-by: Paul Taysom <taysom@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/35836
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
11 years agoCHROMIUM: md: bootcache check metadata and data lengths
Paul Taysom [Mon, 15 Oct 2012 16:42:54 +0000 (09:42 -0700)]
CHROMIUM: md: bootcache check metadata and data lengths

bootcache now verifies that the lengths for metadata and data
make sense and fit with in the partition.

BUG=chromium-os:35379
TEST=ran bootcachetest on stumpy, arm

Change-Id: I6beee3a5b1aa723aaf08c673a004bc4924afc42d
Signed-off-by: Paul Taysom <taysom@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/35578
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
11 years agoCHROMIUM: mm: Fix calculation of dirtyable memory
Puneet Kumar [Thu, 8 Nov 2012 07:47:01 +0000 (23:47 -0800)]
CHROMIUM: mm: Fix calculation of dirtyable memory

The system uses global_dirtyable_memory() to calculate
number of dirtyable pages/pages that can be allocated
to the page cache.  A bug causes an underflow thus making
the page count look like a big unsigned number.  This in turn
confuses the dirty writeback throttling to aggressively write
back pages as they become dirty (usually 1 page at a time).

Fix is to ensure there is no underflow while doing the math.

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
Signed-off-by: Puneet Kumar <puneetster@chromium.org>
BUG=chrome-os-partner:16011
TEST=Manual; boot kernel, powerwash, login with testaccount and
make sure no jank occurs on sync of applications

Change-Id: I614e7c3156e014f0f28a4ef9bdd8cb8a2cd07b2a
Reviewed-on: https://gerrit.chromium.org/gerrit/37612
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Puneet Kumar <puneetster@chromium.org>
Reviewed-by: Puneet Kumar <puneetster@chromium.org>
Tested-by: Puneet Kumar <puneetster@chromium.org>
11 years agosamsung: pm-check: Make checksum algorithm more configurable and add sum
Doug Anderson [Wed, 7 Nov 2012 19:00:35 +0000 (11:00 -0800)]
samsung: pm-check: Make checksum algorithm more configurable and add sum

There are good reasons for using different checksums in pm-check.  Add
'sum' and generalize mechanism for switching checksum algorithms.

The 'sum' algorithm is now the default.

BUG=chrome-os-partner:15655
TEST=Put code in to do a bogus corruption of address
0x71735644 to 0xBADC0DE1.  Then:
1. Do a suspend/resume and see sum algorithm (0xffffffff + 0xbadc0de1):
    s3c_pm_check: Restore CRC error at 71734000 (badc0de0 vs ffffffff)
    bitfix_recover_chunk: Attempting recovery at 71734000
    ...fixed 0x71735644 from 0xbadc0de1 to 0x00000000
2. Switch to xor:
    echo -n xor > /sys/module/pm_check/parameters/pm_check_checksum_type
3. Do suspend/resume again and see xor algorithm (0xffffffff ^ 0xbadc0de1)
    s3c_pm_check: Restore CRC error at 71734000 (4523f21e vs ffffffff)
    bitfix_recover_chunk: Attempting recovery at 71734000
    ...fixed 0x71735644 from 0xbadc0de1 to 0x00000000
4. Switch to CRC:
    echo -n crc > /sys/module/pm_check/parameters/pm_check_checksum_type
5. Do suspend/resume again and see crc algorithm
    s3c_pm_check: Restore CRC error at 71734000 (57243536 vs 270b666b)
    bitfix_recover_chunk: Attempting recovery at 71734000
    ...fixed 0x71735644 from 0xbadc0de1 to 0x00000000
TEST=Time by doing this for sum:
    echo Y > /sys/module/pm_check/parameters/pm_check_print_timings
    suspend_stress_test --noerrors_fatal --backup_rtc \
        --suspend_min 15 --suspend_max 15 -c2
    dmesg | grep 'memory scan'
...and saw this, which is same as xor:
    s3c_pm_check: Suspend memory scan took 4519985 usecs
    s3c_pm_check: Resume memory scan took 1181126 usecs
    s3c_pm_check: Suspend memory scan took 4596896 usecs
    s3c_pm_check: Resume memory scan took 1184638 usecs
...note that the above includes bitfix, which is why suspend is 4.5
seconds.

Change-Id: Ifd20c5d3f6da5069634360057120b63e232f8a77
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37592
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
11 years agoCHROMIUM: config: exynos5: Turn on bitfix
Doug Anderson [Wed, 31 Oct 2012 21:28:04 +0000 (14:28 -0700)]
CHROMIUM: config: exynos5: Turn on bitfix

Enable bitfix code.  This code is safe to enable always--it will
autodetect when it's needed.

BUG=chrome-os-partner:15655
TEST=suspend_stress_test

Change-Id: I9fc03f05c1e894dcf196e2e2a256ae87f8dc4384
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37066
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
11 years agosamsung: snow: bitfix: Recover from bit errors across sleep/wake
Doug Anderson [Wed, 31 Oct 2012 17:55:02 +0000 (10:55 -0700)]
samsung: snow: bitfix: Recover from bit errors across sleep/wake

Some Snow boards have an issue in read-only firmware that can cause
bit errors across a suspend/resume cycle.  Given the pattern of the
corruption we can actually recover from nearly all bit errors given a
little bit of perparation time.

A full description of the problem and solution can be found in
bitfix-snow.c.

This change recovers from most cases of corruption but can still
be made more robust and optimized.

At the moment this code appears to add about 3.5 seconds to
suspend time and ~nothing to resume time.  That's on top of the
~1 second for pm-check.

BUG=chrome-os-partner:15655
TEST=Run the following script:
  cd /var/log
  touch sst.txt
  echo '------------' >> sst.txt
  date >> sst.txt
  while true; do
    suspend_stress_test --noerrors_fatal --backup_rtc \
      --suspend_min 15 --suspend_max 15 | tee -a sst.txt
    dmesg | \
      grep "\(CRC error\|bitfix\|...fixed\|[rR]ecover\)" \
      >> sst.txt
    dmesg -C
  done
See messages like:
  [  229.959279] s3c_pm_check: Restore CRC error at 86856000 (6a5fe07c vs 6acbe07c)
  [  229.959279] bitfix_recover_chunk: Attempting recovery at 86856000
  [  229.959279] ...fixed 0x86857140 from 0x76b47894 to 0x76b07894
  [  229.959279] ...fixed 0x8685751c from 0x00100051 to 0x00000051
  [  229.959279] ...fixed 0x86857d54 from 0x77773604 to 0x77f73604
  [  229.959279] s3c_pm_check: Recovered
  [  229.959279] s3c_pm_check: Restore CRC error at 86858000 (4e502299 vs 4e5b2299)
  [  229.959279] bitfix_recover_chunk: Attempting recovery at 86858000
  [  229.959279] ...fixed 0x86858358 from 0x76f8a3d8 to 0x76f9a3d8
  [  229.959279] ...fixed 0x86858f2c from 0x00080002 to 0x00000002
  [  229.959279] ...fixed 0x86859b64 from 0x00021a66 to 0x00001a66
  [  229.959279] s3c_pm_check: Recovered
TEST=Run bitfix-test.sh from I26b3938fe5c481968dc019f188f46d211dd6a801
TEST=Time by doing:
  echo Y > /sys/module/pm_check/parameters/pm_check_print_timings
  suspend_stress_test --noerrors_fatal --backup_rtc \
      --suspend_min 15 --suspend_max 15 -c3
  dmesg | grep 'memory scan'
See:
  [ 1433.174264] s3c_pm_check: Suspend memory scan took 4434401 usecs
  [ 1433.174264] s3c_pm_check: Resume memory scan took 1122626 usecs
  [ 1445.639303] s3c_pm_check: Suspend memory scan took 4460913 usecs
  [ 1445.639303] s3c_pm_check: Resume memory scan took 1122503 usecs
  [ 1458.219387] s3c_pm_check: Suspend memory scan took 4455245 usecs
  [ 1458.219387] s3c_pm_check: Resume memory scan took 1122534 usecs
TEST=Boot with old bios and see bitfix get enabled by doing:
  dmesg | grep bitfix_reserve
...and see:
  [    0.000000] bitfix_reserve: Detected firmware that needs bitfix
TEST=Run with legacy BIOS (doesn't set RO string) and enable manually
  echo 'Y' > /sys/module/bitfix_snow/parameters/bitfix_enabled
  echo 'Y' > /sys/module/pm_check/parameters/pm_check_enabled
...see bits get fixed using tests above.

Change-Id: I9c7ac2f85b8d9398c93f486f9401daee1526f571
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36905
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
11 years agoPM / Sleep: Mark oops_id as suspend_volatile
Doug Anderson [Thu, 8 Nov 2012 00:28:02 +0000 (16:28 -0800)]
PM / Sleep: Mark oops_id as suspend_volatile

Without this if we have a WARN_ON hit in suspend/resume code we'll
detect this as a CRC error.

BUG=chrome-os-partner:15655
TEST=Try to measure timings (which prints out a warning).
  echo Y > /sys/module/pm_check/parameters/pm_check_print_timings
  suspend_stress_test --noerrors_fatal --backup_rtc \
      --suspend_min 15 --suspend_max 15 -c1
Before this CL you'll see a CRC error:
  s3c_pm_check: Restore CRC error at 407bc000 (08e3f07b vs 08e3f079)
  bitfix_recover_chunk: Attempting recovery at 407bc000
  ...fixed 0x407bdeb0 from 0x76d4a47b to 0x76d4a479
After this CL there will be no CRC error.

Change-Id: I276bd69156bea6bd5b4c32274898e7c4ded03eb5
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37591
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
11 years agoCHROMIUM: drm/i915: Workaround disappearing AVI Infoframe on resume
Stéphane Marchesin [Thu, 8 Nov 2012 01:11:22 +0000 (17:11 -0800)]
CHROMIUM: drm/i915: Workaround disappearing AVI Infoframe on resume

The AVI Infoframe disappears on SNB after suspend/resume. This patch
works around what seems to be a hardware issue by doing a dummy register
write on DPMS calls.

BUG=chrome-os-partner:16054
TEST=with the HDMI analyzer: suspend/resume parrot, verify that
TEST=the AVI infoframe is still here

Change-Id: I7cb880408db3cd279d09cb7a53f6787c14e03027
Reviewed-on: https://gerrit.chromium.org/gerrit/37596
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stuart Abercrombie <sabercrombie@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>

11 years agoCHROMIUM: Input: cyapa - Send uevent when device detection fails
Yufeng Shen [Thu, 1 Nov 2012 22:46:02 +0000 (18:46 -0400)]
CHROMIUM: Input: cyapa - Send uevent when device detection fails

Fire an uevent when device detection fails so that userspace can
take some actions (e.g. gathering relevant logs).

Signed-off-by: Yufeng Shen <miletus@chromium.org>
BUG=chromium-os:35169
TEST=No consistent way to repro the device detection failure. So
     no test for now.

Change-Id: Ie2951f6dc69d6afaf9b3e37b97d7383f0eb53df8
Reviewed-on: https://gerrit.chromium.org/gerrit/37147
Reviewed-by: Benson Leung <bleung@chromium.org>
Commit-Ready: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
11 years agoCHROMIUM: Input: psmouse - retry getid command in psmouse_probe()
Chung-yih Wang [Tue, 2 Oct 2012 07:46:10 +0000 (15:46 +0800)]
CHROMIUM: Input: psmouse - retry getid command in psmouse_probe()

As the synaptics device may not respond to the first command in psmouse_probe
when a machine is booting up, the patch gives a second probe if the first
one fails.

Signed-off-by: Chung-yih Wang <cywang@chromium.org>
BUG=chrome-os-partner:14638
TEST=on device; do the following steps:

1. make sure there is no other USB devices plugged into the machine.
2. mount -o rw,remount /
3. create a script file test-synaptics-present.conf under /etc/init with following.

cat > /etc/init/test-synaptics-present.conf <<EOF
start on starting system-services
script
  DEV=/sys/devices/platform/i8042/serio4/serio5/input/input9
  sleep 15
  if [ -e \$DEV ]; then
    logger 'Synaptics Trackpad found at \$DEV'
    shutdown -r now
  else
    logger 'Synaptics Trackpad NOT found at \$DEV'
  fi
end script

4. reboot, then the machine should keep rebooting every 15+ seconds.

Change-Id: Ieb81acf75bb79ac9f34f9b01fbe3d8f4b6a367b2
Reviewed-on: https://gerrit.chromium.org/gerrit/34405
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
11 years agoPM / Sleep: arm: mmu: Mark fixed ptes as volatile during suspend
Jonathan Kliegman [Tue, 6 Nov 2012 21:35:09 +0000 (16:35 -0500)]
PM / Sleep: arm: mmu: Mark fixed ptes as volatile during suspend

Make the page table entries used by kmap_atomic as volatile so we ignore
changes made to them during the memory checksum operations on suspend/resume.

BUG=chrome-os-partner:15914
TEST=Saw location 0xaf7fe400 generate false CRC errors before patch
  After patch changes to that page are ignored.
  Confirmed with additional debug printing that the supression is added

Change-Id: I6766099aa0e86c479b26ee18d69b537493e84dfc
Signed-off-by: Jonathan Kliegman <kliegs@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37463
Reviewed-by: Michael Spang <spang@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
11 years agosamsung: pm-check: Cleanup chunk exclude code to use suspend_volatile
Doug Anderson [Mon, 5 Nov 2012 22:50:18 +0000 (14:50 -0800)]
samsung: pm-check: Cleanup chunk exclude code to use suspend_volatile

Recent changes mark memory that may change across suspend/resume
as suspend_volatile.  We can now use this in pm-check, so do so.
That means we can remove some extra globals from printk.c.

This change also cleans up handling of sleep_save_sp:
* Don't exclude *sleep_save_sp.  That was a physical address and is
  also already handled by current_thread_info().
* Don't exclude sleep_save_sp.  Instead: we zero it out before out
  code runs.  This is a transitory value and zeroing it is fine.  Now
  we won't exclude chunks of memory stored near sleep_save_sp.

...and a few other minor fixes:
* Skips regions in s3c_pm_makecheck() too.
* Avoids goto in s3c_pm_runcheck() loop.

BUG=chrome-os-partner:15914
TEST=suspend_stress_test

Change-Id: I5eadc7631c3f31f91138170c5e37430da7e3520b
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37359
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
11 years agoCHROMIUM: tpm: always run ContinueSelftest at resume
Luigi Semenzato [Tue, 6 Nov 2012 22:47:46 +0000 (14:47 -0800)]
CHROMIUM: tpm: always run ContinueSelftest at resume

In a previous patch we moved ContinueSelfTest out of the resume path
to speed it up, and we skip the command if enough time has passed
between the resume and the first following TPM command, on the
assumption that the TPM starts and runs the self test to completion
at resume time.  (This applies only to TPMs that are powered off
between suspend and resume.)

The ST Micro TPM behaves differently and needs ContinueSelfTest
to be called at resume, before the next TPM command can be
successfully executed.  We could make the behavior of the
resume callback depend on the TPM model.  However, ContinueSelftest
completes quickly on all TPM models currently used in Chromebooks,
and it's not on any critical path.  So we prefer to make the
code simpler for everybody.

BUG=chrome-os-partner:15694
TEST=tested manually

Change-Id: I62e12db3506947e757ea251a9f8915ffae6ac106
Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37468
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
11 years agoPM / Sleep: ramoops: Mark ramoops buffer as suspend volatile
Doug Anderson [Mon, 5 Nov 2012 22:50:21 +0000 (14:50 -0800)]
PM / Sleep: ramoops: Mark ramoops buffer as suspend volatile

If we don't have no_console_suspend and we have PSTORE_CONSOLE
defined then we might end up writing to the ramoops buffer during
suspend/resume.  Mark that memory as suspend volatile.

BUG=chrome-os-partner:15914
TEST=suspend_stress_test

Change-Id: I8e64c68938c3151ac4e96ed69d45c1ec40799134
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37387
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>