cascardo/linux.git
12 years agoCHROMIUM: r8169: Disable WOL by default
Todd Broch [Fri, 24 Feb 2012 01:15:46 +0000 (17:15 -0800)]
CHROMIUM: r8169: Disable WOL by default

Set the WOL config registers to be disabled by default. Without this change in
place, the WOL config register settings on warm reboot come up in an
inconsistent state since these registers don't get reset on a warm reboot.

BUG=chrome-os-partner:7026
TEST=On a system with a realtek ethernet MAC, do the following
test1,
  1. run "ethtool -s eth0 wol g" to enable WOL from PHY activity
  2. reboot the system
  3. run "ethtool eth0" and check that "g" is not listed in "Wake-on"

test2, Run network_EthCapsServer.py and make sure it still wakes

test3, Measure power during S3 from cold-boot see ~100mW less with WOL disabled

Change-Id: I469b0fc7cac17bf612be3229b8c1770bcd237df6
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/16432
Reviewed-by: Sameer Nanda <snanda@chromium.org>
12 years agoCHROMIUM: r8169: transition to D0 state at shutdown
Sameer Nanda [Sat, 26 May 2012 00:37:27 +0000 (17:37 -0700)]
CHROMIUM: r8169: transition to D0 state at shutdown

With runtime PM, if the ethernet cable is disconnected, the device is
transitioned to D3 state to conserve energy. If the system is shutdown
in this state, any register accesses in rtl_shutdown are dropped on
the floor.

This patch transitions the device back to D0 state in rtl_shutdown if
the device was runtime PM suspended. In addition, since runtime PM
also mucks around with WOL options, the saved WOL options are also
restored in rtl_shutdown.

BUG=chrome-os-partner:7026
TEST=Don't have a good black box test case. It can be tested by
modifying the driver to verify that register accesses in
rtl_shutdown go through with the cable disconnected.

Change-Id: Ic08f2c3fed22a4b1a876dc3816565156b464ec78
Signed-off-by: Sameer Nanda <snanda@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/15832
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
12 years agoCHROMIUM: r8169: Enable WOL from Magic Packet by default
Sameer Nanda [Sat, 26 May 2012 00:28:38 +0000 (17:28 -0700)]
CHROMIUM: r8169: Enable WOL from Magic Packet by default

Set the WOL config registers to only enable WOL from magic packet by
default. Without this change in place, the WOL config register
settings on warm reboot come up in an inconsistent state since these
registers don't get reset on a warm reboot.

BUG=chrome-os-partner:7026
TEST=On a system with a realtek ethernet MAC, do the following
1. run "ethtool -s eth0 wol p" to enable WOL from PHY activity
2. reboot the system
3. run "ethtool eth0" and check that "p" is not listed in "Wake-on"

Change-Id: Iee843b5a93c04a9463342bd87dc03078d37e2ef0
Signed-off-by: Sameer Nanda <snanda@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/15831
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
12 years agoCHROMIUM: r8169: Enable suspend when device is idle from boot.
Todd Broch [Wed, 28 Dec 2011 21:02:47 +0000 (13:02 -0800)]
CHROMIUM: r8169: Enable suspend when device is idle from boot.

The r8169 driver supports power management and correctly transistions
from active to suspend when link transistions from connected to
disconnected.  If its not connected at boot however the device remains
active after the initial probe.

This change adds a check of the link status to the idle pm_op that
will schedule a suspend if inactive.

BUG=chrome-os-partner:7360
TEST=manual
1. boot connected to LAN.  Interface works and continues to work after
disconnect & connect.

2. boot without connected to LAN.  Device's status,
/sys/bus/pci/devices/<devnum>/power/runtime_status is 'suspended'.
Connecting LAN brings up interface and transitions to 'active'.  Test
multiple connect/discoonect still functions

Change-Id: Ia9a5cc300faebbac63f77e3b7eb7cb08491f671e
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/13516

12 years agoCHROMIUM: drivers: net: add module param for control of ASPM disable
Todd Broch [Sat, 26 May 2012 00:06:31 +0000 (17:06 -0700)]
CHROMIUM: drivers: net: add module param for control of ASPM  disable

ASPM has been disabled in this driver by default as its been
implicated in stability issues on at least one platform.  This CL adds
a  module parameter to allow control of ASPM disable.  The default
value is disabled to match the current upstream functionality.

BUG=chrome-os-partner:6691
TEST=manual,
1. Test default
- boot kernel on platform w/ r8169
- lspci -vvv -s <device> | grep -i aspm
LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency
   L0 unlimited, L1 <64us
LnkCtl:    ASPM L1 Enabled; RCB 64 bytes Disabled- Retrain-
   CommClk+
  - Note, 'ASPM L1 Enabled'

2. Test Disabling ASPM
- echo "options r8169 aspm_disable=1" > /etc/modprobe.d/r8169.conf
- re-boot
- lspci -vvv -s <device> | grep -i aspm
   LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency
   L0 unlimited, L1 <64us
LnkCtl:    ASPM Disabled; RCB 64 bytes Disabled- Retrain-
   CommClk+
  - Note, 'ASPM Disabled'

Change-Id: Iae399c08a917fcc7421cb63fb34e9cebca4ab296
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/11551

12 years agoALSA: hda/realtek - set DMIC coefficients
Dylan Reid [Fri, 11 May 2012 03:42:01 +0000 (20:42 -0700)]
ALSA: hda/realtek - set DMIC coefficients

The DMIC coefficients got lost upstream for ZGB between 3.0 and 3.2.
Without them the right channel is exactly the inverse of the left.
GTalk sums the two channels to get a mono stream, leading to zeros.  Use
the new chained fixup method to apply the needed coefficients.

BUG=chromium-os:29356
TEST="arecord -Dhw:1 -f cd /tmp/asdf.wav" copy file to host and use
audacity (or similar) to check that signals wouldn't add to zero.
GTalk call and ensure other party can hear you.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/22440
(cherry picked from commit c6298255936f473e031c3dda0ff1719cf9b52784)

Change-Id: If2049ea42356f28fa93fa4021649460994b70a21
Reviewed-on: https://gerrit.chromium.org/gerrit/23165
Reviewed-by: Todd Broch <tbroch@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Dylan Reid <dgreid@chromium.org>

12 years agoCHROMIUM: tpm: don't run self test during probe
Luigi Semenzato [Mon, 21 May 2012 20:34:16 +0000 (13:34 -0700)]
CHROMIUM: tpm: don't run self test during probe

The new version of the tpm_tis driver in kernel 3.4 runs
TPM_ContinueSelfTest in the probe function.  This is bad
in two ways.  1. If the self test has completed (which it
most likely has, since it starts automatically at power on
and lasts about 500ms) then this may start a new instance
of the selftest, and waits for it to complete, thus
delaying boot.  2. With our TPM, the command fails with
error code 0xa (BAD_ORDINAL) for unfathomable reasons.

I have sent mail to the trousers mailing list (where the
author of the TPM driver lurks) requesting some help in
understanding what goes on.  But in the meanwhile we
should apply this patch and move on.

BUG=chromium-os:31065
TEST=booted, verified that TPM works (stop tcsd, tpmc test, start tcsd)

Change-Id: I23c1f3acb3dd1b2e3149553b07fb633ac27e4aeb
Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/23148
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
12 years agoHACK: tpm: export tpm_continue_selftest for tpm_tis_i2c
Olof Johansson [Thu, 17 May 2012 05:33:46 +0000 (22:33 -0700)]
HACK: tpm: export tpm_continue_selftest for tpm_tis_i2c

Some of the recent upstream changes broke tpm_tis_i2c. It should be fixed
properly, but until then this hack lets us keep moving.

BUG=none
TEST=make sure arm defconfigs build again. Not runtime tested at this
time.

Change-Id: I3bd9f5eb7a7406131e0782a8b33e2b85ed6792eb
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/22906
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
12 years agoCHROMIUM: tpm: fix potential deadlock in resume_if_needed
Grant Grundler [Sat, 12 May 2012 00:16:27 +0000 (00:16 +0000)]
CHROMIUM: tpm: fix potential deadlock in resume_if_needed

Fixes potential deadlock in this call sequence:
    transmit_cmd -> resume_if_needed -> tpm_continue_selftest -> transmit_cmd

Sequence is now:
    transmit_cmd -> resume_if_needed -> tpm_continue_selftest -> tpm_transmit

Reorders declarations of transmit_cmd, tpm_continue_selftest, etc so
we don't need forward declarations of functions.

BUG=none
TEST=code review found the issue. No test.

Change-Id: I95aeb69e89faa2a6c6491350e49bd46ac44f06b1
Signed-off-by: Grant Grundler <grundler@chromium.org>
12 years agoCHROMIUM: scheduler: panic if schedulin while atomic
Sameer Nanda [Tue, 8 May 2012 23:07:31 +0000 (23:07 +0000)]
CHROMIUM: scheduler: panic if schedulin while atomic

When the schduling while atomic condition is hit, currently only a
printk and dump_stack happens but the kernel continues to run.  We've
run into issues where we think this causes a hang during shutdown
eventually.

Now doing a kernel panic instead by calling BUG().  This should prevent
hangs at shutdown from happening as well as providing us stack traces
that might help us root cause the real issue.

Signed-off-by: Sameer Nanda <snanda@chromium.org>
BUG=chromium-os:29599
TEST=We don't have a good way of repro'ing the hang on shutdown so the
testing is limited to kernel building fine.

Change-Id: I52084abf64a133a00f20e2eeaeb921820755e252
Reviewed-on: https://gerrit.chromium.org/gerrit/21534
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Sameer Nanda <snanda@chromium.org>
Tested-by: Sameer Nanda <snanda@chromium.org>
12 years agoCHROMIUM: Add CLOCK_SYSTEM_TRACE to export the trace clock to user space.
Sam Leffler [Thu, 26 Apr 2012 23:54:35 +0000 (16:54 -0700)]
CHROMIUM: Add CLOCK_SYSTEM_TRACE to export the trace clock to user space.

Add a new clock type CLOCK_SYSTEM_TRACE to retrieve the current trace
clock value (if CONFIG_TRACING is not defined then CLOCK_SYSTEM_TRACE
returns the same value as CLOCK_MONOTONIC_RAW).  This allows user event
tracing to timestamp data with the same clock as the kernel.  This is
in-lieu of sending event data through trace_write (which is not a viable
option when there are lots of user-space events).

BUG=chromium-os:27809
TEST=manual:run test app to collect trace time and compare to data generated by the system (e.g. reading from trace)

Signed-off-by: Sam Leffler <sleffler@chromium.org>
Change-Id: If2167ed99291e05f8c298638f4118b10b3e710f8
Reviewed-on: https://gerrit.chromium.org/gerrit/21404
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
12 years agoALSA: hda/realtek - indicate jacks are black and on the left.
Dylan Reid [Thu, 12 Apr 2012 18:12:49 +0000 (11:12 -0700)]
ALSA: hda/realtek - indicate jacks are black and on the left.

This should be squashed with "24bb78aa23bb78aa - add a fixup for ACER's ZGB"
when rebased.  This change doesn't affect run time at all, just gets the color
and location right if you were to check /proc/asound/card0/codec#0.

BUG=none
TEST=build and run on ZGB, inspect /proc/asound/card0/codec#0

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

12 years agoCHROMIUM: ALSA: hda/ca0132 - Move headphones to port D.
Dylan Reid [Thu, 12 Apr 2012 17:55:27 +0000 (10:55 -0700)]
CHROMIUM: ALSA: hda/ca0132 - Move headphones to port D.

For proto-1, HP are on PORTD not PORTA.  Turn on PORTD and configure
for HP output with a little magic from Creative.  This is a temporary
setup that we will use until we get a full driver from Creative.

BUG=chrome-os-partner:8911
TEST=manual, build and run, use amixer to adjust HP mute and volume.

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

12 years agoALSA: hda/realtek - add a fixup for ACER's ZGB.
Dylan Reid [Tue, 8 May 2012 18:08:15 +0000 (18:08 +0000)]
ALSA: hda/realtek - add a fixup for ACER's ZGB.

The ACER ZGB has SPDIF0 wired to an HDMI transmitter.  Configure the
pin widget for SPDIF0 to reflect that it is connected.

BUG=chromium-os:28564
TEST=manual, push kernel to ZGB, check that spdif control is there.
Attach HDMI TV an use aplay to test that audio is sent to the TV.

Change-Id: I6ff4ccae853758b53b584e06c7abc963289cb303
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/19411
Reviewed-by: Todd Broch <tbroch@chromium.org>
12 years agoCHROMIUM: ALSA: hda: cirrus: Add a quirk for Stumpy.
Dylan Reid [Wed, 12 Oct 2011 07:07:16 +0000 (00:07 -0700)]
CHROMIUM: ALSA: hda: cirrus: Add a quirk for Stumpy.

Configure the codec when we are running on stumpy.
This is the same as for the Intel test board, but with new PCI
vendor/device ids.

Cherry pick from chromeos-3.0 commit d0aaf34dd22608df06f9657.

BUG=chrome-os-partner:6135
TEST=Manually plug and unplug various headsets with both the apple
and nokia pin outs.

Change-Id: I663b23bbbf3c8c65c1e2826436e1f4c204132438
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/18635
Reviewed-by: Sameer Nanda <snanda@chromium.org>
12 years agoALSA: hda: ca0132: set eapd
Dylan Reid [Tue, 28 Feb 2012 05:36:29 +0000 (21:36 -0800)]
ALSA: hda: ca0132: set eapd

Enable the EAPD pin and intialize it to power the amp.

Change-Id: I76b9766f332492f79810f73a1317a763a76e87d1
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/18135
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
12 years agoCHROMIUM: i2c: i801: enable irq for byte_by_byte transactions
Benson Leung [Tue, 8 May 2012 18:00:37 +0000 (18:00 +0000)]
CHROMIUM: i2c: i801: enable irq for byte_by_byte transactions

Byte-by-byte transactions are used primarily for accessing i2c devices
with an smbus controller.  For these transactions, for each byte that is
read or written, the SMBus controller generates a BYTE_DONE irq.  The isr
reads/writes the next byte, and clears the irq flag to start the next byte.
On the penultimate irq, the isr also sets the LAST_BYTE flag.

There is no locking around the cmd/len/count/data variables, since the
i2c adapter lock ensures there is never multiple simultaneous transactions
for the same device, and the driver thread never accesses these variables
while interrupts might be occurring.

The end result is a dramatic speed up in emulated i2c-over smbus block
read and write transactions.

Note: This patch has only been tested and verified by doing i2c read and
write block transfers on Cougar Point 6 Series PCH.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:24134
TEST=smbus cyapa (lumpy):
  1) is detected on both warm and cold boot.
  2) fw update takes ~15 seconds (was 95 sec)
  3) cyapa_fw_update -b -o /tmp/cyapa.bin takes ~20 sec (was 220 sec)

Reviewed-on: https://gerrit.chromium.org/gerrit/12815
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
(cherry picked from commit 66b2a28c01a633095b9f021ae5bc8f6c8941f1e3)

Change-Id: Id043296277b78e41b036f53e9b33c8a24244caf8
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/18025
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: i2c: i801: enable irq for i801 smbus transactions
Benson Leung [Tue, 8 May 2012 17:28:01 +0000 (17:28 +0000)]
CHROMIUM: i2c: i801: enable irq for i801 smbus transactions

Add a new 'feature' to i2c-i801 to enable using i801 interrupts.
When the feature is enabled, then an isr is installed for the device's
pci irq.

An i2c/smbus transaction is always terminated by one of the following
interrupt sources: FAILED, BUS_ERR, DEV_ERR, or on success: INTR

When the isr fires for one of these cases, it sets the ->status variable
and wakes up the waitq.  The waitq then saves off the status code, and
clears ->status (in preperation for some future transaction).
The SMBus controller generates an INTR irq at the end of each
transaction where INTREN was set in the HST_CNT register.

No locking is needed around accesses to priv->status since all writes to
it are serialized: it is only ever set once in the isr at the end of a
transaction, and cleared while no irqs can occur.  In addition, the i2c
adapter lock guarantees that entire i2c transactions for a single
adapter are always serialized.

For this patch, the INTREN bit is set only for smbus block, byte and word
transactions, but not for emulated i2c reads or writes.  The use of the
DS (BYTE_DONE) interrupt with byte-by-byte i2c transactions is
implemented in a subsequent patch.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:24134
TEST=With interrupt feature disabled, no regression while accessing light
  sensor or cyapa trackpad, including during:
  * cold boot and warm boot
  * firmware update

Reviewed-on: https://gerrit.chromium.org/gerrit/12814
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
(cherry picked from commit 56873242fc098ae7890695795fa341f16be9f502)

Change-Id: I638aeebb3e02a4fc1f234ebaa8c46eece2129fc1
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/18024
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: ramoops: remove module parameters
Kees Cook [Mon, 9 Apr 2012 19:46:29 +0000 (19:46 +0000)]
CHROMIUM: ramoops: remove module parameters

The ramoops driver is intended to be used with platforms that define
persistent memory regions. If memory regions were configurable with
module parameters, it would be possible to read some RAM regions via
the new /proc interface without access to /dev/mem (which would
result in a loss of kernel memory privacy when a system is built with
STRICT_DEVMEM), so remove this ability completely.

BUG=chromium-os:12059
TEST=x86-alex build and boot, manually verified /dev/pstore/dmesg-ramoops-N
    showing breakme crash reports.

Change-Id: I5177af5b0a237b01633a9a202172504c8564c914
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/11618

12 years agoCHROMIUM: ramoops: use pstore interface
Kees Cook [Mon, 9 Apr 2012 19:41:30 +0000 (19:41 +0000)]
CHROMIUM: ramoops: use pstore interface

Instead of using /dev/mem directly, use the common pstore infrastructure
to handle Oops gathering and extraction.

BUG=chromium-os:12059
TEST=x86-alex build and boot, manually verified /dev/pstore/dmesg-ramoops-N
    showing breakme crash reports.

Change-Id: Ice47506c005d56d24efa23d24bce1dbac0fbd571
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/11617

12 years agoCHROMIUM: char: tpm: need to resume powered-off TPMs after resume
Olof Johansson [Fri, 9 Mar 2012 19:56:22 +0000 (11:56 -0800)]
CHROMIUM: char: tpm: need to resume powered-off TPMs after resume

I was looking at getting rid of some of our tpm patches, and this was
the remaining delta. I asked Luigi about it, and he said (in the below
referenced bug):

"The code that this patch removes is needed by devices that power off
the TPM during suspend.  I believe Alex and ZGB work that way, i.e. they
need the code that this patch removes.

If the platform maintains power to the TPM during suspend, then this
code isn't needed, i.e. you may apply the diff.  But since we're still
supporting Alex and ZGB, that code needs to be there."

So, adding it back without keeping the full add-removesome-addsome
history of the TPM drivers.

BUG=chromium-os:27576
TEST=regression suite

Change-Id: Idae59dcdf9fc66b14a522715824c9d227fdd375e
Signed-off-by: Olof Johansson <olofj@chromium.org>
12 years agoAdd radeon firmware to x86-generic kernels.
Stéphane Marchesin [Thu, 3 Nov 2011 00:59:09 +0000 (17:59 -0700)]
Add radeon firmware to x86-generic kernels.

BUG=chromium-os:21099
TEST=compiles

Change-Id: I2949a63aa94e9ae75c7fa7b2dce8fff0c17e26a6
Reviewed-on: https://gerrit.chromium.org/gerrit/17116
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>

12 years agoCHROMIUM: exec: abort core dump piping only due to a fatal signal
Ben Chan [Thu, 1 Mar 2012 07:14:44 +0000 (23:14 -0800)]
CHROMIUM: exec: abort core dump piping only due to a fatal signal

This patch makes wait_for_dump_helpers() not to abort piping the core
dump data when the crashing process has received any but a fatal signal
(SIGKILL). The rationale is that a crashing process may still receive
uninteresting signals such as SIGCHLD when its core dump data is being
redirected to a helper application. While it's necessary to allow
terminating the core dump piping via SIGKILL, it's practically more
useful for the purpose of debugging and crash reporting if the core dump
piping is not aborted due to other non-fatal signals.

BUG=chromium-os:21559
TEST=Tested the following:
1. Modify /proc/sys/kernel/core_pattern to pipe core dump data to a
   modified crash reporter that waits for minutes before reading core
   dump data.
2. Run a program that crashes with SIGSEGV.
3. Send a SIGCHLD signal to the crashing process while its core dump
   data is being piped to the crash reporter. Verify that the core
   dump eventually finishes without being aborted.
4. Repeat 1-3 but send SIGKILL instead of SIGCHLD to the crashing
   process and verify that the core dump is aborted.

Change-Id: I71e52df0a936fd0f718a4bcb6777900032c0717d
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/17128
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
12 years agoCHERRY-PICK: drm/i915: Retry reading the PCH FDI receiver ISR
Sean Paul [Fri, 2 Mar 2012 17:53:39 +0000 (12:53 -0500)]
CHERRY-PICK: drm/i915: Retry reading the PCH FDI receiver ISR

According to the PRM (Vol3P2), the PCH FDI receiver ISR read for bit lock
should be retried at least once. This patch retries the read 5 times
with a small delay in between reads. I've had reports of display corruption
on resume with "FDI train 1 fail!", so I'm hoping that adding this retry
will mitigate the issue.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit fa37d39e4c6622d80bd8061d600701bcea1d6870)

BUG=chrome-os-partner:7439
TEST=Tested on lumpy with auto suspend/resume script

Change-Id: I8eb18050ddaadd91c5a2a06f4b664f5a3ea65c7f
Reviewed-on: https://gerrit.chromium.org/gerrit/17238
Tested-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Commit-Ready: Sean Paul <seanpaul@chromium.org>

12 years agoCHROMIUM: tpm_tis: move to bus 1 by default
Olof Johansson [Sun, 5 Feb 2012 03:56:08 +0000 (19:56 -0800)]
CHROMIUM: tpm_tis: move to bus 1 by default

Since the multiplexed bus on tegra has been disabled, this means that the
tpm is now on bus 1 by default.

This needs to be fixed with a properly configured driver at some point -- the device info shouldn't be in the driver.

BUG=none
TEST=boot a kaen with 3.2.

Change-Id: Ib7ed22917c9250ea0b0fbd0e4856e8c917367d30
Signed-off-by: Olof Johansson <olof@lixom.net>
Reviewed-on: https://gerrit.chromium.org/gerrit/15303
Tested-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Commit-Ready: Olof Johansson <olofj@chromium.org>

12 years agoCHROMIUM: x86: don't print platform in show_regs
Olof Johansson [Thu, 5 Jan 2012 04:27:33 +0000 (20:27 -0800)]
CHROMIUM: x86: don't print platform in show_regs

We don't care what the platform is, and it's easier if it's just omitted.

BUG=none
TEST=none

Change-Id: I8f3685d36c86563ee6aa4b7f6f44975009720196
Signed-off-by: Olof Johansson <olof@lixom.net>
Reviewed-on: https://gerrit.chromium.org/gerrit/13696
Tested-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Ready: Olof Johansson <olofj@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
12 years agoCHROMIUM: tpm: tpm_tis_i2c: Lock the I2C adapter for a sequence of requests.
Bryan Freed [Tue, 2 Aug 2011 16:51:43 +0000 (09:51 -0700)]
CHROMIUM: tpm: tpm_tis_i2c: Lock the I2C adapter for a sequence of requests.

Submitted upstream at https://lkml.org/lkml/2011/8/3/327.
This is derived from Peter Huewe's hacked tpm_tis_i2c.c driver:

On some ChromeOS systems, a TPM sharing the I2C bus with another device
gets confused when it sees I2C requests to that other device.
This change locks the I2C adapter for the duration of the full sequence
of I2C requests the TPM needs to complete.

smbus_xfer is not supported, but SMBUS is not supported by the original
driver, either.

BUG=chrome-os-partner:4775
TEST='while tpmc getf > /dev/null; do echo -n .;done' runs a loooong time.

Change-Id: Ia9cb23aa5722e46aaebc1e96fb5bc3da2c134c7f
Signed-off-by: Bryan Freed <bfreed@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/5186
Reviewed-by: Grant Grundler <grundler@chromium.org>
12 years agochar/tpm_tis_i2c: minor bugfixes and cleanups
Peter Huewe [Mon, 4 Apr 2011 17:32:05 +0000 (10:32 -0700)]
char/tpm_tis_i2c: minor bugfixes and cleanups

This patchset consists of minor bugfixes and cleanups to the Infineon
IFX TPM TIS I2C Driver.
These patches were already sent to the TPM Maintainer who is currently
reviewing the driver.

The patchset consists of these patches:

char/tpm: Fix cleanup behavior if no hardware is attached in tpm_tis_i2c.c

This patch fixes the cleanup behavior if no hardware is attached, by fixing the
exit points.

Without this patch the driver fails to release the registered minor number if
no hardware is attached.
Moreover if the driver gets called 256 times without the hardware attached,
tpm_register_hardware runs out of device numbers and consequently fails and
tpm_remove_hardware gets called with a NULL pointer, leading to an OOPS.

char/tpm: spellcheck and version bump for tpm_tis_i2c.c

This patch fixes a small typo and bumps the version of tpm_tis_i2c.c to 2.1.1

char/tpm: workaround: TPM can't handle more than 0x4f9 bytes

If the TPM (beta firmware) receives more than 0x4f9 Bytes the TPM shuts itself
down. Since this is usually not the desired behavior the driver has to workaound
this bug by blocking any input over 0x4f9 (1273) bytes.
We chose 1260 as an (arbitrary) upper limit, just to be on the safe side.

char/tpm: don't bypass timeout mechanism for burstcount

If the tpm keeps on reporting burstcount == 0 the driver gets into an endless
loop. This patch fixes this by removing the bypass of the timeout mechanism for
burstcount.
If burstcount == 0 (for some time) the driver now returns gracefully with a
 -EBUSY.

char/tpm_tis_i2c: Update driver to proposed mainline version

This patch updates the tpm_tis_i2c.c driver to the version that was sent
to the LKML.

The patch fixes some spelling errors and bumps the version to 2.1.0
The patch is needed to apply the upcomming patches cleanly.

Change-Id: I95ca3ea90cc4976d3e4f5f19aa37d3f72e0703c2

BUG=
TEST=Running the trousers testsuite several times, manual tests, IFX LinuxDD testsuite
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Olof Johansson <olofj@chromium.org>
Review URL: http://codereview.chromium.org/6794015

12 years agoCHROMIUM: char/tpm: Add support for Infineon's I2C TIS TPM
Peter Huewe [Fri, 11 Mar 2011 02:14:21 +0000 (18:14 -0800)]
CHROMIUM: char/tpm: Add support for Infineon's I2C TIS TPM

[Note: This driver will be reworked by the upstream TPM maintainer
to share as much code as possible with a couple of other i2c tpm's.
While that is taking place, we are checking in this driver to have
something to exercise hardware with. This will be reverted when
the upstream driver is available. -olofj]

This patch adds a new driver for Infineon's new I2C based TPM.
The used protocol is quite similar to the TCG TIS protocol.

Tested on: tegra2 seaboard (arm) , beagleboard (arm)
Known Bugs: Suspend does not work correctly on Seaboard, since I2C bus shuts
itself down too early. Works on Beagleboard

Change-Id: I7e945e2fb4edab4eded6c9cd92dd18a1e947c220

BUG=None
TEST= Running trousers testsuite several times, manual tests
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Olof Johansson <olofj@chromium.org>
Review URL: http://codereview.chromium.org/6530003

12 years agoCHROMIUM:staging:iio:light: fix ISL29018 sensor operation after a brownout
Grant Grundler [Mon, 8 Aug 2011 16:45:08 +0000 (09:45 -0700)]
CHROMIUM:staging:iio:light: fix ISL29018 sensor operation after a brownout

After a voltage brownout, sensor will now operate correctly.

Page 10 of ISL29018 data sheet and the Intersil Application Note 1534
describe the required initialization sequence:
1. Write 0x00 to register 0x08 (TEST)
2. Write 0x00 to register 0x00 (CMD1)
3. msleep(1)
4. program remaining registers as before

BUG=chrome-os-partner:5351,chrome-os-partner:4752
TEST=manual (boots and light sensor responds after 5 seconds)

Change-Id: I09738e3680cacfa9f71e2173cdd02aae82e26dd5
Signed-off-by: Grant Grundler <grundler@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/5474
Reviewed-by: Bryan Freed <bfreed@chromium.org>
Tested-by: Bryan Freed <bfreed@chromium.org>
12 years agoCHROMIUM: Firmware: Add AMD fusion firmware.
Stéphane Marchesin [Mon, 13 Jun 2011 21:46:13 +0000 (14:46 -0700)]
CHROMIUM: Firmware: Add AMD fusion firmware.

Change-Id: Id16d3535c5170580dbdab13735257b8e6d6f5864
Reviewed-on: http://gerrit.chromium.org/gerrit/2565
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
12 years agoCHROMIUM: firmware: import amd fusion gpu firmware
Stéphane Marchesin [Mon, 6 Jun 2011 21:05:38 +0000 (14:05 -0700)]
CHROMIUM: firmware: import amd fusion gpu firmware

Change-Id: I361bd061b4dc28aa33012010ccf9ecbe0e5c0c8a
Reviewed-on: http://gerrit.chromium.org/gerrit/2175
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
12 years agoMOBLIN: fastboot: remove "wait for all devices before mounting root" delay
Arjan van de Ven [Sun, 20 Jul 2008 20:12:16 +0000 (13:12 -0700)]
MOBLIN: fastboot: remove "wait for all devices before mounting root" delay

In the non-initrd case, we wait for all devices to finish their
probing before we try to mount the rootfs.
In practice, this means that we end up waiting 2 extra seconds for
the PS/2 mouse probing even though the root holding device has been
ready since a long time.

The previous two patches in this series made the RAID autodetect code
do it's own "wait for probing to be done" code, and added
"wait and retry" functionality in case the root device isn't actually
available.

These two changes should make it safe to remove the delay itself,
and this patch does this. On my test laptop, this reduces the boot time
by 2 seconds (kernel time goes from 3.9 to 1.9 seconds).

Change-Id: Ie32e9d5f93b35b1aed0d955e8e472b9fc73227e4
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/1667
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: NET: USBNET: move tegra 32 byte alignment issue
Rhyland Klein [Tue, 23 Nov 2010 01:23:24 +0000 (17:23 -0800)]
CHROMIUM: NET: USBNET: move tegra 32 byte alignment issue

We need to ensure the sk buf is 32 byte aligned, and it seems that the
asix controller touches the sk buffer in the tx_fixup callback that
changed this alignment. The misaligned buffer gets stuck in the usb
controller and doesn't get issued, causing the timeout.

BUG=https://code.google.com/p/chrome-os-partner/issues/detail?id=1672
TEST=can browse web steadily without seeing the problem

Change-Id: I2efeaa00766c1611feecccf36c59946b5798a691
Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Olof Johansson <olofj@chromium.org>
Review URL: http://codereview.chromium.org/5211005

12 years agoUBUNTU: SAUCE: trace: add trace events for open(), exec() and uselib()
Scott James Remnant [Tue, 27 Oct 2009 10:05:32 +0000 (10:05 +0000)]
UBUNTU: SAUCE: trace: add trace events for open(), exec() and uselib()

BugLink: http://bugs.launchpad.net/bugs/462111
This patch uses TRACE_EVENT to add tracepoints for the open(),
exec() and uselib() syscalls so that ureadahead can cheaply trace
the boot sequence to determine what to read to speed up the next.

It's not upstream because it will need to be rebased onto the syscall
trace events whenever that gets merged, and is a stop-gap.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Andy Whitcroft <andy.whitcroft@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
12 years agoLinux 3.4 v3.4
Linus Torvalds [Sun, 20 May 2012 22:29:13 +0000 (15:29 -0700)]
Linux 3.4

12 years agoMerge tag 'parisc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6
Linus Torvalds [Sat, 19 May 2012 22:30:15 +0000 (15:30 -0700)]
Merge tag 'parisc-fixes' of git://git./linux/kernel/git/jejb/parisc-2.6

Pull PA-RISC fixes from James Bottomley:
 "This is a set of three bug fixes that gets parisc running again on
  systems with PA1.1 processors.

  Two fix regressions introduced in 2.6.39 and one fixes a prefetch bug
  that only affects PA7300LC processors.  We also have another pending
  fix to do with the sectional arrangement of vmlinux.lds, but there's a
  query on it during testing on one particular system type, so I'll hold
  off sending it in for now."

* tag 'parisc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6:
  [PARISC] fix panic on prefetch(NULL) on PA7300LC
  [PARISC] fix crash in flush_icache_page_asm on PA1.1
  [PARISC] fix PA1.1 oops on boot

12 years agoMerge branch 'x86/ld-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Linus Torvalds [Sat, 19 May 2012 22:28:22 +0000 (15:28 -0700)]
Merge branch 'x86/ld-fix' of git://git./linux/kernel/git/tip/tip

Pull x86 linker bug workarounds from Peter Anvin.

GNU ld-2.22.52.0.[12] (*) has an unfortunate bug where it incorrectly
turns certain relocation entries absolute.  Section-relative symbols
that are part of otherwise empty sections are silently changed them to
absolute.  We rely on section-relative symbols staying section-relative,
and actually have several sections in the linker script solely for this
purpose.

See for example

   http://sourceware.org/bugzilla/show_bug.cgi?id=14052

We could just black-list the buggy linker, but it appears that it got
shipped in at least F17, and possibly other distros too, so it's sadly
not some rare unusual case.

This backports the workaround from the x86/trampoline branch, and as
Peter says: "This is not a minimal fix, not at all, but it is a tested
code base."

* 'x86/ld-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, relocs: When printing an error, say relative or absolute
  x86, relocs: Workaround for binutils 2.22.52.0.1 section bug
  x86, realmode: 16-bit real-mode code support for relocs tool

(*) That's a manly release numbering system. Stupid, sure. But manly.

12 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-block
Linus Torvalds [Sat, 19 May 2012 17:12:17 +0000 (10:12 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-block

Pull block layer fixes from Jens Axboe:
 "A few small, but important fixes.  Most of them are marked for stable
  as well

   - Fix failure to release a semaphore on error path in mtip32xx.
   - Fix crashable condition in bio_get_nr_vecs().
   - Don't mark end-of-disk buffers as mapped, limit it to i_size.
   - Fix for build problem with CONFIG_BLOCK=n on arm at least.
   - Fix for a buffer overlow on UUID partition printing.
   - Trivial removal of unused variables in dac960."

* 'for-linus' of git://git.kernel.dk/linux-block:
  block: fix buffer overflow when printing partition UUIDs
  Fix blkdev.h build errors when BLOCK=n
  bio allocation failure due to bio_get_nr_vecs()
  block: don't mark buffers beyond end of disk as mapped
  mtip32xx: release the semaphore on an error path
  dac960: Remove unused variables from DAC960_CreateProcEntries()

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Sat, 19 May 2012 17:10:59 +0000 (10:10 -0700)]
Merge git://git./linux/kernel/git/davem/net

Pull one more networking bug-fix from David Miller:
 "One last straggler.

  Eric Dumazet's pktgen unload oops fix was not entirely complete, but
  all the cases should be handled properly now....  fingers crossed."

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  pktgen: fix module unload for good

12 years agomemcg,thp: fix res_counter:96 regression
Hugh Dickins [Fri, 18 May 2012 18:28:34 +0000 (11:28 -0700)]
memcg,thp: fix res_counter:96 regression

Occasionally, testing memcg's move_charge_at_immigrate on rc7 shows
a flurry of hundreds of warnings at kernel/res_counter.c:96, where
res_counter_uncharge_locked() does WARN_ON(counter->usage < val).

The first trace of each flurry implicates __mem_cgroup_cancel_charge()
of mc.precharge, and an audit of mc.precharge handling points to
mem_cgroup_move_charge_pte_range()'s THP handling in commit 12724850e806
("memcg: avoid THP split in task migration").

Checking !mc.precharge is good everywhere else, when a single page is to
be charged; but here the "mc.precharge -= HPAGE_PMD_NR" likely to
follow, is liable to result in underflow (a lot can change since the
precharge was estimated).

Simply check against HPAGE_PMD_NR: there's probably a better
alternative, trying precharge for more, splitting if unsuccessful; but
this one-liner is safer for now - no kernel/res_counter.c:96 warnings
seen in 26 hours.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agox86, relocs: When printing an error, say relative or absolute
H. Peter Anvin [Fri, 18 May 2012 16:52:01 +0000 (09:52 -0700)]
x86, relocs: When printing an error, say relative or absolute

When the relocs tool throws an error, let the error message say if it
is an absolute or relative symbol.  This should make it a lot more
clear what action the programmer needs to take and should help us find
the reason if additional symbol bugs show up.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: <stable@vger.kernel.org>
12 years agox86, relocs: Workaround for binutils 2.22.52.0.1 section bug
H. Peter Anvin [Fri, 18 May 2012 07:24:09 +0000 (00:24 -0700)]
x86, relocs: Workaround for binutils 2.22.52.0.1 section bug

GNU ld 2.22.52.0.1 has a bug that it blindly changes symbols from
section-relative to absolute if they are in a section of zero length.
This turns the symbols __init_begin and __init_end into absolute
symbols.  Let the relocs program know that those should be treated as
relative symbols.

Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: H.J. Lu <hjl.tools@gmail.com>
Cc: <stable@vger.kernel.org>
Cc: Jarkko Sakkinen <jarkko.sakkinen@intel.com>
12 years agox86, realmode: 16-bit real-mode code support for relocs tool
H. Peter Anvin [Tue, 8 May 2012 18:22:24 +0000 (21:22 +0300)]
x86, realmode: 16-bit real-mode code support for relocs tool

A new option is added to the relocs tool called '--realmode'.
This option causes the generation of 16-bit segment relocations
and 32-bit linear relocations for the real-mode code. When
the real-mode code is moved to the low-memory during kernel
initialization, these relocation entries can be used to
relocate the code properly.

In the assembly code 16-bit segment relocations must be relative
to the 'real_mode_seg' absolute symbol. Linear relocations must be
relative to a symbol prefixed with 'pa_'.

16-bit segment relocation is used to load cs:ip in 16-bit code.
Linear relocations are used in the 32-bit code for relocatable
data references. They are declared in the linker script of the
real-mode code.

The relocs tool is moved to arch/x86/tools/relocs.c, and added new
target archscripts that can be used to build scripts needed building
an architecture.  be compiled before building the arch/x86 tree.

[ hpa: accelerating this because it detects invalid absolute
  relocations, a serious bug in binutils 2.22.52.0.x which currently
  produces bad kernels. ]

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Link: http://lkml.kernel.org/r/1336501366-28617-2-git-send-email-jarkko.sakkinen@intel.com
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: <stable@vger.kernel.org>
12 years agoMerge tag 'dm-3.4-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm
Linus Torvalds [Sat, 19 May 2012 01:22:45 +0000 (18:22 -0700)]
Merge tag 'dm-3.4-fixes-2' of git://git./linux/kernel/git/agk/linux-dm

Pull a dm fix from Alasdair G Kergon:
 "A fix to the thin provisioning userspace interface."

* tag 'dm-3.4-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm:
  dm thin: fix table output when pool target disables discard passdown internally

12 years agodm thin: fix table output when pool target disables discard passdown internally
Mike Snitzer [Sat, 19 May 2012 00:01:01 +0000 (01:01 +0100)]
dm thin: fix table output when pool target disables discard passdown internally

When the thin pool target clears the discard_passdown parameter
internally, it incorrectly changes the table line reported to userspace.
This breaks dumb string comparisons on these table lines in generic
userspace device-mapper library code and leads to tables being reloaded
repeatedly when nothing is actually meant to be changing.

This patch corrects this by no longer changing the table line when
discard passdown was disabled.

We can still tell when discard passdown is overridden by looking for the
message "Discard unsupported by data device (sdX): Disabling discard passdown."

This automatic detection is also moved from the 'load' to the 'resume'
so that it is re-evaluated should the properties of underlying devices
change.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agoMerge tag 'md-3.4-fixes' of git://neil.brown.name/md
Linus Torvalds [Fri, 18 May 2012 23:19:59 +0000 (16:19 -0700)]
Merge tag 'md-3.4-fixes' of git://neil.brown.name/md

Pull one more md bugfix from NeilBrown:
 "Fix bug in recent fix to RAID10.

  Without this patch, recovery will crash"

* tag 'md-3.4-fixes' of git://neil.brown.name/md:
  md/raid10: fix transcription error in calc_sectors conversion.

12 years agoMerge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux...
Linus Torvalds [Fri, 18 May 2012 23:16:42 +0000 (16:16 -0700)]
Merge branch 'stable' of git://git./linux/kernel/git/cmetcalf/linux-tile

Pull tile tree bugfix from Chris Metcalf:
 "This fixes a security vulnerability (and correctness bug) in tilegx"

* 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
  tilegx: enable SYSCALL_WRAPPERS support

12 years agomd/raid10: fix transcription error in calc_sectors conversion.
NeilBrown [Fri, 18 May 2012 23:01:13 +0000 (09:01 +1000)]
md/raid10: fix transcription error in calc_sectors conversion.

The old code was
sector_div(stride, fc);
the new code was
sector_dir(size, conf->near_copies);

'size' is right (the stride various wasn't really needed), but
'fc' means 'far_copies', and that is an important difference.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoMerge branch 'akpm' (Andrew's patch-bomb)
Linus Torvalds [Fri, 18 May 2012 22:56:25 +0000 (15:56 -0700)]
Merge branch 'akpm' (Andrew's patch-bomb)

Merge misc fixes from Andrew Morton.

* emailed from Andrew Morton <akpm@linux-foundation.org>: (4 patches)
  frv: delete incorrect task prototypes causing compile fail
  slub: missing test for partial pages flush work in flush_all()
  fs, proc: fix ABBA deadlock in case of execution attempt of map_files/ entries
  drivers/rtc/rtc-pl031.c: configure correct wday for 2000-01-01

12 years agoproc: move fd symlink i_mode calculations into tid_fd_revalidate()
Linus Torvalds [Fri, 18 May 2012 18:32:15 +0000 (11:32 -0700)]
proc: move fd symlink i_mode calculations into tid_fd_revalidate()

Instead of doing the i_mode calculations at proc_fd_instantiate() time,
move them into tid_fd_revalidate(), which is where the other inode state
(notably uid/gid information) is updated too.

Otherwise we'll end up with stale i_mode information if an fd is re-used
while the dentry still hangs around.  Not that anything really *cares*
(symlink permissions don't really matter), but Tetsuo Handa noticed that
the owner read/write bits don't always match the state of the
readability of the file descriptor, and we _used_ to get this right a
long time ago in a galaxy far, far away.

Besides, aside from fixing an ugly detail (that has apparently been this
way since commit 61a28784028e: "proc: Remove the hard coded inode
numbers" in 2006), this removes more lines of code than it adds.  And it
just makes sense to update i_mode in the same place we update i_uid/gid.

Al Viro correctly points out that we could just do the inode fill in the
inode iops ->getattr() function instead.  However, that does require
somewhat slightly more invasive changes, and adds yet *another* lookup
of the file descriptor.  We need to do the revalidate() for other
reasons anyway, and have the file descriptor handy, so we might as well
fill in the information at this point.

Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Eric Biederman <ebiederm@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agopktgen: fix module unload for good
Eric Dumazet [Thu, 17 May 2012 23:52:26 +0000 (23:52 +0000)]
pktgen: fix module unload for good

commit c57b5468406 (pktgen: fix crash at module unload) did a very poor
job with list primitives.

1) list_splice() arguments were in the wrong order

2) list_splice(list, head) has undefined behavior if head is not
initialized.

3) We should use the list_splice_init() variant to clear pktgen_threads
list.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotilegx: enable SYSCALL_WRAPPERS support
Chris Metcalf [Fri, 18 May 2012 17:33:24 +0000 (13:33 -0400)]
tilegx: enable SYSCALL_WRAPPERS support

Some discussion with the glibc mailing lists revealed that this was
necessary for 64-bit platforms with MIPS-like sign-extension rules
for 32-bit values.  The original symptom was that passing (uid_t)-1 to
setreuid() was failing in programs linked -pthread because of the "setxid"
mechanism for passing setxid-type function arguments to the syscall code.
SYSCALL_WRAPPERS handles ensuring that all syscall arguments end up with
proper sign-extension and is thus the appropriate fix for this problem.

On other platforms (s390, powerpc, sparc64, and mips) this was fixed
in 2.6.28.6.  The general issue is tracked as CVE-2009-0029.

Cc: <stable@vger.kernel.org>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
12 years agoMerge tag 'linus-mce-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras
Linus Torvalds [Fri, 18 May 2012 16:42:20 +0000 (09:42 -0700)]
Merge tag 'linus-mce-fix' of git://git./linux/kernel/git/ras/ras

Pull a machine check recovery fix from Tony Luck.

I really don't like how the MCE code does some of the things it does,
but this does seem to be an improvement.

* tag 'linus-mce-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
  x86/mce: Only restart instruction after machine check recovery if it is safe

12 years agofrv: delete incorrect task prototypes causing compile fail
Paul Gortmaker [Fri, 18 May 2012 00:03:26 +0000 (17:03 -0700)]
frv: delete incorrect task prototypes causing compile fail

Commit 41101809a865 ("fork: Provide weak arch_release_[task_struct|
thread_info] functions") in -tip highlights a problem in the frv arch,
where it has needles prototypes for alloc_task_struct_node and
free_task_struct.  This now shows up as:

  kernel/fork.c:120:66: error: static declaration of 'alloc_task_struct_node' follows non-static declaration
  kernel/fork.c:127:51: error: static declaration of 'free_task_struct' follows non-static declaration

since that commit turned them into real functions.  Since arch/frv does
does not define define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR (i.e.  it just
uses the generic ones) it shouldn't list these at all.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoslub: missing test for partial pages flush work in flush_all()
majianpeng [Fri, 18 May 2012 00:03:26 +0000 (17:03 -0700)]
slub: missing test for partial pages flush work in flush_all()

I found some kernel messages such as:

    SLUB raid5-md127: kmem_cache_destroy called for cache that still has objects.
    Pid: 6143, comm: mdadm Tainted: G           O 3.4.0-rc6+        #75
    Call Trace:
    kmem_cache_destroy+0x328/0x400
    free_conf+0x2d/0xf0 [raid456]
    stop+0x41/0x60 [raid456]
    md_stop+0x1a/0x60 [md_mod]
    do_md_stop+0x74/0x470 [md_mod]
    md_ioctl+0xff/0x11f0 [md_mod]
    blkdev_ioctl+0xd8/0x7a0
    block_ioctl+0x3b/0x40
    do_vfs_ioctl+0x96/0x560
    sys_ioctl+0x91/0xa0
    system_call_fastpath+0x16/0x1b

Then using kmemleak I found these messages:

    unreferenced object 0xffff8800b6db7380 (size 112):
      comm "mdadm", pid 5783, jiffies 4294810749 (age 90.589s)
      hex dump (first 32 bytes):
        01 01 db b6 ad 4e ad de ff ff ff ff ff ff ff ff  .....N..........
        ff ff ff ff ff ff ff ff 98 40 4a 82 ff ff ff ff  .........@J.....
      backtrace:
        kmemleak_alloc+0x21/0x50
        kmem_cache_alloc+0xeb/0x1b0
        kmem_cache_open+0x2f1/0x430
        kmem_cache_create+0x158/0x320
        setup_conf+0x649/0x770 [raid456]
        run+0x68b/0x840 [raid456]
        md_run+0x529/0x940 [md_mod]
        do_md_run+0x18/0xc0 [md_mod]
        md_ioctl+0xba8/0x11f0 [md_mod]
        blkdev_ioctl+0xd8/0x7a0
        block_ioctl+0x3b/0x40
        do_vfs_ioctl+0x96/0x560
        sys_ioctl+0x91/0xa0
        system_call_fastpath+0x16/0x1b

This bug was introduced by commit a8364d5555b ("slub: only IPI CPUs that
have per cpu obj to flush"), which did not include checks for per cpu
partial pages being present on a cpu.

Signed-off-by: majianpeng <majianpeng@gmail.com>
Cc: Gilad Ben-Yossef <gilad@benyossef.com>
Acked-by: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Tested-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agofs, proc: fix ABBA deadlock in case of execution attempt of map_files/ entries
Cyrill Gorcunov [Fri, 18 May 2012 00:03:25 +0000 (17:03 -0700)]
fs, proc: fix ABBA deadlock in case of execution attempt of map_files/ entries

map_files/ entries are never supposed to be executed, still curious
minds might try to run them, which leads to the following deadlock

  ======================================================
  [ INFO: possible circular locking dependency detected ]
  3.4.0-rc4-24406-g841e6a6 #121 Not tainted
  -------------------------------------------------------
  bash/1556 is trying to acquire lock:
   (&sb->s_type->i_mutex_key#8){+.+.+.}, at: do_lookup+0x267/0x2b1

  but task is already holding lock:
   (&sig->cred_guard_mutex){+.+.+.}, at: prepare_bprm_creds+0x2d/0x69

  which lock already depends on the new lock.

  the existing dependency chain (in reverse order) is:

  -> #1 (&sig->cred_guard_mutex){+.+.+.}:
         validate_chain+0x444/0x4f4
         __lock_acquire+0x387/0x3f8
         lock_acquire+0x12b/0x158
         __mutex_lock_common+0x56/0x3a9
         mutex_lock_killable_nested+0x40/0x45
         lock_trace+0x24/0x59
         proc_map_files_lookup+0x5a/0x165
         __lookup_hash+0x52/0x73
         do_lookup+0x276/0x2b1
         walk_component+0x3d/0x114
         do_last+0xfc/0x540
         path_openat+0xd3/0x306
         do_filp_open+0x3d/0x89
         do_sys_open+0x74/0x106
         sys_open+0x21/0x23
         tracesys+0xdd/0xe2

  -> #0 (&sb->s_type->i_mutex_key#8){+.+.+.}:
         check_prev_add+0x6a/0x1ef
         validate_chain+0x444/0x4f4
         __lock_acquire+0x387/0x3f8
         lock_acquire+0x12b/0x158
         __mutex_lock_common+0x56/0x3a9
         mutex_lock_nested+0x40/0x45
         do_lookup+0x267/0x2b1
         walk_component+0x3d/0x114
         link_path_walk+0x1f9/0x48f
         path_openat+0xb6/0x306
         do_filp_open+0x3d/0x89
         open_exec+0x25/0xa0
         do_execve_common+0xea/0x2f9
         do_execve+0x43/0x45
         sys_execve+0x43/0x5a
         stub_execve+0x6c/0xc0

This is because prepare_bprm_creds grabs task->signal->cred_guard_mutex
and when do_lookup happens we try to grab task->signal->cred_guard_mutex
again in lock_trace.

Fix it using plain ptrace_may_access() helper in proc_map_files_lookup()
and in proc_map_files_readdir() instead of lock_trace(), the caller must
be CAP_SYS_ADMIN granted anyway.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reported-by: Sasha Levin <levinsasha928@gmail.com>
Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Pavel Emelyanov <xemul@openvz.org>
Cc: Dave Jones <davej@redhat.com>
Cc: Vasiliy Kulikov <segoon@openwall.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agodrivers/rtc/rtc-pl031.c: configure correct wday for 2000-01-01
Rajkumar Kasirajan [Fri, 18 May 2012 00:03:24 +0000 (17:03 -0700)]
drivers/rtc/rtc-pl031.c: configure correct wday for 2000-01-01

The reset date of the ST Micro version of PL031 is 2000-01-01.  The
correct weekday for 2000-01-01 is saturday, but pl031 is initialized to
sunday.  This may lead to alarm malfunction, so configure the correct
wday if RTC_DR indicates reset.

Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Cc: Mattias Wallin <mattias.wallin@stericsson.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm
Linus Torvalds [Thu, 17 May 2012 23:52:29 +0000 (16:52 -0700)]
Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm

Pull ARM fixes from Russell King:
 "Small set of fixes again."

* 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
  ARM: 7419/1: vfp: fix VFP flushing regression on sigreturn path
  ARM: 7418/1: LPAE: fix access flag setup in mem_type_table
  ARM: prevent VM_GROWSDOWN mmaps extending below FIRST_USER_ADDRESS
  ARM: 7417/1: vfp: ensure preemption is disabled when enabling VFP access

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Thu, 17 May 2012 23:30:26 +0000 (16:30 -0700)]
Merge git://git./linux/kernel/git/davem/net

Pull two networking fixes from David S. Miller:

1) Thanks to Willy Tarreau and Eric Dumazet, we've unlocked a bug that's
   been present in do_tcp_sendpages() since that function was written in
   2002.

   When we block to wait for memory we have to unconditionally try and
   push out pending TCP data, otherwise we can block for an unreasonably
   long amount of time.

2) Fix deadlock in e1000, fixes kernel bugzilla 43132

   From Tushar Dave.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  e1000: Prevent reset task killing itself.
  tcp: do_tcp_sendpages() must try to push data out on oom conditions

12 years agoACPI / PCI / PM: Fix device PM regression related to D3hot/D3cold
Rafael J. Wysocki [Thu, 17 May 2012 22:39:35 +0000 (00:39 +0200)]
ACPI / PCI / PM: Fix device PM regression related to D3hot/D3cold

Commit 1cc0c998fdf2 ("ACPI: Fix D3hot v D3cold confusion") introduced a
bug in __acpi_bus_set_power() and changed the behavior of
acpi_pci_set_power_state() in such a way that it generally doesn't work
as expected if PCI_D3hot is passed to it as the second argument.

First off, if ACPI_STATE_D3 (equal to ACPI_STATE_D3_COLD) is passed to
__acpi_bus_set_power() and the explicit_set flag is set for the D3cold
state, the function will try to execute AML method called "_PS4", which
doesn't exist.

Fix this by adding a check to ensure that the name of the AML method
to execute for transitions to ACPI_STATE_D3_COLD is correct in
__acpi_bus_set_power().  Also make sure that the explicit_set flag
for ACPI_STATE_D3_COLD will be set if _PS3 is present and modify
acpi_power_transition() to avoid accessing power resources for
ACPI_STATE_D3_COLD, because they don't exist.

Second, if PCI_D3hot is passed to acpi_pci_set_power_state() as the
target state, the function will request a transition to
ACPI_STATE_D3_HOT instead of ACPI_STATE_D3.  However,
ACPI_STATE_D3_HOT is now only marked as supported if the _PR3 AML
method is defined for the given device, which is rare.  This causes
problems to happen on systems where devices were successfully put
into ACPI D3 by pci_set_power_state(PCI_D3hot) which doesn't work
now.  In particular, some unused graphics adapters are not turned
off as a result.

To fix this issue restore the old behavior of
acpi_pci_set_power_state(), which is to request a transition to
ACPI_STATE_D3 (equal to ACPI_STATE_D3_COLD) if either PCI_D3hot or
PCI_D3cold is passed to it as the argument.

This approach is not ideal, because generally power should not
be removed from devices if PCI_D3hot is the target power state,
but since this behavior is relied on, we have no choice but to
restore it at the moment and spend more time on designing a
better solution in the future.

References: https://bugzilla.kernel.org/show_bug.cgi?id=43228
Reported-by: rocko <rockorequin@hotmail.com>
Reported-by: Cristian Rodríguez <crrodriguez@opensuse.org>
Reported-and-tested-by: Peter <lekensteyn@gmail.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoe1000: Prevent reset task killing itself.
Tushar Dave [Thu, 17 May 2012 01:04:50 +0000 (01:04 +0000)]
e1000: Prevent reset task killing itself.

Killing reset task while adapter is resetting causes deadlock.
Only kill reset task if adapter is not resetting.
Ref bug #43132 on bugzilla.kernel.org

CC: stable@vger.kernel.org
Signed-off-by: Tushar Dave <tushar.n.dave@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotcp: do_tcp_sendpages() must try to push data out on oom conditions
Willy Tarreau [Thu, 17 May 2012 11:14:14 +0000 (11:14 +0000)]
tcp: do_tcp_sendpages() must try to push data out on oom conditions

Since recent changes on TCP splicing (starting with commits 2f533844
"tcp: allow splice() to build full TSO packets" and 35f9c09f "tcp:
tcp_sendpages() should call tcp_push() once"), I started seeing
massive stalls when forwarding traffic between two sockets using
splice() when pipe buffers were larger than socket buffers.

Latest changes (net: netdev_alloc_skb() use build_skb()) made the
problem even more apparent.

The reason seems to be that if do_tcp_sendpages() fails on out of memory
condition without being able to send at least one byte, tcp_push() is not
called and the buffers cannot be flushed.

After applying the attached patch, I cannot reproduce the stalls at all
and the data rate it perfectly stable and steady under any condition
which previously caused the problem to be permanent.

The issue seems to have been there since before the kernel migrated to
git, which makes me think that the stalls I occasionally experienced
with tux during stress-tests years ago were probably related to the
same issue.

This issue was first encountered on 3.0.31 and 3.2.17, so please backport
to -stable.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Acked-by: Eric Dumazet <edumazet@google.com>
Cc: <stable@vger.kernel.org>
12 years agoMerge branch '3.4-urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target...
Linus Torvalds [Thu, 17 May 2012 20:25:17 +0000 (13:25 -0700)]
Merge branch '3.4-urgent' of git://git./linux/kernel/git/nab/target-pending

Pull two more target-core updates from Nicholas Bellinger:
 "The first patch addresses a SPC-2 reservations RELEASE bug in a
  special (iscsi specific) multi-ISID setup case that was allowing the
  same initiator to be able to incorrect release it's own reservation on
  a different SCSI path with enforce_pr_isid=1 operation.  This bug was
  caught by Bernhard Kohl.

  The second patch is to address a bug with FILEIO backends where the
  incorrect number of blocks for READ_CAPACITY was being reported after
  an underlying device-mapper block_device size change.  This patch uses
  now i_size_read() in fd_get_blocks() for FILEIO backends with an
  underlying block_device, instead of trying to determine this value at
  setup time during fd_create_virtdevice().  (hch CC'ed)

  Both are CC'ed to stable."

* '3.4-urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
  target: Fix bug in handling of FILEIO + block_device resize ops
  target: Fix SPC-2 RELEASE bug for multi-session iSCSI client setups

12 years agotarget: Fix bug in handling of FILEIO + block_device resize ops
Nicholas Bellinger [Wed, 16 May 2012 23:05:26 +0000 (16:05 -0700)]
target: Fix bug in handling of FILEIO + block_device resize ops

This patch fixes a bug in the handling of FILEIO w/ underlying block_device
resize operations where the original fd_dev->fd_dev_size was incorrectly being
used in fd_get_blocks() for READ_CAPACITY response payloads.

This patch avoids using fd_dev->fd_dev_size for FILEIO devices with
an underlying block_device, and instead changes fd_get_blocks() to
get the sector count directly from i_size_read() as recommended by hch.

Reported-by: Christoph Hellwig <hch@lst.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
12 years agoMerge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Linus Torvalds [Thu, 17 May 2012 16:57:13 +0000 (09:57 -0700)]
Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma

Pull slave-dmaengine fixes fromVinod Koul:
 "fixes of cylic dma usages in slave dma drivers"

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine: fix cyclic dma usage
  dmaengine: pl330: dont complete descriptor for cyclic dma

12 years agoMerge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Linus Torvalds [Thu, 17 May 2012 16:55:58 +0000 (09:55 -0700)]
Merge tag 'for_linus' of git://git./linux/kernel/git/mst/vhost

Pull last minute virtio fixes from Michael S. Tsirkin:
 "Here are a couple of last minute virtio fixes for 3.4.  Hope it's not
  too late yes - I might have tried too hard to make sure the fix is
  well tested.

  Fixes are by Amit and myself.  One fixes module removal and one
  suspend of a VM, the last one the handling of out of memory condition.

  They are thus very low risk as most people never hit these paths, but
  do fix very annoying problems for people that do use the feature.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>"
* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  virtio_net: invoke softirqs after __napi_schedule
  virtio: balloon: let host know of updated balloon size before module removal
  virtio: console: tell host of open ports after resume from s3/s4

12 years agoMerge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
Linus Torvalds [Thu, 17 May 2012 16:46:07 +0000 (09:46 -0700)]
Merge tag 'fixes-for-linus' of git://git./linux/kernel/git/arm/arm-soc

Pull ARM: SoC fixes from Olof Johansson:
 "I will stop trying to predict when we're done with fixes for a
  release.

  Here's another small batch of three patches for arm-soc:

   - A fix for a boot time WARN_ON() due to irq domain conversion on
     PRIMA2
   - Fix for a regression in Tegra SMP spinup code due to swapped
     register offsets
   - Fixed config dependency for mv_cesa crypto driver to avoid build
     breakage"

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  ARM: PRIMA2: fix irq domain size and IRQ mask of internal interrupt controller
  crypto: mv_cesa requires on CRYPTO_HASH to build
  ARM: tegra: Fix flow controller accesses

12 years agoMerge tag 'md-3.4-fixes' of git://neil.brown.name/md
Linus Torvalds [Thu, 17 May 2012 16:44:35 +0000 (09:44 -0700)]
Merge tag 'md-3.4-fixes' of git://neil.brown.name/md

Pull two md fixes from NeilBrown:
 "One fixes a bug in the new raid10 resize code so is relevant to 3.4
  only.

  The other fixes a bug in the use of md by dm-raid, so is relevant to
  any kernel with dm-raid support"

* tag 'md-3.4-fixes' of git://neil.brown.name/md:
  MD: Add del_timer_sync to mddev_suspend (fix nasty panic)
  md/raid10: set dev_sectors properly when resizing devices in array.

12 years agoMerge branches 'perf-urgent-for-linus', 'x86-urgent-for-linus' and 'sched-urgent...
Linus Torvalds [Thu, 17 May 2012 16:35:17 +0000 (09:35 -0700)]
Merge branches 'perf-urgent-for-linus', 'x86-urgent-for-linus' and 'sched-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull perf, x86 and scheduler updates from Ingo Molnar.

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  tracing: Do not enable function event with enable
  perf stat: handle ENXIO error for perf_event_open
  perf: Turn off compiler warnings for flex and bison generated files
  perf stat: Fix case where guest/host monitoring is not supported by kernel
  perf build-id: Fix filename size calculation

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, kvm: KVM paravirt kernels don't check for CPUID being unavailable
  x86: Fix section annotation of acpi_map_cpu2node()
  x86/microcode: Ensure that module is only loaded on supported Intel CPUs

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched: Fix KVM and ia64 boot crash due to sched_groups circular linked list assumption

12 years agoARM: 7419/1: vfp: fix VFP flushing regression on sigreturn path
Will Deacon [Tue, 15 May 2012 14:51:54 +0000 (15:51 +0100)]
ARM: 7419/1: vfp: fix VFP flushing regression on sigreturn path

Commit ff9a184c ("ARM: 7400/1: vfp: clear fpscr length and stride bits
on entry to sig handler") flushes the VFP state prior to entering a
signal handler so that a VFP operation inside the handler will trap and
force a restore of ABI-compliant registers. Reflushing and disabling VFP
on the sigreturn path is predicated on the saved thread state indicating
that VFP was used by the handler -- however for SMP platforms this is
only set on context-switch, making the check unreliable and causing VFP
register corruption in userspace since the register values are not
necessarily those restored from the sigframe.

This patch unconditionally flushes the VFP state after a signal handler.
Since we already perform the flush before the handler and the flushing
itself happens lazily, the redundant flush when VFP is not used by the
handler is essentially a nop.

Reported-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7418/1: LPAE: fix access flag setup in mem_type_table
Vitaly Andrianov [Tue, 15 May 2012 14:01:16 +0000 (15:01 +0100)]
ARM: 7418/1: LPAE: fix access flag setup in mem_type_table

A zero value for prot_sect in the memory types table implies that
section mappings should never be created for the memory type in question.
This is checked for in alloc_init_section().

With LPAE, we set a bit to mask access flag faults for kernel mappings.
This breaks the aforementioned (!prot_sect) check in alloc_init_section().

This patch fixes this bug by first checking for a non-zero
prot_sect before setting the PMD_SECT_AF flag.

Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agovirtio_net: invoke softirqs after __napi_schedule
Michael S. Tsirkin [Wed, 16 May 2012 07:57:12 +0000 (10:57 +0300)]
virtio_net: invoke softirqs after __napi_schedule

__napi_schedule might raise softirq but nothing
causes do_softirq to trigger, so it does not in fact
run. As a result,
the error message "NOHZ: local_softirq_pending 08"
sometimes occurs during boot of a KVM guest when the network service is
started and we are oom:

  ...
  Bringing up loopback interface:  [  OK  ]
  Bringing up interface eth0:
  Determining IP information for eth0...NOHZ: local_softirq_pending 08
   done.
  [  OK  ]
  ...

Further, receive queue processing might get delayed
indefinitely until some interrupt triggers:
virtio_net expected napi to be run immediately.

One way to cause do_softirq to be executed is by
invoking local_bh_enable(). As __napi_schedule is
normally called from bh or irq context, this
seems to make sense: disable bh before __napi_schedule
and enable afterwards.

In fact it's a very complicated way of calling do_softirq(),
and works since this function is only used when we are not
in interrupt context.  It's not hot at all, in any ideal scenario.

Reported-by: Ulrich Obergfell <uobergfe@redhat.com>
Tested-by: Ulrich Obergfell <uobergfe@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
12 years agovirtio: balloon: let host know of updated balloon size before module removal
Amit Shah [Thu, 26 Apr 2012 19:15:56 +0000 (00:45 +0530)]
virtio: balloon: let host know of updated balloon size before module removal

When the balloon module is removed, we deflate the balloon, reclaiming
all the pages that were given to the host.  However, we don't update the
config values for the new balloon size, resulting in the host showing
outdated balloon values.

The size update is done after each leak and fill operation, only the
module removal case was left out.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
12 years agovirtio: console: tell host of open ports after resume from s3/s4
Amit Shah [Wed, 25 Apr 2012 09:10:39 +0000 (14:40 +0530)]
virtio: console: tell host of open ports after resume from s3/s4

If a port was open before going into one of the sleep states, the port
can continue normal operation after restore.  However, the host has to
be told that the guest side of the connection is open to restore
pre-suspend state.

This wasn't noticed so far due to a bug in qemu that was fixed recently
(which marked the guest-side connection as always open).

CC: stable@vger.kernel.org # Only for 3.3
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
12 years agoARM: PRIMA2: fix irq domain size and IRQ mask of internal interrupt controller
Barry Song [Thu, 17 May 2012 03:28:55 +0000 (11:28 +0800)]
ARM: PRIMA2: fix irq domain size and IRQ mask of internal interrupt controller

the old codes will cause 3.4 kernel warning as irq domain size is wrong:
------------[ cut here ]------------
WARNING: at kernel/irq/irqdomain.c:74 irq_domain_legacy_revmap+0x24/0x48()
Modules linked in:
[<c0013f50>] (unwind_backtrace+0x0/0xf8) from [<c001e7d8>] (warn_slowpath_common+0x54/0x64)
[<c001e7d8>] (warn_slowpath_common+0x54/0x64) from [<c001e804>] (warn_slowpath_null+0x1c/0x24)
[<c001e804>] (warn_slowpath_null+0x1c/0x24) from [<c005c3c4>] (irq_domain_legacy_revmap+0x24/0x48)
[<c005c3c4>] (irq_domain_legacy_revmap+0x24/0x48) from [<c005c704>] (irq_create_mapping+0x20/0x120)
[<c005c704>] (irq_create_mapping+0x20/0x120) from [<c005c880>] (irq_create_of_mapping+0x7c/0xf0)
[<c005c880>] (irq_create_of_mapping+0x7c/0xf0) from [<c01a6c48>] (irq_of_parse_and_map+0x2c/0x34)
[<c01a6c48>] (irq_of_parse_and_map+0x2c/0x34) from [<c01a6c68>] (of_irq_to_resource+0x18/0x74)
[<c01a6c68>] (of_irq_to_resource+0x18/0x74) from [<c01a6ce8>] (of_irq_count+0x24/0x34)
[<c01a6ce8>] (of_irq_count+0x24/0x34) from [<c01a7220>] (of_device_alloc+0x58/0x158)
[<c01a7220>] (of_device_alloc+0x58/0x158) from [<c01a735c>] (of_platform_device_create_pdata+0x3c/0x80)
[<c01a735c>] (of_platform_device_create_pdata+0x3c/0x80) from [<c01a7468>] (of_platform_bus_create+0xc8/0x190)
[<c01a7468>] (of_platform_bus_create+0xc8/0x190) from [<c01a74cc>] (of_platform_bus_create+0x12c/0x190)
---[ end trace 1b75b31a2719ed32 ]---

Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
12 years agoMD: Add del_timer_sync to mddev_suspend (fix nasty panic)
Jonathan Brassow [Wed, 16 May 2012 09:06:14 +0000 (04:06 -0500)]
MD: Add del_timer_sync to mddev_suspend (fix nasty panic)

Use del_timer_sync to remove timer before mddev_suspend finishes.

We don't want a timer going off after an mddev_suspend is called.  This is
especially true with device-mapper, since it can call the destructor function
immediately following a suspend.  This results in the removal (kfree) of the
structures upon which the timer depends - resulting in a very ugly panic.
Therefore, we add a del_timer_sync to mddev_suspend to prevent this.

Cc: stable@vger.kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid10: set dev_sectors properly when resizing devices in array.
NeilBrown [Thu, 17 May 2012 00:08:45 +0000 (10:08 +1000)]
md/raid10: set dev_sectors properly when resizing devices in array.

raid10 stores dev_sectors in 'conf' separately from the one in
'mddev' because it can have a very significant effect on block
addressing and so need to be updated carefully.

However raid10_resize isn't updating it at all!

To update it correctly, we need to make sure it is a proper
multiple of the chunksize taking various details of the layout
in to account.
This calculation is currently done in setup_conf.   So split it
out from there and call it from raid10_resize as well.
Then set conf->dev_sectors properly.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoMerge git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Wed, 16 May 2012 21:30:51 +0000 (14:30 -0700)]
Merge git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull kvm powerpc fixes from Marcelo Tosatti:
 "Urgent KVM PPC updates, quoting Alexander Graf:

    There are a few bugs in 3.4 that really should be fixed before
    people can be all happy and fuzzy about KVM on PowerPC.  These fixes
    are:

     * fix POWER7 bare metal with PR=y
     * fix deadlock on HV=y book3s_64 mode in low memory cases
     * fix invalid MMU scope of PR=y mode on book3s_64, possibly eading
       to memory corruption"

* git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: PPC: Book3S HV: Fix bug leading to deadlock in guest HPT updates
  powerpc/kvm: Fix VSID usage in 64-bit "PR" KVM
  KVM: PPC: Book3S: PR: Fix hsrr code
  KVM: PPC: Fix PR KVM on POWER7 bare metal
  KVM: PPC: Book3S: PR: Handle EMUL_ASSIST

12 years agoMerge tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Linus Torvalds [Wed, 16 May 2012 21:29:45 +0000 (14:29 -0700)]
Merge tag 'sound-3.4' of git://git./linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A few last-minute regression fixes for 3.4 final kernel.  All trivial,
  and Cc'ed to stable kernel."

* tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ASoC: wm8994: Fix AIF2ADC power down
  ALSA: hda/idt - Fix power-map for speaker-pins with some HP laptops
  ASoC: cs42l73: Sync digital mixer kcontrols to allow for 0dB

12 years agoMerge tag 'rproc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad...
Linus Torvalds [Wed, 16 May 2012 21:26:05 +0000 (14:26 -0700)]
Merge tag 'rproc-for-linus' of git://git./linux/kernel/git/ohad/remoteproc

Pull remoteproc fix from Ohad Ben-Cohen:
 "Fix a nasty off-by-one remoteproc bug which leaks memory when a remote
  processor is shut down and, on certain circumstances, can indirectly
  prevent it from being reloaded."

* tag 'rproc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc:
  remoteproc: fix off-by-one bug in __rproc_free_vrings

12 years agoMerge git://git.samba.org/sfrench/cifs-2.6
Linus Torvalds [Wed, 16 May 2012 21:22:38 +0000 (14:22 -0700)]
Merge git://git.samba.org/sfrench/cifs-2.6

Pull CIFS fix from Jeff Layton

* git://git.samba.org/sfrench/cifs-2.6:
  cifs: fix misspelling of "forcedirectio"

12 years agoMerge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux...
Linus Torvalds [Wed, 16 May 2012 21:21:41 +0000 (14:21 -0700)]
Merge branch 'stable' of git://git./linux/kernel/git/cmetcalf/linux-tile

Pull two Tile arch fixes from Chris Metcalf:
 "These are both bug-fixes, one to avoid some issues in how we invoke
  the "pending userspace work" flags on return to userspace, and the
  other to provide the same signal handler arguments for tilegx32 that
  we do for tilegx64."

* 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
  arch/tile: apply commit 74fca9da0 to the compat signal handling as well
  arch/tile: fix up some issues in calling do_work_pending()

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Wed, 16 May 2012 20:14:52 +0000 (13:14 -0700)]
Merge git://git./linux/kernel/git/davem/net

Pull networking tree from David Miller:

1) ptp_pch driver build broke during this merge window due to missing
   slab.h header, fix from Geery Uytterhoeven.

2) If ipset passes in a bogus hash table size we crash because the size
   is not validated properly.  Compounding this, gcc-4.7 can miscompile
   ipset such that even when the user specifies legitimate parameters
   the tool passes in an out-of-range size to the kernel.

   Fix from Jozsef Kadlecsik.

3) Users have reported that the netdev watchdog can trigger with pch_gbe
   devices, and it turns out this is happening because of races in the
   TX path of the driver leading to the transmitter hanging.  Fix from
   Eric Dumazet, reported and tested by Andy Cress.

4) Novatel USB551L devices match the generic class entries for the cdc
   ethernet USB driver, but they don't work because they have generic
   descriptors and thus need FLAG_WWAN to function properly.

   Add the necessary ID table entry to fix this, from Dan Williams.

5) A recursive locking fix in the USBNET driver added a new problem, in
   that packet list traversal is now racy and we can thus access
   unlinked SKBs and crash.

   Avoid this situation by adding some extra state tracking, from Ming
   Lei.

6) The rtlwifi conversion to asynchronous firmware loading is racy, fix
   by reordering the probe procedure.  From Larry Finger.

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

7) Fix regressions with bluetooth keyboards by notifying userland
   properly when the security level changes, from Gustavo Padovan.

8) Bluetooth needs to make sure device connected events are emitted
   before other kinds of events, otherwise userspace will think there is
   no baseband link yet and therefore abort the sockets associated with
   that connection.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  netfilter: ipset: fix hash size checking in kernel
  ptp_pch: Add missing #include <linux/slab.h>
  pch_gbe: fix transmit races
  cdc_ether: add Novatel USB551L device IDs for FLAG_WWAN
  usbnet: fix skb traversing races during unlink(v2)
  Bluetooth: mgmt: Fix device_connected sending order
  Bluetooth: notify userspace of security level change
  rtlwifi: fix for race condition when firmware is cached

12 years agoarch/tile: apply commit 74fca9da0 to the compat signal handling as well
Chris Metcalf [Wed, 16 May 2012 18:54:20 +0000 (14:54 -0400)]
arch/tile: apply commit 74fca9da0 to the compat signal handling as well

This passes siginfo and mcontext to tilegx32 signal handlers that
don't have SA_SIGINFO set just as we have been doing for tilegx64.

Cc: stable@vger.kernel.org
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
12 years agoarch/tile: fix up some issues in calling do_work_pending()
Chris Metcalf [Sat, 28 Apr 2012 22:51:43 +0000 (18:51 -0400)]
arch/tile: fix up some issues in calling do_work_pending()

First, we were at risk of handling thread-info flags, in particular
do_signal(), when returning from kernel space.  This could happen
after a failed kernel_execve(), or when forking a kernel thread.
The fix is to test in do_work_pending() for user_mode() and return
immediately if so; we already had this test for one of the flags,
so I just hoisted it to the top of the function.

Second, if a ptraced process updated the callee-saved registers
in the ptregs struct and then processed another thread-info flag, we
would overwrite the modifications with the original callee-saved
registers.  To fix this, we add a register to note if we've already
saved the registers once, and skip doing it on additional passes
through the loop.  To avoid a performance hit from the couple of
extra instructions involved, I modified the GET_THREAD_INFO() macro
to be guaranteed to be one instruction, then bundled it with adjacent
instructions, yielding an overall net savings.

Reported-By: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
12 years agonetfilter: ipset: fix hash size checking in kernel
Jozsef Kadlecsik [Mon, 14 May 2012 01:47:01 +0000 (01:47 +0000)]
netfilter: ipset: fix hash size checking in kernel

The hash size must fit both into u32 (jhash) and the max value of
size_t. The missing checking could lead to kernel crash, bug reported
by Seblu.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoptp_pch: Add missing #include <linux/slab.h>
Geert Uytterhoeven [Wed, 16 May 2012 01:50:17 +0000 (01:50 +0000)]
ptp_pch: Add missing #include <linux/slab.h>

drivers/ptp/ptp_pch.c: In function 'pch_remove':
drivers/ptp/ptp_pch.c:576:2: error: implicit declaration of function 'kfree' [-Werror=implicit-function-declaration]
drivers/ptp/ptp_pch.c: In function 'pch_probe':
drivers/ptp/ptp_pch.c:587:2: error: implicit declaration of function 'kzalloc' [-Werror=implicit-function-declaration]

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agocifs: fix misspelling of "forcedirectio"
Jeff Layton [Wed, 16 May 2012 11:12:26 +0000 (07:12 -0400)]
cifs: fix misspelling of "forcedirectio"

...and add a "directio" synonym since that's what the manpage has
always advertised.

Acked-by: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoARM: prevent VM_GROWSDOWN mmaps extending below FIRST_USER_ADDRESS
Russell King [Wed, 16 May 2012 14:19:20 +0000 (15:19 +0100)]
ARM: prevent VM_GROWSDOWN mmaps extending below FIRST_USER_ADDRESS

Cc: <stable@vger.kernel.org>
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoMerge branch 'for-3.4/fixes-for-final' of git://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Wed, 16 May 2012 13:47:11 +0000 (15:47 +0200)]
Merge branch 'for-3.4/fixes-for-final' of git://git./linux/kernel/git/swarren/linux-tegra into fixes

* 'for-3.4/fixes-for-final' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra:
  ARM: tegra: Fix flow controller accesses

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
12 years agoMerge branch 'marvell_fixes_for_v3.4' of git://git.infradead.org/users/jcooper/linux...
Arnd Bergmann [Wed, 16 May 2012 13:44:34 +0000 (15:44 +0200)]
Merge branch 'marvell_fixes_for_v3.4' of git://git.infradead.org/users/jcooper/linux into fixes

* 'marvell_fixes_for_v3.4' of git://git.infradead.org/users/jcooper/linux:
  crypto: mv_cesa requires on CRYPTO_HASH to build

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
12 years agoKVM: PPC: Book3S HV: Fix bug leading to deadlock in guest HPT updates
Paul Mackerras [Wed, 9 May 2012 23:49:24 +0000 (23:49 +0000)]
KVM: PPC: Book3S HV: Fix bug leading to deadlock in guest HPT updates

When handling the H_BULK_REMOVE hypercall, we were forgetting to
invalidate and unlock the hashed page table entry (HPTE) in the case
where the page had been paged out.  This fixes it by clearing the
first doubleword of the HPTE in that case.

This fixes a regression introduced in commit a92bce95f0 ("KVM: PPC:
Book3S HV: Keep HPTE locked when invalidating").  The effect of the
regression is that the host kernel will sometimes hang when under
memory pressure.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agopowerpc/kvm: Fix VSID usage in 64-bit "PR" KVM
Benjamin Herrenschmidt [Fri, 23 Mar 2012 00:21:14 +0000 (11:21 +1100)]
powerpc/kvm: Fix VSID usage in 64-bit "PR" KVM

The code forgot to scramble the VSIDs the way we normally do
and was basically using the "proto VSID" directly with the MMU.

This means that in practice, KVM used random VSIDs that could
collide with segments used by other user space programs.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[agraf: simplify ppc32 case]
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agoKVM: PPC: Book3S: PR: Fix hsrr code
Alexander Graf [Thu, 10 May 2012 01:58:50 +0000 (03:58 +0200)]
KVM: PPC: Book3S: PR: Fix hsrr code

When jumping back into the kernel to code that knows that it would be
using HSRR registers instead of SRR registers, we need to make sure we
pass it all information on where to jump to in HSRR registers.

Unfortunately, we used r10 to store the information to distinguish between
the HSRR and SRR case. That register got clobbered in between though,
rendering the later comparison invalid.

Instead, let's use cr1 to store this information. That way we don't
need yet another register and everyone's happy.

This fixes PR KVM on POWER7 bare metal for me.

Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agoKVM: PPC: Fix PR KVM on POWER7 bare metal
Alexander Graf [Fri, 27 Apr 2012 14:33:35 +0000 (16:33 +0200)]
KVM: PPC: Fix PR KVM on POWER7 bare metal

When running on a system that is HV capable, some interrupts use HSRR
SPRs instead of the normal SRR SPRs. These are also used in the Linux
handlers to jump back to code after an interrupt got processed.

Unfortunately, in our "jump back to the real host handler after we've
done the context switch" code, we were only setting the SRR SPRs,
rendering Linux to jump back to some invalid IP after it's processed
the interrupt.

This fixes random crashes on p7 opal mode with PR KVM for me.

Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agoKVM: PPC: Book3S: PR: Handle EMUL_ASSIST
Alexander Graf [Thu, 10 May 2012 01:54:58 +0000 (03:54 +0200)]
KVM: PPC: Book3S: PR: Handle EMUL_ASSIST

In addition to normal "priviledged instruction" traps, we can also receive
"emulation assist" traps on newer hardware that has the HV bit set.

Handle that one the same way as a privileged instruction, including the
instruction fetching. That way we don't execute old instructions that we
happen to still leave in that field when an emul assist trap comes.

This fixes -M mac99 / -M g3beige on p7 bare metal for me.

Signed-off-by: Alexander Graf <agraf@suse.de>
12 years ago[PARISC] fix panic on prefetch(NULL) on PA7300LC
James Bottomley [Wed, 16 May 2012 10:10:27 +0000 (11:10 +0100)]
[PARISC] fix panic on prefetch(NULL) on PA7300LC

Due to an errata, the PA7300LC generates a TLB miss interruption even on the
prefetch instruction.  This means that prefetch(NULL), which is supposed to be
a nop on linux actually generates a NULL deref fault.  Fix this by testing the
address of prefetch against NULL before doing the prefetch.

Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[PARISC] fix crash in flush_icache_page_asm on PA1.1
John David Anglin [Wed, 16 May 2012 09:14:52 +0000 (10:14 +0100)]
[PARISC] fix crash in flush_icache_page_asm on PA1.1

As pointed out by serveral people, PA1.1 only has a type 26 instruction
meaning that the space register must be explicitly encoded.  Not giving an
explicit space means that the compiler uses the type 24 version which is PA2.0
only resulting in an illegal instruction crash.

This regression was caused by

    commit f311847c2fcebd81912e2f0caf8a461dec28db41
    Author: James Bottomley <James.Bottomley@HansenPartnership.com>
    Date:   Wed Dec 22 10:22:11 2010 -0600

        parisc: flush pages through tmpalias space

Reported-by: Helge Deller <deller@gmx.de>
Signed-off-by: John David Anglin <dave.anglin@bell.net>
Cc: stable@vger.kernel.org #2.6.39+
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[PARISC] fix PA1.1 oops on boot
James Bottomley [Tue, 15 May 2012 10:04:19 +0000 (11:04 +0100)]
[PARISC] fix PA1.1 oops on boot

All PA1.1 systems have been oopsing on boot since

commit f311847c2fcebd81912e2f0caf8a461dec28db41
Author: James Bottomley <James.Bottomley@HansenPartnership.com>
Date:   Wed Dec 22 10:22:11 2010 -0600

    parisc: flush pages through tmpalias space

because a PA2.0 instruction was accidentally introduced into the PA1.1 TLB
insertion interruption path when it was consolidated with the do_alias macro.
Fix the do_alias macro only to use PA2.0 instructions if compiled for 64 bit.
Cc: stable@vger.kernel.org #2.6.39+
Signed-off-by: James Bottomley <JBottomley@Parallels.com>