* [patch 1/6] zfcp: Remove unnecessary eh_bus_reset_handler callback
2007-11-05 11:37 [patch 0/6] zfcp: updates, fixing a variety of oddities swen
@ 2007-11-05 11:37 ` swen
2007-11-05 11:37 ` [patch 2/6] zfcp: Use also port and adapter to identify unit in messages swen
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: swen @ 2007-11-05 11:37 UTC (permalink / raw)
To: James.Bottomley; +Cc: linux-scsi, linux-kernel, linux-s390, Christof Schmitt
[-- Attachment #1: 800-zfcp-callback.diff --]
[-- Type: text/plain, Size: 1703 bytes --]
From: Christof Schmitt <christof.schmitt@de.ibm.com>
The callback function used by zfcp always returns success,
which is an indication for the SCSI midlayer to stop error
handling. Remove the bus_reset callback, since the same
function will be called via the host_reset callback.
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
---
drivers/s390/scsi/zfcp_scsi.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Index: scsi-misc/drivers/s390/scsi/zfcp_scsi.c
===================================================================
--- scsi-misc.orig/drivers/s390/scsi/zfcp_scsi.c
+++ scsi-misc/drivers/s390/scsi/zfcp_scsi.c
@@ -51,7 +51,6 @@ struct zfcp_data zfcp_data = {
.queuecommand = zfcp_scsi_queuecommand,
.eh_abort_handler = zfcp_scsi_eh_abort_handler,
.eh_device_reset_handler = zfcp_scsi_eh_device_reset_handler,
- .eh_bus_reset_handler = zfcp_scsi_eh_host_reset_handler,
.eh_host_reset_handler = zfcp_scsi_eh_host_reset_handler,
.can_queue = 4096,
.this_id = -1,
@@ -542,7 +541,7 @@ zfcp_task_management_function(struct zfc
}
/**
- * zfcp_scsi_eh_host_reset_handler - handler for host and bus reset
+ * zfcp_scsi_eh_host_reset_handler - handler for host reset
*/
static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt)
{
@@ -552,7 +551,7 @@ static int zfcp_scsi_eh_host_reset_handl
unit = (struct zfcp_unit*) scpnt->device->hostdata;
adapter = unit->port->adapter;
- ZFCP_LOG_NORMAL("host/bus reset because of problems with "
+ ZFCP_LOG_NORMAL("host reset because of problems with "
"unit 0x%016Lx\n", unit->fcp_lun);
zfcp_erp_adapter_reopen(adapter, 0);
--
^ permalink raw reply [flat|nested] 7+ messages in thread* [patch 2/6] zfcp: Use also port and adapter to identify unit in messages.
2007-11-05 11:37 [patch 0/6] zfcp: updates, fixing a variety of oddities swen
2007-11-05 11:37 ` [patch 1/6] zfcp: Remove unnecessary eh_bus_reset_handler callback swen
@ 2007-11-05 11:37 ` swen
2007-11-05 11:37 ` [patch 3/6] zfcp: Specify waiting times in ERP in seconds swen
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: swen @ 2007-11-05 11:37 UTC (permalink / raw)
To: James.Bottomley; +Cc: linux-scsi, linux-kernel, linux-s390, Christof Schmitt
[-- Attachment #1: 802-zfcp-msg.diff --]
[-- Type: text/plain, Size: 1342 bytes --]
From: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
---
drivers/s390/scsi/zfcp_scsi.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff -urpN linux-2.6/drivers/s390/scsi/zfcp_scsi.c linux-2.6-patched/drivers/s390/scsi/zfcp_scsi.c
--- linux-2.6/drivers/s390/scsi/zfcp_scsi.c 2007-11-02 08:38:25.000000000 +0100
+++ linux-2.6-patched/drivers/s390/scsi/zfcp_scsi.c 2007-11-02 08:38:25.000000000 +0100
@@ -458,7 +458,9 @@ zfcp_scsi_eh_device_reset_handler(struct
retval = SUCCESS;
goto out;
}
- ZFCP_LOG_NORMAL("resetting unit 0x%016Lx\n", unit->fcp_lun);
+ ZFCP_LOG_NORMAL("resetting unit 0x%016Lx on port 0x%016Lx, adapter %s\n",
+ unit->fcp_lun, unit->port->wwpn,
+ zfcp_get_busid_by_adapter(unit->port->adapter));
/*
* If we do not know whether the unit supports 'logical unit reset'
@@ -552,7 +554,9 @@ static int zfcp_scsi_eh_host_reset_handl
adapter = unit->port->adapter;
ZFCP_LOG_NORMAL("host reset because of problems with "
- "unit 0x%016Lx\n", unit->fcp_lun);
+ "unit 0x%016Lx on port 0x%016Lx, adapter %s\n",
+ unit->fcp_lun, unit->port->wwpn,
+ zfcp_get_busid_by_adapter(unit->port->adapter));
zfcp_erp_adapter_reopen(adapter, 0);
zfcp_erp_wait(adapter);
--
^ permalink raw reply [flat|nested] 7+ messages in thread* [patch 3/6] zfcp: Specify waiting times in ERP in seconds
2007-11-05 11:37 [patch 0/6] zfcp: updates, fixing a variety of oddities swen
2007-11-05 11:37 ` [patch 1/6] zfcp: Remove unnecessary eh_bus_reset_handler callback swen
2007-11-05 11:37 ` [patch 2/6] zfcp: Use also port and adapter to identify unit in messages swen
@ 2007-11-05 11:37 ` swen
2007-11-05 11:37 ` [patch 4/6] zfcp: Remove SCSI devices when removing complete adapter swen
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: swen @ 2007-11-05 11:37 UTC (permalink / raw)
To: James.Bottomley
Cc: linux-scsi, linux-kernel, linux-s390, Christof Schmitt,
Martin Schwidefsky
[-- Attachment #1: 803-zfcp-waits.diff --]
[-- Type: text/plain, Size: 2896 bytes --]
From: Christof Schmitt <christof.schmitt@de.ibm.com>
It is not necessary to use jiffies or milliseconds to specify
waiting times that last a couple of seconds.
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
---
drivers/s390/scsi/zfcp_def.h | 4 ++--
drivers/s390/scsi/zfcp_erp.c | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
Index: scsi-misc/drivers/s390/scsi/zfcp_def.h
===================================================================
--- scsi-misc.orig/drivers/s390/scsi/zfcp_def.h
+++ scsi-misc/drivers/s390/scsi/zfcp_def.h
@@ -117,7 +117,7 @@ zfcp_address_to_sg(void *address, struct
#define ZFCP_SBAL_TIMEOUT (5*HZ)
-#define ZFCP_TYPE2_RECOVERY_TIME (8*HZ)
+#define ZFCP_TYPE2_RECOVERY_TIME 8 /* seconds */
/* queue polling (values in microseconds) */
#define ZFCP_MAX_INPUT_THRESHOLD 5000 /* FIXME: tune */
@@ -138,7 +138,7 @@ zfcp_address_to_sg(void *address, struct
#define ZFCP_STATUS_READS_RECOM FSF_STATUS_READS_RECOM
/* Do 1st retry in 1 second, then double the timeout for each following retry */
-#define ZFCP_EXCHANGE_CONFIG_DATA_FIRST_SLEEP 100
+#define ZFCP_EXCHANGE_CONFIG_DATA_FIRST_SLEEP 1
#define ZFCP_EXCHANGE_CONFIG_DATA_RETRIES 7
/* timeout value for "default timer" for fsf requests */
Index: scsi-misc/drivers/s390/scsi/zfcp_erp.c
===================================================================
--- scsi-misc.orig/drivers/s390/scsi/zfcp_erp.c
+++ scsi-misc/drivers/s390/scsi/zfcp_erp.c
@@ -131,7 +131,7 @@ static void zfcp_close_qdio(struct zfcp_
debug_text_event(adapter->erp_dbf, 3, "qdio_down2a");
while (qdio_shutdown(adapter->ccw_device,
QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS)
- msleep(1000);
+ ssleep(1);
debug_text_event(adapter->erp_dbf, 3, "qdio_down2b");
/* cleanup used outbound sbals */
@@ -1900,7 +1900,7 @@ zfcp_erp_adapter_strategy(struct zfcp_er
ZFCP_LOG_INFO("Waiting to allow the adapter %s "
"to recover itself\n",
zfcp_get_busid_by_adapter(adapter));
- msleep(jiffies_to_msecs(ZFCP_TYPE2_RECOVERY_TIME));
+ ssleep(ZFCP_TYPE2_RECOVERY_TIME);
}
return retval;
@@ -2080,7 +2080,7 @@ zfcp_erp_adapter_strategy_open_qdio(stru
debug_text_event(adapter->erp_dbf, 3, "qdio_down1a");
while (qdio_shutdown(adapter->ccw_device,
QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS)
- msleep(1000);
+ ssleep(1);
debug_text_event(adapter->erp_dbf, 3, "qdio_down1b");
failed_qdio_establish:
@@ -2165,7 +2165,7 @@ zfcp_erp_adapter_strategy_open_fsf_xconf
ZFCP_LOG_DEBUG("host connection still initialising... "
"waiting and retrying...\n");
/* sleep a little bit before retry */
- msleep(jiffies_to_msecs(sleep));
+ ssleep(sleep);
sleep *= 2;
}
--
^ permalink raw reply [flat|nested] 7+ messages in thread* [patch 4/6] zfcp: Remove SCSI devices when removing complete adapter
2007-11-05 11:37 [patch 0/6] zfcp: updates, fixing a variety of oddities swen
` (2 preceding siblings ...)
2007-11-05 11:37 ` [patch 3/6] zfcp: Specify waiting times in ERP in seconds swen
@ 2007-11-05 11:37 ` swen
2007-11-05 11:37 ` [patch 5/6] zfcp: Fix deadlock when adding invalid LUN swen
2007-11-05 11:37 ` [patch 6/6] zfcp: Reduce flood on hba trace swen
5 siblings, 0 replies; 7+ messages in thread
From: swen @ 2007-11-05 11:37 UTC (permalink / raw)
To: James.Bottomley; +Cc: linux-scsi, linux-kernel, linux-s390, Christof Schmitt
[-- Attachment #1: 804-zfcp-rmdevs.diff --]
[-- Type: text/plain, Size: 1138 bytes --]
From: Christof Schmitt <christof.schmitt@de.ibm.com>
The common I/O layer can call remove a handler to inform zfcp
that a device disappeared. The handler zfcp_ccw_remove then
removes all unit, port and the adapter data structures. Removing
the units requires that the SCSI devices are removed first.
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
---
drivers/s390/scsi/zfcp_ccw.c | 3 +++
1 file changed, 3 insertions(+)
diff -urpN linux-2.6/drivers/s390/scsi/zfcp_ccw.c linux-2.6-patched/drivers/s390/scsi/zfcp_ccw.c
--- linux-2.6/drivers/s390/scsi/zfcp_ccw.c 2007-11-02 08:37:56.000000000 +0100
+++ linux-2.6-patched/drivers/s390/scsi/zfcp_ccw.c 2007-11-02 08:38:26.000000000 +0100
@@ -120,6 +120,9 @@ zfcp_ccw_remove(struct ccw_device *ccw_d
list_for_each_entry_safe(port, p, &adapter->port_remove_lh, list) {
list_for_each_entry_safe(unit, u, &port->unit_remove_lh, list) {
+ if (atomic_test_mask(ZFCP_STATUS_UNIT_REGISTERED,
+ &unit->status))
+ scsi_remove_device(unit->device);
zfcp_unit_dequeue(unit);
}
zfcp_port_dequeue(port);
--
^ permalink raw reply [flat|nested] 7+ messages in thread* [patch 5/6] zfcp: Fix deadlock when adding invalid LUN
2007-11-05 11:37 [patch 0/6] zfcp: updates, fixing a variety of oddities swen
` (3 preceding siblings ...)
2007-11-05 11:37 ` [patch 4/6] zfcp: Remove SCSI devices when removing complete adapter swen
@ 2007-11-05 11:37 ` swen
2007-11-05 11:37 ` [patch 6/6] zfcp: Reduce flood on hba trace swen
5 siblings, 0 replies; 7+ messages in thread
From: swen @ 2007-11-05 11:37 UTC (permalink / raw)
To: James.Bottomley
Cc: linux-scsi, linux-kernel, linux-s390, Christof Schmitt,
Martin Schwidefsky
[-- Attachment #1: 805-zfcp-deadlock.diff --]
[-- Type: text/plain, Size: 3007 bytes --]
From: Christof Schmitt <christof.schmitt@de.ibm.com>
When adding an invalid LUN, there is a deadlock between the add
via scsi_scan_target and the slave_destroy handler: The handler
waits for the scan to complete, but for an invalid unit,
scsi_scan_target directly calls the slave_destroy handler.
Fix the deadlock by removing the wait in the slave_destroy
handler, it was not necessary anyway.
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
---
drivers/s390/scsi/zfcp_aux.c | 2 --
drivers/s390/scsi/zfcp_def.h | 4 ----
drivers/s390/scsi/zfcp_erp.c | 1 -
drivers/s390/scsi/zfcp_scsi.c | 3 ---
4 files changed, 10 deletions(-)
Index: scsi-misc/drivers/s390/scsi/zfcp_aux.c
===================================================================
--- scsi-misc.orig/drivers/s390/scsi/zfcp_aux.c
+++ scsi-misc/drivers/s390/scsi/zfcp_aux.c
@@ -844,8 +844,6 @@ zfcp_unit_enqueue(struct zfcp_port *port
unit->sysfs_device.release = zfcp_sysfs_unit_release;
dev_set_drvdata(&unit->sysfs_device, unit);
- init_waitqueue_head(&unit->scsi_scan_wq);
-
/* mark unit unusable as long as sysfs registration is not complete */
atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &unit->status);
Index: scsi-misc/drivers/s390/scsi/zfcp_def.h
===================================================================
--- scsi-misc.orig/drivers/s390/scsi/zfcp_def.h
+++ scsi-misc/drivers/s390/scsi/zfcp_def.h
@@ -982,10 +982,6 @@ struct zfcp_unit {
struct scsi_device *device; /* scsi device struct pointer */
struct zfcp_erp_action erp_action; /* pending error recovery */
atomic_t erp_counter;
- wait_queue_head_t scsi_scan_wq; /* can be used to wait until
- all scsi_scan_target
- requests have been
- completed. */
};
/* FSF request */
Index: scsi-misc/drivers/s390/scsi/zfcp_erp.c
===================================================================
--- scsi-misc.orig/drivers/s390/scsi/zfcp_erp.c
+++ scsi-misc/drivers/s390/scsi/zfcp_erp.c
@@ -1609,7 +1609,6 @@ static void zfcp_erp_scsi_scan(struct wo
scsi_scan_target(&rport->dev, 0, rport->scsi_target_id,
unit->scsi_lun, 0);
atomic_clear_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status);
- wake_up(&unit->scsi_scan_wq);
zfcp_unit_put(unit);
kfree(p);
}
Index: scsi-misc/drivers/s390/scsi/zfcp_scsi.c
===================================================================
--- scsi-misc.orig/drivers/s390/scsi/zfcp_scsi.c
+++ scsi-misc/drivers/s390/scsi/zfcp_scsi.c
@@ -180,9 +180,6 @@ static void zfcp_scsi_slave_destroy(stru
if (unit) {
zfcp_erp_wait(unit->port->adapter);
- wait_event(unit->scsi_scan_wq,
- atomic_test_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING,
- &unit->status) == 0);
atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status);
sdpnt->hostdata = NULL;
unit->device = NULL;
--
^ permalink raw reply [flat|nested] 7+ messages in thread* [patch 6/6] zfcp: Reduce flood on hba trace
2007-11-05 11:37 [patch 0/6] zfcp: updates, fixing a variety of oddities swen
` (4 preceding siblings ...)
2007-11-05 11:37 ` [patch 5/6] zfcp: Fix deadlock when adding invalid LUN swen
@ 2007-11-05 11:37 ` swen
5 siblings, 0 replies; 7+ messages in thread
From: swen @ 2007-11-05 11:37 UTC (permalink / raw)
To: James.Bottomley; +Cc: linux-scsi, linux-kernel, linux-s390, Christof Schmitt
[-- Attachment #1: 806-zfcp-trace.diff --]
[-- Type: text/plain, Size: 1376 bytes --]
From: Christof Schmitt <christof.schmitt@de.ibm.com>
Remove tracing for request with a "qualifier" field set in the
response. The protocol status qualifier now contains measurement
data for "good" commands, so this check would trace every response
by default.
The fix is to simply remove the "qual" tracing: The responses with an
interesting status are also traced as "ferr" or "perr" and all
responses can be traced as "norm" with a higher trace level.
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
---
drivers/s390/scsi/zfcp_dbf.c | 6 ------
1 file changed, 6 deletions(-)
Index: scsi-misc/drivers/s390/scsi/zfcp_dbf.c
===================================================================
--- scsi-misc.orig/drivers/s390/scsi/zfcp_dbf.c
+++ scsi-misc/drivers/s390/scsi/zfcp_dbf.c
@@ -161,12 +161,6 @@ void zfcp_hba_dbf_event_fsf_response(str
(fsf_req->fsf_command == FSF_QTCB_OPEN_LUN)) {
strncpy(rec->tag2, "open", ZFCP_DBF_TAG_SIZE);
level = 4;
- } else if ((prot_status_qual->doubleword[0] != 0) ||
- (prot_status_qual->doubleword[1] != 0) ||
- (fsf_status_qual->doubleword[0] != 0) ||
- (fsf_status_qual->doubleword[1] != 0)) {
- strncpy(rec->tag2, "qual", ZFCP_DBF_TAG_SIZE);
- level = 3;
} else {
strncpy(rec->tag2, "norm", ZFCP_DBF_TAG_SIZE);
level = 6;
--
^ permalink raw reply [flat|nested] 7+ messages in thread