Commit 553448f6 authored by Christof Schmitt's avatar Christof Schmitt Committed by James Bottomley

[SCSI] zfcp: Message cleanup

Cleanup the messages used in the zfcp driver: Remove unnecessary debug
and trace message and convert the remaining messages to standard
kernel macros. Remove the zfcp message macros and while updating the
whole flie also update the copyright headers.
Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: default avatarSwen Schillig <swen@vnet.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 00bab910
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
zfcp-objs := zfcp_aux.o zfcp_ccw.o zfcp_scsi.o zfcp_erp.o zfcp_qdio.o \ zfcp-objs := zfcp_aux.o zfcp_ccw.o zfcp_scsi.o zfcp_erp.o zfcp_qdio.o \
zfcp_fsf.o zfcp_dbf.o zfcp_sysfs_adapter.o zfcp_sysfs_port.o \ zfcp_fsf.o zfcp_dbf.o zfcp_sysfs_adapter.o zfcp_sysfs_port.o \
zfcp_sysfs_unit.o zfcp_sysfs_driver.o zfcp_fc.o zfcp_cfdc.o zfcp_sysfs_unit.o zfcp_fc.o zfcp_cfdc.o
obj-$(CONFIG_ZFCP) += zfcp.o obj-$(CONFIG_ZFCP) += zfcp.o
/* /*
* This file is part of the zfcp device driver for * zfcp device driver
* FCP adapters for IBM System z9 and zSeries.
* *
* (C) Copyright IBM Corp. 2002, 2006 * Module interface and handling of zfcp data structures.
* *
* This program is free software; you can redistribute it and/or modify * Copyright IBM Corporation 2002, 2008
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* /*
...@@ -31,13 +18,16 @@ ...@@ -31,13 +18,16 @@
* Maxim Shchetynin * Maxim Shchetynin
* Volker Sameske * Volker Sameske
* Ralph Wuerthner * Ralph Wuerthner
* Michael Loehr
* Swen Schillig
* Christof Schmitt
* Martin Petermann
* Sven Schuetz
*/ */
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include "zfcp_ext.h" #include "zfcp_ext.h"
/* accumulated log level (module parameter) */
static u32 loglevel = ZFCP_LOG_LEVEL_DEFAULTS;
static char *device; static char *device;
/*********************** FUNCTION PROTOTYPES *********************************/ /*********************** FUNCTION PROTOTYPES *********************************/
...@@ -57,12 +47,6 @@ MODULE_LICENSE("GPL"); ...@@ -57,12 +47,6 @@ MODULE_LICENSE("GPL");
module_param(device, charp, 0400); module_param(device, charp, 0400);
MODULE_PARM_DESC(device, "specify initial device"); MODULE_PARM_DESC(device, "specify initial device");
module_param(loglevel, uint, 0400);
MODULE_PARM_DESC(loglevel,
"log levels, 8 nibbles: "
"FC ERP QDIO CIO Config FSF SCSI Other, "
"levels: 0=none 1=normal 2=devel 3=trace");
/****************************************************************/ /****************************************************************/
/************** Functions without logging ***********************/ /************** Functions without logging ***********************/
/****************************************************************/ /****************************************************************/
...@@ -87,8 +71,6 @@ _zfcp_hex_dump(char *addr, int count) ...@@ -87,8 +71,6 @@ _zfcp_hex_dump(char *addr, int count)
/****** Functions to handle the request ID hash table ********/ /****** Functions to handle the request ID hash table ********/
/****************************************************************/ /****************************************************************/
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_FSF
static int zfcp_reqlist_alloc(struct zfcp_adapter *adapter) static int zfcp_reqlist_alloc(struct zfcp_adapter *adapter)
{ {
int idx; int idx;
...@@ -118,14 +100,10 @@ int zfcp_reqlist_isempty(struct zfcp_adapter *adapter) ...@@ -118,14 +100,10 @@ int zfcp_reqlist_isempty(struct zfcp_adapter *adapter)
return 1; return 1;
} }
#undef ZFCP_LOG_AREA
/****************************************************************/ /****************************************************************/
/************** Uncategorised Functions *************************/ /************** Uncategorised Functions *************************/
/****************************************************************/ /****************************************************************/
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_OTHER
/** /**
* zfcp_device_setup - setup function * zfcp_device_setup - setup function
* @str: pointer to parameter string * @str: pointer to parameter string
...@@ -143,8 +121,11 @@ zfcp_device_setup(char *devstr) ...@@ -143,8 +121,11 @@ zfcp_device_setup(char *devstr)
len = strlen(devstr) + 1; len = strlen(devstr) + 1;
str = kmalloc(len, GFP_KERNEL); str = kmalloc(len, GFP_KERNEL);
if (!str) if (!str) {
goto err_out; pr_err("zfcp: Could not allocate memory for "
"device parameter string, device not attached.\n");
return 0;
}
memcpy(str, devstr, len); memcpy(str, devstr, len);
tmp = strchr(str, ','); tmp = strchr(str, ',');
...@@ -167,7 +148,8 @@ zfcp_device_setup(char *devstr) ...@@ -167,7 +148,8 @@ zfcp_device_setup(char *devstr)
return 1; return 1;
err_out: err_out:
ZFCP_LOG_NORMAL("Parse error for device parameter string %s\n", str); pr_err("zfcp: Parse error for device parameter string %s, "
"device not attached.\n", str);
kfree(str); kfree(str);
return 0; return 0;
} }
...@@ -248,8 +230,6 @@ zfcp_module_init(void) ...@@ -248,8 +230,6 @@ zfcp_module_init(void)
if (!zfcp_data.gid_pn_cache) if (!zfcp_data.gid_pn_cache)
goto out_gid_cache; goto out_gid_cache;
atomic_set(&zfcp_data.loglevel, loglevel);
/* initialize adapter list */ /* initialize adapter list */
INIT_LIST_HEAD(&zfcp_data.adapter_list_head); INIT_LIST_HEAD(&zfcp_data.adapter_list_head);
...@@ -263,8 +243,7 @@ zfcp_module_init(void) ...@@ -263,8 +243,7 @@ zfcp_module_init(void)
retval = misc_register(&zfcp_cfdc_misc); retval = misc_register(&zfcp_cfdc_misc);
if (retval != 0) { if (retval != 0) {
ZFCP_LOG_INFO("registration of misc device " pr_err("zfcp: registration of misc device zfcp_cfdc failed\n");
"zfcp_cfdc failed\n");
goto out_misc; goto out_misc;
} }
...@@ -277,7 +256,7 @@ zfcp_module_init(void) ...@@ -277,7 +256,7 @@ zfcp_module_init(void)
/* setup dynamic I/O */ /* setup dynamic I/O */
retval = zfcp_ccw_register(); retval = zfcp_ccw_register();
if (retval) { if (retval) {
ZFCP_LOG_NORMAL("registration with common I/O layer failed\n"); pr_err("zfcp: Registration with common I/O layer failed.\n");
goto out_ccw_register; goto out_ccw_register;
} }
...@@ -300,14 +279,10 @@ zfcp_module_init(void) ...@@ -300,14 +279,10 @@ zfcp_module_init(void)
return retval; return retval;
} }
#undef ZFCP_LOG_AREA
/****************************************************************/ /****************************************************************/
/****** Functions for configuration/set-up of structures ********/ /****** Functions for configuration/set-up of structures ********/
/****************************************************************/ /****************************************************************/
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG
/** /**
* zfcp_get_unit_by_lun - find unit in unit list of port by FCP LUN * zfcp_get_unit_by_lun - find unit in unit list of port by FCP LUN
* @port: pointer to port to search for unit * @port: pointer to port to search for unit
...@@ -598,6 +573,8 @@ static void _zfcp_status_read_scheduler(struct work_struct *work) ...@@ -598,6 +573,8 @@ static void _zfcp_status_read_scheduler(struct work_struct *work)
* All adapter internal structures are set up. * All adapter internal structures are set up.
* Proc-fs entries are also created. * Proc-fs entries are also created.
* *
* FIXME: Use -ENOMEM as return code for allocation failures
*
* returns: 0 if a new adapter was successfully enqueued * returns: 0 if a new adapter was successfully enqueued
* ZFCP_KNOWN if an adapter with this devno was already present * ZFCP_KNOWN if an adapter with this devno was already present
* -ENOMEM if alloc failed * -ENOMEM if alloc failed
...@@ -615,11 +592,8 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device) ...@@ -615,11 +592,8 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)
/* try to allocate new adapter data structure (zeroed) */ /* try to allocate new adapter data structure (zeroed) */
adapter = kzalloc(sizeof (struct zfcp_adapter), GFP_KERNEL); adapter = kzalloc(sizeof (struct zfcp_adapter), GFP_KERNEL);
if (!adapter) { if (!adapter)
ZFCP_LOG_INFO("error: allocation of base adapter "
"structure failed\n");
goto out; goto out;
}
ccw_device->handler = NULL; ccw_device->handler = NULL;
...@@ -760,7 +734,6 @@ zfcp_adapter_dequeue(struct zfcp_adapter *adapter) ...@@ -760,7 +734,6 @@ zfcp_adapter_dequeue(struct zfcp_adapter *adapter)
zfcp_reqlist_free(adapter); zfcp_reqlist_free(adapter);
kfree(adapter->fc_stats); kfree(adapter->fc_stats);
kfree(adapter->stats_reset_data); kfree(adapter->stats_reset_data);
ZFCP_LOG_TRACE("freeing adapter structure\n");
kfree(adapter); kfree(adapter);
out: out:
return; return;
...@@ -908,12 +881,8 @@ zfcp_nameserver_enqueue(struct zfcp_adapter *adapter) ...@@ -908,12 +881,8 @@ zfcp_nameserver_enqueue(struct zfcp_adapter *adapter)
port = zfcp_port_enqueue(adapter, 0, ZFCP_STATUS_PORT_WKA, port = zfcp_port_enqueue(adapter, 0, ZFCP_STATUS_PORT_WKA,
ZFCP_DID_DIRECTORY_SERVICE); ZFCP_DID_DIRECTORY_SERVICE);
if (!port) { if (!port)
ZFCP_LOG_INFO("error: enqueue of nameserver port for "
"adapter %s failed\n",
zfcp_get_busid_by_adapter(adapter));
return -ENXIO; return -ENXIO;
}
zfcp_port_put(port); zfcp_port_put(port);
return 0; return 0;
...@@ -946,5 +915,3 @@ int zfcp_sg_setup_table(struct scatterlist *sg, int count) ...@@ -946,5 +915,3 @@ int zfcp_sg_setup_table(struct scatterlist *sg, int count)
} }
return 0; return 0;
} }
#undef ZFCP_LOG_AREA
/* /*
* This file is part of the zfcp device driver for * zfcp device driver
* FCP adapters for IBM System z9 and zSeries.
* *
* (C) Copyright IBM Corp. 2002, 2006 * Debug traces for zfcp.
* *
* This program is free software; you can redistribute it and/or modify * Copyright IBM Corporation 2002, 2008
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <linux/ctype.h> #include <linux/ctype.h>
...@@ -29,8 +16,6 @@ module_param(dbfsize, uint, 0400); ...@@ -29,8 +16,6 @@ module_param(dbfsize, uint, 0400);
MODULE_PARM_DESC(dbfsize, MODULE_PARM_DESC(dbfsize,
"number of pages for each debug feature area (default 4)"); "number of pages for each debug feature area (default 4)");
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_OTHER
static void zfcp_dbf_hexdump(debug_info_t *dbf, void *to, int to_len, static void zfcp_dbf_hexdump(debug_info_t *dbf, void *to, int to_len,
int level, char *from, int from_len) int level, char *from, int from_len)
{ {
...@@ -515,13 +500,13 @@ static const char *zfcp_rec_dbf_ids[] = { ...@@ -515,13 +500,13 @@ static const char *zfcp_rec_dbf_ids[] = {
[52] = "port boxed close unit", [52] = "port boxed close unit",
[53] = "port boxed fcp", [53] = "port boxed fcp",
[54] = "unit boxed fcp", [54] = "unit boxed fcp",
[55] = "port access denied ct", [55] = "port access denied",
[56] = "port access denied els", [56] = "",
[57] = "port access denied open port", [57] = "",
[58] = "port access denied close physical", [58] = "",
[59] = "unit access denied open unit", [59] = "unit access denied",
[60] = "shared unit access denied open unit", [60] = "shared unit access denied open unit",
[61] = "unit access denied fcp", [61] = "",
[62] = "request timeout", [62] = "request timeout",
[63] = "adisc link test reject or timeout", [63] = "adisc link test reject or timeout",
[64] = "adisc link test d_id changed", [64] = "adisc link test d_id changed",
...@@ -586,8 +571,8 @@ static const char *zfcp_rec_dbf_ids[] = { ...@@ -586,8 +571,8 @@ static const char *zfcp_rec_dbf_ids[] = {
[120] = "unknown fsf command", [120] = "unknown fsf command",
[121] = "no recommendation for status qualifier", [121] = "no recommendation for status qualifier",
[122] = "status read physical port closed in error", [122] = "status read physical port closed in error",
[123] = "fc service class not supported ct", [123] = "fc service class not supported",
[124] = "fc service class not supported els", [124] = "",
[125] = "need newer zfcp", [125] = "need newer zfcp",
[126] = "need newer microcode", [126] = "need newer microcode",
[127] = "arbitrated loop not supported", [127] = "arbitrated loop not supported",
...@@ -595,7 +580,7 @@ static const char *zfcp_rec_dbf_ids[] = { ...@@ -595,7 +580,7 @@ static const char *zfcp_rec_dbf_ids[] = {
[129] = "qtcb size mismatch", [129] = "qtcb size mismatch",
[130] = "unknown fsf status ecd", [130] = "unknown fsf status ecd",
[131] = "fcp request too big", [131] = "fcp request too big",
[132] = "fc service class not supported fcp", [132] = "",
[133] = "data direction not valid fcp", [133] = "data direction not valid fcp",
[134] = "command length not valid fcp", [134] = "command length not valid fcp",
[135] = "status read act update", [135] = "status read act update",
...@@ -1291,5 +1276,3 @@ void zfcp_adapter_debug_unregister(struct zfcp_adapter *adapter) ...@@ -1291,5 +1276,3 @@ void zfcp_adapter_debug_unregister(struct zfcp_adapter *adapter)
adapter->hba_dbf = NULL; adapter->hba_dbf = NULL;
adapter->rec_dbf = NULL; adapter->rec_dbf = NULL;
} }
#undef ZFCP_LOG_AREA
/* /*
* This file is part of the zfcp device driver for * zfcp device driver
* FCP adapters for IBM System z9 and zSeries.
* *
* (C) Copyright IBM Corp. 2002, 2006 * Global definitions for the zfcp device driver.
* *
* This program is free software; you can redistribute it and/or modify * Copyright IBM Corporation 2002, 2008
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#ifndef ZFCP_DEF_H #ifndef ZFCP_DEF_H
...@@ -52,9 +39,6 @@ ...@@ -52,9 +39,6 @@
/********************* GENERAL DEFINES *********************************/ /********************* GENERAL DEFINES *********************************/
/* zfcp version number, it consists of major, minor, and patch-level number */
#define ZFCP_VERSION "4.8.0"
/** /**
* zfcp_sg_to_address - determine kernel address from struct scatterlist * zfcp_sg_to_address - determine kernel address from struct scatterlist
* @list: struct scatterlist * @list: struct scatterlist
...@@ -308,107 +292,6 @@ struct zfcp_rc_entry { ...@@ -308,107 +292,6 @@ struct zfcp_rc_entry {
*/ */
#define ZFCP_CT_TIMEOUT (3 * R_A_TOV) #define ZFCP_CT_TIMEOUT (3 * R_A_TOV)
/******************** LOGGING MACROS AND DEFINES *****************************/
/*
* Logging may be applied on certain kinds of driver operations
* independently. Additionally, different log-levels are supported for
* each of these areas.
*/
#define ZFCP_NAME "zfcp"
/* independent log areas */
#define ZFCP_LOG_AREA_OTHER 0
#define ZFCP_LOG_AREA_SCSI 1
#define ZFCP_LOG_AREA_FSF 2
#define ZFCP_LOG_AREA_CONFIG 3
#define ZFCP_LOG_AREA_CIO 4
#define ZFCP_LOG_AREA_QDIO 5
#define ZFCP_LOG_AREA_ERP 6
#define ZFCP_LOG_AREA_FC 7
/* log level values*/
#define ZFCP_LOG_LEVEL_NORMAL 0
#define ZFCP_LOG_LEVEL_INFO 1
#define ZFCP_LOG_LEVEL_DEBUG 2
#define ZFCP_LOG_LEVEL_TRACE 3
/*
* this allows removal of logging code by the preprocessor
* (the most detailed log level still to be compiled in is specified,
* higher log levels are removed)
*/
#define ZFCP_LOG_LEVEL_LIMIT ZFCP_LOG_LEVEL_TRACE
/* get "loglevel" nibble assignment */
#define ZFCP_GET_LOG_VALUE(zfcp_lognibble) \
((atomic_read(&zfcp_data.loglevel) >> (zfcp_lognibble<<2)) & 0xF)
/* set "loglevel" nibble */
#define ZFCP_SET_LOG_NIBBLE(value, zfcp_lognibble) \
(value << (zfcp_lognibble << 2))
/* all log-level defaults are combined to generate initial log-level */
#define ZFCP_LOG_LEVEL_DEFAULTS \
(ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_OTHER) | \
ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_SCSI) | \
ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_FSF) | \
ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_CONFIG) | \
ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_CIO) | \
ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_QDIO) | \
ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_ERP) | \
ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_FC))
/* check whether we have the right level for logging */
#define ZFCP_LOG_CHECK(level) \
((ZFCP_GET_LOG_VALUE(ZFCP_LOG_AREA)) >= level)
/* logging routine for zfcp */
#define _ZFCP_LOG(fmt, args...) \
printk(KERN_ERR ZFCP_NAME": %s(%d): " fmt, __func__, \
__LINE__ , ##args)
#define ZFCP_LOG(level, fmt, args...) \
do { \
if (ZFCP_LOG_CHECK(level)) \
_ZFCP_LOG(fmt, ##args); \
} while (0)
#if ZFCP_LOG_LEVEL_LIMIT < ZFCP_LOG_LEVEL_NORMAL
# define ZFCP_LOG_NORMAL(fmt, args...) do { } while (0)
#else
# define ZFCP_LOG_NORMAL(fmt, args...) \
do { \
if (ZFCP_LOG_CHECK(ZFCP_LOG_LEVEL_NORMAL)) \
printk(KERN_ERR ZFCP_NAME": " fmt, ##args); \
} while (0)
#endif
#if ZFCP_LOG_LEVEL_LIMIT < ZFCP_LOG_LEVEL_INFO
# define ZFCP_LOG_INFO(fmt, args...) do { } while (0)
#else
# define ZFCP_LOG_INFO(fmt, args...) \
do { \
if (ZFCP_LOG_CHECK(ZFCP_LOG_LEVEL_INFO)) \
printk(KERN_ERR ZFCP_NAME": " fmt, ##args); \
} while (0)
#endif
#if ZFCP_LOG_LEVEL_LIMIT < ZFCP_LOG_LEVEL_DEBUG
# define ZFCP_LOG_DEBUG(fmt, args...) do { } while (0)
#else
# define ZFCP_LOG_DEBUG(fmt, args...) \
ZFCP_LOG(ZFCP_LOG_LEVEL_DEBUG, fmt , ##args)
#endif
#if ZFCP_LOG_LEVEL_LIMIT < ZFCP_LOG_LEVEL_TRACE
# define ZFCP_LOG_TRACE(fmt, args...) do { } while (0)
#else
# define ZFCP_LOG_TRACE(fmt, args...) \
ZFCP_LOG(ZFCP_LOG_LEVEL_TRACE, fmt , ##args)
#endif
/*************** ADAPTER/PORT/UNIT AND FSF_REQ STATUS FLAGS ******************/ /*************** ADAPTER/PORT/UNIT AND FSF_REQ STATUS FLAGS ******************/
/* /*
...@@ -846,7 +729,6 @@ struct zfcp_data { ...@@ -846,7 +729,6 @@ struct zfcp_data {
char init_busid[BUS_ID_SIZE]; char init_busid[BUS_ID_SIZE];
wwn_t init_wwpn; wwn_t init_wwpn;
fcp_lun_t init_fcp_lun; fcp_lun_t init_fcp_lun;
char *driver_version;
struct kmem_cache *fsf_req_qtcb_cache; struct kmem_cache *fsf_req_qtcb_cache;
struct kmem_cache *sr_buffer_cache; struct kmem_cache *sr_buffer_cache;
struct kmem_cache *gid_pn_cache; struct kmem_cache *gid_pn_cache;
......
/* /*
* This file is part of the zfcp device driver for * zfcp device driver
* FCP adapters for IBM System z9 and zSeries.
* *
* (C) Copyright IBM Corp. 2002, 2006 * Error Recovery Procedures (ERP).
* *
* This program is free software; you can redistribute it and/or modify * Copyright IBM Corporation 2002, 2008
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_ERP
#include "zfcp_ext.h" #include "zfcp_ext.h"
static int zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *, int, u8, static int zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *, int, u8,
...@@ -171,14 +156,9 @@ static int zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *adapter, ...@@ -171,14 +156,9 @@ static int zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *adapter,
{ {
int retval; int retval;
ZFCP_LOG_DEBUG("reopen adapter %s\n",
zfcp_get_busid_by_adapter(adapter));
zfcp_erp_adapter_block(adapter, clear_mask); zfcp_erp_adapter_block(adapter, clear_mask);
if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &adapter->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &adapter->status)) {
ZFCP_LOG_DEBUG("skipped reopen of failed adapter %s\n",
zfcp_get_busid_by_adapter(adapter));
/* ensure propagation of failed status to new devices */ /* ensure propagation of failed status to new devices */
zfcp_erp_adapter_failed(adapter, 13, NULL); zfcp_erp_adapter_failed(adapter, 13, NULL);
retval = -EIO; retval = -EIO;
...@@ -270,15 +250,9 @@ static int zfcp_erp_port_forced_reopen_internal(struct zfcp_port *port, ...@@ -270,15 +250,9 @@ static int zfcp_erp_port_forced_reopen_internal(struct zfcp_port *port,
{ {
int retval; int retval;
ZFCP_LOG_DEBUG("forced reopen of port 0x%016Lx on adapter %s\n",
port->wwpn, zfcp_get_busid_by_port(port));
zfcp_erp_port_block(port, clear_mask); zfcp_erp_port_block(port, clear_mask);
if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &port->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &port->status)) {
ZFCP_LOG_DEBUG("skipped forced reopen of failed port 0x%016Lx "
"on adapter %s\n", port->wwpn,
zfcp_get_busid_by_port(port));
retval = -EIO; retval = -EIO;
goto out; goto out;
} }
...@@ -332,15 +306,9 @@ static int zfcp_erp_port_reopen_internal(struct zfcp_port *port, int clear_mask, ...@@ -332,15 +306,9 @@ static int zfcp_erp_port_reopen_internal(struct zfcp_port *port, int clear_mask,
{ {
int retval; int retval;
ZFCP_LOG_DEBUG("reopen of port 0x%016Lx on adapter %s\n",
port->wwpn, zfcp_get_busid_by_port(port));
zfcp_erp_port_block(port, clear_mask); zfcp_erp_port_block(port, clear_mask);
if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &port->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &port->status)) {
ZFCP_LOG_DEBUG("skipped reopen of failed port 0x%016Lx "
"on adapter %s\n", port->wwpn,
zfcp_get_busid_by_port(port));
/* ensure propagation of failed status to new devices */ /* ensure propagation of failed status to new devices */
zfcp_erp_port_failed(port, 14, NULL); zfcp_erp_port_failed(port, 14, NULL);
retval = -EIO; retval = -EIO;
...@@ -396,17 +364,9 @@ static int zfcp_erp_unit_reopen_internal(struct zfcp_unit *unit, int clear_mask, ...@@ -396,17 +364,9 @@ static int zfcp_erp_unit_reopen_internal(struct zfcp_unit *unit, int clear_mask,
int retval; int retval;
struct zfcp_adapter *adapter = unit->port->adapter; struct zfcp_adapter *adapter = unit->port->adapter;
ZFCP_LOG_DEBUG("reopen of unit 0x%016Lx on port 0x%016Lx "
"on adapter %s\n", unit->fcp_lun,
unit->port->wwpn, zfcp_get_busid_by_unit(unit));
zfcp_erp_unit_block(unit, clear_mask); zfcp_erp_unit_block(unit, clear_mask);
if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &unit->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &unit->status)) {
ZFCP_LOG_DEBUG("skipped reopen of failed unit 0x%016Lx "
"on port 0x%016Lx on adapter %s\n",
unit->fcp_lun, unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
retval = -EIO; retval = -EIO;
goto out; goto out;
} }
...@@ -631,13 +591,8 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action) ...@@ -631,13 +591,8 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action)
ZFCP_STATUS_FSFREQ_DISMISSED; ZFCP_STATUS_FSFREQ_DISMISSED;
zfcp_rec_dbf_event_action(142, erp_action); zfcp_rec_dbf_event_action(142, erp_action);
} }
if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) { if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT)
zfcp_rec_dbf_event_action(143, erp_action); zfcp_rec_dbf_event_action(143, erp_action);
ZFCP_LOG_NORMAL("error: erp step timed out "
"(action=%d, fsf_req=%p)\n ",
erp_action->action,
erp_action->fsf_req);
}
/* /*
* If fsf_req is neither dismissed nor completed * If fsf_req is neither dismissed nor completed
* then keep it running asynchronously and don't mess * then keep it running asynchronously and don't mess
...@@ -740,11 +695,10 @@ zfcp_erp_thread_setup(struct zfcp_adapter *adapter) ...@@ -740,11 +695,10 @@ zfcp_erp_thread_setup(struct zfcp_adapter *adapter)
atomic_clear_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, &adapter->status); atomic_clear_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, &adapter->status);
retval = kernel_thread(zfcp_erp_thread, adapter, SIGCHLD); retval = kernel_thread(zfcp_erp_thread, adapter, SIGCHLD);
if (retval < 0) { if (retval < 0)
ZFCP_LOG_NORMAL("error: creation of erp thread failed for " dev_err(&adapter->ccw_device->dev,
"adapter %s\n", "Creation of ERP thread failed.\n");
zfcp_get_busid_by_adapter(adapter)); else {
} else {
wait_event(adapter->erp_thread_wqh, wait_event(adapter->erp_thread_wqh,
atomic_test_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, atomic_test_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP,
&adapter->status)); &adapter->status));
...@@ -919,15 +873,10 @@ zfcp_erp_strategy(struct zfcp_erp_action *erp_action) ...@@ -919,15 +873,10 @@ zfcp_erp_strategy(struct zfcp_erp_action *erp_action)
This might happen if an erp_action that used a memory pool This might happen if an erp_action that used a memory pool
element was timed out. element was timed out.
*/ */
if (adapter->erp_total_count == adapter->erp_low_mem_count) { if (adapter->erp_total_count == adapter->erp_low_mem_count)
ZFCP_LOG_NORMAL("error: no mempool elements available, "
"restarting I/O on adapter %s "
"to free mempool\n",
zfcp_get_busid_by_adapter(adapter));
zfcp_erp_adapter_reopen_internal(adapter, 0, 66, NULL); zfcp_erp_adapter_reopen_internal(adapter, 0, 66, NULL);
} else { else
retval = zfcp_erp_strategy_memwait(erp_action); retval = zfcp_erp_strategy_memwait(erp_action);
}
goto unlock; goto unlock;
case ZFCP_ERP_CONTINUES: case ZFCP_ERP_CONTINUES:
/* leave since this action runs asynchronously */ /* leave since this action runs asynchronously */
...@@ -1039,12 +988,6 @@ zfcp_erp_strategy_do_action(struct zfcp_erp_action *erp_action) ...@@ -1039,12 +988,6 @@ zfcp_erp_strategy_do_action(struct zfcp_erp_action *erp_action)
case ZFCP_ERP_ACTION_REOPEN_UNIT: case ZFCP_ERP_ACTION_REOPEN_UNIT:
retval = zfcp_erp_unit_strategy(erp_action); retval = zfcp_erp_unit_strategy(erp_action);
break; break;
default:
ZFCP_LOG_NORMAL("bug: unknown erp action requested on "
"adapter %s (action=%d)\n",
zfcp_get_busid_by_adapter(erp_action->adapter),
erp_action->action);
} }
return retval; return retval;
...@@ -1083,8 +1026,7 @@ zfcp_erp_adapter_failed(struct zfcp_adapter *adapter, u8 id, void *ref) ...@@ -1083,8 +1026,7 @@ zfcp_erp_adapter_failed(struct zfcp_adapter *adapter, u8 id, void *ref)
{ {
zfcp_erp_modify_adapter_status(adapter, id, ref, zfcp_erp_modify_adapter_status(adapter, id, ref,
ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET);
ZFCP_LOG_NORMAL("adapter erp failed on adapter %s\n", dev_err(&adapter->ccw_device->dev, "Adapter ERP failed.\n");
zfcp_get_busid_by_adapter(adapter));
} }
/* /*
...@@ -1100,12 +1042,13 @@ zfcp_erp_port_failed(struct zfcp_port *port, u8 id, void *ref) ...@@ -1100,12 +1042,13 @@ zfcp_erp_port_failed(struct zfcp_port *port, u8 id, void *ref)
ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET);
if (atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status)) if (atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status))
ZFCP_LOG_NORMAL("port erp failed (adapter %s, " dev_err(&port->adapter->ccw_device->dev,
"port d_id=0x%06x)\n", "Port ERP failed for WKA port d_id=0x%06x.\n",
zfcp_get_busid_by_port(port), port->d_id); port->d_id);
else else
ZFCP_LOG_NORMAL("port erp failed (adapter %s, wwpn=0x%016Lx)\n", dev_err(&port->adapter->ccw_device->dev,
zfcp_get_busid_by_port(port), port->wwpn); "Port ERP failed for port wwpn=0x%016Lx.\n",
port->wwpn);
} }
/* /*
...@@ -1120,9 +1063,9 @@ zfcp_erp_unit_failed(struct zfcp_unit *unit, u8 id, void *ref) ...@@ -1120,9 +1063,9 @@ zfcp_erp_unit_failed(struct zfcp_unit *unit, u8 id, void *ref)
zfcp_erp_modify_unit_status(unit, id, ref, zfcp_erp_modify_unit_status(unit, id, ref,
ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET);
ZFCP_LOG_NORMAL("unit erp failed on unit 0x%016Lx on port 0x%016Lx " dev_err(&unit->port->adapter->ccw_device->dev,
" on adapter %s\n", unit->fcp_lun, "Unit ERP failed for unit 0x%016Lx on port 0x%016Lx.\n",
unit->port->wwpn, zfcp_get_busid_by_unit(unit)); unit->fcp_lun, unit->port->wwpn);
} }
/* /*
...@@ -1336,13 +1279,10 @@ zfcp_erp_schedule_work(struct zfcp_unit *unit) ...@@ -1336,13 +1279,10 @@ zfcp_erp_schedule_work(struct zfcp_unit *unit)
p = kzalloc(sizeof(*p), GFP_KERNEL); p = kzalloc(sizeof(*p), GFP_KERNEL);
if (!p) { if (!p) {
ZFCP_LOG_NORMAL("error: Out of resources. Could not register " dev_err(&unit->port->adapter->ccw_device->dev,
"the FCP-LUN 0x%Lx connected to " "Out of resources. Could not register unit 0x%016Lx "
"the port with WWPN 0x%Lx connected to " "on port 0x%016Lx with SCSI stack.\n",
"the adapter %s with the SCSI stack.\n", unit->fcp_lun, unit->port->wwpn);
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
return; return;
} }
...@@ -1585,7 +1525,6 @@ static int ...@@ -1585,7 +1525,6 @@ static int
zfcp_erp_adapter_strategy(struct zfcp_erp_action *erp_action) zfcp_erp_adapter_strategy(struct zfcp_erp_action *erp_action)
{ {
int retval; int retval;
struct zfcp_adapter *adapter = erp_action->adapter;
retval = zfcp_erp_adapter_strategy_close(erp_action); retval = zfcp_erp_adapter_strategy_close(erp_action);
if (erp_action->status & ZFCP_STATUS_ERP_CLOSE_ONLY) if (erp_action->status & ZFCP_STATUS_ERP_CLOSE_ONLY)
...@@ -1593,12 +1532,8 @@ zfcp_erp_adapter_strategy(struct zfcp_erp_action *erp_action) ...@@ -1593,12 +1532,8 @@ zfcp_erp_adapter_strategy(struct zfcp_erp_action *erp_action)
else else
retval = zfcp_erp_adapter_strategy_open(erp_action); retval = zfcp_erp_adapter_strategy_open(erp_action);
if (retval == ZFCP_ERP_FAILED) { if (retval == ZFCP_ERP_FAILED)
ZFCP_LOG_INFO("Waiting to allow the adapter %s "
"to recover itself\n",
zfcp_get_busid_by_adapter(adapter));
ssleep(ZFCP_TYPE2_RECOVERY_TIME); ssleep(ZFCP_TYPE2_RECOVERY_TIME);
}
return retval; return retval;
} }
...@@ -1743,19 +1678,13 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) ...@@ -1743,19 +1678,13 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
for (retries = ZFCP_EXCHANGE_CONFIG_DATA_RETRIES; retries; retries--) { for (retries = ZFCP_EXCHANGE_CONFIG_DATA_RETRIES; retries; retries--) {
atomic_clear_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, atomic_clear_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
&adapter->status); &adapter->status);
ZFCP_LOG_DEBUG("Doing exchange config data\n");
write_lock_irq(&adapter->erp_lock); write_lock_irq(&adapter->erp_lock);
zfcp_erp_action_to_running(erp_action); zfcp_erp_action_to_running(erp_action);
write_unlock_irq(&adapter->erp_lock); write_unlock_irq(&adapter->erp_lock);
if (zfcp_fsf_exchange_config_data(erp_action)) { if (zfcp_fsf_exchange_config_data(erp_action)) {
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
ZFCP_LOG_INFO("error: initiation of exchange of "
"configuration data failed for "
"adapter %s\n",
zfcp_get_busid_by_adapter(adapter));
break; break;
} }
ZFCP_LOG_DEBUG("Xchange underway\n");
/* /*
* Why this works: * Why this works:
...@@ -1773,19 +1702,13 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) ...@@ -1773,19 +1702,13 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
zfcp_rec_dbf_event_thread_lock(6, adapter); zfcp_rec_dbf_event_thread_lock(6, adapter);
down(&adapter->erp_ready_sem); down(&adapter->erp_ready_sem);
zfcp_rec_dbf_event_thread_lock(7, adapter); zfcp_rec_dbf_event_thread_lock(7, adapter);
if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) { if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT)
ZFCP_LOG_INFO("error: exchange of configuration data "
"for adapter %s timed out\n",
zfcp_get_busid_by_adapter(adapter));
break; break;
}
if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
&adapter->status)) &adapter->status))
break; break;
ZFCP_LOG_DEBUG("host connection still initialising... "
"waiting and retrying...\n");
/* sleep a little bit before retry */ /* sleep a little bit before retry */
ssleep(sleep); ssleep(sleep);
sleep *= 2; sleep *= 2;
...@@ -1795,12 +1718,8 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) ...@@ -1795,12 +1718,8 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
&adapter->status); &adapter->status);
if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK,
&adapter->status)) { &adapter->status))
ZFCP_LOG_INFO("error: exchange of configuration data for "
"adapter %s failed\n",
zfcp_get_busid_by_adapter(adapter));
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
}
return retval; return retval;
} }
...@@ -1829,16 +1748,8 @@ zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *erp_action) ...@@ -1829,16 +1748,8 @@ zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *erp_action)
zfcp_rec_dbf_event_thread_lock(8, adapter); zfcp_rec_dbf_event_thread_lock(8, adapter);
down(&adapter->erp_ready_sem); down(&adapter->erp_ready_sem);
zfcp_rec_dbf_event_thread_lock(9, adapter); zfcp_rec_dbf_event_thread_lock(9, adapter);
if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) { if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT)
ZFCP_LOG_INFO("error: exchange port data timed out (adapter "
"%s)\n", zfcp_get_busid_by_adapter(adapter));
ret = ZFCP_ERP_FAILED; ret = ZFCP_ERP_FAILED;
}
/* don't treat as error for the sake of compatibility */
if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status))
ZFCP_LOG_INFO("warning: exchange port data failed (adapter "
"%s\n", zfcp_get_busid_by_adapter(adapter));
return ret; return ret;
} }
...@@ -1884,8 +1795,6 @@ zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action) ...@@ -1884,8 +1795,6 @@ zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action)
if (atomic_test_mask((ZFCP_STATUS_PORT_PHYS_OPEN | if (atomic_test_mask((ZFCP_STATUS_PORT_PHYS_OPEN |
ZFCP_STATUS_COMMON_OPEN), ZFCP_STATUS_COMMON_OPEN),
&port->status)) { &port->status)) {
ZFCP_LOG_DEBUG("port 0x%016Lx is open -> trying "
"close physical\n", port->wwpn);
retval = retval =
zfcp_erp_port_forced_strategy_close(erp_action); zfcp_erp_port_forced_strategy_close(erp_action);
} else } else
...@@ -1895,8 +1804,6 @@ zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action) ...@@ -1895,8 +1804,6 @@ zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action)
case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: case ZFCP_ERP_STEP_PHYS_PORT_CLOSING:
if (atomic_test_mask(ZFCP_STATUS_PORT_PHYS_OPEN, if (atomic_test_mask(ZFCP_STATUS_PORT_PHYS_OPEN,
&port->status)) { &port->status)) {
ZFCP_LOG_DEBUG("close physical failed for port "
"0x%016Lx\n", port->wwpn);
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
} else } else
retval = ZFCP_ERP_SUCCEEDED; retval = ZFCP_ERP_SUCCEEDED;
...@@ -1930,8 +1837,6 @@ zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action) ...@@ -1930,8 +1837,6 @@ zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action)
case ZFCP_ERP_STEP_UNINITIALIZED: case ZFCP_ERP_STEP_UNINITIALIZED:
zfcp_erp_port_strategy_clearstati(port); zfcp_erp_port_strategy_clearstati(port);
if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &port->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &port->status)) {
ZFCP_LOG_DEBUG("port 0x%016Lx is open -> trying "
"close\n", port->wwpn);
retval = zfcp_erp_port_strategy_close(erp_action); retval = zfcp_erp_port_strategy_close(erp_action);
goto out; goto out;
} /* else it's already closed, open it */ } /* else it's already closed, open it */
...@@ -1939,8 +1844,6 @@ zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action) ...@@ -1939,8 +1844,6 @@ zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action)
case ZFCP_ERP_STEP_PORT_CLOSING: case ZFCP_ERP_STEP_PORT_CLOSING:
if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &port->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &port->status)) {
ZFCP_LOG_DEBUG("close failed for port 0x%016Lx\n",
port->wwpn);
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
goto out; goto out;
} /* else it's closed now, open it */ } /* else it's closed now, open it */
...@@ -1983,12 +1886,10 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) ...@@ -1983,12 +1886,10 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action)
case ZFCP_ERP_STEP_PORT_CLOSING: case ZFCP_ERP_STEP_PORT_CLOSING:
if (fc_host_port_type(adapter->scsi_host) == FC_PORTTYPE_PTP) { if (fc_host_port_type(adapter->scsi_host) == FC_PORTTYPE_PTP) {
if (port->wwpn != adapter->peer_wwpn) { if (port->wwpn != adapter->peer_wwpn) {
ZFCP_LOG_NORMAL("Failed to open port 0x%016Lx " dev_err(&adapter->ccw_device->dev,
"on adapter %s.\nPeer WWPN " "Failed to open port 0x%016Lx, "
"0x%016Lx does not match\n", "Peer WWPN 0x%016Lx does not match.\n",
port->wwpn, port->wwpn, adapter->peer_wwpn);
zfcp_get_busid_by_adapter(adapter),
adapter->peer_wwpn);
zfcp_erp_port_failed(port, 25, NULL); zfcp_erp_port_failed(port, 25, NULL);
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
break; break;
...@@ -2001,17 +1902,14 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) ...@@ -2001,17 +1902,14 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action)
if (!(adapter->nameserver_port)) { if (!(adapter->nameserver_port)) {
retval = zfcp_nameserver_enqueue(adapter); retval = zfcp_nameserver_enqueue(adapter);
if (retval != 0) { if (retval != 0) {
ZFCP_LOG_NORMAL("error: nameserver port " dev_err(&adapter->ccw_device->dev,
"unavailable for adapter %s\n", "Nameserver port unavailable.\n");
zfcp_get_busid_by_adapter(adapter));
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
break; break;
} }
} }
if (!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, if (!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED,
&adapter->nameserver_port->status)) { &adapter->nameserver_port->status)) {
ZFCP_LOG_DEBUG("nameserver port is not open -> open "
"nameserver port\n");
/* nameserver port may live again */ /* nameserver port may live again */
atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING, atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING,
&adapter->nameserver_port->status); &adapter->nameserver_port->status);
...@@ -2027,57 +1925,37 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) ...@@ -2027,57 +1925,37 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action)
/* else nameserver port is already open, fall through */ /* else nameserver port is already open, fall through */
case ZFCP_ERP_STEP_NAMESERVER_OPEN: case ZFCP_ERP_STEP_NAMESERVER_OPEN:
if (!atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, if (!atomic_test_mask(ZFCP_STATUS_COMMON_OPEN,
&adapter->nameserver_port->status)) { &adapter->nameserver_port->status))
ZFCP_LOG_DEBUG("open failed for nameserver port\n");
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
} else { else
ZFCP_LOG_DEBUG("nameserver port is open -> "
"nameserver look-up for port 0x%016Lx\n",
port->wwpn);
retval = zfcp_erp_port_strategy_open_common_lookup retval = zfcp_erp_port_strategy_open_common_lookup
(erp_action); (erp_action);
}
break; break;
case ZFCP_ERP_STEP_NAMESERVER_LOOKUP: case ZFCP_ERP_STEP_NAMESERVER_LOOKUP:
if (!atomic_test_mask(ZFCP_STATUS_PORT_DID_DID, &port->status)) { if (!atomic_test_mask(ZFCP_STATUS_PORT_DID_DID, &port->status)) {
if (atomic_test_mask if (atomic_test_mask
(ZFCP_STATUS_PORT_INVALID_WWPN, &port->status)) { (ZFCP_STATUS_PORT_INVALID_WWPN, &port->status)) {
ZFCP_LOG_DEBUG("nameserver look-up failed "
"for port 0x%016Lx "
"(misconfigured WWPN?)\n",
port->wwpn);
zfcp_erp_port_failed(port, 26, NULL); zfcp_erp_port_failed(port, 26, NULL);
retval = ZFCP_ERP_EXIT; retval = ZFCP_ERP_EXIT;
} else { } else
ZFCP_LOG_DEBUG("nameserver look-up failed for "
"port 0x%016Lx\n", port->wwpn);
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
} } else
} else {
ZFCP_LOG_DEBUG("port 0x%016Lx has d_id=0x%06x -> "
"trying open\n", port->wwpn, port->d_id);
retval = zfcp_erp_port_strategy_open_port(erp_action); retval = zfcp_erp_port_strategy_open_port(erp_action);
}
break; break;
case ZFCP_ERP_STEP_PORT_OPENING: case ZFCP_ERP_STEP_PORT_OPENING:
/* D_ID might have changed during open */ /* D_ID might have changed during open */
if (atomic_test_mask((ZFCP_STATUS_COMMON_OPEN | if (atomic_test_mask((ZFCP_STATUS_COMMON_OPEN |
ZFCP_STATUS_PORT_DID_DID), ZFCP_STATUS_PORT_DID_DID),
&port->status)) { &port->status))
ZFCP_LOG_DEBUG("port 0x%016Lx is open\n", port->wwpn);
retval = ZFCP_ERP_SUCCEEDED; retval = ZFCP_ERP_SUCCEEDED;
} else { else
ZFCP_LOG_DEBUG("open failed for port 0x%016Lx\n",
port->wwpn);
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
}
break; break;
default: default:
ZFCP_LOG_NORMAL("bug: unknown erp step 0x%08x\n", /* unknown erp step */
erp_action->step);
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
} }
...@@ -2095,27 +1973,20 @@ zfcp_erp_port_strategy_open_nameserver(struct zfcp_erp_action *erp_action) ...@@ -2095,27 +1973,20 @@ zfcp_erp_port_strategy_open_nameserver(struct zfcp_erp_action *erp_action)
case ZFCP_ERP_STEP_UNINITIALIZED: case ZFCP_ERP_STEP_UNINITIALIZED:
case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: case ZFCP_ERP_STEP_PHYS_PORT_CLOSING:
case ZFCP_ERP_STEP_PORT_CLOSING: case ZFCP_ERP_STEP_PORT_CLOSING:
ZFCP_LOG_DEBUG("port 0x%016Lx has d_id=0x%06x -> trying open\n",
port->wwpn, port->d_id);
retval = zfcp_erp_port_strategy_open_port(erp_action); retval = zfcp_erp_port_strategy_open_port(erp_action);
break; break;
case ZFCP_ERP_STEP_PORT_OPENING: case ZFCP_ERP_STEP_PORT_OPENING:
if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &port->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &port->status))
ZFCP_LOG_DEBUG("WKA port is open\n");
retval = ZFCP_ERP_SUCCEEDED; retval = ZFCP_ERP_SUCCEEDED;
} else { else
ZFCP_LOG_DEBUG("open failed for WKA port\n");
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
}
/* this is needed anyway (dont care for retval of wakeup) */ /* this is needed anyway (dont care for retval of wakeup) */
ZFCP_LOG_DEBUG("continue other open port operations\n");
zfcp_erp_port_strategy_open_nameserver_wakeup(erp_action); zfcp_erp_port_strategy_open_nameserver_wakeup(erp_action);
break; break;
default: default:
ZFCP_LOG_NORMAL("bug: unknown erp step 0x%08x\n", /* unknown erp step */
erp_action->step);
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
} }
...@@ -2313,39 +2184,26 @@ zfcp_erp_unit_strategy(struct zfcp_erp_action *erp_action) ...@@ -2313,39 +2184,26 @@ zfcp_erp_unit_strategy(struct zfcp_erp_action *erp_action)
case ZFCP_ERP_STEP_UNINITIALIZED: case ZFCP_ERP_STEP_UNINITIALIZED:
zfcp_erp_unit_strategy_clearstati(unit); zfcp_erp_unit_strategy_clearstati(unit);
if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status)) {
ZFCP_LOG_DEBUG("unit 0x%016Lx is open -> "
"trying close\n", unit->fcp_lun);
retval = zfcp_erp_unit_strategy_close(erp_action); retval = zfcp_erp_unit_strategy_close(erp_action);
break; break;
} }
/* else it's already closed, fall through */ /* else it's already closed, fall through */
case ZFCP_ERP_STEP_UNIT_CLOSING: case ZFCP_ERP_STEP_UNIT_CLOSING:
if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status))
ZFCP_LOG_DEBUG("close failed for unit 0x%016Lx\n",
unit->fcp_lun);
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
} else { else
if (erp_action->status & ZFCP_STATUS_ERP_CLOSE_ONLY) if (erp_action->status & ZFCP_STATUS_ERP_CLOSE_ONLY)
retval = ZFCP_ERP_EXIT; retval = ZFCP_ERP_EXIT;
else { else
ZFCP_LOG_DEBUG("unit 0x%016Lx is not open -> "
"trying open\n", unit->fcp_lun);
retval = retval =
zfcp_erp_unit_strategy_open(erp_action); zfcp_erp_unit_strategy_open(erp_action);
}
}
break; break;
case ZFCP_ERP_STEP_UNIT_OPENING: case ZFCP_ERP_STEP_UNIT_OPENING:
if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status))
ZFCP_LOG_DEBUG("unit 0x%016Lx is open\n",
unit->fcp_lun);
retval = ZFCP_ERP_SUCCEEDED; retval = ZFCP_ERP_SUCCEEDED;
} else { else
ZFCP_LOG_DEBUG("open failed for unit 0x%016Lx\n",
unit->fcp_lun);
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
}
break; break;
} }
...@@ -2493,16 +2351,8 @@ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, ...@@ -2493,16 +2351,8 @@ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter,
case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_INUSE, if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_INUSE,
&port->status)) { &port->status))
if (port->erp_action.action !=
ZFCP_ERP_ACTION_REOPEN_PORT_FORCED) {
ZFCP_LOG_INFO("dropped erp action %i (port "
"0x%016Lx, action in use: %i)\n",
want, port->wwpn,
port->erp_action.action);
}
goto out; goto out;
}
if (!atomic_test_mask if (!atomic_test_mask
(ZFCP_STATUS_COMMON_RUNNING, &adapter->status) || (ZFCP_STATUS_COMMON_RUNNING, &adapter->status) ||
atomic_test_mask atomic_test_mask
...@@ -2522,19 +2372,10 @@ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, ...@@ -2522,19 +2372,10 @@ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter,
break; break;
default: default:
ZFCP_LOG_NORMAL("bug: unknown erp action requested " /* unknown erp action */
"on adapter %s (action=%d)\n",
zfcp_get_busid_by_adapter(adapter), want);
goto out; goto out;
} }
/* check whether we need something stronger first */
if (need) {
ZFCP_LOG_DEBUG("stronger erp action %d needed before "
"erp action %d on adapter %s\n",
need, want, zfcp_get_busid_by_adapter(adapter));
}
/* mark adapter to have some error recovery pending */ /* mark adapter to have some error recovery pending */
atomic_set_mask(ZFCP_STATUS_ADAPTER_ERP_PENDING, &adapter->status); atomic_set_mask(ZFCP_STATUS_ADAPTER_ERP_PENDING, &adapter->status);
...@@ -2672,10 +2513,9 @@ zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter, ...@@ -2672,10 +2513,9 @@ zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter,
port->rport = port->rport =
fc_remote_port_add(adapter->scsi_host, 0, &ids); fc_remote_port_add(adapter->scsi_host, 0, &ids);
if (!port->rport) if (!port->rport)
ZFCP_LOG_NORMAL("failed registration of rport" dev_err(&adapter->ccw_device->dev,
"(adapter %s, wwpn=0x%016Lx)\n", "Failed registration of rport "
zfcp_get_busid_by_port(port), "0x%016Lx.\n", port->wwpn);
port->wwpn);
else { else {
scsi_target_unblock(&port->rport->dev); scsi_target_unblock(&port->rport->dev);
port->rport->maxframe_size = port->maxframe_size; port->rport->maxframe_size = port->maxframe_size;
...@@ -2803,7 +2643,6 @@ void zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter, u8 id, ...@@ -2803,7 +2643,6 @@ void zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter, u8 id,
void zfcp_erp_port_access_changed(struct zfcp_port *port, u8 id, void *ref) void zfcp_erp_port_access_changed(struct zfcp_port *port, u8 id, void *ref)
{ {
struct zfcp_adapter *adapter = port->adapter;
struct zfcp_unit *unit; struct zfcp_unit *unit;
if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED,
...@@ -2816,34 +2655,16 @@ void zfcp_erp_port_access_changed(struct zfcp_port *port, u8 id, void *ref) ...@@ -2816,34 +2655,16 @@ void zfcp_erp_port_access_changed(struct zfcp_port *port, u8 id, void *ref)
return; return;
} }
ZFCP_LOG_NORMAL("reopen of port 0x%016Lx on adapter %s " zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED, id, ref);
"(due to ACT update)\n",
port->wwpn, zfcp_get_busid_by_adapter(adapter));
if (zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED, id, ref))
ZFCP_LOG_NORMAL("failed reopen of port"
"(adapter %s, wwpn=0x%016Lx)\n",
zfcp_get_busid_by_adapter(adapter), port->wwpn);
} }
void zfcp_erp_unit_access_changed(struct zfcp_unit *unit, u8 id, void *ref) void zfcp_erp_unit_access_changed(struct zfcp_unit *unit, u8 id, void *ref)
{ {
struct zfcp_adapter *adapter = unit->port->adapter;
if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED,
&unit->status) && &unit->status) &&
!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_BOXED, !atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_BOXED,
&unit->status)) &unit->status))
return; return;
ZFCP_LOG_NORMAL("reopen of unit 0x%016Lx on port 0x%016Lx " zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED, id, ref);
" on adapter %s (due to ACT update)\n",
unit->fcp_lun, unit->port->wwpn,
zfcp_get_busid_by_adapter(adapter));
if (zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED, id, ref))
ZFCP_LOG_NORMAL("failed reopen of unit (adapter %s, "
"wwpn=0x%016Lx, fcp_lun=0x%016Lx)\n",
zfcp_get_busid_by_adapter(adapter),
unit->port->wwpn, unit->fcp_lun);
} }
#undef ZFCP_LOG_AREA
/* /*
* This file is part of the zfcp device driver for * zfcp device driver
* FCP adapters for IBM System z9 and zSeries.
* *
* (C) Copyright IBM Corp. 2002, 2006 * External function declarations.
* *
* This program is free software; you can redistribute it and/or modify * Copyright IBM Corporation 2002, 2008
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#ifndef ZFCP_EXT_H #ifndef ZFCP_EXT_H
...@@ -27,7 +14,6 @@ ...@@ -27,7 +14,6 @@
extern struct zfcp_data zfcp_data; extern struct zfcp_data zfcp_data;
/******************************** SYSFS *************************************/ /******************************** SYSFS *************************************/
extern struct attribute_group *zfcp_driver_attr_groups[];
extern int zfcp_sysfs_adapter_create_files(struct device *); extern int zfcp_sysfs_adapter_create_files(struct device *);
extern void zfcp_sysfs_adapter_remove_files(struct device *); extern void zfcp_sysfs_adapter_remove_files(struct device *);
extern int zfcp_sysfs_port_create_files(struct device *, u32); extern int zfcp_sysfs_port_create_files(struct device *, u32);
......
/* /*
* This file is part of the zfcp device driver for * zfcp device driver
* FCP adapters for IBM System z9 and zSeries.
* *
* (C) Copyright IBM Corp. 2002, 2006 * Implementation of FSF commands.
* *
* This program is free software; you can redistribute it and/or modify * Copyright IBM Corporation 2002, 2008
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include "zfcp_ext.h" #include "zfcp_ext.h"
...@@ -71,12 +58,58 @@ static const char zfcp_act_subtable_type[5][8] = { ...@@ -71,12 +58,58 @@ static const char zfcp_act_subtable_type[5][8] = {
"unknown", "OS", "WWPN", "DID", "LUN" "unknown", "OS", "WWPN", "DID", "LUN"
}; };
static void zfcp_act_eval_err(struct zfcp_adapter *adapter, u32 table)
{
u16 subtable = (table & 0xffff0000) >> 16;
u16 rule = table & 0xffff;
if (subtable > 0 &&
subtable < ARRAY_SIZE(zfcp_act_subtable_type)) {
dev_warn(&adapter->ccw_device->dev,
"Access denied in subtable %s, rule %d.\n",
zfcp_act_subtable_type[subtable], rule);
}
}
static void zfcp_fsf_access_denied_port(struct zfcp_fsf_req *req,
struct zfcp_port *port)
{
struct fsf_qtcb_header *header = &req->qtcb->header;
dev_warn(&req->adapter->ccw_device->dev,
"Access denied, cannot send command to port 0x%016Lx.\n",
port->wwpn);
zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[0]);
zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[1]);
zfcp_erp_port_access_denied(port, 55, req);
req->status |= ZFCP_STATUS_FSFREQ_ERROR;
}
static void zfcp_fsf_access_denied_unit(struct zfcp_fsf_req *req,
struct zfcp_unit *unit)
{
struct fsf_qtcb_header *header = &req->qtcb->header;
dev_warn(&req->adapter->ccw_device->dev,
"Access denied for unit 0x%016Lx on port 0x%016Lx.\n",
unit->fcp_lun, unit->port->wwpn);
zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[0]);
zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[1]);
zfcp_erp_unit_access_denied(unit, 59, req);
req->status |= ZFCP_STATUS_FSFREQ_ERROR;
}
static void zfcp_fsf_class_not_supp(struct zfcp_fsf_req *req)
{
dev_err(&req->adapter->ccw_device->dev,
"Required FC class not supported by adapter, "
"shutting down adapter.\n");
zfcp_erp_adapter_shutdown(req->adapter, 0, 123, req);
req->status |= ZFCP_STATUS_FSFREQ_ERROR;
}
/****************************************************************/ /****************************************************************/
/*************** FSF related Functions *************************/ /*************** FSF related Functions *************************/
/****************************************************************/ /****************************************************************/
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_FSF
/* /*
* function: zfcp_fsf_req_alloc * function: zfcp_fsf_req_alloc
* *
...@@ -200,7 +233,6 @@ zfcp_fsf_req_complete(struct zfcp_fsf_req *fsf_req) ...@@ -200,7 +233,6 @@ zfcp_fsf_req_complete(struct zfcp_fsf_req *fsf_req)
int cleanup; int cleanup;
if (unlikely(fsf_req->fsf_command == FSF_QTCB_UNSOLICITED_STATUS)) { if (unlikely(fsf_req->fsf_command == FSF_QTCB_UNSOLICITED_STATUS)) {
ZFCP_LOG_DEBUG("Status read response received\n");
/* /*
* Note: all cleanup handling is done in the callchain of * Note: all cleanup handling is done in the callchain of
* the function call-chain below. * the function call-chain below.
...@@ -225,7 +257,6 @@ zfcp_fsf_req_complete(struct zfcp_fsf_req *fsf_req) ...@@ -225,7 +257,6 @@ zfcp_fsf_req_complete(struct zfcp_fsf_req *fsf_req)
/* cleanup request if requested by initiator */ /* cleanup request if requested by initiator */
if (likely(cleanup)) { if (likely(cleanup)) {
ZFCP_LOG_TRACE("removing FSF request %p\n", fsf_req);
/* /*
* lock must not be held here since it will be * lock must not be held here since it will be
* grabed by the called routine, too * grabed by the called routine, too
...@@ -233,7 +264,6 @@ zfcp_fsf_req_complete(struct zfcp_fsf_req *fsf_req) ...@@ -233,7 +264,6 @@ zfcp_fsf_req_complete(struct zfcp_fsf_req *fsf_req)
zfcp_fsf_req_free(fsf_req); zfcp_fsf_req_free(fsf_req);
} else { } else {
/* notify initiator waiting for the requests completion */ /* notify initiator waiting for the requests completion */
ZFCP_LOG_TRACE("waking initiator of FSF request %p\n",fsf_req);
/* /*
* FIXME: Race! We must not access fsf_req here as it might have been * FIXME: Race! We must not access fsf_req here as it might have been
* cleaned up already due to the set ZFCP_STATUS_FSFREQ_COMPLETED * cleaned up already due to the set ZFCP_STATUS_FSFREQ_COMPLETED
...@@ -276,8 +306,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) ...@@ -276,8 +306,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
zfcp_hba_dbf_event_fsf_response(fsf_req); zfcp_hba_dbf_event_fsf_response(fsf_req);
if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED) { if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED) {
ZFCP_LOG_DEBUG("fsf_req 0x%lx has been dismissed\n",
(unsigned long) fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
ZFCP_STATUS_FSFREQ_RETRY; /* only for SCSI cmnds. */ ZFCP_STATUS_FSFREQ_RETRY; /* only for SCSI cmnds. */
goto skip_protstatus; goto skip_protstatus;
...@@ -291,34 +319,26 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) ...@@ -291,34 +319,26 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
break; break;
case FSF_PROT_QTCB_VERSION_ERROR: case FSF_PROT_QTCB_VERSION_ERROR:
ZFCP_LOG_NORMAL("error: The adapter %s contains " dev_err(&adapter->ccw_device->dev,
"microcode of version 0x%x, the device driver " "The QTCB version requested by zfcp (0x%x) is not "
"only supports 0x%x. Aborting.\n", "supported by the FCP adapter (lowest supported 0x%x, "
zfcp_get_busid_by_adapter(adapter), "highest supported 0x%x).\n",
prot_status_qual->version_error.fsf_version, ZFCP_QTCB_VERSION, prot_status_qual->word[0],
ZFCP_QTCB_VERSION); prot_status_qual->word[1]);
zfcp_erp_adapter_shutdown(adapter, 0, 117, fsf_req); zfcp_erp_adapter_shutdown(adapter, 0, 117, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_PROT_SEQ_NUMB_ERROR: case FSF_PROT_SEQ_NUMB_ERROR:
ZFCP_LOG_NORMAL("bug: Sequence number mismatch between "
"driver (0x%x) and adapter %s (0x%x). "
"Restarting all operations on this adapter.\n",
qtcb->prefix.req_seq_no,
zfcp_get_busid_by_adapter(adapter),
prot_status_qual->sequence_error.exp_req_seq_no);
zfcp_erp_adapter_reopen(adapter, 0, 98, fsf_req); zfcp_erp_adapter_reopen(adapter, 0, 98, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_RETRY; fsf_req->status |= ZFCP_STATUS_FSFREQ_RETRY;
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_PROT_UNSUPP_QTCB_TYPE: case FSF_PROT_UNSUPP_QTCB_TYPE:
ZFCP_LOG_NORMAL("error: Packet header type used by the " dev_err(&adapter->ccw_device->dev,
"device driver is incompatible with " "Packet header type used by the device driver is "
"that used on adapter %s. " "incompatible with that used on the adapter.\n");
"Stopping all operations on this adapter.\n",
zfcp_get_busid_by_adapter(adapter));
zfcp_erp_adapter_shutdown(adapter, 0, 118, fsf_req); zfcp_erp_adapter_shutdown(adapter, 0, 118, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
...@@ -330,12 +350,9 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) ...@@ -330,12 +350,9 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
break; break;
case FSF_PROT_DUPLICATE_REQUEST_ID: case FSF_PROT_DUPLICATE_REQUEST_ID:
ZFCP_LOG_NORMAL("bug: The request identifier 0x%Lx " dev_err(&adapter->ccw_device->dev,
"to the adapter %s is ambiguous. " "The request identifier 0x%Lx is ambiguous.\n",
"Stopping all operations on this adapter.\n", (unsigned long long)qtcb->bottom.support.req_handle);
*(unsigned long long*)
(&qtcb->bottom.support.req_handle),
zfcp_get_busid_by_adapter(adapter));
zfcp_erp_adapter_shutdown(adapter, 0, 78, fsf_req); zfcp_erp_adapter_shutdown(adapter, 0, 78, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
...@@ -349,10 +366,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) ...@@ -349,10 +366,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
break; break;
case FSF_PROT_REEST_QUEUE: case FSF_PROT_REEST_QUEUE:
ZFCP_LOG_NORMAL("The local link to adapter with "
"%s was re-plugged. "
"Re-starting operations on this adapter.\n",
zfcp_get_busid_by_adapter(adapter));
/* All ports should be marked as ready to run again */ /* All ports should be marked as ready to run again */
zfcp_erp_modify_adapter_status(adapter, 28, NULL, zfcp_erp_modify_adapter_status(adapter, 28, NULL,
ZFCP_STATUS_COMMON_RUNNING, ZFCP_STATUS_COMMON_RUNNING,
...@@ -365,24 +378,17 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) ...@@ -365,24 +378,17 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
break; break;
case FSF_PROT_ERROR_STATE: case FSF_PROT_ERROR_STATE:
ZFCP_LOG_NORMAL("error: The adapter %s "
"has entered the error state. "
"Restarting all operations on this "
"adapter.\n",
zfcp_get_busid_by_adapter(adapter));
zfcp_erp_adapter_reopen(adapter, 0, 100, fsf_req); zfcp_erp_adapter_reopen(adapter, 0, 100, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_RETRY; fsf_req->status |= ZFCP_STATUS_FSFREQ_RETRY;
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
default: default:
ZFCP_LOG_NORMAL("bug: Transfer protocol status information " dev_err(&adapter->ccw_device->dev,
"provided by the adapter %s " "Transfer protocol status information"
"is not compatible with the device driver. " "provided by the adapter (0x%x) "
"Stopping all operations on this adapter. " "is not compatible with the device driver.\n",
"(debug info 0x%x).\n", qtcb->prefix.prot_status);
zfcp_get_busid_by_adapter(adapter),
qtcb->prefix.prot_status);
zfcp_erp_adapter_shutdown(adapter, 0, 119, fsf_req); zfcp_erp_adapter_shutdown(adapter, 0, 119, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
} }
...@@ -416,21 +422,14 @@ zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *fsf_req) ...@@ -416,21 +422,14 @@ zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *fsf_req)
/* evaluate FSF Status */ /* evaluate FSF Status */
switch (fsf_req->qtcb->header.fsf_status) { switch (fsf_req->qtcb->header.fsf_status) {
case FSF_UNKNOWN_COMMAND: case FSF_UNKNOWN_COMMAND:
ZFCP_LOG_NORMAL("bug: Command issued by the device driver is " dev_err(&fsf_req->adapter->ccw_device->dev,
"not known by the adapter %s " "Command issued by the device driver (0x%x) is "
"Stopping all operations on this adapter. " "not known by the adapter.\n",
"(debug info 0x%x).\n", fsf_req->qtcb->header.fsf_command);
zfcp_get_busid_by_adapter(fsf_req->adapter),
fsf_req->qtcb->header.fsf_command);
zfcp_erp_adapter_shutdown(fsf_req->adapter, 0, 120, fsf_req); zfcp_erp_adapter_shutdown(fsf_req->adapter, 0, 120, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_FCP_RSP_AVAILABLE:
ZFCP_LOG_DEBUG("FCP Sense data will be presented to the "
"SCSI stack.\n");
break;
case FSF_ADAPTER_STATUS_AVAILABLE: case FSF_ADAPTER_STATUS_AVAILABLE:
zfcp_fsf_fsfstatus_qual_eval(fsf_req); zfcp_fsf_fsfstatus_qual_eval(fsf_req);
break; break;
...@@ -472,17 +471,13 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req) ...@@ -472,17 +471,13 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req)
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_SQ_NO_RECOM: case FSF_SQ_NO_RECOM:
ZFCP_LOG_NORMAL("bug: No recommendation could be given for a " dev_err(&fsf_req->adapter->ccw_device->dev,
"problem on the adapter %s " "No recommendation could be given for a "
"Stopping all operations on this adapter. ", "problem on the adapter.\n");
zfcp_get_busid_by_adapter(fsf_req->adapter));
zfcp_erp_adapter_shutdown(fsf_req->adapter, 0, 121, fsf_req); zfcp_erp_adapter_shutdown(fsf_req->adapter, 0, 121, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_SQ_ULP_PROGRAMMING_ERROR: case FSF_SQ_ULP_PROGRAMMING_ERROR:
ZFCP_LOG_NORMAL("error: not enough SBALs for data transfer "
"(adapter %s)\n",
zfcp_get_busid_by_adapter(fsf_req->adapter));
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
...@@ -491,11 +486,6 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req) ...@@ -491,11 +486,6 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req)
/* dealt with in the respective functions */ /* dealt with in the respective functions */
break; break;
default: default:
ZFCP_LOG_NORMAL("bug: Additional status info could "
"not be interpreted properly.\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL,
(char *) &fsf_req->qtcb->header.fsf_status_qual,
sizeof (union fsf_status_qual));
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
} }
...@@ -523,84 +513,67 @@ zfcp_fsf_link_down_info_eval(struct zfcp_fsf_req *fsf_req, u8 id, ...@@ -523,84 +513,67 @@ zfcp_fsf_link_down_info_eval(struct zfcp_fsf_req *fsf_req, u8 id,
switch (link_down->error_code) { switch (link_down->error_code) {
case FSF_PSQ_LINK_NO_LIGHT: case FSF_PSQ_LINK_NO_LIGHT:
ZFCP_LOG_NORMAL("The local link to adapter %s is down " dev_warn(&fsf_req->adapter->ccw_device->dev,
"(no light detected)\n", "The local link is down: "
zfcp_get_busid_by_adapter(adapter)); "no light detected.\n");
break; break;
case FSF_PSQ_LINK_WRAP_PLUG: case FSF_PSQ_LINK_WRAP_PLUG:
ZFCP_LOG_NORMAL("The local link to adapter %s is down " dev_warn(&fsf_req->adapter->ccw_device->dev,
"(wrap plug detected)\n", "The local link is down: "
zfcp_get_busid_by_adapter(adapter)); "wrap plug detected.\n");
break; break;
case FSF_PSQ_LINK_NO_FCP: case FSF_PSQ_LINK_NO_FCP:
ZFCP_LOG_NORMAL("The local link to adapter %s is down " dev_warn(&fsf_req->adapter->ccw_device->dev,
"(adjacent node on link does not support FCP)\n", "The local link is down: "
zfcp_get_busid_by_adapter(adapter)); "adjacent node on link does not support FCP.\n");
break; break;
case FSF_PSQ_LINK_FIRMWARE_UPDATE: case FSF_PSQ_LINK_FIRMWARE_UPDATE:
ZFCP_LOG_NORMAL("The local link to adapter %s is down " dev_warn(&fsf_req->adapter->ccw_device->dev,
"(firmware update in progress)\n", "The local link is down: "
zfcp_get_busid_by_adapter(adapter)); "firmware update in progress.\n");
break; break;
case FSF_PSQ_LINK_INVALID_WWPN: case FSF_PSQ_LINK_INVALID_WWPN:
ZFCP_LOG_NORMAL("The local link to adapter %s is down " dev_warn(&fsf_req->adapter->ccw_device->dev,
"(duplicate or invalid WWPN detected)\n", "The local link is down: "
zfcp_get_busid_by_adapter(adapter)); "duplicate or invalid WWPN detected.\n");
break; break;
case FSF_PSQ_LINK_NO_NPIV_SUPPORT: case FSF_PSQ_LINK_NO_NPIV_SUPPORT:
ZFCP_LOG_NORMAL("The local link to adapter %s is down " dev_warn(&fsf_req->adapter->ccw_device->dev,
"(no support for NPIV by Fabric)\n", "The local link is down: "
zfcp_get_busid_by_adapter(adapter)); "no support for NPIV by Fabric.\n");
break; break;
case FSF_PSQ_LINK_NO_FCP_RESOURCES: case FSF_PSQ_LINK_NO_FCP_RESOURCES:
ZFCP_LOG_NORMAL("The local link to adapter %s is down " dev_warn(&fsf_req->adapter->ccw_device->dev,
"(out of resource in FCP daughtercard)\n", "The local link is down: "
zfcp_get_busid_by_adapter(adapter)); "out of resource in FCP daughtercard.\n");
break; break;
case FSF_PSQ_LINK_NO_FABRIC_RESOURCES: case FSF_PSQ_LINK_NO_FABRIC_RESOURCES:
ZFCP_LOG_NORMAL("The local link to adapter %s is down " dev_warn(&fsf_req->adapter->ccw_device->dev,
"(out of resource in Fabric)\n", "The local link is down: "
zfcp_get_busid_by_adapter(adapter)); "out of resource in Fabric.\n");
break; break;
case FSF_PSQ_LINK_FABRIC_LOGIN_UNABLE: case FSF_PSQ_LINK_FABRIC_LOGIN_UNABLE:
ZFCP_LOG_NORMAL("The local link to adapter %s is down " dev_warn(&fsf_req->adapter->ccw_device->dev,
"(unable to Fabric login)\n", "The local link is down: "
zfcp_get_busid_by_adapter(adapter)); "unable to login to Fabric.\n");
break; break;
case FSF_PSQ_LINK_WWPN_ASSIGNMENT_CORRUPTED: case FSF_PSQ_LINK_WWPN_ASSIGNMENT_CORRUPTED:
ZFCP_LOG_NORMAL("WWPN assignment file corrupted on adapter %s\n", dev_warn(&fsf_req->adapter->ccw_device->dev,
zfcp_get_busid_by_adapter(adapter)); "WWPN assignment file corrupted on adapter.\n");
break; break;
case FSF_PSQ_LINK_MODE_TABLE_CURRUPTED: case FSF_PSQ_LINK_MODE_TABLE_CURRUPTED:
ZFCP_LOG_NORMAL("Mode table corrupted on adapter %s\n", dev_warn(&fsf_req->adapter->ccw_device->dev,
zfcp_get_busid_by_adapter(adapter)); "Mode table corrupted on adapter.\n");
break; break;
case FSF_PSQ_LINK_NO_WWPN_ASSIGNMENT: case FSF_PSQ_LINK_NO_WWPN_ASSIGNMENT:
ZFCP_LOG_NORMAL("No WWPN for assignment table on adapter %s\n", dev_warn(&fsf_req->adapter->ccw_device->dev,
zfcp_get_busid_by_adapter(adapter)); "No WWPN for assignment table on adapter.\n");
break; break;
default: default:
ZFCP_LOG_NORMAL("The local link to adapter %s is down " dev_warn(&fsf_req->adapter->ccw_device->dev,
"(warning: unknown reason code %d)\n", "The local link to adapter is down.\n");
zfcp_get_busid_by_adapter(adapter),
link_down->error_code);
} }
if (adapter->connection_features & FSF_FEATURE_NPIV_MODE)
ZFCP_LOG_DEBUG("Debug information to link down: "
"primary_status=0x%02x "
"ioerr_code=0x%02x "
"action_code=0x%02x "
"reason_code=0x%02x "
"explanation_code=0x%02x "
"vendor_specific_code=0x%02x\n",
link_down->primary_status,
link_down->ioerr_code,
link_down->action_code,
link_down->reason_code,
link_down->explanation_code,
link_down->vendor_specific_code);
out: out:
zfcp_erp_adapter_failed(adapter, id, fsf_req); zfcp_erp_adapter_failed(adapter, id, fsf_req);
} }
...@@ -616,7 +589,6 @@ static int ...@@ -616,7 +589,6 @@ static int
zfcp_fsf_req_dispatch(struct zfcp_fsf_req *fsf_req) zfcp_fsf_req_dispatch(struct zfcp_fsf_req *fsf_req)
{ {
struct zfcp_erp_action *erp_action = fsf_req->erp_action; struct zfcp_erp_action *erp_action = fsf_req->erp_action;
struct zfcp_adapter *adapter = fsf_req->adapter;
int retval = 0; int retval = 0;
...@@ -673,20 +645,6 @@ zfcp_fsf_req_dispatch(struct zfcp_fsf_req *fsf_req) ...@@ -673,20 +645,6 @@ zfcp_fsf_req_dispatch(struct zfcp_fsf_req *fsf_req)
case FSF_QTCB_UPLOAD_CONTROL_FILE: case FSF_QTCB_UPLOAD_CONTROL_FILE:
zfcp_fsf_control_file_handler(fsf_req); zfcp_fsf_control_file_handler(fsf_req);
break; break;
default:
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
ZFCP_LOG_NORMAL("bug: Command issued by the device driver is "
"not supported by the adapter %s\n",
zfcp_get_busid_by_adapter(adapter));
if (fsf_req->fsf_command != fsf_req->qtcb->header.fsf_command)
ZFCP_LOG_NORMAL
("bug: Command issued by the device driver differs "
"from the command returned by the adapter %s "
"(debug info 0x%x, 0x%x).\n",
zfcp_get_busid_by_adapter(adapter),
fsf_req->fsf_command,
fsf_req->qtcb->header.fsf_command);
} }
if (!erp_action) if (!erp_action)
...@@ -718,12 +676,8 @@ zfcp_fsf_status_read(struct zfcp_adapter *adapter, int req_flags) ...@@ -718,12 +676,8 @@ zfcp_fsf_status_read(struct zfcp_adapter *adapter, int req_flags)
req_flags | ZFCP_REQ_NO_QTCB, req_flags | ZFCP_REQ_NO_QTCB,
adapter->pool.fsf_req_status_read, adapter->pool.fsf_req_status_read,
&lock_flags, &fsf_req); &lock_flags, &fsf_req);
if (retval < 0) { if (retval < 0)
ZFCP_LOG_INFO("error: Could not create unsolicited status "
"buffer for adapter %s.\n",
zfcp_get_busid_by_adapter(adapter));
goto failed_req_create; goto failed_req_create;
}
sbale = zfcp_qdio_sbale_req(fsf_req); sbale = zfcp_qdio_sbale_req(fsf_req);
sbale[0].flags |= SBAL_FLAGS0_TYPE_STATUS; sbale[0].flags |= SBAL_FLAGS0_TYPE_STATUS;
...@@ -744,14 +698,9 @@ zfcp_fsf_status_read(struct zfcp_adapter *adapter, int req_flags) ...@@ -744,14 +698,9 @@ zfcp_fsf_status_read(struct zfcp_adapter *adapter, int req_flags)
sbale->length = sizeof(struct fsf_status_read_buffer); sbale->length = sizeof(struct fsf_status_read_buffer);
retval = zfcp_fsf_req_send(fsf_req); retval = zfcp_fsf_req_send(fsf_req);
if (retval) { if (retval)
ZFCP_LOG_DEBUG("error: Could not set-up unsolicited status "
"environment.\n");
goto failed_req_send; goto failed_req_send;
}
ZFCP_LOG_TRACE("Status Read request initiated (adapter%s)\n",
zfcp_get_busid_by_adapter(adapter));
goto out; goto out;
failed_req_send: failed_req_send:
...@@ -783,14 +732,8 @@ zfcp_fsf_status_read_port_closed(struct zfcp_fsf_req *fsf_req) ...@@ -783,14 +732,8 @@ zfcp_fsf_status_read_port_closed(struct zfcp_fsf_req *fsf_req)
break; break;
read_unlock_irqrestore(&zfcp_data.config_lock, flags); read_unlock_irqrestore(&zfcp_data.config_lock, flags);
if (!port || (port->d_id != (status_buffer->d_id & ZFCP_DID_MASK))) { if (!port || (port->d_id != (status_buffer->d_id & ZFCP_DID_MASK)))
ZFCP_LOG_NORMAL("bug: Reopen port indication received for "
"nonexisting port with d_id 0x%06x on "
"adapter %s. Ignored.\n",
status_buffer->d_id & ZFCP_DID_MASK,
zfcp_get_busid_by_adapter(adapter));
goto out; goto out;
}
switch (status_buffer->status_subtype) { switch (status_buffer->status_subtype) {
...@@ -801,20 +744,48 @@ zfcp_fsf_status_read_port_closed(struct zfcp_fsf_req *fsf_req) ...@@ -801,20 +744,48 @@ zfcp_fsf_status_read_port_closed(struct zfcp_fsf_req *fsf_req)
case FSF_STATUS_READ_SUB_ERROR_PORT: case FSF_STATUS_READ_SUB_ERROR_PORT:
zfcp_erp_port_shutdown(port, 0, 122, fsf_req); zfcp_erp_port_shutdown(port, 0, 122, fsf_req);
break; break;
default:
ZFCP_LOG_NORMAL("bug: Undefined status subtype received "
"for a reopen indication on port with "
"d_id 0x%06x on the adapter %s. "
"Ignored. (debug info 0x%x)\n",
status_buffer->d_id,
zfcp_get_busid_by_adapter(adapter),
status_buffer->status_subtype);
} }
out: out:
return 0; return 0;
} }
static void zfcp_fsf_bit_error_threshold(struct zfcp_fsf_req *req)
{
struct zfcp_adapter *adapter = req->adapter;
struct fsf_status_read_buffer *buf =
(struct fsf_status_read_buffer *) req->data;
struct fsf_bit_error_payload *err =
(struct fsf_bit_error_payload *) buf->payload;
dev_warn(&adapter->ccw_device->dev,
"Warning: bit error threshold data "
"received for the adapter: "
"link failures = %i, loss of sync errors = %i, "
"loss of signal errors = %i, "
"primitive sequence errors = %i, "
"invalid transmission word errors = %i, "
"CRC errors = %i).\n",
err->link_failure_error_count,
err->loss_of_sync_error_count,
err->loss_of_signal_error_count,
err->primitive_sequence_error_count,
err->invalid_transmission_word_error_count,
err->crc_error_count);
dev_warn(&adapter->ccw_device->dev,
"Additional bit error threshold data of the adapter: "
"primitive sequence event time-outs = %i, "
"elastic buffer overrun errors = %i, "
"advertised receive buffer-to-buffer credit = %i, "
"current receice buffer-to-buffer credit = %i, "
"advertised transmit buffer-to-buffer credit = %i, "
"current transmit buffer-to-buffer credit = %i).\n",
err->primitive_sequence_event_timeout_count,
err->elastic_buffer_overrun_error_count,
err->advertised_receive_b2b_credit,
err->current_receive_b2b_credit,
err->advertised_transmit_b2b_credit,
err->current_transmit_b2b_credit);
}
/* /*
* function: zfcp_fsf_status_read_handler * function: zfcp_fsf_status_read_handler
* *
...@@ -829,7 +800,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) ...@@ -829,7 +800,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
struct zfcp_adapter *adapter = fsf_req->adapter; struct zfcp_adapter *adapter = fsf_req->adapter;
struct fsf_status_read_buffer *status_buffer = struct fsf_status_read_buffer *status_buffer =
(struct fsf_status_read_buffer *) fsf_req->data; (struct fsf_status_read_buffer *) fsf_req->data;
struct fsf_bit_error_payload *fsf_bit_error;
if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED) { if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED) {
zfcp_hba_dbf_event_fsf_unsol("dism", adapter, status_buffer); zfcp_hba_dbf_event_fsf_unsol("dism", adapter, status_buffer);
...@@ -851,79 +821,45 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) ...@@ -851,79 +821,45 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
break; break;
case FSF_STATUS_READ_SENSE_DATA_AVAIL: case FSF_STATUS_READ_SENSE_DATA_AVAIL:
ZFCP_LOG_INFO("unsolicited sense data received (adapter %s)\n",
zfcp_get_busid_by_adapter(adapter));
break; break;
case FSF_STATUS_READ_BIT_ERROR_THRESHOLD: case FSF_STATUS_READ_BIT_ERROR_THRESHOLD:
fsf_bit_error = (struct fsf_bit_error_payload *) zfcp_fsf_bit_error_threshold(fsf_req);
status_buffer->payload;
ZFCP_LOG_NORMAL("Warning: bit error threshold data "
"received (adapter %s, "
"link failures = %i, loss of sync errors = %i, "
"loss of signal errors = %i, "
"primitive sequence errors = %i, "
"invalid transmission word errors = %i, "
"CRC errors = %i)\n",
zfcp_get_busid_by_adapter(adapter),
fsf_bit_error->link_failure_error_count,
fsf_bit_error->loss_of_sync_error_count,
fsf_bit_error->loss_of_signal_error_count,
fsf_bit_error->primitive_sequence_error_count,
fsf_bit_error->invalid_transmission_word_error_count,
fsf_bit_error->crc_error_count);
ZFCP_LOG_INFO("Additional bit error threshold data "
"(adapter %s, "
"primitive sequence event time-outs = %i, "
"elastic buffer overrun errors = %i, "
"advertised receive buffer-to-buffer credit = %i, "
"current receice buffer-to-buffer credit = %i, "
"advertised transmit buffer-to-buffer credit = %i, "
"current transmit buffer-to-buffer credit = %i)\n",
zfcp_get_busid_by_adapter(adapter),
fsf_bit_error->primitive_sequence_event_timeout_count,
fsf_bit_error->elastic_buffer_overrun_error_count,
fsf_bit_error->advertised_receive_b2b_credit,
fsf_bit_error->current_receive_b2b_credit,
fsf_bit_error->advertised_transmit_b2b_credit,
fsf_bit_error->current_transmit_b2b_credit);
break; break;
case FSF_STATUS_READ_LINK_DOWN: case FSF_STATUS_READ_LINK_DOWN:
switch (status_buffer->status_subtype) { switch (status_buffer->status_subtype) {
case FSF_STATUS_READ_SUB_NO_PHYSICAL_LINK: case FSF_STATUS_READ_SUB_NO_PHYSICAL_LINK:
ZFCP_LOG_INFO("Physical link to adapter %s is down\n", dev_warn(&adapter->ccw_device->dev,
zfcp_get_busid_by_adapter(adapter)); "Physical link is down.\n");
zfcp_fsf_link_down_info_eval(fsf_req, 38, zfcp_fsf_link_down_info_eval(fsf_req, 38,
(struct fsf_link_down_info *) (struct fsf_link_down_info *)
&status_buffer->payload); &status_buffer->payload);
break; break;
case FSF_STATUS_READ_SUB_FDISC_FAILED: case FSF_STATUS_READ_SUB_FDISC_FAILED:
ZFCP_LOG_INFO("Local link to adapter %s is down " dev_warn(&adapter->ccw_device->dev,
"due to failed FDISC login\n", "Local link is down "
zfcp_get_busid_by_adapter(adapter)); "due to failed FDISC login.\n");
zfcp_fsf_link_down_info_eval(fsf_req, 39, zfcp_fsf_link_down_info_eval(fsf_req, 39,
(struct fsf_link_down_info *) (struct fsf_link_down_info *)
&status_buffer->payload); &status_buffer->payload);
break; break;
case FSF_STATUS_READ_SUB_FIRMWARE_UPDATE: case FSF_STATUS_READ_SUB_FIRMWARE_UPDATE:
ZFCP_LOG_INFO("Local link to adapter %s is down " dev_warn(&adapter->ccw_device->dev,
"due to firmware update on adapter\n", "Local link is down "
zfcp_get_busid_by_adapter(adapter)); "due to firmware update on adapter.\n");
zfcp_fsf_link_down_info_eval(fsf_req, 40, NULL); zfcp_fsf_link_down_info_eval(fsf_req, 40, NULL);
break; break;
default: default:
ZFCP_LOG_INFO("Local link to adapter %s is down " dev_warn(&adapter->ccw_device->dev,
"due to unknown reason\n", "Local link is down.\n");
zfcp_get_busid_by_adapter(adapter));
zfcp_fsf_link_down_info_eval(fsf_req, 41, NULL); zfcp_fsf_link_down_info_eval(fsf_req, 41, NULL);
}; };
break; break;
case FSF_STATUS_READ_LINK_UP: case FSF_STATUS_READ_LINK_UP:
ZFCP_LOG_NORMAL("Local link to adapter %s was replugged. " dev_info(&adapter->ccw_device->dev,
"Restarting operations on this adapter\n", "Local link was replugged.\n");
zfcp_get_busid_by_adapter(adapter));
/* All ports should be marked as ready to run again */ /* All ports should be marked as ready to run again */
zfcp_erp_modify_adapter_status(adapter, 30, NULL, zfcp_erp_modify_adapter_status(adapter, 30, NULL,
ZFCP_STATUS_COMMON_RUNNING, ZFCP_STATUS_COMMON_RUNNING,
...@@ -935,81 +871,18 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) ...@@ -935,81 +871,18 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
break; break;
case FSF_STATUS_READ_NOTIFICATION_LOST: case FSF_STATUS_READ_NOTIFICATION_LOST:
ZFCP_LOG_NORMAL("Unsolicited status notification(s) lost: "
"adapter %s%s%s%s%s%s%s%s%s\n",
zfcp_get_busid_by_adapter(adapter),
(status_buffer->status_subtype &
FSF_STATUS_READ_SUB_INCOMING_ELS) ?
", incoming ELS" : "",
(status_buffer->status_subtype &
FSF_STATUS_READ_SUB_SENSE_DATA) ?
", sense data" : "",
(status_buffer->status_subtype &
FSF_STATUS_READ_SUB_LINK_STATUS) ?
", link status change" : "",
(status_buffer->status_subtype &
FSF_STATUS_READ_SUB_PORT_CLOSED) ?
", port close" : "",
(status_buffer->status_subtype &
FSF_STATUS_READ_SUB_BIT_ERROR_THRESHOLD) ?
", bit error exception" : "",
(status_buffer->status_subtype &
FSF_STATUS_READ_SUB_ACT_UPDATED) ?
", ACT update" : "",
(status_buffer->status_subtype &
FSF_STATUS_READ_SUB_ACT_HARDENED) ?
", ACT hardening" : "",
(status_buffer->status_subtype &
FSF_STATUS_READ_SUB_FEATURE_UPDATE_ALERT) ?
", adapter feature change" : "");
if (status_buffer->status_subtype & if (status_buffer->status_subtype &
FSF_STATUS_READ_SUB_ACT_UPDATED) FSF_STATUS_READ_SUB_ACT_UPDATED)
zfcp_erp_adapter_access_changed(adapter, 135, fsf_req); zfcp_erp_adapter_access_changed(adapter, 135, fsf_req);
break; break;
case FSF_STATUS_READ_CFDC_UPDATED: case FSF_STATUS_READ_CFDC_UPDATED:
ZFCP_LOG_NORMAL("CFDC has been updated on the adapter %s\n",
zfcp_get_busid_by_adapter(adapter));
zfcp_erp_adapter_access_changed(adapter, 136, fsf_req); zfcp_erp_adapter_access_changed(adapter, 136, fsf_req);
break; break;
case FSF_STATUS_READ_CFDC_HARDENED:
switch (status_buffer->status_subtype) {
case FSF_STATUS_READ_SUB_CFDC_HARDENED_ON_SE:
ZFCP_LOG_NORMAL("CFDC of adapter %s saved on SE\n",
zfcp_get_busid_by_adapter(adapter));
break;
case FSF_STATUS_READ_SUB_CFDC_HARDENED_ON_SE2:
ZFCP_LOG_NORMAL("CFDC of adapter %s has been copied "
"to the secondary SE\n",
zfcp_get_busid_by_adapter(adapter));
break;
default:
ZFCP_LOG_NORMAL("CFDC of adapter %s has been hardened\n",
zfcp_get_busid_by_adapter(adapter));
}
break;
case FSF_STATUS_READ_FEATURE_UPDATE_ALERT: case FSF_STATUS_READ_FEATURE_UPDATE_ALERT:
ZFCP_LOG_INFO("List of supported features on adapter %s has "
"been changed from 0x%08X to 0x%08X\n",
zfcp_get_busid_by_adapter(adapter),
*(u32*) (status_buffer->payload + 4),
*(u32*) (status_buffer->payload));
adapter->adapter_features = *(u32*) status_buffer->payload; adapter->adapter_features = *(u32*) status_buffer->payload;
break; break;
default:
ZFCP_LOG_NORMAL("warning: An unsolicited status packet of unknown "
"type was received (debug info 0x%x)\n",
status_buffer->status_type);
ZFCP_LOG_DEBUG("Dump of status_read_buffer %p:\n",
status_buffer);
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
(char *) status_buffer,
sizeof (struct fsf_status_read_buffer));
break;
} }
mempool_free(status_buffer, adapter->pool.data_status_read); mempool_free(status_buffer, adapter->pool.data_status_read);
zfcp_fsf_req_free(fsf_req); zfcp_fsf_req_free(fsf_req);
...@@ -1060,15 +933,8 @@ zfcp_fsf_abort_fcp_command(unsigned long old_req_id, ...@@ -1060,15 +933,8 @@ zfcp_fsf_abort_fcp_command(unsigned long old_req_id,
retval = zfcp_fsf_req_create(adapter, FSF_QTCB_ABORT_FCP_CMND, retval = zfcp_fsf_req_create(adapter, FSF_QTCB_ABORT_FCP_CMND,
req_flags, adapter->pool.fsf_req_abort, req_flags, adapter->pool.fsf_req_abort,
&lock_flags, &fsf_req); &lock_flags, &fsf_req);
if (retval < 0) { if (retval < 0)
ZFCP_LOG_INFO("error: Failed to create an abort command "
"request for lun 0x%016Lx on port 0x%016Lx "
"on adapter %s.\n",
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_adapter(adapter));
goto out; goto out;
}
if (unlikely(!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, if (unlikely(!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED,
&unit->status))) &unit->status)))
...@@ -1134,17 +1000,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) ...@@ -1134,17 +1000,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
* fine. * fine.
*/ */
} else { } else {
ZFCP_LOG_INFO("Temporary port identifier 0x%x for "
"port 0x%016Lx on adapter %s invalid. "
"This may happen occasionally.\n",
unit->port->handle,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
ZFCP_LOG_INFO("status qualifier:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_INFO,
(char *) &new_fsf_req->qtcb->header.
fsf_status_qual,
sizeof (union fsf_status_qual));
/* Let's hope this sorts out the mess */ /* Let's hope this sorts out the mess */
zfcp_erp_adapter_reopen(unit->port->adapter, 0, 104, zfcp_erp_adapter_reopen(unit->port->adapter, 0, 104,
new_fsf_req); new_fsf_req);
...@@ -1160,20 +1015,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) ...@@ -1160,20 +1015,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
* This is fine. * This is fine.
*/ */
} else { } else {
ZFCP_LOG_INFO
("Warning: Temporary LUN identifier 0x%x of LUN "
"0x%016Lx on port 0x%016Lx on adapter %s is "
"invalid. This may happen in rare cases. "
"Trying to re-establish link.\n",
unit->handle,
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
ZFCP_LOG_DEBUG("Status qualifier data:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
(char *) &new_fsf_req->qtcb->header.
fsf_status_qual,
sizeof (union fsf_status_qual));
/* Let's hope this sorts out the mess */ /* Let's hope this sorts out the mess */
zfcp_erp_port_reopen(unit->port, 0, 105, new_fsf_req); zfcp_erp_port_reopen(unit->port, 0, 105, new_fsf_req);
new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
...@@ -1186,20 +1027,12 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) ...@@ -1186,20 +1027,12 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
break; break;
case FSF_PORT_BOXED: case FSF_PORT_BOXED:
ZFCP_LOG_INFO("Remote port 0x%016Lx on adapter %s needs to "
"be reopened\n", unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
zfcp_erp_port_boxed(unit->port, 47, new_fsf_req); zfcp_erp_port_boxed(unit->port, 47, new_fsf_req);
new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR
| ZFCP_STATUS_FSFREQ_RETRY; | ZFCP_STATUS_FSFREQ_RETRY;
break; break;
case FSF_LUN_BOXED: case FSF_LUN_BOXED:
ZFCP_LOG_INFO(
"unit 0x%016Lx on port 0x%016Lx on adapter %s needs "
"to be reopened\n",
unit->fcp_lun, unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
zfcp_erp_unit_boxed(unit, 48, new_fsf_req); zfcp_erp_unit_boxed(unit, 48, new_fsf_req);
new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR
| ZFCP_STATUS_FSFREQ_RETRY; | ZFCP_STATUS_FSFREQ_RETRY;
...@@ -1215,11 +1048,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) ...@@ -1215,11 +1048,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
/* SCSI stack will escalate */ /* SCSI stack will escalate */
new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
default:
ZFCP_LOG_NORMAL
("bug: Wrong status qualifier 0x%x arrived.\n",
new_fsf_req->qtcb->header.fsf_status_qual.word[0]);
break;
} }
break; break;
...@@ -1227,12 +1055,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) ...@@ -1227,12 +1055,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
retval = 0; retval = 0;
new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED; new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED;
break; break;
default:
ZFCP_LOG_NORMAL("bug: An unknown FSF Status was presented "
"(debug info 0x%x)\n",
new_fsf_req->qtcb->header.fsf_status);
break;
} }
skip_fsfstatus: skip_fsfstatus:
return retval; return retval;
...@@ -1287,12 +1109,8 @@ zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool, ...@@ -1287,12 +1109,8 @@ zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool,
ret = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_GENERIC, ret = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_GENERIC,
ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP, ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP,
pool, &lock_flags, &fsf_req); pool, &lock_flags, &fsf_req);
if (ret < 0) { if (ret < 0)
ZFCP_LOG_INFO("error: Could not create CT request (FC-GS) for "
"adapter: %s\n",
zfcp_get_busid_by_adapter(adapter));
goto failed_req; goto failed_req;
}
sbale = zfcp_qdio_sbale_req(fsf_req); sbale = zfcp_qdio_sbale_req(fsf_req);
if (zfcp_use_one_sbal(ct->req, ct->req_count, if (zfcp_use_one_sbal(ct->req, ct->req_count,
...@@ -1313,9 +1131,6 @@ zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool, ...@@ -1313,9 +1131,6 @@ zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool,
ct->req, ct->req,
ZFCP_MAX_SBALS_PER_CT_REQ); ZFCP_MAX_SBALS_PER_CT_REQ);
if (bytes <= 0) { if (bytes <= 0) {
ZFCP_LOG_INFO("error: creation of CT request failed "
"on adapter %s\n",
zfcp_get_busid_by_adapter(adapter));
if (bytes == 0) if (bytes == 0)
ret = -ENOMEM; ret = -ENOMEM;
else else
...@@ -1330,9 +1145,6 @@ zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool, ...@@ -1330,9 +1145,6 @@ zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool,
ct->resp, ct->resp,
ZFCP_MAX_SBALS_PER_CT_REQ); ZFCP_MAX_SBALS_PER_CT_REQ);
if (bytes <= 0) { if (bytes <= 0) {
ZFCP_LOG_INFO("error: creation of CT request failed "
"on adapter %s\n",
zfcp_get_busid_by_adapter(adapter));
if (bytes == 0) if (bytes == 0)
ret = -ENOMEM; ret = -ENOMEM;
else else
...@@ -1343,10 +1155,6 @@ zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool, ...@@ -1343,10 +1155,6 @@ zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool,
fsf_req->qtcb->bottom.support.resp_buf_length = bytes; fsf_req->qtcb->bottom.support.resp_buf_length = bytes;
} else { } else {
/* reject send generic request */ /* reject send generic request */
ZFCP_LOG_INFO(
"error: microcode does not support chained SBALs,"
"CT request too big (adapter %s)\n",
zfcp_get_busid_by_adapter(adapter));
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
goto failed_send; goto failed_send;
} }
...@@ -1368,15 +1176,9 @@ zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool, ...@@ -1368,15 +1176,9 @@ zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool,
zfcp_fsf_start_timer(fsf_req, ZFCP_FSF_REQUEST_TIMEOUT); zfcp_fsf_start_timer(fsf_req, ZFCP_FSF_REQUEST_TIMEOUT);
ret = zfcp_fsf_req_send(fsf_req); ret = zfcp_fsf_req_send(fsf_req);
if (ret) { if (ret)
ZFCP_LOG_DEBUG("error: initiation of CT request failed "
"(adapter %s, port 0x%016Lx)\n",
zfcp_get_busid_by_adapter(adapter), port->wwpn);
goto failed_send; goto failed_send;
}
ZFCP_LOG_DEBUG("CT request initiated (adapter %s, port 0x%016Lx)\n",
zfcp_get_busid_by_adapter(adapter), port->wwpn);
goto out; goto out;
failed_send: failed_send:
...@@ -1408,7 +1210,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) ...@@ -1408,7 +1210,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
struct fsf_qtcb_header *header; struct fsf_qtcb_header *header;
struct fsf_qtcb_bottom_support *bottom; struct fsf_qtcb_bottom_support *bottom;
int retval = -EINVAL; int retval = -EINVAL;
u16 subtable, rule, counter;
adapter = fsf_req->adapter; adapter = fsf_req->adapter;
send_ct = (struct zfcp_send_ct *) fsf_req->data; send_ct = (struct zfcp_send_ct *) fsf_req->data;
...@@ -1428,13 +1229,7 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) ...@@ -1428,13 +1229,7 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
break; break;
case FSF_SERVICE_CLASS_NOT_SUPPORTED: case FSF_SERVICE_CLASS_NOT_SUPPORTED:
ZFCP_LOG_INFO("error: adapter %s does not support fc " zfcp_fsf_class_not_supp(fsf_req);
"class %d.\n",
zfcp_get_busid_by_port(port),
ZFCP_FC_SERVICE_CLASS_DEFAULT);
/* stop operation for this adapter */
zfcp_erp_adapter_shutdown(adapter, 0, 123, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_ADAPTER_STATUS_AVAILABLE: case FSF_ADAPTER_STATUS_AVAILABLE:
...@@ -1448,63 +1243,23 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) ...@@ -1448,63 +1243,23 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
/* ERP strategy will escalate */ /* ERP strategy will escalate */
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
default:
ZFCP_LOG_INFO("bug: Wrong status qualifier 0x%x "
"arrived.\n",
header->fsf_status_qual.word[0]);
break;
} }
break; break;
case FSF_ACCESS_DENIED: case FSF_ACCESS_DENIED:
ZFCP_LOG_NORMAL("access denied, cannot send generic service " zfcp_fsf_access_denied_port(fsf_req, port);
"command (adapter %s, port d_id=0x%06x)\n",
zfcp_get_busid_by_port(port), port->d_id);
for (counter = 0; counter < 2; counter++) {
subtable = header->fsf_status_qual.halfword[counter * 2];
rule = header->fsf_status_qual.halfword[counter * 2 + 1];
switch (subtable) {
case FSF_SQ_CFDC_SUBTABLE_OS:
case FSF_SQ_CFDC_SUBTABLE_PORT_WWPN:
case FSF_SQ_CFDC_SUBTABLE_PORT_DID:
case FSF_SQ_CFDC_SUBTABLE_LUN:
ZFCP_LOG_INFO("Access denied (%s rule %d)\n",
zfcp_act_subtable_type[subtable], rule);
break;
}
}
zfcp_erp_port_access_denied(port, 55, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_GENERIC_COMMAND_REJECTED: case FSF_GENERIC_COMMAND_REJECTED:
ZFCP_LOG_INFO("generic service command rejected "
"(adapter %s, port d_id=0x%06x)\n",
zfcp_get_busid_by_port(port), port->d_id);
ZFCP_LOG_INFO("status qualifier:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_INFO,
(char *) &header->fsf_status_qual,
sizeof (union fsf_status_qual));
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_PORT_HANDLE_NOT_VALID: case FSF_PORT_HANDLE_NOT_VALID:
ZFCP_LOG_DEBUG("Temporary port identifier 0x%x for port "
"0x%016Lx on adapter %s invalid. This may "
"happen occasionally.\n", port->handle,
port->wwpn, zfcp_get_busid_by_port(port));
ZFCP_LOG_INFO("status qualifier:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_INFO,
(char *) &header->fsf_status_qual,
sizeof (union fsf_status_qual));
zfcp_erp_adapter_reopen(adapter, 0, 106, fsf_req); zfcp_erp_adapter_reopen(adapter, 0, 106, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_PORT_BOXED: case FSF_PORT_BOXED:
ZFCP_LOG_INFO("port needs to be reopened "
"(adapter %s, port d_id=0x%06x)\n",
zfcp_get_busid_by_port(port), port->d_id);
zfcp_erp_port_boxed(port, 49, fsf_req); zfcp_erp_port_boxed(port, 49, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR
| ZFCP_STATUS_FSFREQ_RETRY; | ZFCP_STATUS_FSFREQ_RETRY;
...@@ -1513,37 +1268,13 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) ...@@ -1513,37 +1268,13 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
/* following states should never occure, all cases avoided /* following states should never occure, all cases avoided
in zfcp_fsf_send_ct - but who knows ... */ in zfcp_fsf_send_ct - but who knows ... */
case FSF_PAYLOAD_SIZE_MISMATCH: case FSF_PAYLOAD_SIZE_MISMATCH:
ZFCP_LOG_INFO("payload size mismatch (adapter: %s, "
"req_buf_length=%d, resp_buf_length=%d)\n",
zfcp_get_busid_by_adapter(adapter),
bottom->req_buf_length, bottom->resp_buf_length);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break;
case FSF_REQUEST_SIZE_TOO_LARGE: case FSF_REQUEST_SIZE_TOO_LARGE:
ZFCP_LOG_INFO("request size too large (adapter: %s, "
"req_buf_length=%d)\n",
zfcp_get_busid_by_adapter(adapter),
bottom->req_buf_length);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break;
case FSF_RESPONSE_SIZE_TOO_LARGE: case FSF_RESPONSE_SIZE_TOO_LARGE:
ZFCP_LOG_INFO("response size too large (adapter: %s, "
"resp_buf_length=%d)\n",
zfcp_get_busid_by_adapter(adapter),
bottom->resp_buf_length);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break;
case FSF_SBAL_MISMATCH: case FSF_SBAL_MISMATCH:
ZFCP_LOG_INFO("SBAL mismatch (adapter: %s, req_buf_length=%d, "
"resp_buf_length=%d)\n",
zfcp_get_busid_by_adapter(adapter),
bottom->req_buf_length, bottom->resp_buf_length);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
default: default:
ZFCP_LOG_NORMAL("bug: An unknown FSF Status was presented "
"(debug info 0x%x)\n", header->fsf_status);
break; break;
} }
...@@ -1578,12 +1309,8 @@ zfcp_fsf_send_els(struct zfcp_send_els *els) ...@@ -1578,12 +1309,8 @@ zfcp_fsf_send_els(struct zfcp_send_els *els)
ret = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_ELS, ret = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_ELS,
ZFCP_REQ_AUTO_CLEANUP, ZFCP_REQ_AUTO_CLEANUP,
NULL, &lock_flags, &fsf_req); NULL, &lock_flags, &fsf_req);
if (ret < 0) { if (ret < 0)
ZFCP_LOG_INFO("error: creation of ELS request failed "
"(adapter %s, port d_id: 0x%06x)\n",
zfcp_get_busid_by_adapter(adapter), d_id);
goto failed_req; goto failed_req;
}
if (unlikely(!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, if (unlikely(!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED,
&els->port->status))) { &els->port->status))) {
...@@ -1610,9 +1337,6 @@ zfcp_fsf_send_els(struct zfcp_send_els *els) ...@@ -1610,9 +1337,6 @@ zfcp_fsf_send_els(struct zfcp_send_els *els)
els->req, els->req,
ZFCP_MAX_SBALS_PER_ELS_REQ); ZFCP_MAX_SBALS_PER_ELS_REQ);
if (bytes <= 0) { if (bytes <= 0) {
ZFCP_LOG_INFO("error: creation of ELS request failed "
"(adapter %s, port d_id: 0x%06x)\n",
zfcp_get_busid_by_adapter(adapter), d_id);
if (bytes == 0) { if (bytes == 0) {
ret = -ENOMEM; ret = -ENOMEM;
} else { } else {
...@@ -1627,9 +1351,6 @@ zfcp_fsf_send_els(struct zfcp_send_els *els) ...@@ -1627,9 +1351,6 @@ zfcp_fsf_send_els(struct zfcp_send_els *els)
els->resp, els->resp,
ZFCP_MAX_SBALS_PER_ELS_REQ); ZFCP_MAX_SBALS_PER_ELS_REQ);
if (bytes <= 0) { if (bytes <= 0) {
ZFCP_LOG_INFO("error: creation of ELS request failed "
"(adapter %s, port d_id: 0x%06x)\n",
zfcp_get_busid_by_adapter(adapter), d_id);
if (bytes == 0) { if (bytes == 0) {
ret = -ENOMEM; ret = -ENOMEM;
} else { } else {
...@@ -1640,10 +1361,6 @@ zfcp_fsf_send_els(struct zfcp_send_els *els) ...@@ -1640,10 +1361,6 @@ zfcp_fsf_send_els(struct zfcp_send_els *els)
fsf_req->qtcb->bottom.support.resp_buf_length = bytes; fsf_req->qtcb->bottom.support.resp_buf_length = bytes;
} else { } else {
/* reject request */ /* reject request */
ZFCP_LOG_INFO("error: microcode does not support chained SBALs"
", ELS request too big (adapter %s, "
"port d_id: 0x%06x)\n",
zfcp_get_busid_by_adapter(adapter), d_id);
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
goto failed_send; goto failed_send;
} }
...@@ -1661,15 +1378,9 @@ zfcp_fsf_send_els(struct zfcp_send_els *els) ...@@ -1661,15 +1378,9 @@ zfcp_fsf_send_els(struct zfcp_send_els *els)
zfcp_fsf_start_timer(fsf_req, ZFCP_FSF_REQUEST_TIMEOUT); zfcp_fsf_start_timer(fsf_req, ZFCP_FSF_REQUEST_TIMEOUT);
ret = zfcp_fsf_req_send(fsf_req); ret = zfcp_fsf_req_send(fsf_req);
if (ret) { if (ret)
ZFCP_LOG_DEBUG("error: initiation of ELS request failed "
"(adapter %s, port d_id: 0x%06x)\n",
zfcp_get_busid_by_adapter(adapter), d_id);
goto failed_send; goto failed_send;
}
ZFCP_LOG_DEBUG("ELS request initiated (adapter %s, port d_id: "
"0x%06x)\n", zfcp_get_busid_by_adapter(adapter), d_id);
goto out; goto out;
port_blocked: port_blocked:
...@@ -1701,7 +1412,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) ...@@ -1701,7 +1412,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
struct fsf_qtcb_bottom_support *bottom; struct fsf_qtcb_bottom_support *bottom;
struct zfcp_send_els *send_els; struct zfcp_send_els *send_els;
int retval = -EINVAL; int retval = -EINVAL;
u16 subtable, rule, counter;
send_els = (struct zfcp_send_els *) fsf_req->data; send_els = (struct zfcp_send_els *) fsf_req->data;
adapter = send_els->adapter; adapter = send_els->adapter;
...@@ -1721,13 +1431,7 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) ...@@ -1721,13 +1431,7 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
break; break;
case FSF_SERVICE_CLASS_NOT_SUPPORTED: case FSF_SERVICE_CLASS_NOT_SUPPORTED:
ZFCP_LOG_INFO("error: adapter %s does not support fc " zfcp_fsf_class_not_supp(fsf_req);
"class %d.\n",
zfcp_get_busid_by_adapter(adapter),
ZFCP_FC_SERVICE_CLASS_DEFAULT);
/* stop operation for this adapter */
zfcp_erp_adapter_shutdown(adapter, 0, 124, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_ADAPTER_STATUS_AVAILABLE: case FSF_ADAPTER_STATUS_AVAILABLE:
...@@ -1743,91 +1447,25 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) ...@@ -1743,91 +1447,25 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
case FSF_SQ_RETRY_IF_POSSIBLE: case FSF_SQ_RETRY_IF_POSSIBLE:
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
default:
ZFCP_LOG_INFO("bug: Wrong status qualifier 0x%x\n",
header->fsf_status_qual.word[0]);
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_INFO,
(char*)header->fsf_status_qual.word, 16);
} }
break; break;
case FSF_ELS_COMMAND_REJECTED: case FSF_ELS_COMMAND_REJECTED:
ZFCP_LOG_INFO("ELS has been rejected because command filter "
"prohibited sending "
"(adapter: %s, port d_id: 0x%06x)\n",
zfcp_get_busid_by_adapter(adapter), d_id);
break;
case FSF_PAYLOAD_SIZE_MISMATCH: case FSF_PAYLOAD_SIZE_MISMATCH:
ZFCP_LOG_INFO(
"ELS request size and ELS response size must be either "
"both 0, or both greater than 0 "
"(adapter: %s, req_buf_length=%d resp_buf_length=%d)\n",
zfcp_get_busid_by_adapter(adapter),
bottom->req_buf_length,
bottom->resp_buf_length);
break;
case FSF_REQUEST_SIZE_TOO_LARGE: case FSF_REQUEST_SIZE_TOO_LARGE:
ZFCP_LOG_INFO(
"Length of the ELS request buffer, "
"specified in QTCB bottom, "
"exceeds the size of the buffers "
"that have been allocated for ELS request data "
"(adapter: %s, req_buf_length=%d)\n",
zfcp_get_busid_by_adapter(adapter),
bottom->req_buf_length);
break;
case FSF_RESPONSE_SIZE_TOO_LARGE: case FSF_RESPONSE_SIZE_TOO_LARGE:
ZFCP_LOG_INFO(
"Length of the ELS response buffer, "
"specified in QTCB bottom, "
"exceeds the size of the buffers "
"that have been allocated for ELS response data "
"(adapter: %s, resp_buf_length=%d)\n",
zfcp_get_busid_by_adapter(adapter),
bottom->resp_buf_length);
break; break;
case FSF_SBAL_MISMATCH: case FSF_SBAL_MISMATCH:
/* should never occure, avoided in zfcp_fsf_send_els */ /* should never occure, avoided in zfcp_fsf_send_els */
ZFCP_LOG_INFO("SBAL mismatch (adapter: %s, req_buf_length=%d, "
"resp_buf_length=%d)\n",
zfcp_get_busid_by_adapter(adapter),
bottom->req_buf_length, bottom->resp_buf_length);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_ACCESS_DENIED: case FSF_ACCESS_DENIED:
ZFCP_LOG_NORMAL("access denied, cannot send ELS command " zfcp_fsf_access_denied_port(fsf_req, port);
"(adapter %s, port d_id=0x%06x)\n",
zfcp_get_busid_by_adapter(adapter), d_id);
for (counter = 0; counter < 2; counter++) {
subtable = header->fsf_status_qual.halfword[counter * 2];
rule = header->fsf_status_qual.halfword[counter * 2 + 1];
switch (subtable) {
case FSF_SQ_CFDC_SUBTABLE_OS:
case FSF_SQ_CFDC_SUBTABLE_PORT_WWPN:
case FSF_SQ_CFDC_SUBTABLE_PORT_DID:
case FSF_SQ_CFDC_SUBTABLE_LUN:
ZFCP_LOG_INFO("Access denied (%s rule %d)\n",
zfcp_act_subtable_type[subtable], rule);
break;
}
}
if (port != NULL)
zfcp_erp_port_access_denied(port, 56, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
default: default:
ZFCP_LOG_NORMAL(
"bug: An unknown FSF Status was presented "
"(adapter: %s, fsf_status=0x%08x)\n",
zfcp_get_busid_by_adapter(adapter),
header->fsf_status);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
} }
...@@ -1857,9 +1495,6 @@ zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action) ...@@ -1857,9 +1495,6 @@ zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action)
adapter->pool.fsf_req_erp, adapter->pool.fsf_req_erp,
&lock_flags, &fsf_req); &lock_flags, &fsf_req);
if (retval) { if (retval) {
ZFCP_LOG_INFO("error: Could not create exchange configuration "
"data request for adapter %s.\n",
zfcp_get_busid_by_adapter(adapter));
write_unlock_irqrestore(&adapter->req_q.lock, lock_flags); write_unlock_irqrestore(&adapter->req_q.lock, lock_flags);
return retval; return retval;
} }
...@@ -1880,16 +1515,9 @@ zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action) ...@@ -1880,16 +1515,9 @@ zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action)
retval = zfcp_fsf_req_send(fsf_req); retval = zfcp_fsf_req_send(fsf_req);
write_unlock_irqrestore(&adapter->req_q.lock, lock_flags); write_unlock_irqrestore(&adapter->req_q.lock, lock_flags);
if (retval) { if (retval) {
ZFCP_LOG_INFO("error: Could not send exchange configuration "
"data command on the adapter %s\n",
zfcp_get_busid_by_adapter(adapter));
zfcp_fsf_req_free(fsf_req); zfcp_fsf_req_free(fsf_req);
erp_action->fsf_req = NULL; erp_action->fsf_req = NULL;
} }
else
ZFCP_LOG_DEBUG("exchange configuration data request initiated "
"(adapter %s)\n",
zfcp_get_busid_by_adapter(adapter));
return retval; return retval;
} }
...@@ -1908,9 +1536,6 @@ zfcp_fsf_exchange_config_data_sync(struct zfcp_adapter *adapter, ...@@ -1908,9 +1536,6 @@ zfcp_fsf_exchange_config_data_sync(struct zfcp_adapter *adapter,
ZFCP_WAIT_FOR_SBAL, NULL, &lock_flags, ZFCP_WAIT_FOR_SBAL, NULL, &lock_flags,
&fsf_req); &fsf_req);
if (retval) { if (retval) {
ZFCP_LOG_INFO("error: Could not create exchange configuration "
"data request for adapter %s.\n",
zfcp_get_busid_by_adapter(adapter));
write_unlock_irqrestore(&adapter->req_q.lock, lock_flags); write_unlock_irqrestore(&adapter->req_q.lock, lock_flags);
return retval; return retval;
} }
...@@ -1931,11 +1556,7 @@ zfcp_fsf_exchange_config_data_sync(struct zfcp_adapter *adapter, ...@@ -1931,11 +1556,7 @@ zfcp_fsf_exchange_config_data_sync(struct zfcp_adapter *adapter,
zfcp_fsf_start_timer(fsf_req, ZFCP_FSF_REQUEST_TIMEOUT); zfcp_fsf_start_timer(fsf_req, ZFCP_FSF_REQUEST_TIMEOUT);
retval = zfcp_fsf_req_send(fsf_req); retval = zfcp_fsf_req_send(fsf_req);
write_unlock_irqrestore(&adapter->req_q.lock, lock_flags); write_unlock_irqrestore(&adapter->req_q.lock, lock_flags);
if (retval) if (!retval)
ZFCP_LOG_INFO("error: Could not send exchange configuration "
"data command on the adapter %s\n",
zfcp_get_busid_by_adapter(adapter));
else
wait_event(fsf_req->completion_wq, wait_event(fsf_req->completion_wq,
fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED);
...@@ -1959,8 +1580,6 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok) ...@@ -1959,8 +1580,6 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok)
struct Scsi_Host *shost = adapter->scsi_host; struct Scsi_Host *shost = adapter->scsi_host;
bottom = &fsf_req->qtcb->bottom.config; bottom = &fsf_req->qtcb->bottom.config;
ZFCP_LOG_DEBUG("low/high QTCB version 0x%x/0x%x of FSF\n",
bottom->low_qtcb_version, bottom->high_qtcb_version);
adapter->fsf_lic_version = bottom->lic_version; adapter->fsf_lic_version = bottom->lic_version;
adapter->adapter_features = bottom->adapter_features; adapter->adapter_features = bottom->adapter_features;
adapter->connection_features = bottom->connection_features; adapter->connection_features = bottom->connection_features;
...@@ -2013,36 +1632,17 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok) ...@@ -2013,36 +1632,17 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok)
min(FC_SERIAL_NUMBER_SIZE, 17)); min(FC_SERIAL_NUMBER_SIZE, 17));
} }
if (fsf_req->erp_action)
ZFCP_LOG_NORMAL("The adapter %s reported the following "
"characteristics:\n"
"WWNN 0x%016Lx, WWPN 0x%016Lx, "
"S_ID 0x%06x,\n"
"adapter version 0x%x, "
"LIC version 0x%x, "
"FC link speed %d Gb/s\n",
zfcp_get_busid_by_adapter(adapter),
(wwn_t) fc_host_node_name(shost),
(wwn_t) fc_host_port_name(shost),
fc_host_port_id(shost),
adapter->hydra_version,
adapter->fsf_lic_version,
fc_host_speed(shost));
if (ZFCP_QTCB_VERSION < bottom->low_qtcb_version) { if (ZFCP_QTCB_VERSION < bottom->low_qtcb_version) {
ZFCP_LOG_NORMAL("error: the adapter %s " dev_err(&adapter->ccw_device->dev,
"only supports newer control block " "The adapter only supports newer control block "
"versions in comparison to this device " "versions, try updated device driver.\n");
"driver (try updated device driver)\n",
zfcp_get_busid_by_adapter(adapter));
zfcp_erp_adapter_shutdown(adapter, 0, 125, fsf_req); zfcp_erp_adapter_shutdown(adapter, 0, 125, fsf_req);
return -EIO; return -EIO;
} }
if (ZFCP_QTCB_VERSION > bottom->high_qtcb_version) { if (ZFCP_QTCB_VERSION > bottom->high_qtcb_version) {
ZFCP_LOG_NORMAL("error: the adapter %s " dev_err(&adapter->ccw_device->dev,
"only supports older control block " "The adapter only supports older control block "
"versions than this device driver uses" "versions, consider a microcode upgrade.\n");
"(consider a microcode upgrade)\n",
zfcp_get_busid_by_adapter(adapter));
zfcp_erp_adapter_shutdown(adapter, 0, 126, fsf_req); zfcp_erp_adapter_shutdown(adapter, 0, 126, fsf_req);
return -EIO; return -EIO;
} }
...@@ -2074,50 +1674,38 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2074,50 +1674,38 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req)
switch (fc_host_port_type(adapter->scsi_host)) { switch (fc_host_port_type(adapter->scsi_host)) {
case FC_PORTTYPE_PTP: case FC_PORTTYPE_PTP:
ZFCP_LOG_NORMAL("Point-to-Point fibrechannel " if (fsf_req->erp_action)
"configuration detected at adapter %s\n" dev_info(&adapter->ccw_device->dev,
"Peer WWNN 0x%016llx, " "Point-to-Point fibrechannel "
"peer WWPN 0x%016llx, " "configuration detected.\n");
"peer d_id 0x%06x\n",
zfcp_get_busid_by_adapter(adapter),
adapter->peer_wwnn,
adapter->peer_wwpn,
adapter->peer_d_id);
break; break;
case FC_PORTTYPE_NLPORT: case FC_PORTTYPE_NLPORT:
ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel " dev_err(&adapter->ccw_device->dev,
"topology detected at adapter %s " "Unsupported arbitrated loop fibrechannel "
"unsupported, shutting down adapter\n", "topology detected, shutting down adapter\n");
zfcp_get_busid_by_adapter(adapter));
zfcp_erp_adapter_shutdown(adapter, 0, 127, fsf_req); zfcp_erp_adapter_shutdown(adapter, 0, 127, fsf_req);
return -EIO; return -EIO;
case FC_PORTTYPE_NPORT: case FC_PORTTYPE_NPORT:
if (fsf_req->erp_action) if (fsf_req->erp_action)
ZFCP_LOG_NORMAL("Switched fabric fibrechannel " dev_info(&adapter->ccw_device->dev,
"network detected at adapter " "Switched fabric fibrechannel "
"%s.\n", "network detected.\n");
zfcp_get_busid_by_adapter(adapter));
break; break;
default: default:
ZFCP_LOG_NORMAL("bug: The fibrechannel topology " dev_err(&adapter->ccw_device->dev,
"reported by the exchange " "The fibrechannel topology reported by the "
"configuration command for " "adapter is not known by the zfcp driver, "
"the adapter %s is not " "shutting down adapter.\n");
"of a type known to the zfcp "
"driver, shutting down adapter\n",
zfcp_get_busid_by_adapter(adapter));
zfcp_erp_adapter_shutdown(adapter, 0, 128, fsf_req); zfcp_erp_adapter_shutdown(adapter, 0, 128, fsf_req);
return -EIO; return -EIO;
} }
bottom = &qtcb->bottom.config; bottom = &qtcb->bottom.config;
if (bottom->max_qtcb_size < sizeof(struct fsf_qtcb)) { if (bottom->max_qtcb_size < sizeof(struct fsf_qtcb)) {
ZFCP_LOG_NORMAL("bug: Maximum QTCB size (%d bytes) " dev_err(&adapter->ccw_device->dev,
"allowed by the adapter %s " "Maximum QTCB size (%d bytes) allowed by "
"is lower than the minimum " "the adapter is lower than the minimum "
"required by the driver (%ld bytes).\n", "required by the driver (%ld bytes).\n",
bottom->max_qtcb_size, bottom->max_qtcb_size, sizeof(struct fsf_qtcb));
zfcp_get_busid_by_adapter(adapter),
sizeof(struct fsf_qtcb));
zfcp_erp_adapter_shutdown(adapter, 0, 129, fsf_req); zfcp_erp_adapter_shutdown(adapter, 0, 129, fsf_req);
return -EIO; return -EIO;
} }
...@@ -2154,12 +1742,8 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action) ...@@ -2154,12 +1742,8 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action)
unsigned long lock_flags; unsigned long lock_flags;
int retval; int retval;
if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT)) { if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT))
ZFCP_LOG_INFO("error: exchange port data "
"command not supported by adapter %s\n",
zfcp_get_busid_by_adapter(adapter));
return -EOPNOTSUPP; return -EOPNOTSUPP;
}
/* setup new FSF request */ /* setup new FSF request */
retval = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, retval = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA,
...@@ -2167,10 +1751,6 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action) ...@@ -2167,10 +1751,6 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action)
adapter->pool.fsf_req_erp, adapter->pool.fsf_req_erp,
&lock_flags, &fsf_req); &lock_flags, &fsf_req);
if (retval) { if (retval) {
ZFCP_LOG_INFO("error: Out of resources. Could not create an "
"exchange port data request for "
"the adapter %s.\n",
zfcp_get_busid_by_adapter(adapter));
write_unlock_irqrestore(&adapter->req_q.lock, lock_flags); write_unlock_irqrestore(&adapter->req_q.lock, lock_flags);
return retval; return retval;
} }
...@@ -2187,16 +1767,9 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action) ...@@ -2187,16 +1767,9 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action)
write_unlock_irqrestore(&adapter->req_q.lock, lock_flags); write_unlock_irqrestore(&adapter->req_q.lock, lock_flags);
if (retval) { if (retval) {
ZFCP_LOG_INFO("error: Could not send an exchange port data "
"command on the adapter %s\n",
zfcp_get_busid_by_adapter(adapter));
zfcp_fsf_req_free(fsf_req); zfcp_fsf_req_free(fsf_req);
erp_action->fsf_req = NULL; erp_action->fsf_req = NULL;
} }
else
ZFCP_LOG_DEBUG("exchange port data request initiated "
"(adapter %s)\n",
zfcp_get_busid_by_adapter(adapter));
return retval; return retval;
} }
...@@ -2214,21 +1787,13 @@ zfcp_fsf_exchange_port_data_sync(struct zfcp_adapter *adapter, ...@@ -2214,21 +1787,13 @@ zfcp_fsf_exchange_port_data_sync(struct zfcp_adapter *adapter,
unsigned long lock_flags; unsigned long lock_flags;
int retval; int retval;
if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT)) { if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT))
ZFCP_LOG_INFO("error: exchange port data "
"command not supported by adapter %s\n",
zfcp_get_busid_by_adapter(adapter));
return -EOPNOTSUPP; return -EOPNOTSUPP;
}
/* setup new FSF request */ /* setup new FSF request */
retval = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, retval = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA,
0, NULL, &lock_flags, &fsf_req); 0, NULL, &lock_flags, &fsf_req);
if (retval) { if (retval) {
ZFCP_LOG_INFO("error: Out of resources. Could not create an "
"exchange port data request for "
"the adapter %s.\n",
zfcp_get_busid_by_adapter(adapter));
write_unlock_irqrestore(&adapter->req_q.lock, lock_flags); write_unlock_irqrestore(&adapter->req_q.lock, lock_flags);
return retval; return retval;
} }
...@@ -2244,11 +1809,7 @@ zfcp_fsf_exchange_port_data_sync(struct zfcp_adapter *adapter, ...@@ -2244,11 +1809,7 @@ zfcp_fsf_exchange_port_data_sync(struct zfcp_adapter *adapter,
retval = zfcp_fsf_req_send(fsf_req); retval = zfcp_fsf_req_send(fsf_req);
write_unlock_irqrestore(&adapter->req_q.lock, lock_flags); write_unlock_irqrestore(&adapter->req_q.lock, lock_flags);
if (retval) if (!retval)
ZFCP_LOG_INFO("error: Could not send an exchange port data "
"command on the adapter %s\n",
zfcp_get_busid_by_adapter(adapter));
else
wait_event(fsf_req->completion_wq, wait_event(fsf_req->completion_wq,
fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED);
...@@ -2338,13 +1899,8 @@ zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) ...@@ -2338,13 +1899,8 @@ zfcp_fsf_open_port(struct zfcp_erp_action *erp_action)
ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP, ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP,
erp_action->adapter->pool.fsf_req_erp, erp_action->adapter->pool.fsf_req_erp,
&lock_flags, &fsf_req); &lock_flags, &fsf_req);
if (retval < 0) { if (retval < 0)
ZFCP_LOG_INFO("error: Could not create open port request "
"for port 0x%016Lx on adapter %s.\n",
erp_action->port->wwpn,
zfcp_get_busid_by_adapter(erp_action->adapter));
goto out; goto out;
}
sbale = zfcp_qdio_sbale_req(fsf_req); sbale = zfcp_qdio_sbale_req(fsf_req);
sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; sbale[0].flags |= SBAL_FLAGS0_TYPE_READ;
...@@ -2359,19 +1915,11 @@ zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) ...@@ -2359,19 +1915,11 @@ zfcp_fsf_open_port(struct zfcp_erp_action *erp_action)
zfcp_erp_start_timer(fsf_req); zfcp_erp_start_timer(fsf_req);
retval = zfcp_fsf_req_send(fsf_req); retval = zfcp_fsf_req_send(fsf_req);
if (retval) { if (retval) {
ZFCP_LOG_INFO("error: Could not send open port request for "
"port 0x%016Lx on adapter %s.\n",
erp_action->port->wwpn,
zfcp_get_busid_by_adapter(erp_action->adapter));
zfcp_fsf_req_free(fsf_req); zfcp_fsf_req_free(fsf_req);
erp_action->fsf_req = NULL; erp_action->fsf_req = NULL;
goto out; goto out;
} }
ZFCP_LOG_DEBUG("open port request initiated "
"(adapter %s, port 0x%016Lx)\n",
zfcp_get_busid_by_adapter(erp_action->adapter),
erp_action->port->wwpn);
out: out:
write_unlock_irqrestore(&erp_action->adapter->req_q.lock, lock_flags); write_unlock_irqrestore(&erp_action->adapter->req_q.lock, lock_flags);
return retval; return retval;
...@@ -2391,7 +1939,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2391,7 +1939,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
struct zfcp_port *port; struct zfcp_port *port;
struct fsf_plogi *plogi; struct fsf_plogi *plogi;
struct fsf_qtcb_header *header; struct fsf_qtcb_header *header;
u16 subtable, rule, counter;
port = (struct zfcp_port *) fsf_req->data; port = (struct zfcp_port *) fsf_req->data;
header = &fsf_req->qtcb->header; header = &fsf_req->qtcb->header;
...@@ -2405,9 +1952,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2405,9 +1952,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
switch (header->fsf_status) { switch (header->fsf_status) {
case FSF_PORT_ALREADY_OPEN: case FSF_PORT_ALREADY_OPEN:
ZFCP_LOG_NORMAL("bug: remote port 0x%016Lx on adapter %s "
"is already open.\n",
port->wwpn, zfcp_get_busid_by_port(port));
/* /*
* This is a bug, however operation should continue normally * This is a bug, however operation should continue normally
* if it is simply ignored * if it is simply ignored
...@@ -2415,31 +1959,14 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2415,31 +1959,14 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
break; break;
case FSF_ACCESS_DENIED: case FSF_ACCESS_DENIED:
ZFCP_LOG_NORMAL("Access denied, cannot open port 0x%016Lx " zfcp_fsf_access_denied_port(fsf_req, port);
"on adapter %s\n",
port->wwpn, zfcp_get_busid_by_port(port));
for (counter = 0; counter < 2; counter++) {
subtable = header->fsf_status_qual.halfword[counter * 2];
rule = header->fsf_status_qual.halfword[counter * 2 + 1];
switch (subtable) {
case FSF_SQ_CFDC_SUBTABLE_OS:
case FSF_SQ_CFDC_SUBTABLE_PORT_WWPN:
case FSF_SQ_CFDC_SUBTABLE_PORT_DID:
case FSF_SQ_CFDC_SUBTABLE_LUN:
ZFCP_LOG_INFO("Access denied (%s rule %d)\n",
zfcp_act_subtable_type[subtable], rule);
break;
}
}
zfcp_erp_port_access_denied(port, 57, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED: case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED:
ZFCP_LOG_INFO("error: The FSF adapter is out of resources. " dev_warn(&fsf_req->adapter->ccw_device->dev,
"The remote port 0x%016Lx on adapter %s " "The adapter is out of resources. The remote port "
"could not be opened. Disabling it.\n", "0x%016Lx could not be opened, disabling it.\n",
port->wwpn, zfcp_get_busid_by_port(port)); port->wwpn);
zfcp_erp_port_failed(port, 31, fsf_req); zfcp_erp_port_failed(port, 31, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
...@@ -2455,18 +1982,13 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2455,18 +1982,13 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_SQ_NO_RETRY_POSSIBLE: case FSF_SQ_NO_RETRY_POSSIBLE:
ZFCP_LOG_NORMAL("The remote port 0x%016Lx on " dev_warn(&fsf_req->adapter->ccw_device->dev,
"adapter %s could not be opened. " "The remote port 0x%016Lx could not be "
"Disabling it.\n", "opened. Disabling it.\n", port->wwpn);
port->wwpn,
zfcp_get_busid_by_port(port));
zfcp_erp_port_failed(port, 32, fsf_req); zfcp_erp_port_failed(port, 32, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
default: default:
ZFCP_LOG_NORMAL
("bug: Wrong status qualifier 0x%x arrived.\n",
header->fsf_status_qual.word[0]);
break; break;
} }
break; break;
...@@ -2474,10 +1996,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2474,10 +1996,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
case FSF_GOOD: case FSF_GOOD:
/* save port handle assigned by FSF */ /* save port handle assigned by FSF */
port->handle = header->port_handle; port->handle = header->port_handle;
ZFCP_LOG_INFO("The remote port 0x%016Lx via adapter %s "
"was opened, it's port handle is 0x%x\n",
port->wwpn, zfcp_get_busid_by_port(port),
port->handle);
/* mark port as open */ /* mark port as open */
atomic_set_mask(ZFCP_STATUS_COMMON_OPEN | atomic_set_mask(ZFCP_STATUS_COMMON_OPEN |
ZFCP_STATUS_PORT_PHYS_OPEN, &port->status); ZFCP_STATUS_PORT_PHYS_OPEN, &port->status);
...@@ -2505,16 +2023,9 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2505,16 +2023,9 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
{ {
if (fsf_req->qtcb->bottom.support.els1_length < if (fsf_req->qtcb->bottom.support.els1_length <
sizeof (struct fsf_plogi)) { sizeof (struct fsf_plogi)) {
ZFCP_LOG_INFO(
"warning: insufficient length of "
"PLOGI payload (%i)\n",
fsf_req->qtcb->bottom.support.els1_length);
/* skip sanity check and assume wwpn is ok */ /* skip sanity check and assume wwpn is ok */
} else { } else {
if (plogi->serv_param.wwpn != port->wwpn) { if (plogi->serv_param.wwpn != port->wwpn) {
ZFCP_LOG_INFO("warning: d_id of port "
"0x%016Lx changed during "
"open\n", port->wwpn);
atomic_clear_mask( atomic_clear_mask(
ZFCP_STATUS_PORT_DID_DID, ZFCP_STATUS_PORT_DID_DID,
&port->status); &port->status);
...@@ -2528,17 +2039,10 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2528,17 +2039,10 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
case FSF_UNKNOWN_OP_SUBTYPE: case FSF_UNKNOWN_OP_SUBTYPE:
/* should never occure, subtype not set in zfcp_fsf_open_port */ /* should never occure, subtype not set in zfcp_fsf_open_port */
ZFCP_LOG_INFO("unknown operation subtype (adapter: %s, "
"op_subtype=0x%x)\n",
zfcp_get_busid_by_port(port),
fsf_req->qtcb->bottom.support.operation_subtype);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
default: default:
ZFCP_LOG_NORMAL("bug: An unknown FSF Status was presented "
"(debug info 0x%x)\n",
header->fsf_status);
break; break;
} }
...@@ -2569,13 +2073,8 @@ zfcp_fsf_close_port(struct zfcp_erp_action *erp_action) ...@@ -2569,13 +2073,8 @@ zfcp_fsf_close_port(struct zfcp_erp_action *erp_action)
ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP, ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP,
erp_action->adapter->pool.fsf_req_erp, erp_action->adapter->pool.fsf_req_erp,
&lock_flags, &fsf_req); &lock_flags, &fsf_req);
if (retval < 0) { if (retval < 0)
ZFCP_LOG_INFO("error: Could not create a close port request "
"for port 0x%016Lx on adapter %s.\n",
erp_action->port->wwpn,
zfcp_get_busid_by_adapter(erp_action->adapter));
goto out; goto out;
}
sbale = zfcp_qdio_sbale_req(fsf_req); sbale = zfcp_qdio_sbale_req(fsf_req);
sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; sbale[0].flags |= SBAL_FLAGS0_TYPE_READ;
...@@ -2591,19 +2090,11 @@ zfcp_fsf_close_port(struct zfcp_erp_action *erp_action) ...@@ -2591,19 +2090,11 @@ zfcp_fsf_close_port(struct zfcp_erp_action *erp_action)
zfcp_erp_start_timer(fsf_req); zfcp_erp_start_timer(fsf_req);
retval = zfcp_fsf_req_send(fsf_req); retval = zfcp_fsf_req_send(fsf_req);
if (retval) { if (retval) {
ZFCP_LOG_INFO("error: Could not send a close port request for "
"port 0x%016Lx on adapter %s.\n",
erp_action->port->wwpn,
zfcp_get_busid_by_adapter(erp_action->adapter));
zfcp_fsf_req_free(fsf_req); zfcp_fsf_req_free(fsf_req);
erp_action->fsf_req = NULL; erp_action->fsf_req = NULL;
goto out; goto out;
} }
ZFCP_LOG_TRACE("close port request initiated "
"(adapter %s, port 0x%016Lx)\n",
zfcp_get_busid_by_adapter(erp_action->adapter),
erp_action->port->wwpn);
out: out:
write_unlock_irqrestore(&erp_action->adapter->req_q.lock, lock_flags); write_unlock_irqrestore(&erp_action->adapter->req_q.lock, lock_flags);
return retval; return retval;
...@@ -2633,14 +2124,6 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2633,14 +2124,6 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req)
switch (fsf_req->qtcb->header.fsf_status) { switch (fsf_req->qtcb->header.fsf_status) {
case FSF_PORT_HANDLE_NOT_VALID: case FSF_PORT_HANDLE_NOT_VALID:
ZFCP_LOG_INFO("Temporary port identifier 0x%x for port "
"0x%016Lx on adapter %s invalid. This may happen "
"occasionally.\n", port->handle,
port->wwpn, zfcp_get_busid_by_port(port));
ZFCP_LOG_DEBUG("status qualifier:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
(char *) &fsf_req->qtcb->header.fsf_status_qual,
sizeof (union fsf_status_qual));
zfcp_erp_adapter_reopen(port->adapter, 0, 107, fsf_req); zfcp_erp_adapter_reopen(port->adapter, 0, 107, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
...@@ -2653,20 +2136,11 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2653,20 +2136,11 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req)
break; break;
case FSF_GOOD: case FSF_GOOD:
ZFCP_LOG_TRACE("remote port 0x016%Lx on adapter %s closed, "
"port handle 0x%x\n", port->wwpn,
zfcp_get_busid_by_port(port), port->handle);
zfcp_erp_modify_port_status(port, 33, fsf_req, zfcp_erp_modify_port_status(port, 33, fsf_req,
ZFCP_STATUS_COMMON_OPEN, ZFCP_STATUS_COMMON_OPEN,
ZFCP_CLEAR); ZFCP_CLEAR);
retval = 0; retval = 0;
break; break;
default:
ZFCP_LOG_NORMAL("bug: An unknown FSF Status was presented "
"(debug info 0x%x)\n",
fsf_req->qtcb->header.fsf_status);
break;
} }
skip_fsfstatus: skip_fsfstatus:
...@@ -2696,14 +2170,8 @@ zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) ...@@ -2696,14 +2170,8 @@ zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action)
ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP, ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP,
erp_action->adapter->pool.fsf_req_erp, erp_action->adapter->pool.fsf_req_erp,
&lock_flags, &fsf_req); &lock_flags, &fsf_req);
if (retval < 0) { if (retval < 0)
ZFCP_LOG_INFO("error: Could not create close physical port "
"request (adapter %s, port 0x%016Lx)\n",
zfcp_get_busid_by_adapter(erp_action->adapter),
erp_action->port->wwpn);
goto out; goto out;
}
sbale = zfcp_qdio_sbale_req(fsf_req); sbale = zfcp_qdio_sbale_req(fsf_req);
sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; sbale[0].flags |= SBAL_FLAGS0_TYPE_READ;
...@@ -2721,19 +2189,11 @@ zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) ...@@ -2721,19 +2189,11 @@ zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action)
zfcp_erp_start_timer(fsf_req); zfcp_erp_start_timer(fsf_req);
retval = zfcp_fsf_req_send(fsf_req); retval = zfcp_fsf_req_send(fsf_req);
if (retval) { if (retval) {
ZFCP_LOG_INFO("error: Could not send close physical port "
"request (adapter %s, port 0x%016Lx)\n",
zfcp_get_busid_by_adapter(erp_action->adapter),
erp_action->port->wwpn);
zfcp_fsf_req_free(fsf_req); zfcp_fsf_req_free(fsf_req);
erp_action->fsf_req = NULL; erp_action->fsf_req = NULL;
goto out; goto out;
} }
ZFCP_LOG_TRACE("close physical port request initiated "
"(adapter %s, port 0x%016Lx)\n",
zfcp_get_busid_by_adapter(erp_action->adapter),
erp_action->port->wwpn);
out: out:
write_unlock_irqrestore(&erp_action->adapter->req_q.lock, lock_flags); write_unlock_irqrestore(&erp_action->adapter->req_q.lock, lock_flags);
return retval; return retval;
...@@ -2753,7 +2213,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2753,7 +2213,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req)
struct zfcp_port *port; struct zfcp_port *port;
struct zfcp_unit *unit; struct zfcp_unit *unit;
struct fsf_qtcb_header *header; struct fsf_qtcb_header *header;
u16 subtable, rule, counter;
port = (struct zfcp_port *) fsf_req->data; port = (struct zfcp_port *) fsf_req->data;
header = &fsf_req->qtcb->header; header = &fsf_req->qtcb->header;
...@@ -2767,47 +2226,15 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2767,47 +2226,15 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req)
switch (header->fsf_status) { switch (header->fsf_status) {
case FSF_PORT_HANDLE_NOT_VALID: case FSF_PORT_HANDLE_NOT_VALID:
ZFCP_LOG_INFO("Temporary port identifier 0x%x invalid"
"(adapter %s, port 0x%016Lx). "
"This may happen occasionally.\n",
port->handle,
zfcp_get_busid_by_port(port),
port->wwpn);
ZFCP_LOG_DEBUG("status qualifier:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
(char *) &header->fsf_status_qual,
sizeof (union fsf_status_qual));
zfcp_erp_adapter_reopen(port->adapter, 0, 108, fsf_req); zfcp_erp_adapter_reopen(port->adapter, 0, 108, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_ACCESS_DENIED: case FSF_ACCESS_DENIED:
ZFCP_LOG_NORMAL("Access denied, cannot close " zfcp_fsf_access_denied_port(fsf_req, port);
"physical port 0x%016Lx on adapter %s\n",
port->wwpn, zfcp_get_busid_by_port(port));
for (counter = 0; counter < 2; counter++) {
subtable = header->fsf_status_qual.halfword[counter * 2];
rule = header->fsf_status_qual.halfword[counter * 2 + 1];
switch (subtable) {
case FSF_SQ_CFDC_SUBTABLE_OS:
case FSF_SQ_CFDC_SUBTABLE_PORT_WWPN:
case FSF_SQ_CFDC_SUBTABLE_PORT_DID:
case FSF_SQ_CFDC_SUBTABLE_LUN:
ZFCP_LOG_INFO("Access denied (%s rule %d)\n",
zfcp_act_subtable_type[subtable], rule);
break;
}
}
zfcp_erp_port_access_denied(port, 58, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_PORT_BOXED: case FSF_PORT_BOXED:
ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter "
"%s needs to be reopened but it was attempted "
"to close it physically.\n",
port->wwpn,
zfcp_get_busid_by_port(port));
zfcp_erp_port_boxed(port, 50, fsf_req); zfcp_erp_port_boxed(port, 50, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
ZFCP_STATUS_FSFREQ_RETRY; ZFCP_STATUS_FSFREQ_RETRY;
...@@ -2830,19 +2257,10 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2830,19 +2257,10 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req)
/* ERP strategy will escalate */ /* ERP strategy will escalate */
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
default:
ZFCP_LOG_NORMAL
("bug: Wrong status qualifier 0x%x arrived.\n",
header->fsf_status_qual.word[0]);
break;
} }
break; break;
case FSF_GOOD: case FSF_GOOD:
ZFCP_LOG_DEBUG("Remote port 0x%016Lx via adapter %s "
"physically closed, port handle 0x%x\n",
port->wwpn,
zfcp_get_busid_by_port(port), port->handle);
/* can't use generic zfcp_erp_modify_port_status because /* can't use generic zfcp_erp_modify_port_status because
* ZFCP_STATUS_COMMON_OPEN must not be reset for the port * ZFCP_STATUS_COMMON_OPEN must not be reset for the port
*/ */
...@@ -2851,12 +2269,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2851,12 +2269,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req)
atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status); atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status);
retval = 0; retval = 0;
break; break;
default:
ZFCP_LOG_NORMAL("bug: An unknown FSF Status was presented "
"(debug info 0x%x)\n",
header->fsf_status);
break;
} }
skip_fsfstatus: skip_fsfstatus:
...@@ -2890,14 +2302,8 @@ zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action) ...@@ -2890,14 +2302,8 @@ zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action)
ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP, ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP,
erp_action->adapter->pool.fsf_req_erp, erp_action->adapter->pool.fsf_req_erp,
&lock_flags, &fsf_req); &lock_flags, &fsf_req);
if (retval < 0) { if (retval < 0)
ZFCP_LOG_INFO("error: Could not create open unit request for "
"unit 0x%016Lx on port 0x%016Lx on adapter %s.\n",
erp_action->unit->fcp_lun,
erp_action->unit->port->wwpn,
zfcp_get_busid_by_adapter(erp_action->adapter));
goto out; goto out;
}
sbale = zfcp_qdio_sbale_req(fsf_req); sbale = zfcp_qdio_sbale_req(fsf_req);
sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; sbale[0].flags |= SBAL_FLAGS0_TYPE_READ;
...@@ -2916,21 +2322,10 @@ zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action) ...@@ -2916,21 +2322,10 @@ zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action)
zfcp_erp_start_timer(fsf_req); zfcp_erp_start_timer(fsf_req);
retval = zfcp_fsf_req_send(erp_action->fsf_req); retval = zfcp_fsf_req_send(erp_action->fsf_req);
if (retval) { if (retval) {
ZFCP_LOG_INFO("error: Could not send an open unit request "
"on the adapter %s, port 0x%016Lx for "
"unit 0x%016Lx\n",
zfcp_get_busid_by_adapter(erp_action->adapter),
erp_action->port->wwpn,
erp_action->unit->fcp_lun);
zfcp_fsf_req_free(fsf_req); zfcp_fsf_req_free(fsf_req);
erp_action->fsf_req = NULL; erp_action->fsf_req = NULL;
goto out; goto out;
} }
ZFCP_LOG_TRACE("Open LUN request initiated (adapter %s, "
"port 0x%016Lx, unit 0x%016Lx)\n",
zfcp_get_busid_by_adapter(erp_action->adapter),
erp_action->port->wwpn, erp_action->unit->fcp_lun);
out: out:
write_unlock_irqrestore(&erp_action->adapter->req_q.lock, lock_flags); write_unlock_irqrestore(&erp_action->adapter->req_q.lock, lock_flags);
return retval; return retval;
...@@ -2952,7 +2347,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2952,7 +2347,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
struct fsf_qtcb_header *header; struct fsf_qtcb_header *header;
struct fsf_qtcb_bottom_support *bottom; struct fsf_qtcb_bottom_support *bottom;
struct fsf_queue_designator *queue_designator; struct fsf_queue_designator *queue_designator;
u16 subtable, rule, counter;
int exclusive, readwrite; int exclusive, readwrite;
unit = (struct zfcp_unit *) fsf_req->data; unit = (struct zfcp_unit *) fsf_req->data;
...@@ -2977,55 +2371,21 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2977,55 +2371,21 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
switch (header->fsf_status) { switch (header->fsf_status) {
case FSF_PORT_HANDLE_NOT_VALID: case FSF_PORT_HANDLE_NOT_VALID:
ZFCP_LOG_INFO("Temporary port identifier 0x%x "
"for port 0x%016Lx on adapter %s invalid "
"This may happen occasionally\n",
unit->port->handle,
unit->port->wwpn, zfcp_get_busid_by_unit(unit));
ZFCP_LOG_DEBUG("status qualifier:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
(char *) &header->fsf_status_qual,
sizeof (union fsf_status_qual));
zfcp_erp_adapter_reopen(unit->port->adapter, 0, 109, fsf_req); zfcp_erp_adapter_reopen(unit->port->adapter, 0, 109, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_LUN_ALREADY_OPEN: case FSF_LUN_ALREADY_OPEN:
ZFCP_LOG_NORMAL("bug: Attempted to open unit 0x%016Lx on "
"remote port 0x%016Lx on adapter %s twice.\n",
unit->fcp_lun,
unit->port->wwpn, zfcp_get_busid_by_unit(unit));
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_ACCESS_DENIED: case FSF_ACCESS_DENIED:
ZFCP_LOG_NORMAL("Access denied, cannot open unit 0x%016Lx on " zfcp_fsf_access_denied_unit(fsf_req, unit);
"remote port 0x%016Lx on adapter %s\n",
unit->fcp_lun, unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
for (counter = 0; counter < 2; counter++) {
subtable = header->fsf_status_qual.halfword[counter * 2];
rule = header->fsf_status_qual.halfword[counter * 2 + 1];
switch (subtable) {
case FSF_SQ_CFDC_SUBTABLE_OS:
case FSF_SQ_CFDC_SUBTABLE_PORT_WWPN:
case FSF_SQ_CFDC_SUBTABLE_PORT_DID:
case FSF_SQ_CFDC_SUBTABLE_LUN:
ZFCP_LOG_INFO("Access denied (%s rule %d)\n",
zfcp_act_subtable_type[subtable], rule);
break;
}
}
zfcp_erp_unit_access_denied(unit, 59, fsf_req);
atomic_clear_mask(ZFCP_STATUS_UNIT_SHARED, &unit->status); atomic_clear_mask(ZFCP_STATUS_UNIT_SHARED, &unit->status);
atomic_clear_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status); atomic_clear_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_PORT_BOXED: case FSF_PORT_BOXED:
ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s "
"needs to be reopened\n",
unit->port->wwpn, zfcp_get_busid_by_unit(unit));
zfcp_erp_port_boxed(unit->port, 51, fsf_req); zfcp_erp_port_boxed(unit->port, 51, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
ZFCP_STATUS_FSFREQ_RETRY; ZFCP_STATUS_FSFREQ_RETRY;
...@@ -3033,39 +2393,18 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) ...@@ -3033,39 +2393,18 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
case FSF_LUN_SHARING_VIOLATION: case FSF_LUN_SHARING_VIOLATION:
if (header->fsf_status_qual.word[0] != 0) { if (header->fsf_status_qual.word[0] != 0) {
ZFCP_LOG_NORMAL("FCP-LUN 0x%Lx at the remote port " dev_warn(&adapter->ccw_device->dev,
"with WWPN 0x%Lx " "FCP-LUN 0x%Lx at the remote port "
"connected to the adapter %s " "with WWPN 0x%Lx "
"is already in use in LPAR%d, CSS%d\n", "connected to the adapter "
unit->fcp_lun, "is already in use in LPAR%d, CSS%d.\n",
unit->port->wwpn, unit->fcp_lun,
zfcp_get_busid_by_unit(unit), unit->port->wwpn,
queue_designator->hla, queue_designator->hla,
queue_designator->cssid); queue_designator->cssid);
} else { } else
subtable = header->fsf_status_qual.halfword[4]; zfcp_act_eval_err(adapter,
rule = header->fsf_status_qual.halfword[5]; header->fsf_status_qual.word[2]);
switch (subtable) {
case FSF_SQ_CFDC_SUBTABLE_OS:
case FSF_SQ_CFDC_SUBTABLE_PORT_WWPN:
case FSF_SQ_CFDC_SUBTABLE_PORT_DID:
case FSF_SQ_CFDC_SUBTABLE_LUN:
ZFCP_LOG_NORMAL("Access to FCP-LUN 0x%Lx at the "
"remote port with WWPN 0x%Lx "
"connected to the adapter %s "
"is denied (%s rule %d)\n",
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit),
zfcp_act_subtable_type[subtable],
rule);
break;
}
}
ZFCP_LOG_DEBUG("status qualifier:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
(char *) &header->fsf_status_qual,
sizeof (union fsf_status_qual));
zfcp_erp_unit_access_denied(unit, 60, fsf_req); zfcp_erp_unit_access_denied(unit, 60, fsf_req);
atomic_clear_mask(ZFCP_STATUS_UNIT_SHARED, &unit->status); atomic_clear_mask(ZFCP_STATUS_UNIT_SHARED, &unit->status);
atomic_clear_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status); atomic_clear_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status);
...@@ -3073,13 +2412,10 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) ...@@ -3073,13 +2412,10 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
break; break;
case FSF_MAXIMUM_NUMBER_OF_LUNS_EXCEEDED: case FSF_MAXIMUM_NUMBER_OF_LUNS_EXCEEDED:
ZFCP_LOG_INFO("error: The adapter ran out of resources. " dev_warn(&fsf_req->adapter->ccw_device->dev,
"There is no handle (temporary port identifier) " "The adapter ran out of resources. There is no "
"available for unit 0x%016Lx on port 0x%016Lx " "handle available for unit 0x%016Lx on port 0x%016Lx.",
"on adapter %s\n", unit->fcp_lun, unit->port->wwpn);
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
zfcp_erp_unit_failed(unit, 34, fsf_req); zfcp_erp_unit_failed(unit, 34, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
...@@ -3095,19 +2431,10 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) ...@@ -3095,19 +2431,10 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
/* ERP strategy will escalate */ /* ERP strategy will escalate */
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
default:
ZFCP_LOG_NORMAL
("bug: Wrong status qualifier 0x%x arrived.\n",
header->fsf_status_qual.word[0]);
} }
break; break;
case FSF_INVALID_COMMAND_OPTION: case FSF_INVALID_COMMAND_OPTION:
ZFCP_LOG_NORMAL(
"Invalid option 0x%x has been specified "
"in QTCB bottom sent to the adapter %s\n",
bottom->option,
zfcp_get_busid_by_adapter(adapter));
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
retval = -EINVAL; retval = -EINVAL;
break; break;
...@@ -3115,12 +2442,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) ...@@ -3115,12 +2442,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
case FSF_GOOD: case FSF_GOOD:
/* save LUN handle assigned by FSF */ /* save LUN handle assigned by FSF */
unit->handle = header->lun_handle; unit->handle = header->lun_handle;
ZFCP_LOG_TRACE("unit 0x%016Lx on remote port 0x%016Lx on "
"adapter %s opened, port handle 0x%x\n",
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit),
unit->handle);
/* mark unit as open */ /* mark unit as open */
atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status); atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status);
...@@ -3139,23 +2460,27 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) ...@@ -3139,23 +2460,27 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
if (!readwrite) { if (!readwrite) {
atomic_set_mask(ZFCP_STATUS_UNIT_READONLY, atomic_set_mask(ZFCP_STATUS_UNIT_READONLY,
&unit->status); &unit->status);
ZFCP_LOG_NORMAL("read-only access for unit " dev_info(&fsf_req->adapter->ccw_device->dev,
"(adapter %s, wwpn=0x%016Lx, " "Read-only access for unit 0x%016Lx "
"fcp_lun=0x%016Lx)\n", "on port 0x%016Lx.\n",
zfcp_get_busid_by_unit(unit), unit->fcp_lun, unit->port->wwpn);
unit->port->wwpn,
unit->fcp_lun);
} }
if (exclusive && !readwrite) { if (exclusive && !readwrite) {
ZFCP_LOG_NORMAL("exclusive access of read-only " dev_err(&fsf_req->adapter->ccw_device->dev,
"unit not supported\n"); "Exclusive access of read-only unit "
"0x%016Lx on port 0x%016Lx not "
"supported, disabling unit.\n",
unit->fcp_lun, unit->port->wwpn);
zfcp_erp_unit_failed(unit, 35, fsf_req); zfcp_erp_unit_failed(unit, 35, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
zfcp_erp_unit_shutdown(unit, 0, 80, fsf_req); zfcp_erp_unit_shutdown(unit, 0, 80, fsf_req);
} else if (!exclusive && readwrite) { } else if (!exclusive && readwrite) {
ZFCP_LOG_NORMAL("shared access of read-write " dev_err(&fsf_req->adapter->ccw_device->dev,
"unit not supported\n"); "Shared access of read-write unit "
"0x%016Lx on port 0x%016Lx not "
"supported, disabling unit.\n",
unit->fcp_lun, unit->port->wwpn);
zfcp_erp_unit_failed(unit, 36, fsf_req); zfcp_erp_unit_failed(unit, 36, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
zfcp_erp_unit_shutdown(unit, 0, 81, fsf_req); zfcp_erp_unit_shutdown(unit, 0, 81, fsf_req);
...@@ -3164,12 +2489,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) ...@@ -3164,12 +2489,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
retval = 0; retval = 0;
break; break;
default:
ZFCP_LOG_NORMAL("bug: An unknown FSF Status was presented "
"(debug info 0x%x)\n",
header->fsf_status);
break;
} }
skip_fsfstatus: skip_fsfstatus:
...@@ -3204,14 +2523,8 @@ zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action) ...@@ -3204,14 +2523,8 @@ zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action)
ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP, ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP,
erp_action->adapter->pool.fsf_req_erp, erp_action->adapter->pool.fsf_req_erp,
&lock_flags, &fsf_req); &lock_flags, &fsf_req);
if (retval < 0) { if (retval < 0)
ZFCP_LOG_INFO("error: Could not create close unit request for "
"unit 0x%016Lx on port 0x%016Lx on adapter %s.\n",
erp_action->unit->fcp_lun,
erp_action->port->wwpn,
zfcp_get_busid_by_adapter(erp_action->adapter));
goto out; goto out;
}
sbale = zfcp_qdio_sbale_req(fsf_req); sbale = zfcp_qdio_sbale_req(fsf_req);
sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; sbale[0].flags |= SBAL_FLAGS0_TYPE_READ;
...@@ -3227,20 +2540,11 @@ zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action) ...@@ -3227,20 +2540,11 @@ zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action)
zfcp_erp_start_timer(fsf_req); zfcp_erp_start_timer(fsf_req);
retval = zfcp_fsf_req_send(erp_action->fsf_req); retval = zfcp_fsf_req_send(erp_action->fsf_req);
if (retval) { if (retval) {
ZFCP_LOG_INFO("error: Could not send a close unit request for "
"unit 0x%016Lx on port 0x%016Lx onadapter %s.\n",
erp_action->unit->fcp_lun,
erp_action->port->wwpn,
zfcp_get_busid_by_adapter(erp_action->adapter));
zfcp_fsf_req_free(fsf_req); zfcp_fsf_req_free(fsf_req);
erp_action->fsf_req = NULL; erp_action->fsf_req = NULL;
goto out; goto out;
} }
ZFCP_LOG_TRACE("Close LUN request initiated (adapter %s, "
"port 0x%016Lx, unit 0x%016Lx)\n",
zfcp_get_busid_by_adapter(erp_action->adapter),
erp_action->port->wwpn, erp_action->unit->fcp_lun);
out: out:
write_unlock_irqrestore(&erp_action->adapter->req_q.lock, lock_flags); write_unlock_irqrestore(&erp_action->adapter->req_q.lock, lock_flags);
return retval; return retval;
...@@ -3270,41 +2574,16 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) ...@@ -3270,41 +2574,16 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req)
switch (fsf_req->qtcb->header.fsf_status) { switch (fsf_req->qtcb->header.fsf_status) {
case FSF_PORT_HANDLE_NOT_VALID: case FSF_PORT_HANDLE_NOT_VALID:
ZFCP_LOG_INFO("Temporary port identifier 0x%x for port "
"0x%016Lx on adapter %s invalid. This may "
"happen in rare circumstances\n",
unit->port->handle,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
ZFCP_LOG_DEBUG("status qualifier:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
(char *) &fsf_req->qtcb->header.fsf_status_qual,
sizeof (union fsf_status_qual));
zfcp_erp_adapter_reopen(unit->port->adapter, 0, 110, fsf_req); zfcp_erp_adapter_reopen(unit->port->adapter, 0, 110, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_LUN_HANDLE_NOT_VALID: case FSF_LUN_HANDLE_NOT_VALID:
ZFCP_LOG_INFO("Temporary LUN identifier 0x%x of unit "
"0x%016Lx on port 0x%016Lx on adapter %s is "
"invalid. This may happen occasionally.\n",
unit->handle,
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
ZFCP_LOG_DEBUG("Status qualifier data:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
(char *) &fsf_req->qtcb->header.fsf_status_qual,
sizeof (union fsf_status_qual));
zfcp_erp_port_reopen(unit->port, 0, 111, fsf_req); zfcp_erp_port_reopen(unit->port, 0, 111, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_PORT_BOXED: case FSF_PORT_BOXED:
ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s "
"needs to be reopened\n",
unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
zfcp_erp_port_boxed(unit->port, 52, fsf_req); zfcp_erp_port_boxed(unit->port, 52, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
ZFCP_STATUS_FSFREQ_RETRY; ZFCP_STATUS_FSFREQ_RETRY;
...@@ -3322,30 +2601,15 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) ...@@ -3322,30 +2601,15 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req)
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
default: default:
ZFCP_LOG_NORMAL
("bug: Wrong status qualifier 0x%x arrived.\n",
fsf_req->qtcb->header.fsf_status_qual.word[0]);
break; break;
} }
break; break;
case FSF_GOOD: case FSF_GOOD:
ZFCP_LOG_TRACE("unit 0x%016Lx on port 0x%016Lx on adapter %s "
"closed, port handle 0x%x\n",
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit),
unit->handle);
/* mark unit as closed */ /* mark unit as closed */
atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status); atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status);
retval = 0; retval = 0;
break; break;
default:
ZFCP_LOG_NORMAL("bug: An unknown FSF Status was presented "
"(debug info 0x%x)\n",
fsf_req->qtcb->header.fsf_status);
break;
} }
skip_fsfstatus: skip_fsfstatus:
...@@ -3379,15 +2643,8 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter, ...@@ -3379,15 +2643,8 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
retval = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, retval = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags,
adapter->pool.fsf_req_scsi, adapter->pool.fsf_req_scsi,
&lock_flags, &fsf_req); &lock_flags, &fsf_req);
if (unlikely(retval < 0)) { if (unlikely(retval < 0))
ZFCP_LOG_DEBUG("error: Could not create FCP command request "
"for unit 0x%016Lx on port 0x%016Lx on "
"adapter %s\n",
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_adapter(adapter));
goto failed_req_create; goto failed_req_create;
}
if (unlikely(!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, if (unlikely(!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED,
&unit->status))) { &unit->status))) {
...@@ -3463,15 +2720,9 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter, ...@@ -3463,15 +2720,9 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
fcp_cmnd_iu->task_attribute = UNTAGGED; fcp_cmnd_iu->task_attribute = UNTAGGED;
/* set additional length of FCP_CDB in FCP_CMND IU in QTCB, if needed */ /* set additional length of FCP_CDB in FCP_CMND IU in QTCB, if needed */
if (unlikely(scsi_cmnd->cmd_len > FCP_CDB_LENGTH)) { if (unlikely(scsi_cmnd->cmd_len > FCP_CDB_LENGTH))
fcp_cmnd_iu->add_fcp_cdb_length fcp_cmnd_iu->add_fcp_cdb_length
= (scsi_cmnd->cmd_len - FCP_CDB_LENGTH) >> 2; = (scsi_cmnd->cmd_len - FCP_CDB_LENGTH) >> 2;
ZFCP_LOG_TRACE("SCSI CDB length is 0x%x, "
"additional FCP_CDB length is 0x%x "
"(shifted right 2 bits)\n",
scsi_cmnd->cmd_len,
fcp_cmnd_iu->add_fcp_cdb_length);
}
/* /*
* copy SCSI CDB (including additional length, if any) to * copy SCSI CDB (including additional length, if any) to
* FCP_CDB in FCP_CMND IU in QTCB * FCP_CDB in FCP_CMND IU in QTCB
...@@ -3488,19 +2739,14 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter, ...@@ -3488,19 +2739,14 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
scsi_sglist(scsi_cmnd), scsi_sglist(scsi_cmnd),
ZFCP_MAX_SBALS_PER_REQ); ZFCP_MAX_SBALS_PER_REQ);
if (unlikely(real_bytes < 0)) { if (unlikely(real_bytes < 0)) {
if (fsf_req->sbal_number < ZFCP_MAX_SBALS_PER_REQ) { if (fsf_req->sbal_number < ZFCP_MAX_SBALS_PER_REQ)
ZFCP_LOG_DEBUG(
"Data did not fit into available buffer(s), "
"waiting for more...\n");
retval = -EIO; retval = -EIO;
} else { else {
ZFCP_LOG_NORMAL("error: No truncation implemented but " dev_err(&adapter->ccw_device->dev,
"required. Shutting down unit " "SCSI request too large. "
"(adapter %s, port 0x%016Lx, " "Shutting down unit 0x%016Lx on port "
"unit 0x%016Lx)\n", "0x%016Lx.\n", unit->fcp_lun,
zfcp_get_busid_by_unit(unit), unit->port->wwpn);
unit->port->wwpn,
unit->fcp_lun);
zfcp_erp_unit_shutdown(unit, 0, 131, fsf_req); zfcp_erp_unit_shutdown(unit, 0, 131, fsf_req);
retval = -EINVAL; retval = -EINVAL;
} }
...@@ -3510,28 +2756,13 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter, ...@@ -3510,28 +2756,13 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
/* set length of FCP data length in FCP_CMND IU in QTCB */ /* set length of FCP data length in FCP_CMND IU in QTCB */
zfcp_set_fcp_dl(fcp_cmnd_iu, real_bytes); zfcp_set_fcp_dl(fcp_cmnd_iu, real_bytes);
ZFCP_LOG_DEBUG("Sending SCSI command:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
(char *) scsi_cmnd->cmnd, scsi_cmnd->cmd_len);
if (use_timer) if (use_timer)
zfcp_fsf_start_timer(fsf_req, ZFCP_FSF_REQUEST_TIMEOUT); zfcp_fsf_start_timer(fsf_req, ZFCP_FSF_REQUEST_TIMEOUT);
retval = zfcp_fsf_req_send(fsf_req); retval = zfcp_fsf_req_send(fsf_req);
if (unlikely(retval < 0)) { if (unlikely(retval < 0))
ZFCP_LOG_INFO("error: Could not send FCP command request "
"on adapter %s, port 0x%016Lx, unit 0x%016Lx\n",
zfcp_get_busid_by_adapter(adapter),
unit->port->wwpn,
unit->fcp_lun);
goto send_failed; goto send_failed;
}
ZFCP_LOG_TRACE("Send FCP Command initiated (adapter %s, "
"port 0x%016Lx, unit 0x%016Lx)\n",
zfcp_get_busid_by_adapter(adapter),
unit->port->wwpn,
unit->fcp_lun);
goto success; goto success;
send_failed: send_failed:
...@@ -3563,14 +2794,8 @@ zfcp_fsf_send_fcp_command_task_management(struct zfcp_adapter *adapter, ...@@ -3563,14 +2794,8 @@ zfcp_fsf_send_fcp_command_task_management(struct zfcp_adapter *adapter,
retval = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, retval = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags,
adapter->pool.fsf_req_scsi, adapter->pool.fsf_req_scsi,
&lock_flags, &fsf_req); &lock_flags, &fsf_req);
if (retval < 0) { if (retval < 0)
ZFCP_LOG_INFO("error: Could not create FCP command (task "
"management) request for adapter %s, port "
" 0x%016Lx, unit 0x%016Lx.\n",
zfcp_get_busid_by_adapter(adapter),
unit->port->wwpn, unit->fcp_lun);
goto out; goto out;
}
if (unlikely(!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, if (unlikely(!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED,
&unit->status))) &unit->status)))
...@@ -3674,7 +2899,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) ...@@ -3674,7 +2899,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
int retval = -EINVAL; int retval = -EINVAL;
struct zfcp_unit *unit; struct zfcp_unit *unit;
struct fsf_qtcb_header *header; struct fsf_qtcb_header *header;
u16 subtable, rule, counter;
header = &fsf_req->qtcb->header; header = &fsf_req->qtcb->header;
...@@ -3692,137 +2916,61 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) ...@@ -3692,137 +2916,61 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
switch (header->fsf_status) { switch (header->fsf_status) {
case FSF_PORT_HANDLE_NOT_VALID: case FSF_PORT_HANDLE_NOT_VALID:
ZFCP_LOG_INFO("Temporary port identifier 0x%x for port "
"0x%016Lx on adapter %s invalid\n",
unit->port->handle,
unit->port->wwpn, zfcp_get_busid_by_unit(unit));
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
(char *) &header->fsf_status_qual,
sizeof (union fsf_status_qual));
zfcp_erp_adapter_reopen(unit->port->adapter, 0, 112, fsf_req); zfcp_erp_adapter_reopen(unit->port->adapter, 0, 112, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_LUN_HANDLE_NOT_VALID: case FSF_LUN_HANDLE_NOT_VALID:
ZFCP_LOG_INFO("Temporary LUN identifier 0x%x for unit "
"0x%016Lx on port 0x%016Lx on adapter %s is "
"invalid. This may happen occasionally.\n",
unit->handle,
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
ZFCP_LOG_NORMAL("Status qualifier data:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL,
(char *) &header->fsf_status_qual,
sizeof (union fsf_status_qual));
zfcp_erp_port_reopen(unit->port, 0, 113, fsf_req); zfcp_erp_port_reopen(unit->port, 0, 113, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_HANDLE_MISMATCH: case FSF_HANDLE_MISMATCH:
ZFCP_LOG_NORMAL("bug: The port handle 0x%x has changed "
"unexpectedly. (adapter %s, port 0x%016Lx, "
"unit 0x%016Lx)\n",
unit->port->handle,
zfcp_get_busid_by_unit(unit),
unit->port->wwpn,
unit->fcp_lun);
ZFCP_LOG_NORMAL("status qualifier:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL,
(char *) &header->fsf_status_qual,
sizeof (union fsf_status_qual));
zfcp_erp_adapter_reopen(unit->port->adapter, 0, 114, fsf_req); zfcp_erp_adapter_reopen(unit->port->adapter, 0, 114, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_SERVICE_CLASS_NOT_SUPPORTED: case FSF_SERVICE_CLASS_NOT_SUPPORTED:
ZFCP_LOG_INFO("error: adapter %s does not support fc " zfcp_fsf_class_not_supp(fsf_req);
"class %d.\n",
zfcp_get_busid_by_unit(unit),
ZFCP_FC_SERVICE_CLASS_DEFAULT);
/* stop operation for this adapter */
zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 132, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_FCPLUN_NOT_VALID: case FSF_FCPLUN_NOT_VALID:
ZFCP_LOG_NORMAL("bug: unit 0x%016Lx on port 0x%016Lx on "
"adapter %s does not have correct unit "
"handle 0x%x\n",
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit),
unit->handle);
ZFCP_LOG_DEBUG("status qualifier:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
(char *) &header->fsf_status_qual,
sizeof (union fsf_status_qual));
zfcp_erp_port_reopen(unit->port, 0, 115, fsf_req); zfcp_erp_port_reopen(unit->port, 0, 115, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_ACCESS_DENIED: case FSF_ACCESS_DENIED:
ZFCP_LOG_NORMAL("Access denied, cannot send FCP command to " zfcp_fsf_access_denied_unit(fsf_req, unit);
"unit 0x%016Lx on port 0x%016Lx on "
"adapter %s\n", unit->fcp_lun, unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
for (counter = 0; counter < 2; counter++) {
subtable = header->fsf_status_qual.halfword[counter * 2];
rule = header->fsf_status_qual.halfword[counter * 2 + 1];
switch (subtable) {
case FSF_SQ_CFDC_SUBTABLE_OS:
case FSF_SQ_CFDC_SUBTABLE_PORT_WWPN:
case FSF_SQ_CFDC_SUBTABLE_PORT_DID:
case FSF_SQ_CFDC_SUBTABLE_LUN:
ZFCP_LOG_INFO("Access denied (%s rule %d)\n",
zfcp_act_subtable_type[subtable], rule);
break;
}
}
zfcp_erp_unit_access_denied(unit, 61, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_DIRECTION_INDICATOR_NOT_VALID: case FSF_DIRECTION_INDICATOR_NOT_VALID:
ZFCP_LOG_INFO("bug: Invalid data direction given for unit " dev_err(&fsf_req->adapter->ccw_device->dev,
"0x%016Lx on port 0x%016Lx on adapter %s " "Invalid data direction (%d) given for unit 0x%016Lx "
"(debug info %d)\n", "on port 0x%016Lx, shutting down adapter.\n",
unit->fcp_lun, fsf_req->qtcb->bottom.io.data_direction,
unit->port->wwpn, unit->fcp_lun, unit->port->wwpn);
zfcp_get_busid_by_unit(unit),
fsf_req->qtcb->bottom.io.data_direction);
/* stop operation for this adapter */
zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 133, fsf_req); zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 133, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_CMND_LENGTH_NOT_VALID: case FSF_CMND_LENGTH_NOT_VALID:
ZFCP_LOG_NORMAL dev_err(&fsf_req->adapter->ccw_device->dev,
("bug: An invalid control-data-block length field " "An invalid control-data-block length field (%d) "
"was found in a command for unit 0x%016Lx on port " "was found in a command for unit 0x%016Lx on port "
"0x%016Lx on adapter %s " "(debug info %d)\n", "0x%016Lx. Shutting down adapter.\n",
unit->fcp_lun, unit->port->wwpn, fsf_req->qtcb->bottom.io.fcp_cmnd_length,
zfcp_get_busid_by_unit(unit), unit->fcp_lun, unit->port->wwpn);
fsf_req->qtcb->bottom.io.fcp_cmnd_length);
/* stop operation for this adapter */
zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 134, fsf_req); zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 134, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
case FSF_PORT_BOXED: case FSF_PORT_BOXED:
ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s "
"needs to be reopened\n",
unit->port->wwpn, zfcp_get_busid_by_unit(unit));
zfcp_erp_port_boxed(unit->port, 53, fsf_req); zfcp_erp_port_boxed(unit->port, 53, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
ZFCP_STATUS_FSFREQ_RETRY; ZFCP_STATUS_FSFREQ_RETRY;
break; break;
case FSF_LUN_BOXED: case FSF_LUN_BOXED:
ZFCP_LOG_NORMAL("unit needs to be reopened (adapter %s, "
"wwpn=0x%016Lx, fcp_lun=0x%016Lx)\n",
zfcp_get_busid_by_unit(unit),
unit->port->wwpn, unit->fcp_lun);
zfcp_erp_unit_boxed(unit, 54, fsf_req); zfcp_erp_unit_boxed(unit, 54, fsf_req);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR
| ZFCP_STATUS_FSFREQ_RETRY; | ZFCP_STATUS_FSFREQ_RETRY;
...@@ -3838,11 +2986,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) ...@@ -3838,11 +2986,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
/* FIXME(hw) need proper specs for proper action */ /* FIXME(hw) need proper specs for proper action */
/* let scsi stack deal with retries and escalation */ /* let scsi stack deal with retries and escalation */
break; break;
default:
ZFCP_LOG_NORMAL
("Unknown status qualifier 0x%x arrived.\n",
header->fsf_status_qual.word[0]);
break;
} }
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
...@@ -3880,34 +3023,26 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req) ...@@ -3880,34 +3023,26 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
struct scsi_cmnd *scpnt; struct scsi_cmnd *scpnt;
struct fcp_rsp_iu *fcp_rsp_iu = (struct fcp_rsp_iu *) struct fcp_rsp_iu *fcp_rsp_iu = (struct fcp_rsp_iu *)
&(fsf_req->qtcb->bottom.io.fcp_rsp); &(fsf_req->qtcb->bottom.io.fcp_rsp);
struct fcp_cmnd_iu *fcp_cmnd_iu = (struct fcp_cmnd_iu *)
&(fsf_req->qtcb->bottom.io.fcp_cmnd);
u32 sns_len; u32 sns_len;
char *fcp_rsp_info = zfcp_get_fcp_rsp_info_ptr(fcp_rsp_iu); char *fcp_rsp_info = zfcp_get_fcp_rsp_info_ptr(fcp_rsp_iu);
unsigned long flags; unsigned long flags;
struct zfcp_unit *unit = fsf_req->unit;
read_lock_irqsave(&fsf_req->adapter->abort_lock, flags); read_lock_irqsave(&fsf_req->adapter->abort_lock, flags);
scpnt = (struct scsi_cmnd *) fsf_req->data; scpnt = (struct scsi_cmnd *) fsf_req->data;
if (unlikely(!scpnt)) { if (unlikely(!scpnt))
ZFCP_LOG_DEBUG
("Command with fsf_req %p is not associated to "
"a scsi command anymore. Aborted?\n", fsf_req);
goto out; goto out;
}
if (unlikely(fsf_req->status & ZFCP_STATUS_FSFREQ_ABORTED)) { if (unlikely(fsf_req->status & ZFCP_STATUS_FSFREQ_ABORTED)) {
/* FIXME: (design) mid-layer should handle DID_ABORT like /* FIXME: (design) mid-layer should handle DID_ABORT like
* DID_SOFT_ERROR by retrying the request for devices * DID_SOFT_ERROR by retrying the request for devices
* that allow retries. * that allow retries.
*/ */
ZFCP_LOG_DEBUG("Setting DID_SOFT_ERROR and SUGGEST_RETRY\n");
set_host_byte(&scpnt->result, DID_SOFT_ERROR); set_host_byte(&scpnt->result, DID_SOFT_ERROR);
set_driver_byte(&scpnt->result, SUGGEST_RETRY); set_driver_byte(&scpnt->result, SUGGEST_RETRY);
goto skip_fsfstatus; goto skip_fsfstatus;
} }
if (unlikely(fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR)) { if (unlikely(fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR)) {
ZFCP_LOG_DEBUG("Setting DID_ERROR\n");
set_host_byte(&scpnt->result, DID_ERROR); set_host_byte(&scpnt->result, DID_ERROR);
goto skip_fsfstatus; goto skip_fsfstatus;
} }
...@@ -3920,97 +3055,31 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req) ...@@ -3920,97 +3055,31 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
* of result in SCSI command * of result in SCSI command
*/ */
scpnt->result |= fcp_rsp_iu->scsi_status; scpnt->result |= fcp_rsp_iu->scsi_status;
if (unlikely(fcp_rsp_iu->scsi_status)) {
/* DEBUG */
ZFCP_LOG_DEBUG("status for SCSI Command:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
scpnt->cmnd, scpnt->cmd_len);
ZFCP_LOG_DEBUG("SCSI status code 0x%x\n",
fcp_rsp_iu->scsi_status);
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
(void *) fcp_rsp_iu, sizeof (struct fcp_rsp_iu));
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
zfcp_get_fcp_sns_info_ptr(fcp_rsp_iu),
fcp_rsp_iu->fcp_sns_len);
}
if (fsf_req->adapter->adapter_features & FSF_FEATURE_MEASUREMENT_DATA) if (fsf_req->adapter->adapter_features & FSF_FEATURE_MEASUREMENT_DATA)
zfcp_fsf_req_latency(fsf_req); zfcp_fsf_req_latency(fsf_req);
/* check FCP_RSP_INFO */ /* check FCP_RSP_INFO */
if (unlikely(fcp_rsp_iu->validity.bits.fcp_rsp_len_valid)) { if (unlikely(fcp_rsp_iu->validity.bits.fcp_rsp_len_valid)) {
ZFCP_LOG_DEBUG("rsp_len is valid\n");
switch (fcp_rsp_info[3]) { switch (fcp_rsp_info[3]) {
case RSP_CODE_GOOD: case RSP_CODE_GOOD:
/* ok, continue */ /* ok, continue */
ZFCP_LOG_TRACE("no failure or Task Management "
"Function complete\n");
set_host_byte(&scpnt->result, DID_OK); set_host_byte(&scpnt->result, DID_OK);
break; break;
case RSP_CODE_LENGTH_MISMATCH: case RSP_CODE_LENGTH_MISMATCH:
/* hardware bug */ /* hardware bug */
ZFCP_LOG_NORMAL("bug: FCP response code indictates "
"that the fibrechannel protocol data "
"length differs from the burst length. "
"The problem occured on unit 0x%016Lx "
"on port 0x%016Lx on adapter %s",
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
/* dump SCSI CDB as prepared by zfcp */
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
(char *) &fsf_req->qtcb->
bottom.io.fcp_cmnd, FSF_FCP_CMND_SIZE);
set_host_byte(&scpnt->result, DID_ERROR); set_host_byte(&scpnt->result, DID_ERROR);
goto skip_fsfstatus; goto skip_fsfstatus;
case RSP_CODE_FIELD_INVALID: case RSP_CODE_FIELD_INVALID:
/* driver or hardware bug */ /* driver or hardware bug */
ZFCP_LOG_NORMAL("bug: FCP response code indictates "
"that the fibrechannel protocol data "
"fields were incorrectly set up. "
"The problem occured on the unit "
"0x%016Lx on port 0x%016Lx on "
"adapter %s",
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
/* dump SCSI CDB as prepared by zfcp */
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
(char *) &fsf_req->qtcb->
bottom.io.fcp_cmnd, FSF_FCP_CMND_SIZE);
set_host_byte(&scpnt->result, DID_ERROR); set_host_byte(&scpnt->result, DID_ERROR);
goto skip_fsfstatus; goto skip_fsfstatus;
case RSP_CODE_RO_MISMATCH: case RSP_CODE_RO_MISMATCH:
/* hardware bug */ /* hardware bug */
ZFCP_LOG_NORMAL("bug: The FCP response code indicates "
"that conflicting values for the "
"fibrechannel payload offset from the "
"header were found. "
"The problem occured on unit 0x%016Lx "
"on port 0x%016Lx on adapter %s.\n",
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
/* dump SCSI CDB as prepared by zfcp */
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
(char *) &fsf_req->qtcb->
bottom.io.fcp_cmnd, FSF_FCP_CMND_SIZE);
set_host_byte(&scpnt->result, DID_ERROR); set_host_byte(&scpnt->result, DID_ERROR);
goto skip_fsfstatus; goto skip_fsfstatus;
default: default:
ZFCP_LOG_NORMAL("bug: An invalid FCP response " /* invalid FCP response code */
"code was detected for a command. "
"The problem occured on the unit "
"0x%016Lx on port 0x%016Lx on "
"adapter %s (debug info 0x%x)\n",
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit),
fcp_rsp_info[3]);
/* dump SCSI CDB as prepared by zfcp */
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
(char *) &fsf_req->qtcb->
bottom.io.fcp_cmnd, FSF_FCP_CMND_SIZE);
set_host_byte(&scpnt->result, DID_ERROR); set_host_byte(&scpnt->result, DID_ERROR);
goto skip_fsfstatus; goto skip_fsfstatus;
} }
...@@ -4020,50 +3089,15 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req) ...@@ -4020,50 +3089,15 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
if (unlikely(fcp_rsp_iu->validity.bits.fcp_sns_len_valid)) { if (unlikely(fcp_rsp_iu->validity.bits.fcp_sns_len_valid)) {
sns_len = FSF_FCP_RSP_SIZE - sns_len = FSF_FCP_RSP_SIZE -
sizeof (struct fcp_rsp_iu) + fcp_rsp_iu->fcp_rsp_len; sizeof (struct fcp_rsp_iu) + fcp_rsp_iu->fcp_rsp_len;
ZFCP_LOG_TRACE("room for %i bytes sense data in QTCB\n",
sns_len);
sns_len = min(sns_len, (u32) SCSI_SENSE_BUFFERSIZE); sns_len = min(sns_len, (u32) SCSI_SENSE_BUFFERSIZE);
ZFCP_LOG_TRACE("room for %i bytes sense data in SCSI command\n",
SCSI_SENSE_BUFFERSIZE);
sns_len = min(sns_len, fcp_rsp_iu->fcp_sns_len); sns_len = min(sns_len, fcp_rsp_iu->fcp_sns_len);
ZFCP_LOG_TRACE("scpnt->result =0x%x, command was:\n",
scpnt->result);
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE,
scpnt->cmnd, scpnt->cmd_len);
ZFCP_LOG_TRACE("%i bytes sense data provided by FCP\n",
fcp_rsp_iu->fcp_sns_len);
memcpy(scpnt->sense_buffer, memcpy(scpnt->sense_buffer,
zfcp_get_fcp_sns_info_ptr(fcp_rsp_iu), sns_len); zfcp_get_fcp_sns_info_ptr(fcp_rsp_iu), sns_len);
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE,
(void *)scpnt->sense_buffer, sns_len);
}
/* check for overrun */
if (unlikely(fcp_rsp_iu->validity.bits.fcp_resid_over)) {
ZFCP_LOG_INFO("A data overrun was detected for a command. "
"unit 0x%016Lx, port 0x%016Lx, adapter %s. "
"The response data length is "
"%d, the original length was %d.\n",
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit),
fcp_rsp_iu->fcp_resid,
(int) zfcp_get_fcp_dl(fcp_cmnd_iu));
} }
/* check for underrun */ /* check for underrun */
if (unlikely(fcp_rsp_iu->validity.bits.fcp_resid_under)) { if (unlikely(fcp_rsp_iu->validity.bits.fcp_resid_under)) {
ZFCP_LOG_INFO("A data underrun was detected for a command. "
"unit 0x%016Lx, port 0x%016Lx, adapter %s. "
"The response data length is "
"%d, the original length was %d.\n",
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit),
fcp_rsp_iu->fcp_resid,
(int) zfcp_get_fcp_dl(fcp_cmnd_iu));
scsi_set_resid(scpnt, fcp_rsp_iu->fcp_resid); scsi_set_resid(scpnt, fcp_rsp_iu->fcp_resid);
if (scsi_bufflen(scpnt) - scsi_get_resid(scpnt) < if (scsi_bufflen(scpnt) - scsi_get_resid(scpnt) <
scpnt->underflow) scpnt->underflow)
...@@ -4071,8 +3105,6 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req) ...@@ -4071,8 +3105,6 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
} }
skip_fsfstatus: skip_fsfstatus:
ZFCP_LOG_DEBUG("scpnt->result =0x%x\n", scpnt->result);
if (scpnt->result != 0) if (scpnt->result != 0)
zfcp_scsi_dbf_event_result("erro", 3, fsf_req->adapter, scpnt, fsf_req); zfcp_scsi_dbf_event_result("erro", 3, fsf_req->adapter, scpnt, fsf_req);
else if (scpnt->retries > 0) else if (scpnt->retries > 0)
...@@ -4111,7 +3143,6 @@ zfcp_fsf_send_fcp_command_task_management_handler(struct zfcp_fsf_req *fsf_req) ...@@ -4111,7 +3143,6 @@ zfcp_fsf_send_fcp_command_task_management_handler(struct zfcp_fsf_req *fsf_req)
struct fcp_rsp_iu *fcp_rsp_iu = (struct fcp_rsp_iu *) struct fcp_rsp_iu *fcp_rsp_iu = (struct fcp_rsp_iu *)
&(fsf_req->qtcb->bottom.io.fcp_rsp); &(fsf_req->qtcb->bottom.io.fcp_rsp);
char *fcp_rsp_info = zfcp_get_fcp_rsp_info_ptr(fcp_rsp_iu); char *fcp_rsp_info = zfcp_get_fcp_rsp_info_ptr(fcp_rsp_iu);
struct zfcp_unit *unit = (struct zfcp_unit *) fsf_req->data;
if (fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR) { if (fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR) {
fsf_req->status |= ZFCP_STATUS_FSFREQ_TMFUNCFAILED; fsf_req->status |= ZFCP_STATUS_FSFREQ_TMFUNCFAILED;
...@@ -4122,36 +3153,15 @@ zfcp_fsf_send_fcp_command_task_management_handler(struct zfcp_fsf_req *fsf_req) ...@@ -4122,36 +3153,15 @@ zfcp_fsf_send_fcp_command_task_management_handler(struct zfcp_fsf_req *fsf_req)
switch (fcp_rsp_info[3]) { switch (fcp_rsp_info[3]) {
case RSP_CODE_GOOD: case RSP_CODE_GOOD:
/* ok, continue */ /* ok, continue */
ZFCP_LOG_DEBUG("no failure or Task Management "
"Function complete\n");
break; break;
case RSP_CODE_TASKMAN_UNSUPP: case RSP_CODE_TASKMAN_UNSUPP:
ZFCP_LOG_NORMAL("bug: A reuested task management function "
"is not supported on the target device "
"unit 0x%016Lx, port 0x%016Lx, adapter %s\n ",
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
fsf_req->status |= ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP; fsf_req->status |= ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP;
break; break;
case RSP_CODE_TASKMAN_FAILED: case RSP_CODE_TASKMAN_FAILED:
ZFCP_LOG_NORMAL("bug: A reuested task management function "
"failed to complete successfully. "
"unit 0x%016Lx, port 0x%016Lx, adapter %s.\n",
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
fsf_req->status |= ZFCP_STATUS_FSFREQ_TMFUNCFAILED; fsf_req->status |= ZFCP_STATUS_FSFREQ_TMFUNCFAILED;
break; break;
default: default:
ZFCP_LOG_NORMAL("bug: An invalid FCP response " /* invalid FCP response code */
"code was detected for a command. "
"unit 0x%016Lx, port 0x%016Lx, adapter %s "
"(debug info 0x%x)\n",
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit),
fcp_rsp_info[3]);
fsf_req->status |= ZFCP_STATUS_FSFREQ_TMFUNCFAILED; fsf_req->status |= ZFCP_STATUS_FSFREQ_TMFUNCFAILED;
} }
...@@ -4332,9 +3342,7 @@ zfcp_fsf_req_create(struct zfcp_adapter *adapter, u32 fsf_cmd, int req_flags, ...@@ -4332,9 +3342,7 @@ zfcp_fsf_req_create(struct zfcp_adapter *adapter, u32 fsf_cmd, int req_flags,
/* allocate new FSF request */ /* allocate new FSF request */
fsf_req = zfcp_fsf_req_alloc(pool, req_flags); fsf_req = zfcp_fsf_req_alloc(pool, req_flags);
if (unlikely(NULL == fsf_req)) { if (unlikely(!fsf_req)) {
ZFCP_LOG_DEBUG("error: Could not put an FSF request into "
"the outbound (send) queue.\n");
ret = -ENOMEM; ret = -ENOMEM;
goto failed_fsf_req; goto failed_fsf_req;
} }
...@@ -4393,9 +3401,6 @@ zfcp_fsf_req_create(struct zfcp_adapter *adapter, u32 fsf_cmd, int req_flags, ...@@ -4393,9 +3401,6 @@ zfcp_fsf_req_create(struct zfcp_adapter *adapter, u32 fsf_cmd, int req_flags,
sbale[1].length = sizeof(struct fsf_qtcb); sbale[1].length = sizeof(struct fsf_qtcb);
} }
ZFCP_LOG_TRACE("got %i free BUFFERs starting at index %i\n",
fsf_req->sbal_number, fsf_req->sbal_first);
goto success; goto success;
failed_sbals: failed_sbals:
...@@ -4429,13 +3434,7 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req) ...@@ -4429,13 +3434,7 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req)
adapter = fsf_req->adapter; adapter = fsf_req->adapter;
req_q = &adapter->req_q; req_q = &adapter->req_q;
/* FIXME(debug): remove it later */
sbale = zfcp_qdio_sbale_req(fsf_req); sbale = zfcp_qdio_sbale_req(fsf_req);
ZFCP_LOG_DEBUG("SBALE0 flags=0x%x\n", sbale[0].flags);
ZFCP_LOG_TRACE("HEX DUMP OF SBALE1 PAYLOAD:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE, (char *) sbale[1].addr,
sbale[1].length);
/* put allocated FSF request into hash table */ /* put allocated FSF request into hash table */
spin_lock(&adapter->req_list_lock); spin_lock(&adapter->req_list_lock);
...@@ -4476,5 +3475,3 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req) ...@@ -4476,5 +3475,3 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req)
} }
return retval; return retval;
} }
#undef ZFCP_LOG_AREA
/* /*
* This file is part of the zfcp device driver for * zfcp device driver
* FCP adapters for IBM System z9 and zSeries.
* *
* (C) Copyright IBM Corp. 2002, 2006 * Interface to the FSF support functions.
* *
* This program is free software; you can redistribute it and/or modify * Copyright IBM Corporation 2002, 2008
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#ifndef FSF_H #ifndef FSF_H
...@@ -342,6 +329,7 @@ struct fsf_qual_latency_info { ...@@ -342,6 +329,7 @@ struct fsf_qual_latency_info {
} __attribute__ ((packed)); } __attribute__ ((packed));
union fsf_prot_status_qual { union fsf_prot_status_qual {
u32 word[FSF_PROT_STATUS_QUAL_SIZE / sizeof(u32)];
u64 doubleword[FSF_PROT_STATUS_QUAL_SIZE / sizeof(u64)]; u64 doubleword[FSF_PROT_STATUS_QUAL_SIZE / sizeof(u64)];
struct fsf_qual_version_error version_error; struct fsf_qual_version_error version_error;
struct fsf_qual_sequence_error sequence_error; struct fsf_qual_sequence_error sequence_error;
......
/* /*
* This file is part of the zfcp device driver for * zfcp device driver
* FCP adapters for IBM System z9 and zSeries.
* *
* (C) Copyright IBM Corp. 2002, 2006 * Interface to Linux SCSI midlayer.
* *
* This program is free software; you can redistribute it and/or modify * Copyright IBM Corporation 2002, 2008
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_SCSI
#include "zfcp_ext.h" #include "zfcp_ext.h"
#include <asm/atomic.h> #include <asm/atomic.h>
...@@ -44,7 +29,7 @@ static struct device_attribute *zfcp_a_stats_attrs[]; ...@@ -44,7 +29,7 @@ static struct device_attribute *zfcp_a_stats_attrs[];
struct zfcp_data zfcp_data = { struct zfcp_data zfcp_data = {
.scsi_host_template = { .scsi_host_template = {
.name = ZFCP_NAME, .name = "zfcp",
.module = THIS_MODULE, .module = THIS_MODULE,
.proc_name = "zfcp", .proc_name = "zfcp",
.slave_alloc = zfcp_scsi_slave_alloc, .slave_alloc = zfcp_scsi_slave_alloc,
...@@ -64,7 +49,6 @@ struct zfcp_data zfcp_data = { ...@@ -64,7 +49,6 @@ struct zfcp_data zfcp_data = {
.max_sectors = ZFCP_MAX_SECTORS, .max_sectors = ZFCP_MAX_SECTORS,
.shost_attrs = zfcp_a_stats_attrs, .shost_attrs = zfcp_a_stats_attrs,
}, },
.driver_version = ZFCP_VERSION,
}; };
/* Find start of Response Information in FCP response unit*/ /* Find start of Response Information in FCP response unit*/
...@@ -181,16 +165,14 @@ zfcp_scsi_slave_alloc(struct scsi_device *sdp) ...@@ -181,16 +165,14 @@ zfcp_scsi_slave_alloc(struct scsi_device *sdp)
static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt)
{ {
struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata;
WARN_ON(!unit);
if (unit) { if (unit) {
atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status); atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status);
sdpnt->hostdata = NULL; sdpnt->hostdata = NULL;
unit->device = NULL; unit->device = NULL;
zfcp_erp_unit_failed(unit, 12, NULL); zfcp_erp_unit_failed(unit, 12, NULL);
zfcp_unit_put(unit); zfcp_unit_put(unit);
} else }
ZFCP_LOG_NORMAL("bug: no unit associated with SCSI device at "
"address %p\n", sdpnt);
} }
/* /*
...@@ -253,10 +235,6 @@ zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit, ...@@ -253,10 +235,6 @@ zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit,
if (unlikely( if (unlikely(
atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &unit->status) || atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &unit->status) ||
!atomic_test_mask(ZFCP_STATUS_COMMON_RUNNING, &unit->status))) { !atomic_test_mask(ZFCP_STATUS_COMMON_RUNNING, &unit->status))) {
ZFCP_LOG_DEBUG("stopping SCSI I/O on unit 0x%016Lx on port "
"0x%016Lx on adapter %s\n",
unit->fcp_lun, unit->port->wwpn,
zfcp_get_busid_by_adapter(adapter));
zfcp_scsi_command_fail(scpnt, DID_ERROR); zfcp_scsi_command_fail(scpnt, DID_ERROR);
goto out; goto out;
} }
...@@ -264,18 +242,12 @@ zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit, ...@@ -264,18 +242,12 @@ zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit,
tmp = zfcp_fsf_send_fcp_command_task(adapter, unit, scpnt, use_timer, tmp = zfcp_fsf_send_fcp_command_task(adapter, unit, scpnt, use_timer,
ZFCP_REQ_AUTO_CLEANUP); ZFCP_REQ_AUTO_CLEANUP);
if (unlikely(tmp == -EBUSY)) { if (unlikely(tmp == -EBUSY)) {
ZFCP_LOG_DEBUG("adapter %s not ready or unit 0x%016Lx "
"on port 0x%016Lx in recovery\n",
zfcp_get_busid_by_unit(unit),
unit->fcp_lun, unit->port->wwpn);
zfcp_scsi_command_fail(scpnt, DID_NO_CONNECT); zfcp_scsi_command_fail(scpnt, DID_NO_CONNECT);
goto out; goto out;
} }
if (unlikely(tmp < 0)) { if (unlikely(tmp < 0))
ZFCP_LOG_DEBUG("error: initiation of Send FCP Cmnd failed\n");
retval = SCSI_MLQUEUE_HOST_BUSY; retval = SCSI_MLQUEUE_HOST_BUSY;
}
out: out:
return retval; return retval;
...@@ -394,9 +366,6 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) ...@@ -394,9 +366,6 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
adapter = (struct zfcp_adapter *) scsi_host->hostdata[0]; adapter = (struct zfcp_adapter *) scsi_host->hostdata[0];
unit = (struct zfcp_unit *) scpnt->device->hostdata; unit = (struct zfcp_unit *) scpnt->device->hostdata;
ZFCP_LOG_INFO("aborting scsi_cmnd=%p on adapter %s\n",
scpnt, zfcp_get_busid_by_adapter(adapter));
/* avoid race condition between late normal completion and abort */ /* avoid race condition between late normal completion and abort */
write_lock_irqsave(&adapter->abort_lock, flags); write_lock_irqsave(&adapter->abort_lock, flags);
...@@ -420,7 +389,6 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) ...@@ -420,7 +389,6 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
fsf_req = zfcp_fsf_abort_fcp_command(old_req_id, adapter, unit, 0); fsf_req = zfcp_fsf_abort_fcp_command(old_req_id, adapter, unit, 0);
if (!fsf_req) { if (!fsf_req) {
ZFCP_LOG_INFO("error: initiation of Abort FCP Cmnd failed\n");
zfcp_scsi_dbf_event_abort("nres", adapter, scpnt, NULL, zfcp_scsi_dbf_event_abort("nres", adapter, scpnt, NULL,
old_req_id); old_req_id);
retval = FAILED; retval = FAILED;
...@@ -485,10 +453,6 @@ zfcp_task_management_function(struct zfcp_unit *unit, u8 tm_flags, ...@@ -485,10 +453,6 @@ zfcp_task_management_function(struct zfcp_unit *unit, u8 tm_flags,
fsf_req = zfcp_fsf_send_fcp_command_task_management fsf_req = zfcp_fsf_send_fcp_command_task_management
(adapter, unit, tm_flags, 0); (adapter, unit, tm_flags, 0);
if (!fsf_req) { if (!fsf_req) {
ZFCP_LOG_INFO("error: creation of task management request "
"failed for unit 0x%016Lx on port 0x%016Lx on "
"adapter %s\n", unit->fcp_lun, unit->port->wwpn,
zfcp_get_busid_by_adapter(adapter));
zfcp_scsi_dbf_event_devreset("nres", tm_flags, unit, scpnt); zfcp_scsi_dbf_event_devreset("nres", tm_flags, unit, scpnt);
retval = -ENOMEM; retval = -ENOMEM;
goto out; goto out;
...@@ -524,12 +488,6 @@ static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt) ...@@ -524,12 +488,6 @@ static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt)
unit = (struct zfcp_unit*) scpnt->device->hostdata; unit = (struct zfcp_unit*) scpnt->device->hostdata;
adapter = unit->port->adapter; adapter = unit->port->adapter;
ZFCP_LOG_NORMAL("host reset because of problems with "
"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, 141, scpnt); zfcp_erp_adapter_reopen(adapter, 0, 141, scpnt);
zfcp_erp_wait(adapter); zfcp_erp_wait(adapter);
...@@ -549,13 +507,11 @@ zfcp_adapter_scsi_register(struct zfcp_adapter *adapter) ...@@ -549,13 +507,11 @@ zfcp_adapter_scsi_register(struct zfcp_adapter *adapter)
adapter->scsi_host = scsi_host_alloc(&zfcp_data.scsi_host_template, adapter->scsi_host = scsi_host_alloc(&zfcp_data.scsi_host_template,
sizeof (struct zfcp_adapter *)); sizeof (struct zfcp_adapter *));
if (!adapter->scsi_host) { if (!adapter->scsi_host) {
ZFCP_LOG_NORMAL("error: registration with SCSI stack failed " dev_err(&adapter->ccw_device->dev,
"for adapter %s ", "registration with SCSI stack failed.");
zfcp_get_busid_by_adapter(adapter));
retval = -EIO; retval = -EIO;
goto out; goto out;
} }
ZFCP_LOG_DEBUG("host registered, scsi_host=%p\n", adapter->scsi_host);
/* tell the SCSI stack some characteristics of this adapter */ /* tell the SCSI stack some characteristics of this adapter */
adapter->scsi_host->max_id = 1; adapter->scsi_host->max_id = 1;
...@@ -987,5 +943,3 @@ static struct device_attribute *zfcp_a_stats_attrs[] = { ...@@ -987,5 +943,3 @@ static struct device_attribute *zfcp_a_stats_attrs[] = {
&dev_attr_seconds_active, &dev_attr_seconds_active,
NULL NULL
}; };
#undef ZFCP_LOG_AREA
/* /*
* This file is part of the zfcp device driver for * zfcp device driver
* FCP adapters for IBM System z9 and zSeries.
* *
* (C) Copyright IBM Corp. 2002, 2006 * sysfs attributes for CCW device.
* *
* This program is free software; you can redistribute it and/or modify * Copyright IBM Corporation 2002, 2008
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include "zfcp_ext.h" #include "zfcp_ext.h"
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG
/** /**
* ZFCP_DEFINE_ADAPTER_ATTR * ZFCP_DEFINE_ADAPTER_ATTR
* @_name: name of show attribute * @_name: name of show attribute
...@@ -266,5 +251,3 @@ zfcp_sysfs_adapter_remove_files(struct device *dev) ...@@ -266,5 +251,3 @@ zfcp_sysfs_adapter_remove_files(struct device *dev)
{ {
sysfs_remove_group(&dev->kobj, &zfcp_adapter_attr_group); sysfs_remove_group(&dev->kobj, &zfcp_adapter_attr_group);
} }
#undef ZFCP_LOG_AREA
/*
* This file is part of the zfcp device driver for
* FCP adapters for IBM System z9 and zSeries.
*
* (C) Copyright IBM Corp. 2002, 2006
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "zfcp_ext.h"
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG
/**
* ZFCP_DEFINE_DRIVER_ATTR - define for all loglevels sysfs attributes
* @_name: name of attribute
* @_define: name of ZFCP loglevel define
*
* Generates store function for a sysfs loglevel attribute of zfcp driver.
*/
#define ZFCP_DEFINE_DRIVER_ATTR(_name, _define) \
static ssize_t zfcp_sysfs_loglevel_##_name##_store(struct device_driver *drv, \
const char *buf, \
size_t count) \
{ \
unsigned int loglevel; \
unsigned int new_loglevel; \
char *endp; \
\
new_loglevel = simple_strtoul(buf, &endp, 0); \
if ((endp + 1) < (buf + count)) \
return -EINVAL; \
if (new_loglevel > 3) \
return -EINVAL; \
down(&zfcp_data.config_sema); \
loglevel = atomic_read(&zfcp_data.loglevel); \
loglevel &= ~((unsigned int) 0xf << (ZFCP_LOG_AREA_##_define << 2)); \
loglevel |= new_loglevel << (ZFCP_LOG_AREA_##_define << 2); \
atomic_set(&zfcp_data.loglevel, loglevel); \
up(&zfcp_data.config_sema); \
return count; \
} \
\
static ssize_t zfcp_sysfs_loglevel_##_name##_show(struct device_driver *dev, \
char *buf) \
{ \
return sprintf(buf,"%d\n", (unsigned int) \
ZFCP_GET_LOG_VALUE(ZFCP_LOG_AREA_##_define)); \
} \
\
static DRIVER_ATTR(loglevel_##_name, S_IWUSR | S_IRUGO, \
zfcp_sysfs_loglevel_##_name##_show, \
zfcp_sysfs_loglevel_##_name##_store);
ZFCP_DEFINE_DRIVER_ATTR(other, OTHER);
ZFCP_DEFINE_DRIVER_ATTR(scsi, SCSI);
ZFCP_DEFINE_DRIVER_ATTR(fsf, FSF);
ZFCP_DEFINE_DRIVER_ATTR(config, CONFIG);
ZFCP_DEFINE_DRIVER_ATTR(cio, CIO);
ZFCP_DEFINE_DRIVER_ATTR(qdio, QDIO);
ZFCP_DEFINE_DRIVER_ATTR(erp, ERP);
ZFCP_DEFINE_DRIVER_ATTR(fc, FC);
static ssize_t zfcp_sysfs_version_show(struct device_driver *dev,
char *buf)
{
return sprintf(buf, "%s\n", zfcp_data.driver_version);
}
static DRIVER_ATTR(version, S_IRUGO, zfcp_sysfs_version_show, NULL);
static struct attribute *zfcp_driver_attrs[] = {
&driver_attr_loglevel_other.attr,
&driver_attr_loglevel_scsi.attr,
&driver_attr_loglevel_fsf.attr,
&driver_attr_loglevel_config.attr,
&driver_attr_loglevel_cio.attr,
&driver_attr_loglevel_qdio.attr,
&driver_attr_loglevel_erp.attr,
&driver_attr_loglevel_fc.attr,
&driver_attr_version.attr,
NULL
};
static struct attribute_group zfcp_driver_attr_group = {
.attrs = zfcp_driver_attrs,
};
struct attribute_group *zfcp_driver_attr_groups[] = {
&zfcp_driver_attr_group,
NULL,
};
#undef ZFCP_LOG_AREA
/* /*
* This file is part of the zfcp device driver for * zfcp device driver
* FCP adapters for IBM System z9 and zSeries.
* *
* (C) Copyright IBM Corp. 2002, 2006 * sysfs attributes for zfcp port.
* *
* This program is free software; you can redistribute it and/or modify * Copyright IBM Corporation 2002, 2008
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include "zfcp_ext.h" #include "zfcp_ext.h"
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG
/** /**
* zfcp_sysfs_port_release - gets called when a struct device port is released * zfcp_sysfs_port_release - gets called when a struct device port is released
* @dev: pointer to belonging device * @dev: pointer to belonging device
...@@ -291,5 +276,3 @@ zfcp_sysfs_port_remove_files(struct device *dev, u32 flags) ...@@ -291,5 +276,3 @@ zfcp_sysfs_port_remove_files(struct device *dev, u32 flags)
if (!(flags & ZFCP_STATUS_PORT_WKA)) if (!(flags & ZFCP_STATUS_PORT_WKA))
sysfs_remove_group(&dev->kobj, &zfcp_port_no_ns_attr_group); sysfs_remove_group(&dev->kobj, &zfcp_port_no_ns_attr_group);
} }
#undef ZFCP_LOG_AREA
/* /*
* This file is part of the zfcp device driver for * zfcp device driver
* FCP adapters for IBM System z9 and zSeries.
* *
* (C) Copyright IBM Corp. 2002, 2006 * sysfs interface for zfcp unit.
* *
* This program is free software; you can redistribute it and/or modify * Copyright IBM Corporation 2002, 2008
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include "zfcp_ext.h" #include "zfcp_ext.h"
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG
/** /**
* zfcp_sysfs_unit_release - gets called when a struct device unit is released * zfcp_sysfs_unit_release - gets called when a struct device unit is released
* @dev: pointer to belonging device * @dev: pointer to belonging device
...@@ -163,5 +148,3 @@ zfcp_sysfs_unit_remove_files(struct device *dev) ...@@ -163,5 +148,3 @@ zfcp_sysfs_unit_remove_files(struct device *dev)
{ {
sysfs_remove_group(&dev->kobj, &zfcp_unit_attr_group); sysfs_remove_group(&dev->kobj, &zfcp_unit_attr_group);
} }
#undef ZFCP_LOG_AREA
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment