aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
-rw-r--r--drivers/scsi/scsi_debug.c49
1 files changed, 12 insertions, 37 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index fce393f3e7e0..84cf82e0782d 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -4472,7 +4472,6 @@ static int
4472sdebug_change_qdepth(struct scsi_device *sdev, int qdepth, int reason) 4472sdebug_change_qdepth(struct scsi_device *sdev, int qdepth, int reason)
4473{ 4473{
4474 int num_in_q = 0; 4474 int num_in_q = 0;
4475 int bad = 0;
4476 unsigned long iflags; 4475 unsigned long iflags;
4477 struct sdebug_dev_info *devip; 4476 struct sdebug_dev_info *devip;
4478 4477
@@ -4484,43 +4483,18 @@ sdebug_change_qdepth(struct scsi_device *sdev, int qdepth, int reason)
4484 } 4483 }
4485 num_in_q = atomic_read(&devip->num_in_q); 4484 num_in_q = atomic_read(&devip->num_in_q);
4486 spin_unlock_irqrestore(&queued_arr_lock, iflags); 4485 spin_unlock_irqrestore(&queued_arr_lock, iflags);
4487 if (reason == SCSI_QDEPTH_DEFAULT || reason == SCSI_QDEPTH_RAMP_UP) { 4486
4488 if (qdepth < 1) 4487 if (qdepth < 1)
4489 qdepth = 1; 4488 qdepth = 1;
4490 /* allow to exceed max host queued_arr elements for testing */ 4489 /* allow to exceed max host queued_arr elements for testing */
4491 if (qdepth > SCSI_DEBUG_CANQUEUE + 10) 4490 if (qdepth > SCSI_DEBUG_CANQUEUE + 10)
4492 qdepth = SCSI_DEBUG_CANQUEUE + 10; 4491 qdepth = SCSI_DEBUG_CANQUEUE + 10;
4493 scsi_adjust_queue_depth(sdev, qdepth); 4492 scsi_adjust_queue_depth(sdev, qdepth);
4494 } else if (reason == SCSI_QDEPTH_QFULL) 4493
4495 scsi_track_queue_full(sdev, qdepth);
4496 else
4497 bad = 1;
4498 if (bad)
4499 sdev_printk(KERN_WARNING, sdev,
4500 "%s: unknown reason=0x%x\n", __func__, reason);
4501 if (SCSI_DEBUG_OPT_Q_NOISE & scsi_debug_opts) { 4494 if (SCSI_DEBUG_OPT_Q_NOISE & scsi_debug_opts) {
4502 if (SCSI_QDEPTH_QFULL == reason) 4495 sdev_printk(KERN_INFO, sdev,
4503 sdev_printk(KERN_INFO, sdev, 4496 "%s: qdepth=%d, num_in_q=%d\n",
4504 "%s: -> %d, num_in_q=%d, reason: queue full\n", 4497 __func__, qdepth, num_in_q);
4505 __func__, qdepth, num_in_q);
4506 else {
4507 const char *cp;
4508
4509 switch (reason) {
4510 case SCSI_QDEPTH_DEFAULT:
4511 cp = "default (sysfs ?)";
4512 break;
4513 case SCSI_QDEPTH_RAMP_UP:
4514 cp = "ramp up";
4515 break;
4516 default:
4517 cp = "unknown";
4518 break;
4519 }
4520 sdev_printk(KERN_INFO, sdev,
4521 "%s: qdepth=%d, num_in_q=%d, reason: %s\n",
4522 __func__, qdepth, num_in_q, cp);
4523 }
4524 } 4498 }
4525 return sdev->queue_depth; 4499 return sdev->queue_depth;
4526} 4500}
@@ -4576,6 +4550,7 @@ static struct scsi_host_template sdebug_driver_template = {
4576 .max_sectors = -1U, 4550 .max_sectors = -1U,
4577 .use_clustering = DISABLE_CLUSTERING, 4551 .use_clustering = DISABLE_CLUSTERING,
4578 .module = THIS_MODULE, 4552 .module = THIS_MODULE,
4553 .track_queue_depth = 1,
4579}; 4554};
4580 4555
4581static int sdebug_driver_probe(struct device * dev) 4556static int sdebug_driver_probe(struct device * dev)