cascardo/linux.git
11 years agogsmi: Add coreboot to list of matching BIOS vendors
Duncan Laurie [Mon, 25 Jun 2012 17:17:50 +0000 (10:17 -0700)]
gsmi: Add coreboot to list of matching BIOS vendors

In order to use this coreboot needs board support for:
CONFIG_ELOG=y
CONFIG_ELOG_GSMI=y

And the kernel driver needs enabled:
CONFIG_GOOGLE_GSMI=y

BUG=chrome-os-partner:9195
TEST=manual

Verify that clean shutdown event is added to the log:

> mosys eventlog list | grep 'Clean Shutdown'
11 | 2012-06-25 09:49:24 | Kernl Event | Clean Shutdown

Change-Id: I01d5aae415207538bf46166c04a874685213386f
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/26029
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
11 years agogsmi: Fix bug in append_to_eventlog sysfs handler
Duncan Laurie [Mon, 25 Jun 2012 17:15:11 +0000 (10:15 -0700)]
gsmi: Fix bug in append_to_eventlog sysfs handler

The sysfs handler should return the number of bytes
consumed, which in the case of a successful write is
the entire buffer.

BUG=chrome-os-partner:9195
TEST=manual

Successfully append an event to the log with gsmi sysfs.
This sample event is for a "Kernel Software Watchdog"

> xxd -g 1 event.kernel_software_watchdog
0000000: 01 00 00 00 ad de 06 00 00 00

> cat event.kernel_software_watchdog > /sys/firmware/gsmi/append_to_eventlog

> mosys eventlog list | tail -1
14 | 2012-06-25 10:14:14 | Kernl Event | Software Watchdog

Change-Id: I7e238a83d6a4f04a998a384d96422c08f4768dcc
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/26028
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
11 years agox86, mm: only wait for flushes from online cpus
Mandeep Singh Baines [Thu, 21 Jun 2012 22:03:43 +0000 (15:03 -0700)]
x86, mm: only wait for flushes from online cpus

A cpu in the mm_cpumask could go offline before we send the invalidate
IPI causing us to wait forever. Avoid this by only waiting for online
cpus.

We are seeing a softlockup reporting during shutdown. The stack
trace shows us that we are inside default_send_IPI_mask_logical:

<3>[10234.880183] BUG: soft lockup - CPU#0 stuck for 11s! [lmt-udev:23605]
<5>[10234.880323] Pid: 23605, comm: lmt-udev Tainted: G        WC   3.2.7 #1
<5>[10234.880331] EIP: 0060:[<8101eec6>] EFLAGS: 00000202 CPU: 0
<5>[10234.880341] EIP is at flush_tlb_others_ipi+0x8a/0xba
<0>[10234.880631] Call Trace:
<5>[10234.880687]  [<8101f0bb>] flush_tlb_mm+0x5e/0x62
<5>[10234.880696]  [<8101e36c>] pud_populate+0x2c/0x31
<5>[10234.880703]  [<8101e409>] pgd_alloc+0x98/0xc7
<5>[10234.880713]  [<8102c881>] mm_init.isra.38+0xcc/0xf3
<5>[10234.880721]  [<8102cbc2>] dup_mm+0x68/0x34e
<5>[10234.880730]  [<8139bbae>] ? _cond_resched+0xd/0x21
<5>[10234.880739]  [<810a5b7c>] ? kmem_cache_alloc+0x26/0xe2
<5>[10234.880747]  [<8102d421>] ? copy_process+0x556/0xda6
<5>[10234.880756]  [<8102d641>] copy_process+0x776/0xda6
<5>[10234.880765]  [<8102dd5e>] do_fork+0xcb/0x1d4
<5>[10234.880774]  [<810a8c96>] ? do_sync_write+0xd3/0xd3
<5>[10234.880782]  [<810a94ab>] ? vfs_read+0x95/0xa2
<5>[10234.880791]  [<81008850>] sys_clone+0x20/0x25
<5>[10234.880799]  [<8139d8c5>] ptregs_clone+0x15/0x30
<5>[10234.880807]  [<8139d7f7>] ? sysenter_do_call+0x12/0x26

Before the softlock, we see the following kernel warning:

<4>[10222.234548] WARNING: at ../../arch/x86/kernel/apic/ipi.c:113 default_send_IPI_mask_logical+0x58/0x73()
<5>[10222.234633] Pid: 23605, comm: lmt-udev Tainted: G         C   3.2.7 #1
<5>[10222.234639] Call Trace:
<5>[10222.234651]  [<8102e666>] warn_slowpath_common+0x68/0x7d
<5>[10222.234661]  [<81016c36>] ? default_send_IPI_mask_logical+0x58/0x73
<5>[10222.234670]  [<8102e68f>] warn_slowpath_null+0x14/0x18
<5>[10222.234678]  [<81016c36>] default_send_IPI_mask_logical+0x58/0x73
<5>[10222.234687]  [<8101eec2>] flush_tlb_others_ipi+0x86/0xba
<5>[10222.234696]  [<8101f0bb>] flush_tlb_mm+0x5e/0x62
<5>[10222.234703]  [<8101e36c>] pud_populate+0x2c/0x31
<5>[10222.234711]  [<8101e409>] pgd_alloc+0x98/0xc7
<5>[10222.234719]  [<8102c881>] mm_init.isra.38+0xcc/0xf3
<5>[10222.234727]  [<8102cbc2>] dup_mm+0x68/0x34e
<5>[10222.234736]  [<8139bbae>] ? _cond_resched+0xd/0x21
<5>[10222.234745]  [<810a5b7c>] ? kmem_cache_alloc+0x26/0xe2
<5>[10222.234753]  [<8102d421>] ? copy_process+0x556/0xda6
<5>[10222.234761]  [<8102d641>] copy_process+0x776/0xda6
<5>[10222.234770]  [<8102dd5e>] do_fork+0xcb/0x1d4
<5>[10222.234778]  [<810a8c96>] ? do_sync_write+0xd3/0xd3
<5>[10222.234786]  [<810a94ab>] ? vfs_read+0x95/0xa2
<5>[10222.234795]  [<81008850>] sys_clone+0x20/0x25
<5>[10222.234804]  [<8139d8c5>] ptregs_clone+0x15/0x30
<5>[10222.234812]  [<8139d7f7>] ? sysenter_do_call+0x12/0x26

So we are sending an IPI to a cpu which is now offline. Once a cpu is offline,
it will no longer respond to IPIs. This explains the softlockup.

Addresses http://crosbug.com/31737

Changes in V2:
  * bitmap_and is not atomic so use a temporary bitmask

LKML-Reference: https://lkml.org/lkml/2012/6/22/443

BUG=chromium-os:31737
TEST=Cannot reproduce the bug. But ran a few power cycles.

Change-Id: I29fe5fa120bafdc1de6a1e7979473baa7ecd4c30
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25970
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoCHROMIUM: Revert "Input: i8042 - also perform controller reset when suspending"
Benson Leung [Wed, 20 Jun 2012 23:02:44 +0000 (16:02 -0700)]
CHROMIUM: Revert "Input: i8042 - also perform controller reset when suspending"

This reverts commit 1729ad1f4f9e167ade84ca8b5269695c42351160.

The above commit adds a forced i8042_controller_selftest at suspend time.
This has the result of disabling the touchpad wake from S3.

BUG=chromium-os:31556
TEST=on CR-48:
powerd_suspend
touch the touchpad to wake the system
Verify that the system wakes up

Change-Id: I7ac865e82a07e20076d33353acb21b3720f97fce
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25820
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoCHROMIUM: cpu_callback can't be __cpuinit
Olof Johansson [Fri, 22 Jun 2012 01:08:08 +0000 (18:08 -0700)]
CHROMIUM: cpu_callback can't be __cpuinit

This is because lockup_detector_bootcpu_resume() now uses it, so
it's used after runtime init of cpus.

BUG=none
TEST=build with CONFIG_DEBUG_SECTION_MISMATCH=y, watch the warnings go away

Change-Id: I1506e351b9ddeae699245a31f4e45805ac2fd52e
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25898
Reviewed-by: Benson Leung <bleung@chromium.org>
11 years agoCHROMIUM: add missing inline to static function in sched.h
Olof Johansson [Fri, 22 Jun 2012 01:03:08 +0000 (18:03 -0700)]
CHROMIUM: add missing inline to static function in sched.h

Found by visual inspection

BUG=none
TEST=none

Change-Id: Iae22882a90041af9b992735317328da2d0df2bfc
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25897
Reviewed-by: Benson Leung <bleung@chromium.org>
11 years agoCHROMIUM: chromeos_laptop: remove section warnings
Olof Johansson [Fri, 22 Jun 2012 01:00:02 +0000 (18:00 -0700)]
CHROMIUM: chromeos_laptop: remove section warnings

Missing __init annotations causing section mismatch warnings

BUG=none
TEST=build with CONFIG_DEBUG_SECTION_MISMATCH=y, see chromeos_laptop warnings go away

Change-Id: I405ff6da56f84aa97e6546b4529f35f97e47a83f
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25894
Reviewed-by: Benson Leung <bleung@chromium.org>
11 years agoCHROMIUM: ALSA: hda - Optimize power_up before power_down starts.
Dylan Reid [Fri, 22 Jun 2012 02:13:09 +0000 (19:13 -0700)]
CHROMIUM: ALSA: hda - Optimize power_up before power_down starts.

After cancel_delayed_work_sync returns, the power down work either never
started (power_on == 1) or finished (power_on == 0).  In the former case
there is no need to power up again.

BUG=chromium-os:32037
TEST=Ensure key repeat is smooth on alex while a gmail tab is open.

Change-Id: I66c36f406ff515db16fa9a5fe24f053bf20f3dfd
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25905
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Olof Johansson <olofj@chromium.org>

11 years agoCHROMIUM: config: Increase hda power save timeout.
Dylan Reid [Thu, 21 Jun 2012 23:45:54 +0000 (16:45 -0700)]
CHROMIUM: config: Increase hda power save timeout.

Increase the HDA power saving timeout to 15 seconds.  Pepper flash polls
the sound interface every 5 seconds.  Having the power-down timeout the
same as this interval causes the polls to have to wait for the power
down to complete.  While Chrome waits for this it can't send messages to
the GPU process, causing a lot of UI lag.

This change is temporary, bug 32055 filed to track undoing this.

BUG=chromium-ow:32037
TEST=Open gmail tab and a scratchpad and make sure that the rendering of
keys isn't interrupted for long periods of time.

Change-Id: I9ac533c5a4aecf020c2f794d1fc8d67ac6e74f75
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25904
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Olof Johansson <olofj@chromium.org>

11 years agoCHROMIUM: x86: enable idle_notifier's
Sam Leffler [Thu, 14 Jun 2012 23:44:00 +0000 (16:44 -0700)]
CHROMIUM: x86: enable idle_notifier's

Enable idle notifier support on all x86 builds; not just X86_64.

Signed-off-by: Sam Leffler <sleffler@chromium.org>
BUG=chromium-os:17379 chromium:118032
TEST=build for alex; use interactive governor that depends on idle notification

Change-Id: I4d2c22753854b01675819070fae79a73d20a8d7c
Reviewed-on: https://gerrit.chromium.org/gerrit/25345
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
Reviewed-by: Sam Leffler <sleffler@chromium.org>
11 years agoCHROMIUM: import Android interactive governor
Sam Leffler [Tue, 12 Jun 2012 16:13:49 +0000 (09:13 -0700)]
CHROMIUM: import Android interactive governor

Bring in the interactive cpu governor from the Android 3.4 branch.

Signed-off-by: Sam Leffler <sleffler@chromium.org>
BUG=chromium-os:17379 chromium:118032
TEST=build+boot on alex+lumpy

Change-Id: Id8cecdff1380d90e66a7b63208cd77cb5047ff78
Reviewed-on: https://gerrit.chromium.org/gerrit/25344
Tested-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Reviewed-by: Sam Leffler <sleffler@chromium.org>
11 years agoHID: magicmouse: Correct report range of major / minor axes
Yufeng Shen [Thu, 21 Jun 2012 16:40:06 +0000 (12:40 -0400)]
HID: magicmouse: Correct report range of major / minor axes

In patch "HID: magicmouse: Adjust major / minor axes to scale",
touch_major and touch_minor axes are scaled by a factor of
four when reported but the max touch_major/minor is not scaled
accordingly. This patch scales the max touch_major/minor to
be consistent with the reported value.

BUG=chromium-os:29435
TEST=Use evtest to test Apple Magic Trackpad and check that the
     range for touch_major/minor is [0 1020] and the reported
     touch_major/minor value is within the range.

Change-Id: Id1d54e1881025c734e908f90ddcb8e0f12c29d88
Signed-off-by: Yufeng Shen <miletus@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25844
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
11 years agoCHROMIUM: PM: Prevent waiting forever on asynchronous suspend after abort
Mandeep Singh Baines [Wed, 20 Jun 2012 01:17:55 +0000 (18:17 -0700)]
CHROMIUM: PM: Prevent waiting forever on asynchronous suspend after abort

__device_suspend() must always send a completion. Otherwise, parent
devices will wait forever.

Commit 1e2ef05b, "PM: Limit race conditions between runtime PM and
system sleep (v2)", introduced a regression by short-circuiting the
complete_all() for certain error cases.

This patch fixes the bug by always signalling a completion.

LKML-Reference: http://lkml.org/lkml/2012/6/20/386

BUG=chromium-os:31972
TEST=Tested by injecting an abort.

Change-Id: Id5ece5e2134d8ae74fbd2a333ddd10c09b015dd4
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-on: https://gerrit.chromium.org/gerrit/25774
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
12 years agoCHROMIUM: trace: Add IRQ threaded handler entry and exit trace events.
Russell Harmon [Tue, 19 Jun 2012 01:30:25 +0000 (18:30 -0700)]
CHROMIUM: trace: Add IRQ threaded handler entry and exit trace events.

This commit adds irq:irq_threaded_handler_entry and
irq:irq_threaded_handler_exit trace events which are measurable from
perf. This allows you to trace the duration of threaded IRQ handlers.
Useful for tracing e.g. trackpads which use thread IRQs.

BUG=chromium-os:31954
TEST=Enable the traces at runtime. Trace events were emitted.

Signed-off-by: Russell Harmon <eatnumber@chromium.org>
Change-Id: I4d7b7bbaf5bf7489ee6d466fa1e6f42a6481a117
Reviewed-on: https://gerrit.chromium.org/gerrit/25591
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Russell Harmon <eatnumber@google.com>
Commit-Ready: Russell Harmon <eatnumber@google.com>

12 years agoCHROMIUM: chromeos_laptop - Clean up Kconfig description
Benson Leung [Fri, 15 Jun 2012 00:22:27 +0000 (17:22 -0700)]
CHROMIUM: chromeos_laptop - Clean up Kconfig description

BUG=chromium-os:31877
TEST=Builds clean

Change-Id: I0e88c322c7ed6167e9dbd0e9a7ef84b6d3736835
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25368
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
12 years agoCHROMIUM: chromeos_laptop - Remove unused err variable
Benson Leung [Fri, 15 Jun 2012 02:27:06 +0000 (19:27 -0700)]
CHROMIUM: chromeos_laptop - Remove unused err variable

BUG=chromium-os:31877
TEST=Builds clean. Check that there is no unused variable warning.
warning: unused variable 'err' [-Wunused-variable]

Change-Id: I7072e502d06776f4147e3026274b6102ad4f6736
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25367
Reviewed-by: Simon Que <sque@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
12 years agoCHROMIUM: chromeos_laptop - Add a check for a null adapter.
Benson Leung [Fri, 15 Jun 2012 01:40:46 +0000 (18:40 -0700)]
CHROMIUM: chromeos_laptop - Add a check for a null adapter.

In case we are passed a bogus adapter number, lets do a check that
the i2c_get_adapter returns a valid adapter before trying to
add anything to it.

BUG=chromium-os:31877
TEST=Builds clean.

Change-Id: Iaabdf8dc4c23596b6b1cd15c7abf35da07860c6c
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25366
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
12 years agoCHROMIUM: chromeos_laptop - Remove unnecessary irq field.
Benson Leung [Fri, 15 Jun 2012 01:35:33 +0000 (18:35 -0700)]
CHROMIUM: chromeos_laptop - Remove unnecessary irq field.

Assigning irq = -1 is not necessary as we will be overwriting
these with data provided by the system firmware.

BUG=chromium-os:31877
TEST=Builds clean.

Change-Id: Ia0960cf9055c77d4df4379690c1f98152b6ebe4f
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25365
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
12 years agoCHROMIUM: chromeos_laptop - Remove assign to null at exit
Benson Leung [Fri, 15 Jun 2012 01:35:16 +0000 (18:35 -0700)]
CHROMIUM: chromeos_laptop - Remove assign to null at exit

The module is exiting, so assigning null to these pointers
is not necessary.

BUG=chromium-os:31877
TEST=Builds clean

Change-Id: I58e8a045f6e1c758abb462d3139ce9f972b0369c
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25364
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: chromeos_laptop - Fixup description, copyright, and author
Benson Leung [Thu, 14 Jun 2012 20:25:54 +0000 (13:25 -0700)]
CHROMIUM: chromeos_laptop - Fixup description, copyright, and author

Cleanup copyright to be Google, Inc.
Cleanup description to be more clear about what kind of devices
this driver instantiates.
Add the author's full name.

BUG=chromium-os:31877
TEST=Builds clean.

Change-Id: I5bf2c4138adb8895e62e1bceae33978bebd519f9
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25363
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: Input: cyapa - Clean up product_id population
Benson Leung [Sat, 16 Jun 2012 01:54:03 +0000 (18:54 -0700)]
CHROMIUM: Input: cyapa - Clean up product_id population

Use memcpy to copy the right bytes into the product_id string.

BUG=chromium-os:21047
TEST=Builds clean.
On Lumpy system with a cypress touchpad, cat product_id
Check that the product id CYTRA-116001-00 is returned.

Change-Id: Iecd36e10313cfc776da3018bcfc7ac0b3401e478
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25469
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: ALSA: hda - Handle open while transitioning to D3.
Dylan Reid [Thu, 14 Jun 2012 21:26:20 +0000 (14:26 -0700)]
CHROMIUM: ALSA: hda - Handle open while transitioning to D3.

This addresses an issue encountered when a pcm is opened while
transitioning to low power state (codec->power_on == 1 &&
codec->power_transition == -1).  Achieve this by adding a new function,
snd_pcm_power_up_d3wait, to hda_codec.  This function is used to
differentiate a power up caused by opening the device from a power up
caused by writing a register.  hda_intel now uses this function from
azx_pcm_open and it will wait for any pending power down work to
complete before starting to power up.

snd_hda_power_up is called for every verb execution including the verbs
sent while powering down.  This works fine as snd_hda_power_up is a
no-op when power_on is set.  However, azx_pcm_open also calls
snd_hda_power_up, and in this case a no-op is not what is desired.  The
codec can be initialized while the power_work function is simultaneously
powering it down (power_transition == -1).

The specific issue seen was with the CS4210 codec, it powers off the ADC
and DAC nid in it's suspend handler.  If it is re-opened before the
~100ms power down process completes, the ADC and DAC nid are initialized
while powered down.

BUG=chrome-os-partner:10399
TEST=Run Lumpy unplugged with gmail open and the following loop from a
shell, without the fix the loop will eventually hang.
$ while true; do arecord -fdat -Dhw:0 -M -d 2 /tmp/asdf.wav;sleep 1; arecord -fS16_LE -r 96000 -c 2 -Dhw:0 -M -d 2 /tmp/asdf.wav; sleep 1;done

Change-Id: I5fa95da83ab1ebcc542c27508588a94408a8438b
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25325
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoBACKPORT: ALSA: hda - More robustify the power-up/down sequence
Takashi Iwai [Wed, 9 May 2012 10:36:22 +0000 (12:36 +0200)]
BACKPORT: ALSA: hda - More robustify the power-up/down sequence

Check the power_transition up/down state instead of boolean bit, so
that the power-up sequence can cancel the pending power-down work
properly.  Also, by moving cancel_delayed_work_sync() before the
actual power-up sequence, make sure that the delayed power-down is
completed.

BUG=chrome-os-partner:10399
TEST=suspend and resume hda codec.

Change-Id: I5273d41369a5f0e2676e6024a5584105062ec9a6
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Dylan Reid <dgreid@chromium.org>
(cherry picked from commit a2d96e778d1b15d2213f3b7737aa86fd8eda44cb)
Reviewed-on: https://gerrit.chromium.org/gerrit/25324
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: Input: cyapa - Use scnprintf for sysfs properties
Benson Leung [Fri, 15 Jun 2012 23:38:17 +0000 (16:38 -0700)]
CHROMIUM: Input: cyapa - Use scnprintf for sysfs properties

BUG=chromium-os:21047
TEST=Builds clean. Try the following from the cyapa driver's sysfs path on
Lumpy.
cat firmware_version
cat hardware_version
cat product_id
cat protocol_version
Verify that the following are returned:
11.22
2.0
CYTRA-116001-00
3

Change-Id: I6884fd297afa2be9e547601bf58d8d417e66fed5
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25468
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: Input: cyapa - clean up 80 cols
Benson Leung [Fri, 15 Jun 2012 18:23:29 +0000 (11:23 -0700)]
CHROMIUM: Input: cyapa - clean up 80 cols

BUG=chromium-os:21047
TEST=Builds clean

Change-Id: I392447ece8cfb93056d0be5ba7b32d22d5436897
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25467
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: Input: cyapa - Fix hex constants
Benson Leung [Fri, 15 Jun 2012 18:12:05 +0000 (11:12 -0700)]
CHROMIUM: Input: cyapa - Fix hex constants

Hex constants should be lowercase.

BUG=chromium-os:21047
TEST=Builds clean.

Change-Id: I6a9a0ae250fb19d8cb6c9316761b3644a8924a18
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25466
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: Input: cyapa - clean up whitespace
Benson Leung [Fri, 15 Jun 2012 03:25:56 +0000 (20:25 -0700)]
CHROMIUM: Input: cyapa - clean up whitespace

Some places have extra, others not enough.

BUG=chromium-os:21047
TEST=Builds clean.

Change-Id: I02de16e8d79a19d15f827fcc4d269f4bf8282f1b
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25465
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: Input: cyapa - Fix copyright and description
Benson Leung [Fri, 15 Jun 2012 03:21:27 +0000 (20:21 -0700)]
CHROMIUM: Input: cyapa - Fix copyright and description

BUG=chromium-os:21047
TEST=Builds clean.

Change-Id: Ic41eb8d3d02cb150ebcbe9e53091de3d80bbb302
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25464
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoBACKPORT: ALSA: hda - Protect the power-saving count with spinlock
Takashi Iwai [Tue, 8 May 2012 15:08:10 +0000 (17:08 +0200)]
BACKPORT: ALSA: hda - Protect the power-saving count with spinlock

To avoid some races.  Still not perfect, but now a bit safer.

BUG=chrome-os-partner:10399
TEST=suspend and resume hda codec.

Change-Id: I4ed5c1bf283ada5cf05b7ad94859c7f851dc2f53
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Dylan Reid <dgreid@chromium.org>
(cherry picked from commit 5536c6d69376273d5210ce05b7d5d462f0dff9d6)
Reviewed-on: https://gerrit.chromium.org/gerrit/25323
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoBACKPORT: ALSA: hda - Clear the power-saving states properly at reset
Takashi Iwai [Tue, 8 May 2012 14:57:12 +0000 (16:57 +0200)]
BACKPORT: ALSA: hda - Clear the power-saving states properly at reset

Some power-saving states have been left unchanged in
snd_hda_codec_reset(), and this is a potential danger because the
function may be called in various situations including the continuous
operation after that call.

BUG=chrome-os-partner:10399
TEST=suspend and resume hda codec.

Change-Id: Ia5c25f4920a74c51e29f9cacba47eb2d7bea4ed0
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Dylan Reid <dgreid@chromium.org>
(cherry picked from commit 339876d70a5794c0d5fe09d37827c63148d5017a)
Reviewed-on: https://gerrit.chromium.org/gerrit/25322
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoBACKPORT: ALSA: hda - Always resume the codec immediately
Takashi Iwai [Tue, 8 May 2012 14:52:23 +0000 (16:52 +0200)]
BACKPORT: ALSA: hda - Always resume the codec immediately

This is a fix for the problem in commit 785f857d1c, the pop noise
issue on some machines with ALC269.  The problem was the uninitialized
state after the resume due to the delayed resume of the codec chips.
In that commit, we tried to fix by forcibly putting the codec to D3 at
suspend.  But, this still also leaves the uninitialized state after
resume, and it _might_ be still problematic with some BIOS.  Since the
commit turned out to regress another issues, we reverted it in the
end.

Now, in this fix, try to fix by turning on the codec immediately at
the resume path.  We need to take care of the power-saving in this
case.  When the device is woken up at the power-saved state, it should
go power-saving again after the resume.

BUG=chrome-os-partner:10399
TEST=suspend and resume hda codec.

Change-Id: Idada87c9cda84646c5d602e536bea9fd5e33bbed
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Dylan Reid <dgreid@chromium.org>
(cherry picked from commit 7f30830b7b82e5225c38a48b387e44f3defe40e2)
Reviewed-on: https://gerrit.chromium.org/gerrit/25321
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoBACKPORT: ALSA: hda - Fix possible access to uninitialized work struct
Takashi Iwai [Mon, 7 May 2012 13:01:02 +0000 (15:01 +0200)]
BACKPORT: ALSA: hda - Fix possible access to uninitialized work struct

The work struct must be initialized before the possible call in the
destructor.

BUG=chrome-os-partner:10399
TEST=suspend and resume hda codec.

Change-Id: I5ed2112e484df3160193d84825cf6a5ad5c3722d
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Dylan Reid <dgreid@chromium.org>
(cherry picked from commit c382a9f009d7332e16919154e01f5554eeb095ed)
Reviewed-on: https://gerrit.chromium.org/gerrit/25320
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoUPSTREAM: staging: gdm72xx: Release netlink socket properly
Ben Chan [Thu, 14 Jun 2012 20:18:56 +0000 (13:18 -0700)]
UPSTREAM: staging: gdm72xx: Release netlink socket properly

This patch modifies the gdm72xx driver to properly release a netlink
socket using netlink_kernel_release. It fixes the following kernel
crash, which occurs after repeatedly suspending and resuming a system.

   kernel BUG at /home/benchan/trunk/src/third_party/kernel/files/mm/slub.c:3471!
   invalid opcode: 0000 [#1] SMP
   CPU 2
   Modules linked in: asix usbnet snd_hda_codec_hdmi
   snd_hda_codec_cirrus i2c_dev uinput snd_hda_intel snd_hda_codec
   snd_hwdep snd_pcm snd_timer bluetooth snd_page_alloc fuse aesni_intel
   cryptd isl29018(C) aes_x86_64 industrialio(C) memconsole nm10_gpio
   rtc_cmos nf_conntrack_ipv6 nf_defrag_ipv6 r8169 ath9k mac80211
   ip6table_filter ath9k_common ath9k_hw ath cfg80211 xt_mark ip6_tables
   uvcvideo videobuf2_core videodev videobuf2_vmalloc videobuf2_memops
   gdmwm(C) joydev

   Pid: 3125, comm: kworker/u:30 Tainted: G        WC   3.4.0 #1
   RIP: 0010:[<ffffffff810cda19>]  [<ffffffff810cda19>] kfree+0x67/0xca
   RSP: 0018:ffff880134977d60  EFLAGS: 00010246
   RAX: 4000000000000400 RBX: ffffffff818832a0 RCX: 0000000000000000
   RDX: 4000000000000000 RSI: 0000000000000000 RDI: ffffffff818832a0
   RBP: ffff880134977d80 R08: 00000000ffffffff R09: ffffea00000620c0
   R10: ffffffff8111b729 R11: ffff880149fb3840 R12: ffffffff81a08840
   R13: ffffffff813f5bc3 R14: ffffffff8138ed84 R15: 0000000000000000
   FS:  0000000000000000(0000) GS:ffff88014fb00000(0000) knlGS:0000000000000000
   CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
   CR2: 00007f7cad963110 CR3: 000000000180b000 CR4: 00000000000407e0
   DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
   DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
   Process kworker/u:30 (pid: 3125, threadinfo ffff880134976000, task ffff8801330647e0)
   Stack:
    0000000000000002 ffffffff818832a0 ffffffff81a08840 ffff880134977df0
    ffff880134977da0 ffffffff813f5bc3 ffff880134977df0 ffffffff81883250
    ffff880134977dd0 ffffffff8138e64c 0000000180150010 ffffffff81883250
   Call Trace:
    [<ffffffff813f5bc3>] ipv4_sysctl_exit_net+0x23/0x27
    [<ffffffff8138e64c>] ops_exit_list+0x27/0x50
    [<ffffffff8138ee72>] cleanup_net+0xee/0x17c
    [<ffffffff81040c64>] process_one_work+0x199/0x2b8
    [<ffffffff810416e4>] worker_thread+0x13c/0x222
    [<ffffffff810415a8>] ? manage_workers.isra.26+0x171/0x171
    [<ffffffff8104506d>] kthread+0x8b/0x93
    [<ffffffff8145b414>] kernel_thread_helper+0x4/0x10
    [<ffffffff81044fe2>] ? __init_kthread_worker+0x39/0x39
    [<ffffffff8145b410>] ? gs_change+0xb/0xb
   Code: 83 c4 10 49 83 3c 24 00 eb e4 48 83 fb 10 76 76 48 89 df e8 17
   e1 ff ff 49 89 c1 48 8b 00 a8 80 75 15 49 f7 01 00 c0 00 00 75 02
   <0f> 0b 4c 89 cf e8 b8 b4 fd ff eb 4f 4c 8b 55 08 49 8b 79 30 48
   RIP  [<ffffffff810cda19>] kfree+0x67/0xca
    RSP <ffff880134977d60>

Signed-off-by: Ben Chan <benchan@chromium.org>
Cc: Sage Ahn <syahn@gctsemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9f77186dd13125bef301f9136b6075f5530f3d85)

BUG=chrome-os-partner:10336
TEST=No kernel crash when running the suspend/resume test script.

Change-Id: Ib9c3685d18832352db3ed641cad8e41d0ce94d92
Reviewed-on: https://gerrit.chromium.org/gerrit/25280
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>

12 years agoCHROMIUM: drm: Add downclock quirk for Samsung LTN121AT10-301
Sean Paul [Wed, 18 Jan 2012 15:06:40 +0000 (10:06 -0500)]
CHROMIUM: drm: Add downclock quirk for Samsung LTN121AT10-301

Add a quirk which adds a new downclocked mode to the EDID of Samsung
LTN121AT10-301 panels. This allows the intel driver to apply downclocking
and save power.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
BUG=chromium-os:31326
TEST=Tested on lumpy

Change-Id: I91c736df691e2670a1e8ebc4d07d7df4afca1232
Reviewed-on: https://gerrit.chromium.org/gerrit/25287
Tested-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Mark Hayter <mdhayter@chromium.org>
Commit-Ready: Sean Paul <seanpaul@chromium.org>

12 years agoCHROMIUM: config: Enable Broadcom Ethernet/SD card kernel driver
Jay Kim [Fri, 8 Jun 2012 23:49:55 +0000 (16:49 -0700)]
CHROMIUM: config: Enable Broadcom Ethernet/SD card kernel driver

Broadcom Ethernet/SD card combo: BCM57785

Signed-off-by: Jay Kim <yongjaek@google.com>
BUG=chrome-os-partner:9884
TEST=Test Ethernet and SD card on Parrot

Change-Id: I68130be0a37b9ae362320cb123470c4b6533cb05
Reviewed-on: https://gerrit.chromium.org/gerrit/24930
Tested-by: Jay Kim <yongjaek@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Jay Kim <yongjaek@chromium.org>

12 years agoBACKPORT: drm/i915: Implement w/a for sporadic read failures on waking from rc6
Stéphane Marchesin [Wed, 13 Jun 2012 22:59:18 +0000 (15:59 -0700)]
BACKPORT: drm/i915: Implement w/a for sporadic read failures on waking from rc6

As a w/a to prevent reads sporadically returning 0, we need to wait for
the GT thread to return to TC0 before proceeding to read the registers.

Change-Id: I0a501fc164d2e47e774eea0f88bdfbd0e6d37caa
References: https://bugs.freedesktop.org/show_bug.cgi?id=50243
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
TEST=compiles and runs
BUG=none

Change-Id: I8d79cc14a9059f46ddb8ca77bf9c98e60d8e8c96
Reviewed-on: https://gerrit.chromium.org/gerrit/25258
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>

12 years agoCHROMIUM: platform/x86/chromeos_laptop - atmel_mxt_tp increase to 10 points
Benson Leung [Wed, 13 Jun 2012 01:14:52 +0000 (18:14 -0700)]
CHROMIUM: platform/x86/chromeos_laptop - atmel_mxt_tp increase to 10 points

Currently, the atmel_mxt_tp is configured for 4 touch points.
These 4 can be quickly consumed up especially in the case of a
splitting resting palm + a two or three  finger scroll gesture.
Lets bump up the number of supported touch points to the maximum. (10)

BUG=chrome-os-partner:10455
TEST=DISPLAY=:0 mtplot
Select the Atmel maXTouch Touchpad.
Put down 10 fingers on the touchpad. Confirm that mtplot application
shows 10 distinct touchpoints.

Change-Id: I401813716ab78a73463c96ac43d9de9910b76b1c
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25158
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
12 years agoCHROMIUM: minor fixes to chromeos_laptop.c
Simon Que [Tue, 12 Jun 2012 20:41:27 +0000 (13:41 -0700)]
CHROMIUM: minor fixes to chromeos_laptop.c

Comments, logging, and formatting.

BUG=chrome-os-partner:9204
TEST=kernel builds.

Change-Id: Ibf664a4b4edabf4d06c7c244b8742fe44d6640ab
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25120

12 years agoUPSTREAM: staging: gdm72xx: Simplify spinlock fix for gdm_usb_send_complete
Ben Chan [Tue, 12 Jun 2012 18:23:32 +0000 (11:23 -0700)]
UPSTREAM: staging: gdm72xx: Simplify spinlock fix for gdm_usb_send_complete

This patch simplifies the previous patch (commit
dd13c86b0dae86efdde98119ffd7348e80719ade) for fixing the spinlock
recursion issue on several call sites of gdm_usb_send_complete.

Signed-off-by: Ben Chan <benchan@chromium.org>
Cc: Sage Ahn <syahn@gctsemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 0c16ae762990660c4dfd7515e3d46b4249f535f0)

BUG=chrome-os-partner:10150
TEST=Manually test suspend/resume the system after connecting to WiMAX.

Change-Id: I61aee9289fb9606d69a618a742ff0b00f2d59d66
Reviewed-on: https://gerrit.chromium.org/gerrit/25126
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
12 years agoUPSTREAM: staging: gdm72xx: Fix spinlock recursion on gdm_usb_send_complete
Ben Chan [Thu, 7 Jun 2012 06:01:26 +0000 (23:01 -0700)]
UPSTREAM: staging: gdm72xx: Fix spinlock recursion on gdm_usb_send_complete

This patch fixes a spinlock recursion bug on several call sites of
gdm_usb_send_complete by not calling spin_lock_irqsave on
urb->context->tx_cxt->lock when the lock has already been acquired.

Signed-off-by: Ben Chan <benchan@chromium.org>
Cc: Sage Ahn <syahn@gctsemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit dd13c86b0dae86efdde98119ffd7348e80719ade)

BUG=chrome-os-partner:10150
TEST=Manually test suspend/resume the system after connecting to WiMAX.

Change-Id: I2b116efee7a8caf1eef57eb093837bfc2dead449
Reviewed-on: https://gerrit.chromium.org/gerrit/25118
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>

12 years agoUPSTREAM: staging/gdm72xx: Remove version.h includes
Devendra Naga [Sun, 27 May 2012 20:23:22 +0000 (01:53 +0530)]
UPSTREAM: staging/gdm72xx: Remove version.h includes

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 02fd3b3670fb99017b17757d33a0a17e2405920c)

Change-Id: Ib71e72c2c96cf1e6314b182ab3d6ca3913ce3a94
Reviewed-on: https://gerrit.chromium.org/gerrit/25117
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>

12 years agoUPSTREAM: Staging: gdm72xx: gdm_usb: fix deprecated function kernel_thread
Adnan Ali [Thu, 31 May 2012 10:32:48 +0000 (11:32 +0100)]
UPSTREAM: Staging: gdm72xx: gdm_usb: fix deprecated function kernel_thread

This commit fixes deprecated function kernel_thread by replacing
it with kthread_run.

Signed-off-by: Adnan Ali <adnan.ali@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ff5e4a1d2702582614996f6f6d005e9b5caadeb8)

Change-Id: I65f4f471295ddf8ea0ea465dae1b90eef537f24d
Reviewed-on: https://gerrit.chromium.org/gerrit/25116
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>

12 years agoCHROMIUM: Register keyboard backlight for Link
Simon Que [Tue, 22 May 2012 20:10:59 +0000 (13:10 -0700)]
CHROMIUM: Register keyboard backlight for Link

BUG=chrome-os-partner:9204
TEST=/sys/class/backlight/keyboard_backlight exists and can be used to
change the brightness of the keyboard backlight.

Change-Id: I29a540cb83e7fddcdd348a7f63debd96fbda5c88
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24737
Reviewed-by: Benson Leung <bleung@chromium.org>
12 years agoCHROMIUM: boottime: x86: Skip slow reserved memory count
Sonny Rao [Sat, 11 Jun 2011 00:51:01 +0000 (17:51 -0700)]
CHROMIUM: boottime: x86: Skip slow reserved memory count

This loop is taking > 350msec on 2.6.38 and provides us little value
so pull it out.  Longer term, we should fix the performance either by
not looping over every single pfn in lowmem or fixing the performance of
the current page_is_ram() function

BUG=chromium-os:15542
TEST=make sure boot works and kernel time is faster

Change-Id: I25beb8cf95428ac3354e625814fec7b2498a90c0
Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/2499
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25060
Tested-by: Grant Grundler <grundler@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Grant Grundler <grundler@chromium.org>

12 years agoUPSTREAM: x86/reboot: Use NMI to assist in shutting down if IRQ fails
Sameer Nanda [Tue, 12 Jun 2012 01:06:02 +0000 (18:06 -0700)]
UPSTREAM: x86/reboot: Use NMI to assist in shutting down if IRQ fails

For v3.3, I added code to use the NMI to stop other cpus in the
panic case.  The idea was to make sure all cpus on the system
were definitely halted to help serialize the panic path to
execute the rest of the code on a single cpu.

The main problem it was trying to solve was how to stop a cpu
that was spinning with its irqs disabled.  A IPI irq would be
stuck and couldn't get in there, but an NMI could.

Things were great until we had another conversation about some
pstore changes.  Because some of the backend pstore still uses
spinlocks to protect the device access, things could get ugly if
a panic happened and we were stuck spinning on a lock.

Now with the NMI shutting down cpus, we could assume no other
cpus were running and just bust the spin lock and proceed.

The counter argument was, well if you do that the backend could
be in a screwed up state and you might not be able to save
anything as a result. If we could have just given the cpu a
little more time to finish things, we could have grabbed the
spin lock cleanly and everything would have been fine.

Well, how do give a cpu a 'little more time' in the panic case?
For the most part you can't without spinning on the lock and
even in that case, how long do you spin for?

So instead of making it ugly in the pstore code, just mimic the
idea that stop_machine had, which is block on an IRQ IPI until
the remote cpu has re-enabled interrupts and left the critical
region.  Which is what happens now using REBOOT_IRQ.

Then leave the NMI case for those cpus that are truly stuck
after a short time.  This leaves the current behaviour alone and
just handle a corner case.  Most systems should never have to
enter the NMI code and if they do, print out a message in case
the NMI itself causes another issue.

BUG=chromium-os:31189
TEST=run "echo softlockup > /proc/breakme". The system should reboot
after about 10 seconds and a kcrash file should be present in
/var/spool/crash when the system reboots.

Change-Id: If664b5ac869c774ea88d4bbe70bb10ecc90b52a5
Signed-off-by: Don Zickus <dzickus@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1336761675-24296-3-git-send-email-dzickus@redhat.com
Signed-off-by: Sameer Nanda <snanda@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25063
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: platform/x86/chromeos_laptop : Add trackpad2
Yufeng Shen [Fri, 8 Jun 2012 00:43:14 +0000 (20:43 -0400)]
CHROMIUM: platform/x86/chromeos_laptop : Add trackpad2

Adding atmel trackpad2 for testing of loading config data
from file.

BUG=chrome-os-partner:9103
TEST=trackpad2 should be up running correctly.

Change-Id: I10d47139e52603bafd507e67b3e27ba1dcf5d805
Signed-off-by: Yufeng Shen <miletus@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24826
Reviewed-by: Benson Leung <bleung@chromium.org>
12 years agoath9k_hw: Initvals update for AR9462
Sujith Manoharan [Fri, 8 Jun 2012 07:54:55 +0000 (13:24 +0530)]
ath9k_hw: Initvals update for AR9462

MSI is enabled by default for most of the 4th generation
chips. Add this for AR9462 - this fixes PowerSave operation,
the chip was not entering Network-Sleep mode earlier.
With proper powering down of the MAC now, power consumption
in associated state is reduced considerably.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31635
TEST=Recompile, install, join network

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

12 years agoUPSTREAM: ext4: fix the free blocks calculation for ext3 file systems w/ uninit_bg
Theodore Ts'o [Thu, 7 Jun 2012 13:52:33 +0000 (09:52 -0400)]
UPSTREAM: ext4: fix the free blocks calculation for ext3 file systems w/ uninit_bg

Ext3 filesystems that are converted to use as many ext4 file system
features as possible will enable uninit_bg to speed up e2fsck times.
These file systems will have a native ext3 layout of inode tables and
block allocation bitmaps (as opposed to ext4's flex_bg layout).
Unfortunately, in these cases, when first allocating a block in an
uninitialized block group, ext4 would incorrectly calculate the number
of free blocks in that block group, and then errorneously report that
the file system was corrupt:

EXT4-fs error (device vdd): ext4_mb_generate_buddy:741: group 30, 32254 clusters in bitmap, 32258 in gd

This problem can be reproduced via:

    mke2fs -q -t ext4 -O ^flex_bg /dev/vdd 5g
    mount -t ext4 /dev/vdd /mnt
    fallocate -l 4600m /mnt/test

The problem was caused by a bone headed mistake in the check to see if a
particular metadata block was part of the block group.

Many thanks to Kees Cook for finding and bisecting the buggy commit
which introduced this bug (commit fd034a84e1, present since v3.2).

Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@kernel.org
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Cc: Kees Cook <keescook@chromium.org>
(cherry picked from commit b0dd6b70f0fda17ae9762fbb72d98e40a4f66556)

BUG=chromium-os:22172
TEST=x86-alex build & manual testing

Change-Id: I42ab91d74ab44de6ff4bbf05c3bba626ea48f077
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24777
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: config: build in atmel_mxt_ts driver
Benson Leung [Fri, 8 Jun 2012 00:50:01 +0000 (17:50 -0700)]
CHROMIUM: config: build in atmel_mxt_ts driver

Build in the atmel_mxt_ts driver to speed up initialization
of atmel_mxt touch devices. Loading as module results in the
input device not responsive for some seconds as the rest of boot
happens quite quickly.

Bulding it in will improve usability, and also allow us to
perform firmware and config updates early on at boot time.

BUG=chrome-os-partner:9720
TEST=Boot the system. Check for atmel_mxt_ts device initialization.
Check that it occurs around 3s.

Change-Id: I7dfd9b76aed9f4fbdf60c6b7b9bc86b0f44934e9
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24830
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: platform/x86/chromeos_laptop - probe for atmel_mxt_tp bl
Benson Leung [Fri, 8 Jun 2012 01:27:40 +0000 (18:27 -0700)]
CHROMIUM: platform/x86/chromeos_laptop - probe for atmel_mxt_tp bl

Use chromeos_laptop_add_probed_i2c_device to handle atmel_mxt_tp
devices that start in bootloader mode, a condition that may
happen when there is corrupted firmware, but a functional bootloader,
for example.

This will allow the device to be initialized with the bootloader address
and a recovery to occur.

BUG=chrome-os-partner:10318
TEST=Perform a firmware update on the atmel_mxt_tp device, and before
it completes, reboot the system to leave the touchpad in an incomplete
operational firmware state.
On the next boot, the atmel driver should be loaded on 0x25,
so you should find an input device at /sys/bus/i2c/devices/1-0025
Perform another uninterrupted update with chromeos-touch-firmwareupdater.sh
and it should recover.

Change-Id: I11e7e8d6d61b7d5b731f388ef655c8d28ec122e6
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24832
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
12 years agoUPSTREAM: ath9k_hw: fix ath9k_hw_ar9003_dump_eep_power warning
Rajkumar Manoharan [Fri, 1 Jun 2012 05:56:32 +0000 (11:26 +0530)]
UPSTREAM: ath9k_hw: fix ath9k_hw_ar9003_dump_eep_power warning

drivers/net/wireless/ath/ath9k/ar9003_eeprom.c: In function
'ath9k_hw_ar9003_dump_eep_power':
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c:5140:2: warning: format
'%d' expects argument of type 'int', but argument 5 has type 'u8 *'
[-Wformat]

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: I016ddea9396592c80032fc81808337e4ebe487c2
Reviewed-on: https://gerrit.chromium.org/gerrit/24807
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: ath9k: Fix modal EEPROM dump
Mohammed Shafi Shajakhan [Fri, 1 Jun 2012 05:54:20 +0000 (11:24 +0530)]
UPSTREAM: ath9k: Fix modal EEPROM dump

we provide excess buffer size for 'simple_read_from_buffer'
for modal EEPROM dump. This results in trailing NULL bytes
at the end of EEPROM dump, fix this.

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: I8996225a5855b9a8d79fba51d909e3a8ebf2e1cd
Reviewed-on: https://gerrit.chromium.org/gerrit/24806
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: mac80211: Fix race in checking AP status by sending null frame
Soumik Das [Thu, 31 May 2012 12:22:29 +0000 (17:52 +0530)]
UPSTREAM: mac80211: Fix race in checking AP status by sending null frame

mac80211 tries to verify the existence of the current AP by
probing or sending a NULL frame in function
ieee80211_mgd_probe_ap_send. It 1st sends a null frame to the AP,
increments probe_send_count and waits for the ACK to the NULL
frame for a finite duration of time. At times, it happens that by
the time mac80211 gets to increment probe_send_count, the ACK for
the NULL frame transmitted has already been processed. This leads
to a race condition where mac80211 times out waiting for the ACK
for the NULL frame causing unnecessary disconnection with the AP.

Signed-off-by: Soumik Das <soumik.das@stericsson.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: I4dad7958d8afef9de47f9b70a4d1ae06d32a3750
Reviewed-on: https://gerrit.chromium.org/gerrit/24805
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: mac80211: fix network header location when adding encryption headers
Arik Nemtsov [Thu, 10 May 2012 10:21:09 +0000 (13:21 +0300)]
UPSTREAM: mac80211: fix network header location when adding encryption headers

Update the location of the network header when adding encryption
specific headers to a skb. This allows low-level drivers to use the
(now correct) location of the network header.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: Ie67aa86ba1aea8382254319962e6ba926017e368
Reviewed-on: https://gerrit.chromium.org/gerrit/24804
Reviewed-by: Gary Morain <gmorain@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>

12 years agoUPSTREAM: mac80211: Add IV-room in the skb for TKIP and WEP
Janusz.Dziedzic@tieto.com [Wed, 9 May 2012 05:11:20 +0000 (08:11 +0300)]
UPSTREAM: mac80211: Add IV-room in the skb for TKIP and WEP

Add IV-room in skb also for TKIP and WEP.
Extend patch: "mac80211: support adding IV-room in the skb for CCMP keys"

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: If2161de81ec8765485461fd43f39f02275df7531
Reviewed-on: https://gerrit.chromium.org/gerrit/24803
Reviewed-by: Gary Morain <gmorain@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>

12 years agoUPSTREAM: ath9k: Resync beacons after a HW reset
Sujith Manoharan [Tue, 22 May 2012 03:28:59 +0000 (08:58 +0530)]
UPSTREAM: ath9k: Resync beacons after a HW reset

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: I88368e57ae62d824c28d3463ea17257ebf7b2372
Reviewed-on: https://gerrit.chromium.org/gerrit/24802
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: ath9k: simplify beacon configuration for beaconing vifs
Rajkumar Manoharan [Thu, 19 Apr 2012 13:43:51 +0000 (19:13 +0530)]
UPSTREAM: ath9k: simplify beacon configuration for beaconing vifs

As of now beacon configuration is being called multiple times
in bss info change notification. This patch avoids multiple
configuration and make it simpler.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: Ic8686c45481115a8b8e25c385db8e13fb340f841
Reviewed-on: https://gerrit.chromium.org/gerrit/24801
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: ath: do not update cycle counters with sleep mode results
Rajkumar Manoharan [Mon, 30 Apr 2012 08:04:36 +0000 (13:34 +0530)]
UPSTREAM: ath: do not update cycle counters with sleep mode results

When the chip is waking up from sleep state, the cycle counters
might have incorrect readings. So it is better not to update those
readings with software counters.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: I518ce3fafc054f8617527645fe66302edfd2af7e
Reviewed-on: https://gerrit.chromium.org/gerrit/24800
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: ath9k_hw: configure ar9462 switching regulator discontinuous mode
Rajkumar Manoharan [Tue, 8 May 2012 11:29:17 +0000 (16:59 +0530)]
UPSTREAM: ath9k_hw: configure ar9462 switching regulator discontinuous mode

Enable WLAN and BT mode for switching regulator discontinuous
orverride for AR9462 chips.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: Ide0c5f22027410c9e2f5b1295c908291c5983474
Reviewed-on: https://gerrit.chromium.org/gerrit/24799
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: ath9k_hw: fix IQ calibration chain index
Rajkumar Manoharan [Tue, 8 May 2012 04:55:15 +0000 (10:25 +0530)]
UPSTREAM: ath9k_hw: fix IQ calibration chain index

The chain index to perform IQ calibration is counted to number of valid
tx chains and then used for indexing chain specific registers. If the
chainmask is set to 0x2 (i.e chain 1 only), still it accesses chain 0
registers for chain 1. So use real chain index instead sequential one.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: I4c7d646f195d82b347d798881b02d6546b52595e
Reviewed-on: https://gerrit.chromium.org/gerrit/24798
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: ath9k_hw: update ar9462 initval table to fix rx nfcal
Rajkumar Manoharan [Thu, 19 Apr 2012 08:49:40 +0000 (14:19 +0530)]
UPSTREAM: ath9k_hw: update ar9462 initval table to fix rx nfcal

The wrong ADC sample phase that happen between awake and
network/full sleep will lead to improper rx noisefloor
calibration.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: I4fd73a941e4a55bcbb7922bf3a82d9943765e84b
Reviewed-on: https://gerrit.chromium.org/gerrit/24797
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: ath9k: Handle fatal interrupts properly
Sujith Manoharan [Mon, 21 May 2012 08:08:36 +0000 (13:38 +0530)]
UPSTREAM: ath9k: Handle fatal interrupts properly

When a fatal interrupt is received or it is detected that the baseband
has hung, the chip has to be reset immediately.  Otherwise, we end up
processing spurious interrupts. Ensure that we bail out properly in
the ISR when the reset work hasn't completed yet.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: I50470083dc66b8a19241eb928b96fef46366d492
Reviewed-on: https://gerrit.chromium.org/gerrit/24796
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: ath9k_hw: Fix MCI usage
Sujith Manoharan [Sat, 12 May 2012 11:29:15 +0000 (16:59 +0530)]
UPSTREAM: ath9k_hw: Fix MCI usage

MCI has to be handled only when BTCOEX is actually enabled.
Check for this condition before calling MCI related functions
from various reset/calibration call-sites.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: Ied5d5f03b3fde1323faf8d924ae42843b2b97108
Reviewed-on: https://gerrit.chromium.org/gerrit/24795
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: ath9k_hw: Fix AR_RTC_KEEP_AWAKE usage
Sujith Manoharan [Sat, 12 May 2012 07:58:50 +0000 (13:28 +0530)]
UPSTREAM: ath9k_hw: Fix AR_RTC_KEEP_AWAKE usage

The default value that is being programmed to AR_RTC_KEEP_AWAKE
is 0x2, there is no need to program it manually in various
functions.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: I4000e6aeb45e19aa9d43d09e7d17912743c51e98
Reviewed-on: https://gerrit.chromium.org/gerrit/24794
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: ath9k: Setup MCI interrupts properly
Sujith Manoharan [Sat, 12 May 2012 02:26:49 +0000 (07:56 +0530)]
UPSTREAM: ath9k: Setup MCI interrupts properly

MCI interrupts have to be enabled only when BTCOEX is
actually in use.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: I483f394623b881eb994a79d71343618a05554e47
Reviewed-on: https://gerrit.chromium.org/gerrit/24793
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: ath9k: Handle ASPM properly
Sujith Manoharan [Thu, 10 May 2012 07:42:54 +0000 (13:12 +0530)]
UPSTREAM: ath9k: Handle ASPM properly

ASPM has to be disabled when BTCOEX is in use, do this properly
by calling the bus-specific ASPM init routine after the
BTCOEX scheme has been determined.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: I54d3a6a9844eaf887ecdf097209f40219c72b7d6
Reviewed-on: https://gerrit.chromium.org/gerrit/24792
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: ath9k_hw: Fix RTT calibration
Sujith Manoharan [Fri, 4 May 2012 07:53:59 +0000 (13:23 +0530)]
UPSTREAM: ath9k_hw: Fix RTT calibration

This patch fixes multiple issues with the current RTT
implementation in ath9k.

* The data that is obtained from the RTT interface registers
  are stored in 31:5 - mask out the extra bits when reading them.

* A history buffer is maintained which is not needed at all.
  Remove this array and just store the baseband data for each
  chain (or bank).

* A 'num_readings' variable was being used to handle the
  last entry. But it was being used in an improper manner, with
  the result that the RTT values were never being written
  to the RTT Interface registers. Fix this by using a simple
  flag.

* Stop baseband operations before programming the calibration values
  to the HW.

* Do not restore RX gain settings as part of RTT.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: I0061199fa79a0a506574d0ed214c560d7f1e382f
Reviewed-on: https://gerrit.chromium.org/gerrit/24791
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: ath9k: Fix IDLE Powersave
Sujith Manoharan [Tue, 24 Apr 2012 04:53:20 +0000 (10:23 +0530)]
UPSTREAM: ath9k: Fix IDLE Powersave

* PS_WAIT_FOR_TX_ACK is used in network-sleep mode and checking
  it for handling IDLE transitions is incorrect. Fix this.

* RX PCU/DMA engines have to be stopped before setting the chip into
  full-sleep mode - otherwise the chip becomes mute.

* Make things a bit clear by checking explicitly for network-sleep
  mode in the tx() routine and add a couple of debug statements
  to aid PS debugging.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: I1393ab6bfb9a9d9dac48efe78bceae5699fc045b
Reviewed-on: https://gerrit.chromium.org/gerrit/24790
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: ath9k: don't strip mic on non-encrypted frames in tkip
Michael Liang [Fri, 20 Apr 2012 09:11:57 +0000 (17:11 +0800)]
UPSTREAM: ath9k: don't strip mic on non-encrypted frames in tkip

Fix the following bug: in tkip mode, qos-null ps on/off packets
are dropped due to incorrect packet length so that ath9k softap
can't handle powersave state transition of peer STA correctly.

Signed-off-by: Michael Liang <mliang@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: Ied558990083b87b7cc07307bd0776ce9fccbc0d6
Reviewed-on: https://gerrit.chromium.org/gerrit/24789
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: ath9k: fix ibss beacon next tbtt
Rajkumar Manoharan [Fri, 13 Apr 2012 07:46:34 +0000 (13:16 +0530)]
UPSTREAM: ath9k: fix ibss beacon next tbtt

Sync-up ibss beacon timer with the beacon frame's timestamp. When the
node acts as joiner, it has to sync with the received beacon timestamp
instead of reading tsf from hw. As the hw tsf wont wont be update till
bssid is configured. This patch programs hw tsf with the received beacon
timestamp if beacon timers are yet to be configured.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: I1f607a52cd503737114e6a416c5336cb7164192a
Reviewed-on: https://gerrit.chromium.org/gerrit/24788
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: ath9k: fix ibss fair beacon distribution for AR9462
Rajkumar Manoharan [Fri, 13 Apr 2012 07:46:33 +0000 (13:16 +0530)]
UPSTREAM: ath9k: fix ibss fair beacon distribution for AR9462

Update AR9462 initval to fix unbalance beacon distribution
in Ad-Hoc network.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: I4c3bb75055f42ae94993b844d048fcdcfe615369
Reviewed-on: https://gerrit.chromium.org/gerrit/24787
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: ath9k_hw: Remove BTCOEX initvals
Sujith Manoharan [Wed, 11 Apr 2012 04:04:08 +0000 (09:34 +0530)]
UPSTREAM: ath9k_hw: Remove BTCOEX initvals

The MAX_TXPWR table for BTCOEX is not needed for AR9462.
Programming these values to the HW results in undesirable
behavior - for example, large number of delimiter/data
underruns are seen in AES-CCMP mode. Also, registers like
AR_PCU_MISC_MODE2 return 0xdeadbeef after the BTCOEX_MAX
power table is programmed to the HW, and frames being transmitted
end up being looped back to the RX engine, an example being beacon
frames in IBSS mode.

Remove this table for now - this fixes CCMP performance and general
IBSS usage.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: I48af2df760c70bc1c470b81ee057b1c0c304326b
Reviewed-on: https://gerrit.chromium.org/gerrit/24786
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoCHROMIUMOS: Revert "CHROMIUMOS: ath9k: Disable HT on ar9462"
Rajkumar Manoharan [Mon, 21 May 2012 08:29:25 +0000 (13:59 +0530)]
CHROMIUMOS: Revert "CHROMIUMOS: ath9k: Disable HT on ar9462"

This reverts commit af103fe6573b3a1a33aaf0f65227fc542311b3d1.
Re-enabling HT on ar9462 for 3.4 kernel.

Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:31625
TEST=Recompile, install, join GoogleGuest

Change-Id: I9714a5a2e116d8b266fd2a8d96d11e327b83d9e9
Reviewed-on: https://gerrit.chromium.org/gerrit/24785
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agoCHROMIUM: Enable keyboard backlight in config
Simon Que [Tue, 22 May 2012 20:10:15 +0000 (13:10 -0700)]
CHROMIUM: Enable keyboard backlight in config

BUG=chrome-os-partner:9204
TEST=Kernel builds successfully

Change-Id: I3457e18b2bd171c6621b9b83a04fe6dd71b39caf
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24736
Reviewed-by: Benson Leung <bleung@chromium.org>
12 years agoCHROMIUM: backlight: fixes for chromeos_keyboard_bl
Simon Que [Thu, 7 Jun 2012 20:13:14 +0000 (13:13 -0700)]
CHROMIUM: backlight: fixes for chromeos_keyboard_bl

Explicitly include linux/io.h for inb() and outb().

Put includes in alphabetical order.

BUG=chrome-os-partner:9204
TEST=Apply https://gerrit.chromium.org/gerrit/#change,24736, build
on x86, arm, and amd64.

Change-Id: Icf2825f53d8f40eb566093fb9485c0e723c6c9d3
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24752
Reviewed-by: Benson Leung <bleung@chromium.org>
12 years agoCHROMIUM: Input: atmel_mxt_ts - add sysfs entry for writing a config file
Yufeng Shen [Fri, 18 May 2012 20:04:06 +0000 (16:04 -0400)]
CHROMIUM: Input: atmel_mxt_ts - add sysfs entry for writing a config file

Adding a sysfs entry for loading .raw Atmel config file and write it to
the device memory.

The format spec of .raw Atmel config file can be found at
E-9078 Object-Based Chip Config File Format

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Yufeng Shen <miletus@chromium.org>
BUG=chrome-os-partner:9103

TEST=Provide no platform to the atmel device
     cd path-to-atmel-sysfs
     1. cat config_file
        make sure maxtouch.cfg is returned.
        echo 1 > update_config
        and check the error msg in dmesg for
        "Unable to open config file"
     2. copy maxtouch.cfg over to /lib/firmware/
        echo 1 > update_config
        check dmesg to see the device is reconfigured.

Change-Id: I439d86fcc0bf05b7922619e55af56ef79c1892ab
Reviewed-on: https://gerrit.chromium.org/gerrit/24532
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
12 years agoCHROMIUM: config: turn on CONFIG_ACERHDF=m on chromiumos configs
Olof Johansson [Thu, 7 Jun 2012 15:02:27 +0000 (08:02 -0700)]
CHROMIUM: config: turn on CONFIG_ACERHDF=m on chromiumos configs

BUG=none (reported on chromium-os-dev)
TEST=Boot on Acer Aspire One A150 and make sure the fan doesn't run full steam

Change-Id: I9b998cc81b0da1f5b142fb537242c981663928cc
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24724
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
12 years agoCHROMIUM: Add EC-based keyboard backlight driver
Simon Que [Mon, 21 May 2012 23:18:05 +0000 (16:18 -0700)]
CHROMIUM: Add EC-based keyboard backlight driver

This patch adds a Chrome OS keyboard backlight driver to
drivers/video/backlight.  This driver sends commands to the EC to
control the keyboard backlight.  The EC interface code is based on
platform/ec/util/ectool.c.

When successfully installed, the driver will show up under
/sys/class/backlight/keyboard_backlight.

BUG=chrome-os-partner:9204
TEST=kernel builds successfully.

Change-Id: Iefd2598ef0fd6468334524f233419bf26078ce63
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24543
Reviewed-by: Benson Leung <bleung@chromium.org>
12 years agoCHROMIUM: EFI: Don't export invalid SMBIOS base
Duncan Laurie [Wed, 6 Jun 2012 15:44:21 +0000 (08:44 -0700)]
CHROMIUM: EFI: Don't export invalid SMBIOS base

With a non-EFI system there will not be a valid SMBIOS base exported
in an EFI table.  On these systems the exported value in
/sys/kernel/debug/efi_smbios_base is ~0UL which means dmidecode
may attempt to access memory there and trigger a kernel panic.

This change checks the base against the initialized value of
EFI_INVALID_TABLE_ADDR and does not create the sysfs node in
that case.

BUG=chromium-os:31577
TEST=successfully run dmidecode on coreboot based platform

Change-Id: I16dcaa80bc7a41fbab81ff3c482460a0f86ac0ac
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24616
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: Revert "CHROMIUM: config: temporarily disable CONFIG_SECCOMP"
Will Drewry [Wed, 6 Jun 2012 20:54:36 +0000 (15:54 -0500)]
CHROMIUM: Revert "CHROMIUM: config: temporarily disable CONFIG_SECCOMP"

This reverts commit ec0ac9b8b9d33ba5d91658e66e6bd5f6ab4d4102.

Signed-off-by: Will Drewry <wad@chromium.org>
BUG=chromium:131232
TEST=seccomp behaves normally.

Change-Id: I58b1a85e81b41faf5a3ec890d815d0f0d6464ba6
Reviewed-on: https://gerrit.chromium.org/gerrit/24651
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Tested-by: Will Drewry <wad@chromium.org>
Commit-Ready: Will Drewry <wad@chromium.org>

12 years agoCHROMIUM: Default vsyscall to NATIVE again
Will Drewry [Wed, 6 Jun 2012 20:48:43 +0000 (15:48 -0500)]
CHROMIUM: Default vsyscall to NATIVE again

Due to ABI breakage issues, vsyscall was set to
NATIVE in 3.2.  Afterwards, it was changed back to
EMULATE.  EMULATE and seccomp do not get along at
present. Until that is resolved, go back to 3.2 behavior.

Signed-off-by: Will Drewry <wad@chromium.org>
BUG=chromium:131232
TEST=boots, works, seccomp works again with vsyscalls:

unsigned long t;
int main(int argc, char **argv, char **envp) {
int ret;
struct sock_filter filter[] = {
BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW),
};
struct sock_fprog prog = {
.len = (unsigned short)(sizeof(filter)/sizeof(filter[0])),
.filter = filter,
};

ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
printf("no new privs: %d\n", ret);
ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog, 0, 0);
printf("filter installed: %d\n", ret);
t = time(NULL);
printf("time is %lu\n", t);
__asm__(
"               call 0xffffffffff600400 \n"  /* sys_time */
"               movl %eax, t  \n"
);
printf("time is %lu\n", t);
syscall(__NR_exit, (int)t);
}

Change-Id: I9005a34aac215a6f1c936232a27c0e14d0417832
Reviewed-on: https://gerrit.chromium.org/gerrit/24650
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Tested-by: Will Drewry <wad@chromium.org>
Commit-Ready: Will Drewry <wad@chromium.org>

12 years agoCHROMIUM: Fix bad forward port of seccomp PTRACE_O_MASK
Will Drewry [Wed, 6 Jun 2012 16:56:01 +0000 (11:56 -0500)]
CHROMIUM: Fix bad forward port of seccomp PTRACE_O_MASK

Make the mask 0xff and not 0x7f.  Without the change, it
is impossible to use PTRACE_O_TRACESECCOMP.

We should drop this and the original ported change and take
upstreams when we roll to 3.5+.

Signed-off-by: Will Drewry <wad@chromium.org>
TEST=seccomp_tests
BUG=none?

Change-Id: I4c7eb15d3b026203878e4f84ba23cbea28899c36
Reviewed-on: https://gerrit.chromium.org/gerrit/24649
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Tested-by: Will Drewry <wad@chromium.org>
Commit-Ready: Will Drewry <wad@chromium.org>

12 years agoRevert "CHROMIUM: Lay the foundation for chromeos third party drivers"
Anush Elangovan [Wed, 6 Jun 2012 02:25:10 +0000 (19:25 -0700)]
Revert "CHROMIUM: Lay the foundation for chromeos third party drivers"

This reverts commit eb65cd292e79bd3d5b3fb9cce03d97d6f29b37bb.

BUG=none
TEST=lumpy,tegra2 trybots

Change-Id: I810fa1ab56d550c9c650148096a151db510082a1
Signed-off-by: Anush Elangovan <anush@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24569
Tested-by: Anush Elangovan <anush@google.com>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Anush Elangovan <anush@google.com>

12 years agoCHROMIUM: power: add knob for printing device resume times
Sameer Nanda [Wed, 6 Jun 2012 18:03:57 +0000 (11:03 -0700)]
CHROMIUM: power: add knob for printing device resume times

Added a new knob called /sys/power/pm_print_times. Setting it to 1
enables printing of time taken by devices to suspend and resume.
Setting it to 0 disables this printing (unless overridden by
initcall_debug kernel command line option).

This patch has been sent upstream but seems to be in limbo there.  Pushing
as a CHROMIUM patch for now and will revisit once the upstream discussion
happens.

BUG=chromium-os:30539
TEST=First enable device suspend/resume time printing by issuing this
command: "echo 1 > /sys/power/pm_print_times".  Then do a suspend/resume
cycle.  After resuming look at dmesg and there should be several "call
<device> returned 0 after <time> usecs".  The <time> in these messages
indicates the time taken by the <device> to suspend or resume.

Change-Id: I8f210acd6667a870d286bff412df6b8014438e8c
Signed-off-by: Sameer Nanda <snanda@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24628
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: config: temporarily disable CONFIG_SECCOMP
Olof Johansson [Wed, 6 Jun 2012 04:16:36 +0000 (21:16 -0700)]
CHROMIUM: config: temporarily disable CONFIG_SECCOMP

Seems like it kills v8 when it does a sys_time vsyscall. Stack is:

[  140.474867] chrome          x ffff8800741e1d48     0  2832   1159 0x00000100
[  140.482063]  ffff8800741e1cf8 0000000000000046 ffff8800741e1cc8 ffff88005c335640
[  140.489701]  ffff8800741e1cb8 ffff88005c333250 ffff8800741e1fd8 ffff8800741e1fd8
[  140.497313]  00000000000120c0 ffff88005c333250 ffff8800741e1cf8 ffff88005c333250
[  140.504935] Call Trace:
[  140.507433]  [<ffffffff81461249>] schedule+0x64/0x66
[  140.512491]  [<ffffffff8102e69f>] do_exit+0x779/0x77b
[  140.517635]  [<ffffffff81006459>] emulate_vsyscall+0x121/0x284
[  140.523587]  [<ffffffff8145b194>] __bad_area_nosemaphore+0x92/0x1ed
[  140.529986]  [<ffffffff8145b302>] bad_area_nosemaphore+0x13/0x15
[  140.536107]  [<ffffffff81021b21>] do_page_fault+0x151/0x2fc
[  140.577359]  [<ffffffff8146206f>] page_fault+0x1f/0x30

(and that chrome ends up as a zombie there, which might be an issue in and of itself).

The do_exit() call is triggered by the code in emulate_vsyscall:

        if (seccomp_mode(&tsk->seccomp))
                do_exit(SIGKILL);

I'm going to let Will figure out the rest of this. :-)

BUG=chromium:131232
TEST=boot stumpy, login, browse cbsnews.com, make sure it doesn't lock
up on first page load

Change-Id: Ida6514ca26d8222b0d24438b1f7235f85cff2abb
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24572
Reviewed-by: Grant Grundler <grundler@chromium.org>
12 years agoCHROMIUM: Revert references to chromeos/drivers
Anush Elangovan [Wed, 6 Jun 2012 02:16:03 +0000 (19:16 -0700)]
CHROMIUM: Revert references to chromeos/drivers

This partially reverts 7c401e52 to remove references to chromeos/drivers

BUG=none
TEST=trybot on lumpy/tegra2

Change-Id: I16fa4206f302bb294802e9ee110ff594cb00aedd
Signed-off-by: Anush Elangovan <anush@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24482
Tested-by: Anush Elangovan <anush@google.com>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Anush Elangovan <anush@google.com>

12 years agoCHROMIUM: i915: disable GPU RC6 on ivybridge boards
Vincent Palatin [Tue, 5 Jun 2012 22:07:10 +0000 (15:07 -0700)]
CHROMIUM: i915: disable GPU RC6 on ivybridge boards

The BIOS are not updated yet and some boards have still issues.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=None
TEST=boot kernel 3.4 on Link Proto-1.

Change-Id: I40490e5acbc85e2b4cd239faa098d2e1cf0b5c7f
Reviewed-on: https://gerrit.chromium.org/gerrit/24546
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>

12 years agoCHROMIUM: platform/x86/chromeos_laptop - mxt224s palm settings
Benson Leung [Mon, 4 Jun 2012 21:22:07 +0000 (14:22 -0700)]
CHROMIUM: platform/x86/chromeos_laptop - mxt224s palm settings

Make the following changes to the mxt224s touchpad settings:
T9.08 = 4 (to reduce the confetti effect during palm contact)
T9.10 = 5 (to enable MRGHYST to take effect)
T9.15 = 5
T9.16 = 15

Summary :
These changes target more stable palm identification on the mxt224SL
touchpad. Palms should be reported as a single large pressure contact,
and not as "confetti" or "fireworks." These settings attempt to balance
good palm identification with finger seperation for two finger gestures.
Increase Touch Detect Integration field to 4. Enable Merge Timeout with
a timeout of 800ms.
Set merge threshold to 5 and merge hysteresis to 15.

BUG=chrome-os-partner:9737
TEST=use DISPLAY=:0.0 mtplot
Bring down a palm on the top of the touchpad in a natural manner as if
you are resting in a ready position for the keyboard. Verify that
the driver reports a single large touchpoint for the palm, and that it
doesn't "confetti."
Verify that fat close fingers perform well in 2+ finger scroll gestures.

Change-Id: Ide52aa0c3ad361380fdb85bddea25ee55b29e9b1
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24547
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: Input: atmel_mxt_ts - Report TOUCH MAJOR in terms of pixels
Yufeng Shen [Fri, 25 May 2012 17:55:26 +0000 (13:55 -0400)]
CHROMIUM: Input: atmel_mxt_ts - Report TOUCH MAJOR in terms of pixels

The TCHAREA field reported from the device is in terms of channels
covered by the touch, while ABS_MT_TOUCH_MAJOR is expected to be in
the units the same as the configured device resolution. So we
approximate the touch contact as a circle, convert the touch area
from channel numbers to pixel numbers, and compute the diameter of
the circle touch as the value of ABS_MT_TOUCH_MAJOR.

Signed-off-by: Yufeng Shen <miletus@chromium.org>
BUG=chrome-os-partner:9968
TEST=using evtest to check the range of ABS_MT_TOUCH_MAJOR is now
     somewhat between 50 ~ 100, instead of 1 ~ 10 while making
     normal touching.

Change-Id: I9972a4989a18b9fbe4fdf1edd70330a4e9df3f85
Reviewed-on: https://gerrit.chromium.org/gerrit/24530
Commit-Ready: Yufeng Shen <miletus@chromium.org>
Reviewed-by: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
12 years agoCHROMIUM: usb: adding USB support for Novatel E362 module
Jason Glasgow [Tue, 24 May 2011 18:45:27 +0000 (14:45 -0400)]
CHROMIUM: usb: adding USB support for Novatel E362 module

/drivers/usb/serial/option.c: Adding support for Novatel's E362 module

BUG=chromium-os:31539
TEST=Use minicom to communicate with E362

Change-Id: I1f05a03ee5db1b3801f9941cc52999e617a03198
Signed-off-by: Jason Glasgow <jglasgow@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/1466
Reviewed-by: Elly Jones <ellyjones@chromium.org>
[3.4: olofj: Fixups due to context conflicts]
Signed-off-by: Olof Johansson <olof@lixom.net>
Reviewed-on: https://gerrit.chromium.org/gerrit/24513
Commit-Ready: Olof Johansson <olofj@chromium.org>
Tested-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: ARM: tegra: add tegra2_kaen device tree
Olof Johansson [Tue, 5 Jun 2012 03:53:53 +0000 (20:53 -0700)]
CHROMIUM: ARM: tegra: add tegra2_kaen device tree

Based on seaboard. Probably incorrect but it's mostly a placeholder right now to
keep the build system happy.

BUG=none
TEST=emerge-tegra2_kaen chromeos-kernel

Change-Id: Ia5c1f5fb6c4d895e07abeb7c97bea7f49a76a822
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24474

12 years agoCHROMIUM: config: base.config: enable pl2303 driver
Tai-Hsu Lin [Mon, 28 May 2012 09:23:27 +0000 (17:23 +0800)]
CHROMIUM: config: base.config: enable pl2303 driver

Enable pl2303 driver for all platforms so that we could emulate
USB-to-RS232 converters when needed. Note that only the factory
test images will be installed with this driver. Two CLs for that
is following.

BUG=chrome-os-partner:6616,chrome-os-partner:6617
TEST=emerge chromeos-kernel -> got pl2303.ko
tested the ko file on link with converter devices -> works

Change-Id: I9c8e6f2f6c65341e0890f3102385ec6552fc3fdd
Signed-off-by: Tai-Hsu Lin <sheckylin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/23848
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: Input: cyapa - Set default rt suspend scanrate to 30ms
Benson Leung [Fri, 18 May 2012 23:27:23 +0000 (16:27 -0700)]
CHROMIUM: Input: cyapa - Set default rt suspend scanrate to 30ms

Set runtime_suspend_power_mode to 30ms scanrate by default.
Leave the suspend_power_mode scanrate to 50ms by default.

BUG=chromium-os:21047,chromium-os:28646
TEST=cat /sys/bus/i2c/devices/11-0067/power/suspend_scanrate_ms
cat /sys/bus/i2c/devices/11-0067/power/runtime_suspend_scanrate_ms
Check that they are 50 and 30 respectively.

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

12 years agoCHROMIUM: Input: cyapa - Runtime pm with autosuspend
Benson Leung [Wed, 28 Mar 2012 15:25:05 +0000 (08:25 -0700)]
CHROMIUM: Input: cyapa - Runtime pm with autosuspend

Use runtime pm to manage cyapa power states. Autosuspend is used to
delay the runtime_suspend until some period of no activity from
the touchpad.

Default autosuspend period is 10000ms.
Default runtime_scanrate_ms in 50ms.
cyapa_irq will pm_runtime_get, mark last busy, perform data read
and processing, and then pm_runtime_put

Add a sysfs property for showing and updating the idle scanrate
used by the touchpad during runtime suspend (not system suspend).

An integer will set a variable idle scan interval.
Touchpad supports between 20ms to 1000ms scan intervals.
The time will be increased in increments of 10ms from 20ms to 100ms.
From 100ms to 1000ms, time will be increased in increments of 20ms.

BUG=chromium-os:21047,chromium-os:28646
TEST=$ cd <path to i2c device> (e.g. /sys/bus/i2c/devices/11-0067)
$ cat power/control
check that this returns "auto"
$ echo 1000 > power/autosuspend_delay_ms
This will tell the driver to runtime_suspend after 1s of inactivity.
To check, $ watch -n 0.1 cat power/runtime_status.
Touch the touchpad. Notice it changes to 'active'
Do not touch the touchpad for 1s. Notice it changes to 'suspended'
From 'suspended' state, make sure the touchpad feels responsive when
touching it to transition back to 'active'
Test sysfs:
$ cat power/runtime_suspend_scanrate_ms
check that by default, it is 50

Now, test the responsiveness changes based on the setting. Best way
is to test this remotely over ssh to see mouse cursor and shell:
$ echo 20 > power/runtime_suspend_scanrate_ms
$ watch -n 0.1 power/runtime_status
Wait until the status is "Suspended"
Ensure touchpad responds and moves cursor quickly on light touch
Retry this, but with a higher number in scanrate:
$ echo 1000 > power/runtime_suspend_scanrate_ms
Notice it takes longer time on average to respond when in this state.

Change-Id: If1198b9f870b906f1cce58c6b6d48e2f68d8f2ce
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/18684
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
12 years agoCHROMIUM: Input: cyapa - Clean up suspend_scanrate_ms sysfs
Benson Leung [Wed, 23 May 2012 03:41:08 +0000 (20:41 -0700)]
CHROMIUM: Input: cyapa - Clean up suspend_scanrate_ms sysfs

Clean up cyapa_show_suspend_scanrate, using scnprintf.
Change ifdef to CONFIG_PM_SLEEP instead of CONFIG_PM for
suspend_scanrate_ms sysfs and for suspend and resume
functions.

BUG=chromium-os:21047
TEST=With CONFIG_PM_SLEEP=y, make sure that
cat power/suspend_scanrate_ms
returns 50 by default.
With CONFIG_PM_SLEEP disabled, make sure that
power/suspend_scanrate_ms does not exist.

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

12 years agoCHROMIUM: Input: cyapa - Use sysfs_streq
Benson Leung [Fri, 18 May 2012 22:10:59 +0000 (15:10 -0700)]
CHROMIUM: Input: cyapa - Use sysfs_streq

Use sysfs_streq in cyapa_update_suspend_scanrate to check
for a match for "buttononly" mode. Sysfs_streq will
ignore trailing newline in the comparison.

BUG=chromium-os:29697,chromium-os:21047
TEST=echo buttononly > power/suspend_scanrate_ms
cat power/suspend_scanrate_ms
Check that buttononly is returned.
echo -n buttononly > power/suspend_scanrate_ms
cat power/suspend_scanrate_ms
Check that buttononly is returned.

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

12 years agoCHROMIUM: drm/i915/intel_i2c: Allow 400khz for atmel mxt bl on VGADDC
Benson Leung [Fri, 25 May 2012 23:41:54 +0000 (16:41 -0700)]
CHROMIUM: drm/i915/intel_i2c: Allow 400khz for atmel mxt bl on VGADDC

The atmel_mxt_ts bootloader mode can support 400khz operation
successfully. Enable it for bootloader at address 0x25 on the
VGADDC adapter.

BUG=chrome-os-partner:9994
TEST=place valid atmel mxt firmware at /lib/firmware/maxtouch.fw
time echo 1 > update_fw
Check that firmware update succeeds, and that the time is less than 9s.
time echo 1 > update_fw

real 0m8.450s
user 0m0.001s
sys 0m0.100s

Change-Id: I52373189e051c265ce32a99cee8b139f51721b28
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/23760
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
12 years agoCHROMIUM: Input: atmel_mxt_ts - recreate input_dev after fw update
Yufeng Shen [Tue, 22 May 2012 18:51:38 +0000 (14:51 -0400)]
CHROMIUM: Input: atmel_mxt_ts - recreate input_dev after fw update

Recreate and re-register the input device after the firmware
update. Now after both the firmware update and first time
device init, the same path of mxt_initialize() and
mxt_input_device_create() is called.

Signed-off-by: Yufeng Shen <miletus@chromium.org>
BUG=chrome-os-partner:9103

TEST=update the firmware and then check that the input device
     is still working, by using evtest/xinput.

Change-Id: I2ec8b4c96954151495238c450301eddd48085e18
Reviewed-on: https://gerrit.chromium.org/gerrit/23256
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
Commit-Ready: Yufeng Shen <miletus@chromium.org>

12 years agoCHROMIUM: config: enable gobi
Olof Johansson [Fri, 1 Jun 2012 00:06:25 +0000 (17:06 -0700)]
CHROMIUM: config: enable gobi

Now that gobi is merged, enable it as a module everywhere

BUG=chromium-os:31412
TEST=build

Change-Id: I18c238e4f07ddb01ab3261607ea7b93b8dd1152a
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24265
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
12 years agoCHROMIUM: config: renormalize splitconfigs
Olof Johansson [Fri, 1 Jun 2012 00:05:52 +0000 (17:05 -0700)]
CHROMIUM: config: renormalize splitconfigs

Just churn due to new options/drivers

BUG=none
TEST=none

Change-Id: I07503b0512c3fcec7854a48d80974445d6e5703a
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24264
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>