From: Shivasharan S Date: Fri, 10 Feb 2017 08:59:23 +0000 (-0800) Subject: scsi: megaraid_sas: latest controller OCR capability from FW before sending shutdown... X-Git-Tag: v4.1.12-102.0.20170601_1400~20 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5f70c617bc93464cd9117d6eda5f81b699c4a036;p=users%2Fjedix%2Flinux-maple.git scsi: megaraid_sas: latest controller OCR capability from FW before sending shutdown DCMD Orabug: 26096381 Fetch the latest controller OCR capability from FW before sending MR_DCMD_CTRL_SHUTDOWN When application sends a shutdown DCMD (MR_DCMD_CTRL_SHUTDOWN), driver will fetch latest controller information from firmware. This is to ensure that driver always has latest OCR capability of controller before sending the DCMD. Signed-off-by: Kashyap Desai Signed-off-by: Shivasharan S Reviewed-by: Hannes Reinecke Reviewed-by: Tomas Henzl Signed-off-by: Martin K. Petersen (cherry picked from commit 95c060869e6872ea03a4a9d15236adcffb1d8b07) Signed-off-by: Somasundaram Krishnasamy Signed-off-by: Kirtikar Kashyap Reviewed-by: Dhaval Giani --- diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index eecba7726ecdf..d9550d6941667 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -6717,6 +6717,13 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance, MFI_FRAME_SGL64 | MFI_FRAME_SENSE64)); + if (cmd->frame->dcmd.opcode == MR_DCMD_CTRL_SHUTDOWN) { + if (megasas_get_ctrl_info(instance) != DCMD_SUCCESS) { + megasas_return_cmd(instance, cmd); + return -1; + } + } + if (cmd->frame->dcmd.opcode == MR_DRIVER_SET_APP_CRASHDUMP_MODE) { error = megasas_set_crash_dump_params_ioctl(cmd); megasas_return_cmd(instance, cmd);