Mark Kettenis <[email protected]> wrote: > > 1. How do we know if a device is non-removable, I don't think an MMC > > device indicates this, maybe we have to determine this by the > > controller? > > The hardware really doesn't know. It all depends how the controller > is actually wired up. You have to rely on the system firmware > (e.g. BIOS) to tell you. For ACPI systems the SD device namespace is > supposed to include a _RMV method that indicates whether the device is > removeable or not: > > https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/other-acpi-namespace-objects > > For OpenFirmware/FDT systems there is a "non-removable" property. > > Of course firmware can be buggy and lie to you...
Right. But we could "assume" that the rootfs on sdmmc should be "not ejected" at DVACT_SUSPEND time, and resurrected at DVACT_RESUME time. By walking sdmmc -> ... scsibus .. sd ... to sc_dev, and comparing it against rootdv and "whoa, we hold this one". If it isn't there when you resume you crash, or funny enough, we could simply go back to sleep since it doesn't exist, hoping for it to be present when we resume next time.
