From 4fdfefe52944f5c4132a372ed5c208962a73c3f2 Mon Sep 17 00:00:00 2001 From: Andrew Vasquez Date: Thu, 27 Oct 2005 11:09:48 -0700 Subject: [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 Signed-off-by: James Bottomley --- drivers/scsi/qla2xxx/qla_def.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/scsi/qla2xxx/qla_def.h') diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index b455c31405e..522bb2d3f08 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -823,6 +823,11 @@ typedef struct { #define PD_STATE_WAIT_PORT_LOGOUT_ACK 11 +#define QLA_ZIO_MODE_5 (BIT_2 | BIT_0) +#define QLA_ZIO_MODE_6 (BIT_2 | BIT_1) +#define QLA_ZIO_DISABLED 0 +#define QLA_ZIO_DEFAULT_TIMER 2 + /* * ISP Initialization Control Block. * Little endian except where noted. @@ -2470,6 +2475,9 @@ typedef struct scsi_qla_host { /* Needed for BEACON */ uint16_t beacon_blink_led; uint16_t beacon_green_on; + + uint16_t zio_mode; + uint16_t zio_timer; } scsi_qla_host_t; -- cgit v1.2.3 From fa90c54f6d27664cc67691f9e52d9165e0c25ca7 Mon Sep 17 00:00:00 2001 From: Andrew Vasquez Date: Thu, 27 Oct 2005 11:10:08 -0700 Subject: [SCSI] qla2xxx: Update license. Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley --- drivers/scsi/qla2xxx/qla_def.h | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'drivers/scsi/qla2xxx/qla_def.h') diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 522bb2d3f08..fc3234c3625 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -1,22 +1,9 @@ -/******************************************************************************** -* QLOGIC LINUX SOFTWARE -* -* QLogic ISP2x00 device driver for Linux 2.6.x -* Copyright (C) 2003-2005 QLogic Corporation -* (www.qlogic.com) -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2, or (at your option) any -* later version. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* General Public License for more details. -** -******************************************************************************/ - +/* + * QLogic Fibre Channel HBA Driver + * Copyright (c) 2003-2005 QLogic Corporation + * + * See LICENSE.qla2xxx for copyright and licensing details. + */ #ifndef __QLA_DEF_H #define __QLA_DEF_H -- cgit v1.2.3 From 19a7b4aebf9ad435c69a7e39930338499af4d152 Mon Sep 17 00:00:00 2001 From: "James.Smart@Emulex.Com" Date: Tue, 18 Oct 2005 12:03:35 -0400 Subject: [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 --- drivers/scsi/qla2xxx/qla_def.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/scsi/qla2xxx/qla_def.h') diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index fc3234c3625..7096945ea23 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -1665,6 +1666,8 @@ typedef struct fc_port { struct fc_rport *rport; u32 supported_classes; + struct work_struct rport_add_work; + struct work_struct rport_del_work; } fc_port_t; /* -- cgit v1.2.3