aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStuart Hayes <stuart.w.hayes@gmail.com>2018-09-26 17:50:17 -0400
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-09-27 05:18:15 -0400
commit6aecee6ad41cf97c0270f72da032c10eef025bf0 (patch)
treecc63cf0a67db9c8555a789b5984c116ad82e9c16 /drivers
parentf7eaf3fb9d10cc72669fe8c8bd204087a65e50f6 (diff)
firmware: dell_rbu: Make payload memory uncachable
The dell_rbu driver takes firmware update payloads and puts them in memory so the system BIOS can find them after a reboot. This sometimes fails (though rarely), because the memory containing the payload is in the CPU cache but never gets written back to main memory before the system is rebooted (CPU cache contents are lost on reboot). With this patch, the payload memory will be changed to uncachable to ensure that the payload is actually in main memory before the system is rebooted. Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firmware/dell_rbu.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c
index fb8af5cb7c9b..ccefa84f7305 100644
--- a/drivers/firmware/dell_rbu.c
+++ b/drivers/firmware/dell_rbu.c
@@ -45,6 +45,7 @@
45#include <linux/moduleparam.h> 45#include <linux/moduleparam.h>
46#include <linux/firmware.h> 46#include <linux/firmware.h>
47#include <linux/dma-mapping.h> 47#include <linux/dma-mapping.h>
48#include <asm/set_memory.h>
48 49
49MODULE_AUTHOR("Abhay Salunke <abhay_salunke@dell.com>"); 50MODULE_AUTHOR("Abhay Salunke <abhay_salunke@dell.com>");
50MODULE_DESCRIPTION("Driver for updating BIOS image on DELL systems"); 51MODULE_DESCRIPTION("Driver for updating BIOS image on DELL systems");
@@ -181,6 +182,11 @@ static int create_packet(void *data, size_t length)
181 packet_data_temp_buf = NULL; 182 packet_data_temp_buf = NULL;
182 } 183 }
183 } 184 }
185 /*
186 * set to uncachable or it may never get written back before reboot
187 */
188 set_memory_uc((unsigned long)packet_data_temp_buf, 1 << ordernum);
189
184 spin_lock(&rbu_data.lock); 190 spin_lock(&rbu_data.lock);
185 191
186 newpacket->data = packet_data_temp_buf; 192 newpacket->data = packet_data_temp_buf;
@@ -349,6 +355,8 @@ static void packet_empty_list(void)
349 * to make sure there are no stale RBU packets left in memory 355 * to make sure there are no stale RBU packets left in memory
350 */ 356 */
351 memset(newpacket->data, 0, rbu_data.packetsize); 357 memset(newpacket->data, 0, rbu_data.packetsize);
358 set_memory_wb((unsigned long)newpacket->data,
359 1 << newpacket->ordernum);
352 free_pages((unsigned long) newpacket->data, 360 free_pages((unsigned long) newpacket->data,
353 newpacket->ordernum); 361 newpacket->ordernum);
354 kfree(newpacket); 362 kfree(newpacket);