From patchwork Tue Oct 31 12:32:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suganath Prabu S X-Patchwork-Id: 10034423 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C193B602B9 for ; Tue, 31 Oct 2017 12:34:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4F861FE8D for ; Tue, 31 Oct 2017 12:34:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9BC4205A9; Tue, 31 Oct 2017 12:34:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38BA21FE8D for ; Tue, 31 Oct 2017 12:34:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932701AbdJaMd6 (ORCPT ); Tue, 31 Oct 2017 08:33:58 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:56806 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932698AbdJaMd4 (ORCPT ); Tue, 31 Oct 2017 08:33:56 -0400 Received: by mail-qk0-f194.google.com with SMTP id l194so20141802qke.13 for ; Tue, 31 Oct 2017 05:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Fq5/ersTVb1OBulrrv43+YokCVyuIPja0p7mN+eQOpg=; b=IOea+Y4WA2f151ax/RanvH7RgjAz4+UN9hL0keuyH3Hk2TZizSbHwnPcxEMrNe6MBS bw11C7bzln8uMRALAjVgO+uEJFfv2w45kv1wrZtTk18pDniSe5A0g9WgX1k+qHFZpFpb S7rDFeR08sym78+yzeupq7jhDVcZFd0B8jvV0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Fq5/ersTVb1OBulrrv43+YokCVyuIPja0p7mN+eQOpg=; b=mPTIGAgPDci5giNjIDyv9CsqpxPEZ8qw2m08tAtLkaZ0oRZQmLbADLOyJEqQhVi77W HVLL8ZjoMdGIiHl3VQCAOTgGKiQBxR20HqG1l4Q67405WWEL3Bb/ZBFRLF8h8FSXr7xX dO9A1aiAFvu4NZMnXPYC6SFd7A/emh71a/FTUuLF4aAW0bYg3TFpO8u+J8f863Xv+5/+ mEK956/T8Dsyr94V/Skg3Smi7GqBtWlE/Ws5fsdiEDN59KlVt/BOoSHsB2FuuA3mxj4H fweZF9jG52XOq0f5P7VLCroIFW+bpRxIXVyRO0RguqTsvU+9G/j4N0fU8OPelprDtWwq kquA== X-Gm-Message-State: AJaThX4bz5jBzN5OipiqGV3iyEdo0UdpAsAcEAtQXjpvZBuS/4jENKKe 0ZdrEONb7E5Fr0OzGvme32se6X2Z X-Google-Smtp-Source: ABhQp+QrIWMP1ybt4+vXpXc9W/iepL20BJQSceD8qJPJf458WZFAw5jw8t4h87o7UucwjfMablJoXg== X-Received: by 10.55.204.157 with SMTP id n29mr2195680qkl.243.1509453235469; Tue, 31 Oct 2017 05:33:55 -0700 (PDT) Received: from host1.dhcp.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id p31sm790811qtj.12.2017.10.31.05.33.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Oct 2017 05:33:54 -0700 (PDT) From: Suganath Prabu S 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 , Chaitra P B Subject: [PATCH 11/13] mpt3sas: Fix nvme drives checking for tlr. Date: Tue, 31 Oct 2017 18:02:37 +0530 Message-Id: <1509453159-7028-12-git-send-email-suganath-prabu.subramani@broadcom.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1509453159-7028-1-git-send-email-suganath-prabu.subramani@broadcom.com> References: <1509453159-7028-1-git-send-email-suganath-prabu.subramani@broadcom.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Check for NVMe drives before enabling or checking tlr. Signed-off-by: Chaitra P B Signed-off-by: Suganath Prabu S --- 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");