From patchwork Wed Mar 17 19:08:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 403920 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=-18.9 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 01F8EC433DB for ; Wed, 17 Mar 2021 19:09:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ADB2064F5E for ; Wed, 17 Mar 2021 19:09:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231594AbhCQTJH (ORCPT ); Wed, 17 Mar 2021 15:09:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232865AbhCQTIz (ORCPT ); Wed, 17 Mar 2021 15:08:55 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6586AC06174A for ; Wed, 17 Mar 2021 12:08:55 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id g15so1803465pfq.3 for ; Wed, 17 Mar 2021 12:08:55 -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=AbADmU79g3cfEX6BTSGwQVLOGmk5Bnx8cNXWeNmlCCU=; b=KsEzvOAwGhZADvERQQBQu+cO6ueYpv5vry2CqebqdRp1VZjXdwHyGqiIB7trHPp+FP tzJ8Zpz1xlDJgA23hw2idiv+hLVzVgh0u58TkbziyK00yvi7U3XNKSv9mEoLtaoE7+XC 6lHiXiS+TXSJW5U7MBZDt9/JQlpNkhAvXiRYs= 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=AbADmU79g3cfEX6BTSGwQVLOGmk5Bnx8cNXWeNmlCCU=; b=nwuTidrFrI9mHcA/HXciHV0vFdWFk1YhIhprZyLTIv83CsYQG2MY6WeLri0/kX9DBv 5scKoYRi/dUCLgDcREdzyo6DHUASUczRIugn3+cbuaOTv2LWwdxktEGNTSiPKotCTa2O wbkVRy7zhWOMZH8Nuk/wOdw7QV4Xy4H/AgEs789g+6ULLXq5C53sAbhoQU9TdPWmi5sU C6hl0Qeqt34n3J2k+goVRYZasxj2IVMQOWG6x3qwm+oXBt8U03sV20WHB7zysAS1Cw1e SD7967c+/U3K00otYTzGU1wffjw9D3/4wkMsObqVmookXr4RGRR2n/dwWo1Ul+VKQYSd PGlg== X-Gm-Message-State: AOAM532lVbNgdzNHpQG0U6Cxlg4fY21M/qq4dE0SwD6kUg4roNBVVkX+ JxcTPOyxWuIkAjt17JdtmLYF5w== X-Google-Smtp-Source: ABdhPJym0xwXRikJ6GEWuRwrJ5dH2ylrr5revtn3/l8f6IId+/3QrXB3y7/6tf1ECnl6qUNfLj6i6w== X-Received: by 2002:a63:f754:: with SMTP id f20mr3724735pgk.382.1616008134894; Wed, 17 Mar 2021 12:08:54 -0700 (PDT) Received: from dhcp-10-123-20-75.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id w2sm20569437pgh.54.2021.03.17.12.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 12:08:54 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, anand.lodnoor@broadcom.com, Chandrakanth Patil , stable@vger.kernel.org Subject: [PATCH 1/5] megaraid_sas: Send all non-RW IOs for TYPE_ENCLOSURE device through firmware Date: Thu, 18 Mar 2021 00:38:20 +0530 Message-Id: <20210317190824.3050-2-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20210317190824.3050-1-chandrakanth.patil@broadcom.com> References: <20210317190824.3050-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.10+ 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 38fc9467c625..73295cf74cbe 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -3167,6 +3167,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; @@ -3201,8 +3203,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);