}
 
 static inline void
-qla2x00_set_retry_delay_timestamp(fc_port_t *fcport, uint16_t retry_delay)
+qla2x00_set_retry_delay_timestamp(fc_port_t *fcport, uint16_t sts_qual)
 {
-       if (retry_delay)
-               fcport->retry_delay_timestamp = jiffies +
-                   (retry_delay * HZ / 10);
+       u8 scope;
+       u16 qual;
+#define SQ_SCOPE_MASK          0xc000 /* SAM-6 rev5 5.3.2 */
+#define SQ_SCOPE_SHIFT         14
+#define SQ_QUAL_MASK           0x3fff
+
+#define SQ_MAX_WAIT_SEC                60 /* Max I/O hold off time in seconds. */
+#define SQ_MAX_WAIT_TIME       (SQ_MAX_WAIT_SEC * 10) /* in 100ms. */
+
+       if (!sts_qual) /* Common case. */
+               return;
+
+       scope = (sts_qual & SQ_SCOPE_MASK) >> SQ_SCOPE_SHIFT;
+       /* Handle only scope 1 or 2, which is for I-T nexus. */
+       if (scope != 1 && scope != 2)
+               return;
+
+       /* Skip processing, if retry delay timer is already in effect. */
+       if (fcport->retry_delay_timestamp &&
+           time_before(jiffies, fcport->retry_delay_timestamp))
+               return;
+
+       qual = sts_qual & SQ_QUAL_MASK;
+       if (qual < 1 || qual > 0x3fef)
+               return;
+       qual = min(qual, (u16)SQ_MAX_WAIT_TIME);
+
+       /* qual is expressed in 100ms increments. */
+       fcport->retry_delay_timestamp = jiffies + (qual * HZ / 10);
+
+       ql_log(ql_log_warn, fcport->vha, 0x5101,
+              "%8phC: I/O throttling requested (status qualifier = %04xh), holding off I/Os for %ums.\n",
+              fcport->port_name, sts_qual, qual * 100);
 }
 
 static inline bool
 
        int logit = 1;
        int res = 0;
        uint16_t state_flags = 0;
-       uint16_t retry_delay = 0;
+       uint16_t sts_qual = 0;
 
        if (IS_FWI2_CAPABLE(ha)) {
                comp_status = le16_to_cpu(sts24->comp_status);
        sense_len = par_sense_len = rsp_info_len = resid_len =
            fw_resid_len = 0;
        if (IS_FWI2_CAPABLE(ha)) {
-               u16 sts24_retry_delay = le16_to_cpu(sts24->retry_delay);
-
                if (scsi_status & SS_SENSE_LEN_VALID)
                        sense_len = le32_to_cpu(sts24->sense_len);
                if (scsi_status & SS_RESPONSE_INFO_LEN_VALID)
                host_to_fcp_swap(sts24->data, sizeof(sts24->data));
                ox_id = le16_to_cpu(sts24->ox_id);
                par_sense_len = sizeof(sts24->data);
-               /* Valid values of the retry delay timer are 0x1-0xffef */
-               if (sts24_retry_delay > 0 && sts24_retry_delay < 0xfff1) {
-                       retry_delay = sts24_retry_delay & 0x3fff;
-                       ql_dbg(ql_dbg_io, sp->vha, 0x3033,
-                           "%s: scope=%#x retry_delay=%#x\n", __func__,
-                           sts24_retry_delay >> 14, retry_delay);
-               }
+               sts_qual = le16_to_cpu(sts24->status_qualifier);
        } else {
                if (scsi_status & SS_SENSE_LEN_VALID)
                        sense_len = le16_to_cpu(sts->req_sense_length);
         * Check retry_delay_timer value if we receive a busy or
         * queue full.
         */
-       if (lscsi_status == SAM_STAT_TASK_SET_FULL ||
-           lscsi_status == SAM_STAT_BUSY)
-               qla2x00_set_retry_delay_timestamp(fcport, retry_delay);
+       if (unlikely(lscsi_status == SAM_STAT_TASK_SET_FULL ||
+                    lscsi_status == SAM_STAT_BUSY))
+               qla2x00_set_retry_delay_timestamp(fcport, sts_qual);
 
        /*
         * Based on Host and scsi status generate status code for Linux