]> git.kernelconcepts.de Git - karo-tx-linux.git/log
karo-tx-linux.git
12 years ago[SCSI] qla2xxx: Update version number to 8.03.07.13-k.
Chad Dupuis [Thu, 9 Feb 2012 19:14:13 +0000 (11:14 -0800)]
[SCSI] qla2xxx: Update version number to 8.03.07.13-k.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] qla2xxx: Proper detection of firmware abort error code for ISP82xx.
Giridhar Malavali [Thu, 9 Feb 2012 19:14:12 +0000 (11:14 -0800)]
[SCSI] qla2xxx: Proper detection of firmware abort error code for ISP82xx.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] qla2xxx: Remove resetting memory during device initialization for ISP82xx.
Shyam Sundar [Thu, 9 Feb 2012 19:14:11 +0000 (11:14 -0800)]
[SCSI] qla2xxx: Remove resetting memory during device initialization for ISP82xx.

With IOs running and PegHalt testing the system reboots when memory reset is
performed during device initialization.

Signed-off-by: Shyam Sundar <shyam.sundar@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] qla2xxx: Complete mailbox command timedout to avoid initialization failures...
Giridhar Malavali [Thu, 9 Feb 2012 19:14:10 +0000 (11:14 -0800)]
[SCSI] qla2xxx: Complete mailbox command timedout to avoid initialization failures during next reset cycle.

Complete the mailbox command timed out before initiating another abort cycle
to recover so that mailbox commands issued during next reset cycle don't fail
due to pending mailbox access timeout.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] qla2xxx: Remove check for null fcport from host reset handler.
Michael Christie [Thu, 9 Feb 2012 19:14:09 +0000 (11:14 -0800)]
[SCSI] qla2xxx: Remove check for null fcport from host reset handler.

Remove the check for a NULL fcport so that the host reset will run
unconditionally to unwedge any commands before the device is offlined and to
prevent a quick runthrough of the SCSI error handling.

Signed-off-by: Michael Christie <mchristi@redhat.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] qla2xxx: Correct out of bounds read of ISP2200 mailbox registers.
Andrew Vasquez [Thu, 9 Feb 2012 19:14:08 +0000 (11:14 -0800)]
[SCSI] qla2xxx: Correct out of bounds read of ISP2200 mailbox registers.

ISP2200 adapters only have 24 mailbox registers so read only that many.

Reported-by: Olatunji Ruwase <oor@cs.cmu.edu>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] qla2xxx: Remove errant clearing of MBX_INTERRUPT flag during CT-IOCB processing.
Andrew Vasquez [Thu, 9 Feb 2012 19:14:07 +0000 (11:14 -0800)]
[SCSI] qla2xxx: Remove errant clearing of MBX_INTERRUPT flag during CT-IOCB processing.

This can cause instability in mailbox command state machine handling.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] qla2xxx: Clear options-flags while issuing stop-firmware mbx command.
Andrew Vasquez [Thu, 9 Feb 2012 19:14:06 +0000 (11:14 -0800)]
[SCSI] qla2xxx: Clear options-flags while issuing stop-firmware mbx command.

Not clearing the options flags in mbx1 could lead the firmware
into interpreting old data in mbx1 through mbx8.  This could
lead to inadvertent DMA read/write operations to stale memory.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] qla2xxx: Add an "is reset active" helper.
Andrew Vasquez [Thu, 9 Feb 2012 19:14:05 +0000 (11:14 -0800)]
[SCSI] qla2xxx: Add an "is reset active" helper.

Many locations within the driver would use an inconsistent set of
checks to determine ISP-reset state.  Consolidate the checks into
this inline-helper.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] qla2xxx: Add check for null fcport references in qla2xxx_queuecommand.
Chad Dupuis [Thu, 9 Feb 2012 19:14:04 +0000 (11:14 -0800)]
[SCSI] qla2xxx: Add check for null fcport references in qla2xxx_queuecommand.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] qla2xxx: Propagate up abort failures.
Arun Easi [Thu, 9 Feb 2012 19:14:03 +0000 (11:14 -0800)]
[SCSI] qla2xxx: Propagate up abort failures.

Signed-off-by: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] isci: Fix NULL ptr dereference when no firmware is being loaded
Dave Jiang [Fri, 27 Jan 2012 19:17:37 +0000 (11:17 -0800)]
[SCSI] isci: Fix NULL ptr dereference when no firmware is being loaded

NULL orom ptr passed in for verification which caused page fault.
We will set a default version when we don't have orom struct.

Reported-by: Dan Melnic <dan@seamicro.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] ipr: fix eeh recovery for 64-bit adapters
Kleber Sacilotto de Souza [Mon, 16 Jan 2012 21:30:25 +0000 (19:30 -0200)]
[SCSI] ipr: fix eeh recovery for 64-bit adapters

In some scenarios, an EEH error can take a long time to be detected, since the
driver issues an MMIO read only after a device reset command times out and we
try to reset the adapter. This patch adds some code in ipr_cancel_op() to read
a hardware register so we detect the error earlier in case the op is being
aborted because of a timeout caused by a frozen adapter slot.

Another problem in such scenarios is that in __ipr_eh_host_reset() we change the
dump state flag from WAIT_FOR_DUMP to GET_DUMP, and the flag is later changed
from GET_DUMP to READ_DUMP in ipr_reset_restore_cfg_space(). However, if when
__ipr_eh_host_reset() is called by the SCSI error handling the function
ipr_reset_restore_cfg_space() has already been called by the PCI EEH code, we
end up with the flag in an inconsistent state. This patch also prevents this
problem.

Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years agoNFSv4: fix server_scope memory leak
Weston Andros Adamson [Thu, 16 Feb 2012 16:17:05 +0000 (11:17 -0500)]
NFSv4: fix server_scope memory leak

server_scope would never be freed if nfs4_check_cl_exchange_flags() returned
non-zero

Signed-off-by: Weston Andros Adamson <dros@netapp.com>
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
12 years agoNFSv4.1: Fix a NFSv4.1 session initialisation regression
Trond Myklebust [Wed, 15 Feb 2012 01:33:19 +0000 (20:33 -0500)]
NFSv4.1: Fix a NFSv4.1 session initialisation regression

Commit aacd553 (NFSv4.1: cleanup init and reset of session slot tables)
introduces a regression in the session initialisation code. New tables
now find their sequence ids initialised to 0, rather than the mandated
value of 1 (see RFC5661).

Fix the problem by merging nfs4_reset_slot_table() and nfs4_init_slot_table().
Since the tbl->max_slots is initialised to 0, the test in
nfs4_reset_slot_table for max_reqs != tbl->max_slots will automatically
pass for an empty table.

Reported-by: Vitaliy Gusev <gusev.vitaliy@nexenta.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
12 years ago[S390] correct ktime to tod clock comparator conversion
Martin Schwidefsky [Fri, 17 Feb 2012 09:29:23 +0000 (10:29 +0100)]
[S390] correct ktime to tod clock comparator conversion

The conversion of the ktime to a value suitable for the clock comparator
does not take changes to wall_to_monotonic into account. In fact the
conversion just needs the boot clock (sched_clock_base_cc) and the
total_sleep_time.

This is applicable to 3.2+ kernels.

CC: stable@vger.kernel.org
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
12 years ago[S390] 3215 deadlock with tty_wakeup
Martin Schwidefsky [Fri, 17 Feb 2012 09:29:22 +0000 (10:29 +0100)]
[S390] 3215 deadlock with tty_wakeup

The 3215 driver calls tty_wakeup from irq context while holding the
device spinlock. If printk is called by any function on the callchain
starting from tty_wakeup the system deadlocks on the device spinlock.
Using a tasklet to call tty_wakup solves the problem.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
12 years ago[S390] incorrect PageTables counter for kvm page tables
Martin Schwidefsky [Fri, 17 Feb 2012 09:29:21 +0000 (10:29 +0100)]
[S390] incorrect PageTables counter for kvm page tables

The page_table_free_pgste function is used for kvm processes to free page
tables that have the pgste extension. It calls pgtable_page_ctor instead of
pgtable_page_dtor which increases NR_PAGETABLE instead of decreasing it.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
12 years ago[S390] idle: avoid RCU usage in extended quiescent state
Heiko Carstens [Fri, 17 Feb 2012 09:29:20 +0000 (10:29 +0100)]
[S390] idle: avoid RCU usage in extended quiescent state

Avoid calling wake_up() from our NMI "bottom halve" from RCU extended
quiescent state in idle. wake_up() has RCU read-side critical sections
but this will be completely ignored by RCU if the cpu is in extended
quiescent state.
Which means that whatever object is being accessed from within the
read-side critical section can be freed concurrently from a different
cpu.
So make sure we leave extended quiescent state before calling wake_up().

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
12 years agoALSA: hda/realtek - Fix surround output regression on Acer Aspire 5935
Takashi Iwai [Fri, 17 Feb 2012 09:12:38 +0000 (10:12 +0100)]
ALSA: hda/realtek - Fix surround output regression on Acer Aspire 5935

The previous fix for the speaker on Acer Aspire 59135 introduced
another problem for surround outputs.  It changed the connections on
the line-in/mic pins for limiting the routes, but it left the modified
connections.  Thus wrong connection indices were written when set to
4ch or 6ch mode.

This patch fixes it by restoring the right connections just after
parsing the tree but before the initialization.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42740

Cc: <stable@kernel.org> [v3.2+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoi387: move AMD K7/K8 fpu fxsave/fxrstor workaround from save to restore
Linus Torvalds [Fri, 17 Feb 2012 03:11:15 +0000 (19:11 -0800)]
i387: move AMD K7/K8 fpu fxsave/fxrstor workaround from save to restore

The AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception is
pending.  In order to not leak FIP state from one process to another, we
need to do a floating point load after the fxsave of the old process,
and before the fxrstor of the new FPU state.  That resets the state to
the (uninteresting) kernel load, rather than some potentially sensitive
user information.

We used to do this directly after the FPU state save, but that is
actually very inconvenient, since it

 (a) corrupts what is potentially perfectly good FPU state that we might
     want to lazy avoid restoring later and

 (b) on x86-64 it resulted in a very annoying ordering constraint, where
     "__unlazy_fpu()" in the task switch needs to be delayed until after
     the DS segment has been reloaded just to get the new DS value.

Coupling it to the fxrstor instead of the fxsave automatically avoids
both of these issues, and also ensures that we only do it when actually
necessary (the FP state after a save may never actually get used).  It's
simply a much more natural place for the leaked state cleanup.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoi387: do not preload FPU state at task switch time
Linus Torvalds [Thu, 16 Feb 2012 23:45:23 +0000 (15:45 -0800)]
i387: do not preload FPU state at task switch time

Yes, taking the trap to re-load the FPU/MMX state is expensive, but so
is spending several days looking for a bug in the state save/restore
code.  And the preload code has some rather subtle interactions with
both paravirtualization support and segment state restore, so it's not
nearly as simple as it should be.

Also, now that we no longer necessarily depend on a single bit (ie
TS_USEDFPU) for keeping track of the state of the FPU, we migth be able
to do better.  If we are really switching between two processes that
keep touching the FP state, save/restore is inevitable, but in the case
of having one process that does most of the FPU usage, we may actually
be able to do much better than the preloading.

In particular, we may be able to keep track of which CPU the process ran
on last, and also per CPU keep track of which process' FP state that CPU
has.  For modern CPU's that don't destroy the FPU contents on save time,
that would allow us to do a lazy restore by just re-enabling the
existing FPU state - with no restore cost at all!

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoecryptfs: remove the second argument of k[un]map_atomic()
Cong Wang [Fri, 10 Feb 2012 05:39:50 +0000 (13:39 +0800)]
ecryptfs: remove the second argument of k[un]map_atomic()

Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
12 years agoeCryptfs: Copy up lower inode attrs after setting lower xattr
Tyler Hicks [Tue, 7 Feb 2012 23:55:40 +0000 (17:55 -0600)]
eCryptfs: Copy up lower inode attrs after setting lower xattr

After passing through a ->setxattr() call, eCryptfs needs to copy the
inode attributes from the lower inode to the eCryptfs inode, as they
may have changed in the lower filesystem's ->setxattr() path.

One example is if an extended attribute containing a POSIX Access
Control List is being set. The new ACL may cause the lower filesystem to
modify the mode of the lower inode and the eCryptfs inode would need to
be updated to reflect the new mode.

https://launchpad.net/bugs/926292

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reported-by: Sebastien Bacher <seb128@ubuntu.com>
Cc: John Johansen <john.johansen@canonical.com>
Cc: <stable@vger.kernel.org>
12 years agoeCryptfs: Improve statfs reporting
Tyler Hicks [Sat, 5 Nov 2011 17:45:08 +0000 (13:45 -0400)]
eCryptfs: Improve statfs reporting

statfs() calls on eCryptfs files returned the wrong filesystem type and,
when using filename encryption, the wrong maximum filename length.

If mount-wide filename encryption is enabled, the cipher block size and
the lower filesystem's max filename length will determine the max
eCryptfs filename length. Pre-tested, known good lengths are used when
the lower filesystem's namelen is 255 and a cipher with 8 or 16 byte
block sizes is used. In other, less common cases, we fall back to a safe
rounded-down estimate when determining the eCryptfs namelen.

https://launchpad.net/bugs/885744

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reported-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: John Johansen <john.johansen@canonical.com>
12 years agoi387: don't ever touch TS_USEDFPU directly, use helper functions
Linus Torvalds [Thu, 16 Feb 2012 21:33:12 +0000 (13:33 -0800)]
i387: don't ever touch TS_USEDFPU directly, use helper functions

This creates three helper functions that do the TS_USEDFPU accesses, and
makes everybody that used to do it by hand use those helpers instead.

In addition, there's a couple of helper functions for the "change both
CR0.TS and TS_USEDFPU at the same time" case, and the places that do
that together have been changed to use those.  That means that we have
fewer random places that open-code this situation.

The intent is partly to clarify the code without actually changing any
semantics yet (since we clearly still have some hard to reproduce bug in
this area), but also to make it much easier to use another approach
entirely to caching the CR0.TS bit for software accesses.

Right now we use a bit in the thread-info 'status' variable (this patch
does not change that), but we might want to make it a full field of its
own or even make it a per-cpu variable.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoi387: move TS_USEDFPU clearing out of __save_init_fpu and into callers
Linus Torvalds [Thu, 16 Feb 2012 20:22:48 +0000 (12:22 -0800)]
i387: move TS_USEDFPU clearing out of __save_init_fpu and into callers

Touching TS_USEDFPU without touching CR0.TS is confusing, so don't do
it.  By moving it into the callers, we always do the TS_USEDFPU next to
the CR0.TS accesses in the source code, and it's much easier to see how
the two go hand in hand.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoi387: fix x86-64 preemption-unsafe user stack save/restore
Linus Torvalds [Thu, 16 Feb 2012 17:15:04 +0000 (09:15 -0800)]
i387: fix x86-64 preemption-unsafe user stack save/restore

Commit 5b1cbac37798 ("i387: make irq_fpu_usable() tests more robust")
added a sanity check to the #NM handler to verify that we never cause
the "Device Not Available" exception in kernel mode.

However, that check actually pinpointed a (fundamental) race where we do
cause that exception as part of the signal stack FPU state save/restore
code.

Because we use the floating point instructions themselves to save and
restore state directly from user mode, we cannot do that atomically with
testing the TS_USEDFPU bit: the user mode access itself may cause a page
fault, which causes a task switch, which saves and restores the FP/MMX
state from the kernel buffers.

This kind of "recursive" FP state save is fine per se, but it means that
when the signal stack save/restore gets restarted, it will now take the
'#NM' exception we originally tried to avoid.  With preemption this can
happen even without the page fault - but because of the user access, we
cannot just disable preemption around the save/restore instruction.

There are various ways to solve this, including using the
"enable/disable_page_fault()" helpers to not allow page faults at all
during the sequence, and fall back to copying things by hand without the
use of the native FP state save/restore instructions.

However, the simplest thing to do is to just allow the #NM from kernel
space, but fix the race in setting and clearing CR0.TS that this all
exposed: the TS bit changes and the TS_USEDFPU bit absolutely have to be
atomic wrt scheduling, so while the actual state save/restore can be
interrupted and restarted, the act of actually clearing/setting CR0.TS
and the TS_USEDFPU bit together must not.

Instead of just adding random "preempt_disable/enable()" calls to what
is already excessively ugly code, this introduces some helper functions
that mostly mirror the "kernel_fpu_begin/end()" functionality, just for
the user state instead.

Those helper functions should probably eventually replace the other
ad-hoc CR0.TS and TS_USEDFPU tests too, but I'll need to think about it
some more: the task switching functionality in particular needs to
expose the difference between the 'prev' and 'next' threads, while the
new helper functions intentionally were written to only work with
'current'.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoBtrfs: fix a bug on overcommit stuff
Liu Bo [Thu, 16 Feb 2012 10:34:39 +0000 (18:34 +0800)]
Btrfs: fix a bug on overcommit stuff

When overcommitting, we should check the sum of pinned space and
bytes for delayed item.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
12 years agoBtrfs: kick out redundant stuff in convert_extent_bit
Liu Bo [Thu, 16 Feb 2012 10:34:38 +0000 (18:34 +0800)]
Btrfs: kick out redundant stuff in convert_extent_bit

clear_state_bit will do merge_state for us, so kick out the redundant one.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
12 years agoBtrfs: skip states when they does not contain bits to clear
Liu Bo [Thu, 16 Feb 2012 10:34:37 +0000 (18:34 +0800)]
Btrfs: skip states when they does not contain bits to clear

Clearing a range's bits is different with setting them, since we don't
need to touch them when states do not contain bits we want.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
12 years agoBtrfs: check return value of lookup_extent_mapping() correctly
Tsutomu Itoh [Thu, 16 Feb 2012 07:23:58 +0000 (16:23 +0900)]
Btrfs: check return value of lookup_extent_mapping() correctly

This patch corrects error checking of lookup_extent_mapping().

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
12 years agoBtrfs: fix deadlock on page lock when doing auto-defragment
Miao Xie [Thu, 16 Feb 2012 07:01:24 +0000 (15:01 +0800)]
Btrfs: fix deadlock on page lock when doing auto-defragment

When I ran xfstests circularly on a auto-defragment btrfs, the deadlock
happened.

Steps to reproduce:
[tty0]
 # export MOUNT_OPTIONS="-o autodefrag"
 # export TEST_DEV=<partition1>
 # export TEST_DIR=<mountpoint1>
 # export SCRATCH_DEV=<partition2>
 # export SCRATCH_MNT=<mountpoint2>
 # while [ 1 ]
 > do
 > ./check 091 127 263
 > sleep 1
 > done
[tty1]
 # while [ 1 ]
 > do
 > echo 3 > /proc/sys/vm/drop_caches
 > done

Several hours later, the test processes will hang on, and the deadlock will
happen on page lock.

The reason is that:
  Auto defrag task Flush thread Test task
btrfs_writepages()
  add ordered extent
  (including page 1, 2)
  set page 1 writeback
  set page 2 writeback
endio_fn()
  end page 2 writeback
release page 2
lock page 1
alloc and lock page 2
page 2 is not uptodate
  btrfs_readpage()
    start ordered extent()
    btrfs_writepages()
      try  to lock page 1

so deadlock happens.

Fix this bug by unlocking the page which is in writeback, and re-locking it
after the writeback end.

Signed-off-by: Miao Xie <miax@cn.fujitsu.com>
12 years agoBtrfs: fix return value check of extent_io_ops
Tsutomu Itoh [Thu, 16 Feb 2012 01:11:40 +0000 (10:11 +0900)]
Btrfs: fix return value check of extent_io_ops

This patch adds the check on the return value of extent_io_ops.

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
12 years agoALSA: hda/realtek - Fix overflow of vol/sw check bitmap
Takashi Iwai [Thu, 16 Feb 2012 15:38:07 +0000 (16:38 +0100)]
ALSA: hda/realtek - Fix overflow of vol/sw check bitmap

The bitmap introduced in the commit [527e4d73: ALSA: hda/realtek - Fix
missing volume controls with ALC260] is too narrow for some codecs,
which may have more NIDs than 0x20, thus it may overflow the bitmap
array on them.

Just double the number to cover all and also add a sanity-check code
to be safer.

Cc: <stable@kernel.org> [v3.2+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agobtrfs: honor umask when creating subvol root
Florian Albrechtskirchinger [Fri, 10 Feb 2012 21:15:54 +0000 (22:15 +0100)]
btrfs: honor umask when creating subvol root

Set the subvol root inode permissions based on the current umask.

12 years agodrm/exynos: added postclose to release resource.
Inki Dae [Wed, 15 Feb 2012 02:25:22 +0000 (11:25 +0900)]
drm/exynos: added postclose to release resource.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: removed exynos_drm_fbdev_recreate function.
Inki Dae [Wed, 15 Feb 2012 02:25:21 +0000 (11:25 +0900)]
drm/exynos: removed exynos_drm_fbdev_recreate function.

this function ins't needed anymore.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: fixed page flip issue.
Inki Dae [Wed, 15 Feb 2012 02:25:20 +0000 (11:25 +0900)]
drm/exynos: fixed page flip issue.

with vblank_refcount = 1, there was the case that drm_vblank_put
is called by specific page flip function so this patch fixes the
issue.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: added possible_clones setup function.
Inki Dae [Wed, 15 Feb 2012 02:25:19 +0000 (11:25 +0900)]
drm/exynos: added possible_clones setup function.

basically, all crtcs are possible to clone each other.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: removed pageflip_event_list init code when closed.
Joonyoung Shim [Wed, 15 Feb 2012 02:25:18 +0000 (11:25 +0900)]
drm/exynos: removed pageflip_event_list init code when closed.

if one process is terminated by ctrl-c while two processes are
using pageflip feature then for last pageflip event,
user can't get poll from kernel side so this patch fixes the problem.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyoungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: changed priority of mixer layers.
Joonyoung Shim [Wed, 15 Feb 2012 02:25:17 +0000 (11:25 +0900)]
drm/exynos: changed priority of mixer layers.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: Fix typo in exynos_mixer.c
Masanari Iida [Tue, 14 Feb 2012 07:52:41 +0000 (16:52 +0900)]
drm/exynos: Fix typo in exynos_mixer.c

Correct spelling "sucessful" to "successful" in
drivers/gpu/drm/exynos/exynos_mixer.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agopowerpc/perf: power_pmu_start restores incorrect values, breaking frequency events
Anton Blanchard [Wed, 15 Feb 2012 18:48:22 +0000 (18:48 +0000)]
powerpc/perf: power_pmu_start restores incorrect values, breaking frequency events

perf on POWER stopped working after commit e050e3f0a71b (perf: Fix
broken interrupt rate throttling). That patch exposed a bug in
the POWER perf_events code.

Since the PMCs count upwards and take an exception when the top bit
is set, we want to write 0x80000000 - left in power_pmu_start. We were
instead programming in left which effectively disables the counter
until we eventually hit 0x80000000. This could take seconds or longer.

With the patch applied I get the expected number of samples:

          SAMPLE events:       9948

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: <stable@kernel.org>
12 years agopowerpc/adb: Use set_current_state()
majianpeng [Fri, 3 Feb 2012 14:35:59 +0000 (14:35 +0000)]
powerpc/adb: Use set_current_state()

Signed-off-by: majianpeng <majianpeng@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc: Disable interrupts early in Program Check
Benjamin Herrenschmidt [Mon, 13 Feb 2012 20:42:18 +0000 (20:42 +0000)]
powerpc: Disable interrupts early in Program Check

Program Check exceptions are the result of WARNs, BUGs, some
type of breakpoints, kprobe, and other illegal instructions.

We want interrupts (and thus preemption) to remain disabled
while doing the initial stage of testing the reason and
branching off to a debugger or kprobe, so we are still on
the original CPU which makes debugging easier in various cases.

This is how the code was intended, hence the local_irq_enable()
right in the middle of program_check_exception().

However, the assembly exception prologue for that exception was
incorrectly marked as enabling interrupts, which defeats that
(and records a redundant enable with lockdep).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc: Remove legacy iSeries from ppc64_defconfig
Stephen Rothwell [Tue, 14 Feb 2012 16:31:09 +0000 (16:31 +0000)]
powerpc: Remove legacy iSeries from ppc64_defconfig

Since we are heading towards removing the Legacy iSeries platform, start
by no longer building it for ppc64_defconfig.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc/fsl/pci: Fix PCIe fixup regression
Benjamin Herrenschmidt [Tue, 14 Feb 2012 18:22:20 +0000 (18:22 +0000)]
powerpc/fsl/pci: Fix PCIe fixup regression

Upstream changes to the way PHB resources are registered
broke the resource fixup for FSL boards.

We can no longer rely on the resource pointer array for the PHB's
pci_bus structure, so let's leave it alone and go straight for
the PHB resources instead. This also makes the code generally
more readable.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc: Fix kernel log of oops/panic instruction dump
Ira Snyder [Fri, 6 Jan 2012 12:34:07 +0000 (12:34 +0000)]
powerpc: Fix kernel log of oops/panic instruction dump

A kernel oops/panic prints an instruction dump showing several
instructions before and after the instruction which caused the
oops/panic.

The code intended that the faulting instruction be enclosed in angle
brackets, however a bug caused the faulting instruction to be
interpreted by printk() as the message log level.

To fix this, the KERN_CONT log level is added before the actual text of
the printed message.

=== Before the patch ===

[ 1081.587266] Instruction dump:
[ 1081.590236] 7c000110 7c0000f8 5400077c 552907f6 7d290378 992b0003 4e800020 38000001
[ 1081.598034] 3d20c03a 9009a114 7c0004ac 39200000
[ 1081.602500]  4e800020 3803ffd0 2b800009

<4>[ 1081.587266] Instruction dump:
<4>[ 1081.590236] 7c000110 7c0000f8 5400077c 552907f6 7d290378 992b0003 4e800020 38000001
<4>[ 1081.598034] 3d20c03a 9009a114 7c0004ac 39200000
<98090000>[ 1081.602500]  4e800020 3803ffd0 2b800009

=== After the patch ===

[   51.385216] Instruction dump:
[   51.388186] 7c000110 7c0000f8 5400077c 552907f6 7d290378 992b0003 4e800020 38000001
[   51.395986] 3d20c03a 9009a114 7c0004ac 39200000 <980900004e800020 3803ffd0 2b800009

<4>[   51.385216] Instruction dump:
<4>[   51.388186] 7c000110 7c0000f8 5400077c 552907f6 7d290378 992b0003 4e800020 38000001
<4>[   51.395986] 3d20c03a 9009a114 7c0004ac 39200000 <980900004e800020 3803ffd0 2b800009

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agocrypto: sha512 - use standard ror64()
Alexey Dobriyan [Sat, 14 Jan 2012 18:44:49 +0000 (21:44 +0300)]
crypto: sha512 - use standard ror64()

Use standard ror64() instead of hand-written.
There is no standard ror64, so create it.

The difference is shift value being "unsigned int" instead of uint64_t
(for which there is no reason). gcc starts to emit native ROR instructions
which it doesn't do for some reason currently. This should make the code
faster.

Patch survives in-tree crypto test and ping flood with hmac(sha512) on.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
12 years agodrm/i915: do not enable RC6p on Sandy Bridge
Eugeni Dodonov [Tue, 14 Feb 2012 13:44:48 +0000 (11:44 -0200)]
drm/i915: do not enable RC6p on Sandy Bridge

With base on latest findings, RC6p seems to be respondible for RC6-related
issues on Sandy Bridge platform. To work-around those issues, the previous
solution was to completely disable RC6 on Sandy Bridge for the past few
releases, even if plain RC6 was not giving any issues.

What this patch does is preventing RC6p from being enabled on Sandy Bridge
even if users enable RC6 via a kernel parameter. So it won't change the
defaults in any way, but will ensure that if users do enable RC6 manually
it won't break their machines by enabling this extra state.

Proper fix for this (enabling specific RC6 states according to the GPU
generation) were proposed for the -next kernel, but we are too late in the
release process now to pick such changes.

Acked-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
12 years agoARM: 7327/1: need to include asm/system.h in asm/processor.h
Olof Johansson [Wed, 15 Feb 2012 20:17:12 +0000 (21:17 +0100)]
ARM: 7327/1: need to include asm/system.h in asm/processor.h

For files that include asm/processor.h but not asm/system.h:

arch/arm/mach-msm/include/mach/uncompress.h: In function 'putc':
arch/arm/mach-msm/include/mach/uncompress.h:48:3: error: implicit declaration of function 'smp_mb' [-Werror=implicit-function-declaration]

In this case, smp_mb() is from the cpu_relax() call in the msm putc().

It likely went uncaught when the uncompress.h change went in since the
defconfig didn't enable that code path, but later changes (e76f4750f4:
ARM: debug: arrange Kconfig options more logically) resulted in the
option being on for msm_defconfig and thus exposed it.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7326/2: PL330: fix null pointer dereference in pl330_chan_ctrl()
Javi Merino [Wed, 15 Feb 2012 16:36:39 +0000 (17:36 +0100)]
ARM: 7326/2: PL330: fix null pointer dereference in pl330_chan_ctrl()

This fixes the thrd->req_running field being accessed before thrd
is checked for null. The error was introduced in

   abb959f: ARM: 7237/1: PL330: Fix driver freeze

Reference: <1326458191-23492-1-git-send-email-mans.rullgard@linaro.org>

Cc: stable@kernel.org
Signed-off-by: Mans Rullgard <mans.rullgard@linaro.org>
Acked-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7164/3: PL330: Fix the size of the dst_cache_ctrl field
Javi Merino [Wed, 16 Nov 2011 11:36:39 +0000 (12:36 +0100)]
ARM: 7164/3: PL330: Fix the size of the dst_cache_ctrl field

dst_cache_ctrl affects bits 3, 1 and 0 of AWCACHE but it is a 3-bit
field in the Channel Control Register (see Table 3-21 of the DMA-330
Technical Reference Manual) and should be programmed as such.

Reference: <1320244259-10496-3-git-send-email-javi.merino@arm.com>

Signed-off-by: Javi Merino <javi.merino@arm.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7325/1: fix v7 boot with lockdep enabled
Rabin Vincent [Wed, 15 Feb 2012 15:01:42 +0000 (16:01 +0100)]
ARM: 7325/1: fix v7 boot with lockdep enabled

Bootup with lockdep enabled has been broken on v7 since b46c0f74657d
("ARM: 7321/1: cache-v7: Disable preemption when reading CCSIDR").

This is because v7_setup (which is called very early during boot) calls
v7_flush_dcache_all, and the save_and_disable_irqs added by that patch
ends up attempting to call into lockdep C code (trace_hardirqs_off())
when we are in no position to execute it (no stack, MMU off).

Fix this by using a notrace variant of save_and_disable_irqs.  The code
already uses the notrace variant of restore_irqs.

Reviewed-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agonet/ethernet: ks8851_mll fix irq handling
Jan Weitzel [Tue, 14 Feb 2012 21:35:15 +0000 (21:35 +0000)]
net/ethernet: ks8851_mll fix irq handling

There a two different irq variables ks->irq and netdev->irq.
Only ks->irq is set on probe, so disabling irq in ks_start_xmit fails.

This patches remove ks->irq from private data and use only netdev->irq.

Tested on a kernel 3.0 based OMAP4430 SMP Board

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoveth: Enforce minimum size of VETH_INFO_PEER
Thomas Graf [Wed, 15 Feb 2012 04:09:46 +0000 (04:09 +0000)]
veth: Enforce minimum size of VETH_INFO_PEER

VETH_INFO_PEER carries struct ifinfomsg plus optional IFLA
attributes. A minimal size of sizeof(struct ifinfomsg) must be
enforced or we may risk accessing that struct beyond the limits
of the netlink message.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agostmmac: update the driver version to Feb 2012 (v2)
Giuseppe CAVALLARO [Wed, 15 Feb 2012 00:10:40 +0000 (00:10 +0000)]
stmmac: update the driver version to Feb 2012 (v2)

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agostmmac: move hw init in the probe (v2)
Giuseppe CAVALLARO [Wed, 15 Feb 2012 00:10:39 +0000 (00:10 +0000)]
stmmac: move hw init in the probe (v2)

This patch moves the MAC HW initialization and
the HW feature verification from the open to the probe
function as D. Miller suggested.
So the patch actually reorganizes and tidies-up some parts of
the driver and indeed fixes some problem when tune its HW features.
These can be overwritten by looking at the HW cap register at
run-time and that generated problems.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Reviewed-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agostmmac: request_irq when use an ext wake irq line (v2)
Francesco Virlinzi [Wed, 15 Feb 2012 00:10:38 +0000 (00:10 +0000)]
stmmac: request_irq when use an ext wake irq line (v2)

In case of we use an external Wake-Up IRQ line
(priv->wol_irq != dev->irq) we need to invoke the
request_irq.

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agostmmac: do not discard frame on dribbling bit assert
Giuseppe CAVALLARO [Wed, 15 Feb 2012 00:10:37 +0000 (00:10 +0000)]
stmmac: do not discard frame on dribbling bit assert

If this bit is set and the CRC error is reset, then the packet is valid.
Only report this as stat info.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoipheth: Add iPhone 4S
Tim Gardner [Wed, 15 Feb 2012 07:50:15 +0000 (07:50 +0000)]
ipheth: Add iPhone 4S

BugLink: http://bugs.launchpad.net/bugs/900802
Cc: stable@vger.kernel.org 3.2+
Signed-off-by: Till Kamppeter <till.kamppeter@gmail.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agomlx4: add unicast steering entries to resource_tracker
Eugenia Emantayev [Wed, 15 Feb 2012 06:23:16 +0000 (06:23 +0000)]
mlx4: add unicast steering entries to resource_tracker

Add unicast steering entries to resource tracker.
Do qp_detach also for these entries when VF doesn't shut down gracefully.
Otherwise there is leakage of these resources, since they are not tracked.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agomlx4: fix QP tree trashing
Eugenia Emantayev [Wed, 15 Feb 2012 06:22:57 +0000 (06:22 +0000)]
mlx4: fix QP tree trashing

When adding new unicast steer entry, before moving qp to state ready,
actually before calling mlx4_RST2INIT_QP_wrapper(), there were added
a lot of entries with local_qpn=0 into radix tree.
This fact impacted the get_res() function and proper functioning
of resource tracker in addition to adding trash entries into radix tree.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@melllanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agomlx4: fix buffer overrun
Eugenia Emantayev [Wed, 15 Feb 2012 06:22:49 +0000 (06:22 +0000)]
mlx4: fix buffer overrun

When passing MLX4_UC_STEER=1 it was translated to value 2
after mlx4_QP_ATTACH_wrapper. Therefore in new_steering_entry()
unicast steer entries were added to index 2 of array of size 2.
Fixing this bug by shift right to one position.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Wed, 15 Feb 2012 18:41:52 +0000 (13:41 -0500)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem

12 years agoregmap: Fix cache defaults initialization from raw cache defaults
Lars-Peter Clausen [Wed, 15 Feb 2012 09:23:25 +0000 (10:23 +0100)]
regmap: Fix cache defaults initialization from raw cache defaults

Currently registers with a value of 0 are ignored when initializing the register
defaults from raw defaults. This worked in the past, because registers without a
explicit default were assumed to have a default value of 0. This was changed in
commit b03622a8 ("regmap: Ensure rbtree syncs registers set to zero properly").
As a result registers, which have a raw default value of 0 are now assumed to
have no default. This again can result in unnecessary writes when syncing the
cache. It will also result in unnecessary reads for e.g. the first update
operation. In the case where readback is not possible this will even let the
update operation fail, if the register has not been written to before.

So this patch removes the check. Instead it adds a check to ignore raw defaults
for registers which are volatile, since those registers are not cached.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
12 years agoi387: fix sense of sanity check
Linus Torvalds [Wed, 15 Feb 2012 16:05:18 +0000 (08:05 -0800)]
i387: fix sense of sanity check

The check for save_init_fpu() (introduced in commit 5b1cbac37798: "i387:
make irq_fpu_usable() tests more robust") was the wrong way around, but
I hadn't noticed, because my "tests" were bogus: the FPU exceptions are
disabled by default, so even doing a divide by zero never actually
triggers this code at all unless you do extra work to enable them.

So if anybody did enable them, they'd get one spurious warning.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agobtrfs: silence warning in raid array setup
David Sterba [Fri, 7 Oct 2011 16:06:13 +0000 (18:06 +0200)]
btrfs: silence warning in raid array setup

Raid array setup code creates an extent buffer in an usual way. When the
PAGE_CACHE_SIZE is > super block size, the extent pages are not marked
up-to-date, which triggers a WARN_ON in the following
write_extent_buffer call. Add an explicit up-to-date call to silence the
warning.

Signed-off-by: David Sterba <dsterba@suse.cz>
12 years agobtrfs: fix structs where bitfields and spinlock/atomic share 8B word
David Sterba [Thu, 26 Jan 2012 20:01:12 +0000 (15:01 -0500)]
btrfs: fix structs where bitfields and spinlock/atomic share 8B word

On ia64, powerpc64 and sparc64 the bitfield is modified through a RMW cycle and current
gcc rewrites the adjacent 4B word, which in case of a spinlock or atomic has
disaterous effect.

https://lkml.org/lkml/2012/2/1/220

Signed-off-by: David Sterba <dsterba@suse.cz>
12 years agobtrfs: delalloc for page dirtied out-of-band in fixup worker
Jeff Mahoney [Wed, 15 Feb 2012 15:23:57 +0000 (16:23 +0100)]
btrfs: delalloc for page dirtied out-of-band in fixup worker

 We encountered an issue that was easily observable on s/390 systems but
 could really happen anywhere. The timing just seemed to hit reliably
 on s/390 with limited memory.

 The gist is that when an unexpected set_page_dirty() happened, we'd
 run into the BUG() in btrfs_writepage_fixup_worker since it wasn't
 properly set up for delalloc.

 This patch does the following:
 - Performs the missing delalloc in the fixup worker
 - Allow the start hook to return -EBUSY which informs __extent_writepage
   that it should mark the page skipped and not to redirty it. This is
   required since the fixup worker can fail with -ENOSPC and the page
   will have already been redirtied. That causes an Oops in
   drop_outstanding_extents later. Retrying the fixup worker could
   lead to an infinite loop. Deferring the page redirty also saves us
   some cycles since the page would be stuck in a resubmit-redirty loop
   until the fixup worker completes. It's not harmful, just wasteful.
 - If the fixup worker fails, we mark the page and mapping as errored,
   and end the writeback, similar to what we would do had the page
   actually been submitted to writeback.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
12 years agoBtrfs: fix memory leak in load_free_space_cache()
Tsutomu Itoh [Tue, 14 Feb 2012 08:12:23 +0000 (17:12 +0900)]
Btrfs: fix memory leak in load_free_space_cache()

load_free_space_cache() has forgotten to free path.

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
12 years agobtrfs: don't check DUP chunks twice
Arne Jansen [Thu, 9 Feb 2012 14:09:02 +0000 (15:09 +0100)]
btrfs: don't check DUP chunks twice

Because scrub enumerates the dev extent tree to find the chunks to scrub,
it currently finds each DUP chunk twice and also scrubs it twice. This
patch makes sure that scrub_chunk only checks that part of the chunk the
dev extent has been found for. This only changes the behaviour for DUP
chunks.

Reported-and-tested-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Arne Jansen <sensille@gmx.net>
12 years agoBtrfs: fix trim 0 bytes after a device delete
Liu Bo [Thu, 9 Feb 2012 10:17:41 +0000 (18:17 +0800)]
Btrfs: fix trim 0 bytes after a device delete

A user reported a bug of btrfs's trim, that is we will trim 0 bytes
after a device delete.

The reproducer:

$ mkfs.btrfs disk1
$ mkfs.btrfs disk2
$ mount disk1 /mnt
$ fstrim -v /mnt
$ btrfs device add disk2 /mnt
$ btrfs device del disk1 /mnt
$ fstrim -v /mnt

This is because after we delete the device, the block group may start from
a non-zero place, which will confuse trim to discard nothing.

Reported-by: Lutz Euler <lutz.euler@freenet.de>
Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
12 years agoBtrfs: return the internal error unchanged if btrfs_get_extent_fiemap() call failed...
Jeff Liu [Thu, 9 Feb 2012 06:25:50 +0000 (14:25 +0800)]
Btrfs: return the internal error unchanged if btrfs_get_extent_fiemap() call failed for SEEK_DATA/SEEK_HOLE inquiry

Given that ENXIO only means "offset beyond EOF" for either SEEK_DATA or SEEK_HOLE inquiry
in a desired file range, so we should return the internal error unchanged if btrfs_get_extent_fiemap()
call failed, rather than ENXIO.

Cc: Dave Chinner <david@fromorbit.com>
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
12 years agoBtrfs: avoid positive number with ERR_PTR
Jan Schmidt [Wed, 8 Feb 2012 15:01:01 +0000 (16:01 +0100)]
Btrfs: avoid positive number with ERR_PTR

inode_ref_info() returns 1 when the element wasn't found and < 0 on error,
just like btrfs_search_slot(). In iref_to_path() it's an error when the
inode ref can't be found, thus we return ERR_PTR(ret) in that case. In order
to avoid ERR_PTR(1), we now set ret to -ENOENT in that case.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
12 years agobtrfs: Sector Size check during Mount
Keith Mannthey [Wed, 30 Nov 2011 01:44:12 +0000 (17:44 -0800)]
btrfs: Sector Size check during Mount

Gracefully fail when trying to mount a BTRFS file system that has a
sectorsize smaller than PAGE_SIZE.

On PPC it is possible to build a FS while using a 4k PAGE_SIZE kernel
then boot into a 64K PAGE_SIZE kernel.  Presently open_ctree fails in an
endless loop and hangs the machine in this situation.

My debugging has show this Sector size < Page size to be a non trivial
situation and a graceful exit from the situation would be nice for the
time being.

Signed-off-by: Keith Mannthey <kmannth@us.ibm.com>
12 years ago[media] hdpvr: update picture controls to support firmware versions > 0.15
Taylor Ralph [Fri, 21 Oct 2011 02:33:23 +0000 (23:33 -0300)]
[media] hdpvr: update picture controls to support firmware versions > 0.15

Correctly sets the max/min/default values for the hdpvr picture
controls. The reason the current values didn't cause a problem until now
is because any firmware <= 0.15 didn't support them. The latest firmware
releases properly support picture controls and the values in the patch
are derived from the windows driver using SniffUSB2.0.

Thanks to Devin Heitmueller for helping me.

Signed-off-by: Taylor Ralph <tralph@mythtv.org>
Thanks-to: Devin Heitmueller <dheitmueller@kernellabs.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Reviewed-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years ago[media] wl128x: fix build errors when GPIOLIB is not enabled
Randy Dunlap [Thu, 2 Feb 2012 17:40:30 +0000 (14:40 -0300)]
[media] wl128x: fix build errors when GPIOLIB is not enabled

From: Randy Dunlap <rdunlap@xenotime.net>

Fix wl128x Kconfig to depend on GPIOLIB since TI_ST also
depends on GPIOLIB.

(.text+0xe6d60): undefined reference to `st_register'
(.text+0xe7016): undefined reference to `st_unregister'
(.text+0xe70ce): undefined reference to `st_unregister'

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Manjunatha Halli <manjunatha_halli@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years agoALSA: usb-audio: avoid integer overflow in create_fixed_stream_quirk()
Xi Wang [Tue, 14 Feb 2012 10:18:48 +0000 (05:18 -0500)]
ALSA: usb-audio: avoid integer overflow in create_fixed_stream_quirk()

A malicious USB device could feed in a large nr_rates value.  This would
cause the subsequent call to kmemdup() to allocate a smaller buffer than
expected, leading to out-of-bounds access.

This patch validates the nr_rates value and reuses the limit introduced
in commit 4fa0e81b ("ALSA: usb-audio: fix possible hang and overflow
in parse_uac2_sample_rate_range()").

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoARM: 7324/1: modpost: Fix section warnings for ARM for many compilers
Tony Lindgren [Tue, 14 Feb 2012 20:58:56 +0000 (21:58 +0100)]
ARM: 7324/1: modpost: Fix section warnings for ARM for many compilers

It turns out that many compilers don't show section warnings on ARM
currently because handling for ARM_CALL relocs are missing from
modpost.c.

Based on commit c2e26114 ([ARM] 3205/1: Handle new EABI relocations when
loading kernel modules) it seems that R_ARM_PC24, R_ARM_CALL and
R_ARM_JUMP24 can be handled the same way.

Note that at least Debian libc6-dev is missing defines for both
R_ARM_CALL and R_ARM_JUMP24 in /usr/include/elf.h. So for now
we need to define them in modpost.c if not defined.

Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Ben Hutchings <ben@decadent.org.uk>
Cc: Anders Kaseorg <andersk@ksplice.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7323/1: Do not allow ARM_LPAE on pre-ARMv7 architectures
Catalin Marinas [Tue, 14 Feb 2012 15:33:27 +0000 (16:33 +0100)]
ARM: 7323/1: Do not allow ARM_LPAE on pre-ARMv7 architectures

This patch expands the Kconfig dependencies for ARM_LPAE to not allow
enabling when architectures other than ARMv7 are built into the kernel.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoKbuild: Use dtc's -d (dependency) option
Stephen Warren [Mon, 9 Jan 2012 18:00:32 +0000 (11:00 -0700)]
Kbuild: Use dtc's -d (dependency) option

This hooks dtc into Kbuild's dependency system.

Thus, for example, "make dtbs" will rebuild tegra-harmony.dtb if only
tegra20.dtsi has changed yet tegra-harmony.dts has not. The previous
lack of this feature recently caused me to have very confusing "git
bisect" results.

For ARM, it's obvious what to add to $(targets). I'm not familiar enough
with other architectures to know what to add there. Powerpc appears to
already add various .dtb files into $(targets), but the other archs may
need something added to $(targets) to work.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Mark Salter <msalter@redhat.com>
12 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Linus Torvalds [Tue, 14 Feb 2012 23:26:42 +0000 (15:26 -0800)]
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

One small bug fix from Axel plus a fix for a build failure in unrealistic
but commonly built configs which for some reason manage to survive for
an awfully long time in -next without any reports.

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: Fix getting voltage in max8649_enable_time()
  regulator: Fix mc13xxx regulator modular build (again)

12 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Tue, 14 Feb 2012 23:21:25 +0000 (15:21 -0800)]
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc

Quoth BenH:
 "Here are a few powerpc fixes for 3.3, all pretty trivial.  I also
  added the patch to define GET_IP/SET_IP so we can use some more
  asm-generic goodness."

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc/pseries/eeh: Fix crash when error happens during device probe
  powerpc/pseries: Fix partition migration hang in stop_topology_update
  powerpc/powernv: Disable interrupts while taking phb->lock
  powerpc: Fix WARN_ON in decrementer_check_overflow
  powerpc/wsp: Fix IRQ affinity setting
  powerpc: Implement GET_IP/SET_IP
  powerpc/wsp: Permanently enable PCI class code workaround

12 years agoMerge tag 'mmc-fixes-for-3.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 14 Feb 2012 23:20:50 +0000 (15:20 -0800)]
Merge tag 'mmc-fixes-for-3.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc

MMC fixes for 3.3-rc4:
 * The most visible fix here is against a regression introduced in 3.3-rc1
   that ran cards in Ultra High Speed mode even when they failed to initialize
   in that mode, leading to lower-speed cards failing to mount.
 * A lockdep warning introduced in 3.3-rc1 is fixed.
 * Various other small driver fixes, most notably for a NULL dereference
   when using highmem with dw_mmc.

* tag 'mmc-fixes-for-3.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
  mmc: dw_mmc: Fix PIO mode with support of highmem
  mmc: atmel-mci: save and restore sdioirq when soft reset is performed
  mmc: block: Init ro_lock sysfs attr to fix lockdep warnings
  mmc: sh_mmcif: fix late delayed work initialisation
  mmc: tmio_mmc: fix card eject during IO with DMA
  mmc: core: Fix comparison issue in mmc_compare_ext_csds
  mmc: core: Fix PowerOff Notify suspend/resume
  mmc: sdhci-pci: set Medfield SDIO as non-removable
  mmc: core: add the capability for broken voltage
  mmc: core: Fix low speed mmc card detection failure
  mmc: esdhc: set the timeout to the max value
  mmc: esdhc: add PIO mode support
  mmc: core: Ensure clocks are always enabled before host interaction
  mmc: of_mmc_spi: fix little endian support
  mmc: core: UHS sdio card that fails should not exceed 50MHz
  mmc: esdhc: fix errors when booting kernel on Freescale eSDHC version 2.3

12 years agoMerge tag 'stable/for-linus-fixes-3.3-rc3' of git://git.kernel.org/pub/scm/linux...
Linus Torvalds [Tue, 14 Feb 2012 23:20:11 +0000 (15:20 -0800)]
Merge tag 'stable/for-linus-fixes-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen

Two fixes for VCPU offlining; One to fix the string format exposed
by the xen-pci[front|back] to conform to the one used in majority of
PCI drivers; Two fixes to make the code more resilient to invalid
configurations.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
* tag 'stable/for-linus-fixes-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xenbus_dev: add missing error check to watch handling
  xen/pci[front|back]: Use %d instead of %1x for displaying PCI devfn.
  xen pvhvm: do not remap pirqs onto evtchns if !xen_have_vector_callback
  xen/smp: Fix CPU online/offline bug triggering a BUG: scheduling while atomic.
  xen/bootup: During bootup suppress XENBUS: Unable to read cpu state

12 years agoUSB: option: cleanup zte 3g-dongle's pid in option.c
li.rui27@zte.com.cn [Tue, 14 Feb 2012 02:35:01 +0000 (10:35 +0800)]
USB: option: cleanup zte 3g-dongle's pid in option.c

  1. Remove all old mass-storage ids's pid:
     0x0026,0x0053,0x0098,0x0099,0x0149,0x0150,0x0160;
  2. As the pid from 0x1401 to 0x1510 which have not surely assigned to
     use for serial-port or mass-storage port,so i think it should be
     removed now, and will re-add after it have assigned in future;
  3. sort the pid to WCDMA and CDMA.

Signed-off-by: Rui li <li.rui27@zte.com.cn>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoMerge tag 'for-usb-linus-2012-02-14' of git://git.kernel.org/pub/scm/linux/kernel...
Greg Kroah-Hartman [Tue, 14 Feb 2012 22:48:15 +0000 (14:48 -0800)]
Merge tag 'for-usb-linus-2012-02-14' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-linus

xHCI bug fix for broken BIOS on some Intel systems.

Happy Valentine's Day!  Your present is a working xHCI driver under some
Intel systems with buggy BIOSes that don't provide a legacy PCI IRQ line
for the USB 3.0 host.

Please queue for 3.3 and stable to share the love!

12 years agoASoC: wm8962: Fix sidetone enumeration texts
Mark Brown [Tue, 14 Feb 2012 06:00:47 +0000 (22:00 -0800)]
ASoC: wm8962: Fix sidetone enumeration texts

The sidetone enumeration texts have left and right swapped.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
12 years ago3c59x: shorten timer period for slave devices
Eric Dumazet [Tue, 14 Feb 2012 10:27:09 +0000 (10:27 +0000)]
3c59x: shorten timer period for slave devices

Jean Delvare reported bonding on top of 3c59x adapters was not detecting
network cable removal fast enough.

3c59x indeed uses a 60 seconds timer to check link status if carrier is
on, and 5 seconds if carrier is off.

This patch reduces timer period to 5 seconds if device is a bonding
slave.

Reported-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonetpoll: netpoll_poll_dev() should access dev->flags
Eric Dumazet [Tue, 14 Feb 2012 10:11:59 +0000 (10:11 +0000)]
netpoll: netpoll_poll_dev() should access dev->flags

commit 5a698af53f (bond: service netpoll arp queue on master device)
tested IFF_SLAVE flag against dev->priv_flags instead of dev->flags

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: WANG Cong <amwang@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoRxRPC: Fix kcalloc parameters swapped
Axel Lin [Mon, 13 Feb 2012 20:19:14 +0000 (20:19 +0000)]
RxRPC: Fix kcalloc parameters swapped

The first parameter should be "number of elements" and the second parameter
should be "element size".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x: remove the 'poll' module option
Michal Schmidt [Tue, 14 Feb 2012 09:05:46 +0000 (09:05 +0000)]
bnx2x: remove the 'poll' module option

'poll' was a debugging option, but turning it on these days leads to
kernel panic. Remove it.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotcp: fix tcp_shifted_skb() adjustment of lost_cnt_hint for FACK
Neal Cardwell [Mon, 13 Feb 2012 20:22:08 +0000 (20:22 +0000)]
tcp: fix tcp_shifted_skb() adjustment of lost_cnt_hint for FACK

This commit ensures that lost_cnt_hint is correctly updated in
tcp_shifted_skb() for FACK TCP senders. The lost_cnt_hint adjustment
in tcp_sacktag_one() only applies to non-FACK senders, so FACK senders
need their own adjustment.

This applies the spirit of 1e5289e121372a3494402b1b131b41bfe1cf9b7f -
except now that the sequence range passed into tcp_sacktag_one() is
correct we need only have a special case adjustment for FACK.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoUSB: Don't fail USB3 probe on missing legacy PCI IRQ.
Sarah Sharp [Tue, 14 Feb 2012 00:25:57 +0000 (16:25 -0800)]
USB: Don't fail USB3 probe on missing legacy PCI IRQ.

Intel has a PCI USB xhci host controller on a new platform. It doesn't
have a line IRQ definition in BIOS.  The Linux driver refuses to
initialize this controller, but Windows works well because it only depends
on MSI.

Actually, Linux also can work for MSI.  This patch avoids the line IRQ
checking for USB3 HCDs in usb core PCI probe.  It allows the xHCI driver
to try to enable MSI or MSI-X first.  It will fail the probe if MSI
enabling failed and there's no legacy PCI IRQ.

This patch should be backported to kernels as old as 2.6.32.

Signed-off-by: Alex Shi <alex.shi@intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@vger.kernel.org
12 years ago[media] hdpvr: fix race conditon during start of streaming
Janne Grunau [Thu, 2 Feb 2012 16:35:21 +0000 (13:35 -0300)]
[media] hdpvr: fix race conditon during start of streaming

status has to be set to STREAMING before the streaming worker is
queued. hdpvr_transmit_buffers() will exit immediately otherwise.

Reported-by: Joerg Desch <vvd.joede@googlemail.com>
CC: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
12 years agoMerge tag 'sound-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Linus Torvalds [Tue, 14 Feb 2012 17:09:24 +0000 (09:09 -0800)]
Merge tag 'sound-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

sound fixes for 3.3-rc4

Basically all small fixes suited as rc4: a few HD-audio regression fixes,
a stable fix for an old Dell laptop with intel8x0, and a simple fix for
ASoC fsi.

* tag 'sound-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: intel8x0: Fix default inaudible sound on Gateway M520
  ALSA: hda - Fix silent speaker output on Acer Aspire 6935
  ALSA: hda - Fix initialization of secondary capture source on VT1705
  ASoC: fsi: fixup fsi_pointer() calculation method
  ALSA: hda - Fix mute-LED VREF value for new HP laptops

12 years agodrm/radeon/kms: fix MSI re-arm on rv370+
Alex Deucher [Mon, 13 Feb 2012 21:36:34 +0000 (16:36 -0500)]
drm/radeon/kms: fix MSI re-arm on rv370+

MSI_REARM_EN register is a write only trigger register.
There is no need RMW when re-arming.

May fix:
https://bugs.freedesktop.org/show_bug.cgi?id=41668

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
CC: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms/atom: bios scratch reg handling updates
Alex Deucher [Mon, 13 Feb 2012 13:59:41 +0000 (08:59 -0500)]
drm/radeon/kms/atom: bios scratch reg handling updates

- Add missing DFP6 connection state handling
- crtc routing bits not used on DCE4+

Noticed by sylware on phoronix.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>