GitHub/LineageOS/android_kernel_motorola_exynos9610.git
14 years ago[SCSI] add scsi trace core functions and put trace points
Kei Tokunaga [Thu, 1 Apr 2010 11:41:40 +0000 (20:41 +0900)]
[SCSI] add scsi trace core functions and put trace points

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@jp.fujitsu.com>
Signed-off-by: Kei Tokunaga <tokunaga.keiich@jp.fujitsu.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] ftrace: add __print_hex()
Kei Tokunaga [Thu, 1 Apr 2010 11:40:58 +0000 (20:40 +0900)]
[SCSI] ftrace: add __print_hex()

__print_hex() prints values in an array in hex (w/o '0x') (space separated)
EX) 92 33 32 f3 ee 4d

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@jp.fujitsu.com>
Signed-off-by: Kei Tokunaga <tokunaga.keiich@jp.fujitsu.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] Add missing scsi command definitions
Martin K. Petersen [Tue, 23 Mar 2010 05:13:28 +0000 (01:13 -0400)]
[SCSI] Add missing scsi command definitions

Add definitions for VERIFY(12) and VERIFY(32).

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] scsi_debug: Block Limits VPD page fixes
Martin K. Petersen [Tue, 23 Mar 2010 05:12:27 +0000 (01:12 -0400)]
[SCSI] scsi_debug: Block Limits VPD page fixes

Add a few clarifying comments in the B0 page function and allow the
optimal transfer length field to be specified on the command line using
opt_blks=N.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mvsas: fix hot plug handling and IO issues
Srinivas [Mon, 15 Feb 2010 06:00:00 +0000 (00:00 -0600)]
[SCSI] mvsas: fix hot plug handling and IO issues

This patch adds a bunch of fixes

1. Reduce sg table size to 64 (SG_MX) instead of default SG_ALL
2. clear task lists on phy down events
3. release all tasks on port deformation
4. release current task for device gone notification
5. Add sata abort handing
6. Add 10ms delay to each port reset (currently done serially and with
   interrupts disabled)

[jejb: whitespace fixes and clean ups plus added description
       added dummy 94xx_clear_srs_irq function just to prevent the
       mismatch in the mvs_dispatch structure killing 94xx cards]
Signed-off-by: Srinivas <satyasrinivasp@hcl.in>
Cc: Andy Yan <ayan@marvell.com>
Cc: qswang@marvell.com
Cc: jfeng@marvell.com
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] iscsi_tcp: Remove unused field iscsi_conn from struct iscsi_sw_tcp_conn
Avi Kaplan [Sat, 10 Apr 2010 03:07:39 +0000 (22:07 -0500)]
[SCSI] iscsi_tcp: Remove unused field iscsi_conn from struct iscsi_sw_tcp_conn

iscsi_conn is not used so remove it from iscsi_sw_tcp_conn.

Signed-off-by: Avi Kaplan <savik751@gmail.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] iscsi_tcp: Change iscsi_sw_tcp_conn_restore_callbacks arguments
Avi Kaplan [Sat, 10 Apr 2010 03:07:38 +0000 (22:07 -0500)]
[SCSI] iscsi_tcp: Change iscsi_sw_tcp_conn_restore_callbacks arguments

This patch changes the arguments to iscsi_sw_tcp_conn_restore_callbacks,
so that it works like the function to set the callbacks and because
in upcoming patches we need a iscsi_conn.

Signed-off-by: Avi Kaplan <savik751@gmail.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] scsi_dh_emc: request flag cleanup
Mike Christie [Sat, 10 Apr 2010 03:07:37 +0000 (22:07 -0500)]
[SCSI] scsi_dh_emc: request flag cleanup

blk_get_request sets the cmd_flags, so we should not and do not
need to set them. If we did set them to a different value then
it can cause a oops in the elevator code.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] iscsi_tcp: change & to &&
Dan Carpenter [Sat, 10 Apr 2010 03:07:36 +0000 (22:07 -0500)]
[SCSI] iscsi_tcp: change & to &&

This change is basically a clean up.

datadgst_en is an int which comes from the user.  I didn't see anything
limiting it to 1 and 0 although obviously that's what it's supposed to
be.  If the user passed in 2 this test would fail.

This same if condition is repeated in another function and it uses &&
there.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] libfc, fcoe: normalize format specifies for world wide names
Chris Leech [Fri, 9 Apr 2010 21:23:16 +0000 (14:23 -0700)]
[SCSI] libfc, fcoe: normalize format specifies for world wide names

Print all world wide node names (node, port and fabric) with the same
format specifier of "%16.16llx".  That makes sure they all print as a
16 character hex string, with lower case letters, no 0x prefix, and
without stripping off any leading 0s.

Signed-off-by: Chris Leech <christopher.leech@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] libfc: set both precision and field with when printing FC IDs
Chris Leech [Fri, 9 Apr 2010 21:23:10 +0000 (14:23 -0700)]
[SCSI] libfc: set both precision and field with when printing FC IDs

Most of the prints of fabric IDs were specified as %6x, which will not
print any leading 0s.  It's nice to see leading 0s for identifiers
like this, which are a fixed length.  This patch sets the precision
modifier as well, making the specifier %6.6x, which forces the
printing of leading 0s.

Signed-off-by: Chris Leech <christopher.leech@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] libfc: bug in erroring out upon FCP_RSP_LEN_VAL in fc_fcp_resp
Yi Zou [Fri, 9 Apr 2010 21:23:05 +0000 (14:23 -0700)]
[SCSI] libfc: bug in erroring out upon FCP_RSP_LEN_VAL in fc_fcp_resp

fc_fcp_resp is assuming when FCP_SNS_LEN_VAL is set, the FCP_RSP_LEN_VAL
is not, which is not true. This leads to not copying the sense data and
error out a valid FCP_RSP.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] fcoe, fnic, libfc: increased CDB size to 16 bytes for fcoe.
Vasu Dev [Fri, 9 Apr 2010 21:22:59 +0000 (14:22 -0700)]
[SCSI] fcoe, fnic, libfc: increased CDB size to 16 bytes for fcoe.

No reason to restrict CDB size to 12 bytes in fcoe, so
increased to 16 so that 16 bytes SCSI CDB doesn't fail.

Uses common define to set max_cmd_len for fcoe and fnic,
fnic is already setting max_cmd_len to 16.

sg_readcap -l fails without this fix.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] fcoe: removes unused shost in fcoe_shost_config
Vasu Dev [Fri, 9 Apr 2010 21:22:54 +0000 (14:22 -0700)]
[SCSI] fcoe: removes unused shost in fcoe_shost_config

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] fnic: Change fnic_flush_tx() to flush tx instead of rx queue
Brian Uchino [Fri, 9 Apr 2010 21:22:49 +0000 (14:22 -0700)]
[SCSI] fnic: Change fnic_flush_tx() to flush tx instead of rx queue

fnic_flush_tx() is used to send frames held while fabric login
is in progress.  The frames are held in tx_queue, but
fnic_flush_tx() was incorrectly flushing from recv_queue which
is used for received frames.

Signed-off-by: Brian Uchino <buchino@cisco.com>
Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] fnic: Update version to 1.4.0.145
Brian Uchino [Fri, 9 Apr 2010 21:22:44 +0000 (14:22 -0700)]
[SCSI] fnic: Update version to 1.4.0.145

New fnic version to mark inclusion of tx_flush bugfix.

Signed-off-by: Brian Uchino <buchino@cisco.com>
Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] libfc: fix hton24 macro to take expressions as args
Joe Eykholt [Fri, 9 Apr 2010 21:22:39 +0000 (14:22 -0700)]
[SCSI] libfc: fix hton24 macro to take expressions as args

hton24(p + 3, value) would fail to compile because
p + 3[0] is not a valid expression.

Went ahead and converted hton24 and ntoh24 to inline
functions, which is better because the parameters
are evalutated only once.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] libfc: remove unneeded variables in fc_exch_recv_req()
Joe Eykholt [Fri, 9 Apr 2010 21:22:33 +0000 (14:22 -0700)]
[SCSI] libfc: remove unneeded variables in fc_exch_recv_req()

fc_exch_recv_req has variables eof, sof, and f_ctl,
which are set but never used.  Delete them.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] fcoe: check netif operstate instead of IFF_UP & link state
Chris Leech [Fri, 9 Apr 2010 21:22:28 +0000 (14:22 -0700)]
[SCSI] fcoe: check netif operstate instead of IFF_UP & link state

Allow for dormant states while link configuration completes.
In the default link mode, this is equivalent to the old check.

Signed-off-by: Chris Leech <christopher.leech@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] fcoe: reset FIP ctlr link state on disable/enable
Chris Leech [Fri, 9 Apr 2010 21:22:23 +0000 (14:22 -0700)]
[SCSI] fcoe: reset FIP ctlr link state on disable/enable

The FIP controler state wasn't being reset on a disable.
A disable/enable sequence should be treated as a link event.
Otherwise, when using disable to mask a time when the link
is up but unusable, FCF discovery would attempt to continue
and login would jump directly to the non-FIP fallback on
enable.

Signed-off-by: Chris Leech <christopher.leech@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] libfcoe: Don't fill MAC desc in FLOGI if FIP negotiated FPMA
Robert Love [Fri, 9 Apr 2010 21:22:17 +0000 (14:22 -0700)]
[SCSI] libfcoe: Don't fill MAC desc in FLOGI if FIP negotiated FPMA

FPMA indicates that the Fabric will provide the host's
N_Port's MAC address. When sending a FLOGI/FDISC frame
and FPMA was negotiated through FIP discovery we still
need to provide the MAC descriptor, as per the
specification, but the MAC should be zero'd out since
the FCF will be providing it in the FLOGI/FDISC ACC.

In FC-BB-5 section 7.8.7.4.2 (Fabric login) it states:

The MAC address field in the MAC address descriptor of a FIP FLOGI
Request operation or a FIP NPIV FDISC Request operation shall contain:
a) the proposed MAC address to use as VN_Port MAC address if the ENode
   is requesting to use SPMA (see table 27);
b) all zeroes to indicate no MAC address is proposed if the ENode is
   requesting to use FPMA (see table 27); or
c) the proposed MAC address to use as VN_Port MAC address if the ENode
   supports both SPMA and FPMA and leaves the decision of which
   addressing scheme to use to the FCF (i.e., if both the FP and SP
   bits are set to one, see table 27).

This patch fixes case B.

This patch also adds debug statements to illustrate
whether a FPMA or SPMA MAC is added to a FLOGI/FDISC
frame.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: Chris Leech <christopher.leech@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: Bump version 05.100.00.02
Kashyap, Desai [Thu, 8 Apr 2010 12:25:52 +0000 (17:55 +0530)]
[SCSI] mpt2sas: Bump version 05.100.00.02

Upgrade version to 05.100.00.02

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: Before removing sas_device search device in list for _scsih_sas_devic...
Kashyap, Desai [Thu, 8 Apr 2010 12:25:22 +0000 (17:55 +0530)]
[SCSI] mpt2sas: Before removing sas_device search device in list for _scsih_sas_device_remove

Fix a oops in _scsih_sas_device_remove.  The driver was attempting to
delete a object from the sas_device link list when the object was not
present.

Added sanity check for sas_device NULL dereference.
before deleting sas_device now driver will search device in list then
only it will follow device removal.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: Reworked scmd->result priority for _scsih_qcmd.
Kashyap, Desai [Thu, 8 Apr 2010 12:24:32 +0000 (17:54 +0530)]
[SCSI] mpt2sas: Reworked scmd->result priority for _scsih_qcmd.

we added support to set the deleted flag prior to device scan,
then clear the flag for responding devices, leaving the deleted flag only
set for missing devices.  The problem is for internal generated host resets,
IO queues are not blocked at scsi mid layer level.  IO will be continued
sent to driver, and driver  will return SCSI_MLQUEUE_HOST_BUSY.  The problem
is the driver checks for the deleted flag before it checks for the
controller being in reset, so there is a window where the driver would be
returning DID_NO_CONNECT for responding devices.  This occurs during  the
time between calling  _scsih_prep_device_scan, and
_scsih_mark_responding_sas_device & _scsih_mark_responding_raid_device.

Fix the queuecommand entry point so ioc->shost_recovery flag sanity check is
given higher presidence then the device "deleted flag" check.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] lpfc 8.3.12: Update Driver version to 8.3.12
James Smart [Tue, 6 Apr 2010 19:07:03 +0000 (15:07 -0400)]
[SCSI] lpfc 8.3.12: Update Driver version to 8.3.12

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] lpfc 8.3.12: Fix discovery issues
James Smart [Tue, 6 Apr 2010 19:06:30 +0000 (15:06 -0400)]
[SCSI] lpfc 8.3.12: Fix discovery issues

- Add code to prevent unreg_vpi mailbox command from failing.
- Add code to reset the HBA if unreg_vpi mailbox fails with busy status.
- Remove code that was clearing the nlp_type stored during rport discovery.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] lpfc 8.3.12: BSG Fixes and enhancements
James Smart [Tue, 6 Apr 2010 19:05:28 +0000 (15:05 -0400)]
[SCSI] lpfc 8.3.12: BSG Fixes and enhancements

- Add memcpy to mailbox completion to transfer reply correctly.
- Add support for BSG mailbox commands (dump, update_cfg, and
   event_log_status).
- Add warning message and refuse mailbox command while mgmt is blocked.
- Add checks for memory allocation failure.
- Add check for sli4 dump zero BDE size.
- Only copy data if mailbox commands succeed.
- Add support for Read Event Log mailbox command.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] lpfc 8.3.12: Critical fixes
James Smart [Tue, 6 Apr 2010 19:04:33 +0000 (15:04 -0400)]
[SCSI] lpfc 8.3.12: Critical fixes

- Move the code to increase the sg seg count for LP21000 adapters.
- Check pcmd on command completion before dereferencing it.
- Clear queue memory when creating firmware queues to prevent stale entries.
- Replace the use of PAGE_SIZE in many areas that assumed it was always 4k.
- Add an else clause to a conditional that needed to unlock the hba_lock.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] lpfc 8.3.12: T10-PI/DIF changes
James Smart [Tue, 6 Apr 2010 18:49:53 +0000 (14:49 -0400)]
[SCSI] lpfc 8.3.12: T10-PI/DIF changes

Update driver for change in T10-PI interface on adapter
- Remove Profiles.
- Add new SLI Opcodes.
- Add new PDE structures used for BlockGuard.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] lpfc 8.3.12: Miscellaneous Changes
James Smart [Tue, 6 Apr 2010 18:49:03 +0000 (14:49 -0400)]
[SCSI] lpfc 8.3.12: Miscellaneous Changes

- Prevent log message 1801 during vport delete.
- Enable NPIV by default.
- Display correct value for max Vports on SLI4 HBAs.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] lpfc 8.3.12: Emulex SLI enhancements
James Smart [Tue, 6 Apr 2010 18:48:51 +0000 (14:48 -0400)]
[SCSI] lpfc 8.3.12: Emulex SLI enhancements

- Add the new Logical Link speed event support.
- Add RATOV and EDTOV to the REG_VFI mailbox command.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: Upgrade version 05.100.00.01
Kashyap, Desai [Mon, 5 Apr 2010 08:51:48 +0000 (14:21 +0530)]
[SCSI] mpt2sas: Upgrade version 05.100.00.01

Upgraded version string.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: Check for NULL pointer before free_pages is added.
Kashyap, Desai [Mon, 5 Apr 2010 08:51:07 +0000 (14:21 +0530)]
[SCSI] mpt2sas: Check for NULL pointer before free_pages is added.

Added check before free_pages just to make sure ioc->scsi_lookup is not NULL.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: Added support for PCIe Advanced Error Recovery.
Kashyap, Desai [Mon, 5 Apr 2010 08:50:07 +0000 (14:20 +0530)]
[SCSI] mpt2sas: Added support for PCIe Advanced Error Recovery.

Added support in the driver to support EEH and
PCIe Advanced Error Recovery. This involves adding new
pci_error_handler interface for recovering the controller from PCI Bus
errors, such as SERR and PERR. Some tools are available for simulating
PCI errors in order to validate this interface:
http://www.kernel.org/pub/linux/utils/pci/aer-inject

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: Send default descriptor for RAID pass through in mpt2ctl
Kashyap, Desai [Mon, 5 Apr 2010 08:49:21 +0000 (14:19 +0530)]
[SCSI] mpt2sas: Send default descriptor for RAID pass through in mpt2ctl

RAID_SCSI_IO_PASSTHROUGH: Driver needs to be sending the default
descriptor for RAID Passthru, currently its sending SCSI_IO descriptor.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: sanity added to remove duplicate port from topology
Kashyap, Desai [Mon, 5 Apr 2010 08:48:34 +0000 (14:18 +0530)]
[SCSI] mpt2sas: sanity added to remove duplicate port from topology

There are few special cases which needs to be handled deleting old port.

CASE1: In topology you need cascaded expanders. Through sysfs just make sure
topology is up. Erase the manufacturing image of the cascaded expander and
reset the board. In some cases Adapter will receive Exapnder Add event
before expander delete. In such a case, driver needs to delete duplicate
port before adding new port.

CASE2: Enable Device Missing delay of HBA through lsiutils. If expander or
end device is hotswapped with different device before DMD timer expires,
driver will get device add for new device first and then device deletion
event for the original devices will arrive later at DMD timer expires. In
this case also driver need to delete duplicate port before adding port for
new device.

Added new function which will make sure when new port is
added, that its not claiming the same phy resources already in use by
another port. If it does, then it will delete the other port before adding
the new port.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] scsi_debug: add max_queue + no_uld parameters
Douglas Gilbert [Thu, 25 Mar 2010 21:29:05 +0000 (17:29 -0400)]
[SCSI] scsi_debug: add max_queue + no_uld parameters

While testing the midlevel q_at_head and q_at_tail
patch for sg and the block SG_IO ioctl I found it
useful to reduce the queuing within the scsi_debug
driver. The reason is that the midlevel queue only
comes into play when the corresponding LLD queue
is full.

It is also useful when testing to be confident that
your program is the only thing issuing commands
to the (virtual) scsi_debug device. The no_uld=1
parameter will stop a scsi_debug virtual disk
appearing as /dev/sd* .

Changelog:
   - add max_queue parameter to reduce the number
     of queued commands the driver will accept.
     This parameter can be changed after the driver
     is loaded.
   - add no_uld parameter that restricts scsi_debug's
     virtual devices to the sg and bsg drivers
   - correct stale url

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] sd: retry read_capacity on UNIT_ATTENTION
James Bottomley [Thu, 1 Apr 2010 14:30:01 +0000 (10:30 -0400)]
[SCSI] sd: retry read_capacity on UNIT_ATTENTION

Hazard testing uncovered yet another bug in sd. Under heavy reset
activity the retry counter might be exhausted and the command will be
returned with sense UNIT_ATTENTION/0x29/00 (POWER ON, RESET, OR BUS
DEVICE RESET OCCURRED). In those cases we should just increase the
retry counter again, retrying one more to clear up this Unit Attention
state.

[jejb: update to work with RC16 devices and not to loop endlessly]
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas : IOs needs to be pause until handles are refreshed for all device...
Kashyap, Desai [Tue, 30 Mar 2010 05:22:44 +0000 (10:52 +0530)]
[SCSI] mpt2sas : IOs needs to be pause until handles are refreshed for all device after recovery

After Host Reset firmware will have new list of device handles for the target.
Device handle refresh in driver is part of Rescan topology logic.
(See functions like *_search_responding_*). This needs to be done from Host
Reset context before making shost_recovery to 0. Currently it is done in
Firwmare event context, which may leads IO to a wrong device.

Now handler refresh is moved to HBA reset context.
Apart from this, Now driver will stop IOs for all device setting deleted
flag to 1 at the time of HBA Reset through _scsih_prep_device_scan.
It will only unblock devices, if devices has been found as part of RESCAN.
This way it will make more safe IO blocking at the time of HBA reset at
mpt2sas driver layer.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] sd: quiet spurious error messages in READ_CAPACITY(16)
Hannes Reinecke [Mon, 29 Mar 2010 07:29:24 +0000 (09:29 +0200)]
[SCSI] sd: quiet spurious error messages in READ_CAPACITY(16)

sd always tries to submit a READ_CAPACITY(16) CDB,
regardless whether the host actually supports it.
queuecommand() will then return DID_ABORT, which is
not qualified enough to detect the true cause here.
So better check in sd_try_rc16 first if the cdblen
is supported.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] bnx2i: Update version and module description
Anil Veerabhadrappa [Thu, 25 Mar 2010 17:54:44 +0000 (10:54 -0700)]
[SCSI] bnx2i: Update version and module description

missing 10G drivers added to description

Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] bnx2i: link bnx2i hba and cnic device before registering the device
Anil Veerabhadrappa [Thu, 25 Mar 2010 17:54:42 +0000 (10:54 -0700)]
[SCSI] bnx2i: link bnx2i hba and cnic device before registering the device

When bnx2/cnic/bnx2i drivers are loaded in certain order, bnx2i will
will not initialize the device correctly because 'hba->cnic' will be
NULL when bnx2i_start() is called from register_device() context.
Under this condition 'ifdown' and 'ifup' of associated network
interface is required to bring iscsi adapter state to ready state so
that it will accept iscsi connection setup within the chip

Initializing 'hba->cnic' before calling register_device() will fix
this issue

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] bnx2i: make firmware use statsn field when constructing header
Anil Veerabhadrappa [Thu, 25 Mar 2010 17:54:40 +0000 (10:54 -0700)]
[SCSI] bnx2i: make firmware use statsn field when constructing header

instruct firmware to use driver/iscsid provided expected statsn field
while constructing login pdu header.

Initialize 'flags' to instruct chip to use driver/iscsid provided
ExpStatSN value while constructing iSCSI login PDU header

Signed-off-by: Eddie Wai <waie@broadcom.com>
Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] zfcp: Pass return code from fc_block_scsi_eh to scsi eh
Christof Schmitt [Wed, 24 Mar 2010 15:50:31 +0000 (16:50 +0100)]
[SCSI] zfcp: Pass return code from fc_block_scsi_eh to scsi eh

The return code FAST_IO_FAIL from fc_block_scsi_eh indicates that the
pending I/O requests have been terminated as a result of the
fast_io_fail_tmo. Pass this return code back to the scsi eh to stop
the scsi eh in this case.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] Allow FC LLD to fast-fail scsi eh by introducing new eh return
Christof Schmitt [Wed, 24 Mar 2010 15:50:30 +0000 (16:50 +0100)]
[SCSI]  Allow FC LLD to fast-fail scsi eh by introducing new eh return

If the scsi eh is running and then a FC LLD calls
fc_remote_port_delete, the SCSI commands sent from the eh will fail.
To prevent this, a FC LLD can call fc_block_scsi_eh from the eh
callback, blocking the eh thread until the dev_loss_tmo fires or the
remote port is available again.

If (e.g. for a multipathing setup) the dev_loss_tmo is set to a very
large value, thus preventing the scsi device removal , the scsi eh can
block for a long time. For multipathing, the fast_io_fail_tmo is then
set to a low value to detect path problems sooner.

This patch introduces a new return code FAST_IO_FAIL. The function
fc_block_scsi_eh now returns FAST_IO_FAIL when the fast_io_fail_tmo
fires. This indicates that the LLD terminated all pending I/O requests
and there are no more pending SCSI commands for the scsi eh to wait
for. This return code can be passed back to the scsi eh to stop the
escalation and finish the recovery process for this device.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] qla2xxx: Fix documentation of ql2xfdmienable module parameter
Ferenc Wagner [Tue, 23 Mar 2010 17:14:59 +0000 (18:14 +0100)]
[SCSI] qla2xxx: Fix documentation of ql2xfdmienable module parameter

The default is enabled since 7e47e5ca184548341a82eeb2238ee3622c43cae1.

Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Acked-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] qla2xxx: General checkpatch corrections.
Andrew Vasquez [Sat, 20 Mar 2010 00:04:02 +0000 (17:04 -0700)]
[SCSI] qla2xxx: General checkpatch corrections.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] qla2xxx: Fix to make conditional decision based on port number.
Sarang Radke [Sat, 20 Mar 2010 00:04:01 +0000 (17:04 -0700)]
[SCSI] qla2xxx: Fix to make conditional decision based on port number.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] qla2xxx: Free DMA memory only if it is allocated in vendor specific BSG command
Harish Zunjarrao [Sat, 20 Mar 2010 00:04:00 +0000 (17:04 -0700)]
[SCSI] qla2xxx: Free DMA memory only if it is allocated in vendor specific BSG command

The qla84xx_mgmt_cmd function supports multiple subcommands.
Some subcommands require DMA memory and some do not.
Therefore check before freeing DMA memory whether it is allocated or not.

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] qla2xxx: Add APEX support.
Sarang Radke [Sat, 20 Mar 2010 00:03:59 +0000 (17:03 -0700)]
[SCSI] qla2xxx: Add APEX support.

Allows priority setting for FCP_CMNDs.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] qla2xxx: Re-organized BSG interface specific code.
Giridhar Malavali [Sat, 20 Mar 2010 00:03:58 +0000 (17:03 -0700)]
[SCSI] qla2xxx: Re-organized BSG interface specific code.

1. Segregate BSG interface specific code to new files.
2. Handle multiple vendor specific commands indepedently.
3. Reorganised support for reset, management and update FCoE firmware commands.
4. Fixed memory leak issue in Loopback.
5. Added new vendor command to support iiDMA using BSG interface.
6. Proper cleanup of dma mapped and dma allocated buffers for BSG request.

[jejb: fix up conflict and merge in Jiri Slaby lock imbalance patch]
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] bfa: sg addr big endian fix
Jing Huang [Fri, 19 Mar 2010 18:07:36 +0000 (11:07 -0700)]
[SCSI] bfa: sg addr big endian fix

sg address in IO request is not set up correctly for big endian platform.
add new macros to properly swap the address.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] bfa: protect idr using bfad_mutex
Jing Huang [Fri, 19 Mar 2010 18:07:09 +0000 (11:07 -0700)]
[SCSI] bfa: protect idr using bfad_mutex

idr is a global resource, protect it with global bfad_mutex.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] bfa: use pci_iomap() and pci_iounmap()
Jing Huang [Fri, 19 Mar 2010 18:06:44 +0000 (11:06 -0700)]
[SCSI] bfa: use pci_iomap() and pci_iounmap()

Use pci_iomap() and pci_iounmap() to simplify the code. Remove uncessary #ifdef
check for ia64 (it was added as a workaound for some RHEL 5.x release which
doesn't export iounmap function)

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] bfa: fix the issue of not handling scsi_cmnd sg chaining case
Jing Huang [Fri, 19 Mar 2010 18:06:05 +0000 (11:06 -0700)]
[SCSI] bfa: fix the issue of not handling scsi_cmnd sg chaining case

Currently the driver doesn't take into consideraion of possible sg chaining
when it walks through the sg list. This is fixed by using the sg_next()
which automatically handles the chaining case. Obosolete code is removed
as a result of this change.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] bfa: add fc transport class based vport create/delete
Jing Huang [Fri, 19 Mar 2010 18:05:39 +0000 (11:05 -0700)]
[SCSI] bfa: add fc transport class based vport create/delete

Use duplicate fc transport template for physical and vitual port. Add
vport create/delete/disalbe functions in the transport template of physical
port. Changes to make the vport create/delete function to work under this
framework.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] don't kfree an initialized struct device
Alan Stern [Thu, 18 Mar 2010 19:41:22 +0000 (15:41 -0400)]
[SCSI] don't kfree an initialized struct device

This patch (as1359) fixes a bug in scsi_alloc_target().  After a
device structure has been initialized (and especially after its name
has been set), it must not be freed directly.  One has to call
put_device() instead.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] don't reap targets upon device_add failure
Alan Stern [Thu, 18 Mar 2010 19:41:11 +0000 (15:41 -0400)]
[SCSI] don't reap targets upon device_add failure

This patch (as1358) fixes a bug in the error pathway of
scsi_target_add().  If registration fails, the target should not be
reaped.  The reaping occurs later, when scanning is finished and all
the child devices are removed.  The current code leaves an unbalanced
value in starget->reap_ref.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mptfusion: Bump version 03.04.15
Kashyap, Desai [Thu, 18 Mar 2010 13:56:02 +0000 (19:26 +0530)]
[SCSI] mptfusion: Bump version 03.04.15

Upgrade version from 3.04.14 to 3.04.15

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mptfusion: Proper error handling is added after mpt_config timeout
Kashyap, Desai [Thu, 18 Mar 2010 13:54:57 +0000 (19:24 +0530)]
[SCSI] mptfusion: Proper error handling is added after mpt_config timeout

Added proper error handling after mpt_config.
Now check of MPI_IOCSTATUS_CONFIG_INVALID_PAGE is added.
If error is MPI_IOCSTATUS_CONFIG_INVALID_PAGE, driver will return -ENODEV.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mptfusion: Event data alignment with 4 byte.
Kashyap, Desai [Thu, 18 Mar 2010 13:54:20 +0000 (19:24 +0530)]
[SCSI] mptfusion: Event data alignment with 4 byte.

event_data needs to be 4 byte aligned to makes sure there is no unaligned
memory access take place.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mptfusion: Check for command status is added after completion.
Kashyap, Desai [Thu, 18 Mar 2010 13:53:50 +0000 (19:23 +0530)]
[SCSI] mptfusion: Check for command status is added after completion.

1) Corrected name string as "MPT SAS HOST"
2) Added proper check conditions for MPT_MGMT_STATUS_COMMAND_GOOD.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mptfusion: Task abort is not supported for Volumes
Kashyap, Desai [Thu, 18 Mar 2010 13:53:19 +0000 (19:23 +0530)]
[SCSI] mptfusion: Task abort is not supported for Volumes

1) corrected return value as SUCCESS instead of 0.
2) Added check in mptscsih_abort.
mptfusion do not support task abort for Volumes.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mptfusion: sanity check for vdevice pointer is added
Kashyap, Desai [Thu, 18 Mar 2010 13:52:45 +0000 (19:22 +0530)]
[SCSI] mptfusion: sanity check for vdevice pointer is added

Added sanity checks before accessing vdevice and added vdevice->deleted
setting for mptfc.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mptfusion: Setting period,offset and width for SPI driver
Kashyap, Desai [Thu, 18 Mar 2010 13:51:34 +0000 (19:21 +0530)]
[SCSI] mptfusion: Setting period,offset and width for SPI driver

Set factor, offset and width while target negotiation.

Added config timeout 60 seconds. It was missing for only
mptspi_read_spi_device_pg0

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mptfusion: Proper bus_type check is added
Kashyap, Desai [Thu, 18 Mar 2010 13:50:38 +0000 (19:20 +0530)]
[SCSI] mptfusion: Proper bus_type check is added

Added proper bus_type check before processing event/ reset handler.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mptfusion: mpt_detach is called properly at the time of rmmod
Kashyap, Desai [Thu, 18 Mar 2010 13:48:30 +0000 (19:18 +0530)]
[SCSI] mptfusion: mpt_detach is called properly at the time of rmmod

Current design of mptsas is as follow.
MPTSAS will do probe() if pci id matches for available card in
system, irrespective of mode of controller. If controller is I/T mode
or I mode, things are fine. If controller is only in T mode, mptsas is
not doing complete process of mptsas_probe(). It will only make
sure IOC structure is created and IOC reference is available for
mptstm driver. Now While removing module we should take care
case of Target mode only mptsas. If we are removing IOC which is
only in Target mode, We should only detach IOC instead of
following rest of the cleanup process which is only required for T
mode controller. Now For T mode controller, only part clean up is
done instead of complete cleanup. mpt_detach will call early in case
of Target mode only controller.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mptfusion: mpt config will do Hard Reset based upon retry counts
Kashyap, Desai [Thu, 18 Mar 2010 13:44:51 +0000 (19:14 +0530)]
[SCSI] mptfusion: mpt config will do Hard Reset based upon retry counts

mpt_config would only attempt a MUR before retrying the command. The
driver will now retry a second time with a hard reset before leaving
the function.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mptfusion: Updated SCSI IO IOCTL error handling.
Kashyap, Desai [Thu, 18 Mar 2010 13:43:10 +0000 (19:13 +0530)]
[SCSI] mptfusion: Updated SCSI IO IOCTL error handling.

Behavior changes only for IOCTLs that time out.  Current behavior of
Bus Reset remains the same for RAID Passthru Timeouts Current behavior
of Diagnostic reset for any other type of IOCTL remains the same

CHANGE: For IOCTL SCSI IOs that timeout, a Target Reset TM is sent,
instead of Bus Reset. All error handing from that point is the same as
what the driver currently does, which is to say that if the Device
Reset TM fails it escalates do diagnostic reset.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mptfusion: Added new less expensive RESET (Message Unit Reset)
Kashyap, Desai [Thu, 18 Mar 2010 13:42:17 +0000 (19:12 +0530)]
[SCSI] mptfusion: Added new less expensive RESET (Message Unit Reset)

Message Unit Reset - instructs the IOC to reset the Reply Post and
Free FIFO's. All the Message Frames on Reply Free FIFO are
discarded. All posted buffers are freed, and event notification is
turned off.  IOC doesnt reply to any outstanding request. This will
transfer IOC to READY state.  Message unit ready is less expensive
operations than Hard Reset.  soft reset will not force Firmware to
reload again, it only do clean up of Message units.

mpt_Soft_Hard_ResetHandler will first try for Soft Reset,if
it fails then go for big hammer reset which is Hard Reset.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: Bump version 05.100.00.00
Kashyap, Desai [Wed, 17 Mar 2010 10:58:34 +0000 (16:28 +0530)]
[SCSI] mpt2sas: Bump version 05.100.00.00

Upgraded version string.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: Copyright 2010.
Kashyap, Desai [Wed, 17 Mar 2010 10:58:04 +0000 (16:28 +0530)]
[SCSI] mpt2sas: Copyright 2010.

Copyright changes for year 2010.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: Default descriptor for RAID Passthru command.
Kashyap, Desai [Wed, 17 Mar 2010 10:57:25 +0000 (16:27 +0530)]
[SCSI] mpt2sas: Default descriptor for RAID Passthru command.

RAID_SCSI_IO_PASSTHROUGH: Driver needs to be send the default
descriptor for RAID Passthru, currently its sending SCSI_IO descriptor.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: return -ENOMEM if memory allocation failed.
Kashyap, Desai [Wed, 17 Mar 2010 10:56:48 +0000 (16:26 +0530)]
[SCSI] mpt2sas: return -ENOMEM if memory allocation failed.

Added proper return type values in case memory allocation failed.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: removed use of tm_cmds.mutex in IOCTL branch.
Kashyap, Desai [Wed, 17 Mar 2010 10:55:59 +0000 (16:25 +0530)]
[SCSI] mpt2sas: removed use of tm_cmds.mutex in IOCTL branch.

Removed all the mutex's for ioc->tm_cmds.mutex, then created one
single mutex inside the function mpt2sas_scsih_issue_tm. This is the
single function used when sending task management. Also the sanity
checks required for scsi mid layer escalation were moved to inside the
same function because these checks need to be done while the mutex is
held. The ioc->tm_cmds.mutex inside the IOCTL branch is really not
required since there is another mutex in this code called for ctl_cmds
handling this sync.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: Fix for little endian
Kashyap, Desai [Wed, 17 Mar 2010 10:54:52 +0000 (16:24 +0530)]
[SCSI] mpt2sas: Fix for little endian

1. Fixes for little endian issues.
2. Now Debug info for Discovery event is more readable.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: Driver will not treat NEEDS_INIT as failure.
Kashyap, Desai [Wed, 17 Mar 2010 10:54:14 +0000 (16:24 +0530)]
[SCSI] mpt2sas: Driver will not treat NEEDS_INIT as failure.

Now Driver will not treat NEEDS_INIT as failure. In addition to this,
the driver will now display message to describe the the access flags
when bits are set, so the end user can better understand failures.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: Early return from function if shost is in recovery.
Kashyap, Desai [Wed, 17 Mar 2010 10:53:36 +0000 (16:23 +0530)]
[SCSI] mpt2sas: Early return from function if shost is in recovery.

Aded checks for shost_recovery flag for early return from function.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: Use of get_free_pages for huge memorary allocation.
Kashyap, Desai [Wed, 17 Mar 2010 10:52:52 +0000 (16:22 +0530)]
[SCSI] mpt2sas: Use of get_free_pages for huge memorary allocation.

use the get_free_pages API for larger contigious physical memory chunk.
Also, the ioc->chain_depth need to be changed from
a 16bit to 32bit variable because the number of chains will exceed 64k
when the queue depth is large.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: Corrected conditional checks for Internal device Reset
Kashyap, Desai [Wed, 17 Mar 2010 10:52:21 +0000 (16:22 +0530)]
[SCSI] mpt2sas: Corrected conditional checks for Internal device Reset

bug fix in the handling of the internal device reset event
The reason code check in scsih_sas_device_status_change_event never
evaluates as true for internal device reset, hence driver never quiesce s IO
when firmware is sending a device reset. The fix is to change the
evaluate to:
if (event_data->ReasonCode !=
    MPI2_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET &&
   event_data->ReasonCode !=
    MPI2_EVENT_SAS_DEV_STAT_RC_CMP_INTERNAL_DEV_RESET)
        return;

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas: Corrected time stamp
Kashyap, Desai [Wed, 17 Mar 2010 10:51:33 +0000 (16:21 +0530)]
[SCSI] mpt2sas: Corrected time stamp

incorrect timestamp on 32 bit platforms: The upper 32 bit of
the timestamp was getting truncated when converting seconds to
milliseconds, which was due to the variable being long. To fix the problem,
the variable needs to be u64. Also the microseconds conversion to
milliseconds was incorrect; it should be divide by 1000 instead of divide by
8.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt2sas : Do not reset handle before calling _scsih_remove_device in RESCAN...
Kashyap, Desai [Wed, 17 Mar 2010 09:50:37 +0000 (15:20 +0530)]
[SCSI] mpt2sas : Do not reset handle before calling _scsih_remove_device in RESCAN task after HBA RESET

Setting handle to zero is not required before _scsih_remove_device.
Driver uses sas_device->handle reference in _scsih_remove_device.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] lpfc 8.3.11: Update Driver version to 8.3.11
James Smart [Mon, 15 Mar 2010 15:25:58 +0000 (11:25 -0400)]
[SCSI] lpfc 8.3.11: Update Driver version to 8.3.11

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] lpfc 8.3.11: NPIV changes
James Smart [Mon, 15 Mar 2010 15:25:44 +0000 (11:25 -0400)]
[SCSI] lpfc 8.3.11: NPIV changes

- Enable NPIV by default.
- Added code to handle unsolicited LOGO on physical port.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] lpfc 8.3.11: Fix AER uncorrectable non-fatal error handling
James Smart [Mon, 15 Mar 2010 15:25:32 +0000 (11:25 -0400)]
[SCSI] lpfc 8.3.11: Fix AER uncorrectable non-fatal error handling

Only abort outstanding I/O to force the OS to retry failed I/Os for AER
uncorrectable non-fatal errors instead of reseting the adapter.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] lpfc 8.3.11: Driver management improvements via BSG
James Smart [Mon, 15 Mar 2010 15:25:20 +0000 (11:25 -0400)]
[SCSI] lpfc 8.3.11: Driver management improvements via BSG

- Add BSG support for PCI loopback testing.
- Add BSG support for extended mailbox commands.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] lpfc 8.3.11: SLI4 Improvements
James Smart [Mon, 15 Mar 2010 15:25:07 +0000 (11:25 -0400)]
[SCSI] lpfc 8.3.11: SLI4 Improvements

- Correct all SLI4 code to work on big endian systems.
- Move read of sli4 params earlier so returned values are used correctly.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] lpfc 8.3.11: FCF failover improvements
James Smart [Mon, 15 Mar 2010 15:24:56 +0000 (11:24 -0400)]
[SCSI] lpfc 8.3.11: FCF failover improvements

FCF failover improvements

- Add random FCF failover when there are multiple FCFs available.
- Prevent FCF log messages from being displayed for FC adapters.
- Separate the New FCF and Modified FCF log messages.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] mpt: modify mptctl_exit() to call proper deregister functions
Kei Tokunaga [Mon, 15 Mar 2010 05:48:43 +0000 (14:48 +0900)]
[SCSI] mpt: modify mptctl_exit() to call proper deregister functions

This patch fixes some issues of mptctl_exit().

  1) It doesn't call mpt_deregister() for mptctl_taskmgmt_id
     => Insmoding/rmmoding mptctl.ko repeadtedly (up to
        MPT_MAX_PROTOCOL_DRIVERS-1 at most) can eat up all cb_idx,
        and that would cause a lack of MptCallbacks[], MptDriverClass[],
        and MptEvHandlers[].

  2) It doesn't call mpt_event_deregister() for mptctl_id
     => Need to call it.

  3) It calls mpt_reset_deregister() for mptctl_taskmgmt_id
     => This could accidentally deregister an innocent reset handler
        that you don't want to.

This patch also adds a check for mptctl_taskmgmt_id.

Signed-off-by: Kei Tokunaga <tokunaga.keiich@jp.fujitsu.com>
Acked-by: "Desai, Kashyap" <Kashyap.Desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] libfc, libfcoe, fcoe: use smp_processor_id() only when preempt disabled
Joe Eykholt [Sat, 13 Mar 2010 00:08:55 +0000 (16:08 -0800)]
[SCSI] libfc, libfcoe, fcoe: use smp_processor_id() only when preempt disabled

When the kernel is configured for preemption, using smp_processor_id()
when preemption is enabled causes a warning backtrace and is wrong
since we could move off of that CPU as soon as we get the ID,
and we would be referencing the wrong CPU, and possibly an invalid one
if it could be hotswapped out.

Remove the fc_lport_get_stats() function and explicitly use per_cpu_ptr()
to get the statistics.  Where preemption has been disabled by holding
a _bh lock continue to use smp_processor_id(), but otherwise use
get_cpu()/put_cpu().

In fcoe_recv_frame() also changed the cases where we return in the
middle to do a goto to the code which bumps ErrorFrames and does
a put_cpu().  Two of these cases didn't bump ErrorFrames before, but
doing so is harmless because they "can't happen", due to prior length
checks.

Also rearranged code in fcoe_recv_frame() to have only one call to
fc_exch_recv().  It's just as efficient and saves a call to put_cpu().

In fc_fcp.c, adjusted a FIXME comment for code which doesn't need fixing.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] libfc: Add debug statements when fc_fcp returns DID_ERROR to scsi-ml
Robert Love [Sat, 13 Mar 2010 00:08:50 +0000 (16:08 -0800)]
[SCSI] libfc: Add debug statements when fc_fcp returns DID_ERROR to scsi-ml

DID_ERROR cases can be ambigouos. Debugging FCP error cases
will be much easier if we have debug statements when we hit
these error conditions.

This patch simply adds debug messages using the FC_FCP_DBG
macro when we return DID_ERROR to SCSI. This way if a DID_ERROR
is reproducible turning on debug_logging will give a clue
to developers as to what the problem might be.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] libfc: fix fcp pkt recovery in fc_fcp_recv_data
Vasu Dev [Sat, 13 Mar 2010 00:08:44 +0000 (16:08 -0800)]
[SCSI] libfc: fix fcp pkt recovery in fc_fcp_recv_data

Currently fc_fcp_recv_data calls fc_fcp_retry_cmd to
retry failed IO but in this case tgt is still sending
data frames, therefore exchange needs to be aborted
first before initiating retry. So this patch fixes
this by aborting exchange first then have retry.

Renames fc_timeout_error to fc_fcp_recovery since
fc_timeout_error is already called from several other
places beside from fcp timeout handler and then
used fc_fcp_recovery for abort & retry from
fc_fcp_recv_data, this rename also required renaming
FC_CMD_TIME_OUT status to FC_CMD_RECOVERY to be
consistent with new fc_fcp_recovery.

Data frames are not expected for an DDPed exchange and
potentially it could be tampered data frame, so does
recovery in this case by calling fc_fcp_recovery.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] libfc: use offload EM instance again instead jumping to next EM
Vasu Dev [Sat, 13 Mar 2010 00:08:39 +0000 (16:08 -0800)]
[SCSI] libfc: use offload EM instance again instead jumping to next EM

Since use of offloads is more efficient than switching
to non-offload EM. However kept logic same to call em_match
if it is provided in the list of EMs.

Converted fc_exch_alloc to inline being now tiny a function
and already not an exported libfc API any more.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] libfc: fixes unnecessary seq id jump
Vasu Dev [Sat, 13 Mar 2010 00:08:34 +0000 (16:08 -0800)]
[SCSI] libfc: fixes unnecessary seq id jump

In some cases seq is incremented twice causing unnecessary
seq jump, for instance fc_exch_recv_seq_resp increments
seq id when fc_sof_is_init is true and that is true for
each incoming xfer ready but then fc_fcp_send_data does
another seq increment to send data for xfer ready.

This patch removes all such seq id jumps, at least it
eliminates few calls to fc_seq_start_next using ex_lock.

Also removes seq id update with incoming frame's seq id
as this is not needed since each end (I or T) just need
to send incremented their own seq id on each TSI from
other end & before sending new sequence within a
exchange.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] libfc: fix sequence-initiative WARN in fc_seq_start_next
Joe Eykholt [Sat, 13 Mar 2010 00:08:29 +0000 (16:08 -0800)]
[SCSI] libfc: fix sequence-initiative WARN in fc_seq_start_next

When starting a new response sequence in a multi-sequence
exchange, a warning was issued that sequence initiative
wasn't held.

The bug was that sequence initiative was cleared by the previous
sequence due to the END_SEQ flag being on.  The intent may have
been to check LAST_SEQ.  Change just to check SEQ_INIT.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] libfcoe: eliminate unused link and last_link fields
Joe Eykholt [Sat, 13 Mar 2010 00:08:23 +0000 (16:08 -0800)]
[SCSI] libfcoe: eliminate unused link and last_link fields

The link and last_link fields in the fcoe_ctlr struct are no
longer useful, since they are always set to the same value,
and FIP always calls libfc to pass link information to the lport.

Eliminate those fields and rename link_work to timer_work, since
it no longer has any link change work to do.

Thanks to Brian Uchino for discovering this issue.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] fcoe: remove an unused variable in fcoe_recv_frame()
Joe Eykholt [Sat, 13 Mar 2010 00:08:18 +0000 (16:08 -0800)]
[SCSI] fcoe: remove an unused variable in fcoe_recv_frame()

Remove an unused variable, mac, in fcoe_recv_frame().

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] libfc: send point-to-poin FLOGI LS_ACC to assigned D_DID
Joe Eykholt [Sat, 13 Mar 2010 00:08:12 +0000 (16:08 -0800)]
[SCSI] libfc: send point-to-poin FLOGI LS_ACC to assigned D_DID

The method we've been using for point-to-point mode requires
that the LS_ACC for the FLOGI uses the D_ID and S_ID assigned
to the remote port and local port, not those in the exchange.

This is not the correct method, but for now, it's what works
with the old target, as well as with new targets based on libfc.

This patch changes the addresses used accordingly.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] libfc: recognize incoming FLOGI for point-to-point mode
Joe Eykholt [Sat, 13 Mar 2010 00:08:07 +0000 (16:08 -0800)]
[SCSI] libfc: recognize incoming FLOGI for point-to-point mode

When receiving a FLOGI request from a point-to-point peer,
the D_ID of 0xfffffe was not recognized as belonging to one
of the lports, so it was dropped.

Change fc_vport_id_lookup() to treat d_id 0xfffffe as a match.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] fcoe: save gateway address when receiving FLOGI request
Joe Eykholt [Sat, 13 Mar 2010 00:08:02 +0000 (16:08 -0800)]
[SCSI] fcoe: save gateway address when receiving FLOGI request

In point-to-point mode, we need to save the source MAC
from received FLOGI requests to use as the destination MAC
for all outgoing frames.  We stopped doing that at some point.

Use the lport_set_port_id method to catch incoming FLOGI frames
and pass them to fcoe_ctlr_recv_flogi() so it can save the source MAC.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>