Browse Source

abcdisk: don't unmount on activity change, only on host type change

There is no need to unmount all the drives on an activity change. We
do need to unmount on a host type change, and we very much should
*sync* when going offline. Can set the sync bit when going online too;
none of the drives will be dirty at that point so it is basically a
noop, but makes the code simpler.
H. Peter Anvin 3 years ago
parent
commit
fa5b8f0613
6 changed files with 5289 additions and 5286 deletions
  1. BIN
      fpga/output_files/max80.jbc
  2. BIN
      fpga/output_files/max80.jic
  3. BIN
      fpga/output_files/max80.pof
  4. BIN
      fpga/output_files/max80.sof
  5. 5 2
      fw/abcdisk.c
  6. 5284 5284
      fw/boot.mif

BIN
fpga/output_files/max80.jbc


BIN
fpga/output_files/max80.jic


BIN
fpga/output_files/max80.pof


BIN
fpga/output_files/max80.sof


+ 5 - 2
fw/abcdisk.c

@@ -686,6 +686,7 @@ void abcdisk_io_poll(void)
     static uint32_t last_sync;
     static uint32_t last_timer = -1U;
     static uint32_t prev_abc_status = -1U;
+    uint32_t abc_status_change;
 
     uint32_t now = timer_count();
     bool need_sync = false;
@@ -715,7 +716,8 @@ void abcdisk_io_poll(void)
 	last_timer = now;
     }
 
-    if (abc_status != prev_abc_status) {
+    abc_status_change = abc_status ^ prev_abc_status;
+    if (unlikely(abc_status_change)) {
 	const char *host;
 
 	prev_abc_status = abc_status;
@@ -726,8 +728,9 @@ void abcdisk_io_poll(void)
 	con_puts(abc_status & ABC_STATUS_800 ? "ABC800" : "ABC80");
 	con_puts(abc_status & ABC_STATUS_LIVE ? " (online)\n" : " (offline)\n");
 
-	unmount_all = true;
+	unmount_all = !!(abc_status_change & ABC_STATUS_800);
 	reset_all   = true;
+	need_sync   = true;
     }
 
     for (int i = 0; i < CONTROLLER_TYPES; i++) {

File diff suppressed because it is too large
+ 5284 - 5284
fw/boot.mif


Some files were not shown because too many files changed in this diff