diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2004-08-07 00:55:48 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-08-07 00:55:48 -0700 |
commit | 618310db8336eb88626746fa148566d364ca6ddb (patch) | |
tree | 493df1923dd3edec31e92dfaeb643c12d9cd2446 /drivers | |
parent | 61ebd8107356084cdb407b3f0790b050812c4c7b (diff) | |
download | history-618310db8336eb88626746fa148566d364ca6ddb.tar.gz |
[PATCH] s390: zfcp host adapater.
From: Heiko Carstens <heiko.carstens@de.ibm.com>
From: Andreas Herrmann <aherrman@de.ibm.com>
zfcp host adapater change:
- Fix call to close_physical_port to prevent devices going offline
after error recovery.
- Fix return value of sysfs port_remove attribute store function.
- Replace reboot notifier with device driver shutdown function.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 25 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_ccw.c | 21 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_def.h | 8 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 8 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_sysfs_port.c | 8 |
5 files changed, 36 insertions, 34 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 939bbad0f54913..dad02890ef01e8 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -29,7 +29,7 @@ */ /* this drivers version (do not edit !!! generated and updated by cvs) */ -#define ZFCP_AUX_REVISION "$Revision: 1.114 $" +#define ZFCP_AUX_REVISION "$Revision: 1.115 $" #include "zfcp_ext.h" @@ -41,8 +41,6 @@ static char *device; /* written against the module interface */ static int __init zfcp_module_init(void); -int zfcp_reboot_handler(struct notifier_block *, unsigned long, void *); - /* FCP related */ static void zfcp_ns_gid_pn_handler(unsigned long); @@ -338,9 +336,6 @@ zfcp_module_init(void) /* initialise configuration rw lock */ rwlock_init(&zfcp_data.config_lock); - zfcp_data.reboot_notifier.notifier_call = zfcp_reboot_handler; - register_reboot_notifier(&zfcp_data.reboot_notifier); - /* save address of data structure managing the driver module */ zfcp_data.scsi_host_template.module = THIS_MODULE; @@ -357,7 +352,6 @@ zfcp_module_init(void) goto out; out_ccw_register: - unregister_reboot_notifier(&zfcp_data.reboot_notifier); misc_deregister(&zfcp_cfdc_misc); out_misc_register: #ifdef CONFIG_S390_SUPPORT @@ -370,23 +364,6 @@ zfcp_module_init(void) } /* - * This function is called automatically by the kernel whenever a reboot or a - * shut-down is initiated and zfcp is still loaded - * - * locks: zfcp_data.config_sema is taken prior to shutting down the module - * and removing all structures - * returns: NOTIFY_DONE in all cases - */ -int -zfcp_reboot_handler(struct notifier_block *notifier, unsigned long code, - void *ptr) -{ - zfcp_ccw_unregister(); - return NOTIFY_DONE; -} - - -/* * function: zfcp_cfdc_dev_ioctl * * purpose: Handle control file upload/download transaction via IOCTL diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index 84a5e37e7026e4..001d8067ca9590 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c @@ -26,7 +26,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define ZFCP_CCW_C_REVISION "$Revision: 1.55 $" +#define ZFCP_CCW_C_REVISION "$Revision: 1.56 $" #include "zfcp_ext.h" @@ -37,6 +37,7 @@ static void zfcp_ccw_remove(struct ccw_device *); static int zfcp_ccw_set_online(struct ccw_device *); static int zfcp_ccw_set_offline(struct ccw_device *); static int zfcp_ccw_notify(struct ccw_device *, int); +static void zfcp_ccw_shutdown(struct device *); static struct ccw_device_id zfcp_ccw_device_id[] = { {CCW_DEVICE_DEVTYPE(ZFCP_CONTROL_UNIT_TYPE, @@ -59,6 +60,9 @@ static struct ccw_driver zfcp_ccw_driver = { .set_online = zfcp_ccw_set_online, .set_offline = zfcp_ccw_set_offline, .notify = zfcp_ccw_notify, + .driver = { + .shutdown = zfcp_ccw_shutdown, + }, }; MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id); @@ -287,4 +291,19 @@ zfcp_ccw_unregister(void) ccw_driver_unregister(&zfcp_ccw_driver); } +/** + * zfcp_ccw_shutdown - gets called on reboot/shutdown + * + * Makes sure that QDIO queues are down when the system gets stopped. + */ +static void +zfcp_ccw_shutdown(struct device *dev) +{ + struct zfcp_adapter *adapter; + + adapter = dev_get_drvdata(dev); + zfcp_erp_adapter_shutdown(adapter, 0); + zfcp_erp_wait(adapter); +} + #undef ZFCP_LOG_AREA diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index eb65b928825e68..dda20bf004062b 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h @@ -33,7 +33,7 @@ #define ZFCP_DEF_H /* this drivers version (do not edit !!! generated and updated by cvs) */ -#define ZFCP_DEF_REVISION "$Revision: 1.78 $" +#define ZFCP_DEF_REVISION "$Revision: 1.81 $" /*************************** INCLUDES *****************************************/ @@ -42,6 +42,7 @@ #include <linux/miscdevice.h> #include <linux/major.h> #include <linux/blkdev.h> +#include <linux/delay.h> #include <scsi/scsi.h> #include <scsi/scsi_tcq.h> #include <scsi/scsi_cmnd.h> @@ -55,7 +56,6 @@ #include <asm/qdio.h> #include <asm/debug.h> #include <asm/ebcdic.h> -#include <linux/reboot.h> #include <linux/mempool.h> #include <linux/syscalls.h> #include <linux/ioctl.h> @@ -70,7 +70,7 @@ /********************* GENERAL DEFINES *********************************/ /* zfcp version number, it consists of major, minor, and patch-level number */ -#define ZFCP_VERSION "4.0.0" +#define ZFCP_VERSION "4.1.3" static inline void * zfcp_sg_to_address(struct scatterlist *list) @@ -1074,8 +1074,6 @@ struct zfcp_data { lists */ struct semaphore config_sema; /* serialises configuration changes */ - struct notifier_block reboot_notifier; /* used to register cleanup - functions */ atomic_t loglevel; /* current loglevel */ char init_busid[BUS_ID_SIZE]; wwn_t init_wwpn; diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 06de21a98e4653..79451af65f5e05 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -29,7 +29,7 @@ */ /* this drivers version (do not edit !!! generated and updated by cvs) */ -#define ZFCP_FSF_C_REVISION "$Revision: 1.53 $" +#define ZFCP_FSF_C_REVISION "$Revision: 1.55 $" #include "zfcp_ext.h" @@ -2619,6 +2619,7 @@ zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) { int retval = 0; unsigned long lock_flags; + volatile struct qdio_buffer_element *sbale; /* setup new FSF request */ retval = zfcp_fsf_req_create(erp_action->adapter, @@ -2635,6 +2636,11 @@ zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) goto out; } + sbale = zfcp_qdio_sbale_req(erp_action->fsf_req, + erp_action->fsf_req->sbal_curr, 0); + sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; + sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; + /* mark port as being closed */ atomic_set_mask(ZFCP_STATUS_PORT_PHYS_CLOSING, &erp_action->port->status); diff --git a/drivers/s390/scsi/zfcp_sysfs_port.c b/drivers/s390/scsi/zfcp_sysfs_port.c index e0ace9349c7058..11a27c1ff32ab7 100644 --- a/drivers/s390/scsi/zfcp_sysfs_port.c +++ b/drivers/s390/scsi/zfcp_sysfs_port.c @@ -26,7 +26,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define ZFCP_SYSFS_PORT_C_REVISION "$Revision: 1.40 $" +#define ZFCP_SYSFS_PORT_C_REVISION "$Revision: 1.41 $" #include "zfcp_ext.h" @@ -125,7 +125,7 @@ zfcp_sysfs_unit_remove_store(struct device *dev, const char *buf, size_t count) struct zfcp_unit *unit; fcp_lun_t fcp_lun; char *endp; - int retval = -EINVAL; + int retval = 0; down(&zfcp_data.config_sema); @@ -136,8 +136,10 @@ zfcp_sysfs_unit_remove_store(struct device *dev, const char *buf, size_t count) } fcp_lun = simple_strtoull(buf, &endp, 0); - if ((endp + 1) < (buf + count)) + if ((endp + 1) < (buf + count)) { + retval = -EINVAL; goto out; + } write_lock_irq(&zfcp_data.config_lock); unit = zfcp_get_unit_by_lun(port, fcp_lun); |