From patchwork Fri May 28 13:13:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth patil X-Patchwork-Id: 450021 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_HEADER_CTYPE_ONLY, SPF_HELO_NONE, SPF_PASS, T_TVD_MIME_NO_HEADERS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16739C2B9F7 for ; Fri, 28 May 2021 13:13:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E08CC61183 for ; Fri, 28 May 2021 13:13:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235956AbhE1NPZ (ORCPT ); Fri, 28 May 2021 09:15:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235839AbhE1NPY (ORCPT ); Fri, 28 May 2021 09:15:24 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59861C061574 for ; Fri, 28 May 2021 06:13:50 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id q67so3216705pfb.4 for ; Fri, 28 May 2021 06:13:50 -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=dusFIP+JXNw/56OeCrGPqJePb9p4+goZ25cbmlWvQhU=; b=PcDSnSlxhc12fulunfTxtQlX7+D8wcsxLZmALTe0clQRuPmiqNThFtSlmK9JBaBVUh BwsIIgoWMd8Pc8O4DrHWJBX2yGAei4lCDSAZMhMz9USuFeckBuzplU3n0kvEJ43ai7to n8x8ImPySyJBsQW8aPSY0/O/z5I9VoSOAZKP0= 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=dusFIP+JXNw/56OeCrGPqJePb9p4+goZ25cbmlWvQhU=; b=R5Xyf+vi0mW7mICr0f4469MbAnDksPTzisEQZZnVRD9iCpUn0o9p6MRMM/J1qMDA8l iMvGDUexB7pLXffX5Jios2UZM88a01S+08/0jA3sFjYMvMBWFD+KenY6qZksdA8QTt4Q TEJYtWp120q2wkWgEjoDb+bkxdQsYvoJJBM44eno7SW5lKmpeVNnKHgTFvOesYKxuvpH KKIr9iLTvl369Cyj/l6REb+1Dts1gkHosaPrApc3kcX0CPD7YpS48dcMUonuGipnNFsW j9u7pvSQGOnpAOmrsX4ZC7F9010DDih/xTuqh89ih5/Mlp49J4TVsd+FBP+Fxtb9mfpb 9uHg== X-Gm-Message-State: AOAM531e4auRi84MmDP5lsQzb0B17HT7aWFr9kqDn7mOY4BIno1n/pYq gHJmVYc9EcaTQPcrtQ/GGd1hHA== X-Google-Smtp-Source: ABdhPJywd37noY9xk4QXmR3mLwcKYobwUgxyQjp8MA7c5G0cfBRXXkbq8qLH8utrr9TF3lYiFrc7kg== X-Received: by 2002:a63:5664:: with SMTP id g36mr8876728pgm.357.1622207629751; Fri, 28 May 2021 06:13:49 -0700 (PDT) Received: from dhcp-10-123-20-83.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id o2sm4238434pfu.80.2021.05.28.06.13.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 May 2021 06:13:49 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, Chandrakanth Patil , 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 Message-Id: <20210528131307.25683-2-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20210528131307.25683-1-chandrakanth.patil@broadcom.com> References: <20210528131307.25683-1-chandrakanth.patil@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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: # v5.11+ Signed-off-by: Chandrakanth Patil Signed-off-by: Sumit Saxena --- 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);