Commit Graph

145 Commits (6d9d63b9480e1c7ea41845646de803c2d3f0eae2)

Author SHA1 Message Date
andrew.vasquez@qlogic.com d97994dc1f [SCSI] qla2xxx: Correct synchronization issues during rport addition/deletion.
The driver can typically detect port-loss during an
interrupt context (i.e. via interrogation of a status IOCB's
completion status [CS_PORT_LOGGED_OUT].  Due to the calling
requirements of the fc_rport APIs, the driver would defer
removal of the device to the default workqueue.  If the
work-item was preceded by an event which caused the port to
obtain visibility (relogin successful, target re-logged into
the topology), deferred removal could inadvertently drop the
rport.  The code also no longer defers removal via the
default workqueue, instead opting for use of the driver's
own DPC thread.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-01-26 08:16:50 -05:00
andrew.vasquez@qlogic.com 79f89a4296 [SCSI] qla2xxx: Disable port-type RSCN handling via driver state-machine.
Given the semantic changes in both the device-model and
fc-transport APIs, the driver's handling of port-type RSCNs
via a series of ADISCs and PLOGIs can cause series of
badness ranging from unexpectedly device loss to devices not
being discovered.

In the interim, disable (via a module-parameter) this
feature and allow RSCN management to continue to occur
within the driver's DPC thread.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-01-14 10:55:39 -06:00
James Bottomley 0a21ef1e60 [SCSI] qla2xxx: fix compile error caused by pci_dev.owner move
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:12:07 -07:00
Andrew Vasquez 331e347686 [SCSI] qla2xxx: Add support for embedded ISP24xx firmware.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:19 -07:00
Andrew Vasquez 5433383ef3 [SCSI] qla2xxx: Add full firmware(-request) hotplug support for all ISPs.
Transition driver to exclusively use the request_firmware()
interfaces to retrieve firmware-blobs from user-space.  This
will be the default behaviour going forward until the
embedded firmware-binary images are removed from the
upstream kernel.

Upon request, the driver caches the firmware image until the
driver is unloaded.

NOTE: The option is present to allow the user to continue to
use the firmware-loader modules, but, should be considered
deprecated.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

Rejections fixed up and
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:16 -07:00
James.Smart@Emulex.Com 19a7b4aebf [SCSI] update fc_transport for removal of block/unblock functions
We recently went back to implement a board reset. When we perform the
reset, we wanted to tear down the internal data structures and rebuild
them. Unfortunately, when it came to the rport structure, things were
odd. If we deleted them, the scsi targets and sdevs would be
torn down. Not a good thing for a temporary reset. We could block the
rports, but we either maintain the internal structures to keep the
rport reference (perhaps even replicating what's in the transport),
or we have to fatten the fc transport with new search routines to find
the rport (and deal with a case of a dangling rport that the driver
forgets).

It dawned on me that we had actually reached this state incorrectly.
When the fc transport first started, we did the block/unblock first, then
added the rport interface. The purpose of block/unblock is to hide the
temporary disappearance of the rport (e.g. being deleted, then readded).
Why are we making the driver do the block/unblock ? We should be making
the transport have only an rport add/delete, and the let the transport
handle the block/unblock.

So... This patch removes the existing fc_remote_port_block/unblock
functions. It moves the block/unblock functionality into the
fc_remote_port_add/delete functions.  Updates for the lpfc driver are
included. Qlogic driver updates are also enclosed, thanks to the
contributions of Andrew Vasquez. [Note: the qla2xxx changes are
relative to the scsi-misc-2.6 tree as of this morning - which does
not include the recent patches sent by Andrew]. The zfcp driver does
not use the block/unblock functions.

One last comment: The resulting behavior feels very clean. The LLDD is
concerned only with add/delete, which corresponds to the physical
disappearance.  However, the fact that the scsi target and sdevs are
not immediately torn down after the LLDD calls delete causes an
interesting scenario... the midlayer can call the xxx_slave_alloc and
xxx_queuecommand functions with a sdev that is at the location the
rport used to be. The driver must validate the device exists when it
first enters these functions. In thinking about it, this has always
been the case for the LLDD and these routines. The existing drivers
already check for existence. However, this highlights that simple
validation via data structure dereferencing needs to be watched.
To deal with this, a new transport function, fc_remote_port_chkready()
was created that LLDDs should call when they first enter these two
routines. It validates the rport state, and returns a scsi result
which could be returned. In addition to solving the above, it also
creates consistent behavior from the LLDD's when the block and deletes
are occuring.

Rejections fixed up and
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-10-28 21:20:07 -05:00
Andrew Vasquez 91ca7b01ec [SCSI] Add an 'Issue LIP' device attribute in fc_transport class
Ok, here's a patch to add such a common API for fc transport users.
Relevant LLD changes (lpfc and qla2xxx) also present.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-10-28 19:35:25 -05:00
James Bottomley 28f22b031f [SCSI] qla2xxx: put back label erroneously removed by eh_active patch
The label eh_dev_reset_done is still in use

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-10-28 17:22:18 -05:00
Andrew Vasquez 9a41a62b74 [SCSI] qla2xxx: remove eh_active checks in qla2xxx error handling
Here's a patch which drops the eh_active checks in the qla2xxx
eh_handler callbacks.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-10-28 13:25:26 -05:00
Andrew Vasquez fa90c54f6d [SCSI] qla2xxx: Update license.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-10-28 11:53:23 -05:00
Andrew Vasquez 4fdfefe529 [SCSI] qla2xxx: Add support to dynamically enable/disable ZIO.
ISP23xx and ISP24xx chips have support for an adaptive
method of posting SCSI command completions for multiple SCSI
commands during a single system interrupt.

SCSI commands are placed on the system response queue
without interrupting the host until 1) a delay timer
expires; or 2) a SCSI command completes with an error.

As long as the host software (qla2xxx) services the response
queue for completions (this polling is done during
queuecommand()) within the 'delay timer' period, the
firmware will not generate system interrupt.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-10-28 11:52:11 -05:00
Andrew Morton 444d1d9bb5 [PATCH] qlogic lockup fix
If qla2x00_probe_one()'s call to qla2x00_iospace_config() fails, we call
qla2x00_free_device() to clean up.  But because ha->dpc_pid hasn't been set
yet, qla2x00_free_device() tries to stop a kernel thread which hasn't started
yet.  It does wait_for_completion() against an uninitialised completion struct
and the kernel hangs up.

Fix it by initialising ha->dpc_pid a bit earlier.

Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-25 13:51:48 -07:00
Andrew Vasquez f6ef3b1872 [SCSI] qla2xxx: Stop firmware execution at unintialization time.
On ISP24xx parts, stop execution of firmware during ISP
tear-down.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-04 19:53:57 -05:00
Andrew Vasquez fe74c71f6b [SCSI] qla2xxx: Replace schedule_timeout().
From: Nishanth Aravamudan <nacc@us.ibm.com>

Replace schedule_timeout() with
msleep()/msleep_interruptible() as appropriate, to guarantee the task
delays as expected.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-04 19:53:52 -05:00
Andrew Vasquez 86cd6baa82 [SCSI] qla2xxx: Remove bad call to fc_remove_host() during probe failure.
fc_remove_host() should only be called after a scsi_host has
been successfully added via scsi_add_host() -- any failures
while qla2xxx probing would result in an incorrect call to
fc_remove_host() during cleanup.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-04 19:53:50 -05:00
Andrew Vasquez afb046e2be [SCSI] qla2xxx: Add host attributes.
Export additional host information via the shost_attrs member in
the scsi_host template.  Attributes include: driver version,
firmware version, ISP serial number, ISP type, ISP product ID,
HBA model name, HBA model description, PCI interconnect
information, and HBA port state.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-04 19:53:42 -05:00
Andrew Vasquez ce7e4af7f5 [SCSI] qla2xxx: Add change_queue_depth/type() API support.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-04 19:53:40 -05:00
Andrew Vasquez c00c72ae01 [SCSI] qla2xxx: Simplify redundant target/device reset logic.
Remove redundant qla2x00_target_reset() function in favour of
the equivalent qla2x00_device_reset().  Update callers of
old function.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-04 19:53:10 -05:00
Andrew Vasquez cca5335caf [SCSI] qla2xxx: Add FDMI support.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-04 19:53:07 -05:00
Andrew Vasquez 7524f9b9e7 [SCSI] qla2xxx: Use dma_get_required_mask() in determining the 'ideal' DMA mask.
In order to efficiently utilise the ISP's IOCB
request-queue, use the dma_get_required_mask() function to
determine the use of command-type 2 or 3 IOCBs when queueing
SCSI commands.  This applies to ISP2[123]xx chips only, as
the ISP24xx uses command-type 7 IOCBs which use 64bit DSDs.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-04 19:53:02 -05:00
Andrew Vasquez 77d7414361 [SCSI] qla2xxx: Cleanup FC remote port registration.
Cleanup FC remote port registration.

Due to the inherent behaviour (an immediate scan) of adding
a 'target'-role-capable rport via fc_remote_port_add(),
split the registration into two steps -- addition as
unknown-type role, then use fc_remote_port_rolchg() with
appropriate role (based on PLOGI/PRLI bits).  This allows
for a more cleaner rport->dd_data management as can be seen
with the simplified qla2xxx_slave_alloc() function.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-07-14 11:15:55 -04:00
Andrew Vasquez f0883ac6a7 [SCSI] qla2xxx: Add firmware version number to qla24xx_fw_version_str().
Add firmware version number to qla24xx_fw_version_str().

Original code was accidently trimmed during port.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-07-14 11:15:10 -04:00
Andrew Vasquez ae91193cd5 [SCSI] qla2xxx: Update copyright banner.
Update copyright banner.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-07-14 11:12:12 -04:00
Andrew Vasquez fa2a1ce53d [SCSI] qla2xxx: Code scrubbing.
Code scrubbing.

 - Remove trailing whitespace from driver files.
 - Remove unused #defines and inlines.
 - Standardize on C comments (// -> /* */)

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-07-14 11:03:15 -04:00
Andrew Vasquez fca2970371 [SCSI] qla2xxx: Add OS initialization codes for ISP24xx recognition.
Add OS initialization codes for ISP24xx recognition.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-07-14 11:02:23 -04:00
Andrew Vasquez 0107109ed6 [SCSI] qla2xxx: Add ISP24xx initialization routines.
Add ISP24xx initialization routines.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-07-14 11:02:06 -04:00
Andrew Vasquez 459c537807 [SCSI] qla2xxx: Add ISP24xx flash-manipulation routines.
Add ISP24xx flash-manipulation routines.

Add read/write flash manipulation routines for the ISP24xx.
Update sysfs NVRAM objects to use generalized accessor
functions.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-07-14 10:56:54 -04:00
Andrew Vasquez 1c7c63574f [SCSI] qla2xxx: Add MBX command routines for ISP24xx support.
Add MBX command routines for ISP24xx support.

Generalize several routines [qla2x00_load_ram_ext(),
qla2x00_execute_fw(), qla2x00_verify_checksum()] to handle
larger addressing space.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-07-14 10:56:39 -04:00
Andrew Vasquez 3d71644cf9 [SCSI] qla2xxx: Add ISP24xx definitions.
Add ISP24xx definitions.

Add requisite structure definitions and #define's for ISP24xx
support.  Also drop volatile modifiers from device_reg_* register
layouts as the members are never really accessed, only their
offsets within the layout are used during reads and writes.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-07-14 10:54:46 -04:00
Andrew Vasquez abbd8870b9 [SCSI] qla2xxx: Factor-out ISP specific functions to method-based call tables.
Factor-out ISP specific functions to method-based call tables.

In anticipation of ISP24xx/ISP25xx support, factor-out ISP
specific functions into a method-based call table.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-07-14 10:47:30 -04:00
James Bottomley 3afa294c40 merge by hand (qla_os.c mismerge) 2005-06-17 19:04:18 -05:00
James Bottomley 3237ee78fc merge by hand (fix up qla_os.c merge error) 2005-06-17 18:42:23 -05:00
Jeff Garzik df0ae2497d [SCSI] allow sleeping in ->eh_host_reset_handler()
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-17 12:05:18 -05:00
Jeff Garzik 68b3aa7c98 [SCSI] allow sleeping in ->eh_bus_reset_handler()
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-17 12:05:10 -05:00
Jeff Garzik 94d0e7b805 [SCSI] allow sleeping in ->eh_device_reset_handler()
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-17 12:05:03 -05:00
Jeff Garzik 8fa728a268 [SCSI] allow sleeping in ->eh_abort_handler()
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-17 12:04:55 -05:00
Andrew Vasquez a1541d5af6 [SCSI] qla2xxx: Pull-down scsi-host-addition to follow board initialization.
Return to previous held-logic of calling scsi_add_host() only
after the board has been completely initialized.  Also return
pci_*() error-codes during probe failure paths.

This also corrects an issue where only lun 0 is being scanned for
a given port.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-11 13:06:22 -05:00
Andrew Vasquez 18e144d32c [SCSI] qla2xxx: fix bad locking during eh_abort
Correct incorrect locking order in qla2xxx_eh_abort() handler which
would case a hang during certain code-paths.

With extra pieces to fix the irq state in the locks.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-03 09:37:53 -05:00
Andrew Vasquez 354d6b2196 [SCSI] remove some dead code in qla2xxx
Original from: Christoph Hellwig <hch@lst.de>

Modified and
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-05-20 12:53:25 -05:00
Andrew Vasquez 1c97a12a29 [SCSI] qla2xxx: remove a transport #include
Make transport-functions structure non-static.  Replace #include of
scsi_transport.h with a forward declaration.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-04-21 16:13:36 -04:00
6721d2c809 [PATCH] qla2xxx: remove /proc interface
Remove /proc support.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-04-18 13:48:36 -05:00
bdf796210e [PATCH] qla2xxx: remove lun discovery codes...
Remove internal lun discovery routines and support
structures.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-04-18 13:47:46 -05:00
8482e118af [PATCH] qla2xxx: add remote port codes...
Add initial support for FC remote port infrastructure.

     o Use fc_remote_port...() registration and block/unlock
       functions.
     o Consolidate 'attribute' (fc-remote/sysfs) helpers into
       new qla_attr.c file.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-04-18 13:47:19 -05:00
f4f051ebb4 [PATCH] qla2xxx: remove internal queuing...
Remove internal command queuing from the driver.  As is, this
driver cannot tolerate cable-pulls as I/Os will begin to fail
by the upper layers.

     o Should be used in conjuction with the
       11-fc_rport_adds_2.diff patch.
     o Removes qla_listops.h file -- no longer needed.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-04-18 13:46:53 -05:00
Linus Torvalds 1da177e4c3 Linux-2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!
2005-04-16 15:20:36 -07:00