aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_scsi.c')
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c44
1 files changed, 37 insertions, 7 deletions
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 58201e1ae47..e8fbeaeb5fb 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -171,7 +171,7 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
171 write_unlock_irqrestore(&adapter->abort_lock, flags); 171 write_unlock_irqrestore(&adapter->abort_lock, flags);
172 zfcp_scsi_dbf_event_abort("lte1", adapter, scpnt, NULL, 172 zfcp_scsi_dbf_event_abort("lte1", adapter, scpnt, NULL,
173 old_req_id); 173 old_req_id);
174 return SUCCESS; 174 return FAILED; /* completion could be in progress */
175 } 175 }
176 old_req->data = NULL; 176 old_req->data = NULL;
177 177
@@ -486,10 +486,12 @@ static void zfcp_set_rport_dev_loss_tmo(struct fc_rport *rport, u32 timeout)
486 */ 486 */
487static void zfcp_scsi_dev_loss_tmo_callbk(struct fc_rport *rport) 487static void zfcp_scsi_dev_loss_tmo_callbk(struct fc_rport *rport)
488{ 488{
489 struct zfcp_port *port = rport->dd_data; 489 struct zfcp_port *port;
490 490
491 write_lock_irq(&zfcp_data.config_lock); 491 write_lock_irq(&zfcp_data.config_lock);
492 port->rport = NULL; 492 port = rport->dd_data;
493 if (port)
494 port->rport = NULL;
493 write_unlock_irq(&zfcp_data.config_lock); 495 write_unlock_irq(&zfcp_data.config_lock);
494} 496}
495 497
@@ -503,9 +505,18 @@ static void zfcp_scsi_dev_loss_tmo_callbk(struct fc_rport *rport)
503 */ 505 */
504static void zfcp_scsi_terminate_rport_io(struct fc_rport *rport) 506static void zfcp_scsi_terminate_rport_io(struct fc_rport *rport)
505{ 507{
506 struct zfcp_port *port = rport->dd_data; 508 struct zfcp_port *port;
509
510 write_lock_irq(&zfcp_data.config_lock);
511 port = rport->dd_data;
512 if (port)
513 zfcp_port_get(port);
514 write_unlock_irq(&zfcp_data.config_lock);
507 515
508 zfcp_erp_port_reopen(port, 0, "sctrpi1", NULL); 516 if (port) {
517 zfcp_erp_port_reopen(port, 0, "sctrpi1", NULL);
518 zfcp_port_put(port);
519 }
509} 520}
510 521
511static void zfcp_scsi_rport_register(struct zfcp_port *port) 522static void zfcp_scsi_rport_register(struct zfcp_port *port)
@@ -534,8 +545,10 @@ static void zfcp_scsi_rport_register(struct zfcp_port *port)
534 545
535static void zfcp_scsi_rport_block(struct zfcp_port *port) 546static void zfcp_scsi_rport_block(struct zfcp_port *port)
536{ 547{
537 if (port->rport) 548 struct fc_rport *rport = port->rport;
538 fc_remote_port_delete(port->rport); 549
550 if (rport)
551 fc_remote_port_delete(rport);
539} 552}
540 553
541void zfcp_scsi_schedule_rport_register(struct zfcp_port *port) 554void zfcp_scsi_schedule_rport_register(struct zfcp_port *port)
@@ -583,6 +596,23 @@ void zfcp_scsi_rport_work(struct work_struct *work)
583} 596}
584 597
585 598
599void zfcp_scsi_scan(struct work_struct *work)
600{
601 struct zfcp_unit *unit = container_of(work, struct zfcp_unit,
602 scsi_work);
603 struct fc_rport *rport;
604
605 flush_work(&unit->port->rport_work);
606 rport = unit->port->rport;
607
608 if (rport && rport->port_state == FC_PORTSTATE_ONLINE)
609 scsi_scan_target(&rport->dev, 0, rport->scsi_target_id,
610 scsilun_to_int((struct scsi_lun *)
611 &unit->fcp_lun), 0);
612
613 zfcp_unit_put(unit);
614}
615
586struct fc_function_template zfcp_transport_functions = { 616struct fc_function_template zfcp_transport_functions = {
587 .show_starget_port_id = 1, 617 .show_starget_port_id = 1,
588 .show_starget_port_name = 1, 618 .show_starget_port_name = 1,