GitHub/mt8127/android_kernel_alcatel_ttab.git
16 years ago[SCSI] iscsi: extended cdb support
Boaz Harrosh [Fri, 18 Apr 2008 15:11:51 +0000 (10:11 -0500)]
[SCSI] iscsi: extended cdb support

Support for extended CDBs in iscsi.
All we need is to check if command spills over 16 bytes then allocate
an iscsi-extended-header for the leftovers.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Reviewed-by: Pete Wyckoff <pw@osc.edu>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Fix error handling for blocked unit for send FCP command
Christof Schmitt [Fri, 18 Apr 2008 10:51:57 +0000 (12:51 +0200)]
[SCSI] zfcp: Fix error handling for blocked unit for send FCP command

In the case the unit is blocked, zfcp_unit_get has not been called
yet, so the error handling path should not call zfcp_unit_put.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Remove zfcp_erp_wait from slave destory handler to fix deadlock
Christof Schmitt [Fri, 18 Apr 2008 10:51:56 +0000 (12:51 +0200)]
[SCSI] zfcp: Remove zfcp_erp_wait from slave destory handler to fix deadlock

The testcase
# chchp -v 0 0.da && sleep 59 && chchp -v 1 0.da
results in this deadlock situation:

STACK TRACE FOR TASK: 0x7e9a2048 (zfcperp0.0.c613)
0 schedule+816 [0x356b3c]
1 schedule_timeout+172 [0x357340]
2 wait_for_common+192 [0x3565fc]
3 flush_cpu_workqueue+116 [0x52af0]
4 flush_workqueue+116 [0x533b8]
5 fc_remote_port_add+64 [0x1c83ec]
6 zfcp_erp_thread+4534 [0x26585a]
7 kernel_thread_starter+6 [0x195d2]

STACK TRACE FOR TASK: 0x7f8ec048 (fc_wq_0)
0 schedule+816 [0x356b3c]
1 zfcp_erp_wait+104 [0x264568]
2 zfcp_scsi_slave_destroy+64 [0x261b24]
3 __scsi_remove_device+154 [0x1c24ba]
4 scsi_remove_device+62 [0x1c2512]
5 __scsi_remove_target+198 [0x1c25ea]
6 __remove_child+58 [0x1c26d6]
7 device_for_each_child+66 [0x1ab566]
8 scsi_remove_target+98 [0x1c268a]
9 run_workqueue+200 [0x5272c]
10 worker_thread+146 [0x52882]
11 kthread+140 [0x58360]
12 kernel_thread_starter+6 [0x195d2]

Remove the zfcp_erp_wait call that is not required here to prevent the
deadlock situation.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: fix 31 bit compile warnings
Martin Peschke [Fri, 18 Apr 2008 10:51:55 +0000 (12:51 +0200)]
[SCSI] zfcp: fix 31 bit compile warnings

drivers/s390/scsi/zfcp_aux.c: In function ‘zfcp_fsf_incoming_els_rscn’:
drivers/s390/scsi/zfcp_aux.c:1379: warning: cast from pointer to integer of
different size
drivers/s390/scsi/zfcp_aux.c: In function ‘zfcp_fsf_incoming_els_plogi’:
drivers/s390/scsi/zfcp_aux.c:1432: warning: cast from pointer to integer of
different size
drivers/s390/scsi/zfcp_aux.c: In function ‘zfcp_fsf_incoming_els_logo’:
drivers/s390/scsi/zfcp_aux.c:1457: warning: cast from pointer to integer of
different size
..

Just passing pointers rids us of these warnings and improves readability.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] bsg: no need to set BSG_F_BLOCK bit in bsg_complete_all_commands
FUJITA Tomonori [Mon, 31 Mar 2008 01:03:42 +0000 (10:03 +0900)]
[SCSI] bsg: no need to set BSG_F_BLOCK bit in bsg_complete_all_commands

Before bsg_complete_all_commands is called, BSG_F_BLOCK bit is always
set.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] bsg: remove minor in struct bsg_device
FUJITA Tomonori [Mon, 31 Mar 2008 01:03:41 +0000 (10:03 +0900)]
[SCSI] bsg: remove minor in struct bsg_device

minor in struct bsg_device is used as identifier to find the
corresponding struct bsg_device_class. However, request_queuse can be
used as identifier for that and the minor in struct bsg_device is
unnecessary.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] bsg: use better helper list functions
FUJITA Tomonori [Mon, 31 Mar 2008 01:03:40 +0000 (10:03 +0900)]
[SCSI] bsg: use better helper list functions

This replace hlist_for_each and list_entry with hlist_for_each_entry
and list_first_entry respectively.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] bsg: replace kobject_get with blk_get_queue
FUJITA Tomonori [Mon, 31 Mar 2008 01:03:39 +0000 (10:03 +0900)]
[SCSI] bsg: replace kobject_get with blk_get_queue

Both takes a ref to a queue. But blk_get_queue checks QUEUE_FLAG_DEAD
and is more appropriate interface here.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] bsg: takes a ref to struct device in fops->open
FUJITA Tomonori [Mon, 31 Mar 2008 01:03:38 +0000 (10:03 +0900)]
[SCSI] bsg: takes a ref to struct device in fops->open

bsg_register_queue() takes a ref to struct device that a caller
passes. For example, bsg takes a ref to the sdev_gendev for scsi
devices. However, bsg doesn't inrease the refcount in fops->open. So
while an application opens a bsg device, the scsi device that the bsg
device holds can go away (bsg also takes a ref to a queue, but it
doesn't prevent the device from going away).

With this patch, bsg increases the refcount of struct device in
fops->open and decreases it in fops->release.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla1280: remove version check
Adrian Bunk [Thu, 17 Apr 2008 09:37:01 +0000 (12:37 +0300)]
[SCSI] qla1280: remove version check

There's no point for an in-kernel driver to check whether it's compiled
under kernel < 2.6.0 .

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Jes Sorensen <jes@sgi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] libsas: fix endianness bug in sas_ata
Al Viro [Wed, 16 Apr 2008 22:27:45 +0000 (23:27 +0100)]
[SCSI] libsas: fix endianness bug in sas_ata

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: fix compiler warning caused by poking inside new semaphore (linux-next)
Martin Peschke [Wed, 16 Apr 2008 22:08:03 +0000 (00:08 +0200)]
[SCSI] zfcp: fix compiler warning caused by poking inside new semaphore (linux-next)

as seen in linux-next tree:

drivers/s390/scsi/zfcp_dbf.c: In function ‘zfcp_rec_dbf_event_thread’:
drivers/s390/scsi/zfcp_dbf.c:697: warning: passing argument 1 of ‘atomic_read’
 from incompatible pointer type

Caused by recent git commit:

commit 348447e85749120ad600a5c8e23b6bb7058b931d
Author: Martin Peschke <mp3@de.ibm.com>
Date:   Thu Mar 27 14:22:01 2008 +0100

    [SCSI] zfcp: Add trace records for recovery thread and its queues

We are not supposed to poke inside semaphore.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Acked-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] aacraid: Do not describe check_reset parameter with its value
Paul Bolle [Wed, 16 Apr 2008 12:43:00 +0000 (14:43 +0200)]
[SCSI] aacraid: Do not describe check_reset parameter with its value

Describe check_reset parameter with its name (and not its value)

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Acked-by: Mark Salyzyn <Mark_Salyzyn@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] aacraid: Fix down_interruptible() to check the return value
Mark Salyzyn [Mon, 14 Apr 2008 18:20:16 +0000 (14:20 -0400)]
[SCSI] aacraid: Fix down_interruptible() to check the return value

Instead of ignoring the return value in aac_fib_send() return 2 to
indicate to the layers above that fib transmission was aborted due to
timeout.

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] sun3_scsi_vme: add MODULE_LICENSE
Adrian Bunk [Mon, 14 Apr 2008 14:17:26 +0000 (17:17 +0300)]
[SCSI] sun3_scsi_vme: add MODULE_LICENSE

This patch adds the missing MODULE_LICENSE("GPL").

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] st: rename flush_write_buffer()
Adrian Bunk [Mon, 14 Apr 2008 14:17:16 +0000 (17:17 +0300)]
[SCSI] st: rename flush_write_buffer()

This patch fixes the following namespace collision with
include/asm-avr32/cacheflush.h :

<--  snip  -->

...
  CC [M]  drivers/scsi/st.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/scsi/st.c:629:53: error: macro "flush_write_buffer" passed 1 arguments, but takes just 0
...
make[3]: *** [drivers/scsi/st.o] Error 1

<--  snip  -->

st now uses st_flush_write_buffer()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] tgt: use KMEM_CACHE macro
FUJITA Tomonori [Thu, 10 Apr 2008 14:48:14 +0000 (23:48 +0900)]
[SCSI] tgt: use KMEM_CACHE macro

This uses new KMEM_CACHE() macro instead of kmem_cache_create directly
to simplify slab cache creation.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] initio: fix big endian problems for auto request sense
Grant Grundler [Sat, 5 Apr 2008 16:14:22 +0000 (10:14 -0600)]
[SCSI] initio: fix big endian problems for auto request sense

Most of the cpu_to_le32() usage was wrong in one way or another.
Compiler warning on BE builds was just the tip of the iceberg.
This patch attempts to make this driver work on BE though I
don't have the HW to test it.

Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] lpfc 8.2.6 : Update lpfc driver version to 8.2.6
James Smart [Mon, 7 Apr 2008 14:16:10 +0000 (10:16 -0400)]
[SCSI] lpfc 8.2.6 : Update lpfc driver version to 8.2.6

Update lpfc driver version to 8.2.6

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] lpfc 8.2.6 : Miscellaneous Fixes
James Smart [Mon, 7 Apr 2008 14:16:05 +0000 (10:16 -0400)]
[SCSI] lpfc 8.2.6 : Miscellaneous Fixes

Miscellaneous Fixes
- Allow WRITE_VPARAM command when the virtual port is in a stopped state
- Fixed handling of our queue depth max that was unconditionally raising
  the depth on all vports, rather than just the vport affected.
- Fix race in interrupt handler for mailbox processing that did not take
  out the host lock.
- Removed unused functions: find_node, findnode_rpi, and fabric_abort_flogi
- Correct misspelled word unsolicited in message 0146
- Correct HW-error 5 handling - it should not reset the adapter
- Correct handling of IOCBs, which did not null out our pCmd field before
  invoking the midlayer io done function.
- Changed our maximum supported target id to 4096

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] lpfc 8.2.6 : PCI Parity and EEH handling fixes
James Smart [Mon, 7 Apr 2008 14:16:00 +0000 (10:16 -0400)]
[SCSI] lpfc 8.2.6 : PCI Parity and EEH handling fixes

PCI Parity and EEH handling Fixes:
- Under a PCI Data Parity Error, remove a completion routine callback that
  was on a command that we had already failed and released.
- Under PCI parity error, we were not reinstalling the interrupt handler
  in the slot_reset callback, so we never became functional again.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] lpfc 8.2.6 : Multiple discovery fixes
James Smart [Mon, 7 Apr 2008 14:15:56 +0000 (10:15 -0400)]
[SCSI] lpfc 8.2.6 : Multiple discovery fixes

Multiple Discovery Fixes:
- Fix race on discovery due to link events coinciding with vport_delete.
- Use NLP_FABRIC state to filter out switch-based pseudo initiators that
   reuse the same WWNs.
- Correct erroneous setting of DID=0 in lpfc_matchdid()
- Correct extra reference count that was in the lookup path for the
  remoteid from an unsolicited ELS.
- Correct double-free bug in els abort path.
- Correct FDMI server discovery logic for switch that return a WWN of 0.
- Fix bugs in ndlp mgmt when a node changes address
- Correct bug that did not delete RSCNs for vports upon link transitions
- Fix "0216 Link event during NS query" error which pops up when vports
  are swapped to different switch ports.
- Add sanity checks on ndlp structures
- Fix devloss log message to dump WWN correctly
- Hold off mgmt commands that were interferring with discovery mailbox cmds
- Remove unnecessary FC_ESTABLISH_LINK logic.
- Correct some race conditions in the worker thread, resulting in devloss:
  - Clear the work_port_events field before handling the work port events
  - Clear the deferred ring event before handling a deferred ring event
  - Hold the hba lock when waking up the work thread
  - Send an acc for the rscn even when we aren't going to handle it
- Fix locking behavior that was not properly protecting the ACTIVE flag,
  thus allowing mailbox command order to shift.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Update version number to 8.02.01-k1.
Andrew Vasquez [Thu, 3 Apr 2008 20:13:32 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Update version number to 8.02.01-k1.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Correct vport configuration-change handling.
Seokmann Ju [Thu, 3 Apr 2008 20:13:31 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Correct vport configuration-change handling.

Upon having configuration changes on vports only, the driver
handles SCR regardless physical port state and, in turn, it
results mailbox error as below:

Mar 20 11:24:20 dl585 kernel: qla2x00_mailbox_command(9): **** FAILED.  mbx0=4005, mbx1=1, mbx2=8100, cmd=70 ****

With the changes, driver checks physical port loop_state and make
sure the port is ready to take commands.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Use proper HA during asynchrounous event handling.
Seokmann Ju [Thu, 3 Apr 2008 20:13:30 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Use proper HA during asynchrounous event handling.

Changes are added to the driver so that it can behave properly
upon having asynchronous events, for example, addition of target
devices to the VPs.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Check DFLG_NO_CABLE only on physical port.
Seokmann Ju [Thu, 3 Apr 2008 20:13:29 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Check DFLG_NO_CABLE only on physical port.

As there is no actual cable connection on vports, made change so
that the driver checks DFLG_NO_CABLE against ha->device_flags
only for physical port.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Consistently access the physical HA port.
Seokmann Ju [Thu, 3 Apr 2008 20:13:28 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Consistently access the physical HA port.

There were several places where referencing ha structure of
virtual ports for resources. Among those refereces, certain
fields are get up-to-dated only on ha structure of physical port.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Remove unused member (dma_handle) from srb_t structure.
Andrew Vasquez [Thu, 3 Apr 2008 20:13:27 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Remove unused member (dma_handle) from srb_t structure.

The member is not needed as there's no non-scatter-gather
list I/Os submitted by the upper-layers.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Add ISP84XX support.
Harihara Kadayam [Thu, 3 Apr 2008 20:13:26 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Add ISP84XX support.

Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Additional cleanups and
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Assign mailbox command timeout values in a consistent manner.
Ravi Anand [Thu, 3 Apr 2008 20:13:25 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Assign mailbox command timeout values in a consistent manner.

Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Add midlayer target/device reset support.
Andrew Vasquez [Thu, 3 Apr 2008 20:13:24 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Add midlayer target/device reset support.

Now that infrastructure is present within the midlayer and there
is a clear distinction between what is expected from a device and
target reset, convert the current device-reset codes to a
target-reset, and add codes to perform a proper device-reset (LUN
reset).

In the process of adding reset support, collapse and consolidate
large sections of mailbox-command (TMF issuance) codes,
generalize the two 'wait-for-commands-to-complete' functions, and
add a generic-reset routine for use by midlayer reset functions.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Check alternate 'reason' code during GPSC status handling.
Andrew Vasquez [Thu, 3 Apr 2008 20:13:23 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Check alternate 'reason' code during GPSC status handling.

Some switches return 0x09 (Command not supported) as the reason
code for GPSC failure.  Check for this code, and disable
additional GPSC queries if found.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Add Flash Descriptor Table layout support.
Andrew Vasquez [Thu, 3 Apr 2008 20:13:22 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Add Flash Descriptor Table layout support.

The Flash Descriptor Table (FDT) present on many recent HBAs
encodes flash accessing characteristics of the flash-part used on
the HBA.  Use this information during flash manipulation (writes)
rather than using specific hard-coded values based on queried
manufacturer and device IDs.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Use PCI-SIG nomenclature for PCIe bandwidth units.
Andrew Vasquez [Thu, 3 Apr 2008 20:13:21 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Use PCI-SIG nomenclature for PCIe bandwidth units.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Cruft cleanup of functions and structures.
Andrew Vasquez [Thu, 3 Apr 2008 20:13:20 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Cruft cleanup of functions and structures.

Strip unused (DEBUG-ONLY) enabled functions, inlines, useless
wrappers, and unused DPC flags from the code.  Another step in
the migration towards a cleaner (less-crusty) driver.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Add hardware trace-logging support.
Andrew Vasquez [Thu, 3 Apr 2008 20:13:19 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Add hardware trace-logging support.

Recent ISPs have a region within FLASH which acts as a repository
for the logging of serious hardware and software failures.
Currently, the region is large enough to support up to 255
entries.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Add FC-transport Asynchronous Event Notification support.
Andrew Vasquez [Thu, 3 Apr 2008 20:13:18 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Add FC-transport Asynchronous Event Notification support.

Supported events include LIP, LIP reset, RSCN, link up, and link
down.

To support AEN (and additional forthcoming features), we also
introduce a simple deferred-work construct to manage events which
require a non-atomic sleeping-capable context.  This work-list is
processed as part of the driver's standard DPC routine.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Simplify interrupt handler locking.
Andrew Vasquez [Thu, 3 Apr 2008 20:13:17 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Simplify interrupt handler locking.

There's no need to use the heavier (albiet safer)
*_irq[save|restore]() locking primitives within the driver's
interrupt handlers, interrupts are guaranteed to be
non-reentrant.  Use lightweight spin_lock() and spin_unlock()
primitives while acquiring the hardware_lock.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Use an rport's scsi_target_id member consistently throughout driver.
Andrew Vasquez [Thu, 3 Apr 2008 20:13:16 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Use an rport's scsi_target_id member consistently throughout driver.

Rather than using a duplicate/cached value stored in the driver's
internal fcport structure.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Remove unused and obsolete #define's.
Andrew Vasquez [Thu, 3 Apr 2008 20:13:15 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Remove unused and obsolete #define's.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Add support for host supported speeds FC transport attribute.
Andrew Vasquez [Thu, 3 Apr 2008 20:13:14 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Add support for host supported speeds FC transport attribute.

Use generic FC transport #defines for speed values.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Update copyright banner.
Andrew Vasquez [Thu, 3 Apr 2008 20:13:13 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Update copyright banner.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Update firmware filenames for new ISP parts.
Andrew Vasquez [Thu, 3 Apr 2008 20:13:12 +0000 (13:13 -0700)]
[SCSI] qla2xxx: Update firmware filenames for new ISP parts.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] ips: remove spurious cpu_to_leX on outX statements
James Bottomley [Thu, 3 Apr 2008 17:28:20 +0000 (12:28 -0500)]
[SCSI] ips: remove spurious cpu_to_leX on outX statements

These are completely wrong because both outX and writeX do an
automatic reverse of their arguments if necessary, so having an extra
cpu_to_leX gives us the wrong ordering on BE platforms again.

Acked-by: Mark Salyzyn <Mark_Salyzyn@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] libsas: fix missing inlines in header file
James Bottomley [Thu, 3 Apr 2008 14:04:31 +0000 (09:04 -0500)]
[SCSI] libsas: fix missing inlines in header file

Two functions in include/scsi/sas_ata.h don't have static inlines
leading to problems if they're built in:

On Thu, 2008-04-03 at 14:06 +0200, Toralf Förster wrote:
> drivers/scsi/mvsas.o: In function `sas_ata_init_host_and_port':
> mvsas.c:(.text+0x0): multiple definition of `sas_ata_init_host_and_port'
> drivers/scsi/libsas/built-in.o:(.text+0x37f4): first defined here
> drivers/scsi/mvsas.o: In function `sas_ata_task_abort':
> mvsas.c:(.text+0x7): multiple definition of `sas_ata_task_abort'
> drivers/scsi/libsas/built-in.o:(.text+0x37fb): first defined here
> make[2]: *** [drivers/scsi/built-in.o] Error 1
> make[1]: *** [drivers/scsi] Error 2
> make: *** [drivers] Error 2

Add the correct static inline modifiers.

Tested-by: Toralf Förster <toralf.foerster@gmx.de>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] transport_class: BUG if we can't release the attribute container
James Bottomley [Wed, 2 Apr 2008 15:05:48 +0000 (10:05 -0500)]
[SCSI] transport_class: BUG if we can't release the attribute container

Every current transport class calls transport_container_release but
ignores the return value.  This is catastrophic if it returns an error
because the containers are part of a global list and the next action of
almost every transport class is to free the memory used by the
container.

Fix this by making transport_container_release a void, but making it BUG
if attribute_container_release returns an error ... this catches the
root cause of a system panic much earlier.  If we don't do this, we get
an eventual BUG when the attribute container list notices the corruption
caused by the freed memory it's still referencing.

Also made attribute_container_release __must_check as a reminder.

Cc: Greg KH <greg@kroah.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] fix barrier failure issue
James Bottomley [Wed, 2 Apr 2008 23:11:52 +0000 (18:11 -0500)]
[SCSI] fix barrier failure issue

Currently, if the barrier command fails, the error return isn't seen
by the block layer and it proceeds on regardless.  The problem is that
SCSI always returns no error for REQ_TYPE_BLOCK_PC ... it expects the
submitter to pick the errors out of req->errors, which the block
barrier functions don't do.

Since it appears that the way SG_IO and scsi_execute_request() work
they discard the block error return and always use req->errors, the
best fix for this is to have the SCSI layer return an error to block
if one actually occurred (this also allows us to filter out spurious
errors, like deferred sense).

This patch is a bug fix that will need backporting to stable, but it's
also quite a big change and in need of testing, so we'll incubate in
the main kernel tree and backport at the -rc2 or so stage if no
problems turn up.

Acked-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Add docbook comments to debug trace.
Martin Peschke [Mon, 31 Mar 2008 09:15:31 +0000 (11:15 +0200)]
[SCSI] zfcp: Add docbook comments to debug trace.

Add missing docbook-comments for functions forming zfcp's internal
trace API.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Cleanup line breaks in debug trace.
Martin Peschke [Mon, 31 Mar 2008 09:15:30 +0000 (11:15 +0200)]
[SCSI] zfcp: Cleanup line breaks in debug trace.

Remove line breaks that do not conform to coding style.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Shorten excessive names in debug trace.
Martin Peschke [Mon, 31 Mar 2008 09:15:29 +0000 (11:15 +0200)]
[SCSI] zfcp: Shorten excessive names in debug trace.

Saving on line breaks, improving readability, by shortening excessive
function names and identifiers, by simplifying some functions call
chains, and by simplifying nesting of some data structure.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Move DBF definitions to private header file
Christof Schmitt [Mon, 31 Mar 2008 09:15:28 +0000 (11:15 +0200)]
[SCSI] zfcp: Move DBF definitions to private header file

Unclutter the global zfcp_def.h header. Move everything required to
call into the debug feature to a new header file.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Simplify zfcp_dbf_tag and related functions in debug trace.
Martin Peschke [Mon, 31 Mar 2008 09:15:27 +0000 (11:15 +0200)]
[SCSI] zfcp: Simplify zfcp_dbf_tag and related functions in debug trace.

Simplify usage of zfcp_dbf_tag() and calling functions.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Simplify usage of hex dump output function for debug trace.
Martin Peschke [Mon, 31 Mar 2008 09:15:26 +0000 (11:15 +0200)]
[SCSI] zfcp: Simplify usage of hex dump output function for debug trace.

Simplify usage of output function for hex dumps.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Remove obsolete output function from debug trace.
Martin Peschke [Mon, 31 Mar 2008 09:15:25 +0000 (11:15 +0200)]
[SCSI] zfcp: Remove obsolete output function from debug trace.

Remove obsolete output function.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Cleanup debug trace view functions.
Martin Peschke [Mon, 31 Mar 2008 09:15:24 +0000 (11:15 +0200)]
[SCSI] zfcp: Cleanup debug trace view functions.

Improve readability of code by using more convenient output function.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: simplify zfcp_dbf_timestamp()
Martin Peschke [Mon, 31 Mar 2008 09:15:23 +0000 (11:15 +0200)]
[SCSI] zfcp: simplify zfcp_dbf_timestamp()

Change zfcp_dbf_timestamp() so that it just calculates timespec from
timestamp. First step to be able to rip this code out of zfcp.
Besides, this change makes it easier to rip out old-style debug view
functions.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] aic94xx: cleanups
Adrian Bunk [Fri, 28 Mar 2008 21:48:34 +0000 (14:48 -0700)]
[SCSI] aic94xx: cleanups

- static functions in .c files shouldn't be marked inline
- make needlessly global code static
- remove the unused aic94xx_seq.c:asd_unpause_lseq()
- #if 0 other unused code

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] ch: fix sparse shadowed variable warnings
Harvey Harrison [Tue, 1 Apr 2008 05:05:30 +0000 (22:05 -0700)]
[SCSI] ch: fix sparse shadowed variable warnings

Replace the global err array with ch_err.
drivers/scsi/ch.c:271:6: warning: symbol 'err' shadows an earlier one
drivers/scsi/ch.c:116:3: originally declared here

Replace the temporary cmd buffer with ch_err to avoid shadowing the cmd
function parameter.
drivers/scsi/ch.c:724:11: warning: symbol 'cmd' shadows an earlier one
drivers/scsi/ch.c:596:20: originally declared here

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] make scsi_end_bidi_request() static
Adrian Bunk [Sun, 30 Mar 2008 22:53:55 +0000 (01:53 +0300)]
[SCSI] make scsi_end_bidi_request() static

This patch makes the needlessly global scsi_end_bidi_request() static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] hptiop: fix header.context usage
James Bottomley [Sun, 30 Mar 2008 17:36:26 +0000 (12:36 -0500)]
[SCSI] hptiop: fix header.context usage

header.context is a 64 bit field, but it's deliberately split into
context and context_hi32.  Thus cpu_to_le64 assignments are wrong on
this.  Replace them with the correct settings of both the low and high
words.

Cc: HighPoint Linux Team <linux@highpoint-tech.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] wd33c93: fix up cut and paste error
James Bottomley [Tue, 1 Apr 2008 03:06:50 +0000 (22:06 -0500)]
[SCSI] wd33c93: fix up cut and paste error

The three drivers: a2091, gvp11 and mvme147 have erroneous references
to a3000_host.  Fix these to be references to the proper host
variable.

Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] scsi_debug: remove unnecessary function declarations
FUJITA Tomonori [Sat, 29 Mar 2008 15:59:58 +0000 (00:59 +0900)]
[SCSI] scsi_debug: remove unnecessary function declarations

This patch removes function declarations with moving some
functions. This cleans up them a bit to silence checkpatch.pl. There
is no functional change.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] scsi_debug: support large non-fake virtual disk
FUJITA Tomonori [Sat, 29 Mar 2008 15:59:57 +0000 (00:59 +0900)]
[SCSI] scsi_debug: support large non-fake virtual disk

Currently, the maximum amount of RAM that scsi_debug can allocate is
4GB. This patch increases it to 2TB; scsi_debug can allocates 2TB
memory and export it as if it were 2TB scsi disk.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] scsi_debug: remove the duplicated code in resp_read and resp_write
FUJITA Tomonori [Sat, 29 Mar 2008 15:59:56 +0000 (00:59 +0900)]
[SCSI] scsi_debug: remove the duplicated code in resp_read and resp_write

resp_read and resp_write performs READ_* and WRITE_* commands
respectively. This sweeps up the similar code in them.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] scsi_debug: sweep up sdebug_capacity calculation
FUJITA Tomonori [Sat, 29 Mar 2008 15:59:55 +0000 (00:59 +0900)]
[SCSI] scsi_debug: sweep up sdebug_capacity calculation

sdebug_capacity is calculated at five different places. This add a
helper function to calculate sdebug_capacity to sweep up the
duplicatated code.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] scsi_debug: remove unnecessary sdebug_store_size
FUJITA Tomonori [Sat, 29 Mar 2008 15:59:54 +0000 (00:59 +0900)]
[SCSI] scsi_debug: remove unnecessary sdebug_store_size

sdebug_store_size doesn't need to be static global. It's used at
startup only.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] hosts.c: removed one unneeded shost->active_mode assignment
Denis Cheng [Wed, 19 Mar 2008 19:10:20 +0000 (03:10 +0800)]
[SCSI] hosts.c: removed one unneeded shost->active_mode assignment

In the following if/else statement, shost->active_mode will always be set,
so this assignment is unneeded.

Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] aacraid, ips: leX_add_cpu conversion
Marcin Slusarz [Fri, 28 Mar 2008 21:48:35 +0000 (14:48 -0700)]
[SCSI] aacraid, ips: leX_add_cpu conversion

replace all:
little_endian_variable = cpu_to_leX(leX_to_cpu(little_endian_variable) +
expression_in_cpu_byteorder);
with:
leX_add_cpu(&little_endian_variable, expression_in_cpu_byteorder);
generated with semantic patch

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: "Salyzyn, Mark" <Mark_Salyzyn@adaptec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Remove obsolete erp_dbf trace
Martin Peschke [Thu, 27 Mar 2008 13:22:05 +0000 (14:22 +0100)]
[SCSI] zfcp: Remove obsolete erp_dbf trace

This patch removes the now obsolete erp_dbf trace.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Add trace records for recovery actions.
Martin Peschke [Thu, 27 Mar 2008 13:22:04 +0000 (14:22 +0100)]
[SCSI] zfcp: Add trace records for recovery actions.

This patch writes trace records for various phases of a recovery action:
action being created, action being processed, action continueing
asynchronously, action gone, action timed out, action dismissed etc.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Trace all triggers of error recovery activity
Martin Peschke [Thu, 27 Mar 2008 13:22:03 +0000 (14:22 +0100)]
[SCSI] zfcp: Trace all triggers of error recovery activity

This patch allows any recovery event to be traced back to an exact
cause, e.g. a particular request identified by an id (address).

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Add traces for state changes.
Martin Peschke [Thu, 27 Mar 2008 13:22:02 +0000 (14:22 +0100)]
[SCSI] zfcp: Add traces for state changes.

This patch writes a trace record which provides information about state
changes for adapters, ports and units, e.g. target failure, targets becoming
online, targets being temporarily blocked due to pending recovery, targets
which have been recovered successfully etc.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Add trace records for recovery thread and its queues
Martin Peschke [Thu, 27 Mar 2008 13:22:01 +0000 (14:22 +0100)]
[SCSI] zfcp: Add trace records for recovery thread and its queues

This patch writes trace records which provide information about the
operation of the zfcp error recovery thread and the queues it works
on.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Register new recovery trace.
Martin Peschke [Thu, 27 Mar 2008 13:22:00 +0000 (14:22 +0100)]
[SCSI] zfcp: Register new recovery trace.

This patch registers the new recovery trace with the s390 debug
feature.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Introduce printf helper functions for debug trace.
Martin Peschke [Thu, 27 Mar 2008 13:21:59 +0000 (14:21 +0100)]
[SCSI] zfcp: Introduce printf helper functions for debug trace.

Introducing helper functions that allow for code simpfifications.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Add qtcb dump to hba debug trace
Martin Peschke [Thu, 27 Mar 2008 13:21:58 +0000 (14:21 +0100)]
[SCSI] zfcp: Add qtcb dump to hba debug trace

This patch adds per request hardware debugging data to the trace
record which is written per request. It's a replacement for some sad
kernel message based debugging code. Considering the amount of trace
data, printk() is not suitable for this stuff. Writing binary traces
is more efficient. In addition we got all information in one place.

The QTCB trace data is only dumped for requests other than SCSI
requests.  Otherwise we would flood the trace ring buffer. We are
mostly interested in non-SCSI, recovery related requests here anyway.

This patch also works around a known hardware bug. It truncates QTCB
traces so that we do not save unused areas of the hardware trace.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Remove qtcb dump to kernel log
Martin Peschke [Thu, 27 Mar 2008 13:21:57 +0000 (14:21 +0100)]
[SCSI] zfcp: Remove qtcb dump to kernel log

Is not appropriate to printk() tons of hardware trace data.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Clean up _zfcp_san_dbf_event_common_els
Martin Peschke [Thu, 27 Mar 2008 13:21:56 +0000 (14:21 +0100)]
[SCSI] zfcp: Clean up _zfcp_san_dbf_event_common_els

Clean up _zfcp_san_dbf_event_common_els using zfcp_dbf_hexdump()
helper.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Introduce a helper function that dumps hex data to a zfcp trace.
Martin Peschke [Thu, 27 Mar 2008 13:21:55 +0000 (14:21 +0100)]
[SCSI] zfcp: Introduce a helper function that dumps hex data to a zfcp trace.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] scsi_debug: fix lba and data length calculation bugs
FUJITA Tomonori [Tue, 25 Mar 2008 08:04:46 +0000 (17:04 +0900)]
[SCSI] scsi_debug: fix lba and data length calculation bugs

For example, `modprobe scsi_debug virtual_gb=1100` gives:

scsi7 : scsi_debug, version 1.81 [20070104], dev_size_mb=8, opts=0x0
scsi 7:0:0:0: Direct-Access     Linux    scsi_debug       0004 PQ: 0 ANSI: 5
sd 7:0:0:0: [sdc] 2306867200 512-byte hardware sectors (1181116 MB)
sd 7:0:0:0: [sdc] Write Protect is off
sd 7:0:0:0: [sdc] Mode Sense: 73 00 10 08
sd 7:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA
sd 7:0:0:0: [sdc] 2306867200 512-byte hardware sectors (1181116 MB)
sd 7:0:0:0: [sdc] Write Protect is off
sd 7:0:0:0: [sdc] Mode Sense: 73 00 10 08
sd 7:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA
 sdc: unknown partition table
sd 7:0:0:0: [sdc] Attached SCSI disk
sd 7:0:0:0: Attached scsi generic sg6 type 0
end_request: I/O error, dev sdc, sector 2306867072
Buffer I/O error on device sdc, logical block 288358384
end_request: I/O error, dev sdc, sector 2306867072
Buffer I/O error on device sdc, logical block 288358384
end_request: I/O error, dev sdc, sector 2306867192

(snip)

Note that this converts all the calculations (including the correct
calculations) for unification.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] mpt fusion: fix up msi_enable in mpt_suspend
James Bottomley [Sun, 30 Mar 2008 16:38:07 +0000 (11:38 -0500)]
[SCSI] mpt fusion: fix up msi_enable in mpt_suspend

There's a problem with the combination of the upstream power
management fixes and the enabling of MSI by default in that the
suspend path still uses the global variable.  Convert it to check
ioc->msi_enable.

Cc: "Moore, Eric" <Eric.Moore@lsi.com>
Cc: "Prakash, Sathya" <sathya.prakash@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] ps3rom: use scsi_build_sense_buffer
FUJITA Tomonori [Tue, 25 Mar 2008 00:26:53 +0000 (09:26 +0900)]
[SCSI] ps3rom: use scsi_build_sense_buffer

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] stex: use scsi_build_sense_buffer
FUJITA Tomonori [Tue, 25 Mar 2008 00:26:52 +0000 (09:26 +0900)]
[SCSI] stex: use scsi_build_sense_buffer

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] libata: use scsi_build_sense_buffer
FUJITA Tomonori [Tue, 25 Mar 2008 00:26:51 +0000 (09:26 +0900)]
[SCSI] libata: use scsi_build_sense_buffer

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] scsi_debug: use scsi_build_sense_buffer
FUJITA Tomonori [Tue, 25 Mar 2008 00:26:50 +0000 (09:26 +0900)]
[SCSI] scsi_debug: use scsi_build_sense_buffer

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] add scsi_build_sense_buffer helper function
FUJITA Tomonori [Tue, 25 Mar 2008 00:26:49 +0000 (09:26 +0900)]
[SCSI] add scsi_build_sense_buffer helper function

This adds scsi_build_sense_buffer, a simple helper function to build
sense data in a buffer.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] WD33C93: let platform stub override no_sync/fast/dma_mode
Thomas Bogendoerfer [Fri, 21 Mar 2008 21:25:43 +0000 (22:25 +0100)]
[SCSI] WD33C93: let platform stub override no_sync/fast/dma_mode

SGI machines with WD33C93 allow usage of burst mode DMA, which increases
performance noticable. To make this selectable by the sgiwd93 stub,
setting the values for no_sync, fast and dma_mode has been moved to the
individual platform stubs.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] mptsas: do not use ioc->handle to locate hba portinfo structure
Michael Reed [Thu, 20 Mar 2008 22:32:05 +0000 (17:32 -0500)]
[SCSI] mptsas: do not use ioc->handle to locate hba portinfo structure

While performing hardware raid reset testing via the raid's client, I
noticed that sometimes, following the reset, that there would be more
raid targets in the lsscsi output than there actually were raid
targets.  I tracked this down to the following issue.

Fusion cannot always find the mptsas_portinfo structure for the hba
because it uses the handle stored in ioc->handle to locate it.  The
problem is that the firmware can change the handle associated with the
hba when h/w raid is reset (via the raid client).  When this happens,
the driver will allocate another mptsas_portinfo structure and link it
into the chain of said structures.  This ultimately causes confusion
within the driver resulting in targets not being removed when they
should be.

Eric Moore pointed out that the hba's portinfo structure is always the
first structure on the sas_topology list.  This patch modifies
mptsas.c to access the hba's portinfo structure by taking the first
structure on said list.

Signed-off-by: Michael Reed <mdr@sgi.com>
Acked-by: "Moore, Eric" <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla4xxx: fix scsi command completion, lun reset and target reset code
David C Somayajulu [Wed, 19 Mar 2008 18:23:03 +0000 (11:23 -0700)]
[SCSI] qla4xxx: fix scsi command completion, lun reset and target reset code

This patch contains the following:

1. when hba completion status is good, check for iscsi transport
   errors (underflow/overflow) prior to checking the scsi status

2. New firmware requires that one marker iocb be issued for each task
   management command. The patch issues marker iocb immediately
   following a LUN or Target reset.

Signed-off-by: David C Somayajulu <david.somayajulu@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] megaraid_sas: Add the new controller(1078DE) support to the driver
bo yang [Mon, 17 Mar 2008 08:13:07 +0000 (04:13 -0400)]
[SCSI] megaraid_sas: Add the new controller(1078DE) support to the driver

Add the new Controller (ID: 007C) support to driver.

Signed-off-by Bo Yang<bo.yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] megaraid_sas: Fix the frame count calculation
bo yang [Mon, 17 Mar 2008 07:36:43 +0000 (03:36 -0400)]
[SCSI] megaraid_sas: Fix the frame count calculation

When Driver sent wrong frame count to firmware.  As this particular
command is sent to drive, FW is seeing continuous chip resets and so
the command will timeout.

Signed-off-by Bo Yang<bo.yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] megaraid_sas: rollback the sense info implementation
bo yang [Tue, 18 Mar 2008 07:13:06 +0000 (03:13 -0400)]
[SCSI] megaraid_sas: rollback the sense info implementation

Sense buffer ptr data type in the ioctl path is reverted back to u32 *
as in previous versions of driver.

Signed-off-by Bo Yang<bo.yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] 3w-9xxx, 3w-xxxx: memset not needed in probe
Denis Cheng [Tue, 4 Mar 2008 23:24:23 +0000 (15:24 -0800)]
[SCSI] 3w-9xxx, 3w-xxxx: memset not needed in probe

The memory return from scsi_host_alloc is alloced by kzalloc, which is
already zero initilized, so memset not needed.

Signed-off-by: Denis Cheng <crquan@gmail.com>
Cc: Adam Radford <linuxraid@amcc.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] aic7xxx: Test opcode, not definition in aicasm:type_check()
Roel Kluin [Mon, 28 Jan 2008 13:09:54 +0000 (14:09 +0100)]
[SCSI] aic7xxx: Test opcode, not definition in aicasm:type_check()

This fixes a bug that we treat all sequencer operations as ands and
never do the additional invalid bit checks non-and operations require
because the if () to determine this has an operand which is always
true at the end of the or statement.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Acked-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] scsi_debug: remove unnecessary function declarations
FUJITA Tomonori [Thu, 20 Mar 2008 02:09:19 +0000 (11:09 +0900)]
[SCSI] scsi_debug: remove unnecessary function declarations

This patch removes lots of function declarations with moving
scsi_debug_queuecommand. This cleans up scsi_debug_queuecommand a bit
to silence checkpatch.pl

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] scsi_debug: use list_for_each_entry_safe
FUJITA Tomonori [Thu, 20 Mar 2008 02:09:18 +0000 (11:09 +0900)]
[SCSI] scsi_debug: use list_for_each_entry_safe

This replaces list_for_each_safe and list_entry with
list_for_each_entry_safe.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] scsi_debug: remove unnecessary condition test in devInfoReg
FUJITA Tomonori [Thu, 20 Mar 2008 02:09:17 +0000 (11:09 +0900)]
[SCSI] scsi_debug: remove unnecessary condition test in devInfoReg

open_devip is always non NULL.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] scsi_debug: create new scsi_debug devices at a single place
FUJITA Tomonori [Thu, 20 Mar 2008 02:09:16 +0000 (11:09 +0900)]
[SCSI] scsi_debug: create new scsi_debug devices at a single place

Two functions, sdebug_add_adapter and devInfoReg, creates new
scsi_debug devices. To simplify the code, this patch adds a new helper
function to create new scsi_debug devices (sdebug_device_create) and
converts both functions to use it.

I plan to add more to scsi_debug devices (e.g. using a thread for a
scsi_debug device for scalability testings). This patch enable me to
add such to just the new helper function instead of touching two
functions, sdebug_add_adapter and devInfoReg.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] scsi_debug: remove temporary hack around sscanf for negative values
FUJITA Tomonori [Thu, 20 Mar 2008 02:09:15 +0000 (11:09 +0900)]
[SCSI] scsi_debug: remove temporary hack around sscanf for negative values

sscanf can handle negative values.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] export command allocation and freeing functions independently of the host
James Bottomley [Thu, 13 Mar 2008 16:19:36 +0000 (11:19 -0500)]
[SCSI] export command allocation and freeing functions independently of the host

This is needed by things like USB storage that want to set up static
commands for later use at start of day.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>