Thomas Gleixner [Sat, 23 Feb 2008 23:23:57 +0000 (15:23 -0800)]
futex: runtime enable pi and robust functionality
Not all architectures implement futex_atomic_cmpxchg_inatomic(). The default
implementation returns -ENOSYS, which is currently not handled inside of the
futex guts.
Futex PI calls and robust list exits with a held futex result in an endless
loop in the futex code on architectures which have no support.
Fixing up every place where futex_atomic_cmpxchg_inatomic() is called would
add a fair amount of extra if/else constructs to the already complex code. It
is also not possible to disable the robust feature before user space tries to
register robust lists.
Compile time disabling is not a good idea either, as there are already
architectures with runtime detection of futex_atomic_cmpxchg_inatomic support.
Detect the functionality at runtime instead by calling
cmpxchg_futex_value_locked() with a NULL pointer from the futex initialization
code. This is guaranteed to fail, but the call of
futex_atomic_cmpxchg_inatomic() happens with pagefaults disabled.
On architectures, which use the asm-generic implementation or have a runtime
CPU feature detection, a -ENOSYS return value disables the PI/robust features.
On architectures with a working implementation the call returns -EFAULT and
the PI/robust features are enabled.
The relevant syscalls return -ENOSYS and the robust list exit code is blocked,
when the detection fails.
Fixes http://lkml.org/lkml/2008/2/11/149
Originally reported by: Lennart Buytenhek
Thomas Gleixner [Sat, 23 Feb 2008 23:23:55 +0000 (15:23 -0800)]
futex: fix init order
When the futex init code fails to initialize the futex pseudo file system it
returns early without initializing the hash queues. Should the boot succeed
then a futex syscall which tries to enqueue a waiter on the hashqueue will
crash due to the unitilialized plist heads.
Jean Delvare [Sat, 23 Feb 2008 23:23:55 +0000 (15:23 -0800)]
dmi: prevent linked list corruption
Adding the same item to a given linked list more than once is guaranteed
to break and corrupt the list. This is however what we do in dmi_scan
since commit 79da4721117fcf188b4b007b775738a530f574da ("x86: fix DMI out
of memory problems").
Given that there is absolutely no interest in saving empty OEM strings
anyway, I propose the simple and efficient fix below: we discard the empty
OEM strings altogether.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Parag Warudkar <parag.warudkar@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Matt Domsch <Matt_Domsch@dell.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Sergio Luis [Sat, 23 Feb 2008 23:23:53 +0000 (15:23 -0800)]
drivers/video/uvesafb.c: fix section mismatch warning in param_set_scroll()
Fix following warnings:
WARNING: drivers/video/built-in.o(.text+0x7c64a): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/video/built-in.o(.text+0x7c65d): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/video/built-in.o(.text+0x7c679): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/video/built-in.o(.text+0x7c699): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/video/built-in.o(.text+0x7c69f): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/built-in.o(.text+0xa3676): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/built-in.o(.text+0xa3689): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/built-in.o(.text+0xa36a5): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/built-in.o(.text+0xa36c5): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/built-in.o(.text+0xa36cb): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: vmlinux.o(.text+0x4a079a): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: vmlinux.o(.text+0x4a07ad): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: vmlinux.o(.text+0x4a07c9): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: vmlinux.o(.text+0x4a07e9): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: vmlinux.o(.text+0x4a07ef): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
Remove __devinitdata annotation from the variable ypan.
Signed-off-by: Sergio Luis <sergio@larces.uece.br> Cc: Michal Januszewski <spock@gentoo.org> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Eugene Teo [Sat, 23 Feb 2008 23:23:52 +0000 (15:23 -0800)]
proc: add RLIMIT_RTTIME to /proc/<pid>/limits
RLIMIT_RTTIME was introduced to allow the user to set a runtime timeout on
real-time tasks: http://lkml.org/lkml/2007/12/18/218. This patch updates
/proc/<pid>/limits with the new rlimit.
Signed-off-by: Eugene Teo <eugeneteo@kernel.sg> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Merge include/linux/efs_fs{_i,_dir}.h into fs/efs/efs.h. efs_vh.h remains
there because this is the IRIX volume header and shouldn't really be
handled by efs but by the partitioning code. efs_sb.h remains there for
now because it's exported to userspace. Of course this wrong and aboot
should have a copy of it's own, but I'll leave that to a separate patch to
avoid any contention.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
There have been posts to nbd-general mailing list about problems with
cfq and nbd also.
2) nbd performs about 10% better (the last time I tested) with deadline
vs. cfq (the overhead of cfq doesn't provide much advantage to nbd [not
being a real disk], and you end up going through the I/O scheduler on
the nbd server anyway, so it makes sense that deadline is better with
nbd)
Signed-off-by: Paul Clements <paul.clements@steeleye.com> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jeff Dike [Sat, 23 Feb 2008 23:23:49 +0000 (15:23 -0800)]
uml: fix FP register corruption
Commit ee3d9bd4de1ed93d2a7ee41c331ed30a1c7b8acd ("uml: simplify SIGSEGV
handling"), while greatly simplifying the kernel SIGSEGV handler that
runs in the process address space, introduced a bug which corrupts FP
state in the process.
Previously, the SIGSEGV handler called the sigreturn system call by hand - it
couldn't return through the restorer provided to it because that could try to
call the libc restorer which likely wouldn't exist in the process address
space. So, it blocked off some signals, including SIGUSR1, on entry to the
SIGSEGV handler, queued a SIGUSR1 to itself, and invoked sigreturn. The
SIGUSR1 was delivered, and was visible to the UML kernel after sigreturn
finished.
The commit eliminated the signal masking and the call to sigreturn. The
handler simply hits itself with a SIGTRAP to let the UML kernel know that it
is finished. UML then restores the process registers, which effectively
longjmps the process out of the signal handler, skipping sigreturn's restoring
of register state and the signal mask.
The bug is that the host apparently sets used_fp to 0 when it saves the
process FP state in the sigcontext on the process signal stack. Thus, when
the process is longjmped out of the handler, its FP state is corrupt because
it wasn't saved on the context switch to the UML kernel.
This manifested itself as sleep hanging. For some reason, sleep uses floating
point in order to calculate the sleep interval. When a page fault corrupts
its FP state, it is faked into essentially sleeping forever.
This patch saves the FP state before entering the SIGSEGV handler and restores
it afterwards.
Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
In commit 1aa351a308d2c3ddb92b6cc45083fc54271d0010 ("uml: tidy helper
code") the arguments of helper_wait() were changed. The adaptation of
harddog_user.c was forgotten, so this errors occur:
/arch/um/drivers/harddog_user.c: In function 'start_watchdog':
/arch/um/drivers/harddog_user.c:82: error: too many arguments to function 'helper_wait'
/arch/um/drivers/harddog_user.c:89: error: too many arguments to function 'helper_wait'
Signed-off-by: Johann Felix Soden <johfel@users.sourceforge.net> Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jeff Dike [Sat, 23 Feb 2008 23:23:48 +0000 (15:23 -0800)]
uml: remove unused sigcontext accessors
The macros which extract registers from a struct sigcontext are no longer
needed and can be removed. They are starting not to build anyway, given the
removal of the 'e' and 'r' from register names during the x86 merge.
Cc: Jiri Olsa <olsajiri@gmail.com> Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jean Delvare [Sat, 23 Feb 2008 23:23:46 +0000 (15:23 -0800)]
dmi: don't save the same device twice
Now that we gather on-board devices from both DMI types 10 and 41, there is
a possibility that we list the same device twice. In order to not confuse
drivers, and also to save memory, make sure that we do not add duplicate
devices to the dmi_devices list.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Wim Van Sebroeck <wim@iguana.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
David Brownell [Sat, 23 Feb 2008 23:23:44 +0000 (15:23 -0800)]
rtc-cmos: display HPET emulation mode
For the "cmos" RTC, have /proc/driver/rtc say whether HPET based IRQ
emulation is in effect. Given the problems we've had with this particular
hardware maldesign (and the fact that most BIOS code seems not to provide
the IRQ routing needed to use the saner HPET modes), this should help
troubleshooting.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Michael Buesch [Sat, 23 Feb 2008 23:23:42 +0000 (15:23 -0800)]
hwrng: remove Michael as HWRNG maintainer
It turns out that I rewrote the HWRNG core once to make it pluggable, but
I'm not a crypto-expert at all. So I'm certainly the wrong person for
being a maintainer of the HWRNG core. Let's orphan it.
Signed-off-by: Michael Buesch <mb@bu3sch.de> Cc: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Current implementation of cpuset track N_HIGH_MEMORY instead N_MEMORY.
(N_MEMORY doesn't exist in current implementation)
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Acked-by: Paul Jackson <pj@sgi.com> Cc: Christoph Lameter <clameter@sgi.com> Cc: Paul Menage <menage@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Ned Forrester [Sat, 23 Feb 2008 23:23:40 +0000 (15:23 -0800)]
spi: pxa2xx_spi clock polarity fix
Fixes a sequencing bug in spi driver pxa2xx_spi.c in which the chip select
for a transfer may be asserted before the clock polarity is set on the
interface. As a result of this bug, the clock signal may have the wrong
polarity at transfer start, so it may need to make an extra half transition
before the intended clock/data signals begin. (This probably means all
transfers are one bit out of sequence.)
This only occurs on the first transfer following a change in clock polarity
in systems using more than one more than one such polarity. The fix
assures that the clock mode is properly set before asserting chip select.
This bug was introduced in a patch merged on 2006/12/10, kernel 2.6.20.
The patch defines an additional bit in: include/asm-arm/arch-pxa/regs-ssp.h
for 2.6.25 and newer kernels but this addition must be made in:
include/asm-arm/arch-pxa/pxa-regs.h for kernels between 2.6.20 and 2.6.24,
inclusive
Signed-off-by: Ned Forrester <nforrester@whoi.edu> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Russell King <rmk@arm.linux.org.uk> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Atsushi Nemoto [Sat, 23 Feb 2008 23:23:39 +0000 (15:23 -0800)]
atmel_spi: fix clock polarity
The atmel_spi driver does not initialize clock polarity correctly (except for
at91rm9200 CS0 channel) in some case.
The atmel_spi driver uses gpio-controlled chipselect. OTOH spi clock signal
is controlled by CSRn.CPOL bit, but this register controls clock signal
correctly only in 'real transfer' duration. At the time of cs_activate()
call, CSRn.CPOL will be initialized correctly, but the controller do not know
which channel is to be used next, so clock signal will stay at the inactive
state of last transfer. If clock polarity of new transfer and last transfer
was differ, new transfer will start with wrong clock signal state.
For example, if you started SPI MODE 2 or 3 transfer after SPI MODE 0 or 1
transfer, the clock signal state at the assertion of chipselect will be low.
Of course this will violates SPI transfer.
This patch is short term solution for this problem. It makes all CSRn.CPOL
match for the transfer before activating chipselect. For longer term, the
best fix might be to let NPCS0 stay selected permanently in MR and overwrite
CSR0 with to the new slave's settings before asserting CS.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
We should only return IRQ_HANDLED when we actually found something to
handle. This is important since the USART interrupt handler may be
shared with the timer interrupt on some chips.
Pointed-out-by: michael <trimarchi@gandalf.sssup.it> Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
David Rientjes [Sat, 23 Feb 2008 23:23:34 +0000 (15:23 -0800)]
sparc: fix build
Fix build failure on sparc:
In file included from include/linux/mm.h:39,
from include/linux/memcontrol.h:24,
from include/linux/swap.h:8,
from include/linux/suspend.h:7,
from init/do_mounts.c:6:
include/asm/pgtable.h:344: warning: parameter names (without
types) in function declaration
include/asm/pgtable.h:345: warning: parameter names (without
types) in function declaration
include/asm/pgtable.h:346: error: expected '=', ',', ';', 'asm' or
'__attribute__' before '___f___swp_entry'
viro sayeth:
I've run allmodconfig builds on a bunch of target, FWIW (essentially the
same patch). Note that these includes are recent addition caused by added
inline function that had since then become a define. So while I agree with
your comments in general, in _this_ case it's pretty safe.
Cc: Adrian Bunk <bunk@kernel.org> Cc: Robert Reif <reif@earthlink.net> Signed-off-by: David Rientjes <rientjes@google.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Serge E. Hallyn [Sat, 23 Feb 2008 23:23:33 +0000 (15:23 -0800)]
file capabilities: simplify signal check
Simplify the uid equivalence check in cap_task_kill(). Anyone can kill a
process owned by the same uid.
Without this patch wireshark is reported to fail.
Signed-off-by: Serge E. Hallyn <serue@us.ibm.com> Signed-off-by: Andrew G. Morgan <morgan@kernel.org> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Andy Whitcroft [Sat, 23 Feb 2008 23:23:32 +0000 (15:23 -0800)]
hugetlb: ensure we do not reference a surplus page after handing it to buddy
When we free a page via free_huge_page and we detect that we are in surplus
the page will be returned to the buddy. After this we no longer own the page.
However at the end free_huge_page we clear out our mapping pointer from
page private. Even where the page is not a surplus we free the page to
the hugepage pool, drop the pool locks and then clear page private. In
either case the page may have been reallocated. BAD.
Make sure we clear out page private before we free the page.
Signed-off-by: Andy Whitcroft <apw@shadowen.org> Acked-by: Adam Litke <agl@us.ibm.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Hans Rosenfeld [Sat, 23 Feb 2008 23:23:31 +0000 (15:23 -0800)]
/proc/pid/pagemap: fix PM_SPECIAL macro
There seems to be a bug in the PM_SPECIAL macro for /proc/pid/pagemap. I
think masking out those other bits makes more sense then setting all those
mask bits.
Signed-off-by: Hans Rosenfeld <Hans.Rosenfeld@amd.com> Acked-by: Matt Mackall <mpm@selenic.com> Cc: Dave Hansen <haveblue@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Miklos Szeredi [Sat, 23 Feb 2008 23:23:27 +0000 (15:23 -0800)]
fuse: fix permission checking
I added a nasty local variable shadowing bug to fuse in 2.6.24, with the
result, that the 'default_permissions' mount option is basically ignored.
How did this happen?
- old err declaration in inner scope
- new err getting declared in outer scope
- 'return err' from inner scope getting removed
- old declaration not being noticed
-Wshadow would have saved us, but it doesn't seem practical for
the kernel :(
WANG Cong [Sat, 23 Feb 2008 23:23:26 +0000 (15:23 -0800)]
arch/um/kernel/mem.c: fix a shadowed variable
Fix a shadowed variable in arch/um/kernel/mem.c, since there is a global
variable has the same name.
Cc: Jeff Dike <jdike@linux.intel.com> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jeff Dike [Sat, 23 Feb 2008 23:23:24 +0000 (15:23 -0800)]
UML: update defconfig
Update defconfig.
Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
If the initrd file has zero-length, the error message should contain
the filepath.
Cc: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Johann Felix Soden <johfel@users.sourceforge.net> Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Hugh Dickins [Sat, 23 Feb 2008 19:40:17 +0000 (19:40 +0000)]
percpu: fix DEBUG_PREEMPT per_cpu checking
2.6.25-rc1 percpu changes broke CONFIG_DEBUG_PREEMPT's per_cpu checking
on several architectures. On s390, sparc64 and x86 it's been weakened to
not checking at all; whereas on powerpc64 it's become too strict, issuing
warnings from __raw_get_cpu_var in io_schedule and init_timer for example.
Fix this by weakening powerpc's __my_cpu_offset to use the non-checking
local_paca instead of get_paca (which itself contains such a check);
and strengthening the generic my_cpu_offset to go the old slow way via
smp_processor_id when CONFIG_DEBUG_PREEMPT (debug_smp_processor_id is
where all the knowledge of what's correct when lives).
During the last step of hibernation in the "platform" mode (with the
help of ACPI) we use the suspend code, including the devices'
->suspend() methods, to prepare the system for entering the ACPI S4
system sleep state.
But at least for some devices the operations performed by the
->suspend() callback in that case must be different from its operations
during regular suspend.
For this reason, introduce the new PM event type PM_EVENT_HIBERNATE and
pass it to the device drivers' ->suspend() methods during the last phase
of hibernation, so that they can distinguish this case and handle it as
appropriate. Modify the drivers that handle PM_EVENT_SUSPEND in a
special way and need to handle PM_EVENT_HIBERNATE in the same way.
These changes are necessary to fix a hibernation regression related
to the i915 driver (ref. http://lkml.org/lkml/2008/2/22/488).
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Tested-by: Jeff Chua <jeff.chua.linux@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
James Bottomley [Fri, 22 Feb 2008 23:07:52 +0000 (17:07 -0600)]
[SCSI] libsas: correctly flush the LU queue on error recovery
The current sas_scsi_clear_queue_lu() is wrongly checking for commands
which match the pointer to the one passed in. It should be checking for
commands which are on the same logical unit as the one passed in. Fix
this by checking target pointer and LUN for equality.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
James Bottomley [Fri, 22 Feb 2008 23:01:59 +0000 (17:01 -0600)]
[SCSI] aic94xx: fix sequencer hang on error recovery
The clear nexus I_T and clear nexus I_T_L functions in the aic94xx
specify the SUSPEND_TX flag which causes the sequencer to be suspended
until it receives a RESUME_TX. Unfortunately, nothing ever sends the
resume, so the sequencer on the link is stopped forever, leading to
eventual timeouts and I/O errors.
Since clear nexus commands are only executed as part of error recovery,
it's perfectly fine to keep the sequencer running on the link ... as
soon as the recovery function is completed, we'll send it the commands
to retry.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
FUJITA Tomonori [Fri, 22 Feb 2008 14:11:04 +0000 (23:11 +0900)]
[SCSI] stex: stex_internal_copy should be called with sg_count in struct st_ccb
stex_internal_copy copies an in-kernel buffer to a sg list by using
scsi_kmap_atomic_sg. Some functions calls stex_internal_copy with
sg_count in struct st_ccb, which is the value that dma_map_sg
returned. However it might be shorter than the actual number of sg
entries (if the IOMMU merged the sg entries).
scsi_kmap_atomic_sg doesn't see sg->dma_length so stex_internal_copy
should be called with the actual number of sg entries
(i.e. scsi_sg_count), because if the sg entries were merged,
stex_direct_copy wrongly think that the data length in the sg list is
shorter than the actual length.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Ed Lin <ed.lin@promise.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
stex_direct_copy copies an in-kernel buffer to a sg list in order to
spoof some SCSI commands. stex_direct_copy calls dma_map_sg and then
stex_internal_copy with the value that dma_map_sg returned. It calls
scsi_kmap_atomic_sg to copy data.
scsi_kmap_atomic_sg doesn't see sg->dma_length so if dma_map_sg merges
sg entries, stex_internal_copy gets the smaller number of sg entries
than the acutual number, which means it wrongly think that the data
length in the sg list is shorter than the actual length.
stex_direct_copy shouldn't call dma_map_sg and it doesn't need since
this code path doesn't involve dma transfers. This patch removes
stex_direct_copy and simply calls stex_internal_copy with the actual
number of sg entries.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Ed Lin <ed.lin@promise.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Reported-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Acked-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
David Somayajulu [Thu, 21 Feb 2008 11:43:00 +0000 (03:43 -0800)]
[SCSI] qla4xxx: fix up residual handling
the check in the residual case has an incorrect test of scsi_status
(the logic is reversed, it should be scsi_status != 0 instead of
!scsi_status. Since we checked a few lines above that scsi_status was
non-zero, just eliminate this test
Signed-off-by: David C Somayajulu <david.somayajulu@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
James Bottomley [Wed, 20 Feb 2008 03:48:42 +0000 (21:48 -0600)]
[SCSI] libsas: fix error handling
The libsas error handler has two fairly fatal bugs
1. scsi_sas_task_done calls scsi_eh_finish_cmd() too early. This
happens if the task completes after it has been aborted but before
the error handler starts up. Because scsi_eh_finish_cmd()
decrements host_failed and adds the task to the done list, the
error handler start check (host_failed == host_busy) never passes
and the eh never starts.
2. The multiple task completion paths sas_scsi_clear_queue_... all
simply delete the task from the error queue. This causes it to
disappear into the ether, since a command must be placed on the
done queue to be finished off by the error handler. This behaviour
causes the HBA to hang on pending commands.
Fix 1. by moving the SAS_TASK_STATE_ABORTED check to an exit clause at
the top of the routine and calling ->scsi_done() unconditionally (it
is a nop if the timer has fired). This keeps the task in the error
handling queue until the eh starts.
Fix 2. by making sure every task goes through task complete followed
by scsi_eh_finish_cmd().
Tested this by firing resets across a disk running a hammer test (now
it actually survives without hanging the system)
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Takashi Iwai [Fri, 22 Feb 2008 17:47:12 +0000 (18:47 +0100)]
[ALSA] hda-intel - Fix Oops with ATI HDMI devices
The driver gets Oops with ATI HDMI devices due to the wrong calculation
of index for playback streams. This patch fixes it. Reference:
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3746
Sam Ravnborg [Fri, 22 Feb 2008 17:46:47 +0000 (18:46 +0100)]
[ALSA] caiaq - fix section mismatch warning
Fix following warning:
WARNING: vmlinux.o(.text+0x11ec01a): Section mismatch in reference from the function setup_card() to the function .devinit.text:snd_usb_caiaq_control_init()
setup_card() are only used by init_card().
init_card() are only used by snd_probe()
snd_probe() are used for the .probe parameter in usb_driver.probe
The capture source selection for ADC list with two elements is buggy
becaues of a wrong capture mux list. This patch fixes the starting
index based on spec->num_adc_nids.
Roel Kluin [Fri, 22 Feb 2008 17:41:41 +0000 (18:41 +0100)]
[ALSA] soc - duplicate strcasecmp test for "rj-master" in mpc8610_hpcd_probe()
In linus' git tree I found this problem. Is it also in the alsa tree?
please confirm it's the right fix. The patch was not yet tested.
Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Acked-by: Timur Tabi <timur@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Takashi Iwai [Fri, 22 Feb 2008 17:34:44 +0000 (18:34 +0100)]
[ALSA] race between disconnect and error handling in usbmidi
The driver resubmits URBs from an error handler and schedules the error
handler from the URBs' completion handlers. To reliably kill the cycle
a flag must be used.
Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Fri, 22 Feb 2008 16:21:38 +0000 (08:21 -0800)]
Mark CC_STACKPROTECTOR as being BROKEN
It's always been broken, but recent fixes actually made it do something,
and now the brokenness shows up as the resulting kernel simply not
working at all.
So it used to be that you could enable this config option, and it just
didn't do anything. Now we'd better stop people from enabling it by
mistake, since it _does_ do something, but does it so badly as to be
unusable.
Code to actually make it work is pending, but incomplete and won't be
merged into 2.6.25 in any case.
Acked-by: Arjan van de Ven <arjan@infradead.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Cc: James Morris <jmorris@namei.org> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Daniel Drake [Wed, 20 Feb 2008 13:29:05 +0000 (13:29 +0000)]
[SCSI] arcmsr: fix message allocation
arcmsr_iop_message_xfer() is called from atomic context under the
queuecommand scsi_host_template handler. James Bottomley pointed out
that the current GFP_KERNEL|GFP_DMA flags are wrong: firstly we are in
atomic context, secondly this memory is not used for DMA.
Also removed some unneeded casts.
Signed-off-by: Daniel Drake <dsd@gentoo.org> Cc: Nick Cheng <nick.cheng@areca.com.tw> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Adrian Bunk [Wed, 13 Feb 2008 21:30:17 +0000 (23:30 +0200)]
[SCSI] iscsi transport: make 2 functions static
This patch makes the following needlessly global functions static:
- __iscsi_unblock_session()
- iscsi_session_state_name()
Signed-off-by: Adrian Bunk <bunk@kernel.org> Acked-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Adrian Bunk [Thu, 14 Feb 2008 21:24:02 +0000 (23:24 +0200)]
[SCSI] lpfc: make lpfc_disable_node() static
This patch makes the needlessly global lpfc_disable_node() static.
Signed-off-by: Adrian Bunk <bunk@kernel.org> Acked-by: James Smart <James.Smart@Emulex.Com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Linus Torvalds [Fri, 22 Feb 2008 01:19:48 +0000 (17:19 -0800)]
Merge branch 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
* 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
Wrap buffers used for rpc debug printks into RPC_IFDEBUG
nfs: fix sparse warnings
NFS: flush signals before taking down callback thread
Maciej Sosnowski [Thu, 21 Feb 2008 12:44:31 +0000 (13:44 +0100)]
MAINTAINERS: ioatdma, dmaengine and async_tx maintainers change
Shannon Nelson replaced by Maciej Sosnowski in maintanance of
INTEL I/OAT DMA DRIVER, DMA GENERIC ENGINE SUBSYSTEM
and ASYNCHRONOUS TRANSFERS/TRANSFORMS API.
Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com> Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6:
modules: do not try to add sysfs attributes if !CONFIG_SYSFS
POWERPC: fix typo in pseries/power.c
PM: Remove unbalanced mutex_unlock() from dpm_resume()
UIO: fix Greg's stupid changes
stable_kernel_rules: fix must already be in mainline
ide: mark "ide=reverse" option as obsolete
Driver core: Fix error handling in bus_add_driver().
driver-core: fix kernel-doc function parameters
cpufreq: fix kobject reference count handling
slabinfo: fall back from /sys/kernel/slab to /sys/slab
Fix broken utf-8 encodings in ja_JP translation of stable_kernel_rules.txt
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6:
PCI: Fix wrong reference counter check for proc_dir_entry
PCI: fix up setup-bus.c #ifdef
PCI: don't load acpi_php when acpi is disabled
PCI: quirks: set 'En' bit of MSI Mapping for devices onHT-based nvidia platform
PCI: kernel-doc: fix pci-acpi warning
PCI: irq: patch for Intel ICH10 DeviceID's
PCI: pci_ids: patch for Intel ICH10 DeviceID's
PCI: AMD SATA IDE mode quirk
PCI: drivers/pcmcia/i82092.c: fix up after pci_bus_region changes
PCI: hotplug: acpiphp_ibm: Remove get device information
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (23 commits)
ehci-fsl: add PPC_MPC837x to default y
USB: POWERPC: ehci: fix ppc build
USB: usb-storage: don't access beyond the end of the sg buffer
USB: quirks and unusual_devs entry for Actions flash drive
USB: usb-storage: unusual_devs entry for Oracom MP3 player
USB: serial: move zte MF330 from sierra to option
USB: add new vernier product id to ldusb.c
USB: gadget: queue usb USB_CDC_GET_ENCAPSULATED_RESPONSE message
USB: Add another Novatel U727 ID to the device table for usbserial
USB: storage: Nikon D80 new FW still needs Fixup
USB: usb-storage: don't clear-halt when Get-Max-LUN stalls
USB: option: Added vendor id for Dell 5720 broadband modem
USB: option: Add Kyocera KPC680 ids
USB: quirks for known quirky audio devices
USB: fix previous sparse fix which was incorrect
USB: fix error handling in trancevibrator
USB: g_printer, fix empty if statement
USB: ehci-fsl: mpc834x config symbol is PPC_MPC834x, not MPC834x
USB: fix usb open suspend race in cdc-acm
USB: usb: yet another Dell wireless CDMA/EVDO modem
...
Linus Torvalds [Fri, 22 Feb 2008 00:19:34 +0000 (16:19 -0800)]
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm:
[ARM] 4835/1: Fix stale comment in struct machine_desc description
[ARM] 4829/1: add .get method to pxa-cpufreq to silence a warning
[ARM] 4828/1: fix 3 warnings in drivers/video/pxafb.c
[ARM] 4827/1: fix two warnings in drivers/i2c/busses/i2c-pxa.c
[ARM] 4826/1: Orion: Register the RTC interrupt on the TS-209
[ARM] pxa: fix clock lookup to find specific device clocks
Ian Campbell [Thu, 21 Feb 2008 21:03:45 +0000 (13:03 -0800)]
xen: Implement getgeo for Xen virtual block device.
The below implements the getgeo hook for Xen block devices. Extracted
from the xen-unstable tree where it has been used for ages.
It is useful to have because it allows things like grub2 (used by the
Debian installer images) to work in a guest domain without having to
sprinkle Xen specific hacks around the place.
Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Pavel Emelyanov [Thu, 21 Feb 2008 07:57:45 +0000 (10:57 +0300)]
Wrap buffers used for rpc debug printks into RPC_IFDEBUG
Sorry for the noise, but here's the v3 of this compilation fix :)
There are some places, which declare the char buf[...] on the stack
to push it later into dprintk(). Since the dprintk sometimes (if the
CONFIG_SYSCTL=n) becomes an empty do { } while (0) stub, these buffers
cause gcc to produce appropriate warnings.
Wrap these buffers with RPC_IFDEBUG macro, as Trond proposed, to
compile them out when not needed.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Anton Vorontsov [Thu, 21 Feb 2008 20:30:58 +0000 (23:30 +0300)]
ehci-fsl: add PPC_MPC837x to default y
This patch converts USB_EHCI_FSL config option into the verbose
bool, so we'll able to select it for other freescale processors
with built-in EHCI controller.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Anton Vorontsov [Thu, 21 Feb 2008 19:49:13 +0000 (22:49 +0300)]
USB: POWERPC: ehci: fix ppc build
Currently, this setup:
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_HCD_PPC_OF=y
Will fail to build:
CC drivers/usb/host/ehci-hcd.o
drivers/usb/host/ehci-hcd.c:1018:2: error: #error "missing bus glue for ehci-hcd"
make[3]: *** [drivers/usb/host/ehci-hcd.o] Error 1
ehci-hcd.c actually contains OF_PLATFORM_DRIVER glue, so error is bogus.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Wed, 20 Feb 2008 19:15:58 +0000 (14:15 -0500)]
USB: usb-storage: don't access beyond the end of the sg buffer
This patch (as1035) fixes a bug in usb_stor_access_xfer_buf() (the bug
was originally found by Boaz Harrosh): The routine must not attempt to
write beyond the end of a scatter-gather list or beyond the number of
bytes requested. It also fixes up the formatting of a few comments
and similar whitespace issues.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Wed, 20 Feb 2008 17:10:04 +0000 (12:10 -0500)]
USB: quirks and unusual_devs entry for Actions flash drive
This patch (as1033) adds a quirks entry and an unusual_devs entry for
the Actions Semiconductor flash drive. This device has a 64-byte
string descriptor, which it doesn't terminate with a 0-length packet.
Oddly enough, the reporter's logs show that when the device was
plugged in at boot time, it changes its behavior completely -- it uses
a different product ID, product string descriptor, and bDeviceClass.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
USB: usb-storage: unusual_devs entry for Oracom MP3 player
This patch (as1034) was written by Leonid Petrov, reported by Robert
Spitzenpfeil, and updated by me. It adds an unusual_devs entry with
the IGNORE_RESIDUE flag for the Oracom MP3 player. Together with the
change to the Get-Max-LUN routine in as1032, it makes the player usable.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Phil Dibowitz <phil@ipom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Kevin Lloyd [Thu, 14 Feb 2008 21:35:16 +0000 (13:35 -0800)]
USB: serial: move zte MF330 from sierra to option
Move the Onda H600/ZTE MF33 device from the sierra driver to the option
driver.
The reason it was moved is because the sierra driver is starting to support
more and more sierra proprietary features, so it makes more sense to keep
sierra only devices in there.
Signed-off-by: Kevin Lloyd <klloyd@sierrawireless.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jan Altenberg [Tue, 19 Feb 2008 00:44:50 +0000 (01:44 +0100)]
USB: gadget: queue usb USB_CDC_GET_ENCAPSULATED_RESPONSE message
commit 0cf4f2de0a0f4100795f38ef894d4910678c74f8 introduced a bug, which
prevents sending an USB_CDC_GET_ENCAPSULATED_RESPONSE message. This
breaks the RNDIS initialization (especially / only Windoze machines
dislike this behavior...).
Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de> Signed-off-by: Jan Altenberg <jan.altenberg@linutronix.de> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Wed, 13 Feb 2008 15:45:28 +0000 (10:45 -0500)]
USB: usb-storage: don't clear-halt when Get-Max-LUN stalls
This patch (as1032) removes the Clear-Halt calls in
usb_stor_Bulk_max_lun(). Evidently some devices (such as the Oracom
MP3 player) really don't like to receive these requests when their
bulk endpoints aren't halted.
The only reason for adding them originally was to get an ancient
ZIP-100 drive to work. But since this device has only a single LUN,
we don't need to send it a Get-Max-LUN request at all. Adding an
unusual_devs entry for the ZIP-100 with the SINGLE_LUN flag set will
cause this step to be skipped.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
David Brownell [Sat, 2 Feb 2008 10:36:53 +0000 (02:36 -0800)]
USB: fix previous sparse fix which was incorrect
The previous fix for a "sparse" warning in ehci_urb_dequeue() was
incorrect. After rescheduling interrupt transfers it returned the
URB's completion status, not status for the dequeue operation itself.
This patch resolves that issue, cleans up the code in the reschedule
path, and shrinks the object code by a dozen bytes.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>