cascardo/linux.git
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>
11 years agoPM / Sleep: printk: Mark some printk globals as suspend volatile
Doug Anderson [Mon, 5 Nov 2012 20:59:13 +0000 (12:59 -0800)]
PM / Sleep: printk: Mark some printk globals as suspend volatile

This tags global variables in printk that are known to be touched
during suspend/resume.

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

Change-Id: I393536bb4fb1b985b43fa1a3bec253ca81cb99b0
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37386
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>
11 years agoPM / Sleep: Add the concept of suspend_volatile
Doug Anderson [Mon, 5 Nov 2012 18:18:36 +0000 (10:18 -0800)]
PM / Sleep: Add the concept of suspend_volatile

In order to catch suspend/resume problems we would like to run a CRC
over most of memory before and after sleep and compare the results.
To do this we need to know which memory regions the suspend/resume
code touches and avoid running the CRC over those regions.

We will consider those regions to be "suspend volatile".  The CRC code
will skip chunks of memory tagged as suspend volatile to avoid falsely
reporting CRC errors.

We add the ability to mark global variables as suspend volatile
(keeping them in a special section) and also the ability to register
dynamic chunks of memory as volatile.

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

Change-Id: I7964f5886d6b62fbca8d82986db20eae83ad0918
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37385
Reviewed-by: Michael Spang <spang@chromium.org>
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
11 years agoaddr_overlap: Add functions for checking address range overlap
Doug Anderson [Tue, 6 Nov 2012 21:04:16 +0000 (13:04 -0800)]
addr_overlap: Add functions for checking address range overlap

These functions are simple but nice to have in one place.  Code
is based on in_region() from arch/arm/plat-samsung/pm-check.c.
There is similar code in memblock in memblock_addrs_overlap().

BUG=chrome-os-partner:15914
TEST=Use in future CLs.

Change-Id: I4faec4fb977215e0858bec8f0c0b988edb619457
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37467
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>
11 years agoCHROMIUM: r8169.c: Fix WOL setting after resume from S3.
Shawn Nematbakhsh [Thu, 1 Nov 2012 22:05:11 +0000 (15:05 -0700)]
CHROMIUM: r8169.c: Fix WOL setting after resume from S3.

After resume from S3, register Config3 comes up as 0x60 (enable WOL),
regardless of previous state. Fix is to save previous state of Config3
and related WOL register bits and restore them upon resume.

BUG=chrome-os-partner:12129
TEST="ethtool eth0" after S3 resume and check that WOL is disabled. Also
verify that network card still functions as normal after resume.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I2495b71029ccc30f406aea60cfd843b3cc6c711e
Reviewed-on: https://gerrit.chromium.org/gerrit/37143
Commit-Ready: Shawn Nematbakhsh <shawnn@google.com>
Reviewed-by: Shawn Nematbakhsh <shawnn@google.com>
Tested-by: Shawn Nematbakhsh <shawnn@google.com>
11 years agoCHROMIUM: Input: cyapa - Remove capability array
Benson Leung [Wed, 24 Oct 2012 02:40:02 +0000 (19:40 -0700)]
CHROMIUM: Input: cyapa - Remove capability array

It's not actually used for anything. It's just making our cyapa
structure 14 bytes larger.

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

Change-Id: I676fb04ce49172fba5a751a24219bd7c3f451d17
Reviewed-on: https://gerrit.chromium.org/gerrit/36410
Tested-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Benson Leung <bleung@chromium.org>

11 years agoCHROMIUM: Input: cyapa - Set IRQF_ONESHOT for threaded irq
Benson Leung [Wed, 7 Nov 2012 00:28:47 +0000 (16:28 -0800)]
CHROMIUM: Input: cyapa - Set IRQF_ONESHOT for threaded irq

Starting with commit 1c6c69525b ("genirq: Reject bogus threaded irq requests")
threaded IRQs without a primary handler need to be requested with
IRQF_ONESHOT to make sure the irq isn't unmasked before the thread
is finished.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:36125,chromium-os:21047
TEST=verify that the trackpad works, generates events when you move
a finger over it (ie, interrupts are working).

Change-Id: I2ff6294a09509da548624ca1229c5206c758cb7a
Reviewed-on: https://gerrit.chromium.org/gerrit/37493
Tested-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Benson Leung <bleung@chromium.org>

11 years agoCHROMIUM: Input: cyapa - Clean up button capabilities
Benson Leung [Wed, 24 Oct 2012 06:42:35 +0000 (23:42 -0700)]
CHROMIUM: Input: cyapa - Clean up button capabilities

We don't need three boolean variables representing left, middle, right.
Lets just save to u8 btn_capability, and mask for the relevant bits
when we need to report left, middle, or right.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=builds clean
Test on butterfly system. Using a test image.
1. run evtest, select Cypress APA Trackpad (cyapa)
2. left click
3. Verify left click generates BTN_LEFT event
4. right click
5. Verify right click generates BTN_RIGHT event

Change-Id: I8814a63a2b45b9edd54a97a2677e7837d3b312d9
Reviewed-on: https://gerrit.chromium.org/gerrit/36450
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
11 years agoBACKPORT: r8169: enable internal ASPM and clock request settings
hayeswang [Thu, 1 Nov 2012 16:46:28 +0000 (16:46 +0000)]
BACKPORT: r8169: enable internal ASPM and clock request settings

The following chips need to enable internal settings to let ASPM
and clock request work.

RTL8111E-VL, RTL8111F, RTL8411, RTL8111G
RTL8105, RTL8402, RTL8106

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d64ec841517a25f6d468bde9f67e5b4cffdc67c7)

Resolve conflicts as follows:

In the original CL, changes are made to many chip-specific configuration
functions, such as rtl_hw_start_8168e_2, rtl_hw_start_8402, etc. Our
source is missing some of these configuration functions and others do
not integrate cleanly. Therefore, only apply the changes to the hw_start
functions that integrate cleanly:

rtl_hw_start_8168e_2
rtl_hw_start_8105e_1

TEST=Confirm basic functionality on 8168e and 8105e cards.
BUG=chrome-os-partner:15923

Change-Id: Ib790aeb102920e127c43f74a9643e89afdffc251
Reviewed-on: https://gerrit.chromium.org/gerrit/37418
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Commit-Ready: Shawn Nematbakhsh <shawnn@google.com>
Tested-by: Shawn Nematbakhsh <shawnn@google.com>
11 years agoUPSTREAM: mwifiex: process RX packets in SDIO IRQ thread directly
Bing Zhao [Fri, 2 Nov 2012 02:32:36 +0000 (19:32 -0700)]
UPSTREAM: mwifiex: process RX packets in SDIO IRQ thread directly

ksdioirqd has higher priority than kworker. Process RX packets
in SDIO IRQ thread (ksdioirqd/mmcX) directly instead of deferring
the work to kworker to avoid the extra latency.
This improves TCP throughput 15~20% on an ARM platform with SDIO
2.0 controller.

BUG=chrome-os-partner:15867
TEST=TCP throughput improvements (TX 17%, RX 18%) are measured in
shieldroom with '*_CPU_GOVERNOR' set to 'performance' in
/etc/laptop-mode/conf.d/cpufreq.conf

Change-Id: I2de0020540d4b24e3084be21efa880daf186d43a
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/37182
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Sam Leffler <sleffler@chromium.org>
11 years agoCHROMIUM: ramoops: Avoid calling time functions when timekeeping disabled
Doug Anderson [Mon, 5 Nov 2012 19:35:20 +0000 (11:35 -0800)]
CHROMIUM: ramoops: Avoid calling time functions when timekeeping disabled

Calling the time functions when timekeeping is disabled will cause a
WARN_ON() to happen.  This appears to deadlock things.  Better to just
not call the function when we shouldn't.

BUG=chrome-os-partner:15655
TEST=suspend_stress_test
...ran with no serial console (AKA "console=" on kernel cmdline).

Change-Id: I1fa3430ea279c4bc79c3fb5e82228b380fecb60a
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37364
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
11 years agoBACKPORT: module: add flags arg to sys_finit_module()
Rusty Russell [Mon, 22 Oct 2012 07:39:41 +0000 (18:09 +1030)]
BACKPORT: module: add flags arg to sys_finit_module()

Thanks to Michael Kerrisk for keeping us honest.  These flags are actually
useful for eliminating the only case where kmod has to mangle a module's
internals: for overriding module versioning.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Acked-by: Kees Cook <keescook@chromium.org>
(backported from Rusty's modules-next tree)

BUG=None, keeping us in sync with upstream for this API
TEST=daisy build, manual testing
CQ-DEPEND=I5b5a9bee3f9e73eb076f01e8aacee51eff095c56

Change-Id: I40f0b55ff903dda411a04b088f4ca5b6ab5cf05e
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37278
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
11 years agoUPSTREAM: r8169: 8168c and later require bit 0x20 to be set in Config2 for PME signaling.
Francois Romieu [Tue, 17 Apr 2012 09:12:01 +0000 (11:12 +0200)]
UPSTREAM: r8169: 8168c and later require bit 0x20 to be set in Config2 for PME signaling.

The new 84xx stopped flying below the radars.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
(cherry picked from commit d387b427c973974dd619a33549c070ac5d0e089f)

Signed-off-by: Shawn Nematbakhsh <shawnn@google.com>
BUG=chrome-os-partner:14994
TEST=suspend/resume, then check ethernet function on 8168c

Change-Id: I978ff6a80e8575848094ffd85a8aab5cd80ec97a
Reviewed-on: https://gerrit.chromium.org/gerrit/37328
Tested-by: Shawn Nematbakhsh <shawnn@google.com>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Ready: Shawn Nematbakhsh <shawnn@google.com>

11 years agoUPSTREAM: r8169: Config1 is read-only on 8168c and later.
Francois Romieu [Tue, 17 Apr 2012 09:10:11 +0000 (11:10 +0200)]
UPSTREAM: r8169: Config1 is read-only on 8168c and later.

Suggested by Hayes.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
(cherry picked from commit 851e60221926a53344b4227879858bef841b0477)

Signed-off-by: Shawn Nematbakhsh <shawnn@google.com>
BUG=chrome-os-partner:14994
TEST=suspend/resume, then check ethernet function on 8168c

Change-Id: If48adfd0f35b7727fd0d76764c53291a197963f2
Reviewed-on: https://gerrit.chromium.org/gerrit/37327
Tested-by: Shawn Nematbakhsh <shawnn@google.com>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Ready: Shawn Nematbakhsh <shawnn@google.com>

11 years agoRevert "samsung: pm-check: Cleanup chunk exclude code"
Simon Que [Fri, 2 Nov 2012 23:39:02 +0000 (16:39 -0700)]
Revert "samsung: pm-check: Cleanup chunk exclude code"

This reverts commit a16583b2a0799fffc4f3df22a15a282f851e3735.

BUG=chrome-os-partner:15906
TEST=Run powerd_suspend, should suspend and resume successfully

Change-Id: I5ce64a89a045e1576c45249af2c95ff0cfea06fa
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37312
Reviewed-by: Doug Anderson <dianders@chromium.org>
11 years agoHID: multitouch: Add 6673 PID for Ideacom
Dave Parker [Fri, 2 Nov 2012 20:23:52 +0000 (13:23 -0700)]
HID: multitouch: Add 6673 PID for Ideacom

BUG=None
TEST=Boot kernel on machine with ideacom 6673 controller attached.
Verify usbhid module is loaded for the USB device.

Change-Id: I856f2386b889fb88dcd12300080d28626d0ab528
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37281
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
11 years agoCHROMIUM: ARM: MALI: correct hw counter support locking
Sam Leffler [Tue, 30 Oct 2012 23:28:07 +0000 (16:28 -0700)]
CHROMIUM: ARM: MALI: correct hw counter support locking

Fix locking in the hw counter support.  We cannot use a spinlock
to synchronize the collection work against start/stop because
kbase_instr_hwcnt_dump can block; switch to a mutex.  While here also
synchronize start work which can race in multiple ways with the other
uses of mali_hwcs.  Extend coverage of the mutex in the collection thread
for readability though it's not really needed as the event dispatch work
references only static data which is unaffected by polling being stopped.

While here unique-ify error returns.

Signed-off-by: sleffler@chromium.org
BUG=chrome-os-partner:14556
TEST=verify there are no longer console msgs of the form "BUG: spinlock wrong CPU"; also run concurrent start/stop loops from the shell

Change-Id: Ib74fc5c199212441e0e0ea312f7ca57da7c35278
Reviewed-on: https://gerrit.chromium.org/gerrit/36969
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>

11 years agomwifiex: add multi-queue support
Bing Zhao [Mon, 22 Oct 2012 23:44:53 +0000 (16:44 -0700)]
mwifiex: add multi-queue support

This patch adds support for multiple TX queues inside mwifiex
driver. Four different queues according to WMM access categories
are defined for each virtual interface. When a packet is
received from netdev for transmission, tx pending count for
particular queue is incremented and if tx pending count has
reached upper water-mark, this queue is stopped instead of
stopping all queues. Similarly when a packet is successfully
transmitted from device, tx pending count is decremented per
queue and if pending count falls below lower water-mark, queue
operations are again resumed. This ensures that not all
tranmission is blocked if traffic with particular TOS value
suddenly increases.

Also wake all queues when association/IBSS_join happens to
enable traffic on all queues.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
BUG=chrome-os-partner:15536
TEST=pass pre-WiFi Cert. test case 5.2.30

Change-Id: I7b11c6f3f90943f09deaa7ef37b2975982bc02d3
Reviewed-on: https://gerrit.chromium.org/gerrit/36286
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Bing Zhao <bzhao@marvell.com>
Tested-by: Bing Zhao <bzhao@marvell.com>
11 years agoCHROMIUM: drm/i915: Add backlight support for Link
Stéphane Marchesin [Wed, 31 Oct 2012 00:01:10 +0000 (17:01 -0700)]
CHROMIUM: drm/i915: Add backlight support for Link

This adds device-specific backlight support for Link, and also
enables adaptive backlight by default there.

BUG=chrome-os-partner:13276,chrome-os-partner:15248
TEST=by hand

Change-Id: I9ef546bba9f121657a653aa9cfc6a80bbde55cb0
Reviewed-on: https://gerrit.chromium.org/gerrit/36976
Reviewed-by: Daniel Erat <derat@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoCHROMIUM: drm/i915: Remove adaptive backlight from gen6/lvds.
Stéphane Marchesin [Tue, 30 Oct 2012 02:52:01 +0000 (19:52 -0700)]
CHROMIUM: drm/i915: Remove adaptive backlight from gen6/lvds.

We'll only enable it through the adaptive_backlight device on
Link/gen7/eDP, so prune everything else.

BUG=chrome-os-partner:13276,chrome-os-partner:15248
TEST=by hand

Change-Id: Ib5633a370e736d9afbee441d968f718be814d081
Reviewed-on: https://gerrit.chromium.org/gerrit/36975
Reviewed-by: Daniel Erat <derat@chromium.org>
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: drm/i915: Move the backlight accessor functions in dev_priv
Stéphane Marchesin [Tue, 23 Oct 2012 20:02:22 +0000 (13:02 -0700)]
CHROMIUM: drm/i915: Move the backlight accessor functions in dev_priv

This abstracts those functions, so that we can plug-in
platform-specific alternatives.

BUG=chrome-os-partner:3276,chrome-os-partner:15248
TEST=by hand: compiles, works

Change-Id: I29dd15722ffed8f5813b34bf0ce4431ce0524cc2
Reviewed-on: https://gerrit.chromium.org/gerrit/36974
Reviewed-by: Daniel Erat <derat@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoCHROMIUM: gobi: Keep struct qcusbnet alive while cdev is alive
Michael Spang [Thu, 1 Nov 2012 20:52:46 +0000 (16:52 -0400)]
CHROMIUM: gobi: Keep struct qcusbnet alive while cdev is alive

This fixes an issue where struct qcusbnet is freed while the embedded
character device is still alive.

This uses the ability of cdev to pin an arbitrary kobject by setting
cdev.kobj.parent. We have to switch from kref to kobject to use that.
This is arguably misuse of kobject, but char_dev requires it.t t

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

Change-Id: I309e80c6ec91e491d30ea0bfcb062ae7e55f7198
Signed-off-by: Michael Spang <spang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37135
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: char_dev: pin parent kobject
Dmitry Torokhov [Mon, 22 Oct 2012 00:57:19 +0000 (17:57 -0700)]
UPSTREAM: char_dev: pin parent kobject

In certain cases (for example when a cdev structure is embedded into
another object whose lifetime is controlled by a separate kobject) it is
beneficial to tie lifetime of another object to the lifetime of
character device so that related object is not freed until after
char_dev object is freed.

To achieve this let's pin kobject's parent when doing cdev_add() and
unpin when last reference to cdev structure is being released.

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

Change-Id: I35d1762c94afa8b3eda6329a0bf0cfc7dde98b7b
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Michael Spang <spang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37134
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agosamsung: pm-check: Cleanup chunk exclude code
Doug Anderson [Tue, 30 Oct 2012 15:27:33 +0000 (08:27 -0700)]
samsung: pm-check: Cleanup chunk exclude code

In a recent change to pm-check we added some more chunks of
memory to the list to exclude.  This cleans up how that works
a little bit:
* We now use a linker script to exclude printk buffers.  This has an
  advange of being generic (can add extra bits to exclusion without
  modifying pm-check) and also segregating printk buffers to their own
  chunk of memory.  If we do CRC on an 8K chunk we now won't exclude
  any extra memory when we exclude the printk buffers.
* 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.

This also has a few other minor fixes:
* Changes the in_region() function to fix some off-by-one errors and
  also to use physical addresses.
* Skips regions in s3c_pm_makecheck() too.
* Avoids goto in s3c_pm_runcheck() loop.

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

Change-Id: Ic4febb1eb9aaa78d70984c149e26731af738727a
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37031
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>
11 years agodrm/ptn3460: Add edid emulation selection
Sean Paul [Tue, 16 Oct 2012 20:20:53 +0000 (16:20 -0400)]
drm/ptn3460: Add edid emulation selection

This patch adds edid selection to the ptn3460 driver so we can select
the appropriate display resolution from the device tree.

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

Change-Id: I19709a5b95d61061d415f3812dc7568d28e8b4ad
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36700
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoCHROMIUM: exynos: snow: Add PTN edid emulation
Sean Paul [Fri, 26 Oct 2012 17:50:06 +0000 (13:50 -0400)]
CHROMIUM: exynos: snow: Add PTN edid emulation

Add an entry in the ptn3460 node to specify which edid emulation value
to use. The value corresponds to 1366x768, which is the resolution of
snow's lcd panel.

BUG=chrome-os-partner:11158
TEST=Tested on snow, verified EDID was 1366x768

Change-Id: Ie0cd390af41cef9a5eb51b1202c91ebc07d35458
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36699
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoCHROMIUM: CONFIG: exynos: Use PTN3460 DRM driver
Sean Paul [Mon, 29 Oct 2012 18:18:26 +0000 (14:18 -0400)]
CHROMIUM: CONFIG: exynos: Use PTN3460 DRM driver

Change CONFIG_PTN3460 to CONFIG_DRM_PTN3460 so we use the PTN3460 driver
that is in gpu/drm/i2c

BUG=chrome-os-partner:11158
TEST=compiles, runs

Change-Id: I3591448c85ced88afb404b6cd4c5829eab87c3b9
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36792
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agodrm/i2c: Move ptn driver from auxdisplay to drm
Sean Paul [Fri, 26 Oct 2012 20:07:49 +0000 (16:07 -0400)]
drm/i2c: Move ptn driver from auxdisplay to drm

In order to properly synchronize setting up the ptn bridge chip with the
displayport drm driver, we need to move ptn into drm.

The original hope was to keep ptn completely seperate from drm, and have
it just act like a regular monitor. Unfortunately, the bridge is
designed such that it cannot be configured until after it asserts
hotplug. This creates a race between the DP driver detecting hotplug and
reading edid, and the ptn driver configuring its edid emulation setting.

By moving it into the drm subsystem, we can hold off reading edid until
the bridge is properly set up.

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

Change-Id: I99f696b4eeabf36f3055c3772482013397da5002
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36791
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoCHROMIUM: drm/i915: Check the current edp backlight state before changing it.
Stéphane Marchesin [Wed, 31 Oct 2012 19:06:04 +0000 (12:06 -0700)]
CHROMIUM: drm/i915: Check the current edp backlight state before changing it.

This speeds up boot and suspend/resume times.

BUG=chrome-os-partner:13364
TEST=by hand

Change-Id: I8d7b7a22c50bcf32828d492e123ce301cefa297d
Reviewed-on: https://gerrit.chromium.org/gerrit/37047
Reviewed-by: Simon Que <sque@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoCHROMIUM: mali-t6xx: Convert mali_dvfs_spinlock to IRQ-safe spinlock
Michael Spang [Fri, 26 Oct 2012 19:04:40 +0000 (15:04 -0400)]
CHROMIUM: mali-t6xx: Convert mali_dvfs_spinlock to IRQ-safe spinlock

This fixes the following potential deadlock reported by lockdep:

[    2.204853] =================================
[    2.209181] [ INFO: inconsistent lock state ]
[    2.213523] 3.4.0 #101 Not tainted
[    2.216906] ---------------------------------
[    2.221247] inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
[    2.227237] swapper/0/0 [HC1[1]:SC0[0]:HE0:SE1] takes:
[    2.232357]  (&((&mali_dvfs_spinlock))->rlock){?.+...}, at: [<402cef00>] kbase_platform_dvfs_event+0x28/0x54
[    2.242165] {HARDIRQ-ON-W} state was registered at:
[    2.247026]   [<4007a77c>] mark_lock+0x290/0x630
[    2.251626]   [<4007b17c>] __lock_acquire+0x660/0x180c
[    2.256747]   [<4007c8ac>] lock_acquire+0x104/0x128
[    2.261608]   [<40516464>] _raw_spin_lock+0x3c/0x4c
[    2.266469]   [<402cdf00>] kbase_platform_dvfs_init+0x64/0xb0
[    2.272198]   [<402ce17c>] kbase_platform_init+0x164/0x1cc
[    2.277666]   [<402ce200>] kbase_platform_exynos5_init+0x1c/0x124
[    2.283742]   [<402c7118>] kbasep_platform_device_init+0x48/0x54
[    2.289731]   [<402b9128>] kbase_device_init+0x44/0x400
[    2.294939]   [<402ca6ec>] kbase_platform_device_probe+0x1b4/0x6c8
[    2.301102]   [<402d56fc>] platform_drv_probe+0x24/0x28
[    2.306310]   [<402d42b4>] driver_probe_device+0xd8/0x214
[    2.311691]   [<402d4468>] __driver_attach+0x78/0x9c
[    2.316639]   [<402d28e4>] bus_for_each_dev+0x60/0x9c
[    2.321673]   [<402d3d88>] driver_attach+0x28/0x30
[    2.326448]   [<402d38f0>] bus_add_driver+0xc0/0x248
[    2.331395]   [<402d49d8>] driver_register+0xac/0x138
[    2.336429]   [<402d5a18>] platform_driver_register+0x54/0x68
[    2.342158]   [<40767a94>] kbase_driver_init+0xb4/0xd0
[    2.347279]   [<4000869c>] do_one_initcall+0xa0/0x174
[    2.352314]   [<4074db90>] kernel_init+0xf8/0x1b4
[    2.357001]   [<4000f240>] kernel_thread_exit+0x0/0x8
[    2.362036] irq event stamp: 41284
[    2.365421] hardirqs last  enabled at (41281): [<4000f304>] default_idle+0x34/0x40
[    2.372973] hardirqs last disabled at (41282): [<4000db74>] __irq_svc+0x34/0x60
[    2.380264] softirqs last  enabled at (41284): [<40032af8>] _local_bh_enable+0x1c/0x20
[    2.388163] softirqs last disabled at (41283): [<40033340>] irq_enter+0x50/0x7c
[    2.395454]
[    2.395455] other info that might help us debug this:
[    2.401964]  Possible unsafe locking scenario:
[    2.401967]
[    2.407866]        CPU0
[    2.410296]        ----
[    2.412727]   lock(&((&mali_dvfs_spinlock))->rlock);
[    2.417674]   <Interrupt>
[    2.420278]     lock(&((&mali_dvfs_spinlock))->rlock);
[    2.425399]
[    2.425401]  *** DEADLOCK ***
[    2.425403]
[    2.431302] no locks held by swapper/0/0.
[    2.435295]
[    2.435296] stack backtrace:
[    2.439642] [<40015580>] (unwind_backtrace+0x0/0xec) from [<4050e2ec>] (dump_stack+0x20/0x24)
[    2.448146] [<4050e2ec>] (dump_stack+0x20/0x24) from [<4050f5ac>] (print_usage_bug+0x250/0x2b8)
[    2.456826] [<4050f5ac>] (print_usage_bug+0x250/0x2b8) from [<4007a844>] (mark_lock+0x358/0x630)
[    2.465593] [<4007a844>] (mark_lock+0x358/0x630) from [<4007b0f8>] (__lock_acquire+0x5dc/0x180c)
[    2.474359] [<4007b0f8>] (__lock_acquire+0x5dc/0x180c) from [<4007c8ac>] (lock_acquire+0x104/0x128)
[    2.483387] [<4007c8ac>] (lock_acquire+0x104/0x128) from [<40516464>] (_raw_spin_lock+0x3c/0x4c)
[    2.492154] [<40516464>] (_raw_spin_lock+0x3c/0x4c) from [<402cef00>] (kbase_platform_dvfs_event+0x28/0x54)
[    2.501876] [<402cef00>] (kbase_platform_dvfs_event+0x28/0x54) from [<402c6498>] (dvfs_callback+0x28/0x74)
[    2.511511] [<402c6498>] (dvfs_callback+0x28/0x74) from [<400514ec>] (__run_hrtimer+0x144/0x220)
[    2.520276] [<400514ec>] (__run_hrtimer+0x144/0x220) from [<400522f4>] (hrtimer_interrupt+0x120/0x248)
[    2.529566] [<400522f4>] (hrtimer_interrupt+0x120/0x248) from [<400244d8>] (exynos4_mct_tick_isr+0x58/0x60)
[    2.539289] [<400244d8>] (exynos4_mct_tick_isr+0x58/0x60) from [<40091968>] (handle_irq_event_percpu+0x8c/0x248)
[    2.549442] [<40091968>] (handle_irq_event_percpu+0x8c/0x248) from [<40091b70>] (handle_irq_event+0x4c/0x6c)
[    2.559251] [<40091b70>] (handle_irq_event+0x4c/0x6c) from [<40094b50>] (handle_fasteoi_irq+0xe4/0x150)
[    2.568624] [<40094b50>] (handle_fasteoi_irq+0xe4/0x150) from [<40091110>] (generic_handle_irq+0x3c/0x50)
[    2.578173] [<40091110>] (generic_handle_irq+0x3c/0x50) from [<4000efc4>] (handle_IRQ+0x88/0xc8)
[    2.586939] [<4000efc4>] (handle_IRQ+0x88/0xc8) from [<40008564>] (gic_handle_irq+0x44/0x68)
[    2.595358] [<40008564>] (gic_handle_irq+0x44/0x68) from [<4000db84>] (__irq_svc+0x44/0x60)
[    2.603688] Exception stack(0x40797f18 to 0x40797f60)
[    2.608723] 7f00:                                                       00000001 00000004
[    2.616883] 7f20: 00000000 00000000 40796000 4080a1c8 4051a564 407be97c 4000406a 410fc0f4
[    2.625042] 7f40: 00000000 40797f6c 40797f30 40797f60 4007d1b0 4000f308 20000013 ffffffff
[    2.633204] [<4000db84>] (__irq_svc+0x44/0x60) from [<4000f308>] (default_idle+0x38/0x40)
[    2.641363] [<4000f308>] (default_idle+0x38/0x40) from [<4000f570>] (cpu_idle+0xb4/0x10c)
[    2.649523] [<4000f570>] (cpu_idle+0xb4/0x10c) from [<404fccac>] (rest_init+0xb4/0xdc)
[    2.657421] [<404fccac>] (rest_init+0xb4/0xdc) from [<4074d9e0>] (start_kernel+0x46c/0x524)
[    2.665753] [<4074d9e0>] (start_kernel+0x46c/0x524) from [<40008044>] (0x40008044)
[

BUG=chrome-os-partner:15688
TEST=boot with CONFIG_PROVE_LOCKING, check dmesg for warning

Change-Id: Ie2c9fa5b57de6d8f9769d5969142ad7b5ede6440
Signed-off-by: Michael Spang <spang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36705
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-by: Sam Leffler <sleffler@chromium.org>
11 years agoCHROMIUM: USB: ohci-exynos: initialize registers pointer earlier
Vincent Palatin [Mon, 29 Oct 2012 18:54:14 +0000 (11:54 -0700)]
CHROMIUM: USB: ohci-exynos: initialize registers pointer earlier

In the former code, we have a race condition between the first interrupt
and the regs field initilization in the usb_hcd structure.
If the OHCI irq fires before hcd->regs is set, we are getting a null
pointer dereference in ohci_irq.

When calling usb_add_hcd(), it first executes the reset() callback,
then enables the ohci interrupt, and finally executes the start()
callback. So moving the ohci_init() call which actually initializes the
reg field from start() to reset() should remove the race.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:15731
TEST=run on Spring with USB2.0 on internal PHY on HSIC hub initialized
in the bootloader, and see no kernel panic at startup.

Change-Id: If98070a3cd16b7f735c8cfb62c20cebf410953d2
Reviewed-on: https://gerrit.chromium.org/gerrit/36823
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: samsung: Enable suspend memory check only on old bios
Jonathan Kliegman [Wed, 31 Oct 2012 18:57:26 +0000 (14:57 -0400)]
CHROMIUM: samsung: Enable suspend memory check only on old bios

The bios bug only exists in 2695.90.0 so change default to disabled
and only turn on if the RO bios version is Google_Snow.2695.90.0

Also fix a bug where we don't check if crcs are allocated before trying
to access them on resume.

BUG=chrome-os-partner:15811
TEST=deployed on 2695.90.0 bios, 2695.90.2 and unversioned (dev) bios
  Observed /sys/module/pm_check/paramaters/pm_check_enabled set correctly
  Ran power_Resume test on both devices, saw 1 second difference between them.
  Set CONFIG_SAMSUNG_PM_CHECK=n, build, deploy and suspend/resume
Signed-off-by: Jonathan Kliegman <kliegs@chromium.org>
Change-Id: I7eb89ffc7cbd5c6318d02f21d2e598dc383a68b3
Reviewed-on: https://gerrit.chromium.org/gerrit/37032
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Ready: Jon Kliegman <kliegs@chromium.org>
Tested-by: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>
11 years agoath9k: do not start rx poll work when flushing pending rx frames
Felix Fietkau [Mon, 29 Oct 2012 21:18:53 +0000 (22:18 +0100)]
ath9k: do not start rx poll work when flushing pending rx frames

__ath_cancel_work has stopped the rx poll work timer, and it needs to
stay stopped until after the reset

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
BUG=chrome-os-partner:15169
TEST=Boot, associate

Change-Id: If65461674dd41507891c0a66f188276a614c6b64
Signed-off-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36829
Reviewed-by: Wade Guthrie <wdg@google.com>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
11 years agoCHROMIUM: exynos: dts: configure hotplug pin on Spring
Vincent Palatin [Sat, 27 Oct 2012 01:04:06 +0000 (18:04 -0700)]
CHROMIUM: exynos: dts: configure hotplug pin on Spring

Spring does not use the dedicated DP hotplug detection pin but a
standard GPIO.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:14491
TEST=boot on Spring, see the display coming up automatically.

Change-Id: I716b8d0a070503d3d94bfb995d7d7ed2427de41d
Reviewed-on: https://gerrit.chromium.org/gerrit/36827
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: drm: exynos: optional DP hotplug on a GPIO
Vincent Palatin [Sat, 27 Oct 2012 00:54:01 +0000 (17:54 -0700)]
CHROMIUM: drm: exynos: optional DP hotplug on a GPIO

Allow to setup the Display Port hotplug detection on a vanilla GPIO
instead of the dedicated DP_HPD pin.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:14491
TEST=boot on Spring, see the display coming up automatically.

Change-Id: I8eaba89bff0fcdc56d05abf769d7097df05807e1
Reviewed-on: https://gerrit.chromium.org/gerrit/36825
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: exynos: add DP hotplug gpio configuration
Vincent Palatin [Sat, 27 Oct 2012 01:01:10 +0000 (18:01 -0700)]
CHROMIUM: exynos: add DP hotplug gpio configuration

Allow to define an optional gpio in DP platform data used for
DP hotplug detection if the machine is not using the dedicated DP_HPD
pin.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:14491
TEST=build and run on Spring and Snow.

Change-Id: Ib1a552b369bceffd739e7d09aeea70cbc80785df
Reviewed-on: https://gerrit.chromium.org/gerrit/36826
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: Input: atmel_mxt_ts - make mxt_initialize async
Yufeng Shen [Tue, 30 Oct 2012 20:06:51 +0000 (16:06 -0400)]
CHROMIUM: Input: atmel_mxt_ts - make mxt_initialize async

mxt_probe() calles mxt_initialize() to initialize the device, which includes
a soft reset and then msleep for the reset to finish. This has big impact on
the system boot time. This patch makes the mxt_initizlize() call async to
reduce the system boot time.

BUG=chrome-os-partner:15743
TEST=Boot the device and check the kernel timestamp in dmesg to see that
     the device initialization is parallelized.

Signed-off-by: Yufeng Shen <miletus@chromium.org>
Change-Id: If106af37a52a0fa874cdc8255c91fdde36776e1f
Reviewed-on: https://gerrit.chromium.org/gerrit/36964
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Simon Que <sque@chromium.org>
Commit-Ready: Yufeng Shen <miletus@chromium.org>

11 years agoCHROMIUM: avoid deadlock in OOM killer
Luigi Semenzato [Tue, 30 Oct 2012 20:35:18 +0000 (13:35 -0700)]
CHROMIUM: avoid deadlock in OOM killer

This removes code that prevents a memory starvation in low-memory situations.

select_bad_process may fail to find a victim for the OOM-kill by returning
ERR_PTR(-1).  In theory this should happen only when there is a guarantee
that memory will be freed shortly.  But in some cases this is not true.
If any process tries to allocate memory between setting the PF_EXITING
bit of p->flags and setting p->exit_state to non-zero, it prevents
the OOM-killer from making any progress, and nobody is able to
allocate memory.

I have found a process that does exactly that:

[ 4687.418818]  [<8104512d>] __cond_resched+0x1b/0x2b
[ 4687.418828]  [<813b67a7>] _cond_resched+0x18/0x21
[ 4687.418840]  [<81093940>] shrink_slab+0x224/0x22f
[ 4687.418856]  [<81095a96>] try_to_free_pages+0x1b7/0x2e6
[ 4687.418868]  [<8108df2a>] __alloc_pages_nodemask+0x40a/0x61f
[ 4687.418882]  [<810a9dbe>] read_swap_cache_async+0x4a/0xcf
[ 4687.418894]  [<810a9ea4>] swapin_readahead+0x61/0x8d
[ 4687.418906]  [<8109fff4>] handle_pte_fault+0x310/0x5fb
[ 4687.418918]  [<810a0420>] handle_mm_fault+0xae/0xbd
[ 4687.418932]  [<8101d0f9>] do_page_fault+0x265/0x284
[ 4687.419002]  [<813b7887>] error_code+0x67/0x6c
[ 4687.419060]  [<8102351d>] mm_release+0x1d/0xc3
[ 4687.419070]  [<81026ce9>] exit_mm+0x1d/0xe9
[ 4687.419090]  [<81028082>] do_exit+0x19b/0x640

mm_release gets its page fault in the vicinity of this
code which is related to futexes:

if (unlikely(tsk->robust_list)) {
exit_robust_list(tsk);
tsk->robust_list = NULL;
}

Since robust_list is a userspace structure, the page
fault looks legitimate, and this is likely a design bug
(also see comment about deadlocks earlier in select_bad_process)
and difficult to fix completely.

In any case we're happy to trade spurious OOM kills for no hangs.

BUG=chromium-os:32321
TEST=tested with a load that reliably causes a hang before and none after

Change-Id: I7037e68cc3eef3a36ca355b9535af0f559b3a148
Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36953
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
11 years agoCHROMIUM: config: enable mali hw counter support
Sam Leffler [Thu, 25 Oct 2012 16:35:33 +0000 (09:35 -0700)]
CHROMIUM: config: enable mali hw counter support

Enable support for collecting mali hw counter data via trace events.

Signed-off-by: sleffler@chromium.org
BUG=chrome-os-partner:14556
TEST=boot on snow and collect data

Change-Id: I6b905f2469004238d2e0c7e1fc6c8362d0416f71
Reviewed-on: https://gerrit.chromium.org/gerrit/36565
Tested-by: Sam Leffler <sleffler@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>

11 years agoCHROMIUM: ASoC: samsung: Fix warnings in daisy_max98095
Michael Spang [Tue, 30 Oct 2012 17:13:58 +0000 (13:13 -0400)]
CHROMIUM: ASoC: samsung: Fix warnings in daisy_max98095

This fixes the following build warnings:

sound/soc/samsung/daisy_max98095.c: In function 'daisy_init':
sound/soc/samsung/daisy_max98095.c:407:9: warning: assignment makes pointer from integer without a cast
sound/soc/samsung/daisy_max98095.c: In function 'daisy_resume_post':
sound/soc/samsung/daisy_max98095.c:437:1: warning: no return statement in function returning non-void

BUG=none
TEST=build

Change-Id: I287ddfe7f48afd2bb519af3b3ec1ae10ee7f60e8
Signed-off-by: Michael Spang <spang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36912
Reviewed-by: Dylan Reid <dgreid@chromium.org>
11 years agoCHROMIUM: block: Fix warning in disk_block_events
Michael Spang [Tue, 30 Oct 2012 17:08:23 +0000 (13:08 -0400)]
CHROMIUM: block: Fix warning in disk_block_events

This fixes the following warning due to type mismatch for
spin_lock_irqsave() flags.

block/genhd.c: In function 'disk_unblock_events':
block/genhd.c:1504:79: warning: comparison of distinct pointer types lacks a cast

BUG=none
TEST=build

Change-Id: Ia692f29445053eef05e94a8b3e8df9a8b59d193f
Signed-off-by: Michael Spang <spang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36911
Reviewed-by: Paul Taysom <taysom@chromium.org>
11 years agoARM: MALI: connect kbase trace events to system tracing
Sam Leffler [Fri, 12 Oct 2012 16:28:19 +0000 (09:28 -0700)]
ARM: MALI: connect kbase trace events to system tracing

Adapt kbase's trace event mechanism to system trace events.  This facility
is enabled with a new CONFIG_MALI_SYSTEM_TRACE config knob (hidden under
CONFIG_MALI_EXPERT).

Signed-off-by: sleffler@chromium.org
BUG=chrome-os-partner:14556
TEST=verify kbase trace events are generated when enabled

Change-Id: Ic5df3133619c52ae52e9bcd7264494b892e47c86
Reviewed-on: https://gerrit.chromium.org/gerrit/35994
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
11 years agoacpi: thermal: initialize tz_enabled to 1
Sameer Nanda [Tue, 30 Oct 2012 18:50:34 +0000 (11:50 -0700)]
acpi: thermal: initialize tz_enabled to 1

In the acpi_thermal_add path, acpi_thermal_get_info gets called before
acpi_thermal_register_thermal_zone.  Since tz_enabled was getting set to
1 only in acpi_thermal_register_thermal_zone, acpi_thermal_get_info
ended up disabling thermal polling.

Moved setting of tz_enabled to 1 into acpi_thermal_add itself.

BUG=chrome-os-partner:15697
TEST=on kiev, run CPU soaker threads ("while true; do true; done") and ensure
that the fan turns on as the CPU heats up.

Change-Id: Ib2ad69621ce32f252a8b913387e1560d0750b822
Signed-off-by: Sameer Nanda <snanda@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36927
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
11 years agoCHROMIUM: ARM: MALI: add hardware performance counter support
Sam Leffler [Fri, 12 Oct 2012 16:28:19 +0000 (09:28 -0700)]
CHROMIUM: ARM: MALI: add hardware performance counter support

Add support for dispatching hardware performance counter data through
system trace events.  To enable a counter the associated trace event must
be enabled before turning on hardware counter polling through sysfs.
Data are collected at each vblank event.  Note the set of counters
collected is fixed at the time polling is enabled; to change the set of
counters first disable polling.

This functionality is enabled by CONFIG_MALI_HWC_TRACE.

Signed-off-by: sleffler@chromium.org
BUG=chrome-os-partner:14556
TEST=enable events (e.g. mali_hwc_FRAG_TRANS_ELIM); cat trace_pipe&; echo 1 > /sys/devices/platform/mali.0/hwc_enable; monitor trace data

Change-Id: I801fbfbd87abe69ba5832a1720532ee331fb0314
Reviewed-on: https://gerrit.chromium.org/gerrit/36564
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Anush Elangovan <anush@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
11 years agoCHROMIUM: drm: add vblank notifier
Sam Leffler [Mon, 29 Oct 2012 17:52:44 +0000 (10:52 -0700)]
CHROMIUM: drm: add vblank notifier

Add a notifier for vblank events.

Signed-off-by: sleffler@chromium.org
BUG=chrome-os-partner:14556
TEST=collect hardware counter data (dependent cl)

Change-Id: I314186947f9c93b46d3729ffdd5b8f0b0317b88f
Reviewed-on: https://gerrit.chromium.org/gerrit/36781
Reviewed-by: Anush Elangovan <anush@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
11 years agoCHROMIUM: config: exynos: turn on CONFIG_SAMSUNG_PM_CHECK
Jonathan Kliegman [Thu, 25 Oct 2012 18:49:28 +0000 (14:49 -0400)]
CHROMIUM: config: exynos: turn on CONFIG_SAMSUNG_PM_CHECK

Enable checking memory on suspend/resume cycles.

BUG=chrome-os-partner:15600
TEST=Ensure /sys/modules/pm_check exists
  Full pm_check functionality tested in CL 36475
Signed-off-by: Jonathan Kliegman <kliegs@chromium.org>
Change-Id: If13496c68ff97a0d6335d9dbfa9ad58b03af377c
Reviewed-on: https://gerrit.chromium.org/gerrit/36575
Tested-by: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Ready: Jon Kliegman <kliegs@chromium.org>

11 years agoHACK: samsung: pm-check: Add runtime options to enable and panic
Jonathan Kliegman [Thu, 18 Oct 2012 22:16:16 +0000 (18:16 -0400)]
HACK: samsung: pm-check: Add runtime options to enable and panic

Add runtime options to enable, panic and switch between xor and crc
checks of memory.

Update the exclusions to ignore log_buf and sleep_save_sp

BUG=chrome-os-partner:15600
TEST=Tested that with pm_check_should_panic system panics after an
  error and continues running when not set
  Set and unset pm_check_use_xor - confirmed differences in time and
    difference in values for errors
  Set and unset pm_check_enabled, validated log messages for running or not
  Chanaged pm_check_chunksize, saw size of crc error blocks change
  Confirmed correct error messages with pm_check_printskips
  Confirmed suspend_stress_test still catches errors correctly

Change-Id: I4275782391de32378be2f717bd48852ffde634ce
Signed-off-by: Jonathan Kliegman <kliegs@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36475
Reviewed-by: Michael Spang <spang@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
11 years agoCHROMIUM: add stack trace on gpu reset
Sam Leffler [Tue, 23 Oct 2012 17:42:06 +0000 (10:42 -0700)]
CHROMIUM: add stack trace on gpu reset

Add a stack trace for every gpu reset.  This is temporary
for helping with problems in the field.

Signed-off-by: sleffler@chromium.org
BUG=chrome-os-partner:1556
TEST=force gpu reset and verify a stack trace is dumped to the console

Change-Id: I4543367a2bf7321a292bb585bd46e7dfe92cb6e0
Reviewed-on: https://gerrit.chromium.org/gerrit/36498
Reviewed-by: Anush Elangovan <anush@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
11 years agoCHROMIUM: iio: isl29018: Support suspend and resume.
Bryan Freed [Tue, 28 Aug 2012 23:52:40 +0000 (16:52 -0700)]
CHROMIUM: iio: isl29018: Support suspend and resume.

The driver leaves the device in power-down state anyway,
so there is nothing to do on suspend.
On resume, we just have to make sure the range and ADC
values are updated in the device since it may have been
powered down in suspend.

BUG=chrome-os-partner:9494
TEST=Verify that lux values are generally unchanged after suspend/resume.
This is a bit difficult to reproduce on snow because we have to simulate
a FET5 power-down on suspend by manually hitting the TPS.  We also have
to modify a range or resolution value that gets pushed to the device, and
we do not normally do that.  This can reproduce the problem:
cd /sys/bus/iio/devices/*
cat in_illuminance0_input
echo 4000 > range
cat in_illuminance0_input # The value changes just a little bit.
i2cset -f -y 4 0x48 0x13 0x02 # Turn off FET5
i2cset -f -y 4 0x48 0x13 0x1f # Turn FET5 back on
powerd_suspend
cat in_illuminance0_input # The value is 4x expected without this patch.

Change-Id: I73e9f9357db3ae3c240a6e1cc5c8acbcf97b6971
Signed-off-by: Bryan Freed <bfreed@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31662
Reviewed-by: Benson Leung <bleung@chromium.org>
11 years agoCHROMIUM: Input: cyapa - Add debug messages for bl_exit failure cases.
Benson Leung [Wed, 17 Oct 2012 02:20:27 +0000 (19:20 -0700)]
CHROMIUM: Input: cyapa - Add debug messages for bl_exit failure cases.

Print the contents of the three status bytes before concluding
that the current state is CYAPA_STATE_BL_IDLE.

Print these in bl_exit error path after setting
cyapa->debug on the failure to exit bootloader in issue 14206.

Also, fix the debug message for "bl_activate" error path
to be correct. Previously it said "bl_exit"

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chrome-os-partner:14206
TEST=Boot the system, and then force a firmware update using
/opt/google/touchpad/firmware/chromeos-touch-firmwareupdate.sh -d cyapa -f
Then, shut the system down to interrupt the firmware update.
Boot the system the next time.
Check dmesg after the recovery firmware update is complete.
Verify that the following appears :
[    0.863010] cyapa 1-0067: bl_exit failed. Now in state BL_IDLE.
[    0.863019] cyapa 1-0067: status[REG_OP_STATUS] = 0x00
[    0.863031] cyapa 1-0067: status[REG_BL_STATUS] = 0x10
[    0.863038] cyapa 1-0067: status[REG_BL_ERROR] = 0x00
[    0.863045] cyapa 1-0067: failed to bl_exit. -11
[    0.863052] cyapa 1-0067: device detected, but not operational, -11

Change-Id: I0680fd06164306f521f052c3027c0389dc501cb6
Reviewed-on: https://gerrit.chromium.org/gerrit/35791
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
11 years agodrm/exynos: vidi: Fix compilation error re: pitch
Sean Paul [Wed, 24 Oct 2012 20:53:30 +0000 (16:53 -0400)]
drm/exynos: vidi: Fix compilation error re: pitch

Was getting "'struct exynos_drm_overlay' has no member named 'pitch'"
compilation errors when compiling with VIDI enabled.

BUG=None
TEST=Compiles

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

11 years agoCHROMIUM: i915: do not set redundant DP dpms mode
Simon Que [Tue, 23 Oct 2012 18:54:26 +0000 (11:54 -0700)]
CHROMIUM: i915: do not set redundant DP dpms mode

Add a check to intel_dp_dpms() to skip setting the DP's DPMS mode if
the current mode is the same as the new one.

BUG=chrome-os-partner:13364,chrome-os-partner:12423
TEST=Run power_Resume autotest with screen on and screen off on Link.
The resume time should be about the same in each case.

Change-Id: I4269c84bdbd7101b1f71b9fce9935901df917381
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36356
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoUPSTREAM: cfg80211/mac80211: avoid state mishmash on deauth
Stanislaw Gruszka [Mon, 15 Oct 2012 12:52:41 +0000 (14:52 +0200)]
UPSTREAM: cfg80211/mac80211: avoid state mishmash on deauth

Avoid situation when we are on associate state in mac80211 and
on disassociate state in cfg80211. This can results on crash
during modules unload (like showed on this thread:
http://marc.info/?t=134373976300001&r=1&w=2) and possibly other
problems.

Reported-by: Pedro Francisco <pedrogfrancisco@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chrome-os-partner:14187
TEST=Boot, run, suspend and resume

Change-Id: Ia0fb26d9c5f4df84d460a7b236d9112998ec08ee
Reviewed-on: https://gerrit.chromium.org/gerrit/36438
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
11 years agoCHROMIUM: exynos: dts: configure SDIO for Wifi
Vincent Palatin [Tue, 23 Oct 2012 01:15:58 +0000 (18:15 -0700)]
CHROMIUM: exynos: dts: configure SDIO for Wifi

The Wifi SDIO card is on the MMC1 interface,
and the MMC3 interface is no longer connected to anything.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:14489
TEST=run on Spring and attach to the guest wifi network from the UI

Change-Id: I42b2a96c67b61a6f220e12c1bd1242d7919c5e9a
Reviewed-on: https://gerrit.chromium.org/gerrit/36301
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Sam Leffler <sleffler@chromium.org>
11 years agoCHROMIUM: exynos5: enable/reset Wifi module on Spring
Vincent Palatin [Tue, 23 Oct 2012 20:57:30 +0000 (13:57 -0700)]
CHROMIUM: exynos5: enable/reset Wifi module on Spring

The Wifi SDIO module is controlled by the same GPIOs as Daisy and Snow.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:14490
TEST=run on Spring and attach to the guest wifi network from the UI

Change-Id: I6b0e32c09b25f9b279eb57205a098196753882c5
Reviewed-on: https://gerrit.chromium.org/gerrit/36690
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: Input: cyapa - Disable irq before changing power modes
Benson Leung [Wed, 24 Oct 2012 02:04:29 +0000 (19:04 -0700)]
CHROMIUM: Input: cyapa - Disable irq before changing power modes

There could be a potential race condition here as the irq may
be active as we are trying to read and write to device registers
to change power modes. In order to resolve this, disable irq
before cyapa_set_power_mode in cyapa_suspend.

BUG=chromium-os:35663
TEST=Builds clean.
Check that suspend with power/wakeup enabled and disabled
both work correctly to disable and enable the touchpad wake.
1. echo disabled > /sys/bus/i2c/devices/1-0067/power/wakeup
2. powerd_suspend
3. check that trackpad cannot wake the system.
4. Wake using keyboard. Check mouse is functional.
5. echo enabled > /sys/bus/i2c/devices/1-0067/power/wakeup
6. powerd_suspend
7. check that trackpad can wake the system.
8. Check that the trackpad is operational after resume

Change-Id: Ifd8715c51ddea138c5c4c28b4a4337af8d6021cc
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36409