0xlab-kernel:kernel.git
6 years agoOMAPFB: Reset framebuffer after resume
Kan-Ru Chen [Tue, 7 Jun 2011 03:21:14 +0000 (11:21 +0800)]
OMAPFB: Reset framebuffer after resume

6 years agoAdd TOI defconfig for omap3
Kan-Ru Chen [Wed, 1 Jun 2011 11:56:08 +0000 (19:56 +0800)]
Add TOI defconfig for omap3

6 years agoTOI: an option to exclude kernel text and rodata
Yoshiya Hirase [Tue, 26 Apr 2011 00:50:01 +0000 (17:50 -0700)]
TOI: an option to exclude kernel text and rodata

6 years agoARM: enable TOI for ARM.
Matt Hsu [Tue, 15 Mar 2011 08:22:35 +0000 (16:22 +0800)]
ARM: enable TOI for ARM.

Signed-off-by: Matt Hsu <matt@0xlab.org>
Conflicts:

kernel/power/power.h

6 years agoTOI: Apply tuxonice-3.2-for-2.6.38 3/3 (resolve conflicts)
Kan-Ru Chen [Wed, 1 Jun 2011 09:38:49 +0000 (17:38 +0800)]
TOI: Apply tuxonice-3.2-for-2.6.38 3/3 (resolve conflicts)

6 years agoTOI: Apply tuxonice-3.2-for-2.6.38 2/3 (modification)
Kan-Ru Chen [Wed, 1 Jun 2011 09:30:50 +0000 (17:30 +0800)]
TOI: Apply tuxonice-3.2-for-2.6.38 2/3 (modification)

6 years agoTOI: Apply tuxonice-3.2-for-2.6.38 1/3 (addition)
Kan-Ru Chen [Wed, 1 Jun 2011 09:28:42 +0000 (17:28 +0800)]
TOI: Apply tuxonice-3.2-for-2.6.38 1/3 (addition)

6 years agoARM: Add initial hibernation support
Hiroshi DOYU [Wed, 30 Jun 2010 14:28:01 +0000 (14:28 +0000)]
ARM: Add initial hibernation support

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original
patch(*1) was sent to LOML by Teerth Reddy <teerth@ti.com>

*1: https://patchwork.kernel.org/patch/96442/

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
6 years agoFixup android_omap4_defconfig
John Stultz [Wed, 25 May 2011 04:02:21 +0000 (21:02 -0700)]
Fixup android_omap4_defconfig

With the previously reverted change, fix the android_omap4_defconfig
to disable clock resetting and the other hdmi output option.

Signed-off-by: John Stultz <john.stultz@linaro.org>
6 years agoRevert change that broke beagleboard HDMI output
John Stultz [Wed, 25 May 2011 03:43:14 +0000 (20:43 -0700)]
Revert change that broke beagleboard HDMI output

This commit reverts 2967f8fa3c6349fbe9f6f3e79614689c854ba577
which disabled HDMI output on beagle when not using the
DRM based omap_gpu driver.

At the moment, Android has issues with the omap_gpu fb driver
not playing well with the pageflipping requirements. So
reverting this allows Android to use the older omapfb driver.

Signed-off-by: John Stultz <john.stultz@linaro.org>
6 years agoMerge branch 'upstream/linaro.38' into linaro-android.38-test
John Stultz [Fri, 20 May 2011 22:29:44 +0000 (15:29 -0700)]
Merge branch 'upstream/linaro.38' into linaro-android.38-test

6 years agoRevert OMAP4 HDMI patch
John Stultz [Fri, 20 May 2011 22:27:13 +0000 (15:27 -0700)]
Revert OMAP4 HDMI patch

This commit reverts 18e82d2b952ab57fc1c8a69d4fa14e562f2aecf6
because it collides with the reworked HDMI support has landed in
Nico's tree.

Signed-off-by: John Stultz <john.stultz@linaro.org>
6 years agoarm: Add unwinding support for division functions
Laura Abbott [Wed, 18 May 2011 17:33:26 +0000 (10:33 -0700)]
arm: Add unwinding support for division functions

The software division functions never had unwinding annotations
added. Currently, when a division by zero occurs the backtrace shown
will stop at Ldiv0 or some completely unrelated function. Add
unwinding annotations in hopes of getting a more useful backtrace
when a division by zero occurs.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Tested-by: Dave Martin <dave.martin@linaro.org>
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
6 years agoARM: sparsemem: fix highmem detection when using SPARSEMEM
Will Deacon [Wed, 18 May 2011 16:05:11 +0000 (17:05 +0100)]
ARM: sparsemem: fix highmem detection when using SPARSEMEM

sanity_check_meminfo walks over the registered memory banks and attempts
to split banks across lowmem and highmem when they would otherwise
overlap with the vmalloc space.

When SPARSEMEM is used, there are two potential problems that occur
when the virtual address of the start of a bank is equal to vmalloc_min.

 1.) The end of lowmem is calculated as __pa(vmalloc_min - 1) + 1.
     In the above scenario, this will give the end address of the
     previous bank, rather than the actual bank we are interested in.
     This value is later used as the memblock limit and artificially
     restricts the total amount of available memory.

 2.) The checks to determine whether or not a bank belongs to highmem
     or not only check if __va(bank->start) is greater or less than
     vmalloc_min. In the case that it is equal, the bank is incorrectly
     treated as lowmem, which hoses the vmalloc area.

This patch fixes these two problems by checking whether the virtual
start address of a bank is >= vmalloc_min and then calculating
lowmem_end by finding the virtual end address of the highest lowmem
bank.

Cc: Russell King <linux@arm.linux.org.uk>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
6 years agoMerge branch 'rsalveti-andy-for-nicolas' of git://kernel.ubuntu.com/rsalveti/linux...
Nicolas Pitre [Tue, 17 May 2011 18:18:10 +0000 (14:18 -0400)]
Merge branch 'rsalveti-andy-for-nicolas' of git://kernel.ubuntu.com/rsalveti/linux-linaro-2.6.38 into linaro-2.6.38

6 years agoDRM: OMAP: replace request_module with request_module_nowait
Ricardo Salveti de Araujo [Tue, 17 May 2011 02:57:33 +0000 (23:57 -0300)]
DRM: OMAP: replace request_module with request_module_nowait

Otherwise it'll hang while trying to identify the DRM cards and loading
for the pvrsrvkm module.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
6 years agoOMAP2: DSS: HDMI: removing error msg from check_timing
Ricardo Salveti de Araujo [Fri, 6 May 2011 04:09:41 +0000 (01:09 -0300)]
OMAP2: DSS: HDMI: removing error msg from check_timing

The check_timing call is used to validate the timing before actually
appling it, so it's expected to treat unsupported timings. It makes no
sense to print an error message for the user saying that the timing
could not be applied (it's not even being applied by this function).

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
6 years agoDRM: OMAP: Fixing PVR kernel module name
Ricardo Salveti de Araujo [Fri, 6 May 2011 03:46:01 +0000 (00:46 -0300)]
DRM: OMAP: Fixing PVR kernel module name

We currently expect it to be "pvrsrvkm" and not "omap_gpu_pvr", so
change it to load the correct driver.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
6 years agoOMAP: DRM: Using same numbers of CRTCS and PIPES for OMAP 3 and 4
Ricardo Salveti de Araujo [Fri, 6 May 2011 00:21:54 +0000 (21:21 -0300)]
OMAP: DRM: Using same numbers of CRTCS and PIPES for OMAP 3 and 4

So we avoid having on extra vout resource when we enable both ARCH_OMAP3
and ARCH_OMAP4.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
6 years agoOMAP: I2C: "controller timed out" message should use dev_warn
Ricardo Salveti de Araujo [Thu, 5 May 2011 06:54:46 +0000 (03:54 -0300)]
OMAP: I2C: "controller timed out" message should use dev_warn

The OMAP DRM driver pools the I2C bus to find if the monitor is
connected or not, and also to grab the EDID data from the monitor.
Having the timed out messages as an error error doesn't really help,
and is quite annoying for the user, so moving it to dev_warn.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
6 years agoOMAP: DSS2: Avoid enabling panel if none is around
Ricardo Salveti de Araujo [Thu, 5 May 2011 06:07:37 +0000 (03:07 -0300)]
OMAP: DSS2: Avoid enabling panel if none is around

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
6 years agoOMAP4: DSS2: HDMI: adding a workaround for LG monitors
Ricardo Salveti de Araujo [Thu, 5 May 2011 05:11:04 +0000 (02:11 -0300)]
OMAP4: DSS2: HDMI: adding a workaround for LG monitors

Some monitors report a disconnect just after a connect, so if force is enabled,
give some time and check at least one more time. This is a needed workaround
to make the driver work with LG monitors.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
6 years agoOMAP: DSS2: adding force argument to is_detected()
Ricardo Salveti de Araujo [Thu, 5 May 2011 05:03:28 +0000 (02:03 -0300)]
OMAP: DSS2: adding force argument to is_detected()

Force is available from (*detect) at drm_connector_funcs, and can be used
by the driver to avoid expensive, destructive operations during automated
probing.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
6 years agoDRM: OMAP: Add HDMI support
John Rigby [Tue, 3 May 2011 21:01:31 +0000 (15:01 -0600)]
DRM: OMAP: Add HDMI support

This is a port from Rob Clark <rob@ti.com> patch.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
6 years agoOMAP: DSS: HDMI: tame hdmi driver
Rob Clark [Sat, 26 Mar 2011 21:00:12 +0000 (16:00 -0500)]
OMAP: DSS: HDMI: tame hdmi driver

Main change is to avoid automatically picking timings.  Now the driver
defaults to a safe 640x480, and leaves it to the upper layer (drm driver)
to pick the desired resolution based on what the user selects and the
drm infrastucture's parsing of the EDID.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
6 years agoOMAP: DSS2: HDMI: Adding is_detected callback support
Ricardo Salveti de Araujo [Mon, 4 Apr 2011 06:11:56 +0000 (03:11 -0300)]
OMAP: DSS2: HDMI: Adding is_detected callback support

This is a port from Rob Clark <rob@ti.com> patch.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
6 years agoOMAP: DSS2: HDMI: Adding get_edid callback support
Ricardo Salveti de Araujo [Mon, 4 Apr 2011 06:10:04 +0000 (03:10 -0300)]
OMAP: DSS2: HDMI: Adding get_edid callback support

This is a port from Rob Clark <rob@ti.com> patch.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
6 years agoOMAP: Panda: adding i2c_bus_num to make it work with omap drm driver
Ricardo Salveti de Araujo [Fri, 6 May 2011 08:13:49 +0000 (05:13 -0300)]
OMAP: Panda: adding i2c_bus_num to make it work with omap drm driver

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
6 years agoOMAP: devices: register first the drm omap device, and then the SGX one
Ricardo Salveti de Araujo [Thu, 5 May 2011 23:31:29 +0000 (20:31 -0300)]
OMAP: devices: register first the drm omap device, and then the SGX one

Avoid failing to load omap drm module in cases there the hardware
doesn't have SGX hwmode description available.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
6 years agohdmi add notification
Andy Green [Tue, 3 May 2011 04:19:31 +0000 (12:19 +0800)]
hdmi add notification

Signed-off-by: Andy Green <andy.green@linaro.org>
6 years agoomap4: config: add omap4_defconfig
Andy Green [Tue, 3 May 2011 04:19:28 +0000 (12:19 +0800)]
omap4: config: add omap4_defconfig

This introduces a defconfig version of Sebastien Jan's reference
config for Panda.

To use the defconfig, you need to use the following scheme to
expand it back to being a full config

 make ARCH=arm defconfig
 cat arch/arm/configs/omap4_defconfig >>.config
 make ARCH=arm oldnoconfig

From Seb Jan about the original reference config -->

Note on OMAP3 based boards:
Deactivate OMAP3 based boards since their support has not been
integrated (some boards would not build).
Keep OMAP3 and ARCH_3430 because OMAP4 support is not yet properly
supported by configuration and dependencies (ex: v4l2, DSI)

Signed-off-by: Sebastien Jan <s-jan@ti.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
6 years agohdmi audio 4430 hdmi device is only audio device
Andy Green [Tue, 3 May 2011 04:19:26 +0000 (12:19 +0800)]
hdmi audio 4430 hdmi device is only audio device

Signed-off-by: Andy Green <andy.green@linaro.org>
6 years agopanda: select HDMI as default video output
Sebastien Jan [Tue, 3 May 2011 04:19:23 +0000 (12:19 +0800)]
panda: select HDMI as default video output

Tested with following kernel command line arguments:
vram=32M omapfb.vram=0:8M,1:8M

The omapfb.vram is necessary to properly size the FB, else FB are
sized for a 640x480 screen, and cannot be properly re-sized afterwards.

Signed-off-by: Sebastien Jan <s-jan@ti.com>
6 years agoOMAP2: VIDEO: DSS: Use working TI code for HDMI
Andy Green [Tue, 3 May 2011 04:19:20 +0000 (12:19 +0800)]
OMAP2: VIDEO: DSS: Use working TI code for HDMI

This downgrades the incompatibly uplevelled parts of the OMAP2 DSS stuff
to the working HDMI version that TI provided

Signed-off-by: Andy Green <andy.green@linaro.org>
6 years agoARM: OMAP4: Add base of DSS HDMI L3 interconnect
Ricardo Neri [Tue, 3 May 2011 04:19:17 +0000 (12:19 +0800)]
ARM: OMAP4: Add base of DSS HDMI L3 interconnect

Add base address of L3 interconnect of DSS HDMI.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
6 years agoASoC: OMAP: Update Makefile and Kconfig for HDMI audio
Ricardo Neri [Tue, 3 May 2011 04:19:14 +0000 (12:19 +0800)]
ASoC: OMAP: Update Makefile and Kconfig for HDMI audio

Update Makefile and Kconfig to build HDMI audio support for
OMAP4 SDP and Panda boards.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
6 years agoASoC: OMAP4: Add Machine driver for HDMI for SDP and Panda
Ricardo Neri [Tue, 3 May 2011 04:19:12 +0000 (12:19 +0800)]
ASoC: OMAP4: Add Machine driver for HDMI for SDP and Panda

Add machine driver for HDMI on OMAP4 for SDP and Panda boards.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
6 years agoASoC: OMAP: Add header for HDMI CPU DAI
Ricardo Neri [Tue, 3 May 2011 04:19:09 +0000 (12:19 +0800)]
ASoC: OMAP: Add header for HDMI CPU DAI

Add header with definitions for the ASoC HDMI CPU DAI.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
6 years agoASoC: OMAP: Add CPU DAI driver for HDMI
Ricardo Neri [Tue, 3 May 2011 04:19:06 +0000 (12:19 +0800)]
ASoC: OMAP: Add CPU DAI driver for HDMI

Addition of the HDMI CPU DAI driver for OMAP4. This driver is in
charge of configuring DMA settings for HDMI. Also, it finds
the HDMI video device and determines if audio playback can proceed.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
6 years agoOMAP4: HDMI: Add device for HDMI audio interface to OMAP4 PANDA
Ricardo Neri [Tue, 3 May 2011 04:19:04 +0000 (12:19 +0800)]
OMAP4: HDMI: Add device for HDMI audio interface to OMAP4 PANDA

Add platform device for the HHDMI digital audio interface to OMAP4 Panda
board. This is for use of the ASoC HDMI CPU DAI driver.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
6 years agoOMAP4: HDMI: Add device for HDMI audio interface to OMAP4 SDP
Ricardo Neri [Tue, 3 May 2011 04:19:01 +0000 (12:19 +0800)]
OMAP4: HDMI: Add device for HDMI audio interface to OMAP4 SDP

Add platform device for the HHDMI digital audio interface to OMAP4 SDP board.
This is for use of the ASoC HDMI CPU DAI driver.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
6 years agoOMAP4: DSS2: HDMI: Implement ASoC Codec driver for HDMI audio
Ricardo Neri [Tue, 3 May 2011 04:18:58 +0000 (12:18 +0800)]
OMAP4: DSS2: HDMI: Implement ASoC Codec driver for HDMI audio

Implement an ASoC Codec Driver to handle audio configuration. The
implementation offers an interface for audio configuration and
control to be exposed to ALSA while hidding the HDMI details.

The ASoC driver supports the Basic Audio configuration as described
in CEA-861-D: 2-channel linear PCM with 32, 44.1 and 48kHz sample
rates and 16 bits/sample. It additionally supports 24 bit/sample
in 32-bit words.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
6 years agoOMAP4: DSS2: HDMI: Add functionality for audio configuration
Ricardo Neri [Tue, 3 May 2011 04:18:55 +0000 (12:18 +0800)]
OMAP4: DSS2: HDMI: Add functionality for audio configuration

Add functionality for relevant audio configuration. Functions to
configure the audio FIFO and DMA as well as functions for the audio
core and Audio Info frame are included. This functionality is to
be used by the ASoC HDMI audio codec that is implemented in the
following patch.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
6 years agoOMAP4: DSS2: HDMI: Add enums and structures for audio
Ricardo Neri [Tue, 3 May 2011 04:18:52 +0000 (12:18 +0800)]
OMAP4: DSS2: HDMI: Add enums and structures for audio

Add enurations and structures for audio configuration. This includes
enumerations for the Audio InfoFrame, I2S, audio FIFO and audio core.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
6 years agoOMAP4: SGX-KM: Enable SGX initialisation
Vikram Pandita [Tue, 3 May 2011 04:18:50 +0000 (12:18 +0800)]
OMAP4: SGX-KM: Enable SGX initialisation

Added most of the generic GPU initialisation code to mach-omap2.

Change-Id: I90f137c18dcb79aa9b65761147d0aedeed021a27

Signed-off-by: Tony Lofthouse <tony.lofthouse@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
6 years agoKernel changes for hwmod and omap_device initialization for GPU.
Hemant Hariyani [Tue, 3 May 2011 04:18:47 +0000 (12:18 +0800)]
Kernel changes for hwmod and omap_device initialization for GPU.

Change-Id: I4bd96e76af31d0991ce9e67b0c499f0d6f39a1a8
Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
6 years agoOMAPFB: re-allocate FB if needed on resize notification
Sebastien Jan [Tue, 3 May 2011 04:18:44 +0000 (12:18 +0800)]
OMAPFB: re-allocate FB if needed on resize notification

Note that re-allocating can fragment vram, so to avoid re-allocation,
pre-assign FB size with kernel bootargs like:
omapfb.vram=0:8M,1:8M

Note: prevent the console accessing the FB while re-allocation is running.
Other early FB users would be an issue as well.

Signed-off-by: Sebastien Jan <s-jan@ti.com>
6 years agoOMAP: DSS2: DSI: Introduce sync_vc functions
Archit Taneja [Tue, 3 May 2011 04:18:41 +0000 (12:18 +0800)]
OMAP: DSS2: DSI: Introduce sync_vc functions

The DSI protocol engine has no interrupt for signalling the end of a Frame
transfer. The present approach is to send a BTA after DISPC generates a
FRAMEDONE interrupt, and unlock the dsi bus only when the BTA Ack is received.

The assumption made with this approach was that OMAP will send a BTA only after
the long packet corresponding to the last line is sent. However, it is possible
that on the DISPC FRAMEDONE interrupt there are 2 (or more) lines of pixel data
in the DSI line buffer. Hence, the BTA Ack could be received for the long packet
corresponding to the second last line (or the third last and so on..).
Therefore, the current method doesn't ensure that the complete frame data is
sent before we start a new transfer. A similar explanation holds valid if we
send a BTA in between multiple short/long command packets from the slave port.

Introduce dsi_sync_vc functions, based on Tomi Valkeinen's idea, which ensure
that the DSI Virtual Channel in use(update_channel) completes its previous work
before proceeding to the next Frame/Command.

For a frame update, the DSI driver now sends a callback to the Panel Driver
on the FRAMEDONE interrupt itself. The callback in the panel driver then unlocks
the bus. dsi_sync_vc() functions are placed in dsi_vc_config_l4() and
dsi_vc_config_vp() to ensure that the previous task of the Virtual Channel is
completed.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6 years agoDSS: fix DVI and DSI concurrent support
Sebastien Jan [Tue, 3 May 2011 04:18:38 +0000 (12:18 +0800)]
DSS: fix DVI and DSI concurrent support

DSI requires the OMAP2_DSS_USE_DSI_PLL flag to work, and the dummy
regulators.
The USE_DSI_PLL flag also impacts DPI (for DVI on pandaboard), and
currently breaks it.

So deactivate the USE_DSI_PLL flag and hack DSI code to enable DSI
support.

Signed-off-by: Sebastien Jan <s-jan@ti.com>
6 years agoOMAP2: PANDA: remove wl1271 references as replaced by new stuff in bt patchset
Andy Green [Tue, 3 May 2011 04:18:35 +0000 (12:18 +0800)]
OMAP2: PANDA: remove wl1271 references as replaced by new stuff in bt patchset

Signed-off-by: Andy Green <andy.green@linaro.org>
6 years agoPANDA only register hdmi if enabled in config
Andy Green [Tue, 3 May 2011 04:18:32 +0000 (12:18 +0800)]
PANDA only register hdmi if enabled in config

Signed-off-by: Andy Green <andy.green@linaro.org>
6 years agoOMAP: use correct mmc dev attr name in mmc.h
Andy Green [Tue, 3 May 2011 04:18:30 +0000 (12:18 +0800)]
OMAP: use correct mmc dev attr name in mmc.h

Signed-off-by: Andy Green <andy.green@linaro.org>
6 years agoOMAP4: platform devices.c is missing an include of err.h
Andy Green [Tue, 3 May 2011 04:18:27 +0000 (12:18 +0800)]
OMAP4: platform devices.c is missing an include of err.h

Signed-off-by: Andy Green <andy.green@linaro.org>
6 years agoOMAP2420: hwmod data: Add HSMMC
kishore kadiyala [Tue, 3 May 2011 04:18:24 +0000 (12:18 +0800)]
OMAP2420: hwmod data: Add HSMMC

Update the omap2420 hwmod data with the HSMMC info.
Add a device attribute structure which will be used
by the host driver to find whether the HSMMC controller
supports DUAL VOLT cards.

Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
6 years agoOMAP4: OMAPFB: register callback to get notified of resolution change
Sebastien Jan [Tue, 3 May 2011 04:18:21 +0000 (12:18 +0800)]
OMAP4: OMAPFB: register callback to get notified of resolution change

Protect fb_set_var() with console-sem to avoid making console
driver unhappy. Supports more than one framebuffer.

This is a port from Rob Clark <rob@ti.com> patch.

Signed-off-by: Sebastien Jan <s-jan@ti.com>
6 years agoOMAP4: DSS: add generic notifier mechanism
Sebastien Jan [Tue, 3 May 2011 04:18:18 +0000 (12:18 +0800)]
OMAP4: DSS: add generic notifier mechanism

A callback can be registered by the dssdev client in order to be
notified of resolution changes, for example an external monitor
that is hot-plugged.

Multiple clients can now register for notification from one
dssdev, and the notification mechanism can be extended in the
future to add other events.

This is a port of Rob Clark's <rob@ti.com> original patch.

Signed-off-by: Sebastien Jan <s-jan@ti.com>
6 years agoOMAP4 : HDMI : Add HDMI structure in the board file for OMAP4 PANDA
K, Mythri P [Tue, 3 May 2011 04:18:16 +0000 (12:18 +0800)]
OMAP4 : HDMI : Add HDMI structure in the board file for OMAP4 PANDA

Adding  board file structure for display which adds the display
structure with HDMI as the default driver when the display init
is called.
HDMI GPIO configurations are also done in this file.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Sebastien Jan <s-jan@ti.com>
6 years agov4l2: omap: pass debug param to v4l2 framework
Sebastien Jan [Tue, 3 May 2011 04:18:13 +0000 (12:18 +0800)]
v4l2: omap: pass debug param to v4l2 framework

The omap_vout debug module parameter can be passed to the v4l2
framework.
For this, its type has to be extended.

Signed-off-by: Sebastien Jan <s-jan@ti.com>
6 years agoOMAP: DSS2: Adding macro for DISPC_DIVISOR register
Raghuveer Murthy [Tue, 3 May 2011 04:18:10 +0000 (12:18 +0800)]
OMAP: DSS2: Adding macro for DISPC_DIVISOR register

Added macro for DISPC_DIVISOR. This is different from DISPC_DIVISOR1 and
DISPC_DIVISOR2. OMAP4 supports all the above 3 registers.

DISPC_DIVISOR1 and DISPC_DIVISOR2 registers are accessed through
DISPC_DIVISORo(ch) macro

Signed-off-by: Raghuveer Murthy <raghuveer.murthy@ti.com>
6 years agoOMAP2, 3: DSS2: DSI: create platform_driver, move init, exit to driver
Senthilvadivu Guruswamy [Tue, 3 May 2011 04:18:07 +0000 (12:18 +0800)]
OMAP2, 3: DSS2: DSI: create platform_driver, move init, exit to driver

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for DSI is created and init exit methods are moved from core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

Also, vdds_dsi regulator handling is copied to dsi.c, since vdds_dsi regulator is
needed by dpi_init() too. Board files are updated accordingly to add 2 instances of
vdds_dsi regulator.

DSI platform driver is registered from inside omap_dss_probe, in the order desired.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6 years agoOMAP2, 3: DSS2: VENC: create platform_driver, move init, exit to driver
Senthilvadivu Guruswamy [Tue, 3 May 2011 04:18:04 +0000 (12:18 +0800)]
OMAP2, 3: DSS2: VENC: create platform_driver, move init, exit to driver

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for VENC is created and init exit methods are moved from core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

Also, venc_vdda_dac reading is moved to venc.c.

VENC platform driver is registered from inside omap_dss_probe, in the order desired.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6 years agoOMAP2+: hwmod: add ability to setup individual hwmods
Paul Walmsley [Tue, 3 May 2011 04:18:01 +0000 (12:18 +0800)]
OMAP2+: hwmod: add ability to setup individual hwmods

Add omap_hwmod_setup_one(), which is intended for use early in boot to
selectively setup the hwmods needed for system clocksources and
clockevents, and any other hwmod that is needed in early boot.
omap_hwmod_setup_all() can then be called later in the boot process.
The point is to minimize the amount of code that needs to be run
early.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Benoît Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
6 years agoV4L2: OMAP: Make it work for OMAP4
Jassi Brar [Tue, 3 May 2011 04:17:58 +0000 (12:17 +0800)]
V4L2: OMAP: Make it work for OMAP4

Some logical optimization and redundat checks removed.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
6 years agoARM: 6870/1: The mandatory barrier rmb() must be a dsb() in for device accesses
Catalin Marinas [Wed, 6 Apr 2011 15:18:47 +0000 (16:18 +0100)]
ARM: 6870/1: The mandatory barrier rmb() must be a dsb() in for device accesses

Since mandatory barriers may be used (explicitly or implicitly via readl
etc.) to ensure the ordering between Device and Normal memory accesses,
a DMB is not enough. This patch converts it to a DSB.

Cc: Colin Cross <ccross@android.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
(cherry picked from commit a904f5f9eb7a55baacb2f4c1423cac8a8eb78a3a)

6 years agoARM: 6890/1: memmap: only free allocated memmap entries when using SPARSEMEM
Will Deacon [Thu, 28 Apr 2011 17:44:31 +0000 (18:44 +0100)]
ARM: 6890/1: memmap: only free allocated memmap entries when using SPARSEMEM

The SPARSEMEM code allocates memmap entries only for sections which are
present (i.e. those which contain some valid memory). The membank checks
in free_unused_memmap do not take this into account and can incorrectly
attempt to free memory which is not allocated, resulting in a BUG() in
the bootmem code.

However, if memory is configured as follows:

    |<----section---->|<----hole---->|<----section---->|
    +--------+--------+--------------+--------+--------+
    | bank 0 | unused |              | bank 1 | unused |
    +--------+--------+--------------+--------+--------+

where a bank only occupies part of a section, the memmap allocated for
the remainder of the section *can* be freed.

This patch modifies the checks in free_unused_memmap so that only valid
memmap entries are considered for removal.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
(cherry picked from commit 9af386c8dc5a9dce56f36b484647ad6401758c85)

6 years agommc: omap: Fix possible NULL pointer deref
Michael Buesch [Mon, 11 Apr 2011 21:00:44 +0000 (17:00 -0400)]
mmc: omap: Fix possible NULL pointer deref

Either OMAP_MMC_STAT_CARD_ERR or OMAP_MMC_STAT_END_OF_CMD might fire
if there is no host->cmd pointer.

Check for a valid host->cmd pointer before calling mmc_omap_cmd_done().

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
(cherry picked from commit f69475142136c8ad9b9c717aea2ff907aed9f863)

6 years agoarm, hw_breakpoints: Fix racy access to ptrace breakpoints
Frederic Weisbecker [Fri, 8 Apr 2011 15:29:36 +0000 (17:29 +0200)]
arm, hw_breakpoints: Fix racy access to ptrace breakpoints

While the tracer accesses ptrace breakpoints, the child task may
concurrently exit due to a SIGKILL and thus release its breakpoints
at the same time. We can then dereference some freed pointers.

To fix this, hold a reference on the child breakpoints before
manipulating them.

Reported-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Prasad <prasad@linux.vnet.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Link: http://lkml.kernel.org/r/1302284067-7860-5-git-send-email-fweisbec@gmail.com
(cherry picked from commit bf0b8f4b55e591ba417c2dbaff42769e1fc773b0)

6 years agoptrace: Prepare to fix racy accesses on task breakpoints
Frederic Weisbecker [Thu, 7 Apr 2011 14:53:20 +0000 (16:53 +0200)]
ptrace: Prepare to fix racy accesses on task breakpoints

When a task is traced and is in a stopped state, the tracer
may execute a ptrace request to examine the tracee state and
get its task struct. Right after, the tracee can be killed
and thus its breakpoints released.
This can happen concurrently when the tracer is in the middle
of reading or modifying these breakpoints, leading to dereferencing
a freed pointer.

Hence, to prepare the fix, create a generic breakpoint reference
holding API. When a reference on the breakpoints of a task is
held, the breakpoints won't be released until the last reference
is dropped. After that, no more ptrace request on the task's
breakpoints can be serviced for the tracer.

Reported-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Prasad <prasad@linux.vnet.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: v2.6.33.. <stable@kernel.org>
Link: http://lkml.kernel.org/r/1302284067-7860-2-git-send-email-fweisbec@gmail.com
(cherry picked from commit bf26c018490c2fce7fe9b629083b96ce0e6ad019)

6 years agosmsc95xx: fix reset check
Rabin Vincent [Sat, 30 Apr 2011 08:29:27 +0000 (08:29 +0000)]
smsc95xx: fix reset check

The reset loop check should check the MII_BMCR register value for
BMCR_RESET rather than for MII_BMCR (the register address, which also
happens to be zero).

Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d946092000698fd204d82a9d239103c656fb63bf)

6 years agoMerge commit 'v2.6.38.6' into linaro-2.6.38
Nicolas Pitre [Mon, 16 May 2011 17:24:27 +0000 (13:24 -0400)]
Merge commit 'v2.6.38.6' into linaro-2.6.38

6 years agoMerge branch 'upstream/linaro.38' into linaro-android.38
John Stultz [Thu, 12 May 2011 19:28:04 +0000 (12:28 -0700)]
Merge branch 'upstream/linaro.38' into linaro-android.38

6 years agoLinux 2.6.38.6
Greg Kroah-Hartman [Mon, 9 May 2011 22:16:23 +0000 (15:16 -0700)]
Linux 2.6.38.6

6 years agoVM: skip the stack guard page lookup in get_user_pages only for mlock
Linus Torvalds [Thu, 5 May 2011 04:30:28 +0000 (21:30 -0700)]
VM: skip the stack guard page lookup in get_user_pages only for mlock

commit a1fde08c74e90accd62d4cfdbf580d2ede938fe7 upstream.

The logic in __get_user_pages() used to skip the stack guard page lookup
whenever the caller wasn't interested in seeing what the actual page
was.  But Michel Lespinasse points out that there are cases where we
don't care about the physical page itself (so 'pages' may be NULL), but
do want to make sure a page is mapped into the virtual address space.

So using the existence of the "pages" array as an indication of whether
to look up the guard page or not isn't actually so great, and we really
should just use the FOLL_MLOCK bit.  But because that bit was only set
for the VM_LOCKED case (and not all vma's necessarily have it, even for
mlock()), we couldn't do that originally.

Fix that by moving the VM_LOCKED check deeper into the call-chain, which
actually simplifies many things.  Now mlock() gets simpler, and we can
also check for FOLL_MLOCK in __get_user_pages() and the code ends up
much more straightforward.

Reported-and-reviewed-by: Michel Lespinasse <walken@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agofix oops in scsi_run_queue()
James Bottomley [Sun, 1 May 2011 14:42:07 +0000 (09:42 -0500)]
fix oops in scsi_run_queue()

commit c055f5b2614b4f758ae6cc86733f31fa4c2c5844 upstream.

The recent commit closing the race window in device teardown:

commit 86cbfb5607d4b81b1a993ff689bbd2addd5d3a9b
Author: James Bottomley <James.Bottomley@suse.de>
Date:   Fri Apr 22 10:39:59 2011 -0500

    [SCSI] put stricter guards on queue dead checks

is causing a potential NULL deref in scsi_run_queue() because the
q->queuedata may already be NULL by the time this function is called.
Since we shouldn't be running a queue that is being torn down, simply
add a NULL check in scsi_run_queue() to forestall this.

Tested-by: Jim Schutt <jaschut@sandia.gov>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agocan: add missing socket check in can/raw release
Oliver Hartkopp [Wed, 20 Apr 2011 01:57:15 +0000 (01:57 +0000)]
can: add missing socket check in can/raw release

commit 10022a6c66e199d8f61d9044543f38785713cbbd upstream.

v2: added space after 'if' according code style.

We can get here with a NULL socket argument passed from userspace,
so we need to handle it accordingly.

Thanks to Dave Jones pointing at this issue in net/can/bcm.c

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agodrm/radeon/kms: add some new pci ids
Alex Deucher [Tue, 3 May 2011 19:15:55 +0000 (15:15 -0400)]
drm/radeon/kms: add some new pci ids

commit e2c85d8e3974c9041ad7b080846b28d2243e771b upstream.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agoKVM: SVM: check for progress after IRET interception
Avi Kivity [Thu, 3 Feb 2011 13:29:52 +0000 (15:29 +0200)]
KVM: SVM: check for progress after IRET interception

commit bd3d1ec3d26b61120bb4f60b18ee99aa81839e6b upstream.

When we enable an NMI window, we ask for an IRET intercept, since
the IRET re-enables NMIs.  However, the IRET intercept happens before
the instruction executes, while the NMI window architecturally opens
afterwards.

To compensate for this mismatch, we only open the NMI window in the
following exit, assuming that the IRET has by then executed; however,
this assumption is not always correct; we may exit due to a host interrupt
or page fault, without having executed the instruction.

Fix by checking for forward progress by recording and comparing the IRET's
rip.  This is somewhat of a hack, since an unchaging rip does not mean that
no forward progress has been made, but is the simplest fix for now.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agocx88: Fix HVR4000 IR keymap
Lawrence Rust [Thu, 5 May 2011 02:25:10 +0000 (23:25 -0300)]
cx88: Fix HVR4000 IR keymap

[fixed in .39 in a much different way that is too big to backport to
.38 - gregkh]

Fixes the RC key input for Nova-S plus, HVR1100, HVR3000 and HVR4000 in
the 2.6.38 kernel.

Signed-off-by: Lawrence Rust <lvr@softsystem.dot.uk>
Acked-by: Jarod Wilson <jarod@wilsonet.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
6 years agofs/partitions/ldm.c: fix oops caused by corrupted partition table
Timo Warns [Thu, 14 Apr 2011 22:21:56 +0000 (15:21 -0700)]
fs/partitions/ldm.c: fix oops caused by corrupted partition table

commit c340b1d640001c8c9ecff74f68fd90422ae2448a upstream.

The kernel automatically evaluates partition tables of storage devices.
The code for evaluating LDM partitions (in fs/partitions/ldm.c) contains
a bug that causes a kernel oops on certain corrupted LDM partitions.
A kernel subsystem seems to crash, because, after the oops, the kernel no
longer recognizes newly connected storage devices.

The patch validates the value of vblk_size.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Timo Warns <warns@pre-sense.de>
Cc: Eugene Teo <eugeneteo@kernel.sg>
Cc: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Richard Russon <rich@flatcap.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agocan: Add missing socket check in can/bcm release.
Dave Jones [Wed, 20 Apr 2011 03:36:59 +0000 (20:36 -0700)]
can: Add missing socket check in can/bcm release.

commit c6914a6f261aca0c9f715f883a353ae7ff51fe83 upstream.

We can get here with a NULL socket argument passed from userspace,
so we need to handle it accordingly.

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agoOpen with O_CREAT flag set fails to open existing files on non writable directories
Sachin Prabhu [Wed, 20 Apr 2011 12:09:35 +0000 (13:09 +0100)]
Open with O_CREAT flag set fails to open existing files on non writable directories

commit 1574dff8996ab1ed92c09012f8038b5566fce313 upstream.

An open on a NFS4 share using the O_CREAT flag on an existing file for
which we have permissions to open but contained in a directory with no
write permissions will fail with EACCES.

A tcpdump shows that the client had set the open mode to UNCHECKED which
indicates that the file should be created if it doesn't exist and
encountering an existing flag is not an error. Since in this case the
file exists and can be opened by the user, the NFS server is wrong in
attempting to check create permissions on the parent directory.

The patch adds a conditional statement to check for create permissions
only if the file doesn't exist.

Signed-off-by: Sachin S. Prabhu <sprabhu@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agoXZ decompressor: Fix decoding of empty LZMA2 streams
Lasse Collin [Sun, 1 May 2011 16:38:42 +0000 (19:38 +0300)]
XZ decompressor: Fix decoding of empty LZMA2 streams

commit 646032e3b05b32d3f20cb108a030593d9d792eb5 upstream.

The old code considered valid empty LZMA2 streams to be corrupt.
Note that a typical empty .xz file has no LZMA2 data at all,
and thus most .xz files having no uncompressed data are handled
correctly even without this fix.

Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agoARM: 6891/1: prevent heap corruption in OABI semtimedop
Dan Rosenberg [Fri, 29 Apr 2011 14:48:07 +0000 (15:48 +0100)]
ARM: 6891/1: prevent heap corruption in OABI semtimedop

commit 0f22072ab50cac7983f9660d33974b45184da4f9 upstream.

When CONFIG_OABI_COMPAT is set, the wrapper for semtimedop does not
bound the nsops argument.  A sufficiently large value will cause an
integer overflow in allocation size, followed by copying too much data
into the allocated buffer.  Fix this by restricting nsops to SEMOPM.
Untested.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agoaf_unix: Only allow recv on connected seqpacket sockets.
Eric W. Biederman [Sun, 24 Apr 2011 01:54:57 +0000 (01:54 +0000)]
af_unix: Only allow recv on connected seqpacket sockets.

commit a05d2ad1c1f391c7f514a1d1e09b5417968a7d07 upstream.

This fixes the following oops discovered by Dan Aloni:
> Anyway, the following is the output of the Oops that I got on the
> Ubuntu kernel on which I first detected the problem
> (2.6.37-12-generic). The Oops that followed will be more useful, I
> guess.

>[ 5594.669852] BUG: unable to handle kernel NULL pointer dereference
> at           (null)
> [ 5594.681606] IP: [<ffffffff81550b7b>] unix_dgram_recvmsg+0x1fb/0x420
> [ 5594.687576] PGD 2a05d067 PUD 2b951067 PMD 0
> [ 5594.693720] Oops: 0002 [#1] SMP
> [ 5594.699888] last sysfs file:

The bug was that unix domain sockets use a pseduo packet for
connecting and accept uses that psudo packet to get the socket.
In the buggy seqpacket case we were allowing unconnected
sockets to call recvmsg and try to receive the pseudo packet.

That is always wrong and as of commit 7361c36c5 the pseudo
packet had become enough different from a normal packet
that the kernel started oopsing.

Do for seqpacket_recv what was done for seqpacket_send in 2.5
and only allow it on connected seqpacket sockets.

Tested-by: Dan Aloni <dan@aloni.org>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agomac80211: fix SMPS debugfs locking
Johannes Berg [Tue, 19 Apr 2011 18:44:04 +0000 (20:44 +0200)]
mac80211: fix SMPS debugfs locking

commit 243e6df4ed919880d079d717641ad699c6530a03 upstream.

The locking with SMPS requests means that the
debugs file should lock the mgd mutex, not the
iflist mutex. Calls to __ieee80211_request_smps()
need to hold that mutex, so add an assertion.

This has always been wrong, but for some reason
never been noticed, probably because the locking
error only happens while unassociated.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agoath9k: fix the return value of ath_stoprecv
Felix Fietkau [Thu, 14 Apr 2011 22:41:43 +0000 (00:41 +0200)]
ath9k: fix the return value of ath_stoprecv

commit 2232d31bf18ba02f5cd632bbfc3466aeca394c75 upstream.

The patch 'ath9k_hw: fix stopping rx DMA during resets' added code to detect
a condition where rx DMA was stopped, but the MAC failed to enter the idle
state. This condition requires a hardware reset, however the return value
of ath_stoprecv was 'true' in that case, which allowed it to skip the reset
when issuing a fast channel change.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Reported-by: Paul Stewart <pstew@google.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agox86, AMD: Fix APIC timer erratum 400 affecting K8 Rev.A-E processors
Boris Ostrovsky [Fri, 29 Apr 2011 21:47:43 +0000 (17:47 -0400)]
x86, AMD: Fix APIC timer erratum 400 affecting K8 Rev.A-E processors

commit e20a2d205c05cef6b5783df339a7d54adeb50962 upstream.

Older AMD K8 processors (Revisions A-E) are affected by erratum
400 (APIC timer interrupts don't occur in C states greater than
C1). This, for example, means that X86_FEATURE_ARAT flag should
not be set for these parts.

This addresses regression introduced by commit
b87cf80af3ba4b4c008b4face3c68d604e1715c6 ("x86, AMD: Set ARAT
feature on AMD processors") where the system may become
unresponsive until external interrupt (such as keyboard input)
occurs. This results, for example, in time not being reported
correctly, lack of progress on the system and other lockups.

Reported-by: Joerg-Volker Peetz <jvpeetz@web.de>
Tested-by: Joerg-Volker Peetz <jvpeetz@web.de>
Acked-by: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: Boris Ostrovsky <Boris.Ostrovsky@amd.com>
Link: http://lkml.kernel.org/r/1304113663-6586-1-git-send-email-ostr@amd64.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agoflex_arrays: allow zero length flex arrays
Eric Paris [Thu, 28 Apr 2011 19:55:52 +0000 (15:55 -0400)]
flex_arrays: allow zero length flex arrays

commit bf69d41d198138e3c601e9a6645f4f1369aff7e0 upstream.

Just like kmalloc will allow one to allocate a 0 length segment of memory
flex arrays should do the same thing.  It should bomb if you try to use
something, but it should at least allow the allocation.

This is needed because when SELinux switched to using flex_arrays in 2.6.38
the inability to allocate a 0 length array resulted in SELinux policy load
returning -ENOSPC when previously it worked.

Based-on-patch-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
Tested-by: Chris Richards <gizmo@giz-works.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agoflex_array: flex_array_prealloc takes a number of elements, not an end
Eric Paris [Thu, 28 Apr 2011 19:55:52 +0000 (15:55 -0400)]
flex_array: flex_array_prealloc takes a number of elements, not an end

commit 5d30b10bd68df007e7ae21e77d1e0ce184b53040 upstream.

Change flex_array_prealloc to take the number of elements for which space
should be allocated instead of the last (inclusive) element. Users
and documentation are updated accordingly.  flex_arrays got introduced before
they had users.  When folks started using it, they ended up needing a
different API than was coded up originally.  This swaps over to the API that
folks apparently need.

Based-on-patch-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
Tested-by: Chris Richards <gizmo@giz-works.com>
Acked-by: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agoimon: add conditional locking in change_protocol
Jarod Wilson [Wed, 27 Apr 2011 22:01:44 +0000 (19:01 -0300)]
imon: add conditional locking in change_protocol

commit 23ef710e1a6c4d6b9ef1c2fa19410f7f1479401e upstream.

The imon_ir_change_protocol function gets called two different ways, one
way is from rc_register_device, for initial protocol selection/setup,
and the other is via a userspace-initiated protocol change request,
either by direct sysfs prodding or by something like ir-keytable.

In the rc_register_device case, the imon context lock is already held,
but when initiated from userspace, it is not, so we must acquire it,
prior to calling send_packet, which requires that the lock is held.

Without this change, there's an easily reproduceable deadlock when
another function calls send_packet (such as either of the display write
fops) after a userspace-initiated change_protocol.

With a lock-debugging-enabled kernel, I was getting this:

[   15.014153] =====================================
[   15.015048] [ BUG: bad unlock balance detected! ]
[   15.015048] -------------------------------------
[   15.015048] ir-keytable/773 is trying to release lock (&ictx->lock) at:
[   15.015048] [<ffffffff814c6297>] mutex_unlock+0xe/0x10
[   15.015048] but there are no more locks to release!
[   15.015048]
[   15.015048] other info that might help us debug this:
[   15.015048] 2 locks held by ir-keytable/773:
[   15.015048]  #0:  (&buffer->mutex){+.+.+.}, at: [<ffffffff8119d400>] sysfs_write_file+0x3c/0x144
[   15.015048]  #1:  (s_active#87){.+.+.+}, at: [<ffffffff8119d4ab>] sysfs_write_file+0xe7/0x144
[   15.015048]
[   15.015048] stack backtrace:
[   15.015048] Pid: 773, comm: ir-keytable Not tainted 2.6.38.4-20.fc15.x86_64.debug #1
[   15.015048] Call Trace:
[   15.015048]  [<ffffffff81089715>] ? print_unlock_inbalance_bug+0xca/0xd5
[   15.015048]  [<ffffffff8108b35c>] ? lock_release_non_nested+0xc1/0x263
[   15.015048]  [<ffffffff814c6297>] ? mutex_unlock+0xe/0x10
[   15.015048]  [<ffffffff814c6297>] ? mutex_unlock+0xe/0x10
[   15.015048]  [<ffffffff8108b67b>] ? lock_release+0x17d/0x1a4
[   15.015048]  [<ffffffff814c6229>] ? __mutex_unlock_slowpath+0xc5/0x125
[   15.015048]  [<ffffffff814c6297>] ? mutex_unlock+0xe/0x10
[   15.015048]  [<ffffffffa02964b6>] ? send_packet+0x1c9/0x264 [imon]
[   15.015048]  [<ffffffff8108b376>] ? lock_release_non_nested+0xdb/0x263
[   15.015048]  [<ffffffffa0296731>] ? imon_ir_change_protocol+0x126/0x15e [imon]
[   15.015048]  [<ffffffffa024a334>] ? store_protocols+0x1c3/0x286 [rc_core]
[   15.015048]  [<ffffffff81326e4e>] ? dev_attr_store+0x20/0x22
[   15.015048]  [<ffffffff8119d4cc>] ? sysfs_write_file+0x108/0x144
...

The original report that led to the investigation was the following:

[ 1679.457305] INFO: task LCDd:8460 blocked for more than 120 seconds.
[ 1679.457307] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 1679.457309] LCDd            D ffff88010fcd89c8     0  8460      1 0x00000000
[ 1679.457312]  ffff8800d5a03b48 0000000000000082 0000000000000000 ffff8800d5a03fd8
[ 1679.457314]  00000000012dcd30 fffffffffffffffd ffff8800d5a03fd8 ffff88010fcd86f0
[ 1679.457316]  ffff8800d5a03fd8 ffff8800d5a03fd8 ffff88010fcd89d0 ffff8800d5a03fd8
[ 1679.457319] Call Trace:
[ 1679.457324]  [<ffffffff810ff1a5>] ? zone_statistics+0x75/0x90
[ 1679.457327]  [<ffffffff810ea907>] ? get_page_from_freelist+0x3c7/0x820
[ 1679.457330]  [<ffffffff813b0a49>] __mutex_lock_slowpath+0x139/0x320
[ 1679.457335]  [<ffffffff813b0c41>] mutex_lock+0x11/0x30
[ 1679.457338]  [<ffffffffa0d54216>] display_open+0x66/0x130 [imon]
[ 1679.457345]  [<ffffffffa01d06c0>] usb_open+0x180/0x310 [usbcore]
[ 1679.457349]  [<ffffffff81143b3b>] chrdev_open+0x1bb/0x2d0
[ 1679.457350]  [<ffffffff8113d93d>] __dentry_open+0x10d/0x370
[ 1679.457352]  [<ffffffff81143980>] ? chrdev_open+0x0/0x2d0
...

Bump the driver version here so its easier to tell if people have this
locking fix or not, and also make locking during probe easier to follow.

Reported-by: Benjamin Hodgetts <ben@xnode.org>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agov4l: make sure drivers supply a zeroed struct v4l2_subdev
Herton Ronaldo Krzesinski [Fri, 1 Apr 2011 17:12:02 +0000 (14:12 -0300)]
v4l: make sure drivers supply a zeroed struct v4l2_subdev

commit 80845a33165278f3236812009e9c568ba8c29938 upstream.

Some v4l drivers currently don't initialize their struct v4l2_subdev
with zeros, and this is a problem since some of the v4l2 code expects
this. One example is the addition of internal_ops in commit 45f6f84,
after that we are at risk of random oopses with these drivers when code
in v4l2_device_register_subdev tries to dereference sd->internal_ops->*,
as can be shown by the report at http://bugs.launchpad.net/bugs/745213
and analysis of its crash at https://lkml.org/lkml/2011/4/1/168

Use kzalloc within problematic drivers to ensure we have a zeroed struct
v4l2_subdev.

BugLink: http://bugs.launchpad.net/bugs/745213
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agousbnet: add support for some Huawei modems with cdc-ether ports
Dan Williams [Wed, 27 Apr 2011 09:54:28 +0000 (09:54 +0000)]
usbnet: add support for some Huawei modems with cdc-ether ports

commit b3c914aa84f4e4bbb3efc8f41c359d96e5e932d2 upstream.

Some newer Huawei devices (T-Mobile Rocket, others) have cdc-ether
compatible ports, so recognize and expose them.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agofirewire: Fix for broken configrom updates in quick succession
B.J. Buchalter [Mon, 2 May 2011 17:33:42 +0000 (13:33 -0400)]
firewire: Fix for broken configrom updates in quick succession

commit 2e053a27d9d5ad5e0831e002cbf8043836fb2060 upstream.

Current implementation of ohci_set_config_rom() uses a deferred
bus reset via fw_schedule_bus_reset(). If clients add multiple
unit descriptors to the config_rom in quick succession, the
deferred bus reset may not have fired before succeeding update
requests have come in. This can lead to an incorrect partial
update of the config_rom for both addition and removal of
config_rom descriptors, as the ohci_set_config_rom() routine
will return -EBUSY if a previous pending update has not been
completed yet; the requested update just gets dropped on the floor.

This patch recognizes that the "in-flight" update can be modified
until it has been processed by the bus-reset, and the locking
in the bus_reset_tasklet ensures that the update is done atomically
with respect to modifications made by ohci_set_config_rom(). The
-EBUSY error case is simply removed.

[Stefan R:  The bug always existed at least theoretically.  But it
became easy to trigger since 2.6.36 commit 02d37bed188c "firewire: core:
integrate software-forced bus resets with bus management" which
introduced long mandatory delays between janitorial bus resets.]

Signed-off-by: Benjamin Buchalter <bj@mhlabs.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agoUSB: fix regression in usbip by setting has_tt flag
Alan Stern [Mon, 2 May 2011 18:21:44 +0000 (14:21 -0400)]
USB: fix regression in usbip by setting has_tt flag

commit cee6a262550f53a13acfefbc1e3e5ff35c96182c upstream.

This patch (as1460) fixes a regression in the usbip driver caused by
the new check for Transaction Translators in USB-2 hubs.  The root hub
registered by vhci_hcd needs to have the has_tt flag set, because it
can connect to low- and full-speed devices as well as high-speed
devices.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agodrm/radeon: fix regression on atom cards with hardcoded EDID record.
Dave Airlie [Sun, 1 May 2011 10:16:30 +0000 (20:16 +1000)]
drm/radeon: fix regression on atom cards with hardcoded EDID record.

commit eaa4f5e1d0b816291a59a47917e569c0384f2b6f upstream.

Since fafcf94e2b5732d1e13b440291c53115d2b172e9 introduced an edid size, it seems to have broken this path.

This manifest as oops on T500 Lenovo laptops with dual graphics primarily.

Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=33812

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agommc: sdhci: Check mrq != NULL in sdhci_tasklet_finish
Chris Ball [Wed, 27 Apr 2011 21:35:31 +0000 (17:35 -0400)]
mmc: sdhci: Check mrq != NULL in sdhci_tasklet_finish

commit 0c9c99a765321104cc5f9c97f949382a9ba4927e upstream.

It seems that under certain circumstances the sdhci_tasklet_finish()
call can be entered with mrq set to NULL, causing the system to crash
with a NULL pointer de-reference.

Seen on S3C6410 system.  Based on a patch by Dimitris Papastamos.

Reported-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agommc: sdhci: Check mrq->cmd in sdhci_tasklet_finish
Ben Dooks [Wed, 27 Apr 2011 13:24:19 +0000 (14:24 +0100)]
mmc: sdhci: Check mrq->cmd in sdhci_tasklet_finish

commit b7b4d3426d2b5ecab21578eb20d8e456a1aace8f upstream.

It seems that under certain circumstances that the sdhci_tasklet_finish()
call can be entered with mrq->cmd set to NULL, causing the system to crash
with a NULL pointer de-reference.

Unable to handle kernel NULL pointer dereference at virtual address 00000000
PC is at sdhci_tasklet_finish+0x34/0xe8
LR is at sdhci_tasklet_finish+0x24/0xe8

Seen on S3C6410 system.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agommc: sdhci-pci: Fix error case in sdhci_pci_probe_slot()
Chris Ball [Tue, 29 Mar 2011 04:46:12 +0000 (00:46 -0400)]
mmc: sdhci-pci: Fix error case in sdhci_pci_probe_slot()

commit 9fdcdbb0d84922e7ccda2f717a04ea62629f7e18 upstream.

If pci_ioremap_bar() fails during probe, we "goto release;" and free the
host, but then we return 0 -- which tells sdhci_pci_probe() that the probe
succeeded.  Since we think the probe succeeded, when we unload sdhci we'll
go to sdhci_pci_remove_slot() and it will try to dereference slot->host,
which is now NULL because we freed it in the error path earlier.

The patch simply sets ret appropriately, so that sdhci_pci_probe() will
detect the failure immediately and bail out.

Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agommc: fix a race between card-detect rescan and clock-gate work instances
Guennadi Liakhovetski [Fri, 15 Apr 2011 18:08:19 +0000 (20:08 +0200)]
mmc: fix a race between card-detect rescan and clock-gate work instances

commit 26fc8775b51484d8c0a671198639c6d5ae60533e upstream.

Currently there is a race in the MMC core between a card-detect
rescan work and the clock-gating work, scheduled from a command
completion. Fix it by removing the dedicated clock-gating mutex
and using the MMC standard locking mechanism instead.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Simon Horman <horms@verge.net.au>
Cc: Magnus Damm <damm@opensource.se>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 years agoUBIFS: seek journal heads to the latest bud in replay
Artem Bityutskiy [Mon, 25 Apr 2011 15:46:31 +0000 (18:46 +0300)]
UBIFS: seek journal heads to the latest bud in replay

commit 52c6e6f990669deac3f370f1603815adb55a1dbd upstream.

This is the second fix of the following symptom:

UBIFS error (pid 34456): could not find an empty LEB

which sometimes happens after power cuts when we mount the file-system - UBIFS
refuses it with the above error message which comes from the
'ubifs_rcvry_gc_commit()' function. I can reproduce this using the integck test
with the UBIFS power cut emulation enabled.

Analysis of the problem.

Currently UBIFS replay seeks the journal heads to the last _replayed_ bud.
But the buds are replayed out-of-order, so the replay basically seeks journal
heads to the "random" bud belonging to this head, and not to the _last_ one.

The result of this is that the GC head may be seeked to a full LEB with no free
space, or very little free space. And 'ubifs_rcvry_gc_commit()' tries to find a
fully or mostly dirty LEB to match the current GC head (because we need to
garbage-collect that dirty LEB at one go, because we do not have @c->gc_lnum).
So 'ubifs_find_dirty_leb()' fails and we fall back to finding an empty LEB and
also fail. As a result - recovery fails and mounting fails.

This patch teaches the replay to initialize the GC heads exactly to the latest
buds, i.e. the buds which have the largest sequence number in corresponding
log reference nodes.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>