Note that this one is a bit fishy: it seems like it should always be read
and written using either words or bytes, but never using a mixture.

Please verify against the hardware documentation.

Signed-off-by: Christoph Hellwig <h...@lst.de>
---
 drivers/scsi/megaraid/megaraid_sas.h      | 2 +-
 drivers/scsi/megaraid/megaraid_sas_base.c | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas.h 
b/drivers/scsi/megaraid/megaraid_sas.h
index 81484f1..465dd45 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -1676,7 +1676,7 @@ struct megasas_instance {
        u32 drv_buf_alloc;
        u32 crash_dump_fw_support;
        u32 crash_dump_drv_support;
-       u32 crash_dump_app_support;
+       __le32 crash_dump_app_support;
        u32 secure_jbod_support;
        spinlock_t crashdump_lock;
 
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c 
b/drivers/scsi/megaraid/megaraid_sas_base.c
index 3d4a080..29a1b20 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -6010,7 +6010,7 @@ static int megasas_set_crash_dump_params_ioctl(
 {
        struct megasas_instance *local_instance;
        int i, error = 0;
-       int crash_support;
+       __le32 crash_support;
 
        crash_support = cmd->frame->dcmd.mbox.w[0];
 
@@ -6020,7 +6020,7 @@ static int megasas_set_crash_dump_params_ioctl(
                        if ((local_instance->adprecovery ==
                                MEGASAS_HBA_OPERATIONAL) &&
                                !megasas_set_crash_dump_params(local_instance,
-                                       crash_support)) {
+                                       le32_to_cpu(crash_support))) {
                                local_instance->crash_dump_app_support =
                                        crash_support;
                                dev_info(&local_instance->pdev->dev,
@@ -6084,7 +6084,8 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
                                               MFI_FRAME_SGL64 |
                                               MFI_FRAME_SENSE64));
 
-       if (cmd->frame->dcmd.opcode == MR_DRIVER_SET_APP_CRASHDUMP_MODE) {
+       if (cmd->frame->dcmd.opcode ==
+                       cpu_to_le32(MR_DRIVER_SET_APP_CRASHDUMP_MODE)) {
                error = megasas_set_crash_dump_params_ioctl(cmd);
                megasas_return_cmd(instance, cmd);
                return error;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to