Commit Graph

1608 Commits (eae07ac607f317ee6781983d3f9d8f77ef144b45)

Author SHA1 Message Date
Adrian Bunk 8800727ae8 [SCSI] NCR_D700: fix a NULL dereference
The Coverity checker spotted this NULL dereference.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:45:43 -06:00
Matthew Wilcox 72df0ebf95 [SCSI] Missing names from SPI3, SPI4 and SPI5
Add several missing messages from SPI3, SPI4 and SPI5:
 - Terminate Process
 - Continue Task
 - Target Transfer Disable
 - Clear ACA
 - LUN Reset
 - ACA
 - QAS Request
Rename some older commands to their SPI5 names:
 - Command Complete -> Task Complete
 - Abort -> Abort Task Set
 - Bus device Reset -> Target Reset
 - Clear Queue -> Clear Task Set

Change spi_print_msg() to always consume one byte, even if we don't
recognise it.  That allows drivers to call it in a loop to print all
messages.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:44:46 -06:00
Andrew Vasquez 1757b67809 [SCSI] qla2xxx: Firmware updates.
Resync with latest 23xx firmware -- 3.03.20.
Resync with latest 24xx firmware -- 4.00.18.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:44:17 -06:00
Andrew Vasquez d584486a1c [SCSI] qla2xxx: Remove legacy ISP6312 firmware loader.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:42:33 -06:00
andrew.vasquez@qlogic.com 9a52a57cb9 [SCSI] qla2xxx: Correct FCAL login retry logic for ISP24xx.
ISP24XX FW does not support Mbx 0x74 ie Login Local Port.
Added the equivalent code for ISP24XX ie to relogin in non
fabric case for ISP24XX use login iocb.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:40:37 -06:00
andrew.vasquez@qlogic.com 4a59f71d7f [SCSI] qla2xxx: Further restrict ZIO mode support.
Only support ZIO mode 6 on specific ISP types.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:40:13 -06:00
andrew.vasquez@qlogic.com 6f6417905c [SCSI] qla2xxx: Add VPD sysfs attribute.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:39:55 -06:00
andrew.vasquez@qlogic.com fdbc6833c5 [SCSI] qla2xxx: Correct swing/emphasis settings on ISP24xx.
Reserved-bit 15 must set when updating the swing/emphasis values.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:39:36 -06:00
andrew.vasquez@qlogic.com 1328962eb4 [SCSI] qla2xxx: NVRAM id-list updates.
Resync with latest NVRAM subsystem ID list.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:38:42 -06:00
andrew.vasquez@qlogic.com 48c02fde94 [SCSI] qla2xxx: Consolidate ISP63xx handling.
As new 23xx firmware will accomidate ISP63xx types.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:38:22 -06:00
andrew.vasquez@qlogic.com 044cc6c8ec [SCSI] qla2xxx: Add ISP54xx support.
Chip is similar in form to our ISP24xx offering.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:38:03 -06:00
andrew.vasquez@qlogic.com ea5b6382fd [SCSI] qla2xxx: Convert IS_QLA*() defines to bit-operations.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:37:24 -06:00
Dave Jones 93f5608989 [SCSI] fix two leaks in scsi_alloc_sdev failure paths
If the scsi_alloc_queue or the slave_alloc calls in scsi_alloc_device fail,
we forget to release the locally allocated sdev on the failure path.

Coverity #609

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:25:40 -06:00
Ralf Baechle a0b6b6e530 [SCSI] Make sgiwd93_detect and sgiwd93_detect static.
Nothing outside sgiwd93.c references them.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:24:55 -06:00
Alexey Dobriyan 5c1b85e209 [SCSI] drivers/scsi/FlashPoint.c: don't use parenthesis with "return"
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:18:47 -06:00
Alexey Dobriyan 5c04a7b898 [SCSI] drivers/scsi/FlashPoint.c: Lindent
It's much, much more readable now.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:18:15 -06:00
Alexey Dobriyan 13e6851aa1 [SCSI] drivers/scsi/FlashPoint.c: untypedef struct SCCBcard
* struct SCCBcard => struct sccb_card
* PSCCBcard => struct sccb_card *
* SCCBCARD => struct sccb_card

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:17:01 -06:00
Alexey Dobriyan 68d0c1ae66 [SCSI] drivers/scsi/FlashPoint.c: untypedef struct NVRAMInfo
* struct NVRAMInfo => struct nvram_info
* PNVRamInfo => struct nvram_info *
* NVRAMINFO => struct nvram_info

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:16:47 -06:00
Alexey Dobriyan f31dc0cde6 [SCSI] drivers/scsi/FlashPoint.c: untypedef struct SCCBMgr_tar_info
* struct SCCBMgr_tar_info => struct sccb_mgr_tar_info
* PSCCBMgr_tar_info => struct sccb_mgr_tar_info *
* SCCBMGR_TAR_INFO => struct sccb_mgr_tar_info

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:16:25 -06:00
Alexey Dobriyan 7f101662dd [SCSI] drivers/scsi/FlashPoint.c: untypedef struct SCCBMgr_info
* struct SCCBMgr_info => struct sccb_mgr_info
* PSCCBMGR_INFO => struct sccb_mgr_info *
* SCCBMGR_INFO => struct sccb_mgr_info

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:16:09 -06:00
Alexey Dobriyan 69eb2ea477 [SCSI] drivers/scsi/FlashPoint.c: untypedef struct _SCCB
* struct _SCCB => struct sccb
* PSCCB => struct sccb *
* SCCB => struct sccb

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:15:44 -06:00
Alexey Dobriyan ad0e1d9f01 [SCSI] drivers/scsi/FlashPoint.c: use standard fixed size types
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:15:21 -06:00
Alexey Dobriyan fd1e29ed62 [SCSI] drivers/scsi/FlashPoint.c: remove ushort_ptr
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:15:00 -06:00
Alexey Dobriyan d63a4cccf3 [SCSI] drivers/scsi/FlashPoint.c: remove ULONG
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:14:40 -06:00
Alexey Dobriyan ce793215b4 [SCSI] drivers/scsi/FlashPoint.c: remove UINT
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:14:15 -06:00
Alexey Dobriyan c823feeb33 [SCSI] drivers/scsi/FlashPoint.c: remove USHORT
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:13:20 -06:00
Alexey Dobriyan db038cf86f [SCSI] drivers/scsi/FlashPoint.c: remove UCHAR
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:13:00 -06:00
Alexey Dobriyan d8b6b8bd8a [SCSI] drivers/scsi/FlashPoint.c: remove trivial wrappers
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:12:32 -06:00
Alexey Dobriyan 85ae97d816 [SCSI] drivers/scsi/FlashPoint.c: remove unused things
* Remove unused #define's
* Remove unused typedefs.
* Remove prototypes for non-existing functions.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:12:11 -06:00
Rene Herman f018fa552c [SCSI] MODULE_ALIAS_{BLOCK,CHAR}DEV_MAJOR for drivers/scsi
Add device-major aliases in drivers/scsi, allowing kmod autoload:

MODULE_ALIAS_CHARDEV_MAJOR(SCSI_CHANGER_MAJOR)
MODULE_ALIAS_CHARDEV_MAJOR(OSST_MAJOR)
MODULE_ALIAS_CHARDEV_MAJOR(SCSI_TAPE_MAJOR)
MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_CDROM_MAJOR)
MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISKN_MAJOR)

Signed-off-by: Andrew Morton <akpm@osdl.org>
Acked-by: Kai Makisara <kai.makisara@kolumbus.fi>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:11:16 -06:00
Hannes Reinecke 76744f429a [SCSI] aic79xx: Avoid renegotiation on inquiry
Because of some quirk in the SCSI spec the aic79xx driver chose to
force a renegotiation when sending an inquiry. This should better
be handled by the upper layers if required at all.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:06:57 -06:00
Hannes Reinecke 986a25f96a [SCSI] aic79xx: use BIOS settings
This patch fixes the aic79xx driver to properly respond to BIOS
settings.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:06:28 -06:00
Hannes Reinecke 9e691dfba5 [SCSI] aic79xx: Invalid Sequencer interrupt occured
On certain systems the driver seems to hit upon some
"scsi0: Invalid Sequencer interrupt occurred." problem and dumps card state.
According to Adaptec engineers this message is harmless. So as not to
confuse user we can as well disable the internal card state dump and
just print out the message itself.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:06:00 -06:00
Hannes Reinecke 6902f41610 [SCSI] aic79xx: Update error recovery
This patch updates the error recovery. Routines for TARGET RESET
and ABORT COMMAND are split up as the logic is quite dissimilar.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:05:18 -06:00
Hannes Reinecke 1ede5f9fe5 [SCSI] aic79xx: Remove dead code
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:02:36 -06:00
Hannes Reinecke 0aa800db8f [SCSI] aic79xx: use tcq functions
This patch converts aic79xx to use the midlayer-supplied tcq
functions.

We also set the queuedepth to '1' if tcq is disabled; the
aic79xx driver gets confused otherwise. Will set it back to
'2' once I figure out how to queue requests in the driver.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:01:53 -06:00
Hannes Reinecke 7b22da38b6 [SCSI] aic79xx: remove qfrozen
This patch removes the need for platform_data->qfrozen.
We're now using complete() instead of semaphores thus
simplifying ahd_freeze_simq() quite a lot.
This also fixes some deadlocks in the recovery code (again).

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 09:01:13 -06:00
James Smart a382dd7c13 [SCSI] lpfc 8.1.4 : Change version number to 8.1.4
Change version number to 8.1.4

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 08:57:29 -06:00
James Smart fc6c12bcc1 [SCSI] lpfc 8.1.4 : Two misc fixes
Two misc fixes:
 - Fix deadlock caused by return with host_lock held in lpfc_findnode_did
 - Initialize all fields of the allocated mail box structure to zero.
   Was causing some sysfs mailbox commands to fail immediately after load.

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 08:57:13 -06:00
James Smart 9290831f00 [SCSI] lpfc 8.1.4 : Introduce lpfc_reset_barrier() function for resets on dual channel adapters
Introduce lpfc_reset_barrier() function for resets on dual channel adapters

Workaround for a hardware errata on dual channel asics. There is a
potential for the chip to lock up on a reset if a shared dma engine is in
use. The (ugly) work around requires a reset process which uses a mailbox
command to synchronize the independent channels prior to the reset to
avoid the issue. Unfortunately, the timing windows required to ensure this
workaround succeeds are very specific, meaning we can't release the cpu
during the barrier.

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 08:56:58 -06:00
James Smart 1a169689c2 [SCSI] lpfc 8.1.4 : Fixed a timer panic due to timer firing after freeing ndlp
Fixed a timer panic due to timer firing after freeing ndlp

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 08:56:38 -06:00
James Smart fdcebe282f [SCSI] lpfc 8.1.4 : Fixed RSCN handling when a PLOGI is in retry
Fixed RSCN handling when a PLOGI is in retry.

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 08:56:13 -06:00
James Smart 488d1469b3 [SCSI] lpfc 8.1.4 : Fix Discovery processing for NPorts that change their NPortId on the fly
Fix Discovery processing for NPorts that change their NPortId on the fly
due to a cable swap.

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 08:54:29 -06:00
Ralf Baechle cf7f5b45fe [SCSI] wd33c93: Fix missing prototypes by including <linux/interrupt.h>.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-12 08:48:26 -06:00
Tejun Heo 4b10e55927 [PATCH] ahci: enable prefetching for PACKET commands
Turn on AHCI_CMD_PREFETCH for PACKET commands.  This hints the
controller that it can prefetch the CDB and the PRD entries.  This
patch is originally from Jeff Garzik.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-11 21:48:53 -05:00
Jeff Garzik 418dc1f5a8 libata: turn on ATAPI by default 2006-03-11 20:50:08 -05:00
Tejun Heo 8645984c35 [PATCH] sata_sil24: lengthen softreset timeout
sil24 softreset timeout was > 100ms (100 loops with msleep(1)), which
turned out to be too short for some devices (ASI ARAID99 2000).  This
patch converts sil24 softreset waiting loop to use proper timeout
condition and lengthen the timeout to ATA_TMOUT_BOOT secs and check
interval to 100ms.  Chisato Yamauchi discovered the problem and
supplied initial patch.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Chisato Yamauchi <cyamauch@plamo.linet.gr.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-11 19:29:42 -05:00
Tejun Heo 10d996ad19 [PATCH] sata_sil24: exit early from softreset if SStatus reports no device
sata_sil24 softreset routine used to check sata_dev_present() after
SRST is complete in the hope that SRST may do some good even when
SStatus reports no device.  This is okay as long as SRST timeout is
short (> 100ms in the current code) but it seems that not all SATA
devices are happy with short SRST timeout.

This patch makes softreset exit early without performing actual SRST
if SStatus reports no device in preparation for lengthening SRST
timeout.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-11 19:29:42 -05:00
Jeff Garzik 75deb6fa98 Merge branch 'upstream-fixes' 2006-03-11 19:10:06 -05:00
Tejun Heo 6971ed1fbb [PATCH] ahci: fix NULL pointer dereference detected by Coverity
Fix NULL pointer dereference detected by the Coverity checker.  Kill
dev -> pdev -> dev conversion while at it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-11 19:06:02 -05:00
Tejun Heo 2061a47a9b [PATCH] libata: fix missing classes[] initialization in ata_bus_probe()
ata_bus_probe() didn't initialize classes[] properly with
ATA_DEV_UNKNOWN.  As ->probe_reset() is allowed to leave @classes
alone when no device is present, this results in garbage class values.
ATM, the only affected driver is ata_piix.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-11 19:04:49 -05:00
Tejun Heo 75f554bc13 [PATCH] libata: kill unused xfer_mode functions
Preceding xfer_mask changes make the following functions unused.

  ata_pio_modes(), base_from_shift(), ata_pr_blacklisted(), fgb()

Kill them.  Also, as xfer_mode_str[] is now only used by
ata_mode_string(), move it into the function.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-11 19:03:39 -05:00
Tejun Heo a6d5a51cf1 [PATCH] libata: reimplement ata_set_mode() using xfer_mask helpers
Use xfer_mask helpers to determine transfer mode.  This rewrite also
makes transfer mode determination done before any actual
configuration.  This patch doesn't result in any functional changes.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-11 19:03:39 -05:00
Tejun Heo 23e71c3d3e [PATCH] libata: use xfer_mask helpers in ata_dev_set_mode()
Rewrite hardcoded xfer_mode string determination in ata_dev_set_mode()
using xfer_mask helpers.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-11 19:03:39 -05:00
Tejun Heo ff8854b271 [PATCH] libata: use ata_id_xfermask() in ata_dev_configure()
Replace quick & dirty max transfer mode determination in
ata_dev_configure() with ata_id_xfermask().  While at it, rename
xfer_modes variable to xfer_mask and make it unsigned int for
consistency.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-11 19:03:39 -05:00
Tejun Heo cb95d562e4 [PATCH] libata: add xfer_mask handling functions
Add ata_pack_xfermask(), ata_xfer_mask2mode(), ata_xfer_mode2mask(),
ata_xfer_mode2shift() and ata_id_xfermask().  These functions will be
used by following patches to simplify xfer_mask handling.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-11 19:03:39 -05:00
Tejun Heo 1da7b0d01b [PATCH] libata: improve xfer mask constants and update ata_mode_string()
Add ATA_BITS_*, ATA_MASK_* macros and reorder xfer_mask fields such
that higher transfer mode is placed at higher order bit.  As thie
reordering breaks ata_mode_string(), this patch also rewrites
ata_mode_string().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-11 19:03:38 -05:00
Tejun Heo 2e755f68ee [PATCH] libata: rename ATA_FLAG_FLUSH_PIO_TASK to ATA_FLAG_FLUSH_PORT_TASK
Rename ATA_FLAG_FLUSH_PIO_TASK to ATA_FLAG_FLUSH_PORT_TASK.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-11 17:57:21 -05:00
Tejun Heo 507ceda003 [PATCH] libata: kill unused pio_task and packet_task
Kill unused pio_task and packet_task.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-11 17:57:20 -05:00
Tejun Heo 8061f5f0a0 [PATCH] libata: convert pio_task and packet_task to port_task
Make pio_task and atapi_packet_task use port_task.
atapi_packet_task() is moved upward such that it's right after
ata_pio_task().  This position is more natural and makes adding
prototype for ata_qc_issue_prot() unnecessary.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-11 17:57:20 -05:00
Tejun Heo 86e45b6bd6 [PATCH] libata: implement port_task
Implement port_task.  LLDD's can schedule a function to be executed
with context after specified delay.  libata core takes care of
synchronization against EH.  This is generalized form of pio_task and
packet_task which are tied to PIO hsm implementation.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-11 17:57:20 -05:00
Jeff Garzik d7fc3ca1cd Merge branch 'master' 2006-03-11 17:47:20 -05:00
James Bottomley db82f8410e [SCSI] add missing transport_container_unregister in sas class
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-09 22:06:36 -05:00
Andreas Herrmann ad139a2f56 [SCSI] scsi_transport_fc: fix FC_HOST_NUM_ATTRS
In the past I added an host attribute but unfortunately
I forgot to increase FC_HOST_NUM_ATTRS.
This is fixed with the patch. Otherwise an fibre channel
lld might run into
      BUG_ON(count > FC_HOST_NUM_ATTRS);
in fc_attach_transport().

Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-09 11:00:59 -05:00
James Bottomley e12f0a3dec [SCSI] sr: partial revert of 24669f75a3
The patch

[SCSI] SCSI core kmalloc2kzalloc

Has an incorrect piece in sr_ioctl.c; it changes buffer from kmalloc
to kzalloc, but then removes the clearing of the stack variable struct
packet_command.  This, in turn leaves rubbish in the sense pointer
which the sr_do_ioctl() command then happily writes to ... oops.

Thanks to Mike Christie <michaelc@cs.wisc.edu> for spotting this.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-07 14:53:40 -06:00
Willem Riede 5e6575c051 [SCSI] osst: changes required to move forward to block request
On 02/07/2006 04:12:55 AM, Christoph Hellwig wrote:
> On Mon, Feb 06, 2006 at 08:02:21PM -0500, Willem Riede wrote:
>
> > But I will certainly help retire scsi_request. And anything else that is
> > needed to keep up with proper kernel style. Let me know what those are, if
> > you  would? I'll start looking at how st has changed, and will be back with
> > any  questions I may have.
>
> right now the above is the most urgent bit.  What would be nice but not
> required is a conversion to the sense handling helpers, similar to what
> st got (aka using the *normalize_sense functions and then dealing with the
> parsed sense buffer instead of the raw sense data)

Ok, so here is my first take at satisfying this request.
Be warned, that beyond compiling, and checking that the new module
doesn't immediately blow up, there hasn't yet been a lot of testing.

But this should allow you to comment on the changes, and move forward
with dropping scsi_request from the kernel code.

Signed-off-by: Willem Riede <osst@riede.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-07 09:16:01 -06:00
Linus Torvalds f716d83033 Allocate 96 bytes for SCSI sense data reply
The SCSI layer uses SCSI_SENSE_BUFFERSIZE (96) for the sense buffer
size, even though some other code uses "sizeof(struct request_sense)"
(which is 64 bytes).  Allocate the buffer using the bigger of the two
for safety.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-06 17:41:44 -08:00
James Bottomley 286fc8f8ea [SCSI] lpfc: minor syntax fixes
Stop gcc complaining about undefined variables

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-06 10:20:56 -06:00
Jamie Wellnitz b2e977ca36 [PATCH] lpfc 8.1.3: Change version number to 8.1.3
Change version number to 8.1.3

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-06 09:48:02 -06:00
Jamie Wellnitz b808608bd7 [PATCH] lpfc 8.1.3: Fix polling mode panic
Fix polling mode panic

Cause: Race between interrupt driven and polling path in harvesting iocbs
from
the response ring.

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-06 09:47:46 -06:00
Jamie Wellnitz 66a9ed6600 [PATCH] lpfc 8.1.3: Protect NPL lists with host lock
Protect NPL lists with host lock

Symptoms: lpfc_findnode_rpi and lpfc_findnode_did can be called
outside of the discovery thread context. We have to iterate
through the NPL lists under the host lock and all add/del
operations on those lists have to be done under host lock.

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-06 09:47:31 -06:00
Jamie Wellnitz 5fe9f51193 [PATCH] lpfc 8.1.3: Fix deadlock in lpfc_fdmi_tmo_handler
Fix deadlock in lpfc_fdmi_tmo_handler

lpfc_fdmi_tmo_handler was calling lpfc_fdmi_cmd with the host_lock
held.  lpfc_fdmi_cmd assumes the host_lock is released as it calls functions
that acquire the host_lock.  lpfc_fdmi_tmo_handler acquired the host_lock to
protect access to work_hba_events.  This was already checked in the worker
thread so we can remove that code completely and remove access to the
host_lock.

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-06 09:47:14 -06:00
Jamie Wellnitz cf5bf97e1d [PATCH] lpfc 8.1.3: Fix performance when using multiple SLI rings
Fix performance when using multiple SLI rings

Currently the driver allocates all of its SLI command and response ring
entries to one primary ring. Other rings get little, or no, resources.

Allow more resources to be given to ring 1

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-06 09:46:57 -06:00
Jamie Wellnitz 56178645c2 [PATCH] lpfc 8.1.3: Remove unused MBhostaddr from lpfc_sli structure
Remove unused MBhostaddr from lpfc_sli structure

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-06 09:46:34 -06:00
Jamie Wellnitz 719396b48c [PATCH] lpfc 8.1.3: PCI hrd_type should be obtained with pci_read_config_byte() macro
PCI hrd_type should be obtained with pci_read_config_byte() macro

Driver keys off of this field to report the proper adapter type.
The pci subsystem explicitly clears the multiport bit in the copy of
the field given the driver. Thus, to properly name the card, obtain it
from config space.

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-06 09:46:10 -06:00
Jamie Wellnitz 74b72a59b8 [PATCH] lpfc 8.1.3: Derive supported speeds from LMT field in the READ_CONFIG
Derive supported speeds from LMT field in the READ_CONFIG

Driver was keying off internal cores. Use what the firmware reports instead.

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-06 09:45:43 -06:00
James Bottomley 42ab03609c [PATCH] convert aic94xx over to using the sas transport end device
Begin introducing the concept of sas remote devices that have an rphy
embedded.  The first one (this) is a simple end device.  All that an
end device really does is have port mode page parameters contained.
The next and more complex piece will be expander remote devices.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-06 09:43:17 -06:00
Tejun Heo fbfda6e71b [PATCH] sata_sil24: fix mwdma_mask setting
mwdma_mask was not copied from port_info to probe_ent.  Fix it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-05 11:11:32 -05:00
Tejun Heo 48a8a14ff1 [PATCH] libata: revalidate after transfer mode configuration
Revalidate device after transfer mode configuration.  This also makes
dev->id up-to-date.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-05 11:09:42 -05:00
Tejun Heo 623a3128aa [PATCH] libata: implement ata_dev_revalidate()
ata_dev_revalidate() re-reads IDENTIFY PAGE of the given device and
makes sure it's the same device as the configured one.  Once it's
verified that it's the same device, @dev is configured according to
newly read IDENTIFY PAGE.  Note that revalidation currently doesn't
invoke transfer mode reconfiguration.

Criteria for 'same device'

* same class (of course)
* same model string
* same serial string
* if ATA, same n_sectors (to catch geometry parameter changes)

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-05 11:09:42 -05:00
Tejun Heo 4c2d721ab6 [PATCH] libata: add @print_info argument to ata_dev_configure()
Add @print_info argument to ata_dev_configure().  Details of
configured device is printed only when @pinfo_info is non-zero.  This
patch also reorganizes device info printing for LBA case to simplify
code (necessary as @print_info adds extra nesting around it).

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-05 11:09:42 -05:00
Tejun Heo 208a9933bc [PATCH] libata: re-initialize parameters before configuring
In ata_dev_configure(), reinitialize parameters before configuring.
This change is for revalidation and hotplug.  As ata_dev_configure()
can be entered multiple times, parameters need to be reinitialized.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-05 11:09:42 -05:00
Dominik Brodowski cdaeedae98 [SCSI] scsi: aha152x pcmcia driver needs spi transport
AHA152X PCMCIA module needs spi_print_msg.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-05 08:00:47 -06:00
Tejun Heo e653a1e613 [PATCH] sata_sil: cosmetic flag/constant changes
Collect common host flags into SIL_DFL_HOST_FLAGS and add comments to
constants.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-05 02:39:55 -05:00
Tejun Heo 48d4ef2a1d [PATCH] sata_sil: replace register address constants with sil_port[] entry
Kill SIL_FIFO_* and SIL_IDE2_BMDMA and replace them with proper
sil_port[] entry.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-05 02:39:55 -05:00
Tejun Heo 9a5314432a [PATCH] sata_sil: use kzalloc
Use kzalloc instead of kmalloc/memset.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-05 02:39:55 -05:00
Tejun Heo 81c2af3561 [PATCH] sata_sil: replace sil_3112_m15w board id with sil_3112
All 3112's have m15w.  Replace sil_3112_m15w with sil_3112 and flag
sil_3112 with SIL_FLAG_MOD15WRITE.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Carlos Pardo <Carlos.Pardo@siliconimage.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-05 02:39:55 -05:00
Tejun Heo 219e621443 [PATCH] ata_piix: rename PIIX_FLAG_IGN_PRESENT to PIIX_FLAG_IGNORE_PCS
Rename PIIX_FLAG_IGN_PRESENT to PIIX_FLAG_IGNORE_PCS as Jeff
requested.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-05 00:36:28 -05:00
Daniel Drake e1fd263c77 [PATCH] sata_promise: Support FastTrak TX4300/TX4310
This patch adds support for the Promise FastTrak TX4300/TX4310 4-port PCI SATA
controllers based on the PDC40719 chip.

Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-04 12:20:06 -05:00
Tejun Heo 28ca5c57dc [PATCH] libata: reorganize ata_bus_probe()
Now that reset and configure are converted such that they don't modify
or disable libata core data structures, reorganize ata_bus_probe() to
reflect this change.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-03 17:31:04 -05:00
Tejun Heo 4b2f3ededc [PATCH] libata: fold ata_dev_config() into ata_dev_configure()
ata_dev_config() needs to be done everytime a device is configured.
Fold it into ata_dev_configure().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-03 17:31:04 -05:00
Tejun Heo ffeae418c1 [PATCH] libata: separate out ata_dev_configure()
Separate out ata_dev_configure() from ata_dev_identify() such that
ata_dev_configure() only configures @dev according to passed in @id.
The function now does not disable device on failure, it just returns
appropirate error code.

As this change leaves ata_dev_identify() with only reading ID, calling
configure and disabling devices according to the results, this patch
also kills ata_dev_identify() and inlines the logic into
ata_bus_probe().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-03 17:31:04 -05:00
Tejun Heo d9572b1d5e [PATCH] libata: convert dev->id to pointer
Convert dev->id from array to pointer.  This is to accomodate
revalidation.  During revalidation, both old and new IDENTIFY pages
should be accessible and single ->id array doesn't cut it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-03 17:31:04 -05:00
Tejun Heo d133ecab8f [PATCH] ata_piix: reimplement piix_sata_probe()
Reimplement piix_sata_probe() such that it turns on PCS enable bits on
all avaliable ports and check present bits after a while to determine
device presence.  This should help broken BIOSes.  After device
presence detection is complete, PCS enable bits of unoccupied bits are
turned off unless the controller supports AHCI (ICH6/7 docs mandate
all enables bits are always set on AHCI capable controllers).

Note that PCS present bits are ignored on 6300ESB as described in the
datasheet.  This should fix device detection problems reported with
the controller.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-03 15:39:54 -05:00
Tejun Heo d33f58b883 [PATCH] ata_piix: implement proper port map
Replace combined mode handling via PIIX_COMB/COMB_PATA_P0 with proper
port map.  PIIX now prints port configuration during initialization.
ATA_FLAG_SLAVE_POSS is now turned on for SATA ports only when the
slave device is actually avaliable.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-03 15:39:54 -05:00
Tejun Heo d435804803 [PATCH] ata_piix: add a couple of flags
Add PIIX_FLAG_IGN_PRESENT and SCR flags.  Thi patch doesn't cause any
functional change.  To be used by later init/scr updates.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-03 15:39:54 -05:00
Tejun Heo 1d076e5b8d [PATCH] ata_piix: finer-grained port_info
Make port_info finer-grained.  This patch doesn't cause any functional
change.  Later init reimplementation will make use of it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-03 15:39:54 -05:00
James Bottomley dd9fbb5213 [SCSI] make some sas class properties optional
aic94xx doesn't have a use for the bay or enclosure identifiers.
Also, I think it's not going to need a get_linkerrors(), so wire up
all of these exported properties as conditional on the underlying
function support.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-03 08:58:10 -06:00
Christoph Hellwig 39a112403f [SCSI] qla2xxx: use kthread_ API
Use the kthread_ API instead of opencoding lots of hairy code for kernel
thread creation and teardown.

Also switch from semaphore-based thread wakeup to wake_up_process.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-By: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-02 22:56:40 -06:00
Matthew Wilcox 98acfc7e8e [SCSI] Add Brownie to blacklist
This device spews total rubbish to a REPORT LUNS command, so avoid
sending it one.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-02 22:44:06 -06:00
James Bottomley 7e6dff62da [SCSI] add 6.0 Gbit phy definitions to the sas transport class
I don't think these exist in silicon yet, but the aic94xx driver has a
register setting for them.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-02 22:36:58 -06:00
Tejun Heo 348edc59a8 [PATCH] sata_sil: remove unneeded ATA_FLAG_SRST from 3512 port info
Now unneeded ATA_FLAG_SRST sneaked into sil_3512 port info while
merging upstream-fixes.  Kill it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-01 14:56:05 -05:00
Tejun Heo a9d01d2b49 [PATCH] libata: kill illegal kfree(id)
Kill kfree(id) in failure path of ata_dev_read_id().  id is not
dynamically allocated yet.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-01 14:48:42 -05:00
Tejun Heo 4b9d7e04a8 [PATCH] sata_sil24: add a new PCI ID for SiI 3124
Add a new PCI ID for SiI 3124.  Reported by Silicon Image.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Carlos Pardo <Carlos.Pardo@siliconimage.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-01 14:48:41 -05:00
Jeff Garzik d2dbaad855 Merge branch 'master' 2006-03-01 14:45:47 -05:00
Linus Torvalds 71efa38c0e Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 2006-03-01 10:22:04 -08:00
Jamie Wellnitz 3ef0b47ee4 [SCSI] lpfc 8.1.2: Change version number to 8.1.2
Change version number to 8.1.2

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 19:06:03 -06:00
Jamie Wellnitz 50eba24f2e [SCSI] lpfc 8.1.2: Modify RSCN handling to unregister rpis on lost FCP_TARGETs immediately
Modify RSCN handling to unregister rpis on lost FCP_TARGETs immediately

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 19:05:42 -06:00
Jamie Wellnitz 0c6ac8efa8 [SCSI] lpfc 8.1.2: Fix panic caused by HBA resets and target side cable pulls
Fix panic caused by HBA resets and target side cable pulls

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 19:05:14 -06:00
Jamie Wellnitz 8189fd19ac [SCSI] lpfc 8.1.2: Fixed module parameter descriptions.
Fixed module parameter descriptions.

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 19:04:52 -06:00
Jamie Wellnitz 25594c6b84 [SCSI] lpfc 8.1.2: Code cleanup of lpfc_mbx_cmpl_config_link
Code cleanup of lpfc_mbx_cmpl_config_link

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 19:04:28 -06:00
Jamie Wellnitz 367c27134a [SCSI] lpfc 8.1.2: Allow turning on internal loop-back mode
Allow turning on internal loop-back mode

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 19:03:12 -06:00
Jamie Wellnitz 2fe165b650 [SCSI] lpfc 8.1.2: Code style changes for Discovery code
Code style changes for Discovery code

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 19:02:47 -06:00
Jamie Wellnitz 082c02667d [SCSI] lpfc 8.1.2: Make lpfc_els_rsp_rps_acc and lpfc_els_rsp_rpl_acc static
Make lpfc_els_rsp_rps_acc and lpfc_els_rsp_rpl_acc static

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 19:02:11 -06:00
Jamie Wellnitz 5024ab179c [SCSI] lpfc 8.1.2: Added support for FAN
Added support for FAN

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 19:01:51 -06:00
Jamie Wellnitz 41415862a2 [SCSI] lpfc 8.1.2: Add ERROR and WARM_START modes for diagnostic purposes.
Add ERROR and WARM_START modes for diagnostic purposes.

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 19:00:36 -06:00
Jamie Wellnitz d9d959c41f [SCSI] lpfc 8.1.2: Remove hba_list from struct lpfc_hba
Remove hba_list from struct lpfc_hba

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 19:00:11 -06:00
Jamie Wellnitz 7f0b5b1913 [SCSI] lpfc 8.1.2: Correct use of the hostdata field in scsi_host
Correct use of the hostdata field in scsi_host

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 18:58:02 -06:00
Jamie Wellnitz c9f8735bea [SCSI] lpfc 8.1.2: Misc FC Discovery changes :
Misc FC Discovery changes :
   - Added FC_BYPASSED_MODE statistic
   - Corrected some log message data
   - Fix up Discovery infrastructure to support FAN:
       Allow Fabric entities to flow thru DSM
       Fix up linkup/linkdown unregister login processing for Fabric entities
       Clean up Discovery code
       Utilize nodev_tmo for Fabric entities
   - Use of 3 * ratov for CT handling timeouts
   - Fix up DSM to make more appropriate decisions and clean up code.

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 18:57:23 -06:00
Jamie Wellnitz b28485acb9 [SCSI] lpfc 8.1.2: Add module parameter to limit number of outstanding commands per lpfc HBA
Add module parameter to limit number of outstanding commands per lpfc HBA

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 18:56:23 -06:00
Jamie Wellnitz 406d6041ac [SCSI] lpfc 8.1.2: Fixed a double insertion of mail box object to the SLI mailbox list.
Fixed a double insertion of mail box object to the SLI mailbox list.

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 18:55:50 -06:00
Jamie Wellnitz 901a920f07 [SCSI] lpfc 8.1.2: Fixed system panic in lpfc_sli_brdreset during dynamic add of LP11K
Fixed system panic in lpfc_sli_brdreset during dynamic add of LP11K

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 18:55:24 -06:00
Jamie Wellnitz 7062c5281c [SCSI] lpfc 8.1.2: Explicitly initialize the skip_post argument to lpfc_sli_send_reset
Explicitly initialize the skip_post argument to lpfc_sli_send_reset
  on a ERATT interrupt.

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 18:54:09 -06:00
Jamie Wellnitz 6ad425356b [SCSI] lpfc 8.1.2: Fixed a race condition in the PLOGI retry logic.
Fixed a race condition in the PLOGI retry logic.

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 18:53:33 -06:00
Jamie Wellnitz 7bb3b137ab [SCSI] lpfc 8.1.2: Handling of ELS commands RRQ, RPS, RPL and LIRR correctly
Handling of ELS commands RRQ, RPS, RPL and LIRR correctly

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 18:52:50 -06:00
Jamie Wellnitz 0228aadd0f [SCSI] lpfc 8.1.2: Remove unused SLI_IOCB_HIGH_PRIORITY
Remove unused SLI_IOCB_HIGH_PRIORITY

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 18:51:38 -06:00
Jamie Wellnitz 0c71fd9e43 [SCSI] lpfc 8.1.2: Remove unreferenced cfg_fcp_bind_method from struct lpfc_hba
Remove unreferenced cfg_fcp_bind_method from struct lpfc_hba

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 18:51:19 -06:00
Jamie Wellnitz 3bbae37ab4 [SCSI] lpfc 8.1.2: Remove unused prototypes from lpfc_crtn.h
Remove unused prototypes from lpfc_crtn.h

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 18:50:44 -06:00
Jürgen E. Fischer e2482fa16e [SCSI] aha152x: fix variable use before initialisation and other bugs
- change interface of the reset functions from Scsi_Cmnd to Scsi_Host.
- add functions with the original interface and rename the new
  functions to reflect the new interface.
- call these from the pcmcia driver, thereby avoiding the need to
  construct a (broken) Scsi_Cmnd from a Scsi_Host.
- just run the bh if the interrupt is from the controller and if so
  ensure that it's only called once per interrupt.

Signed-off-by: Juergen E. Fischer <fischer@linux-buechse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 11:20:45 -06:00
Matthew Wilcox 23ff51e9fe [SCSI] Fix uninitialised width and speed in sym2
sym2 boards without NVRAM currently negotiate narrow due to this missed
initialisation

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 09:36:14 -06:00
Ralf Baechle 123fc7fd6f [SCSI] Delete duplicate driver template.
Stuborn as compilers are they don't like duplicate definitions.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 09:36:11 -06:00
Brian King 32f9579250 [SCSI] scsi: Handle device_add failure in scsi_alloc_target
Fixes scsi to handle device_add failure in scsi_alloc_target.
Without this patch, if this call were to fail, we can oops
when we free the target.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 23:38:59 -06:00
James Bottomley ffedb45225 [SCSI] fix scsi process problems and clean up the target reap issues
In order to use the new execute_in_process_context() API, you have to
provide it with the work storage, which I do in SCSI in scsi_device and
scsi_target, but which also means that we can no longer queue up the
target reaps, so instead I moved the target to a state model which
allows target_alloc to detect if we've received a dying target and wait
for it to be gone.  Hopefully, this should also solve the target
namespace race.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 23:37:45 -06:00
Mike Christie ba3af0aff0 [SCSI] don't call ips_eh_reset in ips_queue to avoid deadlock
When the locking was changed in the eh code ips_eh_reset was changed
so that it was a wraper around __ips_eh_reset and all ips_eh_reset
does is grab the host lock and then calls __ips_eh_reset.

In the queuecommand, ips_queue is called with the host_lock held so if
it calls ips_eh_reset we will have a problem. This patch just has
ips_queue call __ips_eh_reset.

Patch is only compile tested. I do not have the HW.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: Hammer, Jack <Jack_Hammer@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 23:32:39 -06:00
Al Viro 6d73c8514d [SCSI] scsi_lib: fix recognition of cache type of Initio SBP-2 bridges
Regardless what mode page was asked for, Initio INIC-14x0 and
INIC-2430 always return page 6 without mode page headers.  Try to
recognise this as a special case in scsi_mode_sense and setting the
mode sense headers accordingly.

Signed-off-by: Al Viro <viro@ftp.linux.org.uk>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 23:31:07 -06:00
Matthew Wilcox fc25307d06 [SCSI] Improve message printing code
Fix a bug where we would consume one byte too many in the message
printing code.
Add support for 256-byte long messages.
Add support for the Modify Bidirectional Data Pointer message.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 23:26:56 -06:00
Alan Stern 1bfc5d9d5e [SCSI] Recognize missing LUNs for non-standard devices
Some non-standard SCSI targets or protocols, such as USB UFI, report "no
LUN present" by setting the Peripheral Device Type to 0x1f and the
Peripheral Qualifier to 0 (not 3 as the standard requires) in the INQUIRY
response.  This patch (as650b) adds a new target flag and code to
accomodate such targets.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 23:24:09 -06:00
Christoph Hellwig 8cac814501 [SCSI] aic7xxx: semaphore to completion conversion
On Tue, Jan 31, 2006 at 06:20:18PM +0100, Christoph Hellwig wrote:
> switch eh_sem to a completion.  due to wait_for_completion_timeout this
> also nicely simplifies the code.  Unfortunately it's untested, so if
> someone with the hardware could give it a try that would be nice.  Once
> it works the same thing can be applied to aic79xx.

New version that switches to the common onstack completion and just a
pointer in the platform_data struct idiom.  This gets rid of all the
flags fiddling.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 23:08:37 -06:00
Christoph Hellwig fe27381d16 [SCSI] aacraid: use kthread_ API
Use the kthread_ API instead of opencoding lots of hairy code for kernel
thread creation and teardown.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Salyzyn, Mark <mark_salyzyn@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 22:55:14 -06:00
James Bottomley 38e14f895b [SCSI] Add EXPORT_SYMBOL for spi msg functions
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 22:55:13 -06:00
Christoph Hellwig a012564136 [SCSI] sas: add support for enclosure and bad ID rphy attributes
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 22:55:13 -06:00
Ralf Baechle ae198df377 [SCSI] jazz_esp: Fix sparse warnings.
Using plain integer as NULL pointer.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 22:55:11 -06:00
Ralf Baechle 0320503dce [SCSI] jazz_esp: Delete useless prototype
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 22:55:11 -06:00
Matthew Wilcox e24d873d25 [SCSI] Make spi_print_msg more consistent
Almost all the output from spi_print_msg() has a trailing space.
This patch fixes up the three cases that don't.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 22:55:10 -06:00
Matthew Wilcox 6ea3c0b2da [SCSI] Add spi_populate_*_msg functions
Introduce new helpers:
 - spi_populate_width_msg()
 - spi_populate_sync_msg()
 - spi_populate_ppr_msg()

and use them in drivers which already enable the SPI transport.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 22:55:09 -06:00
Matthew Wilcox b0dc1db152 [SCSI] ncr53c8xx update
Delete unused NAME53C definition
Remove use of the M_* constants; use the common SCSI constants instead
Translate some remaining German
Add a missing changelog entry

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 22:55:08 -06:00
Matthew Wilcox ea697e456a [SCSI] unused show_spi_transport_period_helper parameter
show_spi_transport_period_helper() doesn't need the class_device parameter

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 22:55:07 -06:00
Matthew Wilcox a97a83a06b [SCSI] fix uninitialized variable error
in __scsi_add_device, sdev may be uninitialised if
scsi_host_scan_allowed() returns false.  Fix by initialising at the
top of the routine.  Also rely on the fact that
scsi_probe_and_add_lun() only actually fills in the sdev pointer if
the SCSI_SCAN_LUN_PRESENT case (so no need to check the return value).

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 22:55:07 -06:00
Linas Vepstas f8a88b19b9 [SCSI] PCI Error Recovery: IPR SCSI device driver
Various PCI bus errors can be signaled by newer PCI controllers.  This
patch adds the PCI error recovery callbacks to the IPR SCSI device driver.
The patch has been tested, and appears to work well.

Signed-off-by: Linas Vepstas <linas@linas.org>
Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 22:55:05 -06:00
Greg KH 5e3c34c1e9 [SCSI] Remove devfs support from the SCSI subsystem
As devfs has been disabled from the kernel tree for a number of months
now (5 to be exact), here's a patch against 2.6.16-rc1-git1 that removes
support for it from the SCSI subsystem.

The patch also removes the scsi_disk devfs_name field as it's no longer
needed.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 22:55:04 -06:00
Jes Sorensen 24669f75a3 [SCSI] SCSI core kmalloc2kzalloc
Change the core SCSI code to use kzalloc rather than kmalloc+memset
where possible.

Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 22:55:02 -06:00
Brian King 8884efab15 [SCSI] scsi: scsi command retries off by one fix
Fix up an off by one error in calculating retries for scsi
commands. This bug was discovered when an SG_IO request
was sent to scsi core with retries = 0, causing the overall
timeout check to go off in scsi_softirq_done.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 21:38:39 -06:00
Christoph Hellwig 147aab6aa2 [SCSI] megaraid_sas: fix physical disk handling
This patch hides the devices completely from the midlayer instead.
It requires the patch to handle the slave_configure failure I posted
earlier.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 21:36:46 -06:00
Jeff Garzik c3c013a2c2 [libata] Disable FUA
Until problems are sorted.
2006-02-27 22:31:19 -05:00
Christoph Hellwig 938050916f [SCSI] scsi: handle ->slave_configure return value
When ­>slave_configure fails the scsi midlayer should handle it.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 21:26:45 -06:00
Andrew Vasquez 8b097a6726 [SCSI] fc_transport: stop creating duplicate rport entries.
Current fc_transport consumers initially register rports
with an UNKNOWN role-state and follow-up with a call to
fc_remote_port_rolechg().  Modify code in
fc_remote_port_add() to scan the fc_host_rport_bindings()
array for consistent bindings regardless of role-type.
Original code would only scan bindings array for targets,
causing duplicate fc_remote_ports/rport-X:Y-Z entries to be
created for the yet-to-be-role-changed rports.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 21:25:40 -06:00
Brian King eca7be5e18 [SCSI] sg: Remove aha1542 hack
Remove a hack in the sg driver that alters the total buffer
length for SG_IO commands to ensure buffers are not odd byte
lengths. This breaks on the ipr driver since it requires the
request_bufflen to equal the length specified in the cdb.
The block layer SG_IO code does not appear to have this hack.

Signed-off-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 21:25:40 -06:00
Jeff Garzik cccc65a3b6 Merge branch 'master' 2006-02-27 11:49:05 -05:00
Linus Torvalds e95a9ec1bb Merge branch 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev 2006-02-27 07:41:30 -08:00
Al Viro 4897080077 [PATCH] sd: fix memory corruption with broken mode page headers
There's a problem in sd where we blindly believe the length of the
headers and block descriptors.  Some devices return insane values for
these and cause our length to end up greater than the actual buffer
size, so check to make sure.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Also removed the buffer size magic number (512) and added DPOFUA of
zero to the defaults

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-26 09:09:49 -08:00
Tejun Heo e4e10e3e79 [PATCH] sata_sil: implement R_ERR on DMA activate FIS errata fix
Silicon Image has disclosed a new sil3114/3152 errata and workaround
which causes the controller to return R_ERR on DMA activate FIS if the
FIS is received while the next PRD is being fetched.  This patch
implements the workaround.

This errata results in lock up and doesn't trigger if m15w workaround
is in effect.  We stopped applying m15w to 3512 and 3114 in 2.6.14-rc1
which makes 3512/3114 lock up with some drives on all kernel versions
since 2.6.14-rc1 upto now (2.6.16-rc4).  This patch should fix the
regression.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-02-25 16:52:31 -05:00
Tejun Heo 0ee304d580 [PATCH] sata_sil: add board ID for 3512
3512 is slightly different from 3112 errata-wise.  Differentiate it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-02-25 16:52:31 -05:00
Christoph Hellwig a6ceda7457 [SCSI] esp: fix eh locking
esp_reset didn't get fixed when the EH locking changed.
->eh_bus_reset_handler is now called without the host lock held.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-02-22 14:35:52 -08:00
Tejun Heo ba70d06147 [PATCH] libata: kill ata_dev_reread_id()
Kill now-unused ata_dev_reread_id().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 18:56:59 -05:00
Tejun Heo 49016aca2e [PATCH] libata: separate out ata_dev_read_id()
Separate out ata_dev_read_id() from ata_dev_identify().  This is the
first half of splitting ata_dev_identify().  ata_dev_read_id() will
also be used for revalidation.  This patch does not make any behavior
change.

ata_dev_read_id() doesn't modify any of libata-internal data
structures.  It simply reads IDENTIFY page and returns error code on
failure.  INIT_DEV_PARAMS and EDD wrong class code are also handled by
this function.

Re-reading IDENTIFY after INIT_DEV_PARAMS is performed by jumping to
retry: instead of calling ata_dev_reread_id().  This is done because
1. there's retry label anyway 2. ata_dev_reread_id() cannot be used
anywhere else so there's no reason to keep it.

This function is probably the place to set transfer mode to PIO0
before IDENTIFY.  However, reset -> identify -> init_dev_params order
should be kept for pre-ATA4 devices so we cannot set transfer mode
before IDENTIFY for them.  How do we know if a device is post-ATA4
before IDENTIFY?

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 18:56:58 -05:00
Jeff Garzik f131883e73 Merge branch 'upstream-fixes' 2006-02-20 16:55:56 -05:00
Tejun Heo 2e242fa994 [PATCH] libata: make ata_sg_setup_one() trim zero length sg
This patch makes ata_sg_setup_one() trim sg entry (thus making
qc->n_elem zero) if padding results in zero length sg entry.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 16:48:18 -05:00
Tejun Heo 9ae61c6cb6 [PATCH] libata: fix WARN_ON() condition in *_fill_sg()
For ATAPI commands, padding can reduce qc->n_elem by one and thus to
zero making assert(qc->n_elem > 0)'s in ata_fill_sg() and qs_fill_sg()
fail for legal commands.  This patch fixes the assert()'s to take
qc->pad_len into account.

Although the condition check seems a bit excessive, as this part of
code isn't still stable yet, I think it's worth to keep those.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 16:48:17 -05:00
Tejun Heo ccbe6d5ee0 [PATCH] ata_piix: convert sata to new reset mechanism
Convert ata_piix sata ->phy_reset to new reset mechanism.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 06:19:53 -05:00
Tejun Heo 573db6b8f9 [PATCH] ata_piix: convert pata to new reset mechanism
Convert ata_piix pata ->phy_reset to new reset mechanism.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 06:19:53 -05:00
Tejun Heo 56497bd5f1 [PATCH] libata: fix comment regarding setting cable type
The comment above ata_std_postreset() specified that setting cable
type is the responsibility of postreset(), which isn't possible /
optimal depending on controller / driver.  This patch kills the
comment.  Setting cable type is responsibility of ->probe_reset.
libata doesn't care whether it's done in probeinit, reset or
postreset.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 06:19:53 -05:00
Tejun Heo 6aff8f1f07 [PATCH] libata: update ata_dev_init_params()
Update ata_dev_init_params() such that it doesn't disable port
directly but return with appropriate error mask on failure.  This is
preparation for splitting ata_dev_identify().  Note that this patch
changes behavior of dev_init_params failure such that only failing
devices are taken offline not the whole port.  This change is
intended.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 05:07:52 -05:00
Tejun Heo 6a62a04d47 [PATCH] libata: rename ata_dev_id_[c_]string()
This patch renames ata_dev_id_[c_]string() to ata_id_[c_]string().
All other functions which read data from ATA ID data start with ata_id
and those two function names were getting too long.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 04:54:22 -05:00
Jeff Garzik 5b2ffed906 Merge branch 'master' 2006-02-20 02:16:23 -05:00
Jens Axboe c15d85c8f3 [PATCH] Add missing FUA write to sata_mv dma command list
Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-17 16:31:18 -05:00
Albert Lee 0565c26de7 [PATCH] libata: minor fix for 2.6.16-rc3
- Fix the array index value in ata_rwcmd_protocol() for the added FUA commands.
 - Filter out ATAPI packet command error messages in ata_pio_error()

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-17 16:29:07 -05:00
Dan Williams 2ae5b30ff0 [PATCH] Necessary evil to get sata_vsc to initialize with Intel iq3124h hba
* libata does not care about error interrupts, so handle them locally
* the interrupts that are ignored only appear to happen at init time

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-17 16:27:19 -05:00
Linus Torvalds 26d451b603 Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 2006-02-16 12:47:44 -08:00
James Bottomley 65110b2168 [SCSI] fix wrong context bugs in SCSI
There's a bug in releasing scsi_device where the release function
actually frees the block queue.  However, the block queue release
calls flush_work(), which requires process context (the scsi_device
structure may release from irq context).  Update the release function
to invoke via the execute_in_process_context() API.

Also clean up the scsi_target structure releasing via this API.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-14 11:15:11 -06:00
James Bottomley faead26d7a [PATCH] add scsi_execute_in_process_context() API
We have several points in the SCSI stack (primarily for our device
functions) where we need to guarantee process context, but (given the
place where the last reference was released) we cannot guarantee this.

This API gets around the issue by executing the function directly if
the caller has process context, but scheduling a workqueue to execute
in process context if the caller doesn't have it.  Unfortunately, it
requires memory allocation in interrupt context, but it's better than
what we have previously.  The true solution will require a bit of
re-engineering, so isn't appropriate for 2.6.16.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-14 11:14:26 -06:00
Tejun Heo 49430f97dd [PATCH] libata: kill sht->max_sectors
The previous dev->max_sectors patch made sht->max_sectors meaningless.
Kill all initializations of sht->max_sectors.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-12 14:36:30 -05:00
Tejun Heo b00eec1d58 [PATCH] libata: add per-device max_sectors
If a low level driver wants to control max_sectors, it had to adjust
ap->host->max_sectors and set ATA_DFLAG_LOCK_SECTORS to tell
ata_scsi_slave_config not to override the limit.  This is not only
cumbersome but also incorrect for hosts which support more than one
devices per port.

This patch adds per-device ->max_sectors.  If the field is unset
(zero), libata core layer will adjust ->max_sectors according to
default rules.  If the field is set, libata honors the setting.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-12 14:36:30 -05:00
Tejun Heo 6e7846e9c5 [PATCH] libata: move cdb_len for host to device
cdb_len is per-device property.  Sharing cdb_len on ap results in
inaccurate configuration on revalidation and hotplugging.  This patch
makes cdb_len per-device.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-12 14:29:10 -05:00
Tejun Heo 8eabd02c24 [PATCH] libata: make ata_dev_knobble() per-device
ata_dev_knobble() unconditionally used the first device of the port to
determine whether a device is bridged or not.  This causes bridge
limit to be incorrectly applied or unapplied for hosts with slave
devices (e.g. ata_piix).

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-12 14:29:10 -05:00
Tejun Heo 61eb066aff [PATCH] libata: don't do EDD handling if ->probe_reset is used
EDD is never used with ->probe_reset.  Don't handle EDD special case
in ata_dev_identify if ->probe_reset is in use.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-12 14:29:10 -05:00
Tejun Heo 0bd3300ac9 [PATCH] libata: make ata_dump_id() take @id instead of @dev
Make ata_dump_id() take @id instead of @dev.  This is preparation for
splitting ata_dev_identify().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-12 14:24:41 -05:00
Tejun Heo 3d2ca91095 [PATCH] libata: separate out ata_id_major_version()
Separate out ATA major version calculation from ata_dev_identify()
into ata_id_major_version().  It's preparation for splitting
ata_dev_identify().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-12 14:24:41 -05:00
Tejun Heo 2940740bca [PATCH] libata: separate out ata_id_n_sectors()
Separate out n_sectors calculation into ata_id_n_sectors() from
ata_dev_identify().  This will be used by revalidation.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-12 14:24:41 -05:00
Tejun Heo 2e02671daa [PATCH] libata: use ata_dev_id_c_string()
Use ata_dev_id_c_string()

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-12 14:24:41 -05:00
Tejun Heo 0e949ff304 [PATCH] libata: implement ata_dev_id_c_string()
ata_dev_id_c_string() reads ATA string from the specified offset of
the given IDENTIFY PAGE and puts it in the specified buffer in trimmed
and NULL-terminated form.  The caller must supply a buffer which is
one byte larger than the maximum size of the target ID string.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-12 14:24:41 -05:00
Tejun Heo 48f80e12ab [PATCH] ata_piix: kill spurious assignment in piix_sata_probe()
In piix_sata_probe(), mask gets assigned unnecessarily at the
beginning of the function.  Kill the assignment.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-12 14:06:42 -05:00
Tejun Heo 06ab78222b [PATCH] libata: allow ->probe_reset to return ATA_DEV_UNKNOWN
This patch makes ata_bus_probe() normalize classes[] returned by
->probe_reset such that ->probe_reset can return ATA_DEV_UNKNOWN.
This eases implementation of ->probe_reset's which don't directly use
ata_drive_probe_reset().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-12 13:57:22 -05:00
Matthew Wilcox e2230eac17 [SCSI] sym2: Mask off opcode from RBC
pm->sg.size is set from the Residual Byte Count register.  However,
the upper byte of the RBC is the opcode of the instruction that was
executing, so we need to mask it off.  This fixes some spurious rejects
of IGNORE WIDE RESIDUE messages.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-12 11:13:09 -06:00
Ju, Seokmann 3542adcb35 [SCSI] megaraid_legacy: kobject_register failure
Attached patch fixes problem that cause kobject_register failure
during loading.  Kobject_register would fail when there are more than
1 module with same module name.  This patch will change module name of
megaraid_legacy from 'megaraid' to 'megaraid_legacy'.

Signed-Off-by: Seokmann Ju <seokmann.ju@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-12 11:11:09 -06:00
Brian King 4733804c9f [SCSI] ipr: Fix adapter initialization failure
Since scsi core is always sending scatterlists now, remove
some code which was written with the bad assumption that
a small transfer would not be sent down in a scatterlist.
Without this fix, the ipr driver ends up sending garbage
data to the adapter following a reset, causing it to
fail the reset and take the adapter offline.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-12 11:05:44 -06:00
Tejun Heo beec7dbc6f [PATCH] libata: convert assert(xxx)'s in low-level drivers to WARN_ON(!xxx)'s
This patch converts all assert(xxx)'s in low-level drivers to
WARN_ON(!xxx)'s.  After this patch, there is no in-kernel user of the
libata assert() macro.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-11 17:51:57 -05:00
Tejun Heo a46314744d [PATCH] libata: convert assert(X)'s in libata core layer to WARN_ON(!X)'s
In an effort to kill libata-specific assert() and use generic
WARN_ON(), this patch converts all assert(X)'s in libata core layer to
WARN_ON(!X)'s.  Most conversions are straight-forward logical negation
exception for the followings.

* In libata-core.c:ata_fill_sg(),
  assert(qc->n_elem > 0) is converted to WARN_ON(qc->n_elem == 0) because
  qc->n_elem is unsigned and unsigned <= 0 is weird.

* In libata-scsi.c:ata_gen_ata_desc/fixed_sense(),
  assert(NULL != qc->ap->ops->tf_read) is converted to
  WARN_ON(qc->ap->ops->tf_read == NULL), as there are no other users of
  'constant cond var' style in libata.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-11 17:51:57 -05:00
Tejun Heo 4bd00f6a20 [PATCH] ahci: convert to new reset mechanism
Convert ahci ->phy_reset to new reset mechanism.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-11 17:51:56 -05:00
Tejun Heo a42fc659ba [PATCH] ahci: make ahci_fill_cmd_slot() take *pp instead of *ap
Make ahci_fill_cmd_slot() take struct ahci_port_priv *pp instead of
struct ata_port *ap as suggested by Jeff Garzik.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-11 17:51:56 -05:00
Tejun Heo 76014427e6 [PATCH] libata: inline ata_qc_complete()
This patch inlines ata_qc_complete() and uninlines __ata_qc_complete()
as suggested by Jeff Garzik.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-11 17:51:56 -05:00
Tejun Heo 489ff4c7d1 [PATCH] sata_sil24: add hardreset
Now that libata is smart enough to handle both soft and hard resets,
add hardreset method.  Note that sil24 hardreset doesn't supply
signature; still, the new reset mechanism can make good use of it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-10 10:30:12 -05:00
Tejun Heo 07b734702a [PATCH] sata_sil24: convert to new reset mechanism
Convert sata_sil24 ->phy_reset to new reset mechanism.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-10 10:30:12 -05:00
Tejun Heo 531db7aa0d [PATCH] sata_sil: convert to new reset mechanism
Convert sata_sil to use new reset mechanism.  sata_sil is fairly
generic and can directly use std routine.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-10 10:30:11 -05:00
Tejun Heo ac7c6d596e [PATCH] libata: kill SError clearing in sata_std_hardreset().
Don't clear SError in sata_std_hardreset().  This makes hardreset act
identically to ->phy_reset register-wise.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-10 10:30:11 -05:00
Tejun Heo 3a39746a52 [PATCH] libata: make new reset act identical to ->phy_reset register-wise
This patch makes std component operations act identical to ->phy_reset
register-wise except for SError clearing on sata_std_hardreset.

Note that if a driver only implements/uses hardreset, it should not
use ata_std_probeinit() to avoid extra sata_phy_resume() and
ata_busy_sleep() compared to ->phy_reset.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-10 10:30:11 -05:00
Tejun Heo cc9278ed5e [PATCH] ahci: separate out ahci_fill_cmd_slot()
Separate out ahci_fill_cmd_slot() from ahci_qc_prep().
ahci_fill_cmd_slot() can later be used to issue non-standard commands.
(e.g. softreset)

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-10 07:04:31 -05:00
Tejun Heo f637902015 [PATCH] libata: kill NULL qc handling from ->eng_timeout callbacks
->eng_timeout cannot be invoked with NULL qc anymore.  Add an
assertion in ata_scsi_error() and kill NULL qc handling from all
->eng_timeout callbacks.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-10 06:50:47 -05:00
Tejun Heo 35daeb8f9b [PATCH] libata: use ata_scsi_timed_out()
Make all libata low level drivers use ata_scsi_timed_out().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-10 06:50:46 -05:00
Tejun Heo f29841e08f [PATCH] libata: implement ata_scsi_timed_out()
Implement ata_scsi_timed_out(), to be used as
scsi_host_template->eh_timed_out callback for all libata drivers.
Without this function, the following race exists.

If a qc completes after SCSI timer expires but before libata EH kicks
in, the qc gets completed but the scsicmd still gets passed to libata
EH resulting in ->eng_timeout invocation with NULL qc, which none is
handling properly.

This patch makes sure that scmd and qc share the same lifetime.
Original idea from Jeff Garzik <jgarzik@pobox.com>.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-10 06:50:46 -05:00
Tejun Heo 341963b909 [PATCH] libata: add ATA_QCFLAG_EH_SCHEDULED
Add ATA_QCFLAG_EH_SCHEDULED.  If this flag is set, the qc is owned by
EH and normal completion path is not allowed to finish it.  This patch
doesn't actually use this flag.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-10 06:50:45 -05:00
Jeff Garzik 1fdffbce03 [libata] Move PCI IDE BMDMA-related code to new file libata-bmdma.c. 2006-02-09 05:15:27 -05:00
Jeff Garzik 389984cb75 Merge branch 'upstream-fixes' 2006-02-09 04:30:18 -05:00
Jeff Garzik 9caafa6c86 Merge branch 'upstream-fixes' 2006-02-09 04:29:00 -05:00
Tejun Heo 8a19ac89ed [PATCH] libata: implement ata_std_probeinit()
This patch implements the off-the-shelf probeinit component operation.
Currently, all it does is waking up the PHY if it's a SATA port.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-09 01:59:52 -05:00
Tejun Heo 7944ea9522 [PATCH] libata: add probeinit component operation to ata_drive_probe_reset()
This patch adds probeinit component operation to
ata_drive_probe_reset().  If present, this new operation is called
before performing any reset.  The operations's roll is to prepare @ap
for following probe-reset operations.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-09 01:59:52 -05:00
Jeff Garzik 5140788f77 [libata scsi] build fix for ATA_FLAG_IN_EH change 2006-02-09 01:56:05 -05:00
Tejun Heo 7a7921e866 [PATCH] libata: separate out sata_phy_resume() from sata_std_hardreset()
This patch separates out sata_phy_resume() from sata_std_hardreset().
The function will later be used by probeinit callback.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-09 01:52:54 -05:00
Tejun Heo b911fc3ae0 [PATCH] libata: fix ata_std_probe_reset() SATA detection
ap->cbl is initialized during postreset and thus unknown on entry to
ata_std_probe_reset().  This patch makes ata_std_probe_reset() use
ATA_FLAG_SATA flag instead of ap->cbl to detect SATA port.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-09 01:52:53 -05:00
Tejun Heo c18d06f89f [PATCH] libata: EH / pio tasks synchronization
This patch makes sure that pio tasks are flushed before proceeding
with EH.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-09 01:18:38 -05:00
Tejun Heo dde44589bf [PATCH] libata: implement ATA_FLAG_IN_EH port flag
ATA_FLAG_IN_EH flag is set on entry to EH and cleared on completion.
This patch just sets and clears the flag.  Following patches will
build normal qc execution / EH synchronization aroung this flag.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-09 01:18:37 -05:00
Jeff Garzik 725b2805fd Merge branch 'upstream-fixes' 2006-02-09 00:59:34 -05:00
Jeff Garzik cac0e8e8bb Merge branch 'master' 2006-02-09 00:58:59 -05:00
Al Viro 2d20eaf942 [PATCH] sg gfp_t annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2006-02-07 20:58:27 -05:00
Al Viro e5fb81bd89 [PATCH] scsi_transport_iscsi gfp_t annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2006-02-07 20:58:21 -05:00
Al Viro 7be7cbf684 [PATCH] drivers/scsi/mac53c94.c __iomem annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2006-02-07 20:57:14 -05:00
Al Viro 164006da31 [PATCH] bogus asm/delay.h includes
asm/delay.h is non-portable; linux/delay.h should be used in generic code.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2006-02-07 20:56:41 -05:00
andrew.vasquez@qlogic.com 0d4be1240b [PATCH] qla2xxx: Correct lun assignment during IOCB submission.
4gb products require an IOCB's FCP-LUN to be formatted in
wire-format prior to submission.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-07 10:54:07 -06:00
andrew.vasquez@qlogic.com 247ec457ce [PATCH] qla2xxx: Pass input-buffer length to Get-ID-List mailbox command.
Recent ISP24xx firmwares require that mailbox register 8 be
set to the maximum number of bytes to transfer during DMA
copying of the list.  We safely set this value to zero
(infinite), since the call is *only* made in FCAL
topologies.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-07 10:54:05 -06:00
andrew.vasquez@qlogic.com f7757a5f0f [PATCH] qla2xxx: Remove bogus debug-code.
Commit 854165f424
inadvertently added some code meant only for testing -- the
driver was ignoring the non-zero function numbers of a
multi-port HBA.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-07 10:54:02 -06:00
andrew.vasquez@qlogic.com 387f96b4d9 [PATCH] qla2xxx: Close window on race between rport removal and fcport transition.
Fcport visibility is recognized during interrupt time, but,
rport removal can only occur during a process
(sleeping)-context.  Return a DID_IMM_RETRY status for
commands submitted within this window to insure I/Os do not
prematurely run-out of retries.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-07 10:53:56 -06:00
adam radford 62288f105b [SCSI] 3ware 9000 driver >4GB memory fix
The attached patch fixes a bug in the 3ware 9000 series driver:

- Fix use_sg == 0 mapping on systems with 4GB or higher.

  This fixes REPORT_LUNS (0xa0) failing with 3ware 9000 controllers on systems
  with lots of ram, mentioned in bugzilla # 6009:

      http://bugzilla.kernel.org/show_bug.cgi?id=6009

Signed-off-by: Adam Radford <linuxraid@amcc.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-05 17:15:15 -06:00
Eric Dumazet 88a2a4ac6b [PATCH] percpu data: only iterate over possible CPUs
percpu_data blindly allocates bootmem memory to store NR_CPUS instances of
cpudata, instead of allocating memory only for possible cpus.

As a preparation for changing that, we need to convert various 0 -> NR_CPUS
loops to use for_each_cpu().

(The above only applies to users of asm-generic/percpu.h.  powerpc has gone it
alone and is presently only allocating memory for present CPUs, so it's
currently corrupting memory).

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Jens Axboe <axboe@suse.de>
Cc: Anton Blanchard <anton@samba.org>
Acked-by: William Irwin <wli@holomorphy.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-05 11:06:51 -08:00
Jenx Axboe 40cdc840dc [SCSI] gdth: don't map zero-length requests
Don't map zero-length requests in gdth, zome architectures don't like
that in their dma mapping routines.

[ I'm pretty sure Jens posted this before, but for some reason it got
  forgotten  --hch ]

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-05 12:59:29 -06:00
Sumant Patro f9876f0b67 [SCSI] megaraid_sas: support for 1078 type controller added
This patch adds support for 1078 type controller (device id : 0x60).

Signed-off-by: Sumant Patro <Sumant.Patro@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:38:41 -06:00
Joshua Giles 122da30223 [SCSI] megaraid_sas: register 16 byte CDB capability
This patch properly registers the 16 byte command length capability of
the megaraid_sas controlled hardware with the scsi midlayer.  All
megaraid_sas hardware supports 16 byte CDB's.

Signed-off-by: Joshua Giles <joshua_giles@dell.com>
Signed-off-by: Sumant Patro <Sumant.Patro@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:37:29 -06:00
Mike Christie b5b8101653 [SCSI] iscsi update: rm unused sessions list
rm unused sessions list.

This patch is last becuase I was not sure if this patchset was
going to be applied over the kmalloc2kzalloc one by JesS. If it
is then this patch will not apply and can be dropped for now. I will
resend later when things setttle down.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:30:37 -06:00
Mike Christie 28e5554df6 [SCSI] iscsi update: use gfp_t
Use gfp_t. I accidentally removed this in our last update.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:20:12 -06:00
Mike Christie b36ae07cb7 [SCSI] iscsi update: fix mgmt pool err path release
>From ogerlitz@voltaire.com:

mgmtpool shoild be frees in immdata_alloc_fail label.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:19:53 -06:00
Mike Christie 351f739e68 [SCSI] iscsi update: set correct state at creation time
>From erezz@voltaire.com:

We are still in ISCSI_STATE_FREE state at create time. The addition
of the first connection puts us in ISCSI_STATE_LOGGED_IN.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:19:31 -06:00
Mike Christie 1fd459e367 [SCSI] iscsi update: rm conn lock
>From erezz@voltaire.com:

rm conn->lock since it is not used anymore. The dataqueue is protected
by the session lock and xmitmutex.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:19:08 -06:00
Mike Christie ee7f8e4053 [SCSI] iscsi update: set deamon pid earlier
>From michaelc@cs.wisc.edu:

If the transport lookup fails we set the daemon pid too late.
This can cause us deadlock since the netlink code will think we
meant to call back into our iscsi_if_rx function.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:18:51 -06:00
Mike Christie 142e301fc8 [SCSI] iscsi update: setup pool before using
>From andmike@us.ibm.com:

 Ensure that pool data is setup prior to calling mempool_create as it will
 call the the alloc function during create.

Signed-off-by: Mike Anderson <andmike@us.ibm.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:18:27 -06:00
Mike Christie 5b940adf5b [SCSI] iscsi update: pass correct skb to skb_trim
>From da-x@monatomic.org:

Wrong skb is passed to skb_trim in iscsi_if_get_stats.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:18:09 -06:00
Mike Christie 7b7232f3fb [SCSI] iscsi update: cleanup iscsi class interface
From:
michaelc@cs.wisc.edu
fujita.tomonori@lab.ntt.co.jp
da-x@monatomic.org

and err path fixup from:
ogerlitz@voltaire.com

This patch cleans up that interface by having the lld and class
pass a iscsi_cls_session or iscsi_cls_conn between each other when
the function is used by HW and SW iscsi llds. This way the lld
does not have to remember if it has to send a handle or pointer
and a handle or pointer to connection, session or host.

This also has the class verify the session handle that gets passed from
userspace instead of using the pointer passed into the kernel directly.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:17:03 -06:00
Mark Haverkamp bb08f92ebd [SCSI] aacraid: use no_uld_attach flag
Received From Mark Salyzyn.

In order to support user tools accessing the array components (SMART,
Mode Page information, Cache page adjustments, WWN determination,
Firmware updates etc), we take advantage of the no_uld_attach flag and
deprecate the code that filters Inquiries to block the requests to array
components. The quirk prevents the sd layer from attaching to the
components.

We also took the opportunity to balance the queue depths based on the
total adapter queue depth to the array devices to reduce the chances of
starvation.

Signed-off-by: Mark Haverkamp <markh@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:16:14 -06:00
Mark Haverkamp bfb35aa850 [SCSI] aacraid: Update global function names
Received from Mark Salyzyn,

Reduce the possibility of namespace collision.  Prefix with aac_.

Signed-off-by: Mark Haverkamp <markh@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:16:07 -06:00
Mark Haverkamp d8a571135a [SCSI] aacraid: reduce device probe warnings
Received from Mark Salyzyn.

This patch sets up some device quirks surrounding arrays to inform the
scsi layer that various mode pages are not supported. This reduces the
severity of the complaints that show up in the logs as the array devices
are enumerated.

Signed-off-by: Mark Haverkamp <markh@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:15:56 -06:00
andrew.vasquez@qlogic.com 854165f424 [SCSI] qla2xxx: Add support to retrieve/update HBA option-rom.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:12:41 -06:00
andrew.vasquez@qlogic.com 1b3f63659b [SCSI] qla2xxx: Return correct data-len during NVRAM retrieval.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:12:19 -06:00
andrew.vasquez@qlogic.com f6df144cca [SCSI] qla2xxx: Add beacon support via class-device attribute.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:11:57 -06:00