]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
scsi: megaraid_sas: Add crash dump mode capability bit in MFI capabilities
authorChandrakanth Patil <chandrakanth.patil@broadcom.com>
Thu, 2 Mar 2023 10:53:41 +0000 (16:23 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 6 Mar 2023 23:33:13 +0000 (18:33 -0500)
In kdump kernel mode, the driver works in reduced functionality mode with
some features disabled such as reduced MSI-X 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
through MPI capabilities bit during driver initialization.  This allows
firmware to adjust its behavior accordingly.

Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com>
Link: https://lore.kernel.org/r/20230302105342.34933-3-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/megaraid/megaraid_sas.h
drivers/scsi/megaraid/megaraid_sas_fusion.c

index 2ef9d41fc6f42ccea1bfbfff552ab9089bdba210..c2bace65105b1c42676623de34ad2ca864ac49f9 100644 (file)
@@ -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;
index 6597e118c805af60de2155266b00391f470e4539..84c9a55a5794c814c9bf8960d503130f2f3b451b 100644 (file)
@@ -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;