From: adam radford Date: Tue, 26 Jul 2011 22:42:52 +0000 (-0700) Subject: [SCSI] megaraid_sas: Add .change_queue_depth support X-Git-Tag: v2.6.39-400.9.0~622 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6bc0362d85f36b8992c18e07c8db2dca8aef0f19;p=users%2Fjedix%2Flinux-maple.git [SCSI] megaraid_sas: Add .change_queue_depth support Signed-off-by: Adam Radford Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index e6e30f4da1f6..fc8eb283acf9 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -54,6 +54,7 @@ #include #include #include +#include #include "megaraid_sas_fusion.h" #include "megaraid_sas.h" @@ -2056,6 +2057,20 @@ megasas_service_aen(struct megasas_instance *instance, struct megasas_cmd *cmd) } } +static int megasas_change_queue_depth(struct scsi_device *sdev, + int queue_depth, int reason) +{ + if (reason != SCSI_QDEPTH_DEFAULT) + return -EOPNOTSUPP; + + if (queue_depth > sdev->host->can_queue) + queue_depth = sdev->host->can_queue; + scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), + queue_depth); + + return queue_depth; +} + /* * Scsi host template for megaraid_sas driver */ @@ -2073,6 +2088,7 @@ static struct scsi_host_template megasas_template = { .eh_timed_out = megasas_reset_timer, .bios_param = megasas_bios_param, .use_clustering = ENABLE_CLUSTERING, + .change_queue_depth = megasas_change_queue_depth, }; /**