From 2486c62765d73ad8f206ba43b8ede09e689bd803 Mon Sep 17 00:00:00 2001 From: Himanshu Madhani Date: Thu, 25 Sep 2014 05:17:00 -0400 Subject: qla2xxx: Restore WWPN in case of Loop Dead. For FA-WWPN capable device, ISP2031 and ISP27XX, when loop dead is detected by a driver, restore WWPN from NVRAM. Signed-off-by: Himanshu Madhani Signed-off-by: Saurav Kashyap Signed-off-by: Christoph Hellwig --- drivers/scsi/qla2xxx/qla_isr.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/scsi/qla2xxx/qla_isr.c') diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index f15f87e1abd8..696e4a2d3fa7 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -752,6 +752,16 @@ skip_rio: if (atomic_read(&vha->loop_state) != LOOP_DOWN) { atomic_set(&vha->loop_state, LOOP_DOWN); atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); + /* + * In case of loop down, restore WWPN from + * NVRAM in case of FA-WWPN capable ISP + */ + if (ha->flags.fawwpn_enabled) { + void *wwpn = ha->init_cb->port_name; + + memcpy(vha->port_name, wwpn, WWN_SIZE); + } + vha->device_flags |= DFLG_NO_CABLE; qla2x00_mark_all_devices_lost(vha, 1); } -- cgit v1.2.3