case RSCN_PORT_ADDR:
                fcport = qla2x00_find_fcport_by_nportid(vha, &ea->id, 1);
                if (fcport) {
-                       if (fcport->flags & FCF_FCP2_DEVICE) {
+                       if (fcport->flags & FCF_FCP2_DEVICE &&
+                           atomic_read(&fcport->state) == FCS_ONLINE) {
                                ql_dbg(ql_dbg_disc, vha, 0x2115,
                                       "Delaying session delete for FCP2 portid=%06x %8phC ",
                                        fcport->d_id.b24, fcport->port_name);
                break;
        case RSCN_AREA_ADDR:
                list_for_each_entry(fcport, &vha->vp_fcports, list) {
-                       if (fcport->flags & FCF_FCP2_DEVICE)
+                       if (fcport->flags & FCF_FCP2_DEVICE &&
+                           atomic_read(&fcport->state) == FCS_ONLINE)
                                continue;
 
                        if ((ea->id.b24 & 0xffff00) == (fcport->d_id.b24 & 0xffff00)) {
                break;
        case RSCN_DOM_ADDR:
                list_for_each_entry(fcport, &vha->vp_fcports, list) {
-                       if (fcport->flags & FCF_FCP2_DEVICE)
+                       if (fcport->flags & FCF_FCP2_DEVICE &&
+                           atomic_read(&fcport->state) == FCS_ONLINE)
                                continue;
 
                        if ((ea->id.b24 & 0xff0000) == (fcport->d_id.b24 & 0xff0000)) {
        case RSCN_FAB_ADDR:
        default:
                list_for_each_entry(fcport, &vha->vp_fcports, list) {
-                       if (fcport->flags & FCF_FCP2_DEVICE)
+                       if (fcport->flags & FCF_FCP2_DEVICE &&
+                           atomic_read(&fcport->state) == FCS_ONLINE)
                                continue;
 
                        fcport->scan_needed = 1;