From patchwork Thu Nov 12 18:10:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 7604611 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1D1049F1D3 for ; Thu, 12 Nov 2015 18:11:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 37FC020414 for ; Thu, 12 Nov 2015 18:11:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F6DF203F4 for ; Thu, 12 Nov 2015 18:11:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752761AbbKLSLB (ORCPT ); Thu, 12 Nov 2015 13:11:01 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34233 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751769AbbKLSLA (ORCPT ); Thu, 12 Nov 2015 13:11:00 -0500 Received: by padhx2 with SMTP id hx2so71899937pad.1 for ; Thu, 12 Nov 2015 10:10:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avagotech.com; s=google; h=from:to:cc:subject:date:message-id; bh=wlNfTaJanYdwxxicAJMQzVQWQaY1bovg5N84Sxhj3Go=; b=qLrFvqgQJmr6/6HzWOkrRKym4vjn7NguwykascWWYjlPIrXZKXA/kST79/V1PBmDsk JOv0TlrDK5Fnm5NKrECMO+kXTVWy6Gx3BcNrvsqsHha8u3pxlHG8mdahKTBm51MLhx1g 17Tvmuo1WbufycsjhLQQzMG7CuWF4B71x77jA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=wlNfTaJanYdwxxicAJMQzVQWQaY1bovg5N84Sxhj3Go=; b=cWLLTFETr904Z031G++Az7DYkE5URoE/J1hX0wkmiZmaGG0Qd4BZOoKR4nm9vxcGNf YMh5EuLC3ZvwqRNhJRQazdT8WunP9wmO/XVTYfMWccvzMlOv1GTeyxu0TSdsXtFbyrLA 0Bn8ds0HnXwhN6Xv+/JZD0ZE7m7xaIV3rCQouRuFnwlKIelU7ux+FbToO5/RE6JZu1da 8T5dq3ognTqKRAgzBm7oBqexQPDk6L9sQ60oovahA4jboNr++zAd5dFhhKIZbs5IYDA5 lK+Iofp2j4SHeftfyr0HgCeouco4LCYv8T4nnLtqgTiAH9cOVn4M87QiDwCQJFzeEsqa Uhew== X-Gm-Message-State: ALoCoQl1aKcm/t8y8Lmbnrq/VY7d8iutHndYtC/pVMnLYV2qrQWScxw7ytWYyndSEdTl3l2qfHz4 X-Received: by 10.68.165.34 with SMTP id yv2mr25041157pbb.153.1447351859146; Thu, 12 Nov 2015 10:10:59 -0800 (PST) Received: from host1.lsi.com ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id ux3sm15995526pac.18.2015.11.12.10.10.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Nov 2015 10:10:57 -0800 (PST) From: Sreekanth Reddy X-Google-Original-From: Sreekanth Reddy To: jejb@kernel.org Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, JBottomley@Parallels.com, Sathya.Prakash@avagotech.com, kashyap.desai@avagotech.com, linux-kernel@vger.kernel.org, hch@infradead.org, chaitra.basappa@avagotech.com, suganath-prabu.subramani@avagotech.com, Sreekanth Reddy Subject: [PATCH] mpt3sas: Fix use sas_is_tlr_enabled API before enabling MPI2_SCSIIO_CONTROL_TLR_ON flag Date: Thu, 12 Nov 2015 23:40:37 +0530 Message-Id: <1447351837-31388-1-git-send-email-Sreekanth.Reddy@avagotech.com> X-Mailer: git-send-email 2.0.2 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Before enabling MPI2_SCSIIO_CONTROL_TLR_ON flag in MPI SCSI IO request message, check whether TLR is enabled on the drive using 'sas_is_tlr_enabled' API. Actually in the driver code, driver is using below API's 1. sas_enable_tlr() - to enable the TLR 2. sas_disable_tlr() - to disable the TLR 3. sas_is_tlr_enabled() - to check whether TLR is enabled or not. but in scsih_qcmd() we have missed to use sas_is_tlr_enabled() API, instead we checking for TLR bit from flag field of driver's 'struct MPT3SAS_DEVIC' structure. which is corrected with this patch. Signed-off-by: Sreekanth Reddy Reviewed-by: Hannes Reinecke Reviewed-by: Tomas Henzl --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index d95206b..9ab77b0 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -3905,8 +3905,7 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd) * We do not expose raid functionality to upper layer for warpdrive. */ if (!ioc->is_warpdrive && !scsih_is_raid(&scmd->device->sdev_gendev) - && (sas_device_priv_data->flags & MPT_DEVICE_TLR_ON) && - scmd->cmd_len != 32) + && 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);