Commit 618310db authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Linus Torvalds

[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: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 61ebd810
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
*/ */
/* this drivers version (do not edit !!! generated and updated by cvs) */ /* 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" #include "zfcp_ext.h"
...@@ -41,8 +41,6 @@ static char *device; ...@@ -41,8 +41,6 @@ static char *device;
/* written against the module interface */ /* written against the module interface */
static int __init zfcp_module_init(void); static int __init zfcp_module_init(void);
int zfcp_reboot_handler(struct notifier_block *, unsigned long, void *);
/* FCP related */ /* FCP related */
static void zfcp_ns_gid_pn_handler(unsigned long); static void zfcp_ns_gid_pn_handler(unsigned long);
...@@ -338,9 +336,6 @@ zfcp_module_init(void) ...@@ -338,9 +336,6 @@ zfcp_module_init(void)
/* initialise configuration rw lock */ /* initialise configuration rw lock */
rwlock_init(&zfcp_data.config_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 */ /* save address of data structure managing the driver module */
zfcp_data.scsi_host_template.module = THIS_MODULE; zfcp_data.scsi_host_template.module = THIS_MODULE;
...@@ -357,7 +352,6 @@ zfcp_module_init(void) ...@@ -357,7 +352,6 @@ zfcp_module_init(void)
goto out; goto out;
out_ccw_register: out_ccw_register:
unregister_reboot_notifier(&zfcp_data.reboot_notifier);
misc_deregister(&zfcp_cfdc_misc); misc_deregister(&zfcp_cfdc_misc);
out_misc_register: out_misc_register:
#ifdef CONFIG_S390_SUPPORT #ifdef CONFIG_S390_SUPPORT
...@@ -369,23 +363,6 @@ zfcp_module_init(void) ...@@ -369,23 +363,6 @@ zfcp_module_init(void)
return retval; return retval;
} }
/*
* 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 * function: zfcp_cfdc_dev_ioctl
* *
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 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" #include "zfcp_ext.h"
...@@ -37,6 +37,7 @@ static void zfcp_ccw_remove(struct ccw_device *); ...@@ -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_online(struct ccw_device *);
static int zfcp_ccw_set_offline(struct ccw_device *); static int zfcp_ccw_set_offline(struct ccw_device *);
static int zfcp_ccw_notify(struct ccw_device *, int); 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[] = { static struct ccw_device_id zfcp_ccw_device_id[] = {
{CCW_DEVICE_DEVTYPE(ZFCP_CONTROL_UNIT_TYPE, {CCW_DEVICE_DEVTYPE(ZFCP_CONTROL_UNIT_TYPE,
...@@ -59,6 +60,9 @@ static struct ccw_driver zfcp_ccw_driver = { ...@@ -59,6 +60,9 @@ static struct ccw_driver zfcp_ccw_driver = {
.set_online = zfcp_ccw_set_online, .set_online = zfcp_ccw_set_online,
.set_offline = zfcp_ccw_set_offline, .set_offline = zfcp_ccw_set_offline,
.notify = zfcp_ccw_notify, .notify = zfcp_ccw_notify,
.driver = {
.shutdown = zfcp_ccw_shutdown,
},
}; };
MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id); MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id);
...@@ -287,4 +291,19 @@ zfcp_ccw_unregister(void) ...@@ -287,4 +291,19 @@ zfcp_ccw_unregister(void)
ccw_driver_unregister(&zfcp_ccw_driver); 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 #undef ZFCP_LOG_AREA
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#define ZFCP_DEF_H #define ZFCP_DEF_H
/* this drivers version (do not edit !!! generated and updated by cvs) */ /* 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 *****************************************/ /*************************** INCLUDES *****************************************/
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/delay.h>
#include <scsi/scsi.h> #include <scsi/scsi.h>
#include <scsi/scsi_tcq.h> #include <scsi/scsi_tcq.h>
#include <scsi/scsi_cmnd.h> #include <scsi/scsi_cmnd.h>
...@@ -55,7 +56,6 @@ ...@@ -55,7 +56,6 @@
#include <asm/qdio.h> #include <asm/qdio.h>
#include <asm/debug.h> #include <asm/debug.h>
#include <asm/ebcdic.h> #include <asm/ebcdic.h>
#include <linux/reboot.h>
#include <linux/mempool.h> #include <linux/mempool.h>
#include <linux/syscalls.h> #include <linux/syscalls.h>
#include <linux/ioctl.h> #include <linux/ioctl.h>
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
/********************* GENERAL DEFINES *********************************/ /********************* GENERAL DEFINES *********************************/
/* zfcp version number, it consists of major, minor, and patch-level number */ /* 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 * static inline void *
zfcp_sg_to_address(struct scatterlist *list) zfcp_sg_to_address(struct scatterlist *list)
...@@ -1074,8 +1074,6 @@ struct zfcp_data { ...@@ -1074,8 +1074,6 @@ struct zfcp_data {
lists */ lists */
struct semaphore config_sema; /* serialises configuration struct semaphore config_sema; /* serialises configuration
changes */ changes */
struct notifier_block reboot_notifier; /* used to register cleanup
functions */
atomic_t loglevel; /* current loglevel */ atomic_t loglevel; /* current loglevel */
char init_busid[BUS_ID_SIZE]; char init_busid[BUS_ID_SIZE];
wwn_t init_wwpn; wwn_t init_wwpn;
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
*/ */
/* this drivers version (do not edit !!! generated and updated by cvs) */ /* 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" #include "zfcp_ext.h"
...@@ -2619,6 +2619,7 @@ zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) ...@@ -2619,6 +2619,7 @@ zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action)
{ {
int retval = 0; int retval = 0;
unsigned long lock_flags; unsigned long lock_flags;
volatile struct qdio_buffer_element *sbale;
/* setup new FSF request */ /* setup new FSF request */
retval = zfcp_fsf_req_create(erp_action->adapter, retval = zfcp_fsf_req_create(erp_action->adapter,
...@@ -2635,6 +2636,11 @@ zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) ...@@ -2635,6 +2636,11 @@ zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action)
goto out; 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 */ /* mark port as being closed */
atomic_set_mask(ZFCP_STATUS_PORT_PHYS_CLOSING, atomic_set_mask(ZFCP_STATUS_PORT_PHYS_CLOSING,
&erp_action->port->status); &erp_action->port->status);
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 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" #include "zfcp_ext.h"
...@@ -125,7 +125,7 @@ zfcp_sysfs_unit_remove_store(struct device *dev, const char *buf, size_t count) ...@@ -125,7 +125,7 @@ zfcp_sysfs_unit_remove_store(struct device *dev, const char *buf, size_t count)
struct zfcp_unit *unit; struct zfcp_unit *unit;
fcp_lun_t fcp_lun; fcp_lun_t fcp_lun;
char *endp; char *endp;
int retval = -EINVAL; int retval = 0;
down(&zfcp_data.config_sema); down(&zfcp_data.config_sema);
...@@ -136,8 +136,10 @@ zfcp_sysfs_unit_remove_store(struct device *dev, const char *buf, size_t count) ...@@ -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); fcp_lun = simple_strtoull(buf, &endp, 0);
if ((endp + 1) < (buf + count)) if ((endp + 1) < (buf + count)) {
retval = -EINVAL;
goto out; goto out;
}
write_lock_irq(&zfcp_data.config_lock); write_lock_irq(&zfcp_data.config_lock);
unit = zfcp_get_unit_by_lun(port, fcp_lun); unit = zfcp_get_unit_by_lun(port, fcp_lun);
......
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