firefly-linux-kernel-4.4.55.git
13 years agoserial: tegra_hsuart: Clean-up FIFO flush and set baudrate operations.
Andrei Warkentin [Tue, 15 Feb 2011 22:18:59 +0000 (16:18 -0600)]
serial: tegra_hsuart: Clean-up FIFO flush and set baudrate operations.

Do necessary waits and fifo clear according to NV. Also use 115200
as the rate set while bringing-up rx dma during init, to decrease
start-up time.

Change-Id: I5211c75607cf2880ab2b1c22ab30f2c265534a1c
Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
13 years agovideo: tegra: hdmi: enable wakeup on hotplug
Erik Gilling [Mon, 28 Feb 2011 21:25:44 +0000 (13:25 -0800)]
video: tegra: hdmi: enable wakeup on hotplug

Change-Id: Idbb3f81c3c2d8a4f7f6b76736e11dd07cdd3a413
Signed-off-by: Erik Gilling <konkers@android.com>
13 years agovideo: tegra: hdcp: move call to hdcp suspend out of atomic context
Erik Gilling [Mon, 28 Feb 2011 21:24:30 +0000 (13:24 -0800)]
video: tegra: hdcp: move call to hdcp suspend out of atomic context

Change-Id: I62a9d810637df221862898536f990eda77e50644
Signed-off-by: Erik Gilling <konkers@android.com>
13 years agovideo: tegra: hdmi: fix vic detection for avi infoframe
Erik Gilling [Mon, 28 Feb 2011 21:13:09 +0000 (13:13 -0800)]
video: tegra: hdmi: fix vic detection for avi infoframe

typeo was causing 1080p VICs to never be populated

Change-Id: Idde037cf0d4b71370cff7e65a2135b8c60a91fa0
Signed-off-by: Erik Gilling <konkers@android.com>
13 years agovideo: tegra: de-assert reset after clocks are turned on
Erik Gilling [Sat, 19 Feb 2011 00:24:37 +0000 (16:24 -0800)]
video: tegra: de-assert reset after clocks are turned on

In underflow recovery, if the clocks are not enabled when the dc is brought
out of reset writes to the DC will sometimes hang.

Change-Id: If37de79f755196550018f94080ab2beed84ca326
Signed-off-by: Erik Gilling <konkers@android.com>
13 years agoARM: tegra: fuse: Fix bug in get_spare_fuse
Colin Cross [Sun, 27 Feb 2011 00:45:47 +0000 (16:45 -0800)]
ARM: tegra: fuse: Fix bug in get_spare_fuse

get_spare_fuse was calling tegra_apb_readl and passing an
offset, but tegra_apb_readl requires a physical address.
Fix it by calling tegra_fuse_readl instead, which takes
an offset.

Fixes a crash booting on A03 parts, where get_spare_fuse
is used to determine the difference between A03 and A03
prime.

Change-Id: Ie386dc099e1c14eeb36262bfcc882e29a40a8da6
Signed-off-by: Colin Cross <ccross@android.com>
13 years ago[ARM] tegra: use APB DMA for accessing APB devices
Jon Mayo [Tue, 21 Dec 2010 23:09:33 +0000 (15:09 -0800)]
[ARM] tegra: use APB DMA for accessing APB devices

Change-Id: I165411a14342666cbac02fb8cb171580ab0826aa
Reviewed-on: http://git-master/r/14464
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Tested-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Signed-off-by: Jon Mayo <jmayo@nvidia.com>
13 years ago[ARM] tegra: add kfuse peripherial clk entry
Jon Mayo [Wed, 5 Jan 2011 19:15:21 +0000 (11:15 -0800)]
[ARM] tegra: add kfuse peripherial clk entry

Change-Id: I89fc144428b140288126790065902ea9e49b41e4
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Tested-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Signed-off-by: Jon Mayo <jmayo@nvidia.com>
13 years ago[ARM] tegra: enable kfuse clock on boot
Jon Mayo [Wed, 5 Jan 2011 19:17:30 +0000 (11:17 -0800)]
[ARM] tegra: enable kfuse clock on boot

Change-Id: I7e8d9b5fa275af738fe22be2082a709a3902bdee
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Tested-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Signed-off-by: Jon Mayo <jmayo@nvidia.com>
13 years ago[ARM] tegra: kfuse driver
Jon Mayo [Wed, 5 Jan 2011 19:18:46 +0000 (11:18 -0800)]
[ARM] tegra: kfuse driver

factory programmed encrypted key fuses held in kfuse module.
use APB DMA for accessing kfuse registers, reading directly can hang if any
other DMA is active.

Change-Id: I85e44cc169607bc22116075e28938014aa299d75
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Tested-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Signed-off-by: Jon Mayo <jmayo@nvidia.com>
13 years ago[ARM] tegra: edid modes uninitialized on i2c fail
Jon Mayo [Fri, 7 Jan 2011 03:05:38 +0000 (19:05 -0800)]
[ARM] tegra: edid modes uninitialized on i2c fail

fix unhandled i2c errors in tegra_edid_get_monspecs() that resulted in
truncated mode lists(stale data).

Change-Id: Iec7878f2a3071c5297d0569d4f1cce1c9ed48979
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Tested-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-by: Peter Zu <pzu@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Signed-off-by: Jon Mayo <jmayo@nvidia.com>
13 years ago[ARM] tegra: hdmi nvhdcp driver
Jon Mayo [Tue, 4 Jan 2011 01:26:25 +0000 (17:26 -0800)]
[ARM] tegra: hdmi nvhdcp driver

Device /dev/nvhdcpX is used to manage NVHDCP on framebuffer /dev/fbX.
These devices are created on hdmi driver initialition when it is
attached to dc. Currently only one nvhdcp device may be created. An ioctl
interface is in video/nvhdcp.h

Check for repeaters and store repeater info. userspace application
queries this status to authenticate the connection. When authentication
fails, auto-renegotiate every 1.75 seconds. Give up after 5 failed attempts,
reset after hotplug or policy change.

use TEGRA_DC_OUT_NVHDCP_POLICY_ON_DEMAND in tegra_dc_out.flags in board
panel configuration to select a different default policy at probe. Currently
only TEGRA_DC_OUT_NVHDCP_POLICY_ALWAYS_ON is supported.

Change-Id: I0db66fc86096b98d2604544061721d291523de75
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Tested-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-by: Phillip Smith <psmith@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Signed-off-by: Erik Gilling <konkers@android.com>
13 years agoARM: tegra: PL310 restore dynamic clock gating on resume
Todd Poynor [Fri, 25 Feb 2011 00:24:37 +0000 (16:24 -0800)]
ARM: tegra: PL310 restore dynamic clock gating on resume

Tegra 2.6.36 code needs to restore PL310 dynamic clock gating upon
resume from a power event.

As of 2.6.39 the PL310 is re-init'ed from scratch upon resume,
and this patch can be dropped.

Change-Id: I8c1fb1add3c3cfcffff58fab642b84d8d5a7a90a
Signed-off-by: Todd Poynor <toddpoynor@google.com>
13 years agoARM: tegra: Enable PL310 dynamic clock gating
Todd Poynor [Wed, 16 Feb 2011 20:25:36 +0000 (12:25 -0800)]
ARM: tegra: Enable PL310 dynamic clock gating

The cache controller will stop its clock when idle after several
clock cycles.

Change-Id: Ifc9997d4e7fd4f1e3c6129bac2fd42f8995a069e
Signed-off-by: Todd Poynor <toddpoynor@google.com>
13 years agoARM: PL310: Add power control register definition
Todd Poynor [Wed, 16 Feb 2011 04:41:45 +0000 (20:41 -0800)]
ARM: PL310: Add power control register definition

Change-Id: Ia1f759aab15a241e8e29447622cd1e2998fa745c
Signed-off-by: Todd Poynor <toddpoynor@google.com>
13 years agovideo: tegra: add some missing mutex locking to nvhost_cdma
Prajakta Gudadhe [Tue, 1 Feb 2011 22:56:00 +0000 (14:56 -0800)]
video: tegra: add some missing mutex locking to nvhost_cdma

Change-Id: Ie4606d9a5154090274168babc110ea2d79747c05
Signed-off-by: Erik Gilling <konkers@android.com>
13 years agovideo: tegra: nvmap: Fix broken optimization
kartamonov [Mon, 14 Feb 2011 12:22:46 +0000 (14:22 +0200)]
video: tegra: nvmap: Fix broken optimization

An attempt had been made to reduce the number of pte operations
while patching relocs.  The optimization was incorrectly coded
and was not providing the expected speedup.

Credit for the find goes to Peter Pipkorn.

Change-Id: Ic83b20ee470e54d5053f747dbcbdf7b038b7c7c4
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
13 years ago[ARM] tegra: Enable pl310 data prefetching and prefetch offset
Chris Fries [Fri, 11 Feb 2011 20:26:20 +0000 (14:26 -0600)]
[ARM] tegra: Enable pl310 data prefetching and prefetch offset

Enable data prefetching in the L2 cache controller, and set
the prefetch offset to 7.

Memcpy performance measured copying 16 MB buffers 78 times:
Data prefetch disabled, prefetch offset 0: 440 MB/s
Enabling data prefetching, prefetch offset 0: 430 MB/s
Enabling data prefetching, prefetch offset 7: 502 MB/s

Overall, this patch gives a 14% improvement in memcpy performance.

Prefetch offset of 8 causes prefetches to cross 4k boundaries
and cannot be used.

Original-author: Gary King <gking@nvidia.com>
Signed-off-by: Chris Fries <C.Fries@motorola.com>
Signed-off-by: Colin Cross <ccross@android.com>
Change-Id: I7ce0810b3f94edc2640df3f643cf81357052f2f1

13 years agoRevert "mmc: subtract boot sectors from disk size for eMMC 4.3+ devices"
Colin Cross [Fri, 28 Jan 2011 00:12:58 +0000 (16:12 -0800)]
Revert "mmc: subtract boot sectors from disk size for eMMC 4.3+ devices"

This reverts commit 2cdc235bbeb09b2b78cd02a94ab79c265861aea9.

The reverted commit incorrectly calculates the size of eMMC
devices in some (all?) cases.

This revert may cause problems in cases where the bootloader was
bug-compatible and puts a GPT partition at the incorrect end of
the eMMC device.

Change-Id: Icc9ddb3d294aa2a1caeddfe8fedd2e12aa7691e1

13 years agoRevert "mmc: fix non-arm build due to eMMC 4.3+ change"
Colin Cross [Fri, 28 Jan 2011 00:12:55 +0000 (16:12 -0800)]
Revert "mmc: fix non-arm build due to eMMC 4.3+ change"

This reverts commit 1c119f2c1667ea2747693f7fd2166205e1a10b09.

13 years agoARM: tegra: Handle timers during LP2 idle ticks
Todd Poynor [Mon, 7 Feb 2011 21:42:34 +0000 (13:42 -0800)]
ARM: tegra: Handle timers during LP2 idle ticks

Timer ticks aren't properly serviced while a CPU is in LP2 idle.
Although the Tegra LP2 idle code calls hrtimer_peek_ahead_timers,
because no IRQ regs have been saved, update_process_times is not
called, and thus the timer list is not serviced (and neither is
SMP rebalancing, etc.)  This can cause significant delays
scheduling timer-based activity, especially on CPU 1 (which is
not servicing most other IRQs).

Colin Cross suggested a patch based on upstream review feedback
that uses clock notifiers to switch to the "broadcast" clock event
source ("timer0" Tegra timer 3) during LP2, which has a real
interrupt handler defined that calls the clock event handler in
IRQ context, allowing timers to be checked.

Change-Id: Ifa3f4ec662f07dc9636e433f278358f75b65d10c
Signed-off-by: Todd Poynor <toddpoynor@google.com>
13 years agoUSB: ehci: tegra: Align DMA transfers to 32 bytes
Robert Morell [Thu, 27 Jan 2011 03:06:49 +0000 (19:06 -0800)]
USB: ehci: tegra: Align DMA transfers to 32 bytes

The Tegra2 USB controller doesn't properly deal with misaligned DMA
buffers, causing corruption.  This is especially prevalent with USB
network adapters, where skbuff alignment is often in the middle of a
4-byte dword.

To avoid this, allocate a temporary buffer for the DMA if the provided
buffer isn't sufficiently aligned.

Signed-off-by: Robert Morell <rmorell@nvidia.com>
13 years agoUSB: HCD: Add driver hooks for (un)?map_urb_for_dma
Robert Morell [Thu, 27 Jan 2011 03:06:48 +0000 (19:06 -0800)]
USB: HCD: Add driver hooks for (un)?map_urb_for_dma

Provide optional hooks for the host controller driver to override the
default DMA mapping and unmapping routines.  In general, these shouldn't
be necessary unless the host controller has special DMA requirements,
such as alignment contraints.  If these are not specified, the
general usb_hcd_(un)?map_urb_for_dma functions will be used instead.
Also, pass the status to unmap_urb_for_dma so it can know whether the
DMA buffer has been overwritten.

Finally, add a flag to be used by these implementations if they
allocated a temporary buffer so it can be freed properly when unmapping.

Signed-off-by: Robert Morell <rmorell@nvidia.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: HCD: Add usb_hcd prefix to exported functions
Robert Morell [Thu, 27 Jan 2011 03:06:47 +0000 (19:06 -0800)]
USB: HCD: Add usb_hcd prefix to exported functions

The convention is to prefix symbols exported from the USB HCD core with
"usb_hcd".  This change makes unmap_urb_setup_for_dma() and
unmap_urb_for_dma() consistent with that.

Signed-off-by: Robert Morell <rmorell@nvidia.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agovideo: tegra: only enable HDMI features if detected from edid
Erik Gilling [Mon, 7 Feb 2011 03:33:45 +0000 (19:33 -0800)]
video: tegra: only enable HDMI features if detected from edid

Change-Id: I94c5c83c25a8aa1de344339f5759953074488720
Signed-off-by: Erik Gilling <konkers@android.com>
13 years agovideo: fbmon: add HDMI dectetion to fbmod edid parsing
Erik Gilling [Mon, 7 Feb 2011 03:32:17 +0000 (19:32 -0800)]
video: fbmon: add HDMI dectetion to fbmod edid parsing

Looks for ieee registration numver 0x000c03 as per HDMI spec.

Change-Id: I6875b24c66e8754510edabcb4f9ba682a50d6ac1
Signed-off-by: Erik Gilling <konkers@android.com>
13 years agovideo: tegra: add height/width to dc and fb
Erik Gilling [Thu, 3 Feb 2011 21:15:50 +0000 (13:15 -0800)]
video: tegra: add height/width to dc and fb

Change-Id: I22c280928079af04263375fce63a87776588a457
Signed-off-by: Erik Gilling <konkers@android.com>
13 years agovideo: tegra: set h/v sync polarity for HDMI
Erik Gilling [Wed, 2 Feb 2011 23:28:32 +0000 (15:28 -0800)]
video: tegra: set h/v sync polarity for HDMI

Change-Id: I4be0eb963c3779b9313ef94476b1589059d4aa3c
Signed-off-by: Erik Gilling <konkers@android.com>
13 years agovideo: tegra: support v/h sync polarity
Erik Gilling [Wed, 2 Feb 2011 20:12:31 +0000 (12:12 -0800)]
video: tegra: support v/h sync polarity

Change-Id: Ida82a70efaeadc9d5b11d8703e688063680b72a8
Signed-off-by: Erik Gilling <konkers@android.com>
13 years agovideo: tegra: correct HDMI h/vsync polairty in some modes
Erik Gilling [Tue, 1 Feb 2011 21:01:55 +0000 (13:01 -0800)]
video: tegra: correct HDMI h/vsync polairty in some modes

Change-Id: I0e988d1724461ff2d5bd1009f2fdc379bd154703
Signed-off-by: Erik Gilling <konkers@android.com>
13 years ago[ARM] tegra_i2s_audio: separate TX/RX DMA setup
Eric Laurent [Fri, 28 Jan 2011 17:13:22 +0000 (09:13 -0800)]
[ARM] tegra_i2s_audio: separate TX/RX DMA setup

Fixed a problem preventing independent setup/teardown
of TX and RX DMAs when setting playback or capture buffer count.

Signed-off-by: Eric Laurent <elaurent@google.com>
13 years agoARM: tegra: usb_phy: Configure USB1 PHY to use programmed value
Nathan Connell [Wed, 12 Jan 2011 20:32:24 +0000 (14:32 -0600)]
ARM: tegra: usb_phy: Configure USB1 PHY to use programmed value

instead of fused value.  This is required
to meet High Speed USB signaling requirements.

Change-Id: I659b33faa950605ecf040598112e1972047ae7ad
Signed-off-by: Nathan Connell <w14185@motorola.com>
13 years agowatchdog: tegra_wdt: Several changes to watchdog driver
Dmitriy Gruzman [Tue, 25 Jan 2011 02:52:02 +0000 (20:52 -0600)]
watchdog: tegra_wdt: Several changes to watchdog driver

Fix not re-enabling watchdog resume if it was enabled in probe
Add clearing watchdog interrupt in probe
Remove tegra_wdt_set_timeout

Change-Id: I8fdbb6da3eda64a85a73ed85ab979a5ee0261c37
Signed-off-by: Dmitriy Gruzman <dmitriy.gruzman@motorola.com>
13 years agousb: host: tegra: Request 400MHz emc clock
Benoit Goby [Tue, 25 Jan 2011 20:14:52 +0000 (12:14 -0800)]
usb: host: tegra: Request 400MHz emc clock

while USB is active to eliminate all USB buffer underruns.

Change-Id: I9977224601e715e950284708958be98d37b3e6b1
Signed-off-by: Nathan Connell <w14185@motorola.com>
13 years agousb: gadget: tegra_udc: Request 400MHz emc clock
Benoit Goby [Tue, 25 Jan 2011 20:13:52 +0000 (12:13 -0800)]
usb: gadget: tegra_udc: Request 400MHz emc clock

while USB is active to eliminate all USB buffer underruns.

Change-Id: I7ad8ebfa2d802f91b81839e14fde906da1a0569e
Signed-off-by: Nathan Connell <w14185@motorola.com>
13 years agovideo: tegra: nvmap: Several changes to carveout killer
Rebecca Schultz Zavin [Mon, 24 Jan 2011 22:16:47 +0000 (14:16 -0800)]
video: tegra: nvmap: Several changes to carveout killer

-Add a module param to enable/disable carveout killer
-Fix race condition in code to wait for something to free memory
after firing carveout killer
-Fix the check for current so we always compare task->group_leaders

Change-Id: Ie030978827dce6b0fbbfa1db0d80e4abe59eaa51
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
13 years agovideo: tegra: incresase delay in underflow recovery
Erik Gilling [Mon, 24 Jan 2011 23:28:31 +0000 (15:28 -0800)]
video: tegra: incresase delay in underflow recovery

Change-Id: I8093c83a2749c63b6ece051cc9b892d87e55fe04
Signed-off-by: Erik Gilling <konkers@android.com>
13 years agovideo: tegra: dump host state when timing out on suspend
Erik Gilling [Mon, 24 Jan 2011 20:35:11 +0000 (12:35 -0800)]
video: tegra: dump host state when timing out on suspend

Change-Id: I718fb071ac74f5a051a7d5b9fcdd782163ed48b6
Signed-off-by: Erik Gilling <konkers@android.com>
13 years agoARM: tegra: Prevent dynamically ioremapping device io memory
Colin Cross [Sat, 22 Jan 2011 01:04:36 +0000 (17:04 -0800)]
ARM: tegra: Prevent dynamically ioremapping device io memory

Change-Id: I893a42bd773b1acdf2b83f8602fe1aa6a8ea6741
Signed-off-by: Colin Cross <ccross@android.com>
13 years agoARM: tegra: Statically map all device io memory
Colin Cross [Sat, 22 Jan 2011 01:04:07 +0000 (17:04 -0800)]
ARM: tegra: Statically map all device io memory

Change-Id: I0c750b766dcdd166ddff6317b93556f9f5cce899
Signed-off-by: Colin Cross <ccross@android.com>
13 years agousb: gadget: tegra: Enable emc clock while usb is connected
Benoit Goby [Thu, 20 Jan 2011 23:42:52 +0000 (15:42 -0800)]
usb: gadget: tegra: Enable emc clock while usb is connected

Change-Id: Icb94c516a580e29b42b1899e622c9b91f8701dd2
Signed-off-by: Benoit Goby <benoit@android.com>
13 years agoARM: tegra: clocks: Add shared emc clocks for usb gadget
Benoit Goby [Thu, 20 Jan 2011 23:41:58 +0000 (15:41 -0800)]
ARM: tegra: clocks: Add shared emc clocks for usb gadget

Change-Id: Idf1982fac02b987cb16ef89509cfe4d72953d1e5
Signed-off-by: Benoit Goby <benoit@android.com>
13 years agousb: host: tegra: Enable emc clock while usb is resumed
Benoit Goby [Thu, 20 Jan 2011 22:19:04 +0000 (14:19 -0800)]
usb: host: tegra: Enable emc clock while usb is resumed

Change-Id: I03a102f40134686fabbd5cfa1830816a691cf876
Signed-off-by: Benoit Goby <benoit@android.com>
13 years agoARM: tegra: clocks: Add shared emc clocks for ehci driver
Benoit Goby [Thu, 20 Jan 2011 23:18:18 +0000 (15:18 -0800)]
ARM: tegra: clocks: Add shared emc clocks for ehci driver

Change-Id: I02f9d798159e14007fa2e5abfc3493a2d779d515
Signed-off-by: Benoit Goby <benoit@android.com>
13 years agoARM: tegra: DVFS: set 1.2V core voltage for USB to work
Jay Cheng [Thu, 20 Jan 2011 21:09:32 +0000 (16:09 -0500)]
ARM: tegra: DVFS: set 1.2V core voltage for USB to work

Change-Id: Idb7822329f1975307748a72d1786da68c0635738
Signed-off-by: Jay Cheng <jacheng@nvidia.com>
13 years agousb: host: tegra: Fix SetPortFeature PORT_SUSPEND
Benoit Goby [Wed, 19 Jan 2011 03:38:23 +0000 (19:38 -0800)]
usb: host: tegra: Fix SetPortFeature PORT_SUSPEND

This fixes a regression where hubs cannot detect new devices once they
have been auto-suspended.

Change-Id: I4b3efcaa9634b9a912060e438527000bbc83dc32
Signed-off-by: Benoit Goby <benoit@android.com>
13 years agousb: host: tegra: Fix resuming low speed devices from lp0
Benoit Goby [Tue, 18 Jan 2011 20:56:16 +0000 (12:56 -0800)]
usb: host: tegra: Fix resuming low speed devices from lp0

Change-Id: I9576853bbe0fae52c5c2cfab26ce8f2017077d4e
Signed-off-by: Benoit Goby <benoit@android.com>
13 years agoARM: tegra: usb_phy: Program DPDM_OBSERVE depending on the device speed
Benoit Goby [Wed, 19 Jan 2011 00:57:48 +0000 (16:57 -0800)]
ARM: tegra: usb_phy: Program DPDM_OBSERVE depending on the device speed

Low speed devices require a K-state resume signaling instead of J.

Change-Id: Ic06011f45c2b0f4cd969d018f2783acea57cb510
Signed-off-by: Benoit Goby <benoit@android.com>
13 years agocrypto: tegra-aes: perf: remove unnecessary polling and memset
Varun Wadekar [Fri, 14 Jan 2011 07:49:25 +0000 (13:19 +0530)]
crypto: tegra-aes: perf: remove unnecessary polling and memset

Change-Id: I69731fcd50933ccea73542d046c3c5d86d03fcd9
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
13 years agovideo: tegra: host: Force memory bus to full when using 2d, 3d or mpe
Colin Cross [Fri, 14 Jan 2011 23:07:27 +0000 (15:07 -0800)]
video: tegra: host: Force memory bus to full when using 2d, 3d or mpe

Change-Id: I7138af5d26c3f406537bc4b2bc4bb052de37f7bf
Signed-off-by: Colin Cross <ccross@android.com>
13 years agoARM: tegra: clock: Add shared emc clock for tegra_grhost
Colin Cross [Fri, 14 Jan 2011 23:06:58 +0000 (15:06 -0800)]
ARM: tegra: clock: Add shared emc clock for tegra_grhost

Change-Id: Ie2814726d151777140c20d2bc0a3c1a3822043a8
Signed-off-by: Colin Cross <ccross@android.com>
13 years agoARM: tegra: clock: Add round_rate op for shared clocks
Colin Cross [Fri, 14 Jan 2011 23:06:29 +0000 (15:06 -0800)]
ARM: tegra: clock: Add round_rate op for shared clocks

Change-Id: Ica3f9fd9db4fe38f2c9ca3fc248526211f59c622
Signed-off-by: Colin Cross <ccross@android.com>
13 years agovideo: tegra: host: disable MPE auto-power-gate
Mayuresh Kulkarni [Fri, 14 Jan 2011 02:22:43 +0000 (18:22 -0800)]
video: tegra: host: disable MPE auto-power-gate

It is seen that auto-power-gate of MPE causes some issues when long run
camera stress test is run. The issue manifest itself in the form of
MPE sync-point not getting triggered from hardware and hence the caller
who is waiting on it hangs up the system.

Disabling auto-power-gate for MPE seems to resolve this issue.

Original work of Jay Cheng <jacheng@nvidia.com>
Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Change-Id: Iaef9f959cbc00dd715352ca637955cd2bea6f355

13 years agovideo: tegra: nvmap: Several fixes to the carveout killer
Rebecca Schultz Zavin [Thu, 13 Jan 2011 00:22:36 +0000 (16:22 -0800)]
video: tegra: nvmap: Several fixes to the carveout killer

-Modify the carveout killer to only kill tasks with lower priorities
than the one that's trying to allocate
-After delivering a sigkill to a task, wait for something to exit and
cleanup before retrying the allocation

Change-Id: If62b6ed008a73fc3c347ff26735a83eee284909e
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
13 years agovideo: tegra: reset default window in release
Sergey Kudakov [Thu, 21 Oct 2010 22:55:50 +0000 (17:55 -0500)]
video: tegra: reset default window in release

Change-Id: I242e9fac525472c5c20f213a6de516f95b2f6a12
Cc: Sergey Kudakov <sergey.kudakov@motorola.com>
Signed-off-by: Erik Gilling <konkers@android.com>
13 years agocrypto: tegra-aes: Hack to disable HW AES for dm-crypt
Ken Sumrall [Wed, 12 Jan 2011 23:58:37 +0000 (15:58 -0800)]
crypto: tegra-aes: Hack to disable HW AES for dm-crypt

The hardware aes engine is required for key management for
HDCP, but since it's performance is bad, we don't want it
enabled for dm-crypt.  This hack changes the cra_name field
so dm-crypt won't find a match, but leaves the cra_driver_name
field unchanged to the device file interface will still find it.

Signed-off-by: Ken Sumrall <ksumrall@android.com>
13 years agocrypto: tegra-aes: improve encrypt/decrypt performance
Varun Wadekar [Wed, 12 Jan 2011 20:59:14 +0000 (02:29 +0530)]
crypto: tegra-aes: improve encrypt/decrypt performance

- enable/disable clocks only once per request
- create a thread for handling the driver's work queue
- always set vde clocks to the max before processing a request

Change-Id: I935e5523e9e913c93705cc694f8a475d212c15ce
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
13 years agovideo: tegra: nvmap: Don't store task struct for kernel threads
Rebecca Schultz Zavin [Wed, 12 Jan 2011 19:10:34 +0000 (11:10 -0800)]
video: tegra: nvmap: Don't store task struct for kernel threads

No need to maintain a reference to the task struct if the client
is a kernel thread.  In this case just set the task to NULL.

Change-Id: Ica4785388932f6b298eeb0da04b78b0e1cdc3a44
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
13 years agocrypto: tegra-aes: call INIT_COMPLETION before setting the transfer
Varun Wadekar [Tue, 11 Jan 2011 08:33:54 +0000 (14:03 +0530)]
crypto: tegra-aes: call INIT_COMPLETION before setting the transfer

Change-Id: I368a9bf8aa1c311532e54d18a813b556576b8da1
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
13 years agocrypto: tegra-aes: do not reset bsev/vde per operation
Varun Wadekar [Fri, 7 Jan 2011 13:02:00 +0000 (18:32 +0530)]
crypto: tegra-aes: do not reset bsev/vde per operation

avp does not use the crypto engine inside the vde block,
so it is ok if we do not reset the entire block before
any crypto operation. this would save more than 100us per crypto
operation.

Change-Id: I4e6f4940c5b6e95498b6f7a62498fbf956e25254
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
13 years ago[ARM] tegra_i2s_audio: fixed several issues
Eric Laurent [Wed, 12 Jan 2011 03:39:58 +0000 (19:39 -0800)]
[ARM] tegra_i2s_audio: fixed several issues

- Acquire the DMA request spinlock in dma_tx_complete_callback()
(this was omitted)
- allow_suspend() was called by mistake in start_recording_if_necessary()
every time it was executed which could cause the wake lock to be
released during audio capture.

Signed-off-by: Eric Laurent <elaurent@google.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
13 years agoARM: tegra: clock: Round frequency up in clock dividers
Colin Cross [Wed, 12 Jan 2011 00:59:55 +0000 (16:59 -0800)]
ARM: tegra: clock: Round frequency up in clock dividers

When picking clock divider values, the clock framework picks
the closest frequency that is lower than the requested
frequency.  If the value from a clock divider rounds down,
and then the new rounded down frequency is requested, it
will get rounded down again, resulting in a frequency two
steps lower than the original requested frequency.

Fix the problem by rounding up when calculating the frequency
coming out of a clock divider, so if that frequency is
requested again, the same divider value will be picked.

Change-Id: Ieaf74448f67d91aeb7ba08226e48c092d8afaa2b
Signed-off-by: Colin Cross <ccross@android.com>
13 years agovideo: tegra: work around overlay corruption on underflows
Erik Gilling [Wed, 12 Jan 2011 00:32:20 +0000 (16:32 -0800)]
video: tegra: work around overlay corruption on underflows

Overlays can get their internal state corrupted during and underflow
condition.  The only way to fix this state is to reset the DC.  If we get
4 consecutive frames with underflows, assume we're hosed and reset.

Change-Id: Icdf61517837c8570b8de35f585075de08aa35fe7
Signed-off-by: Erik Gilling <konkers@android.com>
Cc: Michael I. Gold <gold@nvidia.com>
13 years agowatchdog: tegra_wdt: Several changes to watchdog driver
Rebecca Schultz Zavin [Tue, 11 Jan 2011 23:35:47 +0000 (15:35 -0800)]
watchdog: tegra_wdt: Several changes to watchdog driver

Add a config option to enable the watchdog driver from probe
Reduce the default timeout to 30 seconds
Read the reset reason and print a messge if the last reboot was
due to watchdog reset

Change-Id: I7500ef236089b06ffcff3d8e7d86a5b9060b59cb
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
13 years agoARM: tegra: clock: Save and restore audio clock during suspend
Colin Cross [Tue, 11 Jan 2011 20:15:01 +0000 (12:15 -0800)]
ARM: tegra: clock: Save and restore audio clock during suspend

Change-Id: Id1c7a6c8e8679995ad462f17309c2f3550c00da1
Signed-off-by: Colin Cross <ccross@android.com>
13 years agoARM: tegra: clock: Save and restore plld, plls, and pllu in suspend
Colin Cross [Tue, 11 Jan 2011 02:39:43 +0000 (18:39 -0800)]
ARM: tegra: clock: Save and restore plld, plls, and pllu in suspend

HDMI was not working after LP0 because the plld were being reset
during suspend.  plls and pllu were also not being saved.  Add
all three to tegra_clk_suspend.

The lock time for plld is 1000 us, so increase the delay after
setting the PLLs.

Add a BUG_ON to ensure the size of the suspend context area is
correct.

Originally fixed by Mayuresh Kulkarni.

Original-author: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Change-Id: I50a3e994c6e3cab5989aa7a8e26e7a2eb66b6dfb
Signed-off-by: Colin Cross <ccross@android.com>
13 years agoARM: tegra: Fix powergate_debugfs_init return value
Benoit Goby [Mon, 10 Jan 2011 22:58:00 +0000 (14:58 -0800)]
ARM: tegra: Fix powergate_debugfs_init return value

Change-Id: Iff865e0f74e1667aa6e998a63d33d3b4cd09694c
Signed-off-by: Benoit Goby <benoit@android.com>
13 years agovideo: tegra: nvmap: Add carveout killer
Rebecca Schultz Zavin [Fri, 3 Dec 2010 23:43:33 +0000 (15:43 -0800)]
video: tegra: nvmap: Add carveout killer

This change attempts to reclaim carveout memory by killing
other carveout users when an allocation fails.  Processes
are killed in order of priority from lowest to highest, and then
from largest to smallest users.

Change-Id: Iee8a6f36269bc8165d691000a153dbf9f4337775
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
13 years agoARM: tegra: pll_a clock fixes
Stephen Warren [Wed, 5 Jan 2011 00:47:55 +0000 (17:47 -0700)]
ARM: tegra: pll_a clock fixes

Increase the max_frequency entries for clocks that can be driven from pll_a
to match the fastest pll_a table entry.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Colin Cross <ccross@android.com>
13 years agoARM: tegra: Prevent requeuing in-progress DMA requests
Stephen Warren [Wed, 5 Jan 2011 21:24:12 +0000 (14:24 -0700)]
ARM: tegra: Prevent requeuing in-progress DMA requests

If a request already in the queue is passed to tegra_dma_enqueue_req,
tegra_dma_req.node->{next,prev} will end up pointing to itself instead
of at tegra_dma_channel.list, which is the way a the end-of-list
should be set up. When the DMA request completes and is list_del'd,
the list head will still point at it, yet the node's next/prev will
contain the list poison values. When the next DMA request completes,
a kernel panic will occur when those poison values are dereferenced.

This makes the DMA driver more robust in the face of buggy clients.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Colin Cross <ccross@android.com>
13 years agortc: tps6586x: Fix error in RTC tick calculations
Lowell Dennis [Wed, 15 Dec 2010 00:35:17 +0000 (16:35 -0800)]
rtc: tps6586x: Fix error in RTC tick calculations

In the TPS6586x PMU/PMIC RTC support code, when
converting from seconds to ticks using a shift
operator, the most significant bits were being lost
due to seconds being a 32-bit value and ticks being
a 64-bit value.  A hard cast was added to avoid this
loss.

Reviewed-by: Lowell Dennis <ldennis@nvidia.com>
Tested-by: Lowell Dennis <ldennis@nvidia.com>
Reviewed-by: Jonathan Mayo <jmayo@nvidia.com>
Reviewed-by: Peter Zu <pzu@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Signed-off-by: Robert Morell <rmorell@nvidia.com>
Signed-off-by: Colin Cross <ccross@android.com>
13 years agousb: ehci: tegra: continues driving FS-J during resume
Jay Cheng [Fri, 7 Jan 2011 07:03:46 +0000 (02:03 -0500)]
usb: ehci: tegra: continues driving FS-J during resume

To prevent USB glitch.
Also only program PTC bits when resume from LP0

Change-Id: Iced668e33f986828d3a483b411055948b5b257e1
Signed-off-by: Jay Cheng <jacheng@nvidia.com>
13 years agoARM: tegra: usb_phy: continues driving FS-J during resume
Jay Cheng [Fri, 7 Jan 2011 07:03:46 +0000 (02:03 -0500)]
ARM: tegra: usb_phy: continues driving FS-J during resume

to prevent USB glitch.

Change-Id: Iced668e33f986828d3a483b411055948b5b257e1
Signed-off-by: Jay Cheng <jacheng@nvidia.com>
13 years agousb: ehci: tegra: remove reschedule rh_timer
Jay Cheng [Thu, 6 Jan 2011 05:16:18 +0000 (00:16 -0500)]
usb: ehci: tegra: remove reschedule rh_timer

Reschedule rh_timer may cause usb device resume fail, as rh_timer may be
timeout and send USB_REQ_GET_STATUS SETUP control transfer by the time when
the device is handling clear suspend feature, which in turn the device may
drop clear suspend feature request.

Actually on port resume case, the host driver don't need to reschedule
rh_timer to check port status. The host driver will check port status right
after suspend feature is cleared.

Change-Id: I6205e97af49ed4349b6215b851f6b5f1394258d8
Signed-off-by: Jay Cheng <jacheng@nvidia.com>
13 years agoARM: tegra: powergate: Allow calling power up when already powered
Colin Cross [Sat, 8 Jan 2011 21:59:15 +0000 (13:59 -0800)]
ARM: tegra: powergate: Allow calling power up when already powered

Allow calling tegra_powergate_sequence_power_up on a partition
that is already powered.  Reset the partition, and return success
with the clock enabled.

Change-Id: I776c6a84091f0bb8faca22d87b3fabf0cfede564
Signed-off-by: Colin Cross <ccross@android.com>
13 years agoNCT1008 temperature sensor driver
Todd Poynor [Mon, 20 Dec 2010 23:05:52 +0000 (15:05 -0800)]
NCT1008 temperature sensor driver

Replace the PM-only driver for NCT1008 with a new version written by
Varun Wadekar and Dmitriy Gruzman.  Add a callback to an alarm
function specified in the board platform data.

Change-Id: Ib429533930ee75af3402d24b0bc286da9f6ee67b
Signed-off-by: Todd Poynor <toddpoynor@google.com>
13 years agomisc: Initial NCT1008 driver
Greg Meiste [Tue, 16 Nov 2010 19:33:06 +0000 (13:33 -0600)]
misc: Initial NCT1008 driver

Initial version of the NCT1008 driver to turn off the sensor when the
device is suspended.  This improves standby current drain.

Change-Id: Ia64613c33c0052434d5e304c434605611e5ef789
Signed-off-by: Greg Meiste <w30289@motorola.com>
13 years agovideo: tegra: fix debug regs file hang
Erik Gilling [Sat, 8 Jan 2011 02:45:43 +0000 (18:45 -0800)]
video: tegra: fix debug regs file hang

Change-Id: I2bdfe5ec9f69b7b7960e59bec76fb9b02b61f3fb
Signed-off-by: Erik Gilling <konkers@android.com>
13 years agoMerge commit 'v2.6.36.3' into linux-tegra-2.6.36
Colin Cross [Sat, 8 Jan 2011 01:14:48 +0000 (17:14 -0800)]
Merge commit 'v2.6.36.3' into linux-tegra-2.6.36

13 years agocrytpo: tegra-aes: make aes_handle_req aynschronous
Varun Wadekar [Tue, 28 Dec 2010 09:31:18 +0000 (15:01 +0530)]
crytpo: tegra-aes: make aes_handle_req aynschronous

the encrypt/decrypt callbacks have to return with -EINPROGRESS
error code and the request complete callback needs to be
called from handle_req for aynchronous block ciphers. use
work queue to make the driver asynchronous.

Change-Id: I0dec1185c31e5de7ba039c39d6bd87c8b3487b2a
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
13 years agoLinux 2.6.36.3
Greg Kroah-Hartman [Fri, 7 Jan 2011 22:39:58 +0000 (14:39 -0800)]
Linux 2.6.36.3

13 years agogspca - sonixj: Add a flag in the driver_info table
Jean-Francois Moine [Tue, 14 Dec 2010 19:15:37 +0000 (16:15 -0300)]
gspca - sonixj: Add a flag in the driver_info table

commit c6c14330717f9850b4b4c054b81424b9979cd07d upstream.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agogspca - sonixj: Set the flag for some devices
Jean-Francois Moine [Tue, 14 Dec 2010 19:16:16 +0000 (16:16 -0300)]
gspca - sonixj: Set the flag for some devices

commit b2272a49e7df37732d73988f00468ce31e1ebc92 upstream.

The flag PDN_INV indicates that the sensor pin S_PWR_DN has not the same
value as other webcams with the same sensor. For now, only two webcams have
been so detected: the Microsoft's VX1000 and VX3000.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoorinoco: initialise priv->hw before assigning the interrupt
David Kilroy [Tue, 7 Dec 2010 18:50:42 +0000 (18:50 +0000)]
orinoco: initialise priv->hw before assigning the interrupt

commit 229bd792be0bad245b78ed8f119952733a4752e5 upstream.

The interrupt handler takes a lock - but since commit bcad6e80f3f this
lock goes through an indirection specified in the hermes_t structure.
We must therefore initialise the structure before setting up the
interrupt handler.

Fix orinoco_cs and spectrum_cs

<https://bugzilla.kernel.org/show_bug.cgi?id=23932>

Bisected by: Matt Domsch <Matt_Domsch@dell.com>
Signed-off by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoDon't export format_by_forcc on two different drivers
Mauro Carvalho Chehab [Thu, 2 Dec 2010 03:57:03 +0000 (01:57 -0200)]
Don't export format_by_forcc on two different drivers

commit a757ee2216211278680dd8ac869aabe7b4a9970d upstream.

Drivers should append their name on exported symbols, to avoid
conflicts with allyesconfig:

drivers/staging/built-in.o: In function `format_by_fourcc':
/home/v4l/work_trees/linus/drivers/staging/cx25821/cx25821-video.c:96: multiple definition of `format_by_fourcc'
drivers/media/built-in.o:/home/v4l/work_trees/linus/drivers/media/common/saa7146_video.c:88: first defined here

Let's rename both occurences with a small shellscript:

for i in drivers/staging/cx25821/*.[ch]; do sed s,format_by_fourcc,cx25821_format_by_fourcc,g <$i >a && mv a $i; done
for i in drivers/media/common/saa7146*.[ch]; do sed s,format_by_fourcc,saa7146_format_by_fourcc,g <$i >a && mv a $i; done
for i in include/media/saa7146*.[ch]; do sed s,format_by_fourcc,saa7146_format_by_fourcc,g <$i >a && mv a $i; done

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agomx2_camera: fix pixel clock polarity configuration
Baruch Siach [Wed, 27 Oct 2010 07:03:52 +0000 (04:03 -0300)]
mx2_camera: fix pixel clock polarity configuration

commit 42cc37fe20cc680fb58fe12ae5ba718d683b8ca2 upstream.

When SOCAM_PCLK_SAMPLE_FALLING, just leave CSICR1_REDGE unset, otherwise we get
the inverted behaviour.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoposix-cpu-timers: workaround to suppress the problems with mt exec
Oleg Nesterov [Fri, 5 Nov 2010 15:53:42 +0000 (16:53 +0100)]
posix-cpu-timers: workaround to suppress the problems with mt exec

commit e0a70217107e6f9844628120412cb27bb4cea194 upstream.

posix-cpu-timers.c correctly assumes that the dying process does
posix_cpu_timers_exit_group() and removes all !CPUCLOCK_PERTHREAD
timers from signal->cpu_timers list.

But, it also assumes that timer->it.cpu.task is always the group
leader, and thus the dead ->task means the dead thread group.

This is obviously not true after de_thread() changes the leader.
After that almost every posix_cpu_timer_ method has problems.

It is not simple to fix this bug correctly. First of all, I think
that timer->it.cpu should use struct pid instead of task_struct.
Also, the locking should be reworked completely. In particular,
tasklist_lock should not be used at all. This all needs a lot of
nontrivial and hard-to-test changes.

Change __exit_signal() to do posix_cpu_timers_exit_group() when
the old leader dies during exec. This is not the fix, just the
temporary hack to hide the problem for 2.6.37 and stable. IOW,
this is obviously wrong but this is what we currently have anyway:
cpu timers do not work after mt exec.

In theory this change adds another race. The exiting leader can
detach the timers which were attached to the new leader. However,
the window between de_thread() and release_task() is small, we
can pretend that sys_timer_create() was called before de_thread().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agox86/microcode: Fix double vfree() and remove redundant pointer checks before vfree()
Jesper Juhl [Sat, 25 Dec 2010 18:57:41 +0000 (19:57 +0100)]
x86/microcode: Fix double vfree() and remove redundant pointer checks before vfree()

commit 5cdd2de0a76d0ac47f107c8a7b32d75d25768dc1 upstream.

In arch/x86/kernel/microcode_intel.c::generic_load_microcode()
we have  this:

while (leftover) {
...
if (get_ucode_data(mc, ucode_ptr, mc_size) ||
    microcode_sanity_check(mc) < 0) {
vfree(mc);
break;
}
...
}

if (mc)
vfree(mc);

This will cause a double free of 'mc'. This patch fixes that by
just  removing the vfree() call in the loop since 'mc' will be
freed nicely just  after we break out of the loop.

There's also a second change in the patch. I noticed a lot of
checks for  pointers being NULL before passing them to vfree().
That's completely  redundant since vfree() deals gracefully with
being passed a NULL pointer.  Removing the redundant checks
yields a nice size decrease for the object  file.

Size before the patch:
   text    data     bss     dec     hex filename
   4578     240    1032    5850    16da arch/x86/kernel/microcode_intel.o
Size after the patch:
   text    data     bss     dec     hex filename
   4489     240     984    5713    1651 arch/x86/kernel/microcode_intel.o

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
Cc: Shaohua Li <shaohua.li@intel.com>
LKML-Reference: <alpine.LNX.2.00.1012251946100.10759@swampdragon.chaosbits.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoblock: Deprecate QUEUE_FLAG_CLUSTER and use queue_limits instead
Martin K. Petersen [Wed, 1 Dec 2010 18:41:49 +0000 (19:41 +0100)]
block: Deprecate QUEUE_FLAG_CLUSTER and use queue_limits instead

commit e692cb668fdd5a712c6ed2a2d6f2a36ee83997b4 upstream.

When stacking devices, a request_queue is not always available. This
forced us to have a no_cluster flag in the queue_limits that could be
used as a carrier until the request_queue had been set up for a
metadevice.

There were several problems with that approach. First of all it was up
to the stacking device to remember to set queue flag after stacking had
completed. Also, the queue flag and the queue limits had to be kept in
sync at all times. We got that wrong, which could lead to us issuing
commands that went beyond the max scatterlist limit set by the driver.

The proper fix is to avoid having two flags for tracking the same thing.
We deprecate QUEUE_FLAG_CLUSTER and use the queue limit directly in the
block layer merging functions. The queue_limit 'no_cluster' is turned
into 'cluster' to avoid double negatives and to ease stacking.
Clustering defaults to being enabled as before. The queue flag logic is
removed from the stacking function, and explicitly setting the cluster
flag is no longer necessary in DM and MD.

Reported-by: Ed Lin <ed.lin@promise.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoSched: fix skip_clock_update optimization
Mike Galbraith [Wed, 8 Dec 2010 10:05:42 +0000 (11:05 +0100)]
Sched: fix skip_clock_update optimization

commit f26f9aff6aaf67e9a430d16c266f91b13a5bff64 upstream.

idle_balance() drops/retakes rq->lock, leaving the previous task
vulnerable to set_tsk_need_resched().  Clear it after we return
from balancing instead, and in setup_thread_stack() as well, so
no successfully descheduled or never scheduled task has it set.

Need resched confused the skip_clock_update logic, which assumes
that the next call to update_rq_clock() will come nearly immediately
after being set.  Make the optimization robust against the waking
a sleeper before it sucessfully deschedules case by checking that
the current task has not been dequeued before setting the flag,
since it is that useless clock update we're trying to save, and
clear unconditionally in schedule() proper instead of conditionally
in put_prev_task().

Signed-off-by: Mike Galbraith <efault@gmx.de>
Reported-by: Bjoern B. Brandenburg <bbb.lst@gmail.com>
Tested-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1291802742.1417.9.camel@marge.simson.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoALSA: hda: Use LPIB quirk for Dell Inspiron m101z/1120
Daniel T Chen [Tue, 28 Dec 2010 22:20:02 +0000 (17:20 -0500)]
ALSA: hda: Use LPIB quirk for Dell Inspiron m101z/1120

commit e03fa055bc126e536c7f65862e08a9b143138ea9 upstream.

Sjoerd Simons reports that, without using position_fix=1, recording
experiences overruns. Work around that by applying the LPIB quirk
for his hardware.

Reported-and-tested-by: Sjoerd Simons <sjoerd@debian.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agomac80211: fix mesh forwarding
Johannes Berg [Wed, 22 Dec 2010 09:15:07 +0000 (10:15 +0100)]
mac80211: fix mesh forwarding

commit b51aff057c9d0ef6c529dc25fd9f775faf7b6c63 upstream.

Under memory pressure, the mac80211 mesh code
may helpfully print a message that it failed
to clone a mesh frame and then will proceed
to crash trying to use it anyway. Fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agolibata-sff: fix HSM_ST_ERR handling in __ata_sff_port_intr()
Tejun Heo [Fri, 3 Dec 2010 14:19:13 +0000 (15:19 +0100)]
libata-sff: fix HSM_ST_ERR handling in __ata_sff_port_intr()

commit 687a993339c4f3a63654746230da3aab8bbdbffd upstream.

While separating out BMDMA irq handler from SFF, commit c3b28894
(libata-sff: separate out BMDMA irq handler) incorrectly made
__ata_sff_port_intr() consider an IRQ to be an idle one if the host
state was transitioned to HSM_ST_ERR by ata_bmdma_port_intr().

This makes BMDMA drivers ignore IRQs reporting host bus error which
leads to timeouts instead of triggering EH immediately.  Fix it by
making __ata_sff_port_intr() consider the IRQ to be an idle one iff
the state is HSM_ST_IDLE.  This is equivalent to adding HSM_ST_ERR to
the "break"ing case but less error-prone.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Antonio Toma <antonio.toma@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoima: fix add LSM rule bug
Mimi Zohar [Mon, 3 Jan 2011 22:59:10 +0000 (14:59 -0800)]
ima: fix add LSM rule bug

commit 867c20265459d30a01b021a9c1e81fb4c5832aa9 upstream.

If security_filter_rule_init() doesn't return a rule, then not everything
is as fine as the return code implies.

This bug only occurs when the LSM (eg. SELinux) is disabled at runtime.

Adding an empty LSM rule causes ima_match_rules() to always succeed,
ignoring any remaining rules.

 default IMA TCB policy:
  # PROC_SUPER_MAGIC
  dont_measure fsmagic=0x9fa0
  # SYSFS_MAGIC
  dont_measure fsmagic=0x62656572
  # DEBUGFS_MAGIC
  dont_measure fsmagic=0x64626720
  # TMPFS_MAGIC
  dont_measure fsmagic=0x01021994
  # SECURITYFS_MAGIC
  dont_measure fsmagic=0x73636673

  < LSM specific rule >
  dont_measure obj_type=var_log_t

  measure func=BPRM_CHECK
  measure func=FILE_MMAP mask=MAY_EXEC
  measure func=FILE_CHECK mask=MAY_READ uid=0

Thus without the patch, with the boot parameters 'tcb selinux=0', adding
the above 'dont_measure obj_type=var_log_t' rule to the default IMA TCB
measurement policy, would result in nothing being measured.  The patch
prevents the default TCB policy from being replaced.

Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Cc: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Cc: David Safford <safford@watson.ibm.com>
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>
13 years agomv_xor: fix race in tasklet function
Saeed Bishara [Tue, 21 Dec 2010 14:53:39 +0000 (16:53 +0200)]
mv_xor: fix race in tasklet function

commit 8333f65ef094e47020cd01452b4637e7daf5a77f upstream.

use mv_xor_slot_cleanup() instead of __mv_xor_slot_cleanup() as the former function
aquires the spin lock that needed to protect the drivers data.

Signed-off-by: Saeed Bishara <saeed@marvell.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoKVM: Fix OSXSAVE after migration
Sheng Yang [Wed, 8 Dec 2010 02:49:43 +0000 (10:49 +0800)]
KVM: Fix OSXSAVE after migration

commit 3ea3aa8cf67d3bbe00a19b6a4013d19efa7d0f41 upstream.

CPUID's OSXSAVE is a mirror of CR4.OSXSAVE bit. We need to update the CPUID
after migration.

KVM-Stable-Tag.
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoKVM: SVM: Do not report xsave in supported cpuid
Joerg Roedel [Tue, 7 Dec 2010 16:15:05 +0000 (17:15 +0100)]
KVM: SVM: Do not report xsave in supported cpuid

commit 24d1b15f72abe3465e871d11cfc9dc34d1aab8b2 upstream.

To support xsave properly for the guest the SVM module need
software support for it. As long as this is not present do
not report the xsave as supported feature in cpuid.
As a side-effect this patch moves the bit() helper function
into the x86.h file so that it can be used in svm.c too.

KVM-Stable-Tag.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoKVM: enlarge number of possible CPUID leaves
Andre Przywara [Wed, 1 Dec 2010 11:17:44 +0000 (12:17 +0100)]
KVM: enlarge number of possible CPUID leaves

commit 73c1160ce377d8fc6d84cb630ebf9658808bec49 upstream.

Currently the number of CPUID leaves KVM handles is limited to 40.
My desktop machine (AthlonII) already has 35 and future CPUs will
expand this well beyond the limit. Extend the limit to 80 to make
room for future processors.

KVM-Stable-Tag.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agosound: Prevent buffer overflow in OSS load_mixer_volumes
Dan Rosenberg [Sat, 25 Dec 2010 21:23:40 +0000 (16:23 -0500)]
sound: Prevent buffer overflow in OSS load_mixer_volumes

commit d81a12bc29ae4038770e05dce4ab7f26fd5880fb upstream.

The load_mixer_volumes() function, which can be triggered by
unprivileged users via the SOUND_MIXER_SETLEVELS ioctl, is vulnerable to
a buffer overflow.  Because the provided "name" argument isn't
guaranteed to be NULL terminated at the expected 32 bytes, it's possible
to overflow past the end of the last element in the mixer_vols array.
Further exploitation can result in an arbitrary kernel write (via
subsequent calls to load_mixer_volumes()) leading to privilege
escalation, or arbitrary kernel reads via get_mixer_levels().  In
addition, the strcmp() may leak bytes beyond the mixer_vols array.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agomemcg: fix wrong VM_BUG_ON() in try_charge()'s mm->owner check
KAMEZAWA Hiroyuki [Wed, 29 Dec 2010 22:07:11 +0000 (14:07 -0800)]
memcg: fix wrong VM_BUG_ON() in try_charge()'s mm->owner check

commit ebb76ce16daf6908dc030dec1c00827d37129fe5 upstream.

At __mem_cgroup_try_charge(), VM_BUG_ON(!mm->owner) is checked.
But as commented in mem_cgroup_from_task(), mm->owner can be NULL
in some racy case. This check of VM_BUG_ON() is bad.

A possible story to hit this is at swapoff()->try_to_unuse(). It passes
mm_struct to mem_cgroup_try_charge_swapin() while mm->owner is NULL. If we
can't get proper mem_cgroup from swap_cgroup information, mm->owner is used
as charge target and we see NULL.

Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Reported-by: Hugh Dickins <hughd@google.com>
Reported-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>