Skip to content

Commit 51c0859

Browse files
committed
--flash_gpu_descriptor: Keep bay power if already on
84ffa84 made sure to turn on and off the bay power to enable programming the EEPROM even with bad eeprom (which would cause EC not to turn on bay power). But this would cause issue for reprogramming a good eeprom because the power is already on and it would turn it off afterwards. So if the bay power if turned off for a GPU when windows with nvidia driver is running, the driver crashes and bluescreens Windows. Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 6649bce commit 51c0859

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

  • framework_lib/src/chromium_ec

framework_lib/src/chromium_ec/mod.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,15 +1354,18 @@ impl CrosEc {
13541354
}
13551355

13561356
if let Ok(ExpansionBayBoard::DualInterposer) = info.expansion_bay_board() {
1357-
/* Force power to the GPU if we are writing the EEPROM */
1358-
let res = self.set_gpio("gpu_3v_5v_en", true);
1359-
if let Err(err) = res {
1360-
error!("Failed to set ALW power to GPU off {:?}", err);
1361-
return Err(err);
1357+
// If bay power is on already, we don't need to enable/disable it
1358+
if !self.get_gpio("gpu_3v_5v_en")? {
1359+
// Force power to the GPU if we are writing the EEPROM
1360+
let res = self.set_gpio("gpu_3v_5v_en", true);
1361+
if let Err(err) = res {
1362+
error!("Failed to set ALW power to GPU off {:?}", err);
1363+
return Err(err);
1364+
}
1365+
println!("Forcing Power to GPU");
1366+
os_specific::sleep(100_000);
1367+
force_power = true;
13621368
}
1363-
println!("Forcing Power to GPU");
1364-
os_specific::sleep(100_000);
1365-
force_power = true;
13661369
}
13671370

13681371
// Need to program the EEPROM 32 bytes at a time.

0 commit comments

Comments
 (0)