[PATCH 4.4 062/192] [PATCH 065/135] megaraid_sas: Add an i/o barrier

From: Greg Kroah-Hartman
Date: Mon Sep 12 2016 - 13:08:26 EST


4.4-stable review patch. If anyone has any objections, please let me know.

------------------

[ Upstream commit b99dbe56d511eb07de33bfa1b99ac5a6ff76ae08 ]

A barrier should be added to ensure proper ordering of memory mapped
writes.

Signed-off-by: Tomas Henzl <thenzl@xxxxxxxxxx>
Reviewed-by: Kashyap Desai <kashyap.desai@xxxxxxxxxxxx>
Acked-by: Kashyap Desai <kashyap.desai@xxxxxxxxxxxx>
Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
Signed-off-by: Sasha Levin <alexander.levin@xxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
drivers/scsi/megaraid/megaraid_sas_base.c | 1 +
drivers/scsi/megaraid/megaraid_sas_fusion.c | 1 +
2 files changed, 2 insertions(+)

--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -735,6 +735,7 @@ megasas_fire_cmd_skinny(struct megasas_i
&(regs)->inbound_high_queue_port);
writel((lower_32_bits(frame_phys_addr) | (frame_count<<1))|1,
&(regs)->inbound_low_queue_port);
+ mmiowb();
spin_unlock_irqrestore(&instance->hba_lock, flags);
}

--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -201,6 +201,7 @@ megasas_fire_cmd_fusion(struct megasas_i
&instance->reg_set->inbound_low_queue_port);
writel(le32_to_cpu(req_desc->u.high),
&instance->reg_set->inbound_high_queue_port);
+ mmiowb();
spin_unlock_irqrestore(&instance->hba_lock, flags);
#endif
}