summaryrefslogtreecommitdiff
path: root/drivers/scsi/qla2xxx/qla_os.c
AgeCommit message (Collapse)Author
2006-02-07[PATCH] qla2xxx: Remove bogus debug-code.andrew.vasquez@qlogic.com
Commit 854165f4245c4a3b4a8cc363ba2050033151e196 inadvertently added some code meant only for testing -- the driver was ignoring the non-zero function numbers of a multi-port HBA. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-07[PATCH] qla2xxx: Close window on race between rport removal and fcport ↵andrew.vasquez@qlogic.com
transition. Fcport visibility is recognized during interrupt time, but, rport removal can only occur during a process (sleeping)-context. Return a DID_IMM_RETRY status for commands submitted within this window to insure I/Os do not prematurely run-out of retries. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04[SCSI] qla2xxx: Add support to retrieve/update HBA option-rom.andrew.vasquez@qlogic.com
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04[SCSI] qla2xxx: Add beacon support via class-device attribute.andrew.vasquez@qlogic.com
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04[SCSI] qla2xxx: Add port-speed FC transport attribute.andrew.vasquez@qlogic.com
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-01-26[SCSI] qla2xxx: Correct issue where the rport's upcall was not being made ↵andrew.vasquez@qlogic.com
after relogin. A target can LOGO an initiator at any time (i.e. during I/O, due to a controller hicup, or as a simple authentication mechanism after an initial CDB command), when this occurs, the driver attempts to relogin (PLOGI) to the device via the DPC thread. Add code to make the appropriate upcall to the FC transport layer (fc_remote_port_add()) upon successful completion of the PLOGI. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-01-26[SCSI] qla2xxx: Correct synchronization issues during rport addition/deletion.andrew.vasquez@qlogic.com
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-14[SCSI] qla2xxx: Disable port-type RSCN handling via driver state-machine.andrew.vasquez@qlogic.com
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>
2005-12-13[SCSI] qla2xxx: fix compile error caused by pci_dev.owner moveJames Bottomley
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13[SCSI] qla2xxx: Add support for embedded ISP24xx firmware.Andrew Vasquez
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13[SCSI] qla2xxx: Add full firmware(-request) hotplug support for all ISPs.Andrew Vasquez
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-10-28[SCSI] update fc_transport for removal of block/unblock functionsJames.Smart@Emulex.Com
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[SCSI] Add an 'Issue LIP' device attribute in fc_transport classAndrew Vasquez
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[SCSI] qla2xxx: put back label erroneously removed by eh_active patchJames Bottomley
The label eh_dev_reset_done is still in use Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-10-28[SCSI] qla2xxx: remove eh_active checks in qla2xxx error handlingAndrew Vasquez
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[SCSI] qla2xxx: Update license.Andrew Vasquez
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-10-28[SCSI] qla2xxx: Add support to dynamically enable/disable ZIO.Andrew Vasquez
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-25[PATCH] qlogic lockup fixAndrew Morton
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-09-04[SCSI] qla2xxx: Stop firmware execution at unintialization time.Andrew Vasquez
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[SCSI] qla2xxx: Replace schedule_timeout().Andrew Vasquez
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[SCSI] qla2xxx: Remove bad call to fc_remove_host() during probe failure.Andrew Vasquez
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[SCSI] qla2xxx: Add host attributes.Andrew Vasquez
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[SCSI] qla2xxx: Add change_queue_depth/type() API support.Andrew Vasquez
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-04[SCSI] qla2xxx: Simplify redundant target/device reset logic.Andrew Vasquez
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[SCSI] qla2xxx: Add FDMI support.Andrew Vasquez
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-04[SCSI] qla2xxx: Use dma_get_required_mask() in determining the 'ideal' DMA mask.Andrew Vasquez
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-07-14[SCSI] qla2xxx: Cleanup FC remote port registration.Andrew Vasquez
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[SCSI] qla2xxx: Add firmware version number to qla24xx_fw_version_str().Andrew Vasquez
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[SCSI] qla2xxx: Update copyright banner.Andrew Vasquez
Update copyright banner. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-07-14[SCSI] qla2xxx: Code scrubbing.Andrew Vasquez
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[SCSI] qla2xxx: Add OS initialization codes for ISP24xx recognition.Andrew Vasquez
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[SCSI] qla2xxx: Add ISP24xx initialization routines.Andrew Vasquez
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[SCSI] qla2xxx: Add ISP24xx flash-manipulation routines.Andrew Vasquez
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[SCSI] qla2xxx: Add MBX command routines for ISP24xx support.Andrew Vasquez
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[SCSI] qla2xxx: Add ISP24xx definitions.Andrew Vasquez
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[SCSI] qla2xxx: Factor-out ISP specific functions to method-based call tables.Andrew Vasquez
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-06-17merge by hand (qla_os.c mismerge)James Bottomley
2005-06-17merge by hand (fix up qla_os.c merge error)James Bottomley
2005-06-17[SCSI] allow sleeping in ->eh_host_reset_handler()Jeff Garzik
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-17[SCSI] allow sleeping in ->eh_bus_reset_handler()Jeff Garzik
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-17[SCSI] allow sleeping in ->eh_device_reset_handler()Jeff Garzik
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-17[SCSI] allow sleeping in ->eh_abort_handler()Jeff Garzik
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-11[SCSI] qla2xxx: Pull-down scsi-host-addition to follow board initialization.Andrew Vasquez
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-03[SCSI] qla2xxx: fix bad locking during eh_abortAndrew Vasquez
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-05-20[SCSI] remove some dead code in qla2xxxAndrew Vasquez
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-04-21[SCSI] qla2xxx: remove a transport #includeAndrew Vasquez
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-18[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[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[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[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>