All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
To: linux-scsi@vger.kernel.org
Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com,
	kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com,
	sasikumar.pc@broadcom.com,
	shivasharan.srikanteshwara@broadcom.com,
	anand.lodnoor@broadcom.com,
	Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Subject: [PATCH 1/5] megaraid_sas: Limit device qd to controller qd when device qd is greater than controller qd
Date: Fri,  8 May 2020 14:08:34 +0530	[thread overview]
Message-ID: <20200508083838.22778-2-chandrakanth.patil@broadcom.com> (raw)
In-Reply-To: <20200508083838.22778-1-chandrakanth.patil@broadcom.com>

Currently, driver assigns pre-defined qd when firmware provided
device qd is greater than the controller queue depth.
This change assigns controller queue depth instead of pre-defined
qd when firmware provided qd is greater than controller queue depth.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
---
 drivers/scsi/megaraid/megaraid_sas_base.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index fb9c3ce..aeb5952 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -1982,9 +1982,8 @@ static void megasas_set_fw_assisted_qd(struct scsi_device *sdev,
 
 	if (is_target_prop) {
 		tgt_device_qd = le32_to_cpu(instance->tgt_prop->device_qdepth);
-		if (tgt_device_qd &&
-		    (tgt_device_qd <= instance->host->can_queue))
-			device_qd = tgt_device_qd;
+		if (tgt_device_qd)
+			device_qd = min(instance->host->can_queue, (int)tgt_device_qd);
 	}
 
 	if (instance->enable_sdev_max_qd && interface_type != UNKNOWN_DRIVE)
-- 
2.9.5


  reply	other threads:[~2020-05-08  8:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08  8:38 [PATCH 0/5] megaraid_sas: driver updates for 07.714.04.00-rc1 Chandrakanth Patil
2020-05-08  8:38 ` Chandrakanth Patil [this message]
2020-05-13  6:20   ` [PATCH 1/5] megaraid_sas: Limit device qd to controller qd when device qd is greater than controller qd Hannes Reinecke
2020-05-08  8:38 ` [PATCH 2/5] megaraid_sas: Remove IO buffer hole detection logic Chandrakanth Patil
2020-05-13  6:21   ` Hannes Reinecke
2020-05-12  3:48 ` [PATCH 0/5] megaraid_sas: driver updates for 07.714.04.00-rc1 Martin K. Petersen
2020-05-13 21:38   ` Chandrakanth Patil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200508083838.22778-2-chandrakanth.patil@broadcom.com \
    --to=chandrakanth.patil@broadcom.com \
    --cc=anand.lodnoor@broadcom.com \
    --cc=kashyap.desai@broadcom.com \
    --cc=kiran-kumar.kasturi@broadcom.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sankar.patra@broadcom.com \
    --cc=sasikumar.pc@broadcom.com \
    --cc=shivasharan.srikanteshwara@broadcom.com \
    --cc=sumit.saxena@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.