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,
	Chandrakanth Patil <chandrakanth.patil@broadcom.com>,
	stable@vger.kernel.org
Subject: [PATCH v3 1/5] megaraid_sas: Send all non-RW IOs for TYPE_ENCLOSURE device through firmware
Date: Fri, 28 May 2021 18:43:03 +0530	[thread overview]
Message-ID: <20210528131307.25683-2-chandrakanth.patil@broadcom.com> (raw)
In-Reply-To: <20210528131307.25683-1-chandrakanth.patil@broadcom.com>

[-- Attachment #1: Type: text/plain, Size: 1948 bytes --]

Driver issues all non-ReadWrite IOs for TYPE_ENCLOSURE devices through
the fast path with invalid dev handle and fast path inturn directs all
the IOs to the firmware. As firmware stopped handling those IOs from
SAS3.5 generation of controllers (Ventura and its onward generations)
lead to IOs failure.

The driver will issue all the non-ReadWrite IOs for TYPE_ENCLOSURE devices
directly to firmware from SAS3.5 generation of controllers.

Cc: <stable@vger.kernel.org> # v5.11+
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com>
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 2221175ae051..cd94a0c81f83 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -3203,6 +3203,8 @@ megasas_build_io_fusion(struct megasas_instance *instance,
 {
 	int sge_count;
 	u8  cmd_type;
+	u16 pd_index = 0;
+	u8 drive_type = 0;
 	struct MPI2_RAID_SCSI_IO_REQUEST *io_request = cmd->io_request;
 	struct MR_PRIV_DEVICE *mr_device_priv_data;
 	mr_device_priv_data = scp->device->hostdata;
@@ -3237,8 +3239,12 @@ megasas_build_io_fusion(struct megasas_instance *instance,
 		megasas_build_syspd_fusion(instance, scp, cmd, true);
 		break;
 	case NON_READ_WRITE_SYSPDIO:
-		if (instance->secure_jbod_support ||
-		    mr_device_priv_data->is_tm_capable)
+		pd_index = MEGASAS_PD_INDEX(scp);
+		drive_type = instance->pd_list[pd_index].driveType;
+		if ((instance->secure_jbod_support ||
+		     mr_device_priv_data->is_tm_capable) ||
+		     (instance->adapter_type >= VENTURA_SERIES &&
+		     drive_type == TYPE_ENCLOSURE))
 			megasas_build_syspd_fusion(instance, scp, cmd, false);
 		else
 			megasas_build_syspd_fusion(instance, scp, cmd, true);
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4227 bytes --]

  reply	other threads:[~2021-05-28 13:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28 13:13 [PATCH v3 0/5] megaraid_sas: Update driver version to 07.717.02.00-rc1 Chandrakanth Patil
2021-05-28 13:13 ` Chandrakanth Patil [this message]
2021-05-28 13:13 ` [PATCH v3 2/5] megaraid_sas: Fix the resource leak in case of probe failure Chandrakanth Patil
2021-05-28 13:13 ` [PATCH v3 3/5] megaraid_sas: Early detection of VD deletion through RaidMap update Chandrakanth Patil
2021-05-28 13:13 ` [PATCH v3 4/5] megaraid_sas: Handle missing interrupts while re-enabling IRQs Chandrakanth Patil
2021-05-28 13:13 ` [PATCH v3 5/5] megaraid_sas: Update driver version to 07.717.02.00-rc1 Chandrakanth Patil
2021-06-02  5:07 ` [PATCH v3 0/5] " Martin K. Petersen
2021-06-08  3:05 ` Martin K. Petersen

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=20210528131307.25683-2-chandrakanth.patil@broadcom.com \
    --to=chandrakanth.patil@broadcom.com \
    --cc=kashyap.desai@broadcom.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --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.