]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/scsi/qla2xxx/qla_inline.h
[SCSI] qla2xxx: Unload hangs after issuing BSG commands to vport.
[karo-tx-linux.git] / drivers / scsi / qla2xxx / qla_inline.h
index c0462c04c885de1d8cf3008d7c6200e04ad11028..130f6f3c2a9722a4a71e4291b943d2e32249dd09 100644 (file)
@@ -197,6 +197,13 @@ done:
        return sp;
 }
 
+static inline void
+qla2x00_rel_sp(scsi_qla_host_t *vha, srb_t *sp)
+{
+       mempool_free(sp, vha->hw->srb_mempool);
+       QLA_VHA_MARK_NOT_BUSY(vha);
+}
+
 static inline void
 qla2x00_init_timer(srb_t *sp, unsigned long tmo)
 {
@@ -213,3 +220,22 @@ qla2x00_gid_list_size(struct qla_hw_data *ha)
 {
        return sizeof(struct gid_list_info) * ha->max_fibre_devices;
 }
+
+static inline void
+qla2x00_do_host_ramp_up(scsi_qla_host_t *vha)
+{
+       if (vha->hw->cfg_lun_q_depth >= ql2xmaxqdepth)
+               return;
+
+       /* Wait at least HOST_QUEUE_RAMPDOWN_INTERVAL before ramping up */
+       if (time_before(jiffies, (vha->hw->host_last_rampdown_time +
+           HOST_QUEUE_RAMPDOWN_INTERVAL)))
+               return;
+
+       /* Wait at least HOST_QUEUE_RAMPUP_INTERVAL between each ramp up */
+       if (time_before(jiffies, (vha->hw->host_last_rampup_time +
+           HOST_QUEUE_RAMPUP_INTERVAL)))
+               return;
+
+       set_bit(HOST_RAMP_UP_QUEUE_DEPTH, &vha->dpc_flags);
+}