From patchwork Fri May 21 10:25:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 445042 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, URIBL_BLOCKED, 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 93FF6C433B4 for ; Fri, 21 May 2021 10:26:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 74732613AE for ; Fri, 21 May 2021 10:26:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232225AbhEUK15 (ORCPT ); Fri, 21 May 2021 06:27:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231706AbhEUK1s (ORCPT ); Fri, 21 May 2021 06:27:48 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E54CC061763 for ; Fri, 21 May 2021 03:26:25 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id c12so2999776pfl.3 for ; Fri, 21 May 2021 03:26:25 -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=ZlMtgJUy6Q+f0OdhwAmXGj3gAMU3iOQ3xdRy/NooUek=; b=S8lnpvewtCk1xLCJDWwDFGHNJg4bXH1gP06Pk/axLAZtZcqu4vQxj7CNUpQD0ycUkg uayr+ItrIH2k+Q2iiGyEkT+QjnQrBHxlFgPg6gpJjyavX9DpQxCzIe4I5kfuKySq8E2h uJb0v/rhkH7Wcsuc9C2zTBZE2JUHiHDvXvMak= 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=ZlMtgJUy6Q+f0OdhwAmXGj3gAMU3iOQ3xdRy/NooUek=; b=fq4wYjcCAJ+0sDggcKDFzO4j5lRrcF0s//AfhrgFMEDwZcP0vbm7KLJuCW+q2HKVxM mABJGu7cazHGS0DGvT47GrSSjukEC9H5pIyGsQByFp8AH1x5vjguPpBN5id7H2TSwwuA lFWVynBhuIFWwVKSVXFX7tV2ck7SXAzR/WB9Uty6cguwIhyUKE740KKZXv+mE7DIz2qB jkPvAJMgkVyTQPHLiv2VQg+KU05LhenRFhBhuSmK/9TVe8zERGjKTuSfkC2cB+++bM0a Ipqto0j10q3SZZw6YCWj2AvnrzrVITdGJQU2G4UyQ+eNoTeLlhrbFt85uj0zLwWyUVrI cU3Q== X-Gm-Message-State: AOAM5317B8+S/SNT0RHC/jqR64djZ7GsurZqlzTfdRT4fLuLki4KZAQB 6NE10asMPR6ObFyuMgVsMUIAiZ0jQrpLNaYH1Qgf3qbid1MkHTImDeWkuuazpFlLam7QP/QlYsz J3eeuex0uNsysgWJTgW3gW3+T8rxknm5jtT42WbesvBF5xgbEspreZ4Tcv+UyA6lnpCqmbJXSea kWoav0eOPj8ZSqaBs= X-Google-Smtp-Source: ABdhPJzFspZHWyut2RCjQhjaCIdLMnhnX3+RLylZldAPB90MhiHXno55mlhd/9CaNYtfajQSVlhu9g== X-Received: by 2002:a05:6a00:787:b029:2dd:15b6:515a with SMTP id g7-20020a056a000787b02902dd15b6515amr9666178pfu.26.1621592784108; Fri, 21 May 2021 03:26:24 -0700 (PDT) Received: from dhcp-10-123-20-83.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id j3sm4197858pfe.98.2021.05.21.03.26.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 03:26:23 -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 v2 1/5] megaraid_sas: Send all non-RW IOs for TYPE_ENCLOSURE device through firmware Date: Fri, 21 May 2021 15:55:44 +0530 Message-Id: <20210521102548.11156-2-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20210521102548.11156-1-chandrakanth.patil@broadcom.com> References: <20210521102548.11156-1-chandrakanth.patil@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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);