From patchwork Thu Mar 2 10:53:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 13157084 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B84B1C6FA8E for ; Thu, 2 Mar 2023 10:54:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229639AbjCBKyg (ORCPT ); Thu, 2 Mar 2023 05:54:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229673AbjCBKyf (ORCPT ); Thu, 2 Mar 2023 05:54:35 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B9C14EC5 for ; Thu, 2 Mar 2023 02:54:34 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id p20so15899743plw.13 for ; Thu, 02 Mar 2023 02:54:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1677754474; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=2q9jrcy1DNS8CTC6w1q2MZ59aRtYLDMjt9hejdQuq7A=; b=KfIuk8AHmAYXYsKo4ZEgwGXbY9YkmHrILgneq/mkrEZSOjR2ax9+65Frx+x+hAfS0t erU/EEfeJYR+BZzux328LcmaQX6txCyIasNeywiT0HLw8KHGZpK3SpdXpDkfIwoBSQrF 4JlFB0OIMOz+kQgVAAynd9WKBBFkrylFBlmwY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677754474; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2q9jrcy1DNS8CTC6w1q2MZ59aRtYLDMjt9hejdQuq7A=; b=ziPttXGCf8131jiW96Wvth/whteFCk5BOc2ELXIM+Nxls5aZW50ILCRtzRwDZo8jwx 5JgqJ+8Y1y+UEH1ReXq1JMRDfRBpACqyE3h03rVxHVBk3l7zFiwNdsVFDB1wKna62jFl WsJWBYgqb/P+dlXGlgADhyNepDxbcnAgpOnCrb9sigsz64Su7aoPn/9NHp8AMP3TC7j0 0KBj2G+kf+myLGmDI/A3UhmWzkIYxwxixM58khSJetIV/5NwWAe4snfeoHS+eMoWkkoF w9YlALgEPOKDPIvySMoezrQTsD6ZP22RKK/bVjjiIiVgMTiILjAN+rI70JKb2hktc1uR 5VMA== X-Gm-Message-State: AO0yUKWxjuwew7tLk7sCj/CnxUpZbETj3/YxpMcBYT7wFy5GYUmVjYVa GitaSAMzBAJ7MqNa2qO1L+Qy49X5ZjT03N/e5q1zkgVoES9xI+enDA8UGOaUerCi3Dg8gKaBlQ/ Lx1d+YqowPmuvVSLfhZPmNWnf5iGHPwtouRkYvymOrN7XEhMVZLx0wiPNDTr0AMDLB6nXVM7XP+ 6iKDSRNyt2KdjejeI= X-Google-Smtp-Source: AK7set+5NcDBoqHKfLcE+lbWaC52iM2hkUYcp1+mghrWhNebsP9s8YJ6PhWji2SZFj3UC/Q3YPGwnQ== X-Received: by 2002:a05:6a20:9144:b0:bb:b903:d836 with SMTP id x4-20020a056a20914400b000bbb903d836mr11117053pzc.54.1677754473578; Thu, 02 Mar 2023 02:54:33 -0800 (PST) Received: from dhcp-10-123-20-35.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id x14-20020a63170e000000b00502e1c50af3sm8865873pgl.45.2023.03.02.02.54.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 02:54:32 -0800 (PST) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: sumit.saxena@broadcom.com, Chandrakanth Patil Subject: [PATCH 2/3] megaraid_sas: Add crash dump mode capability bit in MFI capabilities Date: Thu, 2 Mar 2023 16:23:41 +0530 Message-Id: <20230302105342.34933-3-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230302105342.34933-1-chandrakanth.patil@broadcom.com> References: <20230302105342.34933-1-chandrakanth.patil@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org In kdump kernel mode, the driver works in reduced functionality mode with some features disabled such as reduced MSIX count and RDPQ disabled etc. However, the firmware is not aware of this mode, in some cases, which results in undefined behavior. To address this, the driver informs the firmware about the kdump mode driver through MPI capabilities bit during driver initialization. So firmware can adjust its behavior accordingly. Signed-off-by: Chandrakanth Patil Signed-off-by: Sumit Saxena --- drivers/scsi/megaraid/megaraid_sas.h | 6 ++++-- drivers/scsi/megaraid/megaraid_sas_fusion.c | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 2ef9d41fc6f4..c2bace65105b 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -1760,7 +1760,8 @@ union megasas_sgl_frame { typedef union _MFI_CAPABILITIES { struct { #if defined(__BIG_ENDIAN_BITFIELD) - u32 reserved:16; + u32 reserved:15; + u32 support_memdump:1; u32 support_fw_exposed_dev_list:1; u32 support_nvme_passthru:1; u32 support_64bit_mode:1; @@ -1794,7 +1795,8 @@ typedef union _MFI_CAPABILITIES { u32 support_64bit_mode:1; u32 support_nvme_passthru:1; u32 support_fw_exposed_dev_list:1; - u32 reserved:16; + u32 support_memdump:1; + u32 reserved:15; #endif } mfi_capabilities; __le32 reg; diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index fe70f8f11435..7ebfbe0c2ba7 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -1201,6 +1201,9 @@ megasas_ioc_init_fusion(struct megasas_instance *instance) drv_ops->mfi_capabilities.support_nvme_passthru = 1; drv_ops->mfi_capabilities.support_fw_exposed_dev_list = 1; + if (reset_devices) + drv_ops->mfi_capabilities.support_memdump = 1; + if (instance->consistent_mask_64bit) drv_ops->mfi_capabilities.support_64bit_mode = 1;