From patchwork Wed Sep 30 15:47:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 7299841 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EA20DBEEA4 for ; Wed, 30 Sep 2015 15:54:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3C932206F9 for ; Wed, 30 Sep 2015 15:54:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 35ECA20650 for ; Wed, 30 Sep 2015 15:54:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755015AbbI3Pw6 (ORCPT ); Wed, 30 Sep 2015 11:52:58 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:34444 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754422AbbI3Psf (ORCPT ); Wed, 30 Sep 2015 11:48:35 -0400 Received: by padhy16 with SMTP id hy16so44227546pad.1 for ; Wed, 30 Sep 2015 08:48:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avagotech.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=12VKvNHbUXCDiTvVjiAjMxb4EXD70dSlB9c8y/X0HsQ=; b=NmPO2up6GnXNYaStOnx+e3VWSrRVttV6TrJHKQxWESoWpdsWRrfQ7ZQSaAvN5Xcv+l zo1GR/2wl5oZ97VmPnkqIXb2oNp6NKGCBcTbaxSOuhFazfzlhpuVFN5CJHTSmmjL0NHn Lku9HXY8oqLwdEiFVxCYiWtzTda37pDNuD3Zo= 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:in-reply-to :references; bh=12VKvNHbUXCDiTvVjiAjMxb4EXD70dSlB9c8y/X0HsQ=; b=L2L+ddCXeZKz4qp1/oUPbWpjoemAU5XhepqUqI+9O9AElXEgJm4aIQngMQjgLHaw1U RzMfh4dZccaFvNrTqBwq9WCll0M0yAy9ngXHVGgCjo7GcKIE9n/kY3i+z06Swd2BEOJY 174oFhf6ofCbyMWWcyBAGiNC+h+SqxKn6PkZpKhyI8x3P56xnW1e+PnTSAioYndibOoR /ehx9lNpxpdSMuj4yaptnvjTSbHYretAc5xYGoPCmqh3UqTEzDf6a7jNow7XUJCZDB2M d1NajdJZ3cj/jll4YDSouih2xs0MrnLamccHMnjU96OPbcdFsmMOO8HOte1BnVig4QY5 Yn/w== X-Gm-Message-State: ALoCoQknae2VF9UqmrNI5NP1+/hF+8jdctwQlZl3Nkr2IOIQgssxzJ84Ci7xLKmt9sCTDajGgzig X-Received: by 10.66.219.227 with SMTP id pr3mr5791458pac.33.1443628115033; Wed, 30 Sep 2015 08:48:35 -0700 (PDT) Received: from host1.lsi.com ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id xg2sm1458666pbb.2.2015.09.30.08.48.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Sep 2015 08:48:33 -0700 (PDT) From: Sreekanth Reddy X-Google-Original-From: Sreekanth Reddy To: jejb@kernel.org, hch@infradead.org Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, JBottomley@Parallels.com, Sathya.Prakash@avagotech.com, chaitra.basappa@avagotech.com, suganath-prabu.subramani@avagotech.com, linux-kernel@vger.kernel.org, Sreekanth Reddy Subject: [PATCH 09/18] mpt3as: Don't send PHYDISK_HIDDEN Raid Action request on SAS2 HBA's Date: Wed, 30 Sep 2015 21:17:09 +0530 Message-Id: <1443628038-13552-10-git-send-email-Sreekanth.Reddy@avagotech.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1443628038-13552-1-git-send-email-Sreekanth.Reddy@avagotech.com> References: <1443628038-13552-1-git-send-email-Sreekanth.Reddy@avagotech.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable 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 Don't send PHYDISK_HIDDEN Raid Action request for SAS2 HBA's. Since these HBA's doesn't support this Raid Action. Also enable fast_path only for SAS3 HBA's. Signed-off-by: Sreekanth Reddy --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index a638920..80469d0 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -1165,8 +1165,10 @@ scsih_target_alloc(struct scsi_target *starget) if (test_bit(sas_device->handle, ioc->pd_handles)) sas_target_priv_data->flags |= MPT_TARGET_FLAGS_RAID_COMPONENT; +#ifndef SCSI_MPT2SAS if (sas_device->fast_path) sas_target_priv_data->flags |= MPT_TARGET_FASTPATH_IO; +#endif } spin_unlock_irqrestore(&ioc->sas_device_lock, flags); @@ -3719,11 +3721,13 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd) ioc->build_zero_len_sge(ioc, &mpi_request->SGL); if (likely(mpi_request->Function == MPI2_FUNCTION_SCSI_IO_REQUEST)) { +#ifndef SCSI_MPT2SAS if (sas_target_priv_data->flags & MPT_TARGET_FASTPATH_IO) { mpi_request->IoFlags = cpu_to_le16(scmd->cmd_len | MPI25_SCSIIO_IOFLAGS_FAST_PATH); mpt3sas_base_put_smid_fast_path(ioc, smid, handle); } else +#endif mpt3sas_base_put_smid_scsi_io(ioc, smid, handle); } else mpt3sas_base_put_smid_default(ioc, smid); @@ -5031,8 +5035,10 @@ _scsih_add_device(struct MPT3SAS_ADAPTER *ioc, u16 handle, u8 phy_num, sas_device->device_info = device_info; sas_device->sas_address = sas_address; sas_device->phy = sas_device_pg0.PhyNum; +#ifndef SCSI_MPT2SAS sas_device->fast_path = (le16_to_cpu(sas_device_pg0.Flags) & MPI25_SAS_DEVICE0_FLAGS_FAST_PATH_CAPABLE) ? 1 : 0; +#endif if (sas_device_pg0.Flags & MPI2_SAS_DEVICE0_FLAGS_ENCL_LEVEL_VALID) { sas_device->enclosure_level = @@ -5731,6 +5737,7 @@ _scsih_sas_discovery_event(struct MPT3SAS_ADAPTER *ioc, } } +#ifndef SCSI_MPT2SAS /** * _scsih_ir_fastpath - turn on fastpath for IR physdisk * @ioc: per adapter object @@ -5750,7 +5757,6 @@ _scsih_ir_fastpath(struct MPT3SAS_ADAPTER *ioc, u16 handle, u8 phys_disk_num) u16 ioc_status; u32 log_info; - mutex_lock(&ioc->scsih_cmds.mutex); if (ioc->scsih_cmds.status != MPT3_CMD_NOT_USED) { @@ -5825,6 +5831,8 @@ _scsih_ir_fastpath(struct MPT3SAS_ADAPTER *ioc, u16 handle, u8 phys_disk_num) FORCE_BIG_HAMMER); return rc; } +/* End of not defined SCSI_MPT2SAS */ +#endif /** * _scsih_reprobe_lun - reprobing lun @@ -6017,8 +6025,10 @@ _scsih_sas_pd_hide(struct MPT3SAS_ADAPTER *ioc, if (!sas_device) return; +#ifndef SCSI_MPT2SAS /* hiding raid component */ _scsih_ir_fastpath(ioc, handle, element->PhysDiskNum); +#endif if (starget) starget_for_each_device(starget, (void *)1, _scsih_reprobe_lun); } @@ -6067,7 +6077,9 @@ _scsih_sas_pd_add(struct MPT3SAS_ADAPTER *ioc, sas_device = _scsih_sas_device_find_by_handle(ioc, handle); spin_unlock_irqrestore(&ioc->sas_device_lock, flags); if (sas_device) { +#ifndef SCSI_MPT2SAS _scsih_ir_fastpath(ioc, handle, element->PhysDiskNum); +#endif return; } @@ -6091,7 +6103,9 @@ _scsih_sas_pd_add(struct MPT3SAS_ADAPTER *ioc, mpt3sas_transport_update_links(ioc, sas_address, handle, sas_device_pg0.PhyNum, MPI2_SAS_NEG_LINK_RATE_1_5); +#ifndef SCSI_MPT2SAS _scsih_ir_fastpath(ioc, handle, element->PhysDiskNum); +#endif _scsih_add_device(ioc, handle, 0, 1); } @@ -6202,13 +6216,14 @@ _scsih_sas_ir_config_change_event(struct MPT3SAS_ADAPTER *ioc, element = (Mpi2EventIrConfigElement_t *)&event_data->ConfigElement[0]; if (ioc->shost_recovery) { - +#ifndef SCSI_MPT2SAS for (i = 0; i < event_data->NumElements; i++, element++) { if (element->ReasonCode == MPI2_EVENT_IR_CHANGE_RC_HIDE) _scsih_ir_fastpath(ioc, le16_to_cpu(element->PhysDiskDevHandle), element->PhysDiskNum); } +#endif return; } for (i = 0; i < event_data->NumElements; i++, element++) {