From: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
To: linux-scsi@vger.kernel.org
Cc: Sathya.Prakash@broadcom.com, linux-kernel@vger.kernel.org,
sreekanth.reddy@broadcom.com, linux-nvme@lists.infradead.org,
Suganath Prabu S <suganath-prabu.subramani@broadcom.com>,
Chaitra P B <chaitra.basappa@broadcom.com>
Subject: [PATCH 11/13] mpt3sas: Fix nvme drives checking for tlr.
Date: Tue, 31 Oct 2017 18:02:37 +0530 [thread overview]
Message-ID: <1509453159-7028-12-git-send-email-suganath-prabu.subramani@broadcom.com> (raw)
In-Reply-To: <1509453159-7028-1-git-send-email-suganath-prabu.subramani@broadcom.com>
Check for NVMe drives before enabling or checking tlr.
Signed-off-by: Chaitra P B <chaitra.basappa@broadcom.com>
Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
---
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index dc1fdad..72dd57f 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -2048,6 +2048,14 @@ scsih_is_raid(struct device *dev)
return (sdev->channel == RAID_CHANNEL) ? 1 : 0;
}
+static int
+scsih_is_nvme(struct device *dev)
+{
+ struct scsi_device *sdev = to_scsi_device(dev);
+
+ return (sdev->channel == PCIE_CHANNEL) ? 1 : 0;
+}
+
/**
* scsih_get_resync - get raid volume resync percent complete
* @dev the device struct object
@@ -4834,8 +4842,9 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
/* Make sure Device is not raid volume.
* We do not expose raid functionality to upper layer for warpdrive.
*/
- if (!ioc->is_warpdrive && !scsih_is_raid(&scmd->device->sdev_gendev)
- && sas_is_tlr_enabled(scmd->device) && scmd->cmd_len != 32)
+ if (((!ioc->is_warpdrive && !scsih_is_raid(&scmd->device->sdev_gendev))
+ && !scsih_is_nvme(&scmd->device->sdev_gendev))
+ && sas_is_tlr_enabled(scmd->device) && scmd->cmd_len != 32)
mpi_control |= MPI2_SCSIIO_CONTROL_TLR_ON;
smid = mpt3sas_base_get_smid_scsiio(ioc, ioc->scsi_io_cb_idx, scmd);
@@ -4880,8 +4889,8 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
raid_device = sas_target_priv_data->raid_device;
if (raid_device && raid_device->direct_io_enabled)
- mpt3sas_setup_direct_io(ioc, scmd, raid_device, mpi_request,
- smid);
+ mpt3sas_setup_direct_io(ioc, scmd,
+ raid_device, mpi_request, smid);
if (likely(mpi_request->Function == MPI2_FUNCTION_SCSI_IO_REQUEST)) {
if (sas_target_priv_data->flags & MPT_TARGET_FASTPATH_IO) {
@@ -5411,9 +5420,10 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply)
le32_to_cpu(mpi_reply->ResponseInfo) & 0xFF;
if (!sas_device_priv_data->tlr_snoop_check) {
sas_device_priv_data->tlr_snoop_check++;
- if (!ioc->is_warpdrive &&
+ if ((!ioc->is_warpdrive &&
!scsih_is_raid(&scmd->device->sdev_gendev) &&
- sas_is_tlr_enabled(scmd->device) &&
+ !scsih_is_nvme(&scmd->device->sdev_gendev))
+ && sas_is_tlr_enabled(scmd->device) &&
response_code == MPI2_SCSITASKMGMT_RSP_INVALID_FRAME) {
sas_disable_tlr(scmd->device);
sdev_printk(KERN_INFO, scmd->device, "TLR disabled\n");
--
2.5.5
next prev parent reply other threads:[~2017-10-31 12:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-31 12:32 [PATCH 00/13] mpt3sas driver NVMe support: Suganath Prabu S
2017-10-31 12:32 ` [PATCH 01/13] mpt3sas: Add nvme device support in slave alloc, target alloc and probe Suganath Prabu S
2017-10-31 12:32 ` [PATCH 02/13] mpt3sas: SGL to PRP Translation for I/Os to NVMe devices Suganath Prabu S
2017-10-31 12:32 ` [PATCH 03/13] mpt3sas: Added support for nvme encapsulated request message Suganath Prabu S
2017-10-31 12:32 ` [PATCH 04/13] mpt3sas: API 's to support NVMe drive addition to SML Suganath Prabu S
2017-10-31 12:32 ` [PATCH 05/13] mpt3sas: API's to remove nvme drive from sml Suganath Prabu S
2017-10-31 12:32 ` [PATCH 06/13] mpt3sas: Handle NVMe PCIe device related events generated from firmware Suganath Prabu S
2017-10-31 12:32 ` [PATCH 07/13] mpt3sas: Set NVMe device queue depth as 128 Suganath Prabu S
2017-10-31 12:32 ` [PATCH 08/13] mpt3sas: scan and add nvme device after controller reset Suganath Prabu S
2017-10-31 12:32 ` [PATCH 09/13] mpt3as: Add-Task-management-debug-info-for-NVMe-drives Suganath Prabu S
2017-10-31 12:32 ` [PATCH 10/13] mpt3sas: NVMe drive support for BTDHMAPPING ioctl command and log info Suganath Prabu S
2017-10-31 12:32 ` Suganath Prabu S [this message]
2017-10-31 12:32 ` [PATCH 12/13] mpt3sas: Fix sparse warnings Suganath Prabu S
2017-10-31 12:32 ` [PATCH 13/13] mpt3sas: Update mpt3sas driver version Suganath Prabu S
2017-11-03 16:32 ` [PATCH 00/13] mpt3sas driver NVMe support: Martin K. Petersen
-- strict thread matches above, loose matches on Subject: below --
2017-07-11 8:55 [PATCH 00/13]mpt3sas " Suganath Prabu S
2017-07-11 8:55 ` [PATCH 11/13] mpt3sas: Fix nvme drives checking for tlr Suganath Prabu S
2017-06-29 14:19 [PATCH 00/13]mpt3sas driver NVMe support: Suganath Prabu S
2017-06-29 14:19 ` [PATCH 11/13] mpt3sas: Fix nvme drives checking for tlr Suganath Prabu S
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=1509453159-7028-12-git-send-email-suganath-prabu.subramani@broadcom.com \
--to=suganath-prabu.subramani@broadcom.com \
--cc=Sathya.Prakash@broadcom.com \
--cc=chaitra.basappa@broadcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=sreekanth.reddy@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®