cascardo/linux.git
12 years agoAdd S2R functionality for HDMI and Mixer
Shirish S [Mon, 17 Sep 2012 12:35:52 +0000 (18:05 +0530)]
Add S2R functionality for HDMI and Mixer

This patch adds clock gating support for HDMI and
Mixer via runtime PM routines.

BUG=chrome-os-partner:12958
Test=On Snow,
DISPLAY=":0" xset dpms force off/on
HDMI hotplug in and out
rtcwake -m mem -s <X>
This system behaves as expected.

Change-Id: I19e1acedc7d732a9f3c6a35918bd67c2d867144a
Signed-off-by: Shirish S <s.shirish@samsung.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/32216
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Tested-by: Shirish S <shirish@chromium.org>
Reviewed-by: Shirish S <shirish@chromium.org>
Commit-Ready: Shirish S <shirish@chromium.org>

12 years agoCHROMIUM: config: disable CONFIG_MMC_SDHCI_S3C config
Alim Akhtar [Sun, 16 Sep 2012 10:18:06 +0000 (19:18 +0900)]
CHROMIUM: config: disable CONFIG_MMC_SDHCI_S3C config

We dont use SDHCI-S3C controller on snow, lets disable this driver.

BUG=none
TEST=build ok booted on snow from SD card, did chromeos-install
     and then booted from eMMC. Connected WIFI and able to browse.
     run ./chromeos/script/kernelconfig oldconfig to normalize config.

Change-Id: Ide0eba1cdb41bed58ec4e14d6ff6bc83b5f78a4a
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/33397
Reviewed-by: Doug Anderson <dianders@chromium.org>
12 years agommc: dw_mmc: Don't copy struct device; keep a pointer
Doug Anderson [Mon, 17 Sep 2012 22:47:59 +0000 (15:47 -0700)]
mmc: dw_mmc: Don't copy struct device; keep a pointer

It's not such a good idea to make a copy of your 'struct device'.
This was specifically causing a warning when you turn on list
debugging but was just generally bad voodoo:

  [    2.876227] ------------[ cut here ]------------
  [    2.880813] WARNING: at .../lib/list_debug.c:32 __list_add+0x64/0x88()
  [    2.891308] list_add corruption. prev->next should be next (eddded18), but was ef2ef5e0. (prev=ef2ef5e0).
  [    2.900855] Modules linked in:
  [    2.903904] [<80015960>] (unwind_backtrace+0x0/0xec) from [<804f5c94>] (dump_stack+0x20/0x24)
  [    2.912406] [<804f5c94>] (dump_stack+0x20/0x24) from [<8002a7ac>] (warn_slowpath_common+0x5c/0x74)
  [    2.921345] [<8002a7ac>] (warn_slowpath_common+0x5c/0x74) from [<8002a880>] (warn_slowpath_fmt+0x40/0x48)
  [    2.930893] [<8002a880>] (warn_slowpath_fmt+0x40/0x48) from [<80234f14>] (__list_add+0x64/0x88)
  [    2.939575] [<80234f14>] (__list_add+0x64/0x88) from [<802cae08>] (add_dr+0x78/0x90)
  [    2.947297] [<802cae08>] (add_dr+0x78/0x90) from [<802cb02c>] (devres_add+0x38/0x48)
  [    2.955021] [<802cb02c>] (devres_add+0x38/0x48) from [<802cb0b0>] (devm_kzalloc+0x74/0x84)
  [    2.963269] [<802cb0b0>] (devm_kzalloc+0x74/0x84) from [<803c85a4>] (dw_mci_probe+0x40/0xd74)
  [    2.971775] [<803c85a4>] (dw_mci_probe+0x40/0xd74) from [<803ca1cc>] (dw_mci_pltfm_probe+0xdc/0x11c)
  [    2.980889] [<803ca1cc>] (dw_mci_pltfm_probe+0xdc/0x11c) from [<802c9544>] (platform_drv_probe+0x24/0x28)
  [    2.990438] [<802c9544>] (platform_drv_probe+0x24/0x28) from [<802c8114>] (driver_probe_device+0xd8/0x210)
  [    3.000072] [<802c8114>] (driver_probe_device+0xd8/0x210) from [<802c82bc>] (__driver_attach+0x70/0x94)
  [    3.009446] [<802c82bc>] (__driver_attach+0x70/0x94) from [<802c6798>] (bus_for_each_dev+0x60/0x9c)
  [    3.018473] [<802c6798>] (bus_for_each_dev+0x60/0x9c) from [<802c7bf0>] (driver_attach+0x28/0x30)
  [    3.027327] [<802c7bf0>] (driver_attach+0x28/0x30) from [<802c7770>] (bus_add_driver+0xc0/0x23c)
  [    3.036094] [<802c7770>] (bus_add_driver+0xc0/0x23c) from [<802c8818>] (driver_register+0xac/0x138)
  [    3.045121] [<802c8818>] (driver_register+0xac/0x138) from [<802c9860>] (platform_driver_register+0x54/0x68)
  [    3.054930] [<802c9860>] (platform_driver_register+0x54/0x68) from [<802c989c>] (platform_driver_probe+0x28/0x9c)
  [    3.065174] [<802c989c>] (platform_driver_probe+0x28/0x9c) from [<8071eb14>] (dw_mci_init+0x18/0x24)
  [    3.074286] [<8071eb14>] (dw_mci_init+0x18/0x24) from [<8000869c>] (do_one_initcall+0xa0/0x170)
  [    3.082966] [<8000869c>] (do_one_initcall+0xa0/0x170) from [<80701a58>] (kernel_init+0xf8/0x1b4)
  [    3.091734] [<80701a58>] (kernel_init+0xf8/0x1b4) from [<8000f220>] (kernel_thread_exit+0x0/0x8)
  [    3.100505] ---[ end trace 21375439ea8d120e ]---

BUG=chrome-os-partner:13946
TEST=Booted; can use WiFi.

Change-Id: I4338bcf488096eb9fdcd395337fd60982a23d9c5
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33461
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Pawel Osciak <posciak@google.com>
12 years agoCHROMIUM: dts: add write protect gpio for SD card slot
Alim Akhtar [Mon, 17 Sep 2012 09:30:21 +0000 (18:30 +0900)]
CHROMIUM: dts: add write protect gpio for SD card slot

Add write protect gpio configuration for sd card slot.

BUG=chrome-os-partner:12467
TEST=build ok, booted on snow
     Insert SD card with write-protect lock ON and can see the gpio is
     high
     localhost ~ # grep -rn mci-wp /sys/kernel/debug/gpio
     50: gpio-61  (dw-mci-wp           ) in  hi
     Also
     localhost ~ # mount /dev/mmcblk1p3 /mnt/
     mount: block device /dev/mmcblk1p3 is write-protected, mounting
     read-only

     Now insert SD card with write-protect lock OFF and can see gpio is
     low
     grep -rn mci-wp /sys/kernel/debug/gpio
      50: gpio-61  (dw-mci-wp           ) in  lo
     Also
     mount /dev/mmcblk1p3 /mnt/ will mount it without any read-only
     warnning message.

Change-Id: I8c49412cb997b0f7bb84fe4377bdad5de284a79e
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/33425
Commit-Ready: Olof Johansson <olofj@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: usb: dwc3: Add delay of 10ms to allow phy clk to stabilise
Vikas C Sajjan [Fri, 14 Sep 2012 07:34:08 +0000 (16:34 +0900)]
CHROMIUM: usb: dwc3: Add delay of 10ms to allow phy clk to stabilise

Adds the delay of 10ms once the gpio line for phy clk is pulled high,
to allow the clock to stabilise.

BUG=chrome-os-partner:13972
TEST=1>booted kernel with USB 3.0 device connected on 3.0 port,
device detected and enumerated.
2>run 'powerd_suspend' while usb 3.0 device is connected on 3.0 port,
system resumes successfully, device detected and enumerated.

Change-Id: I9cc5ad96427b16ce0c7d6fb12b5ff802f27c5f2c
Signed-off-by: Jaehoon Kim <jh228.kim@samsung.com>
Signed-off-by: Vikas Sajjan <vikas.sajjan@samsung.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33299
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
12 years agoexynos/drm: move setting DPCLKON before clk disable
Prathyush K [Sat, 15 Sep 2012 16:56:02 +0000 (22:26 +0530)]
exynos/drm: move setting DPCLKON before clk disable

Setting the register for DPCLKON is being done after clk_disable which
leads to a crash during S2R. This patch moves this before clk_disable.

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

Change-Id: If1f53089b09b141d21716aaf246a320abe024c94
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33392
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Anush Elangovan <anush@google.com>
Tested-by: Anush Elangovan <anush@google.com>
12 years agodrm/exynos: Clean-up IOMMU mapping creation order
Pawel Osciak [Thu, 30 Aug 2012 17:43:24 +0000 (10:43 -0700)]
drm/exynos: Clean-up IOMMU mapping creation order

The IOMMU mappings are shared across FIMD and HDMI. Due to the
ordering in the Makefile, the FIMD map call is executed first,
thus HDMI uses the parameters from there as well. The mapping size
passed in exynos_mixer.c is thus unused and misleading, so change
it to 0. Also, add sanity checks for that assumption in case
the ordering changes in the future.

BUG=None
TEST=None

Change-Id: Ib9c290ca4cdce72d7823fe3b4d584e0c2a7a9cd8
Signed-off-by: Pawel Osciak <posciak@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31898
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Pawel Osciak <posciak@google.com>
Tested-by: Pawel Osciak <posciak@google.com>
12 years agoCHROMIUM: ASoC: samsung i2s - Don't setup if already active.
Dylan Reid [Fri, 7 Sep 2012 02:10:13 +0000 (19:10 -0700)]
CHROMIUM: ASoC: samsung i2s - Don't setup if already active.

If the dai is already running when setup is called, skip setup.  Setting
up again caused set_sysclk to set rclk_srcrate to other->rclk_srcrate,
other would often be set to the default of 44.1.  Playing a 48k stream
then adding a 48k capture stream would lead to both streams set to 44.1
(The value of other->rclk_srcrate).

Similarly in shutdown, if either playback or capture are still active,
return instead of turning off the clocks.

BUG=chrome-os-partner:13769, 13749
TEST=aplay -Dhw:0 <any 48k wav file>, then arecord -Dhw:0 -f dat
/tmp/asdf.wav.  Make sure audio continues from aplay and is captured by
arecord, before this change aplay would stop and arecord would capture
silence.
Gmail settings, make sure microphone progress bar moves when you talk.

Change-Id: I1dd02854e234d23ac25ad686c7603e4bc9265b4e
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32477
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoRevert "EXYNOS: USB: Modify Common block power-down control for USB 2.0 PHY"
Doug Anderson [Sun, 16 Sep 2012 20:47:49 +0000 (13:47 -0700)]
Revert "EXYNOS: USB: Modify Common block power-down control for USB 2.0 PHY"

This reverts commit e62200853145dfa26d7614a0004b4a4912a901ae

The above commit allegedly causes problems with shutdown / suspend
on some systems, especially when running a recovery image and when
nothing is plugged into the USB 2.0 port.  It also has been known to
cause problems with no_console_suspend.  Although we don't
understand the connection between that CL and the problems,
it's wiser to revert while we investigate.

Nothing in this CL is so critical that a revert will really hurt.

This does the same thing as
<https://gerrit.chromium.org/gerrit/#/c/30814/>, but with a commit
message that indicates that it's a straight revert.

BUG=chrome-os-partner:10932, chrome-os-partner:13068
TEST=Automatic reboot after recovery works with this CL.

Change-Id: Ic01b4494b9e4414d22424c010280757d6e15e5a2
Reviewed-on: https://gerrit.chromium.org/gerrit/33400
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
Commit-Ready: Doug Anderson <dianders@chromium.org>

12 years agoCHROMIUM: spi: s3c64xx: fix compiler warning
Naveen Krishna Chatradhi [Tue, 11 Sep 2012 13:10:38 +0000 (18:40 +0530)]
CHROMIUM: spi: s3c64xx: fix compiler warning

Remove the following warnings:
drivers/spi/spi-s3c64xx.c: In function 's3c64xx_spi_dmacb':
drivers/spi/spi-s3c64xx.c:267:21: warning: comparison between 'enum dma_data_direction' and 'enum dma_transfer_direction' [-Wenum-compare]
drivers/spi/spi-s3c64xx.c:276:21: warning: comparison between 'enum dma_data_direction' and 'enum dma_transfer_direction' [-Wenum-compare]
drivers/spi/spi-s3c64xx.c: In function 'prepare_dma':
drivers/spi/spi-s3c64xx.c:295:21: warning: comparison between 'enum dma_data_direction' and 'enum dma_transfer_direction' [-Wenum-compare]

BUG=chromium-os:34287
TEST=emerge-daisy chromeos-kernel built without this warning.

Change-Id: I9b1079267b8c99ef8b2a6a6fe50599c9c5bd67f6
Signed-off-by: Naveen Krishna Chatradhi <naveen@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32920
Reviewed-by: Doug Anderson <dianders@chromium.org>
12 years agoRevert "drm/exynos: Implements proper disable of LCD clock"
Anush Elangovan [Sat, 15 Sep 2012 00:55:04 +0000 (17:55 -0700)]
Revert "drm/exynos: Implements proper disable of LCD clock"

This reverts commit 164bc3d5b187db2de34a87b4163dd5b83f610584

xrandr --output eDP-1 --off / --auto crashes with this change. Back it out for now.

Change-Id: I90bda4b7209f15e376fc386097fd43f84bc57121
Reviewed-on: https://gerrit.chromium.org/gerrit/33380
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Tested-by: Anush Elangovan <anush@google.com>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
12 years agoexynos: cpuidle: Add arm down clock support
Abhilash Kesavan [Sun, 26 Aug 2012 13:58:42 +0000 (06:58 -0700)]
exynos: cpuidle: Add arm down clock support

In idle state down clocking the arm cores can result in power
savings. Program the power control registers to achieve this and
save these registers across a suspend/resume cycle. Also, modify
the target residency to improve the transition to idle state.

BUG=chrome-os-partner:12917
TEST=Ensure idle state transitions are occuring.

Change-Id: Iec8c00d0b7e54a199f4d770c4b4c3725af15c641
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/31438
Reviewed-by: Bryan Freed <bfreed@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Ready: Todd Broch <tbroch@chromium.org>

12 years agodrivers: mfs: tps65090: don't free IRQ of not initialized on probe
Jonathan Kliegman [Wed, 29 Aug 2012 15:10:19 +0000 (11:10 -0400)]
drivers: mfs: tps65090: don't free IRQ of not initialized on probe

Only free the irq if its been initalized during probe.

BUG=chromium-os:33995
TEST=None

Change-Id: I8905a4a7e777970037c953468f6fa976c07e12a0
Signed-off-by: Jonathan Kliegman <kliegs@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31709
Reviewed-by: Doug Anderson <dianders@chromium.org>
12 years agoasoc/exynos: dapm switch added for hdmi audio
Rahul Sharma [Wed, 29 Aug 2012 13:34:51 +0000 (19:04 +0530)]
asoc/exynos: dapm switch added for hdmi audio

i2s card is modified to add dapm switch for hdmi-audio. Without
this change in place audio will be heard from speakers as well as
hdmi output. This switch needs to be toggled from the user space
for enabling disabling hdmi audio.

BUG=none
TEST=verified various audio files using amixer
application.

Change-Id: I1e30ec316f1dbe2bf3d03ab7c42d0334b26ecfd7
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/31696
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Commit-Ready: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
12 years agoexynos5: dts: exynos5 hdmi-audio as child to hdmi node
Rahul Sharma [Fri, 24 Aug 2012 21:05:16 +0000 (02:35 +0530)]
exynos5: dts: exynos5 hdmi-audio as child to hdmi node

Hdmi audio is added as child node to hdmi device node.

BUG=none
TEST=verified various audio files using aplay
application.

Change-Id: Ie14b8959523aa56dd16405b30c520dd05ea8d026
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/31365
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
12 years agoexynos5: dts: exynos5 hdmi-audio as plugin to i2s
Rahul Sharma [Fri, 24 Aug 2012 21:00:45 +0000 (02:30 +0530)]
exynos5: dts: exynos5 hdmi-audio as plugin to i2s

Hdmi audio is added as a plugin to i2s. This info is
passed as a property to i2s device node. Other plugins
can also be added to the same property.

BUG=none
TEST=verified various audio files using aplay
application.

Change-Id: Ie68d96d0777c1ceffdc473e62e53b64d14094c35
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/31364
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
12 years agodrm/exynos5: hdmi-audio plf device is registered
Rahul Sharma [Fri, 24 Aug 2012 20:54:56 +0000 (02:24 +0530)]
drm/exynos5: hdmi-audio plf device is registered

For exynos5, hdmi-audio is registered as a platform device. hdmi-audio
driver is registerd from /sound/soc/samsung. This helps in configuring
the hdmi-audio though ALSA framework.

BUG=none
TEST=verified various audio files using aplay
application.

Change-Id: I19f563dec7ca5035e111f8bdbc18dd3bce0eeec0
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/31363
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Dylan Reid <dgreid@chromium.org>

12 years agodrm/exynos5: hdmi-audio calls removed
Rahul Sharma [Fri, 24 Aug 2012 20:49:39 +0000 (02:19 +0530)]
drm/exynos5: hdmi-audio calls removed

For exynos5, hdmi-audio code is moved to /sound/soc. This helps in
reconfiguring the hdmi-audio whenever there is a change in audio
params.

BUG=none
TEST=verified various audio files using aplay
application.

Change-Id: I8f7a418b692c238d878fd7c0ad37a5aba8a75c52
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/31362
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
12 years agoCHROMIUM: config: enable hdmi-audio
Rahul Sharma [Fri, 24 Aug 2012 20:41:48 +0000 (02:11 +0530)]
CHROMIUM: config: enable hdmi-audio

Enable hdmi-audio

BUG=none
TEST=verified various audio files using aplay
application.

Change-Id: Ibe227003d0d9a29e8a184cd99e21264466f6627e
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/31361
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
12 years agoasoc/exynos: i2s dai modified to call plugin api
Rahul Sharma [Fri, 24 Aug 2012 21:24:50 +0000 (02:54 +0530)]
asoc/exynos: i2s dai modified to call plugin api

i2s dai is modified to accept the plugin connection from hdmi-audio
and similar plugins. These plugins will be passed from DT. With this
change, all format related calls will also be forwarded to the
attached plugin.

BUG=none
TEST=verified various audio files using aplay
application.

Change-Id: I8767ae72a9f8e1d55760185317bff6078aaa9b23
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/31360
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
12 years agoasoc/exynos: add hdmi-audio as a plf driver and plugin
Rahul Sharma [Fri, 24 Aug 2012 21:18:56 +0000 (02:48 +0530)]
asoc/exynos: add hdmi-audio as a plf driver and plugin

hdmi-audio is added as a platform driver. exynos-hdmi-audio device will
instantiated by drm hdmi driver.With this change hdmi-audio is like
dummy codec driver attached to i2s and recieving calls for audio
format change.

BUG=none
TEST=verified various audio files using aplay
application.

Change-Id: I385c9443aa888d018ac852ca2e7b03966a12e4dc
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/31359
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
12 years agodrm/exynos: mixer: Move layer update out of vsync
Sean Paul [Thu, 13 Sep 2012 23:18:47 +0000 (16:18 -0700)]
drm/exynos: mixer: Move layer update out of vsync

Move the mixer's layer update command out of the vsync interrupt and do
it only once per layer per vsync. We also don't want to finish a
pageflip if a layer update is in progress since it will still be
scanning out and X/userspace will start drawing to the front buffer.

BUG=chrome-os-partner:13692
TEST=Tested on snow, no corruption detected

Change-Id: I811da726daaf52117f9a42a299dbc98b43d7c3bd
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33252
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
12 years agoUPSTREAM: mutex: Place lock in contended state after fastpath_lock failure
Will Deacon [Fri, 10 Aug 2012 14:22:09 +0000 (15:22 +0100)]
UPSTREAM: mutex: Place lock in contended state after fastpath_lock failure

ARM recently moved to asm-generic/mutex-xchg.h for its mutex
implementation after the previous implementation was found to be missing
some crucial memory barriers. However, this has revealed some problems
running hackbench on SMP platforms due to the way in which the
MUTEX_SPIN_ON_OWNER code operates.

The symptoms are that a bunch of hackbench tasks are left waiting on an
unlocked mutex and therefore never get woken up to claim it. This boils
down to the following sequence of events:

        Task A        Task B        Task C        Lock value
0                                                     1
1       lock()                                        0
2                     lock()                          0
3                     spin(A)                         0
4       unlock()                                      1
5                                   lock()            0
6                     cmpxchg(1,0)                    0
7                     contended()                    -1
8       lock()                                        0
9       spin(C)                                       0
10                                  unlock()          1
11      cmpxchg(1,0)                                  0
12      unlock()                                      1

At this point, the lock is unlocked, but Task B is in an uninterruptible
sleep with nobody to wake it up.

This patch fixes the problem by ensuring we put the lock into the
contended state if we fail to acquire it on the fastpath, ensuring that
any blocked waiters are woken up when the mutex is released.

BUG=chrome-os-partner:13943
TEST=Booted

Change-Id: If605d2ecb15562b2444928fe4d4ec35cc6dfdb21
Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Chris Mason <chris.mason@fusionio.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: <stable@vger.kernel.org>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-6e9lrw2avczr0617fzl5vqb8@git.kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit 0bce9c46bf3b15f485d82d7e81dabed6ebcc24b1)
Reviewed-on: https://gerrit.chromium.org/gerrit/33327
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Pawel Osciak <posciak@google.com>
12 years agoUPSTREAM: ARM: 7467/1: mutex: use generic xchg-based implementation for ARMv6+
Will Deacon [Fri, 13 Jul 2012 18:15:40 +0000 (19:15 +0100)]
UPSTREAM: ARM: 7467/1: mutex: use generic xchg-based implementation for ARMv6+

The open-coded mutex implementation for ARMv6+ cores suffers from a
severe lack of barriers, so in the uncontended case we don't actually
protect any accesses performed during the critical section.

Furthermore, the code is largely a duplication of the ARMv6+ atomic_dec
code but optimised to remove a branch instruction, as the mutex fastpath
was previously inlined. Now that this is executed out-of-line, we can
reuse the atomic access code for the locking (in fact, we use the xchg
code as this produces shorter critical sections).

This patch uses the generic xchg based implementation for mutexes on
ARMv6+, which introduces barriers to the lock/unlock operations and also
has the benefit of removing a fair amount of inline assembly code.

BUG=chrome-os-partner:13943
TEST=Booted

Change-Id: Idf504e4778be7cdc50c5f1a121fe24c53a9746b7
Cc: <stable@vger.kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@linaro.org>
Reported-by: Shan Kang <kangshan0910@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit a76d7bd96d65fa5119adba97e1b58d95f2e78829)
Reviewed-on: https://gerrit.chromium.org/gerrit/33324
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Pawel Osciak <posciak@google.com>
12 years agoIncrease XHCI suspend timeout to 16ms
Michael Spang [Wed, 12 Sep 2012 22:52:25 +0000 (18:52 -0400)]
Increase XHCI suspend timeout to 16ms

The Intel XHCI specification says that after clearing the run/stop bit
the controller may take up to 16ms to halt. We've seen a device take
14ms, which with the current timeout of 10ms causes the kernel to
abort the suspend. Increasing the timeout to the recommended value
fixes the problem.

BUG=chrome-os-partner:13799
TEST=suspend, check for "WARN: xHC CMD_RUN timeout"

Change-Id: I1a8a1442a73e7778b91cd652f256cef447874fcd
Signed-off-by: Michael Spang <spang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33239
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Vikas Sajjan <vikas.sajjan@samsung.com>
12 years agoUPSTREAM: staging/gdm72xx: usb_boot: replace firmware upgrade API
Macpaul Lin [Thu, 13 Sep 2012 10:11:55 +0000 (18:11 +0800)]
UPSTREAM: staging/gdm72xx: usb_boot: replace firmware upgrade API

Replace file I/O of reading firmware usb_boot()
by request_firmware().

Signed-off-by: Macpaul Lin <macpaul@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 1839c7ebd9363cc73b55ce48d4c3c6823c2fdd42)

Change-Id: I763502a1e40cb1131369b55ad339e00df922669d
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33282
Reviewed-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: staging/gdm72xx: usb_boot: coding style cleanup
Macpaul Lin [Thu, 13 Sep 2012 10:11:54 +0000 (18:11 +0800)]
UPSTREAM: staging/gdm72xx: usb_boot: coding style cleanup

1. Coding style re-formatting (tabs).
2. Remove unused MIN() marco.

Signed-off-by: Macpaul Lin <macpaul@gmail.com>
Cc: Paul Stewart <pstew@chromium.org>
Cc: Ben Chan <benchan@chromium.org>
Cc: Sage Ahn <syahn@gctsemi.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 443242d2feb68c90fbd96de212d76d7858ac0834)

Change-Id: I10ca026c666ed4a35b27e29f48151ad15904e5c6
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33281
Reviewed-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: staging: gdm72xx: simplify alloc_tx_struct and alloc_rx_struct
Ben Chan [Wed, 12 Sep 2012 18:43:41 +0000 (11:43 -0700)]
UPSTREAM: staging: gdm72xx: simplify alloc_tx_struct and alloc_rx_struct

This patch simplifies alloc_tx_struct and alloc_rx_struct in gdm_sdio.c
and gdm_usb.c by replacing kmalloc+memset with kzalloc and reorganizing
the code.

Signed-off-by: Ben Chan <benchan@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 129575f2a8958a1e90780b0d5b80702bb45b5aac)

Change-Id: I59d1bfb0e5a525b9d3e5663a32e1f7f293d07037
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33280
Reviewed-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: staging/gdm72xx: gdm_usb coding style clean up
Macpaul Lin [Wed, 12 Sep 2012 09:49:24 +0000 (17:49 +0800)]
UPSTREAM: staging/gdm72xx: gdm_usb coding style clean up

gdm_usb.* coding style clean up.

Signed-off-by: Macpaul Lin <macpaul@gmail.com>
Cc: Paul Stewart <pstew@chromium.org>
Cc: Ben Chan <benchan@chromium.org>
Cc: Sage Ahn <syahn@gctsemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 0d660025564343e7c20c096d386f8ef8bacebdcd)

Change-Id: If45efca67169fdfc9ab3e95e57ce91bc21cb100c
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33279
Reviewed-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: drivers/staging/gdm72xx/gdm_sdio.c: Remove useless kfree
Peter Senna Tschudin [Wed, 12 Sep 2012 15:06:44 +0000 (17:06 +0200)]
UPSTREAM: drivers/staging/gdm72xx/gdm_sdio.c: Remove useless kfree

Remove useless kfree() and clean up code related to the removal.

The semantic patch that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
position p1,p2;
expression x;
@@

if (x@p1 == NULL) { ... kfree@p2(x); ... return ...; }

@unchanged exists@
position r.p1,r.p2;
expression e <= r.x,x,e1;
iterator I;
statement S;
@@

if (x@p1 == NULL) { ... when != I(x,...) S
                        when != e = e1
                        when != e += e1
                        when != e -= e1
                        when != ++e
                        when != --e
                        when != e++
                        when != e--
                        when != &e
   kfree@p2(x); ... return ...; }

@ok depends on unchanged exists@
position any r.p1;
position r.p2;
expression x;
@@

... when != true x@p1 == NULL
kfree@p2(x);

@depends on !ok && unchanged@
position r.p2;
expression x;
@@

*kfree@p2(x);
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 47ad3428a1086af425447f763705e06b16ae905d)

Change-Id: I9736fbae327b73ec991a905397bcd0127c482ed3
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33278
Reviewed-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: staging/gdm72xx: remove camel-case vars in gdm_qos
Macpaul Lin [Tue, 11 Sep 2012 07:55:31 +0000 (15:55 +0800)]
UPSTREAM: staging/gdm72xx: remove camel-case vars in gdm_qos

Remove camel-case variables in gdm_qos.h and gdm_qos.c

Signed-off-by: Macpaul Lin <macpaul@gmail.com>
Cc: Paul Stewart <pstew@chromium.org>
Cc: Ben Chan <benchan@chromium.org>
Cc: Sage Ahn <syahn@gctsemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 13b2663c95f6f30f835ef92ef51c9aff0b3f09d6)

Change-Id: I69de363ab13fc11a9c8cc707d354aebe3e58ba6c
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33277
Reviewed-by: Paul Stewart <pstew@chromium.org>
12 years agoUPSTREAM: slightly reduce lossage in gdm72xx
Al Viro [Sun, 22 Jul 2012 17:09:14 +0000 (21:09 +0400)]
UPSTREAM: slightly reduce lossage in gdm72xx

* filp_close() needs non-NULL second argument only if it'd been in descriptor
table
* opened files have non-NULL dentries, TYVM
* ... and those dentries are positive - it's kinda hard to open a file that
doesn't exist.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
(cherry picked from commit 09fada5b5f1f56502bb14f36a69a2c31cea262be)

Change-Id: I33defe5b2835430c81cfea9e5c8a3d53854cb8eb
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33276
Reviewed-by: Paul Stewart <pstew@chromium.org>
12 years agoMap standard F13 scancode 08/F0_08 to keycode 183 (KEY_F13)
agnescheng [Thu, 13 Sep 2012 07:31:36 +0000 (15:31 +0800)]
Map standard F13 scancode 08/F0_08 to keycode 183 (KEY_F13)

Map standard F13 scancode 08/F0_08 to keycode 183 (KEY_F13) to enable
screen lock using PS/2 ketboard on Butterfly.

Signed-off-by: agnescheng <agnescheng@chromium.org>
BUG=chrome-os-partner:13567
TEST=Test on butterfly. Press F13 on butterfly PS/2 keyboard to lock
screen.

Change-Id: Ice2c18bac5a1098d65a2c6fed8fc1f80ff141324
Reviewed-on: https://gerrit.chromium.org/gerrit/33186
Reviewed-by: Terry Lambert <tlambert@chromium.org>
Reviewed-by: Mark Hayter <mdhayter@chromium.org>
Commit-Ready: Agnes Cheng <agnescheng@google.com>
Tested-by: Agnes Cheng <agnescheng@google.com>
12 years agoCHROMIUM: dts: Add BUCK8 operating mode bindings
Abhilash Kesavan [Tue, 28 Aug 2012 15:57:33 +0000 (08:57 -0700)]
CHROMIUM: dts: Add BUCK8 operating mode bindings

BUCK8 can be turned off when the BUCK8EN bits of BUCK8CTRL register
are set to '01/10/00'. However, the register is set to '11' which
ignores the ENB8 signal. Set the operating mode for the BUCK to
obtain power savings by turning off the eMMC.

BUG=chrome-os-partner:12665
TEST=Verify BUCK8EN as "01". Mount, read and write the eMMC post resume.
Do a chromeos-install on the eMMC, boot from eMMC and check functioning
post resume. Suspend the system (rtcwake -m mem -s 25) and measure BUCK8
power. No significant change in power consumption.

Change-Id: I10768d46fd4fc6061e522fbcf570a5ddaa560114
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/31597
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Bryan Freed <bfreed@chromium.org>
12 years agoexynos/gsc: make m2m ctx null during resume
Prathyush K [Tue, 11 Sep 2012 17:55:17 +0000 (23:25 +0530)]
exynos/gsc: make m2m ctx null during resume

The gsc driver updates all its registers from the driver's internal context
whenever the m2m context is made NULL. Currently, this is happening
only if there is a job pending in resume. This should be done even if
there is no job pending during resume. This ensures that gsc runs
normally when there is a suspend to resume call during video playback.

BUG=chrome-os-partner:12326
TEST=suspend/resume during video playback on Snow. Video continues
playing normally after resume.

Change-Id: Ia353ff901081bdd9522d234a49363a3525cf308b
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/32917
Commit-Ready: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
Tested-by: Jon Kliegman <kliegs@chromium.org>
12 years agoARM: EXYNOS5: dts: Move mfc after sysmmu declarations
Jonathan Kliegman [Mon, 10 Sep 2012 21:23:18 +0000 (17:23 -0400)]
ARM: EXYNOS5: dts: Move mfc after sysmmu declarations

The mfc depends on sysmmu and gsc being restored so move it after them
in the exynos5250.dtsi file

BUG=chrome-os-partner:12326
TEST=suspend/resume with video playing, no panic.

Change-Id: I9220ca15b8598395dc7745b371ab04824bf878c7
Signed-off-by: Jonathan Kliegman <kliegs@chromium.org>
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/32802

12 years agoUPSTREAM: mwifiex: remove AMSDU_AGGR_CTRL command response handler
Bing Zhao [Wed, 12 Sep 2012 21:50:51 +0000 (14:50 -0700)]
UPSTREAM: mwifiex: remove AMSDU_AGGR_CTRL command response handler

HostCmd_CMD_AMSDU_AGGR_CTRL is never called with GET action.
So the code in mwifiex_ret_amsdu_aggr_ctrl() becomes redundant.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
BUG=chrome-os-partner:13998
TEST=Build and run autotest suites

Change-Id: I92dff9846c954405a80af275cdfbff50fda6496d
Reviewed-on: https://gerrit.chromium.org/gerrit/33147
Reviewed-by: Gary Morain <gmorain@chromium.org>
Tested-by: Bing Zhao <bzhao@marvell.com>
Commit-Ready: Bing Zhao <bzhao@marvell.com>

12 years agoUPSTREAM: mwifiex: remove 11N_CFG command response handler
Bing Zhao [Wed, 12 Sep 2012 21:49:11 +0000 (14:49 -0700)]
UPSTREAM: mwifiex: remove 11N_CFG command response handler

HostCmd_CMD_11N_CFG is never called with GET action. So the code in
mwifiex_ret_11n_cfg() becomes redundant.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
BUG=chrome-os-partner:13998
TEST=Build and run autotest suites

Change-Id: I83acad8fd48b2cee99260ad6cb4d94bf8e25f4fa
Reviewed-on: https://gerrit.chromium.org/gerrit/33146
Reviewed-by: Gary Morain <gmorain@chromium.org>
Tested-by: Bing Zhao <bzhao@marvell.com>
Commit-Ready: Bing Zhao <bzhao@marvell.com>

12 years agoUPSTREAM: mwifiex: remove get operation code for SUBSCRIBE EVENT command
Bing Zhao [Wed, 12 Sep 2012 21:46:05 +0000 (14:46 -0700)]
UPSTREAM: mwifiex: remove get operation code for SUBSCRIBE EVENT command

We don't send this command with GET action. Redundant code in
mwifiex_ret_subsc_evt() is removed in this patch.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
BUG=chrome-os-partner:13998
TEST=Build and run autotest suites

Change-Id: I426e20adf7c509b253386694e4ae90c4b052a682
Reviewed-on: https://gerrit.chromium.org/gerrit/33145
Reviewed-by: Gary Morain <gmorain@chromium.org>
Tested-by: Bing Zhao <bzhao@marvell.com>
Commit-Ready: Bing Zhao <bzhao@marvell.com>

12 years agos5p-mfc: Change scratch buffer size for VP8 decoder
Arun Kumar K [Tue, 11 Sep 2012 16:05:42 +0000 (21:35 +0530)]
s5p-mfc: Change scratch buffer size for VP8 decoder

Scratch buffer size of VP8 decoder is changed as per the
firmware v6.5. The earlier size was still using the v6.1
values.

BUG=none
TEST=Played VP8 test streams with secomx

Change-Id: Iefb71d0b520dc3922f1026ba795235b2961b8465
Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/32916
Commit-Ready: kiran <kiran@chromium.org>
Reviewed-by: kiran <kiran@chromium.org>
12 years agoiommu/exynos: change dev_err to dev_dbg when failed to add to genpd
Prathyush K [Tue, 11 Sep 2012 10:41:26 +0000 (16:11 +0530)]
iommu/exynos: change dev_err to dev_dbg when failed to add to genpd

A device is added to its genpd by finding the of node property
'samsung,pd'. If such a property is not found, then the device is not
added to any genpd which is currently the case with fimd, g2d, hdmi.
When this fails, we log the information using dev_err which is now
changed to dev_dbg.

These error messages should not appear during bootup.
[    0.101028] s5p-sysmmu s5p-sysmmu.2: failed to add to genpd
[    0.101119] s5p-sysmmu s5p-sysmmu.27: failed to add to genpd
[    0.101152] s5p-sysmmu s5p-sysmmu.28: failed to add to genpd

BUG=chrome-os-partner:13884
TEST=Booted on snow and the above error message do not appear.

Change-Id: I5f384a244aefaee07daf387269d9478c58128197
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/32908
Tested-by: Prathyush Kalashwaram <prathyush@chromium.org>
Reviewed-by: Bryan Freed <bfreed@chromium.org>
Reviewed-by: naveen krishna chatradhi <naveen@chromium.org>
Tested-by: naveen krishna chatradhi <naveen@chromium.org>
Commit-Ready: naveen krishna chatradhi <naveen@chromium.org>

12 years agoCHROMIUM: Input: atmel_mxt_ts - enable RPTEN if can wakeup from suspend
Yufeng Shen [Wed, 12 Sep 2012 16:42:16 +0000 (12:42 -0400)]
CHROMIUM: Input: atmel_mxt_ts - enable RPTEN if can wakeup from suspend

Currently when going into suspend and if wakeup is enabled,
the driver will check whether the T9_ctrl ENABLE bit is set and
if not, it will toggle the bit so that T9 object is enabled
to make wakeup possible during suspend.

With recent change to T9_ctrl's default value to be 0x81, it
is enabled (ENABLE bit set) but not reporting (RPTEN bit not
set) which prevents touches reported back during suspend.

To fix this, this patches adds checking that whether both ENABLE
and RPTEN bits are set, and if not, set both of them.

Signed-off-by: Yufeng Shen <miletus@chromium.org>
BUG=chrome-os-partner:9192
TEST=Use powerd_suspend to supend the device and then make sure
     touching the touch device wakes up the system.

Change-Id: I234531ae91627f7e1cccbef5810a18a5af6cbae9
Reviewed-on: https://gerrit.chromium.org/gerrit/33088
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Commit-Ready: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
12 years agoUPSTREAM: mwifiex: support custom world regulatory domain
Bing Zhao [Tue, 11 Sep 2012 02:06:49 +0000 (19:06 -0700)]
UPSTREAM: mwifiex: support custom world regulatory domain

country 00 (world regulatory domain) doesn't define channels
52 - 64 and 100 - 140. Add these channels to our custom world
regulatory domain.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
BUG=chrome-os-partner:12711
TEST=Enabled CONFIG_CFG80211_REG_DEBUG=y to confirm cfg80211 is
using our custom world regulatory domain as its default setting.
Also passed WiFiMatFunc.002Check11a test which checks channel 64.

Change-Id: I90069bff54cf63ee00bc5865269a0ebc7f66c7eb
Reviewed-on: https://gerrit.chromium.org/gerrit/33101
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Bing Zhao <bzhao@marvell.com>
Tested-by: Bing Zhao <bzhao@marvell.com>
12 years agoUPSTREAM: mwifiex: do not hint regulatory domain with f/w country code
Bing Zhao [Tue, 11 Sep 2012 01:52:20 +0000 (18:52 -0700)]
UPSTREAM: mwifiex: do not hint regulatory domain with f/w country code

We will use world regulatory domain (country 00) as default
when driver is loaded. Later after a successful association
cfg80211 will change the regulatory domain to a specific country
if the AP has advertised country IE.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
BUG=chrome-os-partner:12711
TEST=Checked dmesg to confirm that we do not hint cfg80211 with
US regulatory domain for SD8797 card with US region code 0x10.
Also checked that cfg80211 does use default world regulatory
domain while disconnected, and change to US regulatory domain
after associated to AP with US country IE in beacon/prob_resp.

Change-Id: Id82ec3df35f94985f0f8679e04f40749b4dd0164
Reviewed-on: https://gerrit.chromium.org/gerrit/33100
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Bing Zhao <bzhao@marvell.com>
Tested-by: Bing Zhao <bzhao@marvell.com>
12 years agoUPSTREAM: mwifiex: use country ie of requested AP while associating
Bing Zhao [Tue, 11 Sep 2012 01:33:27 +0000 (18:33 -0700)]
UPSTREAM: mwifiex: use country ie of requested AP while associating

AP's country ie is parsed and 11d information is updated in firmware
while associating. Previous mwifiex_send_domain_info_cmd_fw() call in
association path is not necessary now. Hence it is removed in this
patch.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
BUG=chrome-os-partner:12711
TEST=Enabled dynamic debug to dump the cmd 0x5b being sent to f/w
and verified the cmd body contains the country ie for the AP we are
associating.

Change-Id: Ia3d764433daf22bd8d3b90a3cfc49d2904189870
Reviewed-on: https://gerrit.chromium.org/gerrit/33099
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Reviewed-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Bing Zhao <bzhao@marvell.com>
Tested-by: Bing Zhao <bzhao@marvell.com>
12 years agodrm/i915: Expose adaptive backlight properties on LVDS connectors.
Stéphane Marchesin [Wed, 12 Sep 2012 17:36:32 +0000 (10:36 -0700)]
drm/i915: Expose adaptive backlight properties on LVDS connectors.

So far we only exposed it on eDP connectors. Let's also expose it on LVDS.

BUG=none
TEST=by hand, ran xrandr --verbose and checked the adaptive backlight
TEST=property is here

Change-Id: I70d836ff437ace10acf59c780aa5f06428ecef58
Reviewed-on: https://gerrit.chromium.org/gerrit/33098
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>

12 years agoCHROMIUM: ALSA: ASoC: max98095 0 Add built in EQ for 44.1k and 48k.
Dylan Reid [Tue, 7 Aug 2012 16:08:49 +0000 (09:08 -0700)]
CHROMIUM: ALSA: ASoC: max98095 0 Add built in EQ for 44.1k and 48k.

EQ setting supplied by Maxim after tuning a snow PVT device.
We need to move this to device tree eventually, but Samsung says it is
important for speaker protection to get it in right away.

BUG=chrome-os-partner:12039
TEST=listen to youtube with EQ enabled and disabled.

Change-Id: I269e70daa79c5c83834c801d3b0dd824da88607e
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33065

12 years agoCHROMIUM: iommu/exynos: Fix free now that we're using kmem_cache
Doug Anderson [Wed, 12 Sep 2012 17:18:11 +0000 (10:18 -0700)]
CHROMIUM: iommu/exynos: Fix free now that we're using kmem_cache

The previous CL ("CHROMIUM: iommu/exynos: Fix allocation to be safer
in terms of alignment") introduced a potential bug where kfree() was
being called still in one case.  It doesn't appear that we run this
codepath in normal usage (so we actually have a memory leak), but it's
good to fix just in case.

BUG=chrome-os-partner:13948
TEST=boot with slub debugging turn on; play youtube video

Change-Id: Ie9aff3e180c95c6f9f3643efe8f98cf5b5693320
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33094
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Pawel Osciak <posciak@google.com>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
12 years agoCHROMIUM: iommu/exynos: Fix allocation to be safer in terms of alignment
Sonny Rao [Wed, 12 Sep 2012 04:27:06 +0000 (21:27 -0700)]
CHROMIUM: iommu/exynos: Fix allocation to be safer in terms of alignment

The code was expecting kzalloc to align to the size of the allocation
even though that isn't guaranteed, and even had a BUG() to catch when it
happened.  This started triggering with SLUB debugging turned on.  Fix it
by using a slab which returns objects that are properly aligned.

BUG=chrome-os-partner:13948
TEST=boot with slub debugging turn on

Change-Id: Icdf9475233e8c80f090f624a4ca5497011d4aa33
Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33053
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Pawel Osciak <posciak@google.com>
Reviewed-by: Prathyush Kalashwaram <prathyush@chromium.org>
Commit-Ready: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
12 years agoUPSTREAM: kernel: panic: fix a possible deadlock in panic()
Vikram Mulukutla [Mon, 30 Jul 2012 21:39:58 +0000 (14:39 -0700)]
UPSTREAM: kernel: panic: fix a possible deadlock in panic()

panic_lock is meant to ensure that panic processing takes place only on
one cpu; if any of the other cpus encounter a panic, they will spin
waiting to be shut down.

However, this causes a regression in this scenario:

1. Cpu 0 encounters a panic and acquires the panic_lock
   and proceeds with the panic processing.
2. There is an interrupt on cpu 0 that also encounters
   an error condition and invokes panic.
3. This second invocation fails to acquire the panic_lock
   and enters the infinite while loop in panic_smp_self_stop.

Thus all panic processing is stopped, and the cpu is stuck for eternity
in the while(1) inside panic_smp_self_stop.

To address this, disable local interrupts with local_irq_disable before
acquiring the panic_lock.  This will prevent interrupt handlers from
executing during the panic processing, thus avoiding this particular
problem.

BUG=chrome-os-partner:13943
TEST=booted chrome and played back a Video file in the browser.

Change-Id: I156cd63ea18309ef59cbeb86f36282cbe79b4a4c
Signed-off-by: Vikas C Sajjan <vikas.sajjan@samsung.com>
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 190320c3b6640d4104650f55ff69611e050ea06b)
Reviewed-on: https://gerrit.chromium.org/gerrit/33067
Reviewed-by: Abhinav Kochhar <kochhar.abhinav@gmail.com>
Tested-by: Abhinav Kochhar <kochhar.abhinav@gmail.com>
Commit-Ready: Olof Johansson <olofj@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: mm: dma-mapping: fix compiler warning
Naveen Krishna Chatradhi [Tue, 11 Sep 2012 13:03:55 +0000 (18:33 +0530)]
CHROMIUM: mm: dma-mapping: fix compiler warning

Remove the following warning:
arch/arm/mm/dma-mapping.c: In function 'arm_dma_alloc':
arch/arm/mm/dma-mapping.c:582:122: warning: 'page' may be used uninitialized in this function [-Wmaybe-uninitialized]
arch/arm/mm/dma-mapping.c:542:15: note: 'page' was declared here

BUG=chromium-os:34287
TEST=emerge-daisy chromeos-kernel built without this warning.

Change-Id: I8469cef3d88adaf8262e2447c993748d708c7c34
Signed-off-by: Naveen Krishna Chatradhi <naveen@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32918
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Ready: Doug Anderson <dianders@chromium.org>

12 years agoCHROMIUM: Bluetooth: Add MD222 [0489:e04e], [04ca:700b]
Scott James Remnant [Tue, 11 Sep 2012 20:38:52 +0000 (13:38 -0700)]
CHROMIUM: Bluetooth: Add MD222 [0489:e04e], [04ca:700b]

BUG=none
TEST=hciconfig shows device and hcitool scan works

Change-Id: I3544f7bc2dd7809cc00fbcb6f260a46429da7620
Signed-off-by: Scott James Remnant <keybuk@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32968
Reviewed-by: Paul Stewart <pstew@chromium.org>
12 years agoARM: dma-mapping: Skip cache maint for invalid page
Hiroshi Doyu [Sun, 9 Sep 2012 14:27:20 +0000 (19:57 +0530)]
ARM: dma-mapping: Skip cache maint for invalid page

Skip cache maint for invalid page but warn it.

BUG=chrome-os-partner:13935
TEST=Play VIDEO on Snow

Change-Id: I4dfd4f7a7c5f5559a45d115b369c0b44ebdca5db
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32665
Reviewed-by: Pawel Osciak <posciak@google.com>
12 years agoUPSTREAM: ARM: dma-mapping: IOMMU allocates pages from atomic_pool with GFP_ATOMIC
Hiroshi Doyu [Tue, 28 Aug 2012 05:13:04 +0000 (08:13 +0300)]
UPSTREAM: ARM: dma-mapping: IOMMU allocates pages from atomic_pool with GFP_ATOMIC

Make use of the same atomic pool as DMA does, and skip a kernel page
mapping which can involve sleep'able operations at allocating a kernel
page table.

BUG=chrome-os-partner:13935
TEST=Booted

Change-Id: I9452deb7ad6c42d53d4db0656c74e8844e9ec092
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit 479ed93a4b98eef03fd8260f7ddc00019221c450)
Reviewed-on: https://gerrit.chromium.org/gerrit/32664
Reviewed-by: Pawel Osciak <posciak@google.com>
12 years agoUPSTREAM: ARM: dma-mapping: Introduce __atomic_get_pages() for __iommu_get_pages()
Hiroshi Doyu [Tue, 28 Aug 2012 05:13:03 +0000 (08:13 +0300)]
UPSTREAM: ARM: dma-mapping: Introduce __atomic_get_pages() for __iommu_get_pages()

Support atomic allocation in __iommu_get_pages().

BUG=chrome-os-partner:13935
TEST=Booted

Change-Id: I2da41ab739f69e2a563365b7035ff8060b648401
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
[moved __atomic_get_pages() under #ifdef CONFIG_ARM_DMA_USE_IOMMU
 to avoid unused fuction warning for no-IOMMU case]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit 665bad7bb911d392000fa69bc6b599c0df992504)
Reviewed-on: https://gerrit.chromium.org/gerrit/32663
Reviewed-by: Pawel Osciak <posciak@google.com>
12 years agoUPSTREAM: ARM: dma-mapping: Refactor out to introduce __in_atomic_pool
Hiroshi Doyu [Tue, 28 Aug 2012 05:13:02 +0000 (08:13 +0300)]
UPSTREAM: ARM: dma-mapping: Refactor out to introduce __in_atomic_pool

Check the given range("start", "size") is included in "atomic_pool" or not.

BUG=chrome-os-partner:13935
TEST=Booted

Change-Id: I03e461bf5a66656321813385333722ea4e30e25a
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit 21d0a75951ccf71f671eb24b61a8ad2b497be4b4)
Reviewed-on: https://gerrit.chromium.org/gerrit/32662
Reviewed-by: Pawel Osciak <posciak@google.com>
12 years agoUPSTREAM: ARM: dma-mapping: atomic_pool with struct page **pages
Hiroshi Doyu [Tue, 28 Aug 2012 05:13:01 +0000 (08:13 +0300)]
UPSTREAM: ARM: dma-mapping: atomic_pool with struct page **pages

struct page **pages is necessary to align with non atomic path in
__iommu_get_pages(). atomic_pool() has the intialized **pages instead
of just *page.

BUG=chrome-os-partner:13935
TEST=Play VIDEO on Snow

Change-Id: Ia68cf6fc4530ff5fb6cd4f2b345c9b707a38bf55
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit 6b3fe47264262fa082897ebe8ae01041eae65e14)
Reviewed-on: https://gerrit.chromium.org/gerrit/32661
Reviewed-by: Pawel Osciak <posciak@google.com>
12 years agoUPSTREAM: ARM: DMA-Mapping: print warning when atomic coherent allocation fails
Marek Szyprowski [Wed, 22 Aug 2012 12:50:42 +0000 (14:50 +0200)]
UPSTREAM: ARM: DMA-Mapping: print warning when atomic coherent allocation fails

Print a loud warning when system runs out of memory from atomic DMA
coherent pool to let users notice the potential problem.

BUG=chrome-os-partner:13935
TEST=Compiled and booted

Change-Id: I80a82589ecf3da7fa5d6b8aa96130cf41a5ba3ea
Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit fb71285f0c1633a85544784aae7577502274b77a)
Reviewed-on: https://gerrit.chromium.org/gerrit/32964
Reviewed-by: Pawel Osciak <posciak@google.com>
12 years agoUPSTREAM: ARM: dma-mapping: fix error path for memory allocation failure
Marek Szyprowski [Fri, 27 Jul 2012 15:12:50 +0000 (17:12 +0200)]
UPSTREAM: ARM: dma-mapping: fix error path for memory allocation failure

This patch fixes incorrect check in error path. When the allocation of
first page fails, the kernel ops appears due to accessing -1 element of
the pages array.

BUG=chrome-os-partner:13935
TEST=Booted

Change-Id: Ib59f0b01a3674b6b15c99785e66587cb09421f99
Reported-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit 9fa8af91f0679f2abbebe1382b937264f3a8b981)
Reviewed-on: https://gerrit.chromium.org/gerrit/32963
Reviewed-by: Pawel Osciak <posciak@google.com>
12 years agoUPSTREAM: ARM: dma-mapping: add more sanity checks in arm_dma_mmap()
Marek Szyprowski [Mon, 30 Jul 2012 07:35:26 +0000 (09:35 +0200)]
UPSTREAM: ARM: dma-mapping: add more sanity checks in arm_dma_mmap()

Add some sanity checks and forbid mmaping of buffers into vma areas larger
than allocated dma buffer.

BUG=chrome-os-partner:13935
TEST=Booted

Change-Id: Ie81e97810a105d271a6b386112e8ca5dc9176db4
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit 50262a4bf38dd70486e9fce2b8235d5ae3e0f627)
Reviewed-on: https://gerrit.chromium.org/gerrit/32962
Reviewed-by: Pawel Osciak <posciak@google.com>
12 years agoFIXUP: ARM: dma-mapping: remove custom consistent dma region
Doug Anderson [Tue, 11 Sep 2012 18:24:02 +0000 (11:24 -0700)]
FIXUP: ARM: dma-mapping: remove custom consistent dma region

This attempts to fix the above comment to match more closely
what landed upstream.  We originally had v3 of the patch but
it went up to v6.

There are still a few differences from upstream.  Most notably:
* I didn't take the VM_ARM_DMA_CONSISTENT stuff.  I wasn't sure
  how far reaching that was.
* We have a slightly different way for disabling CMA.  I didn't
  try to match upstream.

Note that part of the original patch moved to a separate
patch: "add more sanity checks in arm_dma_mmap()".  See the next
CL.

BUG=chrome-os-partner:13935
TEST=Bootup

Change-Id: I9a642884fbd3dcb17f68e687539a7772caf41f8c
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32961
Reviewed-by: Pawel Osciak <posciak@google.com>
12 years agoUPSTREAM: ARM: dma-mapping: modify condition check while freeing pages
Prathyush K [Mon, 16 Jul 2012 06:59:55 +0000 (08:59 +0200)]
UPSTREAM: ARM: dma-mapping: modify condition check while freeing pages

WARNING: at mm/vmalloc.c:1471 __iommu_free_buffer+0xcc/0xd0()
Trying to vfree() nonexistent vm area (ef095000)
Modules linked in:
[<c0015a18>] (unwind_backtrace+0x0/0xfc) from [<c0025a94>] (warn_slowpath_common+0x54/0x64)
[<c0025a94>] (warn_slowpath_common+0x54/0x64) from [<c0025b38>] (warn_slowpath_fmt+0x30/0x40)
[<c0025b38>] (warn_slowpath_fmt+0x30/0x40) from [<c0016de0>] (__iommu_free_buffer+0xcc/0xd0)
[<c0016de0>] (__iommu_free_buffer+0xcc/0xd0) from [<c0229a5c>] (exynos_drm_free_buf+0xe4/0x138)
[<c0229a5c>] (exynos_drm_free_buf+0xe4/0x138) from [<c022b358>] (exynos_drm_gem_destroy+0x80/0xfc)
[<c022b358>] (exynos_drm_gem_destroy+0x80/0xfc) from [<c0211230>] (drm_gem_object_free+0x28/0x34)
[<c0211230>] (drm_gem_object_free+0x28/0x34) from [<c0211bd0>] (drm_gem_object_release_handle+0xcc/0xd8)
[<c0211bd0>] (drm_gem_object_release_handle+0xcc/0xd8) from [<c01abe10>] (idr_for_each+0x74/0xb8)
[<c01abe10>] (idr_for_each+0x74/0xb8) from [<c02114e4>] (drm_gem_release+0x1c/0x30)
[<c02114e4>] (drm_gem_release+0x1c/0x30) from [<c0210ae8>] (drm_release+0x608/0x694)
[<c0210ae8>] (drm_release+0x608/0x694) from [<c00b75a0>] (fput+0xb8/0x228)
[<c00b75a0>] (fput+0xb8/0x228) from [<c00b40c4>] (filp_close+0x64/0x84)
[<c00b40c4>] (filp_close+0x64/0x84) from [<c0029d54>] (put_files_struct+0xe8/0x104)
[<c0029d54>] (put_files_struct+0xe8/0x104) from [<c002b930>] (do_exit+0x608/0x774)
[<c002b930>] (do_exit+0x608/0x774) from [<c002bae4>] (do_group_exit+0x48/0xb4)
[<c002bae4>] (do_group_exit+0x48/0xb4) from [<c002bb60>] (sys_exit_group+0x10/0x18)
[<c002bb60>] (sys_exit_group+0x10/0x18) from [<c000ee80>] (ret_fast_syscall+0x0/0x30)

This patch modifies the condition while freeing to match the condition
used while allocation. This fixes the above warning which arises when
array size is equal to PAGE_SIZE where allocation is done using kzalloc
but free is done using vfree.

BUG=chrome-os-partner:13935
TEST=Booted

Change-Id: I6541ff3e5269f373b4feadfcb616db91e4dc96c4
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit 46c87852e99cf8ce97e207b11cde19085837e39c)
Reviewed-on: https://gerrit.chromium.org/gerrit/32936
Reviewed-by: Pawel Osciak <posciak@google.com>
12 years agoBACKPORT: ASoC: samsung dma - Don't indicate support for pause/resume.
Dylan Reid [Sat, 1 Sep 2012 08:38:19 +0000 (01:38 -0700)]
BACKPORT: ASoC: samsung dma - Don't indicate support for pause/resume.

The pause and resume operations indicate that the stream can be
un-paused/resumed from the exact location they were paused/suspended.
This is not true for this driver, the pause and suspend triggers share
the same code path with stop, they flush all pending DMA transfers.
This drops all pending samples.  The pause_release/resume triggers are
the same as start, except that prepare won't be called beforehand,
nothing will be enqueued to the DMA engine and nothing will happen (no
audio).  Removing the pause flag will let apps know that it isn't
supported.  Removing the resume flag will cause user space to call
prepare and start instead of resume, so audio will continue playing when
the system wakes up.

Before removing the pause and resume flags, I tested this on an exynos
5250, using 'aplay -i'. Pause/un-pause leads to silence followed by a
write error.  Suspend/resume testing led to the same result.  Removing
the two flags fixes suspend/resume (since snd_pcm_prepare is called
again). And leads to a proper reporting of pause not supported.

BUG=chrome-os-partner:12258
TEST=suspend/resume while playing youtube.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
(cherry picked from commit 57b2d68863f281737d8596cb3d76d89d9cc54fd8)

Change-Id: I224deb6445be3464c064edd4e91641b6cd187b83
Reviewed-on: https://gerrit.chromium.org/gerrit/32866
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Ready: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
12 years agoCHROMIUM: trace: remove warning
Olof Johansson [Mon, 10 Sep 2012 16:51:42 +0000 (09:51 -0700)]
CHROMIUM: trace: remove warning

fs/exec.c:790:2: warning: passing argument 1 of ‘trace_open_exec’ discards ‘const’ qualifier from pointer target type [enabled by default]

BUG=chromium-os:34287
TEST=build, make sure warning is gone

Change-Id: Ia81f05aa28bb28327e3be7b438df281a0166bcb8
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32829
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
12 years agoCHROMIUM: dm: verity: fix warnings
Olof Johansson [Mon, 10 Sep 2012 16:45:06 +0000 (09:45 -0700)]
CHROMIUM: dm: verity: fix warnings

Fixes:

drivers/md/dm-verity.c:109:1: warning: return from incompatible pointer type [enabled by default]
drivers/md/dm-verity.c:81:1: warning: return from incompatible pointer type [enabled by default]
drivers/md/dm-verity.c:85:1: warning: return from incompatible pointer type [enabled by default]

BUG=chromium-os:34287
TEST=build, check lack of warnings.

Change-Id: Iaff319f774a152e179836cb765ce951d97dbca9f
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32828
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
12 years agoRevert "CHROMIUM: config: enable RCU_FAST_NO_HZ"
Stéphane Marchesin [Tue, 11 Sep 2012 02:15:52 +0000 (19:15 -0700)]
Revert "CHROMIUM: config: enable RCU_FAST_NO_HZ"

This reverts commit add52cca2810b40fd13495ad8c091b96135982f7
This commit breaks the interrupts for i915 on boot sometimes.
i915 needs interrupts to work to operate properly, so let's revert to
unbreak the miscellaneous canaries.

The symptoms are similar to what's described in the following thread:
http://comments.gmane.org/gmane.linux.kernel/1270773

BUG=chromium:145312,chrome-os-partner:13617
TEST=by hand: the interrupts work again and graphics isn't stuck on boot.

Change-Id: I0d3f550dc374ca0c81ddee9ba7d0e2793b318e31
Reviewed-on: https://gerrit.chromium.org/gerrit/32887
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
12 years agoCHROMIUM: drm: exynos: fix compiler warning
Olof Johansson [Mon, 10 Sep 2012 23:29:35 +0000 (16:29 -0700)]
CHROMIUM: drm: exynos: fix compiler warning

drivers/gpu/drm/exynos/exynos_drm_fb.c:94:16: warning: assignment makes integer from pointer without a cast [enabled by default]

BUG=chromium-os:34287
TEST=none

Change-Id: I9d4f22e683316cecdd49a245e1ba08a87e2f57d9
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32840
Reviewed-by: Anush Elangovan <anush@chromium.org>
12 years agoCHROMIUM: ARM: exynos: pm: add one __maybe_unused annotation
Olof Johansson [Mon, 10 Sep 2012 23:16:36 +0000 (16:16 -0700)]
CHROMIUM: ARM: exynos: pm: add one __maybe_unused annotation

It's hard to tell from the code flow (which is nasty in the first place) if the function will or will not be used, so
just mark it __maybe_unused for now.

Resolves:

arch/arm/mach-exynos/pm_domains.c:138:20: warning: 'exynos_pm_add_dev_to_genpd' defined but not used [-Wunused-function]

BUG=chromium-os:34287
TEST=none

Change-Id: Ieb8290edf595e33885b89eca29c83b460613a702
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32837
Reviewed-by: Doug Anderson <dianders@chromium.org>
12 years agoCHROMIUM: thermal: fix unused variable warning
Olof Johansson [Mon, 10 Sep 2012 16:56:06 +0000 (09:56 -0700)]
CHROMIUM: thermal: fix unused variable warning

drivers/thermal/thermal_sys.c:65:21: warning: ‘thermal_event_seqnum’ defined but not used [-Wunused-variable]

BUG=chromium-os:34287
TEST=none

Change-Id: Ie7610886e5235d80330848593d6e7e40db900128
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32831
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
12 years agoCHROMIUM: ARM: exynos: ifdef out some unused variables
Olof Johansson [Mon, 10 Sep 2012 23:19:31 +0000 (16:19 -0700)]
CHROMIUM: ARM: exynos: ifdef out some unused variables

arch/arm/mach-exynos/mach-exynos5-dt.c:107:29: warning: 'smdk5250_fb_win1' defined but not used [-Wunused-variable]
arch/arm/mach-exynos/mach-exynos5-dt.c:126:29: warning: 'smdk5250_fb_win2' defined but not used [-Wunused-variable]
arch/arm/mach-exynos/mach-exynos5-dt.c:88:29: warning: 'smdk5250_fb_win0' defined but not used [-Wunused-variable]

BUG=chromium-os:34287
TEST=none

Change-Id: I6f1d030c87b18abccad796794ea40bf245d643cf
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32838
Reviewed-by: Doug Anderson <dianders@chromium.org>
12 years agoCHROMIUM: libata: remove warning
Olof Johansson [Mon, 10 Sep 2012 17:10:30 +0000 (10:10 -0700)]
CHROMIUM: libata: remove warning

drivers/ata/libata-core.c:5376:2: warning: assignment from incompatible pointer type [enabled by default]
drivers/ata/libata-core.c:5577:2: warning: assignment from incompatible pointer type [enabled by default]

BUG=chromium-os:34287
TEST=none

Change-Id: Ic0af73ba8fbc4aefb5895d00ec0bc853fcbec192
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32834
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
12 years agodrm/exynos: Implements proper disable of LCD clock
Akshu Agrawal [Sat, 1 Sep 2012 01:40:35 +0000 (18:40 -0700)]
drm/exynos: Implements proper disable of LCD clock

Since fimd_power_on is called twice at bootup, fimd clock was
getting enabled twice and increasing its refcount to 2.
During the disable since the count was not equal to zero lcd clk
was not getting disabled.

BUG=chromeos-partner:13349
TEST= Tested display going off, poweroff command when display off.
Tested suspend/resume in display on and off state

Change-Id: Ifd49f25c8beecd78d35c009f2caceec50d8129c8
Signed-off-by: Akshu Agrawal <akshu.a@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/32083
Commit-Ready: Akshu Agrawal <akshu@chromium.org>
Reviewed-by: Akshu Agrawal <akshu@chromium.org>
Tested-by: Akshu Agrawal <akshu@chromium.org>
12 years agoCHROMIUM: drm: remove warning
Olof Johansson [Mon, 10 Sep 2012 17:09:05 +0000 (10:09 -0700)]
CHROMIUM: drm: remove warning

drivers/gpu/drm/drm_edid.c:1460:39: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]

BUG=chromium-os:34287
TEST=none

Change-Id: I0817b80bd22c126456e74343c9b8ef67fa3d1830
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32833
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
12 years agoCHROMIUM: drm: constify drm_mode_equal args
Olof Johansson [Mon, 10 Sep 2012 17:16:09 +0000 (10:16 -0700)]
CHROMIUM: drm: constify drm_mode_equal args

Resolves:

drivers/gpu/drm/drm_edid.c:1462:3: warning: passing argument 2 of ‘drm_mode_equal’ discards ‘const’ qualifier from pointer target type [enabled by default]

BUG=chromium-os:34287
TEST=none

Change-Id: I1f4041b85bb3f2c40fd5654350e3a25423f9b8a1
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32835
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
12 years agoCHROMIUM: power: tps65090: remove warning
Olof Johansson [Mon, 10 Sep 2012 22:49:28 +0000 (15:49 -0700)]
CHROMIUM: power: tps65090: remove warning

drivers/power/tps65090-charger.c:98:6: warning: unused variable 'irq' [-Wunused-variable]

BUG=chromium-os:34287
TEST=none

Change-Id: Ib4942a0f65b7f5a476686a53149007126140d253
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32836
Reviewed-by: Simon Que <sque@chromium.org>
12 years agoCHROMIUM: net: r8169: remove warning
Olof Johansson [Mon, 10 Sep 2012 17:06:10 +0000 (10:06 -0700)]
CHROMIUM: net: r8169: remove warning

drivers/net/ethernet/realtek/r8169.c:761:1: warning: return from incompatible pointer type [enabled by default]

BUG=chromium-os:34287
TEST=none

Change-Id: I3f58003a83739abebf5108eca4ca539dda186d1c
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32832
Reviewed-by: Todd Broch <tbroch@chromium.org>
12 years agoCHROMIUM: sd: Fix warning
Olof Johansson [Mon, 10 Sep 2012 16:54:38 +0000 (09:54 -0700)]
CHROMIUM: sd: Fix warning

drivers/scsi/sd.c:2676:2: warning: assignment from incompatible pointer type [enabled by default]
drivers/scsi/sd.c:2913:2: warning: assignment from incompatible pointer type [enabled by default]

Since there's no way to return an error, do a WARN_ON() in the error
case instead.

BUG=chromium-os:34287
TEST=none (we need an automated test for error injection here)

Change-Id: Idaf0c0184e81ef7bac63b1deeda1a7690aa48a42
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32830
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
12 years agoCHROMIUM: sbs-battery: Fixed wrong dev_err() call
Doug Anderson [Mon, 10 Sep 2012 19:04:11 +0000 (12:04 -0700)]
CHROMIUM: sbs-battery: Fixed wrong dev_err() call

The dev_err() call was missing the dev and so would crash
whenever it was called.

BUG=chrome-os-partner:13857
TEST=Hack the "if" statement to always hit and rebuild kernel.
See the error printed properly.

Change-Id: Ic2f33e8db3259847d120558542c1d47d8ff4c09c
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32775
Reviewed-by: Rong Chang <rongchang@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
12 years agoCHROMIUM: config: Renormalize splitconfig
Doug Anderson [Mon, 10 Sep 2012 17:25:40 +0000 (10:25 -0700)]
CHROMIUM: config: Renormalize splitconfig

Just ran: ./chromeos/scripts/kernelconfig oldconfig
...and hit return for everything.  AKA: no functional change
here, this just tells us where we are.

BUG=None
TEST=Compiled and booted on one device.

Change-Id: I2221089cff75ea89150fa6981a7f5f97c5109eb6
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32765
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
12 years agoexynos5: usb: Fix EXYNOS5_USB_CFG to use SYSREG bank
Jonathan Kliegman [Mon, 10 Sep 2012 18:55:28 +0000 (14:55 -0400)]
exynos5: usb: Fix EXYNOS5_USB_CFG to use SYSREG bank

The EXYNOS5_USB_CFG register is in the SYSREG bank of register.
Fix the define to point to that and move it into the setup-usb-phy.c
file next to the EXYNOS4_USB_CFG register

BUG=chrome-os-partner:13859
TEST=Changed dev_dbg to dev_info and validated correct output
  Checked values of SYSREG(0x230) and PMUREG(0x230) and confirmed
  correct settings on boot.
Signed-off-by: Jonathan Kliegman <kliegs@chromium.org>
Change-Id: I4d643ca982e3b92ed114d4651db9f98e7af7be0f
Reviewed-on: https://gerrit.chromium.org/gerrit/32773
Tested-by: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Ready: Jon Kliegman <kliegs@chromium.org>

12 years agodrm/exynos: fimd: Disable all windows on power off
Sean Paul [Fri, 7 Sep 2012 18:14:51 +0000 (11:14 -0700)]
drm/exynos: fimd: Disable all windows on power off

Make sure we disable all windows when we power off. We were seeing
crashes on HDMI hotplug, this occurred because we DPMS off on hotplug,
then resize the scanout buffer. This resize deletes the old buffer,
which calls fimd_win_disable. This function returns early and the window
is never disabled. Then when we try to delete the buffer, we get a crash
in iommu, presumably because the buffer is still being used by the
enabled window.

BUG=chrome-os-partner:13349
TEST=Tested boot with hdmi and hotplug

Change-Id: I134d510ae4abc5604606f565ce7d631d96918477
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32568
Tested-by: Shirish S <shirish@chromium.org>
12 years agodrm/exynos: fimd: Fix compilation warning
Sean Paul [Fri, 7 Sep 2012 18:51:46 +0000 (11:51 -0700)]
drm/exynos: fimd: Fix compilation warning

This patch fixes a compilation warning (and possibly) use uninitialized
in fimd_display_power_on by returning early if we received an invalid
DPMS mode value.

BUG=chrome-os-partner:13349
TEST=Tested on snow

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

12 years agoCHROMIUM: dm: bootcache Device mapper for bootcache
Paul Taysom [Thu, 6 Sep 2012 20:41:20 +0000 (13:41 -0700)]
CHROMIUM: dm: bootcache Device mapper for bootcache

Missed the last set of changes in prevous delivery.
Changes from waitq to competion.

BUG=chromium-os:25441
TEST=boot the system with bootcache enabled

Change-Id: I452f8315f3e8544df72e7b202c2e365e39834a4b
Signed-off-by: Paul Taysom <taysom@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32427
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
12 years agoARM: SAMSUNG: use spin_lock_irqsave() in clk_set_rate
Prathyush K [Mon, 3 Sep 2012 13:52:26 +0000 (19:22 +0530)]
ARM: SAMSUNG: use spin_lock_irqsave() in clk_set_rate

The clk_set_rate function has been modified to save and restore
IRQs during spin lock/unlock.

BUG=chrome-os-partner:13840
TEST=Booted kernel and ran video overnight.

Change-Id: I5c746303e141b8fc5e2ce1c0cb9943d5c8c6cd6d
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/32650
Tested-by: Prathyush Kalashwaram <prathyush@chromium.org>
Reviewed-by: Prashanth Godrehal <prashanth.g@samsung.com>
Reviewed-by: Abhinav Kochhar <kochhar.abhinav@gmail.com>
Tested-by: Abhinav Kochhar <kochhar.abhinav@gmail.com>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Doug Anderson <dianders@chromium.org>

12 years agoRevert "UPSTREAM: dma: pl330: assign a new cookie when restarting tx descriptors...
Padmavathi Venna [Fri, 7 Sep 2012 09:04:53 +0000 (14:34 +0530)]
Revert "UPSTREAM: dma: pl330: assign a new cookie when restarting tx descriptors in cyclic mode"

This reverts commit d49ef2b0f56719541fa06135379e8490e8544d41.

As Vinod Koul has suggested a better way to handle, this patch is not
required now and his patch already got merged in the mainline and gerrit.

chrome-os-partner:12565
TEST=built for emerge-daisy chromeos-kernel and booted on one board.

Change-Id: I1cea5efd08e29ed3ebea898595a5227bd925f748
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/32505
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Doug Anderson <dianders@chromium.org>

12 years agoarm: exynos: add busfreq trace events
Sam Leffler [Fri, 7 Sep 2012 17:35:36 +0000 (10:35 -0700)]
arm: exynos: add busfreq trace events

Add exynos_busfreq_target_{mif,int} events to monitor operation
and remove printk that is now duplicate information.

Signed-off-by: Sam Leffler <sleffler@chromium.org>
BUG=chrome-os-partner:13801
TEST=monitor evevents while playing video

Change-Id: I0e82ad4afb72e6b4664dbd95d206186864a9266e
Reviewed-on: https://gerrit.chromium.org/gerrit/32560
Reviewed-by: Bryan Freed <bfreed@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
12 years agoCHROMIUM: iio: isl29018: Support fractional ALS scaling.
Bryan Freed [Wed, 29 Aug 2012 04:10:25 +0000 (21:10 -0700)]
CHROMIUM: iio: isl29018: Support fractional ALS scaling.

The Industrial IO framework supports scaling ADC values by fractions,
but most drivers default to using whole numbers.
This change turns on fractional scaling in the isl29018 driver.

BUG=chrome-os-partner:11948
TEST='echo 1.5 > in_illuminance_calibscale', and verify it has the
     expected effect on in_illuminance0_input.

Change-Id: Ie8e2e55a2a2fe008de513abd955615f5d16204ce
Signed-off-by: Bryan Freed <bfreed@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31683
Reviewed-by: Grant Grundler <grundler@chromium.org>
12 years agoCHROMIUM: mac80211: prevent work queueing while quiescing on suspend
Felix Fietkau [Fri, 7 Sep 2012 13:33:12 +0000 (15:33 +0200)]
CHROMIUM: mac80211: prevent work queueing while quiescing on suspend

Do not emit a warning in that case, since there is nothing else in mac80211
that would effectively prevent more work from being queued.

BUG=chrome-os-partner:10785
TEST=per crosbug.com/p/10785#c54

Change-Id: Ic14aee400184772cbe19af65f01de11f683559fe
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: mukesh agrawal <quiche@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32602

12 years agoCHROMIUM: ath9k: improve resume reliability
Felix Fietkau [Fri, 7 Sep 2012 09:53:32 +0000 (11:53 +0200)]
CHROMIUM: ath9k: improve resume reliability

Ensure that drv_start() always returns true, as a failing hw start usually
eventually leads to crashes when there's still a station entry present.
Call a power-on reset after resume and also if a hw reset fails, this should
bring the hardware back to life again.

BUG=chrome-os-partner:10785
TEST=per crosbug.com/p/10785#c54

Change-Id: Ib397e9b06f60f5de9bf1611f9c414f823e1770ff
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: mukesh agrawal <quiche@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32599

12 years agoCHROMIUM: ath9k: Change rateset calculation
Sujith Manoharan [Fri, 7 Sep 2012 18:20:50 +0000 (23:50 +0530)]
CHROMIUM: ath9k: Change rateset calculation

Commit "ath9k: Change rate control to use legacy rate as last MRR"
resulted in the mixing of HT/legacy rates in a single rateset,
which is undesirable. Revert this behavior.

BUG=chrome-os-partner:12560
TEST=compile

Change-Id: I37a718181269181d78ac1a11f91e4971acd96920
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: mukesh agrawal <quiche@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32623

12 years agoCHROMIUM: ath9k: Fix RTS/CTS rate selection
Sujith Manoharan [Fri, 10 Aug 2012 11:16:57 +0000 (16:46 +0530)]
CHROMIUM: ath9k: Fix RTS/CTS rate selection

The current method of assigning the RTS/CTS rate is completely
broken for HT mode and breaks P2P operation. Fix this by using
the basic_rates provided to the driver by mac80211. For now,
choose the lowest supported basic rate for HT frames.

BUG=chrome-os-partner:12560
TEST=compile

Change-Id: I3ced4be51bec5b3f495df4cac1a6048b03e136f4
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: mukesh agrawal <quiche@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32622

12 years agoCHROMIUM: ath9k: Fix a crash in 2 WIRE btcoex chipsets
Mohammed Shafi Shajakhan [Tue, 28 Aug 2012 06:44:48 +0000 (12:14 +0530)]
CHROMIUM: ath9k: Fix a crash in 2 WIRE btcoex chipsets

Generic timers for BTCOEX functionality is applicable
only for 3 WIRE BTCOEX (and MCI) chipsets.
Hence btcoex->no_stomp_timer is allocated only 3 WIRE
btcoex chipsets and in all the other cases its NULL.
Make sure we stop the generic timer only if
'btcoex->hw_timer_enabled' is true(only if its up and
running)

Fixes the following crash

[68757.020454] BUG: unable to handle kernel NULL pointer dereference at 0000000c
[68757.020916] IP: [<f9b055c3>] ath9k_hw_gen_timer_stop+0x13/0x80 [ath9k_hw]
[68757.021251] *pde = 00000000
[68757.024384] EIP: 0060:[<f9b055c3>] EFLAGS: 00010082 CPU: 0
[68757.024384] EIP is at ath9k_hw_gen_timer_stop+0x13/0x80 [ath9k_hw]
[68757.024384] EAX: d32d0000 EBX: d32d0000 ECX: 00000000 EDX: 00000000
[68757.024384] ESI: e67c24c0 EDI: 00000296 EBP: e137be2c ESP: e137be20
[68757.024384]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[68757.024384] CR0: 8005003b CR2: 0000000c CR3: 00b99000 CR4: 000407d0
[68757.024384] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[68757.024384] DR6: ffff0ff0 DR7: 00000400
[68757.024384] Process kworker/u:2 (pid: 8917, ti=e137a000 task=ea7a6860 task.ti=e137a000)
[68757.024384] Stack:
[68757.024384]  c06c4676 d32d0000 e67c24c0 e137be38 f81c9590 e67c1ca0 e137be40 f81c95d9
[68757.024384]  e137be64 f81cd1c5 00000246 00000002 d32d0000 e67c05e0 e67c1ca0 e67c05e0
[68757.024384]  00000000 e137beac f81cdfa0 e137be84 00000246 00000246 e67c1ca0 e67c1ca0
[68757.024384] Call Trace:
[68757.024384]  [<c06c4676>] ? _raw_spin_lock_irqsave+0x86/0xa0
[68757.024384]  [<f81c9590>] ath9k_gen_timer_stop+0x10/0x40 [ath9k]
[68757.024384]  [<f81c95d9>] ath9k_btcoex_stop_gen_timer+0x19/0x20 [ath9k]
[68757.024384]  [<f81cd1c5>] ath9k_ps_restore+0x85/0x110 [ath9k]
[68757.024384]  [<f81cdfa0>] ath9k_config+0x220/0x520 [ath9k]
[68757.024384]  [<f81cd47d>] ? ath9k_flush+0x15d/0x1b0 [ath9k]
[68757.024384]  [<f85c7ca5>] ieee80211_hw_config+0x135/0x2c0 [mac80211]
[68757.024384]  [<f860e3c8>] ieee80211_dynamic_ps_enable_work+0x198/0x5f0 [mac80211]

BUG=chrome-os-partner:12560
TEST=compile

Change-Id: Id28cc37261ad7b29564f8a54dfc79284bde6bbad
Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Cc: Bala Shanmugam <bkamatch@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: mukesh agrawal <quiche@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32621

12 years agoCHROMIUM: ath9k_hw: Wait BT calibration to complete
Rajkumar Manoharan [Fri, 7 Sep 2012 18:07:35 +0000 (23:37 +0530)]
CHROMIUM: ath9k_hw: Wait BT calibration to complete

Whenever BT calibration requested, WLAN has to wait for the
calibration to be completed. Bt right now we defer the waiting
which is causing BT calibration failure. Fix that.

BUG=chrome-os-partner:12560
TEST=compile

Change-Id: I344d301c87e080d9d6efa079688b370b78b7eb22
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: mukesh agrawal <quiche@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32620

12 years agoCHROMIUM: ath9k: fix interrupt storms on queued hardware reset
Felix Fietkau [Fri, 7 Sep 2012 17:55:24 +0000 (23:25 +0530)]
CHROMIUM: ath9k: fix interrupt storms on queued hardware reset

commit b74713d04effbacd3d126ce94cec18742187b6ce
"ath9k: Handle fatal interrupts properly" introduced a race condition,
where
IRQs are being left enabled, however the irq handler returns IRQ_HANDLED
while the reset is still queued without addressing the IRQ cause.
This leads to an IRQ storm that prevents the system from even getting to
the reset code.

Fix this by disabling IRQs in the handler without touching intr_ref_cnt.

BUG=chrome-os-partner:12560
TEST=compile

Change-Id: I10a6c530dc3dbda66ed5f54e09251f6f109d43c2
Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Cc: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: mukesh agrawal <quiche@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32619

12 years agoCHROMIUM: ath9k: Fix race in reset-work usage
Rajkumar Manoharan [Fri, 7 Sep 2012 17:47:56 +0000 (23:17 +0530)]
CHROMIUM: ath9k: Fix race in reset-work usage

Using work_pending() to defer certain operations when
a HW-reset work has been queued is racy since the check
would return false when the work item is actually in
execution. Use SC_OP_HW_RESET instead to fix this race.
Also, unify the reset debug statistics maintenance.

BUG=chrome-os-partner:12560
TEST=compile

Change-Id: Ia6240350542831d796c0374ac7eff71c96ec2a06
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: mukesh agrawal <quiche@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32618

12 years agoCHROMIUM: ath9k: Fix powersave locking
Sujith Manoharan [Fri, 7 Sep 2012 17:01:39 +0000 (22:31 +0530)]
CHROMIUM: ath9k: Fix powersave locking

The 'ps_flags' is used/accessed in a variety of contexts
and requires proper locking. Use 'sc_pm_lock' appropriately.

BUG=chrome-os-partner:12560
TEST=compile

Change-Id: Ib3cf758dbd5518d60355069d6cd0be19d91dfee0
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: mukesh agrawal <quiche@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32617

12 years agoCHROMIUM: ath9k: Fix work handling
Sujith Manoharan [Fri, 7 Sep 2012 16:51:47 +0000 (22:21 +0530)]
CHROMIUM: ath9k: Fix work handling

* Currently, there is no synchronization between the reset
  work and the tx-poll work. Fix this and make sure that we
  bail out properly if a reset work is in progress.

BUG=chrome-os-partner:12560
TEST=compile

Change-Id: I4b1ca09bc9e6970c4e072e706f052245b60072c9
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: mukesh agrawal <quiche@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32616

12 years agoCHROMIUM: ath9k: Prune ath9k_init_device
Sujith Manoharan [Fri, 7 Sep 2012 16:25:26 +0000 (21:55 +0530)]
CHROMIUM: ath9k: Prune ath9k_init_device

Instead of cluttering ath9k_init_device() with 'ath_softc'
specific initialization code, use ath9k_init_softc() to
setup driver-specific work routines, timers etc.

BUG=chrome-os-partner:12560
TEST=compile

Change-Id: I090c6bbaf2546e109af03c048e947fce25ca0c43
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: mukesh agrawal <quiche@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32615

12 years agoCHROMIUM: ath9k_hw: Read and configure thermocal for AR9462
Rajkumar Manoharan [Fri, 7 Sep 2012 05:08:43 +0000 (10:38 +0530)]
CHROMIUM: ath9k_hw: Read and configure thermocal for AR9462

Read and configure thermometer calibration results read from
OTP card.

BUG=chrome-os-partner:12560
TEST=compile

Change-Id: Ie908981882c62a778fe88b78212a87bc77755810
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: mukesh agrawal <quiche@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32614

12 years agoCHROMIUM: ath9k_hw: Read and apply thermometer settings from EEPROM
Rajkumar Manoharan [Fri, 7 Sep 2012 05:07:25 +0000 (10:37 +0530)]
CHROMIUM: ath9k_hw: Read and apply thermometer settings from EEPROM

BUG=chrome-os-partner:12560
TEST=compile

Change-Id: Ic7b2b8f52cd6fb5dc2de17dad874c73afd61af90
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: mukesh agrawal <quiche@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32613