Merge branch '6.9/scsi-queue' into 6.9/scsi-fixes
[linux-2.6-block.git] / drivers / scsi / lpfc / lpfc_scsi.c
index c0038eaae7b0ae9e40d945c9d99708897c97382e..4a6e5223a22418a9f10c07c104003187b3b727cb 100644 (file)
@@ -167,11 +167,10 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
        struct Scsi_Host  *shost;
        struct scsi_device *sdev;
        unsigned long new_queue_depth;
-       unsigned long num_rsrc_err, num_cmd_success;
+       unsigned long num_rsrc_err;
        int i;
 
        num_rsrc_err = atomic_read(&phba->num_rsrc_err);
-       num_cmd_success = atomic_read(&phba->num_cmd_success);
 
        /*
         * The error and success command counters are global per
@@ -186,20 +185,16 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
                for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {
                        shost = lpfc_shost_from_vport(vports[i]);
                        shost_for_each_device(sdev, shost) {
-                               new_queue_depth =
-                                       sdev->queue_depth * num_rsrc_err /
-                                       (num_rsrc_err + num_cmd_success);
-                               if (!new_queue_depth)
-                                       new_queue_depth = sdev->queue_depth - 1;
+                               if (num_rsrc_err >= sdev->queue_depth)
+                                       new_queue_depth = 1;
                                else
                                        new_queue_depth = sdev->queue_depth -
-                                                               new_queue_depth;
+                                               num_rsrc_err;
                                scsi_change_queue_depth(sdev, new_queue_depth);
                        }
                }
        lpfc_destroy_vport_work_array(phba, vports);
        atomic_set(&phba->num_rsrc_err, 0);
-       atomic_set(&phba->num_cmd_success, 0);
 }
 
 /**
@@ -5336,16 +5331,6 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
                }
                err = lpfc_bg_scsi_prep_dma_buf(phba, lpfc_cmd);
        } else {
-               if (vport->phba->cfg_enable_bg) {
-                       lpfc_printf_vlog(vport,
-                                        KERN_INFO, LOG_SCSI_CMD,
-                                        "9038 BLKGRD: rcvd PROT_NORMAL cmd: "
-                                        "x%x reftag x%x cnt %u pt %x\n",
-                                        cmnd->cmnd[0],
-                                        scsi_prot_ref_tag(cmnd),
-                                        scsi_logical_block_count(cmnd),
-                                        (cmnd->cmnd[1]>>5));
-               }
                err = lpfc_scsi_prep_dma_buf(phba, lpfc_cmd);
        }