diff options
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 7 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 2ccbd185a5fb..fa2460b42298 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -672,12 +672,15 @@ err_out: | |||
672 | */ | 672 | */ |
673 | void zfcp_port_dequeue(struct zfcp_port *port) | 673 | void zfcp_port_dequeue(struct zfcp_port *port) |
674 | { | 674 | { |
675 | wait_event(port->remove_wq, atomic_read(&port->refcount) == 0); | ||
676 | write_lock_irq(&zfcp_data.config_lock); | 675 | write_lock_irq(&zfcp_data.config_lock); |
677 | list_del(&port->list); | 676 | list_del(&port->list); |
678 | write_unlock_irq(&zfcp_data.config_lock); | 677 | write_unlock_irq(&zfcp_data.config_lock); |
679 | if (port->rport) | 678 | if (port->rport) { |
680 | port->rport->dd_data = NULL; | 679 | port->rport->dd_data = NULL; |
680 | port->rport = NULL; | ||
681 | } | ||
682 | wait_event(port->remove_wq, atomic_read(&port->refcount) == 0); | ||
683 | cancel_work_sync(&port->rport_work); /* usually not necessary */ | ||
681 | zfcp_adapter_put(port->adapter); | 684 | zfcp_adapter_put(port->adapter); |
682 | sysfs_remove_group(&port->sysfs_device.kobj, &zfcp_sysfs_port_attrs); | 685 | sysfs_remove_group(&port->sysfs_device.kobj, &zfcp_sysfs_port_attrs); |
683 | device_unregister(&port->sysfs_device); | 686 | device_unregister(&port->sysfs_device); |
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 6925a1784682..54a7a7474aa5 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -582,8 +582,10 @@ void zfcp_scsi_schedule_rport_block(struct zfcp_port *port) | |||
582 | zfcp_port_get(port); | 582 | zfcp_port_get(port); |
583 | port->rport_task = RPORT_DEL; | 583 | port->rport_task = RPORT_DEL; |
584 | 584 | ||
585 | if (!queue_work(zfcp_data.work_queue, &port->rport_work)) | 585 | if (port->rport && queue_work(zfcp_data.work_queue, &port->rport_work)) |
586 | zfcp_port_put(port); | 586 | return; |
587 | |||
588 | zfcp_port_put(port); | ||
587 | } | 589 | } |
588 | 590 | ||
589 | void zfcp_scsi_schedule_rports_block(struct zfcp_adapter *adapter) | 591 | void zfcp_scsi_schedule_rports_block(struct zfcp_adapter *adapter) |