History log of /drivers/message/fusion/mptfc.c
Revision Date Author Comments
5074b1b60edd47e0ce4485e57990f7ca75c3e67e 25-Jun-2014 Joe Lawrence <joe.lawrence@stratus.com> mptfusion: remove redundant kfree checks

Fixes the following smatch warnings:

drivers/message/fusion/mptfc.c:529 mptfc_target_destroy() info:
redundant null check on starget->hostdata calling kfree()

drivers/message/fusion/mptspi.c:465 mptspi_target_destroy() info:
redundant null check on starget->hostdata calling kfree()

Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
Acked-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
9cb78c16f5dadefd8dc5ba0ae5a2f26cd59419b3 25-Jun-2014 Hannes Reinecke <hare@suse.de> scsi: use 64-bit LUNs

The SCSI standard defines 64-bit values for LUNs, and large arrays
employing large or hierarchical LUN numbers become more and more
common.

So update the linux SCSI stack to use 64-bit LUN numbers.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@infradead.org>
Reviewed-by: Ewan Milne <emilne@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
a48ac9e5d4f3555bdec2fd61e49fc71b26810d68 27-Mar-2014 Matthew Wilcox <matthew.r.wilcox@intel.com> fusion: Remove use of DEF_SCSI_QCMD

Removing the host_lock from the I/O submission path gives a huge
scalability improvement.

Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Reviewed-by: Nicholas Bellinger <nab@linux-iscsi.org>
Reviewed-by: Praveen Krishnamoorthy <Praveen.krishnamoorthy@lsi.com>
Acked-by: Sreekanth Reddy <Sreekanth.reddy@lsi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
cac197031ce274efff8a5abea811b9d69ae3d740 31-Mar-2013 Al Viro <viro@zeniv.linux.org.uk> fusion: switch to ->show_info()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
47b1ea75fe072432f5b93ced21c019ed2b930c98 22-Dec-2012 Greg Kroah-Hartman <gregkh@linuxfoundation.org> Drivers: message: remove __dev* attributes.

CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
markings need to be removed.

This change removes the use of __devinit, __devexit_p, __devinitdata,
and __devexit from these drivers.

Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>
Cc: Sreekanth Reddy <Sreekanth.Reddy@lsi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
f281233d3eba15fb225d21ae2e228fd4553d824a 16-Nov-2010 Jeff Garzik <jeff@garzik.org> SCSI host lock push-down

Move the mid-layer's ->queuecommand() invocation from being locked
with the host lock to being unlocked to facilitate speeding up the
critical path for drivers who don't need this lock taken anyway.

The patch below presents a simple SCSI host lock push-down as an
equivalent transformation. No locking or other behavior should change
with this patch. All existing bugs and locking orders are preserved.

Additionally, add one parameter to queuecommand,
struct Scsi_Host *
and remove one parameter from queuecommand,
void (*done)(struct scsi_cmnd *)

Scsi_Host* is a convenient pointer that most host drivers need anyway,
and 'done' is redundant to struct scsi_cmnd->scsi_done.

Minimal code disturbance was attempted with this change. Most drivers
needed only two one-line modifications for their host lock push-down.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
213aaca3e5727f3eb56002b04a1405db34a54ed8 26-Jul-2010 Kashyap, Desai <kashyap.desai@lsi.com> [SCSI] mptfusion: Extra debug prints added relavent to Device missing delay error handling

Adding function name in original debug prints and few more debug prints are
added.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
08f5c5c23d52aa385ff304becffb0e0c37cedfe5 18-Mar-2010 Kashyap, Desai <kashyap.desai@lsi.com> [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>
ffb7fef32b98fff773a5a6882ae4f8aee65a7708 18-Mar-2010 Kashyap, Desai <kashyap.desai@lsi.com> [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>
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
03cb3829e0e5650518ce37e2b4420a35e034dc9e 10-Feb-2010 Michael Reed <mdr@sgi.com> [SCSI] fusion: hold off error recovery while alternate ioc is initializing

After discussing this patch with LSI, I resubmitting with a recommended
40 second wait for the alternate ioc's initialization to complete.
--
Fusion FC chips are two function with some shared resources. During
initialization of one function its driver inhibits the ability of the
other function's driver to allocate message frames by clearing its
"active" flag. Should mid-layer error recovery be initiated for a
scsi command during this initialization (which can take up to 40 seconds)
error recovery will escalate to the level of host reset. This host
reset might fail (as the other function is resetting) resulting in
all connected targets being taken offline.

This patch holds off mid-layer error recovery for up to 40 seconds
to permit initialization of the other function to complete.

Signed-off-by: Michael Reed <mdr@sgi.com>
Acked-by: "Desai, Kashyap" <Kashyap.Desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
a247fa4521ccec7cb82a9f2d4e8544fce27ea109 04-Aug-2009 Kashyap, Desai <kashyap.desai@lsi.com> [SCSI] mptsas : Removed mptscsih_timer_expired.

Removed mptscsih_timer_expired. This timer is no more use.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
ea2a788de4ce5ebab09276e25443f55592af2335 29-May-2009 Kashyap, Desai <kashyap.desai@lsi.com> [SCSI] mpt fusion: rewrite of ioctl_cmds internal generated function

1) rewrite of ioctl_cmds internal generated function that issue commands to
firmware, porting them to be single threaded using the generic MPT_MGMT
struct. All wait Queues are replace by completion Queue.
2) added seperate callback handler for ioctl task managment
(mptctl_taskmgmt_reply), to handle command that timeout
3) rewrite mptctl_bus_reset

Signed-off-by: Kashyap Desai <kadesai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
e7deff3374cc5951f914dcb3c66bc1b8de8a084e 29-May-2009 Kashyap, Desai <kashyap.desai@lsi.com> [SCSI] mpt fusion: Adding DeviceResetCtx for internal Device reset frame

1.) Added taskmgmt_quiesce_io flag in IOC and removed resetPending from
_MPT_SCSI_HOST struct.
2.) Reset from Scsi mid layer and internal Reset are seperate context.
Adding DeviceResetCtx for internal Device reset frame.
mptsas_taskmgmt_complete is optimized as part of implementation.

Signed-off-by: Kashyap Desai <kadesai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
37c60f374a855974c27bd30d5662a8fa5e933792 29-May-2009 Kashyap, Desai <kashyap.desai@lsi.com> [SCSI] mpt fusion: rewrite of all internal generated functions

Rewrite of all internal generated functions that issue commands to firmware,
porting them to be single threaded using the generic MPT_MGMT
struct. Implemented using completion Queue.

Signed-off-by: Kashyap Desai <kadesai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
14d0f0b063f5363984dd305a792854f9c23e9e97 29-May-2009 Kashyap, Desai <kashyap.desai@lsi.com> [SCSI] mpt fusion: Fixing 1078 data corruption issue for 36GB memory region

The reason for this change is there is a data corruption when four different
physical memory regions in the 36GB to 37GB region are
accessed. This is only affecting 1078.

The solution is we need to use different addressing when filling in
the scatter gather table for the effected memory regions. So instead
of snooping on all four different memory holes, we treat any physical
addresses in the 36GB address with the same algorithm.

The fix is explained below
1) Ensure that the message frames are NOT located in the trouble
region. There is no remapping available for message frames, they must
be allocated outside the problem region.
2) Ensure that Sense buffers are NOT in the trouble region. There is
no remapping available.
3) Walk through the SGE entries and if any are inside the trouble region
then they need to be remapped as discussed below.
1) Set the Local Address bit in the SGE Flags field.
MPI_SGE_FLAGS_LOCAL_ADDRESS
2) Ensure we are using 64-bit SGEs
3) Set MSb (Bit 63) of the 64-bit address, this will indicate buffer
location is Host Memory.

Signed-off-by: Kashyap Desai <kadesai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
cadbd4a5e36dde7e6c49b587b2c419103c0b7218 04-Jul-2008 Harvey Harrison <harvey.harrison@gmail.com> [SCSI] replace __FUNCTION__ with __func__

[jejb: fixed up a ton of missed conversions.

All of you are on notice this has happened, driver trees will now
need to be rebased]

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: SCSI List <linux-scsi@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
aab0de245150c09e61c30962feb16aacde508dc3 02-May-2008 Kay Sievers <kay.sievers@vrfy.org> driver core: remove KOBJ_NAME_LEN define

Kobjects do not have a limit in name size since a while, so stop
pretending that they do.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
cddc0ab71194a09c0ac359be10a0f1ef976ddc95 20-May-2008 Prakash, Sathya <sathya.prakash@lsi.com> [SCSI] mpt fusion : Updated copyright statment with 2008 included

Updating copyright statement to include the year 2008

Signed-off-by: Sathya Prakash <sathya.prakash@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
7ba2db5f38955907e46a65c9334d287cd3da32c2 13-Mar-2008 Michael Reed <mdr@sgi.com> [SCSI] fusion mpt: fix target missing after resetting external raid

Following a hard reset of a SAS raid, one of the raid targets is occasionally
missing. I tracked this down to a pretty obscure little bug.

The LSI fusion drivers for SAS and Fibre Channel both use their respective
transport layers. Those transport layers increment the target number
assigned to new targets.

The routine __scsi_scan_target uses the "this_id" element of the Scsi_Host
structure to avoid scanning the scsi host adapter. Both fusion drivers set
"this_id" from a value returned in a firmware PortFacts response. For my
particular test case (SAS) the firmware id assigned to the initiator was
173. After enough raid resets to cause the raid targets to go and come a
sufficient number of times, the id assigned by the transport to a raid
target would match the id assigned by the host adapter to the "this_id"
field, resulting in that target not being scanned.

Fix by not assigning this_id and not checking it in slave_configure.

Signed-off-by: Michael Reed <mdr@sgi.com>
Acked-by: "Moore, Eric" <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
e8206381f5842269691f3164ec0d79b7059bd710 29-Sep-2007 Eric Moore <eric.moore@lsi.com> [SCSI] mpt fusion: lock down ScsiLookup

ScsiLookup is an array of pending scmd pointers that the scsi lld
maintains. This array is touched from queuecommand, eh threads, and
interrupt context. This array should put under locks, hence this patch
to synchronize its access. I've added some nice little function
wrappers for this, and moved the ScsiLookup array over to MPT_ADAPTER
struct.

Signed-off-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
e7eae9f6e94cd49261c2997b0b4f768c1351bc02 29-Sep-2007 Eric Moore <eric.moore@lsi.com> [SCSI] mpt fusion: add use of shost_priv and remove all the typecasting

The driver is currently typecasting to obtain the shost hostdata. The
driver is updated to use the shost_priv macro.

Signed-off-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
e80b002bfd38263117da93feb4f67f5cf7d9221b 15-Sep-2007 Eric Moore <eric.moore@lsi.com> [SCSI] mpt fusion: removing references to hd->ioc

Cleaning up code by accesing the ioc pointer directly instead of via hd->ioc. In the future, most data members of struct MPT_SCSI_HOST will be either deleted or moved to struct MPT_ADAPTER.

Signed-off-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
a69de507aae293e32d22e873f34f25f49b2db3b2 15-Sep-2007 Eric Moore <eric.moore@lsi.com> [SCSI] mpt fusion: rename vdev to vdevice

common naming of vdevice through out driver

Signed-off-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
29dd3609f2fc70e02ce48123485b14d9417b834f 15-Sep-2007 Eric Moore <eric.moore@lsi.com> [SCSI] mpt fusion: standardize printks and debug info

Standardize all prints using common MYIOC_s_XXX_FMT macro defined in mptbase.h. Currently the driver uses several different methods to display info, where in some cases the "controller name" generating the printk is not provided.

Signed-off-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
f36789e22ac32a6554b8e4d05ab6125fc1161745 14-Aug-2007 Prakash, Sathya <sathya.prakash@lsi.com> [SCSI] mpt fusion: Change company name from LSI Logic to LSI

Recently LSI Logic Corp was renamed as LSI Corp, so whereever there is
a reference of LSI Logic, it is changed to LSI in mpt fusion driver
code.

signed-off-by: Sathya Prakash <sathya.prakash@lsi.com>
Acked-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
eb5329f40c13923e84a847204b5c5d62954eaf05 14-Aug-2007 Prakash, Sathya <sathya.prakash@lsi.com> [SCSI] mpt fusion: Link speed change display support

When there is state change in FC links, a message is displayed with
old and new link speed.

signed-off-by: Sathya Prakash <sathya.prakash@lsi.com>
Acked-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
f606f5718fa5a36e400000f91c44a5725b0f005d 14-Aug-2007 Prakash, Sathya <sathya.prakash@lsi.com> [SCSI] mpt fusion: Change call back indices to u8 from int

The call back index requires only u8 but in lot of places it is
referred as int, now everywhere the call back index variables are
declared as u8 with uniform name cb_idx

signed-off-by: Sathya Prakash <sathya.prakash@lsi.com>
Acked-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
d6ecdd638aa840604b87195f2097cabbd095092c 24-Jul-2007 Prakash, Sathya <sathya.prakash@lsi.com> [SCSI] mpt fusion: Changes in mptfc.c mptlan.c mptsas.c and mptspi.c for logging support

This patch contains changes in mptfc.c, mptlan.c, mptsas.c and mptspi.c to
support logging in MPT fusion drivers.

The changes are majorly in debug printks, the existing debugprintk are
modified accroding to new debug macros defined in the file mptbdebug.h

signed-off-by: Sathya Prakash <sathya.prakash@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
ef1d8df72fce074584244a8e3c4ae91606ccd784 17-Jul-2007 Prakash, Sathya <sathya.prakash@lsi.com> [SCSI] mpt fusion: add support for Brocade branded LSI FC HBA

Add support for Brocade 410/420 4Gbit FC HBAs.
They are re-branded LSI HBAs [LSI7104EP-LC/LSI7204EP-LC]

Signed-off-by: Sathya Prakash <sathya.prakash@lsi.com>
Acked-by: "Moore, Eric" <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
edb9068d0d7a3ba92f66b8c86cba625f3a439f64 17-Jul-2007 Prakash, Sathya <sathya.prakash@lsi.com> [SCSI] mpt fusion: add sysfs attributes to display IOC parameters

New sysfs scsi_host attributes are added to provide information about Firmware
version, BIOS version, MPI version and other product related information

signed-off-by: Sathya Praksh <sathya.prakash@lsi.com>
Acked-by: "Moore, Eric" <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
caa5dea19d4853f71b091cad8fde75e6f14ff1be 14-Jun-2007 Eric Moore <eric.moore@lsi.com> [SCSI] mpt fusion: remove unused header - linux_compat.h

remove unused header

Signed-off-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
16d201016a9f29e0557849907352769c63cef259 14-Jun-2007 Eric Moore <eric.moore@lsi.com> [SCSI] mpt fusion: update MAINTAINERS (fusion part)

Update assocated fusion sources with new support email address.

Signed-off-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
cd354f1ae75e6466a7e31b727faede57a1f89ca5 14-Feb-2007 Tim Schmielau <tim@physik3.uni-rostock.de> [PATCH] remove many unneeded #includes of sched.h

After Al Viro (finally) succeeded in removing the sched.h #include in module.h
recently, it makes sense again to remove other superfluous sched.h includes.
There are quite a lot of files which include it but don't actually need
anything defined in there. Presumably these includes were once needed for
macros that used to live in sched.h, but moved to other header files in the
course of cleaning it up.

To ease the pain, this time I did not fiddle with any header files and only
removed #includes from .c-files, which tend to cause less trouble.

Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
configs in arch/arm/configs on arm. I also checked that no new warnings were
introduced by the patch (actually, some warnings are removed that were emitted
by unnecessarily included header files).

Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
07c861d6d9ca3dc58e225bcfe2da0f378af6fa6c 29-Jan-2007 Eric Moore <eric.moore@lsi.com> [SCSI] fusion - bump version - 3.04.04

bump version, and fix email addr for lsi support

Signed-off-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
793955f549c710a1b0c18f823d5d710840747b15 29-Jan-2007 Eric Moore <eric.moore@lsi.com> [SCSI] fusion - Greater than 255 target and lun support

Add support for greater than 255 target and luns.
Kill the hd->Target[] field, and change all references
of bus_id/target_id, to channel/id.

Signed-off-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
9f4203b357d46a66c042df3dedf277ccaa5e2b1d 05-Jan-2007 Eric Moore <eric.moore@lsil.com> [SCSI] fusion: MODULE_VERSION support

* Add modinfo driver version support.
* Change copyright year to 2007.

Signed-off-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
d9489fb60614794cbca4b6b173c60ed9388974c6 07-Dec-2006 Randy Dunlap <randy.dunlap@oracle.com> [PATCH] kernel-doc: fix fusion and i2o docs

Correct lots of typos, kernel-doc warnings, & kernel-doc usage in fusion and
i2o drivers.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
c4028958b6ecad064b1a6303a6a5906d4fe48d73 22-Nov-2006 David Howells <dhowells@redhat.com> WorkStruct: make allyesconfig

Fix up for make allyesconfig.

Signed-Off-By: David Howells <dhowells@redhat.com>
35508e46aae4b57bd07d095eb11533e296b254dc 06-Oct-2006 Michael Reed <mdr@sgi.com> [SCSI] mptfc: stall eh handlers if resetting while rport blocked

Thanks to James Smart for the inspiration.

Stall error handler if attempting recovery while an rport is blocked.
This avoids device offline scenarios due to errors in the error handler.
Also verify that VirtDevice is available before issuing scsi command.
VirtDevice is removed when fc transport removes a target.

See James Smart's patch of 08/17/2006 for greater detail.

http://marc.theaimsgroup.com/?l=linux-scsi&m=115583213624803&w=2

Also bump version number per Eric's request.

Signed-off-by: Michael Reed <mdr@sgi.com>
Acked-by: Eric Moore <eric.moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
5d947f2b7607c4674d104accbd3768744aaa4154 31-Jul-2006 Michael Reed <mdr@sgi.com> [SCSI] mptfc: add additional fc transport attributes

Add host_supported_speeds, host_maxframe_size, host_speed, host_fabric_name,
host_port_type, host_port_state, and host_symbolic_name transport attributes
to fusion fibre channel.

Signed-off-by: Michael Reed <mdr@sgi.com>
Acked-by: Moore, Eric <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
3a0c56d801df6785b30e36c19e89d7e971c151da 31-Jul-2006 Michael Reed <mdr@sgi.com> [SCSI] mptfc: correct out of order event processing

This patch corrects a problem in mptfc which can result in targets
being removed after executing an "lsiutil 99" reset of the fibre
channel ports.

The last rescan event was being processed before the setup reset work
due to an inappropriate optimization in the event processing logic.
Every rescan event is now queued for execution and the setup reset
work now executes in the proper sequence.

Signed-off-by: Michael Reed <mdr@sgi.com>
Acked-by: Moore, Eric <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
77d88ee275aeba5da447987f30401bbd4c901ca9 31-Jul-2006 Michael Reed <mdr@sgi.com> [SCSI] mptfc: properly wait for firmware target discovery to complete

Based upon a conversation I had with LSI's fibre channel firmware guru,
this patch adds another condition under which the driver waits for the
firmware link initialization / target discovery to complete.

Signed-off-by: Michael Reed <mdr@sgi.com>
Acked-by: Moore, Eric <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
ba856d32f2cede67fd2a59a53bc662360f17c7b5 12-Jul-2006 Eric Moore <eric.moore@lsil.com> [SCSI] mptfusion: misc fix's

* removing obsolete 1066, 1066E from Kconfig
* initializing aen_event_read_flag after host reset
* remove oem references
* remove obsolete mpt_pq_filter command line option

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
87cf89866790a373edcf88c12b64d6d38560acdd 28-Jun-2006 Eric Moore <eric.moore@lsil.com> [SCSI] mptsas: Adding 1078 ROC support

* Adding 1078 ROC (Raid On Chip) Support - New host adapter

* Moving all PCI Vendor/Device ids to using internal defines; a request
from Christoph/James B. some time ago for when the next chip was added.

* Removing SAS 1066/1066E Vendor/Device IDs, as there are no plans to
manufacture that controller.

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
8f7607803717e9d045965b210cd16a25d80cd04b 27-Jun-2006 Jesper Juhl <jesper.juhl@gmail.com> [PATCH] Remove redundant NULL checks before [kv]free - in drivers/

Remove redundant NULL chck before kfree + tiny CodingStyle cleanup for
drivers/

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
d6be06c84da9626b10443c664ee55bda96fb3514 24-May-2006 Michael Reed <mdr@sgi.com> [SCSI] mptfc: abort of board reset leaves port dead requiring reboot

The driver uses msleep_interruptible() in the code path responsible
for resetting the card's ports via the lsiutil command. If a
<ctrl-c> is received during the reset it can leave a port in such
a state that the only way to regain its use is to reboot the system.
Changing from msleep_interruptible() to msleep() corrects the problem.

Signed-off-by: Michael Reed <mdr@sgi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
419835e285c3e39cd62c8c8426da0aebea9cd89f 24-May-2006 Michael Reed <mdr@sgi.com> [SCSI] mptfc: fix fibre channel infinite request/response loop

While doing board reset testing I was able to put the system in
an infinite request/response loop between the scsi layer and
mptscsih_qcmd() by aborting the reset. This patch installs
a "SETUP RESET" handler which calls fc_remote_port_delete()
for all registered rports. This blocks the target which
prevents the loop. Additionally, should the reset fail to
complete, the transport will now terminate i/o to the target.

Signed-off-by: Michael Reed <mdr@sgi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
ca2f938efe71ca48cbc689db4df8d4f04b5d8f07 24-May-2006 Michael Reed <mdr@sgi.com> [SCSI] mptfc: set fibre channel fw target missing timers to one second

The fibre channel firmware provides a timer which is similar in purpose
to the fibre channel transport's device loss timer. The effect of this
timer is to extend the total time that a target will be missing beyond
the value associated with the transport's timer. This patch changes
the firmware timer to a default of one second which significantly reduces
the lag between when a target goes missing and the notification of the
fibre channel transport.

Signed-off-by: Michael Reed <mdr@sgi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
80d3ac77a84987d5132726f3d7cef342a280f7d9 24-May-2006 Michael Reed <mdr@sgi.com> [SCSI] mptfusion: move fc event/reset handling to mptfc

Move fibre channel event and reset handling to mptfc. This will
result in fewer changes over time that need to be applied to
either mptbase.c or mptscsih.c.

Signed-off-by: Michael Reed <mdr@sgi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
6dd727da92290193d0f74fa39f3ad53f423524db 01-May-2006 mdr@sgi.com <mdr@sgi.com> [SCSI] mptfc: race between mptfc_register_dev and mptfc_target_alloc

A race condition exists in mptfc between the thread registering a device
with the fc transport and the scan work generated by the transport.
This race existed prior to the application of the mptfc bug fix patch.

mptfc_register_dev() calls fc_remote_port_add() with the FC_RPORT_ROLE_TARGET
bit set in the rport ids passed to the function. Having this bit set causes
fc_remote_port_add() to schedule a scan of the device.

This scan can execute before mptfc_register_dev() can fill in the dd_data
in the rport structure. When this happens, mptfc_target_alloc() will fail
because dd_data is null.

Attached is a patch which fixes the problem. The patch changes the rport ids
passed to fc_remote_port_add() to not have the TARGET bit set. This prevents
the scan from being scheduled. After mptfc_register_dev() fills in the rport
dd_data field, fc_remote_port_rolechg() is called, changing the role of the
rport to TARGET. Thus, the scan is scheduled after dd_data is filled
in which prevents the failure in mptfc_target_alloc().

Signed-off-by: Michael Reed <mdr@sgi.com>
Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
65207fedcf57dcb854a3ebb9da43c745106fe8d5 22-Apr-2006 Moore, Eric <Eric.Moore@lsil.com> [SCSI] - fusion - mptfc bug fix's to prevent deadlock situations

mptbase.h

bump version number to 3.03.09

remove unneeded flags
define workq and remove old fc specific locks

mptbase.c

initialize new lock and don't initialize two removed locks

mptscsih.c

when firmware reports target is no longer there, return
DID_REQUEUE for fc hosts so that i/o doesn't get killed until
the transport has an opportunity to manage the loss via its
dev loss timer

when the "eh_abort" routine is called, check to see if the
driver has the command or not before looking to see if a reset
is pending. James Smart and I talked about this and believe
that the API for this routine is: if driver doesn't have
command, return SUCCESS. This change helps prevent a target
from being taken offline. SUCCESS is returned because it's
likely that the command completed after error recovery timed
it out but before it could be aborted.

provide a routine to queue work to newly created workq, and
use it.

remove "ioc" from mptscsih_abort() it was only used one time.
the other references were via hd->ioc, so I just moved it....
net change in references to ioc via hd->ioc is zero

move hd->resetPending test and hd->timeouts increment to after
the test for whether the command to be aborted remains known
to the driver

Make certain that the workq exists before queuing work to it.

mptfc.c

no longer need to lock rport data structures as I was able to
single thread the code! I fixed up the debug code to
eliminate compilation messages due to type mismatch in the
printk. Got rid of some no longer needed rport flags.
Initialize and destroy the workq used for the rescan work.

simplify the logic regarding the increment of
fc_rescan_work_count. use post increment and test for zero
vs. pre increment and test for one; eliminate work_count
variable: queue_work can be called with the work_lock held as
it doesn't sleep

Signed-off-by: Michael Reed <mdr@sgi.com>
Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
914c2d8e597798d62c2e0a3cba737bf6f611eecf 14-Mar-2006 Moore, Eric <Eric.Moore@lsil.com> [SCSI] fusion - removing target_id/bus_id from the VirtDevice structure

It makes no sense in keeping the target_id and bus_id
in the VirtDevice structure, when it can be obtained
from the VirtTarget structure.

In addition, this patch fix's couple compilation bugs
in mptfc.c when MPT_DEBUG_FC is enabled. This
provided by Micheal Reed.

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
3a892bef3f7e94c4d6c2c20b9a1b546f43679fd3 14-Mar-2006 Moore, Eric <Eric.Moore@lsil.com> [SCSI] fusion - move some debug firmware event debug msgs to verbose level

Created a debug level MPT_DEBUG_VERBOSE_EVENTS.
Moving some of the more vebose debug messages
for firwmare events into new debug level. Also
added some more firmware events descriptions.

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
03fbcbcd57e9d1bc5a4fe6a81c1845e7365ddabc 25-Jan-2006 Adrian Bunk <bunk@stusta.de> [SCSI] drivers/message/fusion/mptfc.c: make 2 functions static

This patch makes two needlessly global functions static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
3bc7bf1d1294642f87c4f7df04c048dafa38ad51 26-Jan-2006 Michael Reed <mdr@sgi.com> [SCSI] fusion: FC rport code fixes

This fix's problems with recent fc submission regarding
i/o being redirected to the wrong target.

Signed-off-by: Michael Reed <mdr@sgi.com>
Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
6d5b0c315e0c14f8a0fe274eda7676d62cbd8584 14-Jan-2006 Moore, Eric <Eric.Moore@lsil.com> [SCSI] fusion - adding support for FC949ES

Add software recognition for the new LSI Logic Fibre Channel controller.

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
05e8ec17f4d11ba13795e878fc389cb04d1fdadd 13-Jan-2006 Michael Reed <mdr@sgi.com> [SCSI] mptfusion - fc transport attributes

Signed-off-by: Michael Reed <mdr@sgi.com>
Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
1ca00bb7916cb40b8140173c23481e11d92d6f6a 13-Jan-2006 Christoph Hellwig <hch@lst.de> [SCSI] fusion: kzalloc / kcalloc conversion

Convert kmalloc + memset to kzalloc or kcalloc in fusion.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
c7c82987b4844f555d309ccbd42abe95d46822ff 17-Nov-2005 Moore, Eric Dean <Eric.Moore@lsil.com> [SCSI] mptfusion - mapping fixs required support for transport layers.

This utilizes the hostdata area that is hung off of scsi_target and
scsi_device for saving unique firmware mapping. This will be required
for supporting new Fibre and SPI transport support.

This also fixs problems in error handling error code for SAS
controllers, in which the incorrect mapping was passed to the
firmware.

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
7acec1e7556a861416bb6b10f3e3cbb6e82fc01d 17-Nov-2005 Moore, Eric Dean <Eric.Moore@lsil.com> [SCSI] mptfusion - cleaning up xxx_probe error handling

This cleans the returning failure conditions of the
mptsas/mptfc/mptspi probe routines.

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
f78496da6a85f4b5f4532d7bf85b05fa655146a8 17-Nov-2005 Moore, Eric Dean <Eric.Moore@lsil.com> [SCSI] mptfusion - adding = THIS_MODULE

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
466544d8898fc87ed6e2e62ac14af7c50ab7a1a4 15-Sep-2005 Moore, Eric Dean <Eric.Moore@lsil.com> [SCSI] fusion SAS support (mptsas driver) updates

Summary of Changes:
* splitting mpt_interrupt per Christophs suggestion
about a month ago
* rename ScsiCfgData to SpiCfgData structure,
then move all the raid related info into
new structure called RaidCfgData. This is
done because SAS supports RAID, as well as SPI,
so the raid stuff should be seperate.
* incorrect timeout calculation for cntdn
inside WaitForDoorbellAck and WaitForDoortbellInt
* add support for interpreting SAS Log Info
* Increase Event Log Size from 0xA to 0x32
* Fix bug in mptsas/mptfc/mptspi - when controller
has Initiator Mode Disabled, and only running in
TargetMode, the mptctl would panic when loading.
The fix is to return 0, instead of -ENODEV, in
SCSI LLD respective probe routines
* Fix bug in mptlan.c - driver will panic if
there is host reset, due to dev being set to
zero in mpt_lan_ioc_reset
* Fix's for SPI - Echo Buffer
* Several fix's in mptscsih_io_done - FCP Response
info, RESIDUAL_MISMATCH, Data Underrun, etc.
* Cleanup Error Handling - EH handlers,
mptscsih_flush_cmds, and zeroing out ScsiLookup
from mptscsih_qcmd
* Cleanup asyn event handling from
mptscsih -> mptscsih_event_process. Also
added support for SAS Persistent Table Full,
an asyn event

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
6e3815ba3a6d392fa9cfbf08208f64c06d9558c4 24-Jun-2005 Moore, Eric Dean <Eric.Moore@lsil.com> [SCSI] - mptfusion - convert to new change_queue_depth API

Convert driver to use new change_queue_depth API.

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>

Fixed up rejections and
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
d18c3db58bc544fce6662ca7edba616ca9788a70 24-Jun-2005 Greg Kroah-Hartman <gregkh@suse.de> [PATCH] PCI: make drivers use the pci shutdown callback instead of the driver core callback.

Now we can change the pci core to always set this pointer, as pci drivers
should use it, not the driver core callback.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12413197eef2a29e0b9fb0fa541f5cbaeb1d3f3f 11-Jun-2005 Christoph Hellwig <hch@lst.de> [SCSI] remove scsi_set_device

scsi_add_host is the proper place to set the device, but people copy
the scsi_set_device usage from older drivers again and again.

note that this leaves some legacy drivers like qlogicisp/qlogicfc
without pci association in sysfs, but they're scheduled to go away soon
anyway.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
3fadc59d603caf70e7a5295158e4f6eb06dffb8f 12-May-2005 Moore, Eric Dean <Eric.Moore@lsil.com> [SCSI] fusion - Adding pci recog support for Fibre 949X and 939X chips

* adding pci id support for new Fibre chips, 949X and 939X
* adding errata workaround - disabling PIO access except during fwdlb.

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
d335cc38c75e28407455463444b912b09c92daec 01-May-2005 Moore, Eric Dean <Eric.Moore@lsil.com> [SCSI] mptfusion: fix panic loading driver statically compiled


Adjust link ordering in the Makefile. Also, the ioc->DoneCtx handles
for mptspi/mptfc in the message frame. And I'm now not seeing the
panic.

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2496af3945bdcc5fe774b8220a415086a47f40a0 23-Apr-2005 Moore, Eric Dean <Eric.Moore@lsil.com> [SCSI] mptfusion: mptfc Adding Stub Driver - Fiber Channel

(1) mptfc.c: This driver is having module_init, module_exit, and probe.
(2) mptfc.c: Registering for Fibre Channel pci ids are done from this
module.
(3) mptfc.c: Convert MODULE_PARM to module_param

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>