cascardo/linux.git
11 years agodrm/exynos: Split crtc from encoder
Sean Paul [Thu, 21 Feb 2013 18:36:33 +0000 (13:36 -0500)]
drm/exynos: Split crtc from encoder

This patch removes all calls from exynos_crtc directly into
exynos_encoder and instead relies on drm to do the right thing (which it
does).

BUG=None
TEST=Tested on snow, hotplug/suspend/resume/idle on & off

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

11 years agodrm/exynos: Don't reset mixer on win_disable
Sean Paul [Tue, 19 Feb 2013 17:49:43 +0000 (12:49 -0500)]
drm/exynos: Don't reset mixer on win_disable

This patch removes code which resets the mixer on win_disable of the
default overlay. The effect of this code is that it disables interrupts,
and resets all mixer registers to power-on-reset values, then
re-enables interrupts. The code was introduced in the S2R patch, it
probably hacked around a bug, but it's not needed any longer.

BUG=None
TEST=on snow; powerd_suspend/idle off/idle suspend/hotplug/multiple boots

Change-Id: Id65650c7ab7a4cbc508a2087d4354b780acdce1a
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43517
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoCHROMIUM: sock_diag: Fix out-of-bounds access to sock_diag_handlers[]
Mathias Krause [Sat, 23 Feb 2013 18:29:07 +0000 (10:29 -0800)]
CHROMIUM: sock_diag: Fix out-of-bounds access to sock_diag_handlers[]

Userland can send a netlink message requesting SOCK_DIAG_BY_FAMILY
with a family greater or equal then AF_MAX -- the array size of
sock_diag_handlers[]. The current code does not test for this
condition therefore is vulnerable to an out-of-bound access opening
doors for a privilege escalation.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
BUG=chromium-os:39185
TEST=link build, exploit PoC fails

Change-Id: I6f924e8849f60e1a98cdc16cbcb8d4ef5ce611e1
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43867
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoCHROMIUM: i2c: wire the smart battery passthrough
Vincent Palatin [Wed, 20 Feb 2013 16:33:27 +0000 (08:33 -0800)]
CHROMIUM: i2c: wire the smart battery passthrough

On Spring, the smart battery is behind the EC.
We are connecting the regular SBS I2C driver and translating i2c
messages for the smart battery to the matching EC commands.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17812
TEST=on Spring, read the battery status by using "power-supply-info"
command.

Change-Id: I4d1353d740201935e1bb9566a08f1a81b0262232
Reviewed-on: https://gerrit.chromium.org/gerrit/43610
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: mfd: chromeos_ec: instantiate sub-devices from device tree
Vincent Palatin [Fri, 22 Feb 2013 00:58:44 +0000 (16:58 -0800)]
CHROMIUM: mfd: chromeos_ec: instantiate sub-devices from device tree

If the EC device tree node has sub-nodes, try to instantiate them as MFD
sub-devices.
We can configure the EC features provided by the board.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17812
TEST=on Spring, check that flashrom is working to re-flash the EC
firmware.

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

11 years agoCHROMIUM: exynos: dts: EC related configuration is per board
Vincent Palatin [Wed, 30 Jan 2013 18:45:37 +0000 (10:45 -0800)]
CHROMIUM: exynos: dts: EC related configuration is per board

Move the Smart Battery configuration to board-specific files.
On Daisy and Snow, the Smart Battery is on the same as the EC,
on Spring, it is behind the EC.

Declare board dependant EC sub-devices as children of the EC node.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17812
TEST=on both Snow and Spring, check that "power-supply-info" returns
acceptable values.

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

11 years agoCHROMIUM: drm/exynos: dp: configure GPIO for eDP hotplug detection
Vincent Palatin [Tue, 19 Feb 2013 20:47:30 +0000 (12:47 -0800)]
CHROMIUM: drm/exynos: dp: configure GPIO for eDP hotplug detection

the HPD line from the Parade eDP/LVDS bridge is used to trigger the
display controller initialization. Let's configure it as a proper
interrupt line to allow the Exynos display port controller driver to use
it.
The current Exynos needs special hackery to plug an interrupt on a
random GPIO.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17228
TEST=on Spring, boot and see the counter of the HPD interrupt from
the eDP bridge incrementing.

Change-Id: I15c612fe57c0dab98e18c58e1ef092fd8e103a92
Reviewed-on: https://gerrit.chromium.org/gerrit/43535
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
11 years agoCHROMIUM: arm: s5p: fix section mismatch for gpioint
Vincent Palatin [Fri, 22 Feb 2013 17:01:33 +0000 (09:01 -0800)]
CHROMIUM: arm: s5p: fix section mismatch for gpioint

The gpioint irq creation might be called from hotpluggable devices,
so it needs to be marked as __devinit (and as nothing in the future).

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:12625
TEST=emerge-daisy_spring chromeos-kernel with
"CONFIG_DEBUG_SECTION_MISMATCH=y" and do not see any warning.

Change-Id: Ibc0880c90a4002063fd95e752e3fe417455afd22
Reviewed-on: https://gerrit.chromium.org/gerrit/43786
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>

11 years agoCHROMIUM: arm: s5p: add suspend/resume support to GPIO interrupts
Vincent Palatin [Thu, 21 Feb 2013 16:08:07 +0000 (08:08 -0800)]
CHROMIUM: arm: s5p: add suspend/resume support to GPIO interrupts

We need to restore the GPIO external interrupt configuration and mask
registers after resume as the hardware has lost those registers content.
We just use the cache maintained by the generic-irq layer.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:12625
TEST=manually check the EXTINT registers content before and after a
suspend/resume cycle, and no longer see an interrupt storm after
resuming.

Change-Id: I950362c8d2c7126f5a10502b414cee2d12d2cd4d
Reviewed-on: https://gerrit.chromium.org/gerrit/43726
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>

11 years agoCHROMIUM: bluetooth/usb: hack to cover up dma after free corruption
Sonny Rao [Thu, 21 Feb 2013 01:45:06 +0000 (17:45 -0800)]
CHROMIUM: bluetooth/usb: hack to cover up dma after free corruption

This is a horrible, gross hack to cover up the fact that we
sometimes get an apparent DMA from the interrupt endpoint on the
bluetooth module after shutting it down.  This ends up manifesting as
random kernel crashes, often from other users of kmalloc-16.

Since we don't have root cause (yet?) and can't do much about it, put
in this band-aid which will leak around 64 bytes of memory every time we
suspend/resume a usb bluetooth device.  We make no attempt to free
this memory because we don't know when the DMA could come in and it's
a relatively small amount so probably not worth trying to free it
later.

Another issue is that SLUB will mix together objects from different
slabs if they are all the same size.  So, in order to get a separate
slab in /proc/slabinfo, we turn on some of the slab debugging options.
The main reason for doing this is to let us track how much memory got
leaked through slabinfo.  This will trigger a BUG_ON() in
kmem_cache_create() if the kernel is compiled with
CONFIG_SLAB && !CONFIG_DEBUG_SLAB.

One day, when we have a real fix, we should remove this abomination.

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
BUG=chrome-os-partner:12507
BUG=chrome-os-partner:17614
TEST=repeated suspend resume, should not see a kernel crash

Change-Id: Iebdfe033d178c664a91fce1164b255aa1c322ad0
Reviewed-on: https://gerrit.chromium.org/gerrit/43682
Commit-Queue: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: gpio: samsung: add support for interrupts on Exynos5 GPIOs
Vincent Palatin [Sat, 16 Feb 2013 01:11:25 +0000 (17:11 -0800)]
CHROMIUM: gpio: samsung: add support for interrupts on Exynos5 GPIOs

Add support for interrupts on all bank A and B GPIOs on Exynos 5,
in addition of the current XEINT pins.

Re-use the current Exynos4 / s5p code to minizime this CL overhead as we
probably won't use more that a couple of those interrupts but it's not
optimal in term of performance and it requires to do an explicit
5p_register_gpio_interrupt in the platform code for each GPIO used as an
interrupt.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17228 chrome-os-partner:12625
TEST=on Spring, boot and see the counter of the HPD interrupt from the
eDP bridge incrementing.

Change-Id: I60bbe8e96d4028393f82e5717fdfa9ca19eb0773
Reviewed-on: https://gerrit.chromium.org/gerrit/43533
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>

11 years agodrm/exynos: Remove crtc->disable
Sean Paul [Thu, 21 Feb 2013 18:35:49 +0000 (13:35 -0500)]
drm/exynos: Remove crtc->disable

Remove the crtc->disable callback since it's not needed and most likely
incorrect anyways. DRM will fall back to dpms if disable is not defined,
and that will simplify the various paths we have. Furthermore, all
disable did was disable the default overlay on the crtc, which is not
the intended result.

BUG=None
TEST=Tested on snow with boot/hotplug/suspend/idle

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

11 years agodrm/exynos: Don't win_disable if mixer is off
Sean Paul [Thu, 21 Feb 2013 18:18:03 +0000 (13:18 -0500)]
drm/exynos: Don't win_disable if mixer is off

The win_disable function shouldn't be called when the mixer is off. This
also prevents us from waiting for a vsync that will never happen (occurs
twice on boot, adding 2 seconds to the boot time).

BUG=None
TEST=Tested on snow, verified no regressions

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

11 years agoCHROMIUM: exynos: dts: enable OHCI controller and EHCI port 0
Vic Yang [Thu, 21 Feb 2013 07:46:12 +0000 (15:46 +0800)]
CHROMIUM: exynos: dts: enable OHCI controller and EHCI port 0

Now that we have proper hardware to prevent electrical conflict, we can
re-enable OHCI controller and port 0 on EHCI.

Signed-off-by: Vic Yang <victoryang@chromium.org>
BUG=chrome-os-partner:14319
TEST=boot Spring and verify USB functionality.

Change-Id: Ia0a3e5bb32a5e679b4bfb8158505172b84b57a08
Reviewed-on: https://gerrit.chromium.org/gerrit/43710
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
11 years agoCHROMIUM: Input: synaptics - skip trackpoint reconnect
Chung-yih Wang [Tue, 19 Feb 2013 10:47:05 +0000 (18:47 +0800)]
CHROMIUM: Input: synaptics - skip trackpoint reconnect

Since trackpoint properties are probed in the boot time, it should
be safe to skip the reconnect function as we don't need to
probe the properties again to reduce the latency of unresponsiveness.

BUG=chrome-os-partner:15015
TEST=on device; use powerd_suspend and then hit a key to wake it up
   see if the trackpoint/trackpoint could be active in 3~4 seconds
   after resume instead of 7 seconds long

Change-Id: I7286fe97dfd4a68dbbca0aa411eb15b0d2bcd67d
Signed-off-by: Chung-yih Wang <cywang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43510
Tested-by: Agnes Cheng <agnescheng@google.com>
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Gediminas Ramanauskas <gedis@chromium.org>
11 years agoCHROMIUM: USB: option: don't show error when urb is killed in an expected way
Ben Chan [Thu, 21 Feb 2013 01:33:43 +0000 (17:33 -0800)]
CHROMIUM: USB: option: don't show error when urb is killed in an expected way

When a device supported by the option driver is suspended, the interrupt
urb is killed and option_instat_callback() is invoked with the urb's
status set to -ENOENT. The patch prevents the option driver from
spamming the log with a message 'option_instat_callback: error -2' under
such scenario.

BUG=chrome-os-partner:17918
TEST=Tested the following on link:
1. Put the system on battery so that USB auto-suspend is turned on for
   the Novatel E362 modem.
2. Verify that the option kernel drive no longer prints the following
   error to /var/log/messages:

       option: option_instat_callback: error -2

Change-Id: Ia2d52c3331499b0713455b65c13e2b34dbc48d16
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43680
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
11 years agoarm: exynos: Fix PMU register configuration for local power blocks
Abhilash Kesavan [Thu, 21 Feb 2013 03:48:21 +0000 (09:18 +0530)]
arm: exynos: Fix PMU register configuration for local power blocks

For the six local power blocks - MFC, DISP1, GSC, MAU, G3D and ISP
the respective CMU_RESET, CMU_SYSCLK and CMU_CLKSTOP registers need
to be low initially for normal mode. This change has been updated
only in the latest Exynos5250 1.10 user manual. Also fix the AFTR
and LPA configurations even though they are not being used.

There are no known issues fixed by doing this, though had we done this
originally for CMU_RESET_ISP_SYS_PWR_REG I believe we wouldn't have
ever hit the problems that ISP ARM was causing us with suspend/resume
(we wouldn't have had the perfect poweroff sequence for ISP ARM but
wouldn't have hit issues).

BUG=chrome-os-partner:17459
TEST=Boot to login screen on an MP and run suspend_stress_test

Change-Id: I15453224a7f9aed5de477827713e58e8edbe499d
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42097

11 years agoCHROMIUM: mfd: chromeos_ec: update EC<->AP protocol
Vincent Palatin [Tue, 19 Feb 2013 23:09:13 +0000 (15:09 -0800)]
CHROMIUM: mfd: chromeos_ec: update EC<->AP protocol

Update the EC commands header with an up-to-date version including
the new pass-through commands.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17812 chrome-os-partner:17813
TEST=emerge-daisy_spring chromeos-kernel

Change-Id: Ic7f1d06bd2219f1314646ae6d803365b6e008ae6
Reviewed-on: https://gerrit.chromium.org/gerrit/43608
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: Platform: x86: chromeos_laptop - Change identifiers for Pixel
Benson Leung [Thu, 21 Feb 2013 18:14:07 +0000 (10:14 -0800)]
CHROMIUM: Platform: x86: chromeos_laptop - Change identifiers for Pixel

Change the names of the setup functions for Pixel's atmel
touchscreen and touchpad.

Also, enable the name search for "touchscreen" for the atmel 1664s
irq number in dmi data.

Finally, change some of the Chromebook Pixel related identifiers
in chromeos_laptop_dmi_table.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chrome-os-partner:17951
TEST=Builds clean. Touchscreen, touchpad, and keyboard backlight all work.

Change-Id: I6945c5d64aea6943ea8468f761a8213eb4d4b498
Reviewed-on: https://gerrit.chromium.org/gerrit/43727
Reviewed-by: Puneet Kumar <puneetster@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>

11 years agoHID: multitouch: Add quirks for Stantum MTP Controller
Yufeng Shen [Mon, 21 Jan 2013 19:45:10 +0000 (14:45 -0500)]
HID: multitouch: Add quirks for Stantum MTP Controller

[NOT FOR UPSTREAM, TEST ONLY]

In each frame, Stantum controller sends back first HID_DG_CONTACTCOUNT
to indicate how many active contacts are in the frame. Then the
controller sends back the state of a fixed number touches, with the
first HID_DG_CONTACTCOUNT touches being valid touches. The generic
hid-multitouch implementation will exam all the sent back touches and
get confused by relying on some other unreliable information like
HID_DG_INRANGE and HID_DG_TIPSWITCH to determine active touches.

This CL adds the quirk for Stantum to only consider the first
HID_DG_CONTACTCOUNT number of touches as active touches.

Signed-off-by: Yufeng Shen <miletus@chromium.org>
BUG=chrome-os-partner:17333
TEST=boot chromebook, plug in the touch device, using mtplot to
     make sure it works as expected.

Change-Id: I2a050567c758e3df65aff9cfce1c579f4c98eebb
Reviewed-on: https://gerrit.chromium.org/gerrit/41724
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
11 years agoCHROMIUM: exynos: dts: Move TPS65090 to per board configs.
Todd Broch [Thu, 21 Feb 2013 15:44:40 +0000 (07:44 -0800)]
CHROMIUM: exynos: dts: Move TPS65090 to per board configs.

Move the TPS65090 specification from the common cros5250 to each
board.  This will allow for spring to place TPS65090 behind the EC.

BUG=chrome-os-partner:17813
TEST=manual,

1. Boot kernel, login as root
2a. On Snow see regulators still enumerated in sysfs,
   cat /sys/devices/s3c2440-i2c.4/i2c-4/4-0048/tps65090-regulator/regulator/regulator.*/name
2b. On Spring device still functions but devices are NOT in sysfs

Signed-off-by: Todd Broch <tbroch@chromium.org>
Change-Id: I9837062a851b677c3c8844e6b6503450aa4ed555
Reviewed-on: https://gerrit.chromium.org/gerrit/43718
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agodrm/exynos: Untangle dpms a little
Sean Paul [Wed, 13 Feb 2013 19:52:26 +0000 (14:52 -0500)]
drm/exynos: Untangle dpms a little

This patch strives to simplify the various dpms paths. The overarching
goal is to not get into a situation where connector->dpms is out of
touch with the rest of the driver since that effectively disables
userspace control of the power. The patch also eliminates the duplicate
paths through crtc and encoder.

BUG=chromium-os:37797
TEST=Tested hotplug; idle suspend/resume; idle off/on; lid
     suspend/resume; powerd_suspend/resume. No regressions noted

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

11 years agodrm/exynos: Remove apply() callback
Sean Paul [Tue, 19 Feb 2013 17:25:20 +0000 (12:25 -0500)]
drm/exynos: Remove apply() callback

Remove the apply() callback from the panel and controller ops, it really
doesn't make sense.

BUG=None
TEST=Booted snow, suspend/resume/hotplug no regressions

Change-Id: I1df3a368409aa2bbd0d69866f365d6baa0786025
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43516
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoCHROMIUM: drm/exynos: Drop non-essential frames on dpms off
Sean Paul [Wed, 23 Jan 2013 20:16:38 +0000 (15:16 -0500)]
CHROMIUM: drm/exynos: Drop non-essential frames on dpms off

This patch drops all frames except for the last pending one when a crtc
is disabled. It will also wait on the last frame to render before
returning from DPMS off.

BUG=chromium-os:37797
TEST=Tested manually:
- Plug/unplug HDMI with no content on the HDMI monitor
- Plug/unplug HDMI with animation (sad puppy) on HDMI monitor
- Plug/unplug HDMI with animation + cursor movement on monitor
- Suspend/resume with animation on monitor
- Idle suspend/resume

Change-Id: I3e26e8bac9be0d71cf3c0756d1cc3dd92d2612de
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41772
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agodrm/exynos: Disable fimd interrupts on power off
Sean Paul [Wed, 20 Feb 2013 22:20:35 +0000 (17:20 -0500)]
drm/exynos: Disable fimd interrupts on power off

Disable fimd interrupts on power off.

BUG=None
TEST=Tested on snow with powerd_suspend and idle off

Change-Id: I37734b62b03b79b922b93c821e606a9ba77d26a1
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43640
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agodrm/exynos: Remove irq_flags kruft
Sean Paul [Wed, 20 Feb 2013 21:59:14 +0000 (16:59 -0500)]
drm/exynos: Remove irq_flags kruft

Remove the irq_flags kruft from the enable/disable vblank functions. It
only serves to make things less deterministic and more confusing.

BUG=None
TEST=Tested suspend/resume on snow, no regressions

Change-Id: I3255b55ee5480cf6313de766d35ae84401343312
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43639
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoCHROMIUM: s5p-mfc: fix DISPLAY_DELAY
John Sheu [Wed, 13 Feb 2013 22:03:59 +0000 (14:03 -0800)]
CHROMIUM: s5p-mfc: fix DISPLAY_DELAY

V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE is being
ignored, and the display delay is always being applied.  Fix this.

Signed-off-by: John Sheu <sheu@google.com>
BUG=chromium:175638
BUG=chromium-os:38121
BUG=chromium-os:38376
BUG=chromium-os:38693
TEST=local build, run on snow
Change-Id: I0bfd3cfbb3ec312c073eed5e39bfd2e1637bee3c
Reviewed-on: https://gerrit.chromium.org/gerrit/43677
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
11 years agoCHROMIUM: s5p-mfc: Fix input/output format reporting
John Sheu [Wed, 13 Feb 2013 21:53:56 +0000 (13:53 -0800)]
CHROMIUM: s5p-mfc: Fix input/output format reporting

The video encode/decode paths have duplicated logic between
VIDIOC_TRY_FMT and VIDIOC_S_FMT that should be de-duped.  Also, video
decode reports V4L2_PIX_FMT_NV12MT_16X16 output format, regardless of
what the actual output has been set at.  Fix this.

Signed-off-by: John Sheu <sheu@google.com>
BUG=chromium-os:38376
TEST=local build, run on snow
Change-Id: I82272ebe5d46cd78339616795fd96f688fecdabe
Reviewed-on: https://gerrit.chromium.org/gerrit/43676
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
11 years agoUPSTREAM: exynos: add basic diagnostic output for IOMMU faults
Grant Grundler [Wed, 13 Feb 2013 21:52:31 +0000 (13:52 -0800)]
UPSTREAM: exynos: add basic diagnostic output for IOMMU faults

Give some visibility into which devices are hitting problems and
which type of faults they are generating.

Code is roughly what pullip.cho@samsung.com suggested in
   http://crosbug.com/37066

Equivalent code is present upstream in exynos-iommu.c:default_fault_handler()
Author: KyongHo Cho <pullip.cho@samsung.com>
Date:   Sat May 12 05:56:09 2012 +0900
iommu/exynos: Add iommu driver for EXYNOS Platforms

BUG=chromium-os:37066
TEST=manually injected fault to trigger output.

Change-Id: I06e1d1214578033b72b5aa51c228f13cb4443bcb
Signed-off-by: Grant Grundler <grundler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43235
Reviewed-by: Doug Anderson <dianders@chromium.org>
11 years agoCHROMIUM: coredump: prevent crash pipe reader from blocking suspend
Mandeep Singh Baines [Wed, 13 Feb 2013 03:44:46 +0000 (19:44 -0800)]
CHROMIUM: coredump: prevent crash pipe reader from blocking suspend

Also, prevent hung_task detector from panic()ing the system.

$ # TEST CODE
$ cat pthread_test.c
\#include <pthread.h>
\#include <assert.h>
\#include <unistd.h>

void *task_code(void *argument)
{
   pause();

   return NULL;
}

int main(int argc, char *argv[])
{
   pthread_t thread;
   int rc;

   rc = pthread_create(&thread, NULL, task_code, NULL);
   assert(0 == rc);

   rc = pthread_join(thread, NULL);
   assert(0 == rc);

   return 0;
}
$

$ # TEST PROCESS
$ stop daisydog
$ echo "|/usr/bin/sleep 1d" > /proc/sys/kernel/core_pattern
$ ./pthread_test &
[1] 2872
$ kill -ABRT $!
$ echo mem > /sys/power/state

Sent-upstream: http://thread.gmane.org/gmane.linux.kernel/1441805

BUG=chrome-os-partner:16961
TEST=See above.

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

11 years agoCHROMIUM: mfd: s5m-core: Enable low-jitter via DT.
Todd Broch [Wed, 20 Feb 2013 16:34:45 +0000 (08:34 -0800)]
CHROMIUM: mfd: s5m-core: Enable low-jitter via DT.

Provide facility via device tree to activate the low-jitter
capababilities of the 32Khz clocks (BT, CP, AP).  Note the feature is
enabled for all the clocks or none per the design

Additionally fixed two small nits:
1. added __devinit to declaration of probe function
2. fixed function name of s5m87xx_i2c_parse_dt_pdata for the case when
   CONFIG_OF is undefined

BUG=chrome-os-partner:17833 chrome-os-partner:17858
TEST=manual
1. boot kernel, login as root
2. examine CTRL1 (0xa) register and see Low Jitter_EN bit (<3>) is
enabled for the spring design.
  i2cget -y -f 0 0x66 0xa
  0xf

Signed-off-by: Todd Broch <tbroch@chromium.org>
Change-Id: I80750a3049806692c1c1e214982577f2f39899e1
Reviewed-on: https://gerrit.chromium.org/gerrit/43624
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: coredump: sanitize the setting of signal->group_exit_code
Oleg Nesterov [Sun, 17 Feb 2013 19:19:05 +0000 (20:19 +0100)]
CHROMIUM: coredump: sanitize the setting of signal->group_exit_code

Now that the coredumping process can be SIGKILL'ed, the setting of
->group_exit_code in do_coredump() can race with complete_signal()
and SIGKILL or 0x80 can be "lost", or wait(status) can report
status == SIGKILL | 0x80.

But the main problem is that it is not clear to me what should we
do if binfmt->core_dump() succeeds but SIGKILL was sent, that is
why this patch comes as a separate change.

This patch adds 0x80 if ->core_dump() succeeds and the process was
not killed. But perhaps we can (should?) re-set ->group_exit_code
changed by SIGKILL back to "siginfo->si_signo |= 0x80" in case when
core_dumped == T.

Under review upstream:

http://thread.gmane.org/gmane.linux.kernel/1442910

BUG=chrome-os-partner:16961
TEST=See "coredump: prevent crash pipe reader from blocking suspend."

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Change-Id: I96e81bfea6cb5e21e59f2500f502fe1e9c673b43
Reviewed-on: https://gerrit.chromium.org/gerrit/43580
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
11 years agoCHROMIUM: coredump: ensure that SIGKILL always kills the dumping thread
Oleg Nesterov [Sun, 17 Feb 2013 19:19:02 +0000 (20:19 +0100)]
CHROMIUM: coredump: ensure that SIGKILL always kills the dumping thread

prepare_signal() blesses SIGKILL sent to the dumping process but
this signal can be "lost" anyway. The problems is, complete_signal()
sees SIGNAL_GROUP_EXIT and skips the "kill them all" logic. And even
if the dumping process is single-threaded (so the target is always
"correct"), the group-wide SIGKILL is not recorded in task->pending
and thus __fatal_signal_pending() won't be true. A multi-threaded
case has even more problems.

And even ignoring all technical details, SIGNAL_GROUP_EXIT doesn't
look right to me. This coredumping process is not exiting yet, it can
do a lot of work dumping the core.

With this patch the dumping process doesn't have SIGNAL_GROUP_EXIT,
we set signal->group_exit_task instead. This makes signal_group_exit()
true and thus this should equally close the races with exit/exec/stop
but allows to kill the dumping thread reliably.

Notes:
- It is not clear what should we do with ->group_exit_code
  if the dumper was killed, see the next change.

- we need more (hopefully straightforward) changes to ensure
  that SIGKILL actually interrupts the coredump. Basically we
  need to check __fatal_signal_pending() in dump_write() and
  dump_seek().

Under review upstream:

http://thread.gmane.org/gmane.linux.kernel/1442910

BUG=chrome-os-partner:16961
TEST=See "coredump: prevent crash pipe reader from blocking suspend."

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Change-Id: I92d0458f179bacb816a548c274e2dc83bb6c374d
Reviewed-on: https://gerrit.chromium.org/gerrit/43579
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
11 years agoCHROMIUM: coredump: only SIGKILL should interrupt the coredumping task
Oleg Nesterov [Sun, 17 Feb 2013 19:18:49 +0000 (20:18 +0100)]
CHROMIUM: coredump: only SIGKILL should interrupt the coredumping task

There are 2 well known and ancient problems with coredump/signals,
and a lot of related bug reports:

- do_coredump() clears TIF_SIGPENDING but of course this can't help
  if, say, SIGCHLD comes after that.

  In this case the coredump can fail unexpectedly. See for example
  wait_for_dump_helper()->signal_pending() check but there are other
  reasons.

- At the same time, dumping a huge core on the slow media can take a
  lot of time/resources and there is no way to kill the coredumping
  task reliably. In particular this is not oom_kill-friendly.

This patch tries to fix the 1st problem, and makes the preparation
for the next changes.

We add the new SIGNAL_GROUP_COREDUMP flag set by zap_threads() to
indicate that this process dumps the core. prepare_signal() checks
this flag and nacks any signal except SIGKILL.

Note that this check tries to be conservative, in the long term we
should probably treat the SIGNAL_GROUP_EXIT case equally but this
needs more discussion. See marc.info/?l=linux-kernel&m=120508897917439

Notes:
- recalc_sigpending() doesn't check SIGNAL_GROUP_COREDUMP.
  The patch assumes that dump_write/etc paths should never
  call it, but we can change it as well.

- There is another source of TIF_SIGPENDING, freezer. This
  will be addressed separately.

Under review upstream:

http://thread.gmane.org/gmane.linux.kernel/1442910

BUG=chrome-os-partner:16961
TEST=See "coredump: prevent crash pipe reader from blocking suspend."

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Change-Id: I2a660ef2e61d5132dad2aedbcd543d08f1003beb
Reviewed-on: https://gerrit.chromium.org/gerrit/43578
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
11 years agoCHROMIUM: lockdep: check that no locks held at freeze time
Mandeep Singh Baines [Thu, 14 Feb 2013 22:49:54 +0000 (14:49 -0800)]
CHROMIUM: lockdep: check that no locks held at freeze time

We shouldn't try_to_freeze if locks are held. Verified that
I get no lockdep warnings after applying this patch and
"vfork: don't freezer_count() for in-kernel users of CLONE_VFORK".

Sent-upstream: http://thread.gmane.org/gmane.linux.kernel/1441805

BUG=chrome-os-partner:16961
TEST=Verified that there are no lockdep warnings across suspend/resume.

Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Change-Id: Iba1f22a51aaff4f2cf2c2f95ffa88ad3c7df97ff
Reviewed-on: https://gerrit.chromium.org/gerrit/43347
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
11 years agoCHROMIUM: watchdog: add WDIOC_GETBOOTSTATUS support to s3c2410_wdt
Grant Grundler [Wed, 6 Feb 2013 01:51:04 +0000 (17:51 -0800)]
CHROMIUM: watchdog: add WDIOC_GETBOOTSTATUS support to s3c2410_wdt

Exynos5 can report the most recent "reset" (or boot) cause.  In particular,
WDIOC_GETBOOTSTATUS ioctl (to /dev/watchdog) can let users know if
the HW watchdog timed out and reset the machine.

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

Change-Id: Iceb63d8404e25200846f75e6ce44da62749246dd
Signed-off-by: Grant Grundler <grundler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42759
Reviewed-by: Doug Anderson <dianders@chromium.org>
11 years agoCHROMIUM: exynos: log when watchdog timeout triggers a reset
Grant Grundler [Wed, 6 Feb 2013 02:10:57 +0000 (18:10 -0800)]
CHROMIUM: exynos: log when watchdog timeout triggers a reset

If the HW watchdog timer (WDT) resets the machine, there is no panic.
This patch prints a warning HW WDT timed out (dmesg buffer) and
enables daisydog (or watchdog) daemon to query /dev/watchdog via
WDIOC_GETBOOTSTATUS ioctl.

BUG=chrome-os-partner:9403
TEST=./run_remote_tests.sh --board=daisy --remote=192.168.1.100 platform_HWwatchdog
    and check dmesg output for "Watchdog timed out" message.

Change-Id: Ic559244af48773ae7fc35d462620c1ef98f98a4d
Signed-off-by: Grant Grundler <grundler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42760
Reviewed-by: Doug Anderson <dianders@chromium.org>
11 years agoCHROMIUM: power: Allow bus used for power supply to be found
Simon Glass [Sat, 2 Feb 2013 05:52:24 +0000 (21:52 -0800)]
CHROMIUM: power: Allow bus used for power supply to be found

Some power supplies such as batteries are connected via a bus such as i2c.
When we want to resume the battery we must resume the bus also, otherwise
it will not be possible to communicate with it.

Add a function which returns the device that a power supply is connected
on, to permit a caller to resume the bus also.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
Use charger-manager, with other changes, and see that in the
suspend_again() handler, the battery temperature can be read successfully.
This indicates that the i2c bus is working properly.
Change-Id: I1f19606861e0cb7f86621c2ad22415d7761cb060
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43012
Reviewed-by: Benson Leung <bleung@chromium.org>
11 years agoCHROMIUM: exynos: dts: allow to switch off eDP bridge regulator
Vincent Palatin [Tue, 19 Feb 2013 21:26:58 +0000 (13:26 -0800)]
CHROMIUM: exynos: dts: allow to switch off eDP bridge regulator

We want to control the 1.2v regulator going to the eDP bridge from the
Parade driver.
In order to do this, we don't want to force it on all the time.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17866
TEST=on Spring, suspend with regulator traces and see the vdd_bridge
regulator going off.

Change-Id: I280844b3225cfa0f817a04190ca24779d26fa999
Reviewed-on: https://gerrit.chromium.org/gerrit/43532
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: mwifiex: improvement in cfg80211 set_bitrate_mask handler
Bing Zhao [Tue, 19 Feb 2013 20:06:20 +0000 (12:06 -0800)]
UPSTREAM: mwifiex: improvement in cfg80211 set_bitrate_mask handler

This patch configures data rates to firmware using bitrate mask
provided by cfg80211.

Earlier we used to only update band information in this handler
which will be used later for ibss network. Due to recent
modifications in ibss join code we don't need to do that.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
BUG=chrome-os-partner:17764
TEST=associate to 5G 11n AP nearby, iw link shows tx bitrate MCS-15.
disconnect and re-connect, association succeeds and iw link still
shows MCS-15.

Change-Id: Iba896d38674517549a162bd7f2627dd00c6f6dd0
Reviewed-on: https://gerrit.chromium.org/gerrit/43523
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Bing Zhao <bzhao@marvell.com>

11 years agoCHROMIUM: regulator: s5m8767: properly disable regulators
Vincent Palatin [Tue, 19 Feb 2013 21:31:23 +0000 (13:31 -0800)]
CHROMIUM: regulator: s5m8767: properly disable regulators

Whatever the default operating mode of a regulator is, we want to ensure
that we are actually putting 0 in the mode to disable it.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17866
TEST=manual

Change-Id: Ic019c92a72b3a97b6ea06657b4f57774337519de
Reviewed-on: https://gerrit.chromium.org/gerrit/43531
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMEOS: config: Enable addrtype iptables match
Paul Stewart [Fri, 15 Feb 2013 22:03:48 +0000 (14:03 -0800)]
CHROMEOS: config: Enable addrtype iptables match

This enables the "addrtype" matches to iptables.  This will allow
iptables rules to match the type of source and destination addresses
that should be matched.  This allows us to classify incoming packets
as "unicast" (intended directly for us) which will allow us to
restrict the types of packets sent to userspace for multicast-reply
classification.  See CL
https://gerrit.chromium.org/gerrit/#/c/43447/3/iptables.conf for an
example of how this will be used.

Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:38605
TEST=Compile kernel, ensure iptables works correctly with "-m addrtype" rule

Change-Id: I5cb191453b9458f9014a6494574ccdc151d99d75
Reviewed-on: https://gerrit.chromium.org/gerrit/43426
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>

11 years agoCHROMIUM: BACKPORT: mm: better fix for OOM killer hang
Luigi Semenzato [Tue, 4 Dec 2012 18:41:21 +0000 (10:41 -0800)]
CHROMIUM: BACKPORT: mm: better fix for OOM killer hang

This change replaces a previous fix for crosbug.com/32321
(https://gerrit.chromium.org/gerrit/#/c/36953) with a better
fix which David Rentjes applies upstream (this is the equivalent
change).  I have studied and tested David's change and it also
avoids the deadlock.  In addition, our change has the potential
for unnecessarily killing processes that don't need to be killed.
Furthermore, it's probably better to track upstream more closely.

 commit 9ff4868e3051d9128a24dd330bed32011a11421d
 Author:     David Rientjes <rientjes@google.com>
 AuthorDate: Tue Dec 11 16:01:30 2012 -0800
 Commit:     Linus Torvalds <torvalds@linux-foundation.org>
 CommitDate: Tue Dec 11 17:22:24 2012 -0800

    mm, oom: allow exiting threads to have access to memory reserves

    Exiting threads, those with PF_EXITING set, can pagefault and require
    memory before they can make forward progress.  This happens, for instance,
    when a process must fault task->robust_list, a userspace structure, before
    detaching its memory.

    These threads also aren't guaranteed to get access to memory reserves
    unless oom killed or killed from userspace.  The oom killer won't grant
    memory reserves if other threads are also exiting other than current and
    stalling at the same point.  This prevents needlessly killing processes
    when others are already exiting.

    Instead of special casing all the possible situations between PF_EXITING
    getting set and a thread detaching its mm where it may allocate memory,
    which probably wouldn't get updated when a change is made to the exit
    path, the solution is to give all exiting threads access to memory
    reserves if they call the oom killer.  This allows them to quickly
    allocate, detach its mm, and free the memory it represents.

    Summary of Luigi's bug report:

    : He had an oom condition where threads were faulting on task->robust_list
    : and repeatedly called the oom killer but it would defer killing a thread
    : because it saw other PF_EXITING threads.  This can happen anytime we need
    : to allocate memory after setting PF_EXITING and before detaching our mm;
    : if there are other threads in the same state then the oom killer won't do
    : anything unless one of them happens to be killed from userspace.
    :
    : So instead of only deferring for PF_EXITING and !task->robust_list, it's
    : better to just give them access to memory reserves to prevent a potential
    : livelock so that any other faults that may be introduced in the future in
    : the exit path don't cause the same problem (and hopefully we don't allow
    : too many of those!).

Signed-off-by: David Rientjes <rientjes@google.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Tested-by: Luigi Semenzato <semenzato@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
BUG=chromium-os:38812
TEST=manually tested in a deadlock situation

Change-Id: If0c52a7009dbc7002d4b26ffe91a1a97989f2215
Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39199

11 years agoCHROMIUM: ASoC: samsung: Enable daisy platform to support MAX98088.
Dylan Reid [Fri, 15 Feb 2013 00:00:50 +0000 (16:00 -0800)]
CHROMIUM: ASoC: samsung: Enable daisy platform to support MAX98088.

The Spring board will use the MAX98088 instead of the MAX98095.  Add
the ability to use this codec to the daisy platform driver.

BUG=chrome-os-partner:17794
TEST=play audio on snow and spring.

Change-Id: I7beb941d931d198a37d50e970821b8a32786a2e3
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43358
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: wake_up_process() should be never used to wakeup a TASK_STOPPED/TRACED...
Oleg Nesterov [Mon, 21 Jan 2013 19:48:17 +0000 (20:48 +0100)]
UPSTREAM: wake_up_process() should be never used to wakeup a TASK_STOPPED/TRACED task

wake_up_process() should never wakeup a TASK_STOPPED/TRACED task.
Change it to use TASK_NORMAL and add the WARN_ON().

TASK_ALL has no other users, probably can be killed.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
BUG=chromium-os:38610
TEST=link build

Change-Id: I6573a5341e55309f10d3597d2fcf40a0b8e9d73a
(cherry picked from upstream commit 9067ac85d533651b98c2ff903182a20cbb361fcb)
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43145
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
11 years agoUPSTREAM: ptrace: ensure arch_ptrace/ptrace_request can never race with SIGKILL
Oleg Nesterov [Mon, 21 Jan 2013 19:48:00 +0000 (20:48 +0100)]
UPSTREAM: ptrace: ensure arch_ptrace/ptrace_request can never race with SIGKILL

putreg() assumes that the tracee is not running and pt_regs_access() can
safely play with its stack.  However a killed tracee can return from
ptrace_stop() to the low-level asm code and do RESTORE_REST, this means
that debugger can actually read/modify the kernel stack until the tracee
does SAVE_REST again.

set_task_blockstep() can race with SIGKILL too and in some sense this
race is even worse, the very fact the tracee can be woken up breaks the
logic.

As Linus suggested we can clear TASK_WAKEKILL around the arch_ptrace()
call, this ensures that nobody can ever wakeup the tracee while the
debugger looks at it.  Not only this fixes the mentioned problems, we
can do some cleanups/simplifications in arch_ptrace() paths.

Probably ptrace_unfreeze_traced() needs more callers, for example it
makes sense to make the tracee killable for oom-killer before
access_process_vm().

While at it, add the comment into may_ptrace_stop() to explain why
ptrace_stop() still can't rely on SIGKILL and signal_pending_state().

Reported-by: Salman Qazi <sqazi@google.com>
Reported-by: Suleiman Souhlal <suleiman@google.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
BUG=chromium-os:38610
TEST=link build

Change-Id: Iee6b0f1362545ed014e9e63abb566715d45d524d
(cherry picked from upstream commit 9899d11f654474d2d54ea52ceaa2a1f4db3abd68)
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43144
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
11 years agoUPSTREAM: ptrace: introduce signal_wake_up_state() and ptrace_signal_wake_up()
Oleg Nesterov [Mon, 21 Jan 2013 19:47:41 +0000 (20:47 +0100)]
UPSTREAM: ptrace: introduce signal_wake_up_state() and ptrace_signal_wake_up()

Cleanup and preparation for the next change.

signal_wake_up(resume => true) is overused. None of ptrace/jctl callers
actually want to wakeup a TASK_WAKEKILL task, but they can't specify the
necessary mask.

Turn signal_wake_up() into signal_wake_up_state(state), reintroduce
signal_wake_up() as a trivial helper, and add ptrace_signal_wake_up()
which adds __TASK_TRACED.

This way ptrace_signal_wake_up() can work "inside" ptrace_request()
even if the tracee doesn't have the TASK_WAKEKILL bit set.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
BUG=chromium-os:38610
TEST=link build

Change-Id: Ifef1e075ab82e588804961484981aff55a5f054d
(cherry picked from upstream commit 910ffdb18a6408e14febbb6e4b6840fd2c928c82)
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43143
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
11 years agoCHROMIUM: config: add MAX98088 driver on Exynos platforms.
Dylan Reid [Thu, 14 Feb 2013 23:51:34 +0000 (15:51 -0800)]
CHROMIUM: config: add MAX98088 driver on Exynos platforms.

On Spring, this codec will be used on the next board spin.

BUG=chromeos-partner:17794
TEST=push kernel to daisy and (modified) spring, check audio.

Change-Id: Id91d3b712e31eb98067f8a950ed6fcecf4c43593
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43357
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: exynos: dts: Make audio codec per board
Dylan Reid [Thu, 14 Feb 2013 19:54:59 +0000 (11:54 -0800)]
CHROMIUM: exynos: dts: Make audio codec per board

Move the audio codec specification from the common cros5250 to each
board.  This will allow for spring to use a different codec than snow.

BUG=chrome-os-partner:17794
TEST=build and run images for daisy and spring, listen to audio.

Change-Id: If61d794785dbb6786a37666885abc9c3ea5791a3
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43356
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: ASoC: max98088: Add TLV data for volume controls.
Dylan Reid [Thu, 14 Feb 2013 00:19:21 +0000 (16:19 -0800)]
CHROMIUM: ASoC: max98088: Add TLV data for volume controls.

Specify volumes as defined in the MAX98088/9 data sheet.  Allows ALSA
lib snd_mixer_selem_get_playback_dB_range and related functions to
work.

BUG=chrome-os-partner:17794
TEST=amixer cget on volume controls, observe valid range.

Change-Id: Ib140cf31c23d5191ae165f76508e4ad44f197241
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43355
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: Input: cyapa - Set to power mode OFF on remove
Benson Leung [Thu, 6 Dec 2012 20:24:42 +0000 (12:24 -0800)]
CHROMIUM: Input: cyapa - Set to power mode OFF on remove

If the driver is unloaded, set the trackpad to the lowest
power state.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=Set CONFIG_MOUSE_CYAPA=m in the chromeos config.
Builds clean.
Load the driver on a test system with the trackpad INT line scoped.
Check that the touchpad is functional.
rmmod cyapa to unload the cyapa module.
Click on the trackpad.
Check that the INT line does not assert on the scope, indicating
that the trackpad is indeed in OFF power state.

Change-Id: I11528776c82468a2d35a21fe22f5a6c7781d7ec0
Reviewed-on: https://gerrit.chromium.org/gerrit/42281
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
11 years agoCHROMIUM: Input: cyapa - Change phys to use a static array in cyapa
Benson Leung [Thu, 6 Dec 2012 20:44:26 +0000 (12:44 -0800)]
CHROMIUM: Input: cyapa - Change phys to use a static array in cyapa

Simplify this so we don't have to worry about freeing memory
later.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=builds clean.
cat /proc/bus/input/devices | grep -A1 cyapa
Check that the output is something like this (middle number will vary
based on adapter number on particular platform and kernel):
N: Name="cyapa"
P: Phys=i2c-1-0067/input0

Change-Id: I13fe249fb0ac83ce2703c22cb4dcc0bf89f0aa9f
Reviewed-on: https://gerrit.chromium.org/gerrit/42279
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
11 years agoCHROMIUM: Input: cyapa - Remove BL_KEY defines.
Benson Leung [Wed, 5 Dec 2012 23:52:04 +0000 (15:52 -0800)]
CHROMIUM: Input: cyapa - Remove BL_KEY defines.

These defines are not used anywhere in the driver.

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

Change-Id: I478862c52ba065af3af270ad3ec5c04592979123
Reviewed-on: https://gerrit.chromium.org/gerrit/42278
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
11 years agoCHROMIUM: Input: cyapa - Only set INPUT_PROP_BUTTONPAD on buttonpads
Benson Leung [Thu, 6 Dec 2012 21:00:36 +0000 (13:00 -0800)]
CHROMIUM: Input: cyapa - Only set INPUT_PROP_BUTTONPAD on buttonpads

Use the button capabilities to determine if this is a buttonpad,
ie, one where there is a single button under the trackpad.

If there is exactly one physical button, a left button, then set
INPUT_PROP_BUTTONPAD.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=builds clean.
Test on two systems, one with a buttonpad (such as Lumpy)
and another with real physical buttons (Butterfly).
Do the following on both:
from crosh, run tpcontrol log
Then, from the shell, grep isButtonPad /var/log/touchpad_activity_log.txt
On Lumpy, this should return "isButtonPad": true
On Butterfly, this should return "isButtonPad": false

Change-Id: Ic46b5a7c9585f22bef7693be53c0344a62ba331a
Reviewed-on: https://gerrit.chromium.org/gerrit/42277
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
11 years agoCHROMIUM: spring: dts: add Atmel trackpad configuration
Vincent Palatin [Wed, 13 Feb 2013 20:24:49 +0000 (12:24 -0800)]
CHROMIUM: spring: dts: add Atmel trackpad configuration

The Cypress one is defined in the common device tree,
so we currently define both of them.

Also add another entry if the trackpad is in bootloader mode at
address 0x25.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17825
TEST=boot a machine with an Atmel trackpad attached and one with Cypress
trackpad and have a working pointer on both of them.

Change-Id: I1886f7d3b2eedf39d73ca31376bd3229f8373b2d
Reviewed-on: https://gerrit.chromium.org/gerrit/43230
Reviewed-by: Benson Leung <bleung@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: input: atmel_mxt_ts - bail out early if we have no hardware
Vincent Palatin [Wed, 13 Feb 2013 23:29:49 +0000 (15:29 -0800)]
CHROMIUM: input: atmel_mxt_ts - bail out early if we have no hardware

When using the device tree to configure the kernel I2C devices,
the devices are not probed. So if we want to support multiple optional
peripherals, we might end up executing their probe callback.
In that case, just probe early the Atmel chip on the i2c and bail out
early if it is not present.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17825
TEST=boot a machine with an Atmel trackpad attached and one with Cypress
trackpad and have a working pointer on both of them.

Change-Id: I0c948cac2a38f587cc5f1efa5ba424715f25804d
Reviewed-on: https://gerrit.chromium.org/gerrit/43229
Reviewed-by: Benson Leung <bleung@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: input: cyapa - bail out early if we have no hardware
Vincent Palatin [Wed, 13 Feb 2013 23:29:49 +0000 (15:29 -0800)]
CHROMIUM: input: cyapa - bail out early if we have no hardware

When using the device tree to configure the kernel I2C devices,
the devices are not probed. So if we want to support multiple optional
peripherals, we might end up executing their probe callback.
In that case, just probe early the Cypress chip on the i2c and bail out
early if it is not present.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17825
TEST=boot a machine with an Atmel trackpad attached and one with Cypress
trackpad and have a working pointer on both of them.

Change-Id: I7d8cc499c5844521fe1b0eb703001f734cc43499
Reviewed-on: https://gerrit.chromium.org/gerrit/43228
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: exynos: de-activate internal backlight on Spring
Vincent Palatin [Thu, 14 Feb 2013 20:29:57 +0000 (12:29 -0800)]
CHROMIUM: exynos: de-activate internal backlight on Spring

On Spring, the Parade eDP bridge generates internally the PWM for the
LCD backlight.
When it is present, we can avoid configuring the
internal Exynos PWM in order to save power and to have only one
backlight device.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17227
TEST=boot on Spring and Snow, see backlight coming up in both cases

Change-Id: Id4d9db185b5e928f0b81d7fb358575cf07a20e36
Reviewed-on: https://gerrit.chromium.org/gerrit/43308
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: auxdisplay/ps8620: implement backlight control
Vincent Palatin [Thu, 14 Feb 2013 19:40:36 +0000 (11:40 -0800)]
CHROMIUM: auxdisplay/ps8620: implement backlight control

Add a standard backlight interface to the PS8622 bridge.

Also refactor how we are storing the driver data in a more classical fashion.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17227
TEST=on Spring, boot ChromeOS and press Backlight+/- keys from 100% to 0%
and back.

Change-Id: I1989192161ed6f6d5aafb5399658114a2f60bd97
Reviewed-on: https://gerrit.chromium.org/gerrit/43307
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: atkbd: improve workaround for chromeos EC bug
Luigi Semenzato [Thu, 14 Feb 2013 20:36:50 +0000 (12:36 -0800)]
CHROMIUM: atkbd: improve workaround for chromeos EC bug

This makes the workaround for commit b483f9730b97ba8812340cf1584b491d5aa1e774
(https://gerrit.chromium.org/gerrit/43049, "CHROMIUM: atkbd: workaround
for ChromeOS EC keyboard enable bug") work properly by re-enabling the
keyboard IRQ which was accidentally disabled.

BUG=chrome-os-partner:17810
TEST=tested with > 200 power cycles and > 30 workaround triggers
BRANCH=none

Change-Id: Ia8a817f665a3575eebeb1ba2ec3aa89f80c3e0e3
Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43300

11 years agoCHROMEOS: config: Add support for iptables QUEUE
Paul Stewart [Thu, 7 Feb 2013 00:18:22 +0000 (16:18 -0800)]
CHROMEOS: config: Add support for iptables QUEUE

Add the QUEUE target to the kernel.  This pulls in a bunch of
other modules we DON'T want, so explicilty configure these
off.

Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:38605
TEST=Compile kernel.  run ./chromeos/scripts/kernelconfig oldconfig
and confirm there are no additional changes

Change-Id: I07b53e81df045fae522c1048895138dd66e6d5d4
Reviewed-on: https://gerrit.chromium.org/gerrit/43133
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
11 years agodrm/exynos: Turn off VT switching on suspend
Sean Paul [Tue, 12 Feb 2013 20:34:07 +0000 (15:34 -0500)]
drm/exynos: Turn off VT switching on suspend

The exynos driver keeps track of dpms state on suspend/resume such that
we don't require VT switching. Disable it on driver probe.

BUG=chromium-os:38536
TEST=Tested on snow, used powerd_suspend and verified no VT switch

Change-Id: Ie20a0090474d259db6c063a1feb2e4eeee289a4d
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43118
Reviewed-by: Benson Leung <bleung@chromium.org>
11 years agoUPSTREAM: PM: make VT switching to the suspend console optional
Jesse Barnes [Tue, 12 Feb 2013 20:12:20 +0000 (15:12 -0500)]
UPSTREAM: PM: make VT switching to the suspend console optional

KMS drivers can potentially restore the display configuration without
userspace help.  Such drivers can can call a new funciton,
pm_vt_switch_required(false) if they support this feature.  In that
case, the PM layer won't VT switch to the suspend console at suspend
time and then back to the original VT on resume, but rather leave things
alone for a nicer looking suspend and resume sequence.

BUG=chromium-os:38536
TEST=Tested on snow, verified no VT switch on powerd_suspend

Change-Id: Id392b1ea14a0fef165b75d3caa4a9fa9e593740f
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43117
Reviewed-by: Benson Leung <bleung@chromium.org>
11 years agoCHROMIUM: atkbd: workaround for ChromeOS EC keyboard enable bug
Luigi Semenzato [Mon, 11 Feb 2013 19:47:48 +0000 (11:47 -0800)]
CHROMIUM: atkbd: workaround for ChromeOS EC keyboard enable bug

The ChromeOS EC enables keystrokes too early, and the driver
can get scancodes when it's expecting a response from the
GETID request.  The workaround consists of repeating the request
a few times if it fails.

BUG=chrome-os-partner:17005
TEST=verified that the workaround works around the bug
BRANCH=none

Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Change-Id: Ica4ad7ed1564c07ab196b302d1a33732a48c680f
Reviewed-on: https://gerrit.chromium.org/gerrit/43049
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>

11 years agoCHROMIUM: ALSA: hda - Hack in a delay when turning codec on.
Dylan Reid [Wed, 13 Feb 2013 03:11:47 +0000 (19:11 -0800)]
CHROMIUM: ALSA: hda - Hack in a delay when turning codec on.

Add a 10msec delay before and after powering on the codec.  It might
make link more likely to produce audio.

BUG=chrome-os-partner:17393
TEST=modified loopback test for 20 hours without losing audio.

Change-Id: I62822ae47b8a538c9537be42f8d6b3f3852dbb11
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43162
Commit-Queue: Trond Wuellner <trond@chromium.org>
Commit-Queue: Puneet Kumar <puneetster@chromium.org>
Reviewed-by: Puneet Kumar <puneetster@chromium.org>
11 years agoCHROMIUM: mmc: card: add a quirk for Kingston eMMC
Vincent Palatin [Wed, 13 Feb 2013 00:20:12 +0000 (16:20 -0800)]
CHROMIUM: mmc: card: add a quirk for Kingston eMMC

The Kingston eMMC 16GB is sometimes freezing (not answering to the
request) when doing a multiple read (CMD18).
With this workaround, I'm no longer encountering the issue.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17397
TEST=on Spring with unreliable Kingston eMMC, /usr/sbin/chromeos-install,
then boot the board from eMMC and see both steps succeeding without freeze.

Change-Id: If22613093debafeb90ecdc90b8ad5373d2050de9
Reviewed-on: https://gerrit.chromium.org/gerrit/43149
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoRevert "CHROMIUM: USB: add quirk for Novatel Wireless E362 modem"
Ben Chan [Wed, 13 Feb 2013 02:24:03 +0000 (18:24 -0800)]
Revert "CHROMIUM: USB: add quirk for Novatel Wireless E362 modem"

This reverts commit 4c1721759b9744d82c85926a188efcbd023df1e5

Change-Id: Ib6655f7980b66de712eaf6e475121d8fcd4ca8b9
Reviewed-on: https://gerrit.chromium.org/gerrit/43158
Commit-Queue: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
11 years agoCHROMIUM: USB: add quirk for Novatel Wireless E362 modem
Ben Chan [Tue, 12 Feb 2013 02:23:58 +0000 (18:23 -0800)]
CHROMIUM: USB: add quirk for Novatel Wireless E362 modem

BUG=chrome-os-partner:17609
TEST=Tested the following:
1. Leave the Chromebook on battery and verify that the USB auto-suspend
   is enabled on the E362 modem.
2. Repeatedly suspend and resume the Chromebook.

Change-Id: Ic9f0b82e6092f50b4e1f06192c29a1f3f4aa1326
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43125
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
11 years agoCHROMIUM: BACKPORT: regulator: s5m8767: fix stack corruption.
Todd Broch [Tue, 12 Feb 2013 21:27:01 +0000 (13:27 -0800)]
CHROMIUM: BACKPORT: regulator: s5m8767: fix stack corruption.

This CL fixes same stack corruption identified by the following commit

     commit 3ef303988cfcb35922f550892cf476e861377f0b
     Author: Inderpal Singh <inderpal.singh@linaro.org>
     Date:   Wed Dec 12 08:57:00 2012 +0530

 regulator: s5m8767: Fix probe failure due to stack corruption

Prior to the upstream fix, the failure manifested itself as kernel
Oops.  In CHROMIUM kernel (3.4) it quietly overwrote the i2c register
index to '0' (PMIC_ID) which led to successful return but without
writing the new voltage value.

This changelist mimics the upstream patch and can be dropped once
we've moved to 3.8 kernel.

BUG=chrome-os-partner:16430, chromium-os:38853
TEST=build & boot.  See voltage levels change based on cpufreq.

Signed-off-by: Todd Broch <tbroch@chromium.org>
Change-Id: I620f1a0487f0cce409e9fc223fb964a076e024d1
Reviewed-on: https://gerrit.chromium.org/gerrit/43129
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: HID: multitouch: Add advanced silicon cooltouch 2303 controller
Bernie Thompson [Mon, 11 Feb 2013 20:04:53 +0000 (12:04 -0800)]
CHROMIUM: HID: multitouch: Add advanced silicon cooltouch 2303 controller

Based on 9d8e6e by dparker@chromium.org.

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

Change-Id: Iab7b36fc7c41d6bed40f65c0a04e8ea9d011e3eb
Signed-off-by: Bernie Thompson <bhthompson@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43060
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoCHROMIUM: spring: dts: update Wifi 32Khz clock declaration
Vincent Palatin [Sat, 9 Feb 2013 01:57:06 +0000 (17:57 -0800)]
CHROMIUM: spring: dts: update Wifi 32Khz clock declaration

On SLSI S5M8767 PMIC, the fixed regulator for the 32Khz clock for
Wifi/Bluetooth is called en32khz_bt.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17512
TEST=on Spring with S5M8767 PMIC, boot and see Wifi coming up properly

Change-Id: I0224d866bd59a242b77db28ec985d7a1f0fad589
Reviewed-on: https://gerrit.chromium.org/gerrit/42977
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: regulator: s5m8767: add support for 32Khz clocks
Vincent Palatin [Sat, 9 Feb 2013 01:57:06 +0000 (17:57 -0800)]
CHROMIUM: regulator: s5m8767: add support for 32Khz clocks

Present the 32Khz clocks as fixed regulators.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17512
TEST=on Spring with S5M8767 PMIC, boot and see Wifi coming up properly

Change-Id: I51ff3adcacc2ea442c7a73aac0ab914767b2f8ce
Reviewed-on: https://gerrit.chromium.org/gerrit/42976
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: spring: dts: Cleanup regulator op_modes for s5m8767.
Todd Broch [Fri, 8 Feb 2013 22:30:16 +0000 (14:30 -0800)]
CHROMIUM: spring: dts: Cleanup regulator op_modes for s5m8767.

Changes were:
  ldo6: should be on in S0
  ldo17: can be turned off
  buck6: can be turned off
  emmc VR was moved to buck9

BUG=chrome-os-partner:16430
TEST=compile & boot kernel on spring
Run following and see properly configured opmodes for various VRs
     i=1
     for reg in 0x32 0x34 0x3d 0x46 0x4f 0x54 0x56 0x58 0x5a ; do
 a=$(( $(( $(i2cget -y -f 0 0x66 $reg) & 0xc0 )) >> 6 ))
 echo "${reg} :: buck${i} op_mode:${a}"
 i=$(( $i + 1))
     done

     i=1
     for reg in 0x5c 0x5d `seq 0x61 0x7a`; do
 a=$(( $(( $(i2cget -y -f 0 0x66 $reg) & 0xc0 )) >> 6 ))
 printf "0x%02x :: ldo${i} op_mode:%d\n" $reg $a
 i=$(( $i + 1))
     done

Signed-off-by: Todd Broch <tbroch@chromium.org>
Change-Id: I1d4093da9528beae4ff1be9f85e7d6b03d1fd713
Reviewed-on: https://gerrit.chromium.org/gerrit/42954
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: regulator: s5m8767: Enable configureable opmodes.
Todd Broch [Fri, 8 Feb 2013 22:21:53 +0000 (14:21 -0800)]
CHROMIUM: regulator: s5m8767: Enable configureable opmodes.

Allow the voltage regulators operating mode to be configured via
device tree node 'reg_op_mode'.  Previously operating modes were set
to 0x3 (always on) which is still the default for systems not using
device tree.

BUG=chrome-os-partner:16430
TEST=compile & boot kernel

Signed-off-by: Todd Broch <tbroch@chromium.org>
Change-Id: I474d92330854251dfc47a45a14eb0bc5af3e7889
Reviewed-on: https://gerrit.chromium.org/gerrit/42953
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: dts: Add node for MAX77686 RTC
Simon Glass [Sun, 3 Feb 2013 22:26:25 +0000 (14:26 -0800)]
CHROMIUM: dts: Add node for MAX77686 RTC

We will use this timer for the charger manager, so add a phandle for it.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
Use a pr_info() statement to check that the node is found in the driver on
boot.

Change-Id: I3239c108ce5b65c1c02ac328e27b7d5009d20c62
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42576

11 years agoCHROMIUM: power: max77686: Add basic device tree binding
Simon Glass [Sun, 3 Feb 2013 22:17:35 +0000 (14:17 -0800)]
CHROMIUM: power: max77686: Add basic device tree binding

This chip has an RTC within it, so define an "rtc" subnode. So far there
are no properties, but the existence of the node is enough to make it
accessible via a phandle.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
With later commits, see that we can find this node in the rtc driver.

Change-Id: Ia6d3fdb22b77b17bc4887ff3671b711f2969a251
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42575

11 years agoCHROMIUM: power: sbs: Warning on register read failure
Simon Glass [Sat, 2 Feb 2013 05:51:15 +0000 (21:51 -0800)]
CHROMIUM: power: sbs: Warning on register read failure

Warn when we fail to read from the battery.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
Disconnect battery and see that we start getting kernel warnings.

Change-Id: I6ad787be5bc4937df6bbcfe6f0af5a4b3ea91272
Reviewed-on: https://gerrit.chromium.org/gerrit/42574
Commit-Queue: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
11 years agoCHROMIUM: charger-manager: Allow battery to provide temperature
Simon Glass [Sun, 17 Jun 2012 17:38:45 +0000 (10:38 -0700)]
CHROMIUM: charger-manager: Allow battery to provide temperature

In some systems the we cannot obtain the cell temperature using the charger
or an ADC; we must ask the battery (fuel cell) since it has thermistors
which are closer to the battery and thus give a more accurate reading.

Add this feature to charger-manager.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
See that we obtain the correct temperature now (from the battery)

Change-Id: I2f2844632b7ef7b1179878cc769bcbe751c4c708
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/40169
Reviewed-by: Sameer Nanda <snanda@chromium.org>
11 years agoCHROMIUM: charger-manager: Show current state in status message
Simon Glass [Mon, 4 Feb 2013 23:04:27 +0000 (15:04 -0800)]
CHROMIUM: charger-manager: Show current state in status message

Charger-manager prints a status debug message each time it checks the
system. Adjust this so that it also prints the current charging state,
and tidy up the uevent emission code at the same time.

Keep a count of how many monitor cycles have been completed.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
See that a debug message appears every 10 seconds, showing the current
charge state.

Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: Ia45d3489031fb79ca765206a7b56b4a82c7fab59
Reviewed-on: https://gerrit.chromium.org/gerrit/42573
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
11 years agoregulator: tps65090: dts: Add binding documentation
Simon Glass [Sun, 17 Jun 2012 17:22:46 +0000 (10:22 -0700)]
regulator: tps65090: dts: Add binding documentation

The binding is fairly simple but we should still have documentation for it.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on daisy

Change-Id: I817d6934e38a963c24334c9512a8fbe8daea077a
Signed-off-by: Simon Glass <sjg@chromium.org>
BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
Reviewed-on: https://gerrit.chromium.org/gerrit/40165
Reviewed-by: Sameer Nanda <snanda@chromium.org>
11 years agoCHERRY-PICK: ARM: EXYNOS4: Enable Suspend/Resume of MCT.
MyungJoo Ham [Wed, 2 May 2012 02:17:11 +0000 (11:17 +0900)]
CHERRY-PICK: ARM: EXYNOS4: Enable Suspend/Resume of MCT.

Suspend/Resume has been failing because of MCT after introducing EXT-GIC
to EXYNOS4. This patch allows MCT's PM to work properly.

Change-Id: I562dbd1a7e8b7f99e50b03dcb102e351617796ac
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
(cherry picked from commits f20446c7cd2138ec53428151988b223f3a99b1b4
and 6c34b32be3e9ca8c1d3b5bd303cb54063d1454fc
in branch charger-manager-for-next of
git://git.infradead.org/users/kmpark/linux-2.6-samsung)

Modified by sjg@chromium.org to build without warnings

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow

Change-Id: I164d119b9c1a82b72e79bafe75d26fe89b0bc736
Reviewed-on: https://gerrit.chromium.org/gerrit/42572
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
11 years agoWake up DP sinks for DPCD read-based detection.
Stuart Abercrombie [Wed, 6 Feb 2013 22:39:59 +0000 (14:39 -0800)]
Wake up DP sinks for DPCD read-based detection.

When in DPMS sleep state the Apple mini DP->VGA adapter doesn't respond.
This led to no external display on boot.

v2: Avoid DPCD check and keep AUX awake for EDID read.

BUG=chrome-os-partner:17063
TEST=Straight DP and various adapters on mini-DP and DP platforms.

Change-Id: I90bea73006ae9c99464b0b5bc57f3803918313a8
Reviewed-on: https://gerrit.chromium.org/gerrit/42583
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stuart Abercrombie <sabercrombie@chromium.org>
Tested-by: Stuart Abercrombie <sabercrombie@chromium.org>
11 years agoCHROMIUM: msr: whitelist the i915 thermal control for wrmsr
Kees Cook [Fri, 8 Feb 2013 01:01:21 +0000 (17:01 -0800)]
CHROMIUM: msr: whitelist the i915 thermal control for wrmsr

Deny all userspace MSR writes except those explicitly whitelisted for
i915 thermal controls. Without this, processes with CAP_SYS_RAWIO can
run arbitrary kernel code via MSR writing.

BUG=chromium-os:38756
TEST=link build, wrmsr works only on i915 thermal registers

Change-Id: Iff5b9a466dbddd5d94e9246ff99b63a21c975406
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42910
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
11 years agoUPSTREAM: x86/msr: Add capabilities check
Alan Cox [Thu, 15 Nov 2012 13:06:22 +0000 (13:06 +0000)]
UPSTREAM: x86/msr: Add capabilities check

At the moment the MSR driver only relies upon file system
checks. This means that anything as root with any capability set
can write to MSRs. Historically that wasn't very interesting but
on modern processors the MSRs are such that writing to them
provides several ways to execute arbitary code in kernel space.
Sample code and documentation on doing this is circulating and
MSR attacks are used on Windows 64bit rootkits already.

In the Linux case you still need to be able to open the device
file so the impact is fairly limited and reduces the security of
some capability and security model based systems down towards
that of a generic "root owns the box" setup.

Therefore they should require CAP_SYS_RAWIO to prevent an
elevation of capabilities. The impact of this is fairly minimal
on most setups because they don't have heavy use of
capabilities. Those using SELinux, SMACK or AppArmor rules might
want to consider if their rulesets on the MSR driver could be
tighter.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Horses <stable@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
BUG=chromium-os:38633
TEST=link build, reading MSR correctly fails as uid 0 without caps:
 (can't use iotools with minijail because iotools is statically linked)
 `minijail0 -c 0 /usr/local/bin/python -c 'from struct import *; \
    m = open("/dev/cpu/0/msr"); m.seek(0x3a); \
    print "0x%016x" % (unpack("Q", m.read(8)))'`

(cherry picked from upstream commit c903f0456bc69176912dee6dd25c6a66ee1aed00)
Change-Id: I9d636ff7baac98a4243392428b48c0730600c7bc
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42684
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
11 years agoCHROMIUM: config: enable CGROUP_FREEZER
Mandeep Singh Baines [Wed, 6 Feb 2013 22:22:38 +0000 (14:22 -0800)]
CHROMIUM: config: enable CGROUP_FREEZER

This change is need for work on idle enhancements.

The overhead is negligible. Just calls to cgroup_freezing() in
freezing_slow_path(). cgroup_freezing() is a very low
overhead call.

BUG=chromium-os:38701
TEST=Compile. Boot.

Change-Id: I8df3e19c1bc9a45c7fef0ec014db294c00ab34fc
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42797
Reviewed-by: Sameer Nanda <snanda@chromium.org>
11 years agoCHROMIUM: spring: dts: Instantiate s5m8767 PMIC.
Todd Broch [Wed, 6 Feb 2013 19:57:54 +0000 (11:57 -0800)]
CHROMIUM: spring: dts: Instantiate s5m8767 PMIC.

Note, this will enumerate multiple PMICs for the same design as the
max77686 PMIC is also enumerated via cros5250-common.dtsi.  This is
remedied by the firmware (u-boot) at boot time by pruning the
non-existent PMIC.

  See: https://gerrit.chromium.org/gerrit/#/c/41993/ for details.

CL also disables ADC node for Spring which is unused.

BUG=chrome-os-partner:16430
TEST=kernel compiles for BOARD=daisy_spring

Change-Id: Ic1070b3001b20b4825582f10bd039051a61c7459
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42798
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: spring: add DT support for s5m8767.
Todd Broch [Sat, 26 Jan 2013 02:41:30 +0000 (18:41 -0800)]
CHROMIUM: spring: add DT support for s5m8767.

Add minimal device tree support for mfd/s5m-core and associated
s5m8767 PMIC.

BUG=chrome-os-partner:16430
TEST=kernel compiles

Signed-off-by: Todd Broch <tbroch@chromium.org>
Change-Id: Ieb74abb8ae061b727523c1b3010b354ce6023fe7
Reviewed-on: https://gerrit.chromium.org/gerrit/42202
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
11 years agoCHROMIUM: exynos: enable ADCs only if there are used
Vincent Palatin [Wed, 6 Feb 2013 19:05:28 +0000 (11:05 -0800)]
CHROMIUM: exynos: enable ADCs only if there are used

Check the presence of an ADC node in the device tree before activating
the ADCs and the NTP thermistors connected to them.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:16430
TEST=on Spring with SLSI PMIC, boot with adc node de-activated and
doesn't see any ADC related panic.
on Snow, boot and check the thermistor temperatures in sysfs.

Change-Id: I1603d78805a8d0877c137b92bcd2c64cbb32564d
Reviewed-on: https://gerrit.chromium.org/gerrit/42868
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: gobi: check for overflow in buffer_new()
Elly Fong-Jones [Tue, 5 Feb 2013 19:59:07 +0000 (14:59 -0500)]
CHROMIUM: gobi: check for overflow in buffer_new()

The size passed into buffer_new() can overflow. This isn't exploitable, since
all the calling paths check this, but still. Belt and suspenders and all that.

BUG=chromium-os:38211
TEST=adhoc

Change-Id: I3f19ec85db502c9ce56c9bae9e80d393cd5c5972
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42636

11 years agoCHROMIUM: s5p-mfc: enable NV12M/NV21M decoder output.
John Sheu [Wed, 6 Feb 2013 20:26:40 +0000 (12:26 -0800)]
CHROMIUM: s5p-mfc: enable NV12M/NV21M decoder output.

These two formats work on hardware; there is no need to disable them.
Enable them so we can have linear multiplanar YUV output support.

Signed-off-by: John Sheu <sheu@google.com>
BUG=chromium-os:38376
BUG=chromium:167417
TEST=local build, run on snow
Change-Id: Ic4889ca26555b067e7faadf9027e789633622dee
Reviewed-on: https://gerrit.chromium.org/gerrit/42761
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>

11 years agoUPSTREAM: ext4: ignore last group w/o enough space when resizing instead of BUG'ing
Yongqiang Yang [Wed, 5 Sep 2012 05:21:50 +0000 (01:21 -0400)]
UPSTREAM: ext4: ignore last group w/o enough space when resizing instead of BUG'ing

If the last group does not have enough space for group tables, ignore
it instead of calling BUG_ON().

Reported-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@vger.kernel.org
BUG=chromium-os:36118
TEST=link build, resize still works

(cherry picked from upstream commit 03c1c29053f678234dbd51bf3d65f3b7529021de)
Change-Id: I3a7274b6bd72346652b9e7f68b53674684764de7
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42679
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
11 years agoCHROMIUM: v4l2: dmabuf: update VIDIOC_EXPBUF interface to upstream
John Sheu [Thu, 31 Jan 2013 02:39:36 +0000 (18:39 -0800)]
CHROMIUM: v4l2: dmabuf: update VIDIOC_EXPBUF interface to upstream

<UPSTREAM MERGE NOT REQUIRED>

Backport the VIDIOC_EXPBUF interface from upstream kernels.

Signed-off-by: John Sheu <sheu@google.com>
BUG=chromium-os:38376
BUG=chromium:167417
TEST=local build, run on snow
Change-Id: Ia5cae1636b85d2c716188ff510a83a04b9cd8bc9
Reviewed-on: https://gerrit.chromium.org/gerrit/42374
Tested-by: John Sheu <sheu@chromium.org>
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>

11 years agoCHROMIUM: dma-buf: restore args on failure of dma_buf_mmap
John Sheu [Wed, 30 Jan 2013 10:04:36 +0000 (02:04 -0800)]
CHROMIUM: dma-buf: restore args on failure of dma_buf_mmap

Callers to dma_buf_mmap expect to fput() the vma struct's vm_file
themselves on failure.  Not restoring the struct's data on failure
causes a double-decrement of the vm_file's refcount.

Signed-off-by: John Sheu <sheu@google.com>
BUG=chromium-os:38376
BUG=chromium:167417
TEST=local build, run on snow

Change-Id: I868696d5f67235b9ca7d2599eac733438387e82b
Reviewed-on: https://gerrit.chromium.org/gerrit/42295
Tested-by: John Sheu <sheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>

11 years agoCHROMIUM: gobi: fix integer wraparound bug
Elly Fong-Jones [Mon, 4 Feb 2013 22:13:35 +0000 (17:13 -0500)]
CHROMIUM: gobi: fix integer wraparound bug

All the sizes here are bounded on the wire by 16 bits, to switch to size_t and
check for wraparound more carefully.

BUG=chromium-os:38210
TEST=adhoc
build, boot, see if the gobi still shows up

Change-Id: I492e632722714b1a869929d03c33a4fc12995120
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42559
Reviewed-by: Kees Cook <keescook@chromium.org>
11 years agoUPSTREAM: introduce SIZE_MAX
Xi Wang [Thu, 31 May 2012 23:26:04 +0000 (16:26 -0700)]
UPSTREAM: introduce SIZE_MAX

ULONG_MAX is often used to check for integer overflow when calculating
allocation size.  While ULONG_MAX happens to work on most systems, there
is no guarantee that `size_t' must be the same size as `long'.

This patch introduces SIZE_MAX, the maximum value of `size_t', to improve
portability and readability for allocation size validation.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Acked-by: Alex Elder <elder@dreamhost.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit a3860c1c5dd1137db23d7786d284939c5761d517)

Change-Id: Ic87ed61f0bbcd4d92ab3c8e898d0519d4d905ffb
BUG=chromium-os:38211
TEST=adhoc
build, boot, test for gobi presence

Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Change-Id: I82b6bf09368b7cc6a1ea1d2813f482cdf4fab424
Reviewed-on: https://gerrit.chromium.org/gerrit/42742
Reviewed-by: Kees Cook <keescook@chromium.org>
11 years agoUPSTREAM: debugfs: convert gid= argument from decimal, not octal
Dave Reisner [Wed, 2 Jan 2013 13:54:37 +0000 (08:54 -0500)]
UPSTREAM: debugfs: convert gid= argument from decimal, not octal

This patch technically breaks userspace, but I suspect that anyone who
actually used this flag would have encountered this brokenness, declared
it lunacy, and already sent a patch.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Reviewed-by: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
BUG=chromium-os:23758
TEST=link build, debugfs mount options work with decimal for gid

Change-Id: I4a37f3bd13da0ced916bde8038de16ebc3504d5e
(cherry picked from upstream commit f1688e0431d3a395388e70fe21da89ed0de0c323)
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42650
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
11 years agoCHROMIUM: sysrq-x: killall chrome process not just first one
Mandeep Singh Baines [Tue, 5 Feb 2013 22:55:38 +0000 (14:55 -0800)]
CHROMIUM: sysrq-x: killall chrome process not just first one

Currently, sysrq-x just kills the first chrome process it finds.
We've seen in at least one occassion where there may be a stale
chrome process from a previous session. The fix is to kill all
processes we find that meet our criteria.

I also modified the printk to print the pid of the process
that is killed. Previously we were printing the pid of
session_manager which is not as useful.

BUG=chrome-os-partner:17522
TEST=manual (debugging feature):
 hold down alt-volup then x - chrome should crash
 repeat immediately afterward - session should restart
 repeat and machine should reboot

2013-02-05T13:28:37.425355-08:00 localhost crash_reporter[2829]: Received crash notification for chrome[963] sig 6 (ignoring - chrome crash)
2013-02-05T13:28:37.557482-08:00 localhost session_manager: [0205/132837:INFO:session_manager_service.cc(523)] Handling child process exit: 963
2013-02-05T13:28:37.557537-08:00 localhost session_manager: [0205/132837:INFO:session_manager_service.cc(525)]   Exited with signal 6

Change-Id: Id039df7386cf7cccf42e0861bc2ab6f653147605
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42658
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
11 years agoCHROMIUM: watchdog: don't free perf_event on disable
Mandeep Singh Baines [Tue, 5 Feb 2013 20:58:55 +0000 (12:58 -0800)]
CHROMIUM: watchdog: don't free perf_event on disable

When offlining a CPU, we currently free the perf_event used for
the hardlockup detector. This sometimes results in an allocation
failure when bringing the CPU back online. The hotplug code to
bring the CPU back online is run while gfp flags are masked by
pm_restrict_gfp_mask.

[10086.691854]  [<ffffffff810a4e80>] warn_alloc_failed+0x10f/0x123
[10086.691864]  [<ffffffff810a6560>] ? drain_local_pages+0x16/0x18
[10086.691872]  [<ffffffff810a75f8>] __alloc_pages_nodemask+0x697/0x752
[10086.691881]  [<ffffffff810a7738>] __get_free_pages+0x17/0x44
[10086.691891]  [<ffffffff810ccca0>] kmalloc_order_trace+0x2b/0x5b
[10086.691898]  [<ffffffff810cf095>] __kmalloc+0x37/0x151
[10086.691908]  [<ffffffff81011a0d>] ? kmalloc_node.isra.0.constprop.3+0xe/0x10
[10086.691917]  [<ffffffff81011a0d>] kmalloc_node.isra.0.constprop.3+0xe/0x10
[10086.691925]  [<ffffffff810120dc>] reserve_ds_buffers+0xaf/0x30e
[10086.691934]  [<ffffffff8100ec2c>] x86_pmu_event_init+0x2d2/0x31c
[10086.691941]  [<ffffffff8109e456>] perf_init_event+0x66/0xac
[10086.691948]  [<ffffffff8109e6fb>] perf_event_alloc+0x25f/0x38f
[10086.691957]  [<ffffffff81076488>] ? touch_nmi_watchdog+0x67/0x67
[10086.691965]  [<ffffffff8109eacd>] perf_event_create_kernel_counter+0x26/0xd9
[10086.691973]  [<ffffffff810762b0>] watchdog_enable+0x7e/0x1ef
[10086.691981]  [<ffffffff81076848>] cpu_callback+0x31/0x3f
[10086.691999]  [<ffffffff810769d4>] lockup_detector_bootcpu_resume+0x2e/0x32
[10086.692009]  [<ffffffff8105beab>] suspend_devices_and_enter+0x1a3/0x26e
[10086.692018]  [<ffffffff8105c075>] pm_suspend+0xff/0x1c2
[10086.692025]  [<ffffffff8105b3a1>] state_store+0x99/0xca
[10086.692034]  [<ffffffff811d6562>] kobj_attr_store+0xf/0x1b
[10086.692042]  [<ffffffff81123280>] sysfs_write_file+0xe9/0x121
[10086.692050]  [<ffffffff810d2fca>] vfs_write+0x98/0xda
[10086.692057]  [<ffffffff810d3199>] sys_write+0x43/0x73
[10086.692066]  [<ffffffff8146ac52>] system_call_fastpath+0x16/0x1b

The end result of the allocation failure is that the watchdog no
longer works sometimes after suspend/resume. The fix is to only
disable the event and not free it. This avoids the failed allocation.

BUG=chrome-os-partner:17522
TEST=Verify that detector still works after suspend/resume.

Change-Id: I78c90b13f718d660bd23884968be2f14c7c61860
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42657
Reviewed-by: Sameer Nanda <snanda@chromium.org>
11 years agoCHROMIUM: exynos: properly manage "regulator" for HSIC reset
Vincent Palatin [Tue, 5 Feb 2013 17:12:19 +0000 (09:12 -0800)]
CHROMIUM: exynos: properly manage "regulator" for HSIC reset

We were violating something in the documentation for regulator_put,
namely:
  Note: drivers must ensure that all regulator_enable calls made on
  this regulator source are balanced by regulator_disable calls prior
  to calling this function.

We now keep the regulator around until we've disabled it.  That keeps
the regulator in the right state.

At the same time, add some error checking to regulator calls.

BUG=chromium-os:38403
TEST=on Snow with 3G modem, do a suspend/resume cycle and check in
"lsusb" that the modem (VID/PID 1410:a021) and the camera (VID/PID
2232:1037) are still there after resume.
On Spring, check we can still boot from USB.
TEST=Check state of hsichub-reset-l at boot and after resume:
1. cd /sys/kernel/debug/regulator/hsichub-reset-l
2. grep "" *
3. Check open_count of 1 and use_count of 1.

Change-Id: I31012c15e30c43a1259f15ffd3592ee68cb0b772
Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42621
Reviewed-by: Todd Broch <tbroch@chromium.org>
11 years agoCHROMIUM: nl80211: Reassign NL80211_ATTR_SCAN_FLAGS
Paul Stewart [Tue, 5 Feb 2013 19:53:08 +0000 (11:53 -0800)]
CHROMIUM: nl80211: Reassign NL80211_ATTR_SCAN_FLAGS

Change the NL80211_ATTR_SCAN_FLAGS value to match upstream kernels.
In doing so, fast-forward the contents of the nl80211_attrs enum to
its contents as of the current wireless-testing kernel.

CQ-DEPEND=I315dce8b3c39ae02db2a01401f83666f81b51f63
BUG=chromium-os:38618
TEST="test-flimflam scan" with new supplicant and kernel installed

Change-Id: Ie27c65a6eea1006f34346c51768d797ceadb7951
Signed-off-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42640
Reviewed-by: mukesh agrawal <quiche@chromium.org>