]> err.no Git - linux-2.6/log
linux-2.6
16 years ago[SCSI] mpt fusion: don't oops if NumPhys==0
Krzysztof Oledzki [Tue, 4 Mar 2008 22:56:23 +0000 (14:56 -0800)]
[SCSI] mpt fusion: don't oops if NumPhys==0

Don't oops if NumPhys==0, instead return -ENODEV.
This patch fixes http://bugzilla.kernel.org/show_bug.cgi?id=9909

Signed-off-by: Krzysztof Piotr Oledzki <ole@ans.pl>
Acked-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] iscsi class: regression - fix races with state manipulation and blocking/unblo...
Mike Christie [Tue, 4 Mar 2008 19:26:55 +0000 (13:26 -0600)]
[SCSI] iscsi class: regression - fix races with state manipulation and blocking/unblocking

For qla4xxx, we could be starting a session, but some error (network,
target, IO from a device that got started, etc) could cause the session
to fail and curring the block/unblock and state manipulation could race
with each other. This patch just has those operations done in the
single threaded iscsi eh work queue, so that way they are serialized.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla4xxx: regression - add start scan callout
Mike Christie [Tue, 4 Mar 2008 19:26:54 +0000 (13:26 -0600)]
[SCSI] qla4xxx: regression - add start scan callout

We are seeing EXIST errors from sysfs during device addition.
We need a start scan callout so we do not start scanning sessions
found during hba setup, before the async scsi scan code is ready.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: David C Somayajulu <david.somayajulu@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla4xxx: fix host reset dpc race
Mike Christie [Tue, 4 Mar 2008 19:26:53 +0000 (13:26 -0600)]
[SCSI] qla4xxx: fix host reset dpc race

The host reset callout could be starting to reset the hba at the same
time the dpc thread is. This creates lots of problems because they both
want to do wierd things with the firmware and interrupts, etc.

This patch just has the host reset function fully shutdown the dpc
thread before resetting the hba.

This patch also moves the setting of the session online bit to fix
a potential race with the dpc thread and iscsi recovery thread.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: David C Somayajulu <david.somayajulu@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] tgt: fix build errors when dprintk is defined
FUJITA Tomonori [Sat, 1 Mar 2008 06:36:37 +0000 (15:36 +0900)]
[SCSI] tgt: fix build errors when dprintk is defined

drivers/scsi/ibmvscsi/ibmvstgt.c: In function 'ibmvstgt_cmd_done':
drivers/scsi/ibmvscsi/ibmvstgt.c:292: error: 'cmd' undeclared (first use in this function)
drivers/scsi/ibmvscsi/ibmvstgt.c:292: error: (Each undeclared identifier is reported only once
drivers/scsi/ibmvscsi/ibmvstgt.c:292: error: for each function it appears in.)

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] tgt: set the data length properly
FUJITA Tomonori [Sat, 1 Mar 2008 06:36:36 +0000 (15:36 +0900)]
[SCSI] tgt: set the data length properly

scsi_tgt uses REQ_TYPE_BLOCK_PC so scsi_init_io doesn't set the length
for us. scsi_tgt needs to do it by itself.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] tgt: stop zero'ing scsi_cmnd
FUJITA Tomonori [Sat, 1 Mar 2008 06:36:35 +0000 (15:36 +0900)]
[SCSI] tgt: stop zero'ing scsi_cmnd

The scsi midlayer allocates scsi_cmnd->sense_buffer dynamically so we
can't initialize scsi_cmnd (the midlyaer does for us).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] ibmvstgt: set up scsi_host properly before __scsi_alloc_queue
FUJITA Tomonori [Sat, 1 Mar 2008 06:36:34 +0000 (15:36 +0900)]
[SCSI] ibmvstgt: set up scsi_host properly before __scsi_alloc_queue

Before calling __scsi_alloc_queue, scsi_host->shost_gendev.parent must
be initialized properly.

This patch moves __scsi_alloc_queue after scsi_add_host (like
initiator drivers do).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] docbook: fix fusion source files
Randy Dunlap [Sat, 1 Mar 2008 06:03:27 +0000 (22:03 -0800)]
[SCSI] docbook: fix fusion source files

Fix docbook problems in fusion source files.
These cause the generated docbook to be incorrect.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] docbook: fix scsi source file
Randy Dunlap [Sat, 1 Mar 2008 06:02:50 +0000 (22:02 -0800)]
[SCSI] docbook: fix scsi source file

Fix docbook problem in SCSI source files.
These cause the generated docbook to be incorrect.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Update version number to 8.02.00-k9.
Andrew Vasquez [Thu, 28 Feb 2008 22:06:12 +0000 (14:06 -0800)]
[SCSI] qla2xxx: Update version number to 8.02.00-k9.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Correct usage of inconsistent timeout values while issuing ELS commands.
Andrew Vasquez [Thu, 28 Feb 2008 22:06:11 +0000 (14:06 -0800)]
[SCSI] qla2xxx: Correct usage of inconsistent timeout values while issuing ELS commands.

The original code would incorrectly hardcode ELS timeout values
rather than using the traditional '2 * r_a_tov' value.  In some
cases, the hardcoded values would be larger than the
mailbox-command-timeout and result in a needless BIG_HAMMER (ISP
reset), the typical recovery mechanism employed in such cases.

The second defect in the original code was in the assignment of
the default 'ha->r_a_tov' to twice the traditional value.
Correct this by setting the value to 10 seconds.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Correct discrepancies during OVERRUN handling on FWI2-capable cards.
Andrew Vasquez [Thu, 28 Feb 2008 22:06:10 +0000 (14:06 -0800)]
[SCSI] qla2xxx: Correct discrepancies during OVERRUN handling on FWI2-capable cards.

For recent ISPs, software must detect OVERRUN conditions by
checking the SS_RESIDUAL_OVER bit during CS_COMPLETE handling.
Update the driver to perform this check, which is consistent with
what earlier firmwares did by explicitly cracking open the
FCP_RSP statuses and returning an CS_DATA_OVERRUN.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Correct needless clean-up resets during shutdown.
Andrew Vasquez [Thu, 28 Feb 2008 22:06:09 +0000 (14:06 -0800)]
[SCSI] qla2xxx: Correct needless clean-up resets during shutdown.

There's no point in hitting the RISC with what will most
assuredly be an unsucessful reset of the RISC hardware if the
initial stop-firmware mailbox command fails with a time-out
status.  Instead, to avoid what could amount to a lengthy
stop-firmware/detect-failure/reset-risc loop, continue with
driver unloading and discard the stop-firmware requirement.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] arcmsr: update version and changelog
Nick Cheng [Wed, 27 Feb 2008 08:22:03 +0000 (16:22 +0800)]
[SCSI] arcmsr: update version and changelog

The fix up from Daniel Drake for replacing GFP_DMA with something
more sensible has gone in here:

commit 69e562c234440fb7410877b5b24f4b29ef8521d1
Author: Daniel Drake <dsd@gentoo.org>
Date:   Wed Feb 20 13:29:05 2008 +0000

    [SCSI] arcmsr: fix message allocation

add a change log and update the version for this.

Signed-off-by: Nick Cheng <nick.cheng@areca.com.tw>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] ps3rom: disable clustering
FUJITA Tomonori [Sun, 17 Feb 2008 14:46:00 +0000 (23:46 +0900)]
[SCSI] ps3rom: disable clustering

ps3rom does:

scsi_for_each_sg(cmd, sgpnt, scsi_sg_count(cmd), k) {
kaddr = kmap_atomic(sg_page(sgpnt), KM_IRQ0);

We cannot do something like that with the clustering enabled (or we
can use scsi_kmap_atomic_sg).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] ps3rom: fix wrong resid calculation bug
FUJITA Tomonori [Mon, 25 Feb 2008 13:23:45 +0000 (14:23 +0100)]
[SCSI] ps3rom: fix wrong resid calculation bug

sg driver rounds up the length in struct scatterlist to be a multiple
of 512 in some conditions. So LLDs can't use the data length in a sg
list to calculate residual. Instead, the length in struct scsi_cmnd
should be used.

[Geert: the variable buflen already contains scsi_bufflen(cmd)]

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] mvsas: fix phy sas address
Ke Wei [Wed, 27 Feb 2008 12:50:25 +0000 (20:50 +0800)]
[SCSI] mvsas: fix phy sas address

The phy sas address is showing wrongly (wrong endianness).  Fix up the
endian transforms to make this correct.

Signed-off-by: Ke Wei <kewei@marvell.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] gdth: fix to internal commands execution
Boaz Harrosh [Wed, 27 Feb 2008 23:29:15 +0000 (15:29 -0800)]
[SCSI] gdth: fix to internal commands execution

The recent patch named:
  [SCSI] gdth: !use_sg cleanup and use of scsi accessors

has done a bad job in handling internal commands issued by gdth_execute().

Internal commands are issued with device gdth_cmd_str ready made directly
to the card, without any mapping or translations of scsi commands. So here
I added a gdth_cmd_str pointer to the gdth_cmndinfo private structure which
is then copied directly to host.

following this patch is a cleanup that removes the home cooked accessors
and reverts them to regular scsi_cmnd accessors. Since they are not used
anymore. After review maybe the 2 patches should be squashed together.

FIXME: There is still a problem with gdth_get_info(). as reported there
   is a WARN_ON trigerd in dma_free_coherent() when doing:
   $ cat /proc/sys/gdth/0

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Tested-by: Joerg Dorchain: <joerg@dorchain.net>
Tested-by: Stefan Priebe <s.priebe@allied-internet.ag>
Tested-by: Jon Chelton <jchelton@ffpglobal.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] gdth: bugfix for the at-exit problems
Boaz Harrosh [Wed, 27 Feb 2008 23:27:16 +0000 (15:27 -0800)]
[SCSI] gdth: bugfix for the at-exit problems

gdth_exit would first remove all cards then stop the timer
and would not sync with the timer function. This caused a crash
in gdth_timer() when module was unloaded.
So del_timer_sync the timer before we delete the cards.

also the reboot notifier function would crash. So clean
that up and fix the crashes.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Tested-by: Joerg Dorchain: <joerg@dorchain.net>
Tested-by: Stefan Priebe <s.priebe@allied-internet.ag>
Tested-by: Jon Chelton <jchelton@ffpglobal.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] iscsi regression: check for zero max session cmds
Mike Christie [Tue, 26 Feb 2008 18:35:23 +0000 (12:35 -0600)]
[SCSI] iscsi regression: check for zero max session cmds

The old tools did not set max session cmds. This is a regression.
I removed the check when merging the power of 2 patch.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] aic94xx: fix TMF ascb handling to prevent sequencer panic
James Bottomley [Sun, 24 Feb 2008 05:44:19 +0000 (23:44 -0600)]
[SCSI] aic94xx: fix TMF ascb handling to prevent sequencer panic

This is a particularly nasty bug.  The problem is that if any internal
ascb times out, currently we free it even though it's pending at the
sequencer.  This results in the sequencer getting terminally confused
and the error message:

BUG:sequencer:dl:no ascb

Being returned when it comes back.  The way to fix this is to manage
freeing the ascb from the tasklet completion routine, so that we only
free it when the sequencer actually returns it.  The code is also
altered to use on stack completions and transfer variables.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] libsas: misc fixes to the eh path
James Bottomley [Sun, 24 Feb 2008 05:39:59 +0000 (23:39 -0600)]
[SCSI] libsas: misc fixes to the eh path

- Correct one use after free of the sas task
- update the reset required path to move straight to LUN reset
- make the bigger hammer actually reset something instead of just trying
  to clear all the tasks.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] libsas: use the supplied address for SATA devices rather than changing it
James Bottomley [Sun, 24 Feb 2008 05:38:44 +0000 (23:38 -0600)]
[SCSI] libsas: use the supplied address for SATA devices rather than changing it

Once the phy reset is plumbed in properly, SATA error handling fails
nastily because we change the port attached_sas_address using the WWN
field of the IDENTIFY message.  This is a nice thing to do in theory,
but it really destroys hotplug because any event on the port causes an
automatic mismatch between the sas_address the phy just picked up and
the one we propagate into the port.  However ugly they are, we have to
stick with the sas addresses made up by the phys and expanders.

Also does a few cosmetic changes to the way port printing is done to
make it clearer how a port is formed.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] aic94xx: plumb in I_T_nexus_reset task management function
James Bottomley [Sun, 24 Feb 2008 05:37:26 +0000 (23:37 -0600)]
[SCSI] aic94xx: plumb in I_T_nexus_reset task management function

Currently aic94xx has no exported I_T_nexus_reset function.  This is a
bit of a huge problem, since sas_ata relies on this function to
perform an ATA phy reset and also it means that if abort fails, we
really have no bigger hammer to hit everything with.

Plumb in the I_T_nexus_reset by quiescing the sequencer, sending the
correct phy reset (link for ATA and hard for SAS) and then carefully
resuming the sequencer again.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] libsas: export sas_find_local_phy function
James Bottomley [Sun, 24 Feb 2008 05:35:44 +0000 (23:35 -0600)]
[SCSI] libsas: export sas_find_local_phy function

This is needed by the to be added I_T reset function in aic94xx.  It
needs to know the local phy so it can send a link or hard reset along
the path.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] mvsas: remove execute permission from file
James Bottomley [Sun, 24 Feb 2008 05:51:00 +0000 (23:51 -0600)]
[SCSI] mvsas: remove execute permission from file

mvsas.c picked up execute permissions.  Move it back to being a plane
old file.

James Bottomley <James.Bottomley@HansenPartnership.com>

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years agoAdd memory barrier semantics to wake_up() & co
Linus Torvalds [Sun, 24 Feb 2008 02:05:03 +0000 (18:05 -0800)]
Add memory barrier semantics to wake_up() & co

Oleg Nesterov and others have pointed out that on some architectures,
the traditional sequence of

set_current_state(TASK_INTERRUPTIBLE);
if (CONDITION)
return;
schedule();

is racy wrt another CPU doing

CONDITION = 1;
wake_up_process(p);

because while set_current_state() has a memory barrier separating
setting of the TASK_INTERRUPTIBLE state from reading of the CONDITION
variable, there is no such memory barrier on the wakeup side.

Now, wake_up_process() does actually take a spinlock before it reads and
sets the task state on the waking side, and on x86 (and many other
architectures) that spinlock is in fact equivalent to a memory barrier,
but that is not generally guaranteed.  The write that sets CONDITION
could move into the critical region protected by the runqueue spinlock.

However, adding a smp_wmb() to before the spinlock should now order the
writing of CONDITION wrt the lock itself, which in turn is ordered wrt
the accesses within the spinlock (which includes the reading of the old
state).

This should thus close the race (which probably has never been seen in
practice, but since smp_wmb() is a no-op on x86, it's not like this will
make anything worse either on the most common architecture where the
spinlock already gave the required protection).

Acked-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Dmitry Adamushko <dmitry.adamushko@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomvsas: fix build warning, clean prototypes
Jeff Garzik [Sat, 23 Feb 2008 21:53:44 +0000 (16:53 -0500)]
mvsas: fix build warning, clean prototypes

- Fix build 'make randconfig' build warning spotted by Toralf Foerster:

drivers/scsi/mvsas.c: In function 'mvs_hexdump':
drivers/scsi/mvsas.c:715: error: implicit declaration of function 'isalnum'

- Remove unneeded prototypes (spotted by hch)

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agodocumentation: atomic_add_unless() doesn't imply mb() on failure
Oleg Nesterov [Sat, 23 Feb 2008 21:03:29 +0000 (00:03 +0300)]
documentation: atomic_add_unless() doesn't imply mb() on failure

(sorry for being offtpoic, but while experts are here...)

A "typical" implementation of atomic_add_unless() can return 0 immediately
after the first atomic_read() (before doing cmpxchg). In that case it doesn't
provide any barrier semantics. See include/asm-ia64/atomic.h as an example.

We should either change the implementation, or fix the docs.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcgroup: return negative error code in mem_cgroup_create()
Li Zefan [Sat, 23 Feb 2008 23:24:14 +0000 (15:24 -0800)]
memcgroup: return negative error code in mem_cgroup_create()

Cgroup requires the subsystem to return negative error code on error in the
create method.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcgroup: remove a useless VM_BUG_ON()
Li Zefan [Sat, 23 Feb 2008 23:24:13 +0000 (15:24 -0800)]
memcgroup: remove a useless VM_BUG_ON()

Remove this VM_BUG_ON(), as Balbir stated:

We used to have a for loop with !list_empty() as a termination condition
and VM_BUG_ON(!pc) is a spill over.  With the new loop, VM_BUG_ON(!pc) does
not make sense.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Balbir Singh <balbir@in.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcgroup: fix and update documentation
Li Zefan [Sat, 23 Feb 2008 23:24:12 +0000 (15:24 -0800)]
memcgroup: fix and update documentation

- remove trailing " Bytes"s in the demonstration
- remove section 4.4 (feature control_type has been removed)
- fix reference section

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocgroup: remove dead code in cgroup_get_rootdir()
Li Zefan [Sat, 23 Feb 2008 23:24:12 +0000 (15:24 -0800)]
cgroup: remove dead code in cgroup_get_rootdir()

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocgroup: remove duplicate code in find_css_set()
Li Zefan [Sat, 23 Feb 2008 23:24:11 +0000 (15:24 -0800)]
cgroup: remove duplicate code in find_css_set()

The list head res->tasks gets initialized twice in find_css_set().

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocgroup: fix subsys bitops
Li Zefan [Sat, 23 Feb 2008 23:24:11 +0000 (15:24 -0800)]
cgroup: fix subsys bitops

Cgroup uses unsigned long for subsys bitops, not unsigned long long.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocgroup: fix memory leak in cgroup_get_sb()
Li Zefan [Sat, 23 Feb 2008 23:24:10 +0000 (15:24 -0800)]
cgroup: fix memory leak in cgroup_get_sb()

opts.release_agent is not kfree()ed in all necessary places.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocgroup: clean up cgroup.h
Li Zefan [Sat, 23 Feb 2008 23:24:09 +0000 (15:24 -0800)]
cgroup: clean up cgroup.h

- replace old name 'cont' with 'cgrp' (Paul Menage did this cleanup for
  cgroup.c in commit bd89aabc6761de1c35b154fe6f914a445d301510)
- remove a duplicate declaration of cgroup_path()

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocgroup: fix comments
Li Zefan [Sat, 23 Feb 2008 23:24:09 +0000 (15:24 -0800)]
cgroup: fix comments

fix:
- comments about need_forkexit_callback
- comments about release agent
- typo and comment style, etc.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocgroup: fix and update documentation
Li Zefan [Sat, 23 Feb 2008 23:24:08 +0000 (15:24 -0800)]
cgroup: fix and update documentation

Misc fixes and updates, make the doc consistent with current cgroup
implementation.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoSolve section mismatch for free_area_init_core.
Alexander van Heukelum [Sat, 23 Feb 2008 23:24:06 +0000 (15:24 -0800)]
Solve section mismatch for free_area_init_core.

WARNING: vmlinux.o(.meminit.text+0x649):
Section mismatch in reference from the
function free_area_init_core() to the function .init.text:setup_usemap()
The function __meminit free_area_init_core() references
a function __init setup_usemap().
If free_area_init_core is only used by setup_usemap then
annotate free_area_init_core with a matching annotation.

The warning is covers this stack of functions in mm/page_alloc.c:

alloc_bootmem_node must be marked __init.
alloc_bootmem_node is used by setup_usemap, if !SPARSEMEM.
(usemap_size is only used by setup_usemap, if !SPARSEMEM.)
setup_usemap is only used by free_area_init_core.
free_area_init_core is only used by free_area_init_node.

free_area_init_node is used by:
arch/alpha/mm/numa.c: __init paging_init()
arch/arm/mm/init.c: __init bootmem_init_node()
arch/avr32/mm/init.c: __init paging_init()
arch/cris/arch-v10/mm/init.c: __init paging_init()
arch/cris/arch-v32/mm/init.c: __init paging_init()
arch/m32r/mm/discontig.c: __init zone_sizes_init()
arch/m32r/mm/init.c: __init zone_sizes_init()
arch/m68k/mm/motorola.c: __init paging_init()
arch/m68k/mm/sun3mmu.c: __init paging_init()
arch/mips/sgi-ip27/ip27-memory.c: __init paging_init()
arch/parisc/mm/init.c: __init paging_init()
arch/sparc/mm/srmmu.c: __init srmmu_paging_init()
arch/sparc/mm/sun4c.c: __init sun4c_paging_init()
arch/sparc64/mm/init.c: __init paging_init()
mm/page_alloc.c: __init free_area_init_nodes()
mm/page_alloc.c: __init free_area_init()
and
mm/memory_hotplug.c: hotadd_new_pgdat()

hotadd_new_pgdat can not be an __init function, but:

It is compiled for MEMORY_HOTPLUG configurations only
MEMORY_HOTPLUG depends on SPARSEMEM || X86_64_ACPI_NUMA
X86_64_ACPI_NUMA depends on X86_64
ARCH_FLATMEM_ENABLE depends on X86_32
ARCH_DISCONTIGMEM_ENABLE depends on X86_32
So X86_64_ACPI_NUMA implies SPARSEMEM, right?

So we can mark the stack of functions __init for !SPARSEMEM, but we must mark
them __meminit for SPARSEMEM configurations.  This is ok, because then the
calls to alloc_bootmem_node are also avoided.

Compile-tested on:
silly minimal config
defconfig x86_32
defconfig x86_64
defconfig x86_64 -HIBERNATION +MEMORY_HOTPLUG

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoSmack: update for file capabilities
Casey Schaufler [Sat, 23 Feb 2008 23:24:04 +0000 (15:24 -0800)]
Smack: update for file capabilities

Update the Smack LSM to allow the registration of the capability "module"
as a secondary LSM.  Integrate the new hooks required for file based
capabilities.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Cc: Serge Hallyn <serue@us.ibm.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Paul Moore <paul.moore@hp.com>
Cc: James Morris <jmorris@namei.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agokprobes: refuse kprobe insertion on add/sub_preempt_counter()
Srinivasa Ds [Sat, 23 Feb 2008 23:24:04 +0000 (15:24 -0800)]
kprobes: refuse kprobe insertion on add/sub_preempt_counter()

Kprobes makes use of preempt_disable(),preempt_enable_noresched() and these
functions inturn call add/sub_preempt_count().  So we need to refuse user from
inserting probe in to these functions.

This patch disallows user from probing add/sub_preempt_count().

Signed-off-by: Srinivasa DS <srinivasa@in.ibm.com>
Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocgroup memory controller: document huge memory/cache overhead in Kconfig
Andi Kleen [Sat, 23 Feb 2008 23:24:02 +0000 (15:24 -0800)]
cgroup memory controller: document huge memory/cache overhead in Kconfig

Document huge memory/cache overhead of memory controller in Kconfig

I was a little surprised that 2.6.25-rc* increased struct page for the
memory controller.  At least on many x86-64 machines it will not fit into a
single cache line now anymore and also costs considerable amounts of RAM.
At earlier review I remembered asking for a external data structure for
this.

It's also quite unobvious that a innocent looking Kconfig option with a
single line Kconfig description has such a negative effect.

This patch attempts to document these disadvantages at least so that users
configuring their kernel can make a informed decision.

Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Balbir Singh <balbir@in.ibm.com>
Acked-by: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agokernel-doc: fix function-pointer-parameter parsing
Richard Kennedy [Sat, 23 Feb 2008 23:24:01 +0000 (15:24 -0800)]
kernel-doc: fix function-pointer-parameter parsing

When running "make htmldocs" I'm seeing some non-fatal perl errors caused
by trying to parse the callback function definitions in blk-core.c.

The errors are "Use of uninitialized value in concatenation (.)..."
in combination with:
Warning(linux-2.6.25-rc2/block/blk-core.c:1877): No description found for parameter ''

The function pointers are defined without a * i.e.
int (drv_callback)(struct request *)

The compiler is happy with them, but kernel-doc isn't.

This patch teaches create_parameterlist in kernel-doc to parse this type of
function pointer definition, but is it the right way to fix the problem ?
The problem only seems to occur in blk-core.c.

However with the patch applied, kernel-doc finds the correct parameter
description for the callback in blk_end_request_callback, which is doesn't
normally.

I thought it would be a bit odd to change to code to use the more normal
form of function pointers just to get the documentation to work, so I fixed
kernel-doc instead - even though this is teaching it to understand code
that might go away (The comment for blk_end_request_callback says that it
should not be used and will removed at some point).

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoh8300: defconfig update
Yoshinori Sato [Sat, 23 Feb 2008 23:24:00 +0000 (15:24 -0800)]
h8300: defconfig update

defconfig update.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoh8300: IRQ handling update
Yoshinori Sato [Sat, 23 Feb 2008 23:23:59 +0000 (15:23 -0800)]
h8300: IRQ handling update

- add missing file and declare.
- remove unused file and macros.
- some cleanup.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoh8300: uaccess.h update
Yoshinori Sato [Sat, 23 Feb 2008 23:23:59 +0000 (15:23 -0800)]
h8300: uaccess.h update

get_user const *ptr access fix.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoh8300: signal.c typo fix
Yoshinori Sato [Sat, 23 Feb 2008 23:23:58 +0000 (15:23 -0800)]
h8300: signal.c typo fix

typo fix.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofutex: runtime enable pi and robust functionality
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

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Riku Voipio <riku.voipio@movial.fi>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofutex: fix init order
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.

Initialize the hash queues before the filesystem.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Riku Voipio <riku.voipio@movial.fi>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agodmi: prevent linked list corruption
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>
16 years agodrivers/video/uvesafb.c: fix section mismatch warning in param_set_scroll()
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>
16 years agoproc: add RLIMIT_RTTIME to /proc/<pid>/limits
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>
16 years agoefs: move headers out of include/linux/
Christoph Hellwig [Sat, 23 Feb 2008 23:23:51 +0000 (15:23 -0800)]
efs: move headers out of include/linux/

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>
16 years agoNBD: make nbd default to deadline I/O scheduler
Paul Clements [Sat, 23 Feb 2008 23:23:50 +0000 (15:23 -0800)]
NBD: make nbd default to deadline I/O scheduler

NBD doesn't work well with CFQ (or AS) schedulers, so let's default to
something else.

The two problems I have experienced with nbd and cfq are:

1) nbd hangs with cfq on RHEL 5 (2.6.18) -- this may well have been
   fixed

   There's a similar debian bug that has been filed as well:

   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=447638

   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>
16 years agouml: fix FP register corruption
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>
16 years agouml: fix helper_wait calls in watchdog
Johann Felix Soden [Sat, 23 Feb 2008 23:23:49 +0000 (15:23 -0800)]
uml: fix helper_wait calls in watchdog

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>
16 years agouml: remove unused sigcontext accessors
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>
16 years agodmi: don't save the same device twice
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>
16 years agortc-cmos: display HPET emulation mode
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>
16 years agohwrng: remove Michael as HWRNG maintainer
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>
16 years agocpuset: trivial documentation fix s/N_MEMORY/N_HIGH_MEMORY/
KOSAKI Motohiro [Sat, 23 Feb 2008 23:23:41 +0000 (15:23 -0800)]
cpuset: trivial documentation fix s/N_MEMORY/N_HIGH_MEMORY/

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>
16 years agospi: pxa2xx_spi clock polarity fix
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>
16 years agoatmel_spi: fix clock polarity
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>
16 years agolib/vsprintf.c: fix bug omitting minus sign of numbers (module_param)
Hoang-Nam Nguyen [Sat, 23 Feb 2008 23:23:37 +0000 (15:23 -0800)]
lib/vsprintf.c: fix bug omitting minus sign of numbers (module_param)

lib/vsprintf.c: Fix bug omitting minus sign of numbers (module_param)

Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Cc: Yi Yang <yi.y.yang@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoNOMMU: is_vmalloc_addr() won't compile if !MMU
David Howells [Sat, 23 Feb 2008 23:23:37 +0000 (15:23 -0800)]
NOMMU: is_vmalloc_addr() won't compile if !MMU

Make is_vmalloc_addr() contingent on CONFIG_MMU=y, as it won't compile
in !MMU mode.

[ Bug introduced in commit 9e2779fa281cfda13ac060753d674bbcaa23367e:
  "is_vmalloc_addr(): Check if an address is within the vmalloc
  boundaries" ].

Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Greg Ungerer <gerg@snapgear.com>
Cc: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoatmel_serial: fix interrupt handler return value
Haavard Skinnemoen [Sat, 23 Feb 2008 23:23:36 +0000 (15:23 -0800)]
atmel_serial: fix interrupt handler return value

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>
16 years agocopyright owner and author clean up for intel iommu and related files
mark gross [Sat, 23 Feb 2008 23:23:35 +0000 (15:23 -0800)]
copyright owner and author clean up for intel iommu and related files

The following is a clean up and correction of the copyright holding
entities for the files associated with the intel iommu code.

Signed-off-by: <mgross@linux.intel.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agosparc: fix build
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.

  The commit that had done it is 3062fc67dad01b1d2a15d58c709eff946389eca4
  ("memcontrol: move mm_cgroup to header file") and the switch to #define
  is in commit 60c12b1202a60eabb1c61317e5d2678fcea9893f ("memcontrol: add
  vm_match_cgroup()") (BTW, that probably warranted mentioning in the
  changelog of the latter).

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>
16 years agomarkers: fix sparse warnings in markers.c
Harvey Harrison [Sat, 23 Feb 2008 23:23:33 +0000 (15:23 -0800)]
markers: fix sparse warnings in markers.c

char can be unsigned
kernel/marker.c:64:20: error: dubious one-bit signed bitfield
kernel/marker.c:65:14: error: dubious one-bit signed bitfield

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofile capabilities: simplify signal check
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>
16 years agohugetlb: ensure we do not reference a surplus page after handing it to buddy
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>
16 years ago/proc/pid/pagemap: fix PM_SPECIAL macro
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>
16 years agoMAINTAINERS: linux-fbdev is moderated
Geert Uytterhoeven [Sat, 23 Feb 2008 23:23:30 +0000 (15:23 -0800)]
MAINTAINERS: linux-fbdev is moderated

While linux-fbdev is subscribers-only, non-subscribers are not plainly
rejected, but moderated, so the casual patch/comment/question comes through.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoufs: fix parenthesisation in ufs_set_fs_state()
Roel Kluin [Sat, 23 Feb 2008 23:23:29 +0000 (15:23 -0800)]
ufs: fix parenthesisation in ufs_set_fs_state()

This bug snuck in with

commit 252e211e90ce56bf005cb533ad5a297c18c19407
Author: Mark Fortescue <mark@mtfhpc.demon.co.uk>
Date:   Tue Oct 16 23:26:31 2007 -0700

    Add in SunOS 4.1.x compatible mode for UFS

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Acked-by: Evgeniy Dushistov <dushistov@mail.ru>
Cc: Mark Fortescue <mark@mtfhpc.demon.co.uk>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMN10300: define SO_MARK
David Howells [Sat, 23 Feb 2008 23:23:28 +0000 (15:23 -0800)]
MN10300: define SO_MARK

Define SO_MARK for MN10300.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMN10300: define HZ as a config option
David Howells [Sat, 23 Feb 2008 23:23:28 +0000 (15:23 -0800)]
MN10300: define HZ as a config option

Define HZ as a config option.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofuse: fix permission checking
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 :(

More testing would have also saved us :((

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomake LKDTM depend on BLOCK
Chris Snook [Sat, 23 Feb 2008 23:23:26 +0000 (15:23 -0800)]
make LKDTM depend on BLOCK

Make LKDTM depend on BLOCK to prevent build failures with certain configs.

Signed-off-by: Chris Snook <csnook@redhat.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoarch/um/kernel/mem.c: fix a shadowed variable
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>
16 years agoUML: update defconfig
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>
16 years agouml: fix initrd printk
Johann Felix Soden [Sat, 23 Feb 2008 23:23:23 +0000 (15:23 -0800)]
uml: fix initrd printk

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>
16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
Linus Torvalds [Sat, 23 Feb 2008 20:29:16 +0000 (12:29 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: (25 commits)
  [SCSI] qlogicpt: section fixes
  [SCSI] mvsas: convert from rough draft to working driver
  [SCSI] mvsas: Add Marvell 6440 SAS/SATA driver
  [SCSI] libsas: correctly flush the LU queue on error recovery
  [SCSI] aic94xx: fix sequencer hang on error recovery
  [SCSI] st: compile fix when DEBUG set to one
  [SCSI] stex: stex_internal_copy should be called with sg_count in struct st_ccb
  [SCSI] stex: stex_direct_copy shouldn't call dma_map_sg
  [SCSI] lpfc: Balance locking
  [SCSI] qla4xxx: fix up residual handling
  [SCSI] libsas: fix error handling
  [SCSI] arcmsr: fix message allocation
  [SCSI] mptbase: fix use-after-free's
  [SCSI] iscsi transport: make 2 functions static
  [SCSI] lpfc: make lpfc_disable_node() static
  [SCSI] ips: fix data buffer accessors conversion bug
  [SCSI] gdth: don't call pci_free_consistent under spinlock
  [SCSI] qla2xxx: fix compile warning for printk format
  [SCSI] aic7xx: mitigate HOST_MSG_LOOP invalid SCB ff panic
  [SCSI] scsi_debug: disable clustering
  ...

16 years agopercpu: fix DEBUG_PREEMPT per_cpu checking
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).

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Reviewed-by: Mike Travis <travis@sgi.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoPM: Introduce PM_EVENT_HIBERNATE callback state
Rafael J. Wysocki [Sat, 23 Feb 2008 18:13:25 +0000 (19:13 +0100)]
PM: Introduce PM_EVENT_HIBERNATE callback state

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>
16 years ago[SCSI] qlogicpt: section fixes
Adrian Bunk [Wed, 30 Jan 2008 20:03:36 +0000 (22:03 +0200)]
[SCSI] qlogicpt: section fixes

In current mainline, __devinit qpti_sbus_probe() still is calling __init
qpti_chain_add().  Change occurrences of __init to __devinit to fix.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] mvsas: convert from rough draft to working driver
Ke Wei [Sat, 23 Feb 2008 13:15:27 +0000 (21:15 +0800)]
[SCSI] mvsas: convert from rough draft to working driver

Convert rough draft Marvell 6440 driver to a working driver.
Added support for SAS and SATA devices, hotplug, wide port, and expanders.

Signed-off-by: Ke Wei <kewei@marvell.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] mvsas: Add Marvell 6440 SAS/SATA driver
Jeff Garzik [Fri, 26 Oct 2007 00:58:22 +0000 (20:58 -0400)]
[SCSI] mvsas: Add Marvell 6440 SAS/SATA driver

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years agoi915: fix AR register restore.
Jesse Barnes [Fri, 22 Feb 2008 01:44:35 +0000 (17:44 -0800)]
i915: fix AR register restore.

Make sure the restoration correctly restores the AR registers by
flipping the ARX register into index mode before doing anything.

Without this, some people have had the text mode restore all green.

Signed-off-by: Jesse Barnes <jesse.barnes@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago[SCSI] libsas: correctly flush the LU queue on error recovery
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>
16 years ago[SCSI] aic94xx: fix sequencer hang on error recovery
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>
16 years ago[SCSI] st: compile fix when DEBUG set to one
Kai Makisara [Fri, 22 Feb 2008 18:11:21 +0000 (20:11 +0200)]
[SCSI] st: compile fix when DEBUG set to one

Remove the now useless counting of adjacent pages from the debugging code in
to make it compile when DEBUG is set non-zero.

Signed-off-by: Kai Makisara <kai.makisara@kolumbus.fi>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] stex: stex_internal_copy should be called with sg_count in struct st_ccb
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>
16 years ago[SCSI] stex: stex_direct_copy shouldn't call dma_map_sg
FUJITA Tomonori [Fri, 22 Feb 2008 14:11:03 +0000 (23:11 +0900)]
[SCSI] stex: stex_direct_copy shouldn't call dma_map_sg

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>
16 years ago[SCSI] lpfc: Balance locking
Matthew Wilcox [Thu, 21 Feb 2008 12:44:33 +0000 (05:44 -0700)]
[SCSI] lpfc: Balance locking

Commit 3163f725a5d071eea1830bbbfab78cfe3fc9baaf introduced locking in
lpfc_sli_hbqbuf_fill_hbqs, but missed unlocking on one exit.

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>
16 years ago[SCSI] qla4xxx: fix up residual handling
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>
16 years ago[SCSI] libsas: fix error handling
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>
16 years ago[ALSA] bt87X: fix freeing of shared interrupt
Clemens Ladisch [Fri, 22 Feb 2008 17:47:44 +0000 (18:47 +0100)]
[ALSA] bt87X: fix freeing of shared interrupt

Call free_irq() after iounmap() because other devices could trigger our
shared interrupt handler.

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>
16 years ago[ALSA] hda-intel - Fix Oops with ATI HDMI devices
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

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>