fix bug in adjust_hpsa_scsi_table which caused devices which have
changed size, etc. to do the wrong thing.
The problem was as follows:
The driver maintains its current idea of what devices are present
in the h->dev[] array. When it updates this array, it scans the
hardware, and produces a new list of devices, call it sd[], for
scsi devices.
Then, it compares each item in h->dev[] vs. sd[], and any items which
are not present sd it removes from h->dev[], and any items present
in sd[], but different, it modifies in h->dev[].
Then, it looks for items in sd[] which are not present in h->dev[],
and adds those items into h->dev[]. All the while, it keeps track
of what items were added and removed to/from h->dev[].
Finally, it updates the SCSI mid-layer by removing and adding
the same devices it removed and added to/from h->dev[]. (modified
devices count as a remove then add.)
originally, when a "changed" device was discovered, it was
removed then added to h->dev[]. The item was added to the *end*
of h->dev[]. And, the item was removed from sd[] as well
(nulled out). As it processed h->dev[], these newly added items
at the end of the list were encountered, and sd[] was searched,
but those items were nulled out. So they ended up getting removed
immediately after they were added.
The solution is to have a way to replace items in the h->dev[]
array instead of doing a remove + add. Then the "changed" items.
are not encountered a second time, and removed.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Mike Miller [Thu, 4 Feb 2010 14:43:26 +0000 (08:43 -0600)]
[SCSI] hpsa: print all the bytes of the CDB, not just the first one.
Signed-off-by: Mike Miller <mikem@beardog.cce.hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
[SCSI] hpsa: use scan_start and scan_finished entry points for scanning
use scan_start and scan_finished entry points for scanning and route
the CCISS_REGNEWD ioctl and sysfs triggering of same functionality
through hpsa_scan_start.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Matt Gates [Thu, 4 Feb 2010 14:43:05 +0000 (08:43 -0600)]
[SCSI] hpsa: Don't return DID_NO_CONNECT when a device is merely not ready
Signed-off-by: Matt Gates <matthew.gates@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Matt Gates [Thu, 4 Feb 2010 14:43:00 +0000 (08:43 -0600)]
[SCSI] hpsa: Retry commands completing with a sense key of ABORTED_COMMAND
Signed-off-by: Matt Gates <matthew.gates@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Matt Gates [Thu, 4 Feb 2010 14:42:55 +0000 (08:42 -0600)]
[SCSI] hpsa: Return DID_RESET for commands which complete with status of UNSOLICITED ABORT
The commands should be retried, and this will make that happen,
instead of resulting in an i/o error.
Signed-off-by: Matt Gates <matthew.gates@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
The p1210m responsds to SCSI report LUNs, unlike traditional Smart
Array controllers. This means that the bus, target, and lun
assignments done by the driver cannot be arbitrary, but must match
what SCSI REPORT LUNS returns.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
and update pci_ids.h to include new PCI ID for StorageWorks 1210m variant.
Signed-off-by: Mike Miller <mikem@beardog.cce.hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Don Brace [Thu, 4 Feb 2010 14:42:40 +0000 (08:42 -0600)]
[SCSI] hpsa: Allow multiple command completions per interrupt.
This is done by adding support for the so-called "performant mode"
(that's really what they called it). Smart Array controllers
have a mode which enables multiple command completions to be
delivered with a single interrupt, "performant" mode. We want to use
that mode, as some newer controllers will be requiring this mode.
Signed-off-by: Don Brace <brace@beardog.cce.hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Mike Miller <mikem@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Discovery relates changes:
- Separated VPI_REGISTERED state of physical port into VFI_REGISTERED and
VPI_REGISTERED state so that driver can unregister physical port VPI
independent of VFI.
- Add code to unregister, re-init and re-register physical port VPI
when physical port NportID change.
- Add code to unregister and re-register VPI of a vport when its Nport
ID change.
- Add code in FDISC completion path to re-start FLOGI discovery when
a FDISC complete with LOGIN_REQUIRED reason code.
- Fix a memory leak in lpfc_init_vpi_cmpl
- Add code to start a timer for vport to retry FDISC when CVL is received
by a vport or physical port. If all Nports receive CVLs, then all timers
are cancelled and a logical link level discovery will be started after
one second.
- Flush ELS commands after killing all delayed ELS commands.
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Smart [Wed, 27 Jan 2010 04:07:37 +0000 (23:07 -0500)]
[SCSI] lpfc 8.3.8: BugFixes: SLI relates changes
Fix hardware/SLI relates issues:
- Handle XB bit so that ELS XRIs are not prematurely released.
- Handle XB bit so that FCP XRIs are not prematurely released.
- Define new security SLI Commands.
- Remove unused security SLI commands
- Skip receive data size parameter check on received FLOGI.
- Added LPFC_USE_FCPWQIDX flag to iocb to force SLI layer
to submit abort WQE on same WQ as the command WQE.
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Dmitry Torokhov [Tue, 19 Jan 2010 18:24:40 +0000 (10:24 -0800)]
[SCSI] vmw_pvscsi: fix signedness warning with newer compilers
pvscsi_setup_msix() expects 'irq' argument to be an int but is being
passed unsigned int. Unsigned int is more proper type for IRQ number
so let's use it. This shuts off a compile warning with recent
compilers.
[SCSI] be2iscsi: Fix to allow driver to load when the FW allows more cids
This fix allows the driver to load when the FW allows more cids
than than the driver supports. The driver will limit the number of cid
to what it can support. There was no reason to fail the driver load,so,
correcting that
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Kashyap, Desai [Wed, 16 Dec 2009 13:27:02 +0000 (18:57 +0530)]
[SCSI] mpt2sas: Bump version 04.100.01.00
Version upgraded to 04.100.01.00.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Kashyap, Desai [Wed, 16 Dec 2009 13:26:28 +0000 (18:56 +0530)]
[SCSI] mpt2sas: Enable TLR for SSP TAPE drives (Added SAS Transport APIs)
If TLR is supported for end device, MPT2SAS driver will enable the TLR
bit in the SCSI_IO for every request. If there is a response with
MPI2_SCSITASKMGMT_RSP_INVALID_FRAME, the driver will turn off the TLR
logic.
[jejb: updated to new transport class TLR API] Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <Eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Kashyap, Desai [Wed, 16 Dec 2009 13:25:54 +0000 (18:55 +0530)]
[SCSI] mpt2sas: Update driver header to latest MPI Spec.
Update header to latest MPI SPEC revision.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Kashyap, Desai [Wed, 16 Dec 2009 13:25:26 +0000 (18:55 +0530)]
[SCSI] mpt2sas: Added phy_enable and set_phy_speed sysfs callback support.
Added new callbacks phy_enable and set_phy_speed in the
mpt2sas_transport_functions template. This will allow end user to
enable/disable phys and change links rates using the SysFS interface.
Current implementation only supports direct attached phys, but we
could in the future add support for expander based phys.
A new subroutine mpt2sas_config_set_sas_iounit_pg1 was added;
this wrapper function used to send request to controller firmware to modify
the phys and link rates. A new subroutine _transport_find_local_phy was added;
a function for easly obtaining the local phy object for direct attached.
Example to disable a phy
echo 0 > /sys/class/phy3:0/enable
Example to enable the same phy
echo 1 > /sys/class/phy3:0/enable
Example to change the link rate to 1.5
#echo "1.5 Gbit" > /sys/class/phy3:0/maximum_linkrate
#cat /sys/class/phy3:0/negotiated_linkrate
1.5 Gbit
Example to change the link rate to 3.0
#echo "3.0 Gbit" > /sys/class/phy3:0/maximum_linkrate
#cat /sys/class/phy3:0/negotiated_linkrate
3.0 Gbit
Example to change the link rate to 6.0
#echo "6.0 Gbit" > /sys/class/phy3:0/maximum_linkrate
#cat /sys/class/phy3:0/negotiated_linkrate
6.0 Gbit
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Kashyap, Desai [Wed, 16 Dec 2009 13:24:42 +0000 (18:54 +0530)]
[SCSI] mpt2sas: Added raid transport support
Adding support for raid transport layer. This will provide sysfs attributes
containing raid level, state, and resync rate.
MPT2SAS module will select RAID_ATTRS.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Kashyap, Desai [Wed, 16 Dec 2009 13:23:04 +0000 (18:53 +0530)]
[SCSI] mpt2sas: Use compat_ptr to setup the pointer compatibility.
On ppc64, an 32bit application was failing due to data buffers not being
copied properly from user to kernel memory. The problem due to improper
conversion of 32 to 64 bit pointers. The fix is to use compat_ptr to
setup the pointer compatibility in the routine _ctl_compat_mpt_command.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Kashyap, Desai [Wed, 16 Dec 2009 13:22:39 +0000 (18:52 +0530)]
[SCSI] mpt2sas: Set ioc->fwfault_debug to the cmd line option mpt2sas_fwfault_debug.
(1) change the formentioned string from logging_level to fwfault_debug
(2) set ioc->fwfault_debug to the command line option mpt2sas_fwfault_debug
setting at driver load time.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Kashyap, Desai [Wed, 16 Dec 2009 13:21:45 +0000 (18:51 +0530)]
[SCSI] mpt2sas: User resource_size_t instead of unsigned long
Use resource_size_t to define the type resource for the system interface
register set.
The existing implementation was using "unsigned long" which would be 32 bit
in 32 bit OS. If 32 bit OS is using 64 bit physical
address space for the system interface register set, we need to shift to
using resource_size_t which takes care of physical address space.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Kashyap, Desai [Wed, 16 Dec 2009 13:21:05 +0000 (18:51 +0530)]
[SCSI] mpt2sas: Return -ENODATA on IOCTL timeout
The driver was modified to return -ENODATA when there is a timeout
via ioctl path.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Kashyap, Desai [Wed, 16 Dec 2009 13:20:06 +0000 (18:50 +0530)]
[SCSI] mpt2sas: Delete volume before HBA detach.
The driver hangs when doing `rmmod mpt2sas` if there are any
IR volumes present.The hang is due the scsi midlayer trying to access the
IR volumes after the driver releases controller resources. Perhaps when
scsi_remove_host is called,the scsi mid layer is sending some request.
This doesn't occur for bare drives becuase the driver is already reporting
those drives deleted prior to calling mpt2sas_base_detach.
To solve this issue, we need to delete the volumes as well.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Bottomley [Mon, 18 Jan 2010 16:14:51 +0000 (10:14 -0600)]
[SCSI] scsi_transport_sas: add support for transport layer retries (TLR)
The mpt2sas driver wants to use transport layer retries (TLR) so the
simplest thing to do seems to be to add the enabling flags and checks
to the SAS transport class, since they're a SAS specific protocol
feature.
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
A Gentoo bug report [1] showed that as of 2.6.31 lpfc only uses INTx interrupts.
This patch restores lpfc's ability to support MSI-X/MSI interrupts that the
"Addition of SLI4 Interface - Base Support" patch [2] broke.
It reestablishes MSI-X as the default interrupt method and in case MSI-X is not
supported lpfc_sli{4,}_enable_intr fallbacks to MSI and then to INTx.
[James Smart:
Background:
Nothing Broke. This was intended.
We had originally enabled MSI-X by default, but in qualification within the
last 12 months, we encountered a major catch-22:
There were at least 4 platforms, from 2 major OEMs, that :
- Say they support MSI-X - platform routines work and act as if they do.
- We enable it, generate a test interrupt to check they really do deliver it,
and it works.
- But shortly after attachment, the system hangs or loses interrupts,
resulting in a bad system behavior.
Given the distro's picking up the 2.6.32 kernel, we had to stick with a
default of MSI-X off, with user-enabled MSI-X as these platforms couldn't get
fixed.
However, we're also now encountering platforms that require MSI-X and never
INTx, so we must change. It's desired also for also for performance reasons.
So - now (2.6.33) is the right time to re-enable MSI-X by default.
]
[jejb: fix up comment on default values]
Signed-off-by: George Kadianakis <desnacked@gmail.com> Acked-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Carnuccio [Tue, 12 Jan 2010 21:02:46 +0000 (13:02 -0800)]
[SCSI] qla2xxx: Enhance EEH support and enable AER support.
qla2xxx: EEH added call to pci_restore_state.
qla2xxx: EEH added delay in slot reset routine.
qla2xxx: EEH moved call to pci_save_state(), see (1).
qla2xxx: EEH additional changes for RHEL5.5.
qla2xxx: EEH added function call, removed function call, see (2).
(1) In qla2xxx_probe_one the call to pci_save_state() has been
moved to after the call to qla2xxx_request_irqs().
(2) Add call to pci_disable_pcie_error_reporting() in remove_one.
Delete call to pci_cleanup_aer_uncorrect_error_status() in pci_resume.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Douglas Gilbert [Sun, 3 Jan 2010 18:51:15 +0000 (13:51 -0500)]
[SCSI] skip sense logging for some ATA PASS-THROUGH cdbs
Further to the lsml thread titled:
"does scsi_io_completion need to dump sense data for ata pass through (ck_cond =
1) ?"
This is a patch to skip logging when the sense data is
associated with a SENSE_KEY of "RECOVERED_ERROR" and the
additional sense code is "ATA PASS-THROUGH INFORMATION
AVAILABLE". This only occurs with the SAT ATA PASS-THROUGH
commands when CK_COND=1 (in the cdb). It indicates that
the sense data contains ATA registers.
Smartmontools uses such commands on ATA disks connected via
SAT. Periodic checks such as those done by smartd cause
nuisance entries into logs that are:
- neither errors nor warnings
- pointless unless the cdb that caused them are also logged
Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Kashyap, Desai [Wed, 16 Dec 2009 13:31:58 +0000 (19:01 +0530)]
[SCSI] mptfusion: Added sysfs expander manufacture information at the time of expander add.
Added new function mptsas_exp_manufacture_info, which will
obtain the REPORT_MANUFACTURING, and fill the details into the
sas_expander_device object when the expander port is created.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
There is a 'ioprio' field in the BIO and the Request structure.
check this priority field and set MPI_SCSIIO_CONTROL_HEADOFQ
to pass down I/O priority.
An enhancement to the LSI Disk Array Controller firmware is being
developed to look at the Head Of Queue bit to allow I/Os with the HOQ bit
set to be processed before I/Os which do not have the HOQ bit set.
In order to set the HOQ bit, the mpt fusion driver needs to look at the
'ioprio' field in the request structure associated with the scsi command.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Finn Thain [Sat, 5 Dec 2009 01:30:42 +0000 (12:30 +1100)]
[SCSI] mac_esp: fix PIO mode, take 2
The mac_esp PIO algorithm no longer works in 2.6.31 and crashes my Centris
660av. So here's a better one.
Also, force async with esp_set_offset() rather than esp_slave_configure().
One of the SCSI drives I tested still doesn't like the PIO mode and fails
with "esp: esp0: Reconnect IRQ2 timeout" (the same drive works fine in
PDMA mode).
This failure happens when esp_reconnect_with_tag() tries to read in two
tag bytes but the chip only provides one (0x20). I don't know what causes
this. I decided not to waste any more time trying to fix it because the
best solution is to rip out the PIO mode altogether and use the DMA
engine.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Hannes Reinecke [Tue, 15 Dec 2009 08:26:06 +0000 (09:26 +0100)]
[SCSI] scsi_transport_fc: Remove capping from dev_loss_tmo
Currently dev_loss_tmo is capped by SCSI_DEVICE_BLOCK_MAX_TIMEOUT.
This causes problem with multipathing when the 'no_path_retry' setting
exceeds the dev_loss_tmo setting, as then the system might run into
a deadlock when all paths have been removed temporarily for longer
than dev_loss_tmo.
The principal reasons for the capping has been that we should
not allow a remote port to remain in status 'blocked' indefinitely,
so the capping is there to ensure that the port status is being reset
eventually.
However, the fast_io_fail_tmo will also move the remote port out of
the 'blocked' state, so for any HBA driver implementing both the
capping should really be on the fast_io_fail_tmo, and not on the
dev_loss_tmo.
This patch implements just that, ie the fast_io_fail_tmo is capped
to SCSI_DEVICE_BLOCK_TIMEOUT and the capping is removed from
dev_loss_tmo when fast_io_fail_tmo is set.
This allows us to synchronize the dev_loss_tmo setting to the
'no_path_retry' setting from multipathing thus avoiding the deadlock.
Signed-off-by: Hannes Reinecke <hare@suse.de> Acked-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Erik Ekman [Mon, 14 Dec 2009 20:21:56 +0000 (21:21 +0100)]
[SCSI] fusion: fix warning when not using procfs
Fixes the following warning:
drivers/message/fusion/mptbase.c:129: warning: 'mpt_proc_root_dir' defined but not used
also moves it from public data section since it is static.
Signed-off-by: Erik Ekman <erik@kryo.se> Acked-by: "Desai, Kashyap" <Kashyap.Desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>