diff --git a/main.c b/main.c index ce98a3ed..d753a425 100644 --- a/main.c +++ b/main.c @@ -1167,6 +1167,8 @@ void loadHdlInfoModule(void) //--------------------------------------------------------------------------- static void closeAllAndPoweroff(void) { + int i; + if (ps2dev9_loaded) { /* Close all files */ fileXioDevctl("pfs:", PDIOC_CLOSEALL, NULL, 0, NULL, 0); @@ -1175,6 +1177,13 @@ static void closeAllAndPoweroff(void) }; } + // As required by some (typically 2.5") HDDs, issue the SCSI STOP UNIT command to avoid causing an emergency park. + for (i = 0; i < USB_mass_max_drives; i++) { + char device[7]; + sprintf(device, "mass%d:", i); + fileXioDevctl(device, USBMASS_DEVCTL_STOP_UNIT, NULL, 0, NULL, 0); + } + /* Power-off the PlayStation 2 console. */ poweroffShutdown(); }