Skip to content

fix block layer and scsi SD card runtime power management

this is one "solution" (preliminary) that is being discussed at https://lore.kernel.org/linux-scsi/20200729154056.GA1575761@rowland.harvard.edu/T/#t

in short: the SCSI layer explicitely always treats "sd card changed" as an error and fails. Even if a driver flag called "expecting_cc_ua" is set. After runtime suspend, in our case, the SD cardreader loses power and treats the card as a new card, triggering "card changed". We create a new flag, that we only set for runtime_resume() that ignores "card changed". That's the SCSI side of things.

The solution that James Bottomley suggests is basically the same, but with more details / policy about when driver should set that new flag. For our specific kernel, this won't change anything.

The block layer just has logic errors regarding runtime pm that get fixed here.

Fixes: https://source.puri.sm/Librem5/linux-next/-/issues/196

Edited by Martin Kepplinger

Merge request reports