Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4c8aa11 authored by brking@charter.net's avatar brking@charter.net Committed by James Bottomley
Browse files

[SCSI] megaraid: Add support for change_queue_depth



Adds support for change_queue_depth so that device
queue depth can be changed at runtime through sysfs.

Signed-off-by: default avatar <brking@charter.net>
Acked-by: default avatarSeokmann Ju <seokmann.ju@lsil.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 64821324
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -330,6 +330,21 @@ static struct device_attribute *megaraid_sdev_attrs[] = {
	NULL,
};

/**
 * megaraid_change_queue_depth - Change the device's queue depth
 * @sdev:	scsi device struct
 * @qdepth:	depth to set
 *
 * Return value:
 * 	actual depth set
 **/
static int megaraid_change_queue_depth(struct scsi_device *sdev, int qdepth)
{
	if (qdepth > MBOX_MAX_SCSI_CMDS)
		qdepth = MBOX_MAX_SCSI_CMDS;
	scsi_adjust_queue_depth(sdev, 0, qdepth);
	return sdev->queue_depth;
}

/*
 * Scsi host template for megaraid unified driver
@@ -343,6 +358,7 @@ static struct scsi_host_template megaraid_template_g = {
	.eh_device_reset_handler	= megaraid_reset_handler,
	.eh_bus_reset_handler		= megaraid_reset_handler,
	.eh_host_reset_handler		= megaraid_reset_handler,
	.change_queue_depth		= megaraid_change_queue_depth,
	.use_clustering			= ENABLE_CLUSTERING,
	.sdev_attrs			= megaraid_sdev_attrs,
	.shost_attrs			= megaraid_shost_attrs,