8 years agodrm/i915: Check overlay stride errata for i830 and i845
Chris Wilson [Mon, 12 Jul 2010 18:35:38 +0000 (19:35 +0100)]
drm/i915: Check overlay stride errata for i830 and i845

commit a1efd14a99483a4fb9308902397ed86b69454c99 upstream.

Apparently i830 and i845 cannot handle any stride that is not a multiple
of 256, unlike their brethren which do support 64 byte aligned strides.

Signed-off-by: Chris Wilson <>
Signed-off-by: Eric Anholt <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agodrm/i915: Unset cursor if out-of-bounds upon mode change (v4)
Chris Wilson [Fri, 9 Jul 2010 07:45:04 +0000 (08:45 +0100)]
drm/i915: Unset cursor if out-of-bounds upon mode change (v4)

commit cda4b7d3a5b1dcbc0d8e7bad52134347798e9047 upstream.

The docs warn that to position the cursor such that no part of it is
visible on the pipe is an undefined operation. Avoid such circumstances
upon changing the mode, or at any other time, by unsetting the cursor if
it moves out of bounds.

"For normal high resolution display modes, the cursor must have at least a
single pixel positioned over the active screen.” (p143, p148 of the hardware
registers docs).


  Bug 24748 - [965G] Graphics crashes when resolution is changed with KMS

v2: Only update the cursor registers if they change.
v3: Fix the unsigned comparision of x,y against width,height.
v4: Always set CUR.BASE or else the cursor may become corrupt.

Signed-off-by: Chris Wilson <>
Reported-by: Christian Eggers <>
Cc: Christopher James Halse Rogers <>
Signed-off-by: Eric Anholt <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agodrm/radeon/kms: handle the case of no active displays properly in the bandwidth code
Alex Deucher [Mon, 2 Aug 2010 16:13:46 +0000 (12:13 -0400)]
drm/radeon/kms: handle the case of no active displays properly in the bandwidth code

commit e06b14ee91a2ddefc9a67443a6cd8ee0fa800115 upstream.

Logic was:
if (mode0 && mode1)
else if (mode0)

Should be:
if (mode0 && mode1)
else if (mode0)
else if (mode1)

Otherwise we may end up calculating the priority regs with
unitialized values.


Signed-off-by: Alex Deucher <>
Signed-off-by: Dave Airlie <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agodrm/radeon/kms/r7xx: add workaround for hw issue with HDP flush
Alex Deucher [Mon, 26 Jul 2010 22:51:53 +0000 (18:51 -0400)]
drm/radeon/kms/r7xx: add workaround for hw issue with HDP flush

commit 812d046915f48236657f02c06d7dc47140e9ceda upstream.

Use of HDP_*_COHERENCY_FLUSH_CNTL can cause a hang in certain
situations.  Add workaround.

Signed-off-by: Alex Deucher <>
Signed-off-by: Dave Airlie <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agodrm/radeon: fall back to GTT if bo creation/validation in VRAM fails.
Michel Dänzer [Thu, 8 Jul 2010 02:43:28 +0000 (12:43 +1000)]
drm/radeon: fall back to GTT if bo creation/validation in VRAM fails.

commit e376573f7267390f4e1bdc552564b6fb913bce76 upstream.

This fixes a problem where on low VRAM cards we'd run out of space for validation.

[airlied: Tested on my M7, Thinkpad T42, compiz works with no problems.]

Signed-off-by: Michel Dänzer <>
Signed-off-by: Dave Airlie <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agodrm/radeon: add new pci ids
Alex Deucher [Wed, 4 Aug 2010 15:40:00 +0000 (11:40 -0400)]
drm/radeon: add new pci ids

commit 1297c05a8dfb568c689f057d51a65eebe5ddc86f upstream.

New evergreen and r7xx ids.

Signed-off-by: Alex Deucher <>
Signed-off-by: Dave Airlie <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoxen: drop xen_sched_clock in favour of using plain wallclock time
Jeremy Fitzhardinge [Mon, 12 Jul 2010 18:49:59 +0000 (11:49 -0700)]
xen: drop xen_sched_clock in favour of using plain wallclock time

commit 8a22b9996b001c88f2bfb54c6de6a05fc39e177a upstream.

xen_sched_clock only counts unstolen time.  In principle this should
be useful to the Linux scheduler so that it knows how much time a process
actually consumed.  But in practice this doesn't work very well as the
scheduler expects the sched_clock time to be synchronized between
cpus.  It also uses sched_clock to measure the time a task spends
sleeping, in which case "unstolen time" isn't meaningful.

So just use plain xen_clocksource_read to return wallclock nanoseconds
for sched_clock.

Signed-off-by: Jeremy Fitzhardinge <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoSCSI: enclosure: fix error path - actually return ERR_PTR() on error
James Bottomley [Fri, 12 Mar 2010 22:14:42 +0000 (16:14 -0600)]
SCSI: enclosure: fix error path - actually return ERR_PTR() on error

commit a91c1be21704113b023919826c6d531da46656ef upstream.

we also need to clean up and free the cdev.

Reported-by: Jani Nikula <>
Signed-off-by: James Bottomley <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoCRED: Fix RCU warning due to previous patch fixing __task_cred()'s checks
David Howells [Wed, 4 Aug 2010 15:59:14 +0000 (16:59 +0100)]
CRED: Fix RCU warning due to previous patch fixing __task_cred()'s checks

commit 694f690d27dadccc8cb9d90532e76593b61fe098 upstream.

Commit 8f92054e7ca1 ("CRED: Fix __task_cred()'s lockdep check and banner
comment") fixed the lockdep checks on __task_cred().  This has shown up
a place in the signalling code where a lock should be held - namely that
check_kill_permission() requires its callers to hold the RCU lock.

Fix group_send_sig_info() to get the RCU read lock around its call to

Without this patch, the following warning can occur:

  [ INFO: suspicious rcu_dereference_check() usage. ]
  kernel/signal.c:660 invoked rcu_dereference_check() without protection!

Reported-by: Tetsuo Handa <>
Signed-off-by: David Howells <>
Acked-by: Oleg Nesterov <>
Signed-off-by: Linus Torvalds <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agomac80211: avoid scheduling while atomic in mesh_rx_plink_frame
John W. Linville [Mon, 21 Jun 2010 21:14:07 +0000 (17:14 -0400)]
mac80211: avoid scheduling while atomic in mesh_rx_plink_frame

commit c937019761a758f2749b1f3a032b7a91fb044753 upstream.

While mesh_rx_plink_frame holds sta->lock...

mesh_rx_plink_frame ->
mesh_plink_inc_estab_count ->

...but ieee80211_bss_info_change_notify is allowed to sleep.  A driver
taking advantage of that allowance can cause a scheduling while
atomic bug.  Similar paths exist for mesh_plink_dec_estab_count,
so work around those as well.

Also, correct a minor kerneldoc comment error (mismatched function names).

Signed-off-by: John W. Linville <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agocfg80211: don't get expired BSSes
Johannes Berg [Tue, 13 Jul 2010 08:55:38 +0000 (10:55 +0200)]
cfg80211: don't get expired BSSes

commit ccb6c1360f8dd43303c659db718e7e0b24175db5 upstream.

When kernel-internal users use cfg80211_get_bss()
to get a reference to a BSS struct, they may end
up getting one that would have been removed from
the list if there had been any userspace access
to the list. This leads to inconsistencies and

Fix it by making cfg80211_get_bss() ignore BSSes
that cfg80211_bss_expire() would remove.


Reported-by: Jiajia Zheng <>
Tested-by: Jiajia Zheng <>
Signed-off-by: Johannes Berg <>
Signed-off-by: John W. Linville <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agocfg80211: ignore spurious deauth
Johannes Berg [Mon, 12 Jul 2010 12:46:43 +0000 (14:46 +0200)]
cfg80211: ignore spurious deauth

commit 643f82e32f14faf0d0944c804203a6681b6b0a1e upstream.

Ever since mac80211/drivers are no longer
fully in charge of keeping track of the
auth status, trying to make them do so will
fail. Instead of warning and reporting the
deauthentication to userspace, cfg80211 must
simply ignore it so that spurious
deauthentications, e.g. before starting
authentication, aren't seen by userspace as
actual deauthentications.

Reported-by: Paul Stewart <>
Signed-off-by: Johannes Berg <>
Signed-off-by: John W. Linville <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agossb: Handle alternate SSPROM location
Larry Finger [Sat, 15 May 2010 03:08:58 +0000 (22:08 -0500)]
ssb: Handle alternate SSPROM location

commit 9d1ac34ec3a67713308ae0883c3359c557f14d17 upstream.

In kernel Bugzilla #15825 (2 users), in a wireless mailing list thread
(, and on a
netbook owned by John Linville
(, there are reports
of ssb failing to detect an SPROM at the normal location. After studying the
MMIO trace dump for the Broadcom wl driver, it was determined that the affected
boxes had a relocated SPROM.

This patch fixes all systems that have reported this problem.

Signed-off-by: Larry Finger <>
Signed-off-by: John W. Linville <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoiwlwifi: fix scan abort
Stanislaw Gruszka [Thu, 29 Jul 2010 09:37:41 +0000 (11:37 +0200)]
iwlwifi: fix scan abort

commit d28232b461b8d54b09e59325dbac8b0913ce2049 upstream.

Fix possible double priv->mutex lock introduced by commit
"iwlwifi: cancel scan watchdog in iwl_bg_abort_scan" .
We can not call cancel_delayed_work_sync(&priv->scan_check) with
priv->mutex locked because workqueue function iwl_bg_scan_check()
take that lock internally.

We do not need to synchronize when canceling priv->scan_check work.
We can avoid races (sending double abort command or send no
command at all) using STATUS_SCAN_ABORT bit. Moreover
current iwl_bg_scan_check() code seems to be broken, as
we should not send abort commands when currently aborting.

Signed-off-by: Stanislaw Gruszka <>
Signed-off-by: John W. Linville <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoath9k_hw: fix antenna diversity on AR9285
Felix Fietkau [Sun, 11 Jul 2010 10:48:39 +0000 (12:48 +0200)]
ath9k_hw: fix antenna diversity on AR9285

commit 601e0cb165e65dc185b31fe7ebd2c0169ea47306 upstream.

On AR9285, the antenna switch configuration register uses more than just
16 bits. Because of an arbitrary mask applied to the EEPROM value that
stores this configuration, diversity was broken in some cases, leading
to a significant degradation in signal strength.
Fix this by changing the callback to return a 32 bit value and remove
the arbitrary mask.

Signed-off-by: Felix Fietkau <>
Signed-off-by: John W. Linville <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoath9k: fix yet another buffer leak in the tx aggregation code
Felix Fietkau [Fri, 23 Jul 2010 01:53:16 +0000 (03:53 +0200)]
ath9k: fix yet another buffer leak in the tx aggregation code

commit 4cee78614cfa046a26c4fbf313d5bbacb3ad8efc upstream.

When an aggregation session is being cleaned up, while the tx status
for some frames is being processed, the TID is flushed and its buffers
are sent out.

Unfortunately that left the pending un-acked frames unprocessed, thus
leaking buffers. Fix this by reordering the code so that those frames
are processed first, before the TID is flushed.

Signed-off-by: Felix Fietkau <>
Signed-off-by: John W. Linville <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoath9k: fix TSF after reset on AR913x
Felix Fietkau [Wed, 30 Jun 2010 00:07:48 +0000 (02:07 +0200)]
ath9k: fix TSF after reset on AR913x

commit f860d526eb2939a1c37128900b5af2b6f3ff7f20 upstream.

When issuing a reset, the TSF value is lost in the hardware because of
the 913x specific cold reset. As with some AR9280 cards, the TSF needs
to be preserved in software here.

Additionally, there's an issue that frequently prevents a successful
TSF write directly after the chip reset. In this case, repeating the
TSF write after the initval-writes usually works.

This patch detects failed TSF writes and recovers from them, taking
into account the delay caused by the initval writes.

Signed-off-by: Felix Fietkau <>
Reported-by: Björn Smedman <>
Signed-off-by: John W. Linville <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoath9k: another fix for the A-MPDU buffer leak
Felix Fietkau [Mon, 12 Jul 2010 21:16:34 +0000 (23:16 +0200)]
ath9k: another fix for the A-MPDU buffer leak

commit 31e79a5954b78fbed15de2c8974d5a2b6019199a upstream.

The patch 'ath9k: fix a buffer leak in A-MPDU completion' addressed the
issue of running out of buffers/descriptors in the tx path if a STA is
deleted while tx status feedback is still pending.
The remaining issue is that the skbs of the buffers are not reclaimed,
leaving a memory leak.
This patch fixes this issue by running the buffers through
ath_tx_complete_buf(), ensuring that the pending frames counter is also

Signed-off-by: Felix Fietkau <>
Signed-off-by: John W. Linville <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoath9k: fix a buffer leak in A-MPDU completion
Felix Fietkau [Wed, 7 Jul 2010 17:42:09 +0000 (19:42 +0200)]
ath9k: fix a buffer leak in A-MPDU completion

commit 73e194639d90594d06d0c10019c0ab4638869135 upstream.

When ath_tx_complete_aggr() is called, it's responsible for returning
all buffers in the linked list. This was not done when the STA lookup
failed, leading to a race condition that could leak a few buffers when
a STA just disconnected.
Fix this by immediately returning all buffers to the free list in this case.

Signed-off-by: Felix Fietkau <>
Signed-off-by: John W. Linville <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoath9k: fix retry count for A-MPDU rate control status reports
Felix Fietkau [Thu, 24 Jun 2010 23:26:16 +0000 (01:26 +0200)]
ath9k: fix retry count for A-MPDU rate control status reports

commit 78c4653a2274479547e259e1f416d2b3d04c42a8 upstream.

The 'bf_retries' field of the ath_buf structure was used for both
software retries (AMPDU subframes) and hardware retries (legacy
frames). This led to a wrong retry count being reported for the A-MPDU
rate control stats.
This patch changes the code to no longer use bf_retries for reporting
retry counts, but instead always using the real on-chip retry count
from the ath_tx_status.
Additionally, if the first subframe of an A-MPDU was not acked, the tx
status report is submitted along with the first acked subframe, which
may not contain the correct rates in the tx info.
This is easily corrected by saving the tx rate info before looping over
subframes, and then copying it back once the A-MPDU status report is
In my tests this change improves throughput visibly.

Signed-off-by: Felix Fietkau <>
Reported-by: Björn Smedman <>
Signed-off-by: John W. Linville <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoath9k_hw: fix an off-by-one error in the PDADC boundaries calculation
Felix Fietkau [Sun, 11 Jul 2010 10:48:41 +0000 (12:48 +0200)]
ath9k_hw: fix an off-by-one error in the PDADC boundaries calculation

commit 03b4776c408d2f4bf3a5d204e223724d154716d1 upstream.

PDADC values were only generated for values surrounding the target
index, however not for the target index itself, leading to a minor
error in the generated curve.

Signed-off-by: Felix Fietkau <>
Signed-off-by: John W. Linville <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoath9k_hw: fix a sign error in the IQ calibration code
Felix Fietkau [Sun, 11 Jul 2010 10:48:40 +0000 (12:48 +0200)]
ath9k_hw: fix a sign error in the IQ calibration code

commit 23399016d9583d799ca98ce443a1410b13c3e96e upstream.

Signed-off-by: Felix Fietkau <>
Signed-off-by: John W. Linville <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoath9k_hw: prevent a fast channel change after a rx DMA stuck issue
Felix Fietkau [Sun, 11 Jul 2010 10:48:42 +0000 (12:48 +0200)]
ath9k_hw: prevent a fast channel change after a rx DMA stuck issue

commit 9cc2f3e881dcda5466c55ffe8dd0a9d1433469cb upstream.

If the receive path gets stuck, a full hardware reset is necessary to
recover from it. If this happens during a scan, the whole scan might fail,
as each channel change bypasses the full reset sequence.
Fix this by resetting the fast channel change flag if stopping the
receive path fails.

This will reduce the number of error messages that look like this:
ath: DMA failed to stop in 10 ms AR_CR=0x00000024 AR_DIAG_SW=0x40000020

Signed-off-by: Felix Fietkau <>
Signed-off-by: John W. Linville <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoath9k: fix a potential buffer leak in the STA teardown path
Felix Fietkau [Wed, 7 Jul 2010 17:42:08 +0000 (19:42 +0200)]
ath9k: fix a potential buffer leak in the STA teardown path

commit 2b40994cabd2f545d5c11d3a65dcee6f6f9155f8 upstream.

It looks like it might be possible for a TID to be paused, while still
holding some queued buffers, however ath_tx_node_cleanup currently only
iterates over active TIDs.
Fix this by always checking every allocated TID for the STA that is being
cleaned up.

Signed-off-by: Felix Fietkau <>
Signed-off-by: John W. Linville <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoath9k: enable serialize_regmode for non-PCIE AR9160
John W. Linville [Wed, 28 Jul 2010 14:06:35 +0000 (10:06 -0400)]
ath9k: enable serialize_regmode for non-PCIE AR9160

commit 4c85ab11ca56da1aa59b58c80cc6a356515cc645 upstream.

Signed-off-by: John W. Linville <>
Acked-by: Luis R. Rodriguez <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoigb: Use only a single Tx queue in SR-IOV mode
Greg Rose [Thu, 1 Jul 2010 13:38:16 +0000 (13:38 +0000)]
igb: Use only a single Tx queue in SR-IOV mode

commit 5fa8517f038d51d571981fb495206cc30ed91b06 upstream.

The 82576 expects the second rx queue in any pool to receive L2 switch
loop back packets sent from the second tx queue in another pool.  The
82576 VF driver does not enable the second rx queue so if the PF driver
sends packets destined to a VF from its second tx queue then the VF
driver will never see them.  In SR-IOV mode limit the number of tx queues
used by the PF driver to one. This patch fixes a bug reported in which
the PF cannot communciate with the VF and should be considered for 2.6.34

Signed-off-by: Greg Rose <>
Tested-by: Jeff Pieper <>
Signed-off-by: Jeff Kirsher <>
Signed-off-by: David S. Miller <>
Signed-off-by: Greg Kroah-Hartman <>
8 years ago9p: strlen() doesn't count the terminator
Dan Carpenter [Fri, 9 Jul 2010 23:51:54 +0000 (23:51 +0000)]
9p: strlen() doesn't count the terminator

commit 5c4bfa17f3ec46becec4b23d12323f7605ebd696 upstream.

This is an off by one bug because strlen() doesn't count the NULL
terminator.  We strcpy() addr into a fixed length array of size
UNIX_PATH_MAX later on.

The addr variable is the name of the device being mounted.

Signed-off-by: Dan Carpenter <>
Signed-off-by: David S. Miller <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoe1000e: 82577/82578 PHY register access issues
Bruce Allan [Tue, 27 Jul 2010 12:28:46 +0000 (12:28 +0000)]
e1000e: 82577/82578 PHY register access issues

commit ff847ac2d3e90edd94674c28bade25ae1e6a2e49 upstream.

The MAC-PHY interconnect on 82577/82578 uses a power management feature
(called K1) which must be disabled when in 1Gbps due to a hardware issue on
these parts.  The #define bit setting used to enable/disable K1 is
incorrect and can cause PHY register accesses to stop working altogether
until the next device reset.  This patch sets the register correctly.

This issue is present in kernels since 2.6.32.

Signed-off-by: Bruce Allan <>
Tested-by: Jeff Pieper <>
Signed-off-by: Jeff Kirsher <>
Signed-off-by: David S. Miller <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoe1000e: don't inadvertently re-set INTX_DISABLE
Dean Nelson [Tue, 29 Jun 2010 18:12:05 +0000 (18:12 +0000)]
e1000e: don't inadvertently re-set INTX_DISABLE

commit 36f2407fe52c55566221f8c68c8fb808abffd2f5 upstream.

Should e1000_test_msi() fail to see an msi interrupt, it attempts to
fallback to legacy INTx interrupts. But an error in the code may prevent
this from happening correctly.

Before calling e1000_test_msi_interrupt(), e1000_test_msi() disables SERR
by clearing the SERR bit from the just read PCI_COMMAND bits as it writes
them back out.

Upon return from calling e1000_test_msi_interrupt(), it re-enables SERR
by writing out the version of PCI_COMMAND it had previously read.

The problem with this is that e1000_test_msi_interrupt() calls
pci_disable_msi(), which eventually ends up in pci_intx(). And because
pci_intx() was called with enable set to 1, the INTX_DISABLE bit gets
cleared from PCI_COMMAND, which is what we want. But when we get back to
e1000_test_msi(), the INTX_DISABLE bit gets inadvertently re-set because
of the attempt by e1000_test_msi() to re-enable SERR.

The solution is to have e1000_test_msi() re-read the PCI_COMMAND bits as
part of its attempt to re-enable SERR.

During debugging/testing of this issue I found that not all the systems
I ran on had the SERR bit set to begin with. And on some of the systems
the same could be said for the INTX_DISABLE bit. Needless to say these
latter systems didn't have a problem falling back to legacy INTx
interrupts with the code as is.

Signed-off-by: Dean Nelson <>
Tested-by: Emil Tantilov <>
Signed-off-by: Jeff Kirsher <>
Signed-off-by: David S. Miller <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoxen: netfront: explicitly generate arp_notify event after migration.
Ian Campbell [Wed, 26 May 2010 00:09:43 +0000 (00:09 +0000)]
xen: netfront: explicitly generate arp_notify event after migration.

commit 592970675c9522bde588b945388c7995c8b51328 upstream.

Use newly introduced netif_notify_peers() method to ensure a gratuitous ARP is
generated after a migration.

Signed-off-by: Ian Campbell <>
Cc: Stephen Hemminger <>
Cc: Jeremy Fitzhardinge <>
Cc: David S. Miller <>
Signed-off-by: David S. Miller <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoarp_notify: allow drivers to explicitly request a notification event.
Ian Campbell [Wed, 26 May 2010 00:09:42 +0000 (00:09 +0000)]
arp_notify: allow drivers to explicitly request a notification event.

commit 06c4648d46d1b757d6b9591a86810be79818b60c upstream.

Currently such notifications are only generated when the device comes up or the
address changes. However one use case for these notifications is to enable
faster network recovery after a virtual machine migration (by causing switches
to relearn their MAC tables). A migration appears to the network stack as a
temporary loss of carrier and therefore does not trigger either of the current
conditions. Rather than adding carrier up as a trigger (which can cause issues
when interfaces a flapping) simply add an interface which the driver can use
to explicitly trigger the notification.

Signed-off-by: Ian Campbell <>
Cc: Stephen Hemminger <>
Cc: Jeremy Fitzhardinge <>
Cc: David S. Miller <>
Signed-off-by: David S. Miller <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoamd64_edac: Fix operator precendence error
Borislav Petkov [Tue, 3 Aug 2010 14:51:28 +0000 (16:51 +0200)]
amd64_edac: Fix operator precendence error

commit 962b70a1eb22c467b95756a290c694e73da17f41 upstream.

The bitwise AND is of higher precedence, make that explicit.

Signed-off-by: Borislav Petkov <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoamd64_edac: Correct scrub rate setting
Borislav Petkov [Fri, 21 May 2010 19:25:03 +0000 (21:25 +0200)]
amd64_edac: Correct scrub rate setting

commit bc57117856cf1e581135810b37d3b75f9d1749f5 upstream.

Exit early when setting scrub rate on unknown/unsupported families.

Signed-off-by: Borislav Petkov <>
Acked-by: Doug Thompson <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoamd64_edac: Fix DCT base address selector
Borislav Petkov [Mon, 8 Mar 2010 17:29:35 +0000 (18:29 +0100)]
amd64_edac: Fix DCT base address selector

commit 9975a5f22a4fcc8d08035c65439900a983f891ad upstream.

The correct check is to verify whether in high range we're below 4GB
and not to extract the DctSelBaseAddr again. See "2.8.5 Routing DRAM
Requests" in the F10h BKDG.

Signed-off-by: Borislav Petkov <>
Acked-by: Doug Thompson <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoparisc: pass through '\t' to early (iodc) console
Kyle McMartin [Wed, 4 Aug 2010 00:38:08 +0000 (20:38 -0400)]
parisc: pass through '\t' to early (iodc) console

commit d9b68e5e88248bb24fd4e455588bea1d56108fd6 upstream.

The firmware handles '\t' internally, so stop trying to emulate it
(which, incidentally, had a bug in it.)

Fixes a really weird hang at bootup in rcu_bootup_announce, which,
as far as I can tell, is the first printk in the core kernel to use
a tab as the first character.

Signed-off-by: Kyle McMartin <>
Signed-off-by: Linus Torvalds <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoblock_dev: always serialize exclusive open attempts
Tejun Heo [Wed, 4 Aug 2010 15:59:39 +0000 (17:59 +0200)]
block_dev: always serialize exclusive open attempts

commit e75aa85892b2ee78c79edac720868cbef16e62eb upstream.

bd_prepare_to_claim() incorrectly allowed multiple attempts for
exclusive open to progress in parallel if the attempting holders are
identical.  This triggered BUG_ON() as reported in the following bug.

__bd_abort_claiming() is used to finish claiming blocks and doesn't
work if multiple openers are inside a claiming block.  Allowing
multiple parallel open attempts to continue doesn't gain anything as
those are serialized down in the call chain anyway.  Fix it by always
allowing only single open attempt in a claiming block.

This problem can easily be reproduced by adding a delay after
bd_prepare_to_claim() and attempting to mount two partitions of a

Signed-off-by: Tejun Heo <>
Reported-by: Markus Trippelsdorf <>
Signed-off-by: Linus Torvalds <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoarm/imx/gpio: add spinlock protection
Baruch Siach [Tue, 6 Jul 2010 11:03:22 +0000 (14:03 +0300)]
arm/imx/gpio: add spinlock protection

commit 14cb0deb66fcfca8fdbef75da8c84b5405a8c767 upstream.

The GPIO registers need protection from concurrent access for operations that
are not atomic.

Cc: Juergen Beisert <>
Cc: Daniel Mack <>
Signed-off-by: Baruch Siach <>
Signed-off-by: Sascha Hauer <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoPARISC: led.c - fix potential stack overflow in led_proc_write()
Helge Deller [Mon, 2 Aug 2010 20:46:41 +0000 (22:46 +0200)]
PARISC: led.c - fix potential stack overflow in led_proc_write()

commit 4b4fd27c0b5ec638a1f06ced9226fd95229dbbf0 upstream.

avoid potential stack overflow by correctly checking count parameter

Reported-by: Ilja <>
Signed-off-by: Helge Deller <>
Acked-by: Kyle McMartin <>
Cc: James E.J. Bottomley <>
Signed-off-by: Linus Torvalds <>
Signed-off-by: Greg Kroah-Hartman <>
8 years agoLinux 2.6.35
Linus Torvalds [Sun, 1 Aug 2010 22:11:14 +0000 (15:11 -0700)]
Linux 2.6.35

8 years agoNFS: Fix a typo in include/linux/nfs_fs.h
Trond Myklebust [Sun, 1 Aug 2010 17:40:40 +0000 (13:40 -0400)]
NFS: Fix a typo in include/linux/nfs_fs.h

nfs_commit_inode() needs to be defined irrespectively of whether or not
we are supporting NFSv3 and NFSv4.

Allow the compiler to optimise away code in the NFSv2-only case by
converting it into an inlined stub function.

Reported-and-tested-by: Ingo Molnar <>
Signed-off-by: Trond Myklebust <>
Signed-off-by: Linus Torvalds <>
8 years agoMerge
Linus Torvalds [Sat, 31 Jul 2010 02:02:51 +0000 (19:02 -0700)]

  cyber2000fb: fix console in truecolor modes
  cyber2000fb: fix machine hang on module load
  SA1111: Eliminate use after free
  ARM: Fix Versatile/Realview/VExpress MMC card detection sense
  ARM: 6279/1: highmem: fix SMP preemption bug in kmap_high_l1_vipt
  ARM: Add barriers to io{read,write}{8,16,32} accessors as well
  ARM: 6273/1: Add barriers to the I/O accessors if ARM_DMA_MEM_BUFFERABLE
  ARM: 6272/1: Convert L2x0 to use the IO relaxed operations
  ARM: 6271/1: Introduce *_relaxed() I/O accessors
  ARM: 6275/1: ux500: don't use writeb() in uncompress.h
  ARM: 6270/1: clean files in arch/arm/boot/compressed/
  ARM: Fix csum_partial_copy_from_user()

8 years agoMerge branch 'bugfixes' of git://
Linus Torvalds [Sat, 31 Jul 2010 02:02:21 +0000 (19:02 -0700)]
Merge branch 'bugfixes' of git://

* 'bugfixes' of git://
  NFS: Ensure that writepage respects the nonblock flag
  NFS: kswapd must not block in nfs_release_page
  nfs: include space for the NUL in root path

8 years agoMerge branch 'drm-fixes' of git://
Linus Torvalds [Sat, 31 Jul 2010 02:01:11 +0000 (19:01 -0700)]
Merge branch 'drm-fixes' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://
  drm/edid: Fix the HDTV hack sync adjustment
  drm/radeon/kms: fix radeon mid power profile reporting

8 years agomm: fix ia64 crash when gcore reads gate area
Hugh Dickins [Fri, 30 Jul 2010 17:58:26 +0000 (10:58 -0700)]
mm: fix ia64 crash when gcore reads gate area

Debian's ia64 autobuilders have been seeing kernel freeze or reboot
when running the gdb testsuite (Debian bug 588574): dannf bisected to
2.6.32 62eede62dafb4a6633eae7ffbeb34c60dba5e7b1 "mm: ZERO_PAGE without
PTE_SPECIAL"; and reproduced it with gdb's gcore on a simple target.

I'd missed updating the gate_vma handling in __get_user_pages(): that
happens to use vm_normal_page() (nowadays failing on the zero page),
yet reported success even when it failed to get a page - boom when
access_process_vm() tried to copy that to its intermediate buffer.

Fix this, resisting cleanups: in particular, leave it for now reporting
success when not asked to get any pages - very probably safe to change,
but let's not risk it without testing exposure.

Why did ia64 crash with 16kB pages, but succeed with 64kB pages?
Because setup_gate() pads each 64kB of its gate area with zero pages.

Reported-by: Andreas Barth <>
Bisected-by: dann frazier <>
Signed-off-by: Hugh Dickins <>
Tested-by: dann frazier <>
Signed-off-by: Linus Torvalds <>
8 years agoCIFS: Remove __exit mark from cifs_exit_dns_resolver()
David Howells [Fri, 30 Jul 2010 14:25:19 +0000 (15:25 +0100)]
CIFS: Remove __exit mark from cifs_exit_dns_resolver()

Remove the __exit mark from cifs_exit_dns_resolver() as it's called by the
module init routine in case of error, and so may have been discarded during

Signed-off-by: David Howells <>
Acked-by: Jeff Layton <>
Signed-off-by: Linus Torvalds <>
8 years agocyber2000fb: fix console in truecolor modes
Ondrej Zary [Thu, 29 Jul 2010 20:40:54 +0000 (22:40 +0200)]
cyber2000fb: fix console in truecolor modes

Return value was not set to 0 in setcolreg() with truecolor modes. This causes
fb_set_cmap() to abort after first color, resulting in blank palette - and
blank console in 24bpp and 32bpp modes.

Signed-off-by: Ondrej Zary <>
Signed-off-by: Russell King <>
8 years agocyber2000fb: fix machine hang on module load
Ondrej Zary [Thu, 29 Jul 2010 20:32:20 +0000 (22:32 +0200)]
cyber2000fb: fix machine hang on module load

I was testing two CyberPro 2000 based PCI cards on x86 and the machine always
hanged completely when the cyber2000fb module was loaded. It seems that the
card hangs when some registers are accessed too quickly after writing RAMDAC
control register. With this patch, both card work.

Add delay after RAMDAC control register write to prevent hangs on module load.

Signed-off-by: Ondrej Zary <>
Signed-off-by: Russell King <>
8 years agoSA1111: Eliminate use after free
Julia Lawall [Fri, 30 Jul 2010 15:17:28 +0000 (17:17 +0200)]
SA1111: Eliminate use after free

__sa1111_remove always frees its argument, so the subsequent reference to
sachip->saved_state represents a use after free.  __sa1111_remove does not
appear to use the saved_state field, so the patch simply frees it first.

A simplified version of the semantic patch that finds this problem is as
follows: (

// <smpl>
expression E,E2;

  E = E2
* E
// </smpl>

Signed-off-by: Julia Lawall <>
Signed-off-by: Russell King <>
8 years agoARM: Fix Versatile/Realview/VExpress MMC card detection sense
Russell King [Thu, 29 Jul 2010 14:58:59 +0000 (15:58 +0100)]
ARM: Fix Versatile/Realview/VExpress MMC card detection sense

The MMC card detection sense has become really confused with negations
at various levels, leading to some platforms not detecting inserted
cards.  Fix this by converting everything to positive logic throughout,
thereby getting rid of these negations.

Signed-off-by: Russell King <>
8 years agoARM: 6279/1: highmem: fix SMP preemption bug in kmap_high_l1_vipt
Gary King [Thu, 29 Jul 2010 16:37:20 +0000 (17:37 +0100)]
ARM: 6279/1: highmem: fix SMP preemption bug in kmap_high_l1_vipt

smp_processor_id() must not be called from a preemptible context (this
is checked by CONFIG_DEBUG_PREEMPT).  kmap_high_l1_vipt() was doing so.
This lead to a problem where the wrong per_cpu kmap_high_l1_vipt_depth
could be incremented, causing a BUG_ON(*depth <= 0); in

The solution is to move the call to smp_processor_id() after the call
to preempt_disable().

Originally by: Andrew Howe <>

Signed-off-by: Gary King <>
Acked-by: Nicolas Pitre <>
Signed-off-by: Russell King <>
8 years agoNFS: Ensure that writepage respects the nonblock flag
Trond Myklebust [Fri, 30 Jul 2010 19:31:57 +0000 (15:31 -0400)]
NFS: Ensure that writepage respects the nonblock flag

Signed-off-by: Trond Myklebust <>
8 years agoNFS: kswapd must not block in nfs_release_page
Trond Myklebust [Fri, 30 Jul 2010 19:31:54 +0000 (15:31 -0400)]
NFS: kswapd must not block in nfs_release_page


If other processes are blocked waiting for kswapd to free up some memory so
that they can make progress, then we cannot allow kswapd to block on those

Signed-off-by: Trond Myklebust <>
8 years agonfs: include space for the NUL in root path
Dan Carpenter [Tue, 13 Jul 2010 11:34:59 +0000 (13:34 +0200)]
nfs: include space for the NUL in root path

In root_nfs_name() it does the following:

        if (strlen(buf) + strlen(cp) > NFS_MAXPATHLEN) {
                printk(KERN_ERR "Root-NFS: Pathname for remote directory too long.\n");
                return -1;
        sprintf(nfs_export_path, buf, cp);

In the original code if (strlen(buf) + strlen(cp) == NFS_MAXPATHLEN)
then the sprintf() would lead to an overflow.  Generally the rest of the
code assumes that the path can have NFS_MAXPATHLEN (1024) characters and
a NUL terminator so the fix is to add space to the nfs_export_path[]

Signed-off-by: Dan Carpenter <>
Signed-off-by: Trond Myklebust <>
8 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Thu, 29 Jul 2010 22:23:28 +0000 (15:23 -0700)]
Merge branch 'for-linus' of git://

* 'for-linus' of git://
  [S390] etr: fix clock synchronization race
  [S390] Fix IRQ tracing in case of PER

8 years agoMerge git://
Linus Torvalds [Thu, 29 Jul 2010 22:21:44 +0000 (15:21 -0700)]
Merge git://git./linux/kernel/git/wim/linux-2.6-watchdog

* git://
  watchdog: update MAINTAINERS entry

8 years agoMerge branch 'fix/hda' of git://
Linus Torvalds [Thu, 29 Jul 2010 22:21:07 +0000 (15:21 -0700)]
Merge branch 'fix/hda' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'fix/hda' of git://
  ALSA: hda - Add a PC-beep workaround for ASUS P5-V
  ALSA: hda - Assume PC-beep as default for Realtek
  ALSA: hda - Don't register beep input device when no beep is available
  ALSA: hda - Fix pin-detection of Nvidia HDMI

8 years agoCRED: Fix __task_cred()'s lockdep check and banner comment
David Howells [Thu, 29 Jul 2010 11:45:55 +0000 (12:45 +0100)]
CRED: Fix __task_cred()'s lockdep check and banner comment

Fix __task_cred()'s lockdep check by removing the following validation


as commit_creds() does not take the tasklist_lock, and nor do most of the
functions that call it, so this check is pointless and it can prevent
detection of the RCU lock not being held if the tasklist_lock is held.

Instead, add the following validation condition:

task->exit_state >= 0

to permit the access if the target task is dead and therefore unable to change
its own credentials.

Fix __task_cred()'s comment to:

 (1) discard the bit that says that the caller must prevent the target task
     from being deleted.  That shouldn't need saying.

 (2) Add a comment indicating the result of __task_cred() should not be passed
     directly to get_cred(), but rather than get_task_cred() should be used

Also put a note into the documentation to enforce this point there too.

Signed-off-by: David Howells <>
Acked-by: Jiri Olsa <>
Cc: Paul E. McKenney <>
Signed-off-by: Linus Torvalds <>
8 years agoCRED: Fix get_task_cred() and task_state() to not resurrect dead credentials
David Howells [Thu, 29 Jul 2010 11:45:49 +0000 (12:45 +0100)]
CRED: Fix get_task_cred() and task_state() to not resurrect dead credentials

It's possible for get_task_cred() as it currently stands to 'corrupt' a set of
credentials by incrementing their usage count after their replacement by the
task being accessed.

What happens is that get_task_cred() can race with commit_creds():

__cred = __task_cred(TASK_2)
old_cred = TASK_2->real_cred
TASK_2->real_cred = ...
[__cred->usage == 0]
[__cred->usage == 1]
[__cred->usage == 1]

However, since a tasks credentials are generally not changed very often, we can
reasonably make use of a loop involving reading the creds pointer and using
atomic_inc_not_zero() to attempt to increment it if it hasn't already hit zero.

If successful, we can safely return the credentials in the knowledge that, even
if the task we're accessing has released them, they haven't gone to the RCU
cleanup code.

We then change task_state() in procfs to use get_task_cred() rather than
calling get_cred() on the result of __task_cred(), as that suffers from the
same problem.

Without this change, a BUG_ON in __put_cred() or in put_cred_rcu() can be
tripped when it is noticed that the usage count is not zero as it ought to be,
for example:

kernel BUG at kernel/cred.c:168!
invalid opcode: 0000 [#1] SMP
last sysfs file: /sys/kernel/mm/ksm/run
Pid: 2436, comm: master Not tainted #1 0HR330/OptiPlex
RIP: 0010:[<ffffffff81069881>]  [<ffffffff81069881>] __put_cred+0xc/0x45
RSP: 0018:ffff88019e7e9eb8  EFLAGS: 00010202
RAX: 0000000000000001 RBX: ffff880161514480 RCX: 00000000ffffffff
RDX: 00000000ffffffff RSI: ffff880140c690c0 RDI: ffff880140c690c0
RBP: ffff88019e7e9eb8 R08: 00000000000000d0 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000040 R12: ffff880140c690c0
R13: ffff88019e77aea0 R14: 00007fff336b0a5c R15: 0000000000000001
FS:  00007f12f50d97c0(0000) GS:ffff880007400000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f8f461bc000 CR3: 00000001b26ce000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process master (pid: 2436, threadinfo ffff88019e7e8000, task ffff88019e77aea0)
 ffff88019e7e9ec8 ffffffff810698cd ffff88019e7e9ef8 ffffffff81069b45
<0> ffff880161514180 ffff880161514480 ffff880161514180 0000000000000000
<0> ffff88019e7e9f28 ffffffff8106aace 0000000000000001 0000000000000246
Call Trace:
 [<ffffffff810698cd>] put_cred+0x13/0x15
 [<ffffffff81069b45>] commit_creds+0x16b/0x175
 [<ffffffff8106aace>] set_current_groups+0x47/0x4e
 [<ffffffff8106ac89>] sys_setgroups+0xf6/0x105
 [<ffffffff81009b02>] system_call_fastpath+0x16/0x1b
Code: 48 8d 71 ff e8 7e 4e 15 00 85 c0 78 0b 8b 75 ec 48 89 df e8 ef 4a 15 00
48 83 c4 18 5b c9 c3 55 8b 07 8b 07 48 89 e5 85 c0 74 04 <0f> 0b eb fe 65 48 8b
04 25 00 cc 00 00 48 3b b8 58 04 00 00 75
RIP  [<ffffffff81069881>] __put_cred+0xc/0x45
 RSP <ffff88019e7e9eb8>
---[ end trace df391256a100ebdd ]---

Signed-off-by: David Howells <>
Acked-by: Jiri Olsa <>
Signed-off-by: Linus Torvalds <>
8 years agowatchdog: update MAINTAINERS entry
Wim Van Sebroeck [Thu, 29 Jul 2010 18:02:51 +0000 (18:02 +0000)]
watchdog: update MAINTAINERS entry

Add Mailing-list and website to watchdog MAINTAINERS entry.

Signed-off-by: Wim Van Sebroeck <>
8 years agoALSA: hda - Add a PC-beep workaround for ASUS P5-V
Takashi Iwai [Thu, 29 Jul 2010 13:30:02 +0000 (15:30 +0200)]
ALSA: hda - Add a PC-beep workaround for ASUS P5-V

ASUS P5-V provides a SSID that unexpectedly matches with the value
compilant with Realtek's specification.  Thus the driver interprets
it badly, resulting in non-working PC beep.

This patch adds a white-list for such a case; a white-list of known
devices with working PC beep.

Signed-off-by: Takashi Iwai <>
8 years agoARM: Add barriers to io{read,write}{8,16,32} accessors as well
Russell King [Thu, 29 Jul 2010 10:38:05 +0000 (11:38 +0100)]
ARM: Add barriers to io{read,write}{8,16,32} accessors as well

The ioread/iowrite accessors also need barriers as they're used in
place of readl/writel in portable drivers.  Create __iormb()
and __iowmb() which are conditionally defined to be barriers dependent
on ARM_DMA_MEM_BUFFERABLE, and always use these macros in the accessors.

Signed-off-by: Russell King <>
8 years agoARM: 6273/1: Add barriers to the I/O accessors if ARM_DMA_MEM_BUFFERABLE
Catalin Marinas [Wed, 28 Jul 2010 21:01:55 +0000 (22:01 +0100)]
ARM: 6273/1: Add barriers to the I/O accessors if ARM_DMA_MEM_BUFFERABLE

When the coherent DMA buffers are mapped as Normal Non-cacheable
(ARM_DMA_MEM_BUFFERABLE enabled), buffer accesses are no longer ordered
with Device memory accesses causing failures in device drivers that do
not use the mandatory memory barriers before starting a DMA transfer.
LKML discussions led to the conclusion that such barriers have to be
added to the I/O accessors:

This patch introduces a wmb() barrier to the write*() I/O accessors to
handle the situations where Normal Non-cacheable writes are still in the
processor (or L2 cache controller) write buffer before a DMA transfer
command is issued. For the read*() accessors, a rmb() is introduced
after the I/O to avoid speculative loads where the driver polls for a
DMA transfer ready bit.

Signed-off-by: Catalin Marinas <>
Signed-off-by: Russell King <>
8 years agoARM: 6272/1: Convert L2x0 to use the IO relaxed operations
Catalin Marinas [Wed, 28 Jul 2010 21:01:25 +0000 (22:01 +0100)]
ARM: 6272/1: Convert L2x0 to use the IO relaxed operations

This patch is in preparation for a subsequent patch which adds barriers
to the I/O accessors. Since the mandatory barriers may do an L2 cache
sync, this patch avoids a recursive call into l2x0_cache_sync() via the
write*() accessors and wmb() and a call into l2x0_cache_sync() with the
l2x0_lock held.

Signed-off-by: Catalin Marinas <>
Signed-off-by: Russell King <>
8 years agoARM: 6271/1: Introduce *_relaxed() I/O accessors
Catalin Marinas [Wed, 28 Jul 2010 21:00:54 +0000 (22:00 +0100)]
ARM: 6271/1: Introduce *_relaxed() I/O accessors

This patch introduces readl*_relaxed()/write*_relaxed() as the main I/O
accessors (when __mem_pci is defined). The standard read*()/write*()
macros are now based on the relaxed accessors.

This patch is in preparation for a subsequent patch which adds barriers
to the I/O accessors.

Signed-off-by: Catalin Marinas <>
Signed-off-by: Russell King <>
8 years agoARM: 6275/1: ux500: don't use writeb() in uncompress.h
Rabin Vincent [Thu, 29 Jul 2010 11:13:18 +0000 (12:13 +0100)]
ARM: 6275/1: ux500: don't use writeb() in uncompress.h

Don't use writeb() in uncompress.h, to avoid the following build errors
when the "Add barriers to the I/O accessors" series is applied.  Use
__raw_writeb() instead.

arch/arm/boot/compressed/misc.o: In function `putc':
undefined reference to `outer_cache'

Acked-by: Linus Walleij <>
Signed-off-by: Rabin Vincent <>
Signed-off-by: Russell King <>
8 years agoARM: 6270/1: clean files in arch/arm/boot/compressed/
Magnus Damm [Wed, 28 Jul 2010 04:46:21 +0000 (05:46 +0100)]
ARM: 6270/1: clean files in arch/arm/boot/compressed/

Update the compressed boot Makefile for ARM to
remove files during clean.

Signed-off-by: Magnus Damm <>
Signed-off-by: Russell King <>
8 years agodrm/edid: Fix the HDTV hack sync adjustment
Adam Jackson [Tue, 27 Jul 2010 21:40:32 +0000 (07:40 +1000)]
drm/edid: Fix the HDTV hack sync adjustment

We're adjusting horizontal timings only here, moving vsync was just a
slavish translation of a typo in the X server.

Signed-off-by: Adam Jackson <>
Signed-off-by: Dave Airlie <>
8 years agodrm/radeon/kms: fix radeon mid power profile reporting
Daniel J Blueman [Wed, 28 Jul 2010 11:25:58 +0000 (12:25 +0100)]
drm/radeon/kms: fix radeon mid power profile reporting

Fix incorrectly reporting 'default' power profile, when it is set to 'mid'.

Signed-off-by: Daniel J Blueman <>
Reviewed-by: Alex Deucher <>
Signed-off-by: Dave Airlie <>
8 years agoMerge branch 'for_linus' of git://
Linus Torvalds [Thu, 29 Jul 2010 03:01:26 +0000 (20:01 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/jwessel/linux-2.6-kgdb

* 'for_linus' of git://
  x86,kgdb: Fix hw breakpoint regression

8 years agoMerge git://
Linus Torvalds [Thu, 29 Jul 2010 03:00:42 +0000 (20:00 -0700)]
Merge git://git./linux/kernel/git/jejb/scsi-rc-fixes-2.6

* git://
  [SCSI] ibmvscsi: Fix oops when an interrupt is pending during probe
  [SCSI] zfcp: Update status read mempool
  [SCSI] zfcp: Do not wait for SBALs on stopped queue
  [SCSI] zfcp: Fix check whether unchained ct_els is possible
  [SCSI] ipr: fix resource path display and formatting

8 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Thu, 29 Jul 2010 02:59:55 +0000 (19:59 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/lrg/voltage-2.6

* 'for-linus' of git://
  davinci: da850/omap-l138 evm: account for DEFDCDC{2,3} being tied high
  regulator: tps6507x: allow driver to use DEFDCDC{2,3}_HIGH register
  wm8350-regulator: fix wm8350_register_regulator error handling
  ab3100: fix off-by-one value range checking for voltage selector

8 years agoecryptfs: Bugfix for error related to ecryptfs_hash_buckets
Andre Osterhues [Tue, 13 Jul 2010 20:59:17 +0000 (15:59 -0500)]
ecryptfs: Bugfix for error related to ecryptfs_hash_buckets

The function ecryptfs_uid_hash wrongly assumes that the
second parameter to hash_long() is the number of hash
buckets instead of the number of hash bits.
This patch fixes that and renames the variable
ecryptfs_hash_buckets to ecryptfs_hash_bits to make it

Fixes: CVE-2010-2492

Signed-off-by: Andre Osterhues <>
Signed-off-by: Tyler Hicks <>
Signed-off-by: Linus Torvalds <>
8 years agox86,kgdb: Fix hw breakpoint regression
Jason Wessel [Thu, 29 Jul 2010 00:10:30 +0000 (19:10 -0500)]
x86,kgdb: Fix hw breakpoint regression

HW breakpoints events stopped working correctly with kgdb
as a result of commit: 018cbffe6819f6f8db20a0a3acd9bab9bfd667e4
(Merge commit 'v2.6.33' into perf/core).

The regression occurred because the behavior changed for setting
NOTIFY_STOP as the return value to the die notifier if the breakpoint
was known to the HW breakpoint API.  Because kgdb is using the HW
breakpoint API to register HW breakpoints slots, it must also now
implement the overflow_handler call back else kgdb does not get to see
the events from the die notifier.

The kgdb_ll_trap function will be changed to be general purpose code
which can allow an easy way to implement the hw_breakpoint API
overflow call back.

Signed-off-by: Jason Wessel <>
Acked-by: Dongdong Deng <>
Acked-by: Frederic Weisbecker <>
8 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Wed, 28 Jul 2010 18:10:53 +0000 (11:10 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/sage/ceph-client

* 'for-linus' of git://
  ceph: use complete_all and wake_up_all
  ceph: Correct obvious typo of Kconfig variable "CRYPTO_AES"
  ceph: fix dentry lease release
  ceph: fix leak of dentry in ceph_init_dentry() error path
  ceph: fix pg_mapping leak on pg_temp updates
  ceph: fix d_release dop for snapdir, snapped dentries
  ceph: avoid dcache readdir for snapdir

8 years agoGFS2: Use kmalloc when possible for ->readdir()
Steven Whitehouse [Wed, 28 Jul 2010 16:56:23 +0000 (17:56 +0100)]
GFS2: Use kmalloc when possible for ->readdir()

If we don't need a huge amount of memory in ->readdir() then
we can use kmalloc rather than vmalloc to allocate it. This
should cut down on the greater overheads associated with
vmalloc for smaller directories.

We may be able to eliminate vmalloc entirely at some stage,
but this is easy to do right away.

Also using GFP_NOFS to avoid any issues wrt to deleting inodes
while under a glock, and suggestion from Linus to factor out
the alloc/dealloc.

I've given this a test with a variety of different sized
directories and it seems to work ok.

Cc: Andrew Morton <>
Cc: Nick Piggin <>
Cc: Prarit Bhargava <>
Signed-off-by: Steven Whitehouse <>
Signed-off-by: Linus Torvalds <>
8 years agoALSA: hda - Assume PC-beep as default for Realtek
Takashi Iwai [Wed, 28 Jul 2010 15:43:36 +0000 (17:43 +0200)]
ALSA: hda - Assume PC-beep as default for Realtek

Enable PC-beep as default for hardwares that aren't compliant with the
SSID value Realtek requires.  In such a case, better to enable the beep
to avoid a regression.

Signed-off-by: Takashi Iwai <>
8 years agoALSA: hda - Don't register beep input device when no beep is available
Takashi Iwai [Wed, 28 Jul 2010 15:37:16 +0000 (17:37 +0200)]
ALSA: hda - Don't register beep input device when no beep is available

We check now the availability of PC beep and skip the build of beep
mixers, but the driver still registers the input device.  This should
be checked as well.

Signed-off-by: Takashi Iwai <>
8 years agodavinci: da850/omap-l138 evm: account for DEFDCDC{2,3} being tied high
Sekhar Nori [Mon, 12 Jul 2010 12:26:21 +0000 (17:56 +0530)]
davinci: da850/omap-l138 evm: account for DEFDCDC{2,3} being tied high

Per the da850/omap-l138 Beta EVM SOM schematic, the DEFDCDC2 and
DEFDCDC3 lines are tied high. This leads to a 3.3V IO and 1.2V CVDD

Pass the right platform data to the TPS6507x driver so it can operate
on the DEFDCDC{2,3}_HIGH register to read and change voltage levels.

Signed-off-by: Sekhar Nori <>
Acked-by: Mark Brown <>
Signed-off-by: Liam Girdwood <>
8 years agoregulator: tps6507x: allow driver to use DEFDCDC{2,3}_HIGH register
Anuj Aggarwal [Mon, 12 Jul 2010 12:24:06 +0000 (17:54 +0530)]
regulator: tps6507x: allow driver to use DEFDCDC{2,3}_HIGH register

Acked-by: Mark Brown <>
In TPS6507x, depending on the status of DEFDCDC{2,3} pin either
DEFDCDC{2,3}_LOW or DEFDCDC{2,3}_HIGH register needs to be read or
programmed to change the output voltage.

The current driver assumes DEFDCDC{2,3} pins are always tied low
and thus operates only on DEFDCDC{2,3}_LOW register. This need
not always be the case (as is found on OMAP-L138 EVM).

Unfortunately, software cannot read the status of DEFDCDC{2,3} pins.
So, this information is passed through platform data depending on
how the board is wired.

Signed-off-by: Anuj Aggarwal <>
Signed-off-by: Sekhar Nori <>
Signed-off-by: Liam Girdwood <>
8 years agoALSA: hda - Fix pin-detection of Nvidia HDMI
Takashi Iwai [Wed, 28 Jul 2010 12:21:55 +0000 (14:21 +0200)]
ALSA: hda - Fix pin-detection of Nvidia HDMI

The behavior of Nvidia HDMI codec regarding the pin-detection unsol events
is based on the old HD-audio spec, i.e. PD bit indicates only the update
and doesn't show the current state.  Since the current code assumes the
new behavior, the pin-detection doesn't work relialby with these h/w.

This patch adds a flag for indicating the old spec, and fixes the issue
by checking the pin-detection explicitly for such hardware.

Tested-by: Wei Ni <>
Cc: <>
Signed-off-by: Takashi Iwai <>
8 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Tue, 27 Jul 2010 21:32:59 +0000 (14:32 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/ericvh/v9fs

* 'for-linus' of git://
  9p: Pass the correct end of buffer to p9stat_read

8 years agogpio: fix spurious printk when freeing a gpio
Jon Povey [Tue, 27 Jul 2010 20:18:06 +0000 (13:18 -0700)]
gpio: fix spurious printk when freeing a gpio

When freeing a gpio that has not been exported, gpio_unexport() prints a
debug message when it should just fall through silently.

Example spurious message:

gpio_unexport: gpio0 status -22

Signed-off-by: Jon Povey <>
Cc: David Brownell <>
Acked-by: Uwe Kleine-K?nig <>
Cc: Gregory Bean <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
8 years agoedac: mpc85xx: fix coldplug/hotplug module autoloading
Anton Vorontsov [Tue, 27 Jul 2010 20:18:05 +0000 (13:18 -0700)]
edac: mpc85xx: fix coldplug/hotplug module autoloading

The MPC85xx EDAC driver is missing module device aliases, so the driver
won't load automatically on boot.  This patch fixes the issue by adding
proper MODULE_DEVICE_TABLE() macros.

Signed-off-by: Anton Vorontsov <>
Cc: Doug Thompson <>
Cc: Peter Tyser <>
Cc: Dave Jiang <>
Cc: Kumar Gala <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
8 years agodrivers/rtc/rtc-rx8581.c: fix setdatetime
Rudolf Marek [Tue, 27 Jul 2010 20:18:02 +0000 (13:18 -0700)]
drivers/rtc/rtc-rx8581.c: fix setdatetime

Fix the logic while writing new date/time to the chip.  The driver
incorrectly wrote back register values to different registers and even
with wrong mask.  The patch adds clearing of the VLF register, which
should be cleared if all date/time values are set.

Signed-off-by: Rudolf Marek <>
Acked-by: Wan ZongShun <>
Cc: Martyn Welch <>
Cc: Alessandro Zummo <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
8 years agodynamic debug: move ddebug_remove_module() down into free_module()
Jason Baron [Tue, 27 Jul 2010 20:18:01 +0000 (13:18 -0700)]
dynamic debug: move ddebug_remove_module() down into free_module()

The command

echo "file ec.c +p" >/sys/kernel/debug/dynamic_debug/control

causes an oops.

Move the call to ddebug_remove_module() down into free_module().  In this
way it should be called from all error paths.  Currently, we are missing
the remove if the module init routine fails.

Signed-off-by: Jason Baron <>
Reported-by: Thomas Renninger <>
Tested-by: Thomas Renninger <>
Cc: <> [2.6.32+]
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
8 years agoceph: use complete_all and wake_up_all
Yehuda Sadeh [Tue, 27 Jul 2010 20:11:08 +0000 (13:11 -0700)]
ceph: use complete_all and wake_up_all

This fixes an issue triggered by running concurrent syncs. One of the syncs
would go through while the other would just hang indefinitely. In any case, we
never actually want to wake a single waiter, so the *_all functions should
be used.

Signed-off-by: Yehuda Sadeh <>
Signed-off-by: Sage Weil <>
8 years ago9p: Pass the correct end of buffer to p9stat_read
Latchesar Ionkov [Mon, 19 Jul 2010 20:40:03 +0000 (15:40 -0500)]
9p: Pass the correct end of buffer to p9stat_read

Pass the correct end of the buffer to p9stat_read.

Signed-off-by: Latchesar Ionkov <>
Signed-off-by: Eric Van Hensbergen <>
8 years ago[S390] etr: fix clock synchronization race
Martin Schwidefsky [Tue, 27 Jul 2010 17:29:38 +0000 (19:29 +0200)]
[S390] etr: fix clock synchronization race

The etr events switch-to-local and sync-check disable the synchronous clock
and schedule a work queue that tries to get the clock back into sync.
If another switch-to-local or sync-check event occurs while the work queue
function etr_work_fn still runs the bit and the clock_sync_word can
become inconsistent because check_sync_clock only uses the clock_sync_word
to determine if the clock is in sync or not. The second pass of the
etr_work_fn will reset the bit but will leave the clock_sync_word
intact. Fix this race by moving the reset of the bit into the
switch-to-local and sync-check functions and by checking the bit
as well to decide if the clock needs to be synced.

Signed-off-by: Martin Schwidefsky <>
8 years ago[S390] Fix IRQ tracing in case of PER
Heiko Carstens [Tue, 27 Jul 2010 17:29:37 +0000 (19:29 +0200)]
[S390] Fix IRQ tracing in case of PER

In case user space is single stepped (PER) the program check handler
claims too early that IRQs are enabled on the return path.
Subsequent checks will notice that the IRQ mask in the PSW and
what lockdep thinks the IRQ mask should be do not correlate and
therefore will print a warning to the console and disable lockdep.

Fix this by doing all the work within the correct context.

Signed-off-by: Heiko Carstens <>
Signed-off-by: Martin Schwidefsky <>
8 years ago[SCSI] ibmvscsi: Fix oops when an interrupt is pending during probe
Anton Blanchard [Tue, 13 Jul 2010 04:59:29 +0000 (14:59 +1000)]
[SCSI] ibmvscsi: Fix oops when an interrupt is pending during probe

A driver needs to be ready to take an interrupt as soon as it registers
an interrupt handler. I noticed the following oops when testing kdump:

ipr: IBM Power RAID SCSI Device Driver version: 2.5.0 (February 11, 2010)
ibmvscsi 30000002: SRP_VERSION: 16.a
ibmvscsi 30000002: SRP_VERSION: 16.a
Unable to handle kernel paging request for data at address 0x00000000
pc: c000000004085e34: .tasklet_action+0xf4/0x1dc
c000000004086fe4 .__do_softirq+0x16c/0x2c0
c00000000403138c .call_do_softirq+0x14/0x24
c00000000400ee14 .do_softirq+0xa0/0x104
c00000000408690c .irq_exit+0x70/0xd0
c00000000400f190 .do_IRQ+0x214/0x2a8
c000000004004804 hardware_interrupt_entry+0x1c/0x98
--- Exception: 501 (Hardware Interrupt) at c00000000400c544 .raw_local_irq_restore+0x48/0x54
c00000000465d2a8 ._raw_spin_unlock_irqrestore+0x74/0xa0
c0000000040e7f00 .__setup_irq+0x2ec/0x3f0
c0000000040e8198 .request_threaded_irq+0x194/0x22c
c00000000446d854 .rpavscsi_init_crq_queue+0x284/0x3f0
c00000000446c764 .ibmvscsi_probe+0x688/0x710
c00000000402903c .vio_bus_probe+0x37c/0x3e4
c000000004403f10 .driver_probe_device+0xec/0x1b8
c000000004404088 .__driver_attach+0xac/0xf4
c000000004403184 .bus_for_each_dev+0x98/0x104
c000000004403c98 .driver_attach+0x40/0x60
c0000000044026f0 .bus_add_driver+0x154/0x324
c0000000044045d0 .driver_register+0xe8/0x1ac
c00000000402b2a8 .vio_register_driver+0x54/0x74
c000000004933ea4 .ibmvscsi_module_init+0x80/0xc0
c000000004009834 .do_one_initcall+0x98/0x1d8
c0000000049005b4 .kernel_init+0x27c/0x33c
c000000004031550 .kernel_thread+0x54/0x70

srp_task needs to be setup before request_irq. The patch below fixes the oops.

Signed-off-by: Anton Blanchard <>
Acked-by: Brian King <>
Signed-off-by: James Bottomley <>
8 years agoMerge branch 'urgent' of git://
Linus Torvalds [Tue, 27 Jul 2010 16:23:39 +0000 (09:23 -0700)]
Merge branch 'urgent' of git://git./linux/kernel/git/paulus/perf

* 'urgent' of git://
  perf, powerpc: Use perf_sample_data_init() for the FSL code

8 years agoMerge git://
Linus Torvalds [Tue, 27 Jul 2010 16:22:55 +0000 (09:22 -0700)]
Merge git://

* git://
  ds2782_battery: Rename get_current to fix build failure / name conflict

8 years agoMerge git://
Linus Torvalds [Tue, 27 Jul 2010 16:21:00 +0000 (09:21 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://
  s2io: fixing DBG_PRINT() macro
  ath9k: fix dma direction for map/unmap in ath_rx_tasklet
  net: dev_forward_skb should call nf_reset
  net sched: fix race in mirred device removal
  tun: avoid BUG, dump packet on GSO errors
  bonding: set device in RLB ARP packet handler
  wimax/i2400m: Add PID & VID for Intel WiMAX 6250
  ipv6: Don't add routes to ipv6 disabled interfaces.
  net: Fix skb_copy_expand() handling of ->csum_start
  net: Fix corruption of skb csum field in pskb_expand_head() of net/core/skbuff.c
  macvtap: Limit packet queue length
  ixgbe/igb: catch invalid VF settings
  bnx2x: Advance a module version
  bnx2x: Protect statistics ramrod and sequence number
  bnx2x: Protect a SM state change
  wireless: use netif_rx_ni in ieee80211_send_layer2_update

8 years agoperf, powerpc: Use perf_sample_data_init() for the FSL code
Peter Zijlstra [Fri, 9 Jul 2010 08:21:21 +0000 (10:21 +0200)]
perf, powerpc: Use perf_sample_data_init() for the FSL code

We should use perf_sample_data_init() to initialize struct
perf_sample_data.  As explained in the description of commit dc1d628a
("perf: Provide generic perf_sample_data initialization"), it is
possible for userspace to get the kernel to dereference data.raw,
so if it is not initialized, that means that unprivileged userspace
can possibly oops the kernel.  Using perf_sample_data_init makes sure
it gets initialized to NULL.

This conversion should have been included in commit dc1d628a, but it
got missed.

Signed-off-by: Peter Zijlstra <>
Acked-by: Kumar Gala <>
Signed-off-by: Paul Mackerras <>
8 years agowm8350-regulator: fix wm8350_register_regulator error handling
Axel Lin [Mon, 26 Jul 2010 02:41:58 +0000 (10:41 +0800)]
wm8350-regulator: fix wm8350_register_regulator error handling

In the case of platform_device_add() fail, we should call
platform_device_put() instead of platform_device_del()

Signed-off-by: Axel Lin <>
Acked-by: Mark Brown <>
Signed-off-by: Liam Girdwood <>
8 years agoab3100: fix off-by-one value range checking for voltage selector
Axel Lin [Mon, 26 Jul 2010 07:34:14 +0000 (15:34 +0800)]
ab3100: fix off-by-one value range checking for voltage selector

We use voltage selector as an array index for typ_voltages.
Thus the valid range for voltage selector should be 0..voltages_len-1.

Signed-off-by: Axel Lin <>
Acked-by: Mark Brown <>
Acked-by: Linus Walleij <>
Signed-off-by: Liam Girdwood <>
8 years agoMerge branch 'x86-fixes-for-linus' of git://
Linus Torvalds [Mon, 26 Jul 2010 23:02:07 +0000 (16:02 -0700)]
Merge branch 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://
  x86: Do not try to disable hpet if it hasn't been initialized before
  x86, i8259: Only register sysdev if we have a real 8259 PIC

8 years agos2io: fixing DBG_PRINT() macro
Breno Leitao [Mon, 26 Jul 2010 22:37:30 +0000 (15:37 -0700)]
s2io: fixing DBG_PRINT() macro

Patch 9e39f7c5b311a306977c5471f9e2ce4c456aa038 changed the
DBG_PRINT() macro and the if clause was wrongly changed. It means
that currently all the DBG_PRINT are being printed, flooding the
kernel log buffer with things like:

s2io: eth6: Next block at: c0000000b9c90000
s2io: eth6: In Neterion Tx routine

Signed-off-by: Breno Leitao <>
Acked-by: Sreenivasa Honnur <>
Signed-off-by: David S. Miller <>
8 years agoMerge branch 'fixes' of git://
Linus Torvalds [Mon, 26 Jul 2010 22:35:53 +0000 (15:35 -0700)]
Merge branch 'fixes' of git://git./linux/kernel/git/davej/cpufreq

* 'fixes' of git://
  [CPUFREQ] powernow-k8: Limit Pstate transition latency check
  [CPUFREQ] Fix PCC driver error path
  [CPUFREQ] fix double freeing in error path of pcc-cpufreq
  [CPUFREQ] pcc driver should check for pcch method before calling _OSC
  [CPUFREQ] fix memory leak in cpufreq_add_dev
  [CPUFREQ] revert "[CPUFREQ] remove rwsem lock from CPUFREQ_GOV_STOP call (second call site)"

8 years agoMerge branch 'upstream' of git://
Linus Torvalds [Mon, 26 Jul 2010 22:35:04 +0000 (15:35 -0700)]
Merge branch 'upstream' of git://

* 'upstream' of git://
  MIPS: Set io_map_base for several PCI bridges lacking it
  MIPS: Alchemy: Define eth platform devices in the correct order
  MIPS: BCM63xx: Prevent second enet registration on BCM6338
  MIPS: Quit using undefined behavior of ADDU in 64-bit atomic operations.
  MIPS: N32: Define getdents64.
  MIPS: MTX-1: Fix PCI on the MeshCube and related boards
  MIPS: Make init_vdso a subsys_initcall.
  MIPS: "Fix" useless 'init_vdso successfully' message.
  MIPS: PowerTV: Move register setup to before reading registers.
  SOUND: Au1000: Fix section mismatch
  VIDEO: Au1100fb: Fix section mismatch
  VIDEO: PMAGB-B: Fix section mismatch
  VIDEO: PMAG-BA: Fix section mismatch
  NET: declance: Fix section mismatches
  VIDEO. gbefb: Fix section mismatches.