This read-only problem is very annoying. I also try to use my librem5 as a daily driver. As I drove with my car and Pure Maps and OSM Scout Server yesterday, the read-only problem happened as I stopped for 15 minutes. Maybe the plugged power to to the car socket did not get power in this time and a suspend happened. The librem5 display did not change any more while moving the car. After rebooting it worked again. I think this means, if you use the librem5 for navigating you must not enable suspend. (I will try that next time)
I wonder, that there are only so few comments to this topic. Because this topic is so annoying. Are there people, that do not face this read-only problem while using a sd-card and suspend enabled ? If so, which sd-card do you use ?
So maybe the problem is only with an encrypted sd-card. (/dev/mapper/crypt_home /home ext4 nofail 0 2) and with ext4 (you are using vfat).
Also if nothing is running I can suspend (most of the time) without problems. So maybe the problem only happens while writing to the sd-card.
Maybe I have to test when this problem occurs, and how I can provoke it.
Also I wonder why this never happens with the internal disk of the librem5. What is the difference ?
I haven’t come across this issue and I also use a LUKS encrypted SD card with ext4 format. I don’t use automatic suspend, but I do suspend it manually when I am going to be away from a power source for awhile.
I’m facing with the same problem. A small investigation shows that the problem is quite old. Unfortunately, there is no CONFIG_MMC_UNSAFE_RESUME in the modern kernel. But, in fact, another solution has been found - adding the “expecting_media_change” flag. Moreover, the code was merged, but it disappears in the last kernel version. Why? I tried to revert it back and it looks like everything works! There is only one drawback - you must not remove sdcard during suspend, and this limitation is ok for me.
That’s not the same problem, what used to be UNSAFE_RESUME is the default behavior now.
Because it was not a correct fix and the problem it was attempting to resolve (which was related to runtime PM) has been solved differently.
It’s still a useful thing to note if it does actually workaround the suspend problem. Reading the code, I’m confused how could that happen though - but that may just as well mean that my understanding is incomplete
In fact some additional investigating is needed… This is my patch and I can not find the exact commit that I used. But I can confirm that now my sdcard works well during suspend/resume cycles. What drawbacks can be expected by this patch?
It looks like I’ve found a workaround for this issue.
Some context first: I use ext4 fs over LUKS encrypted partition located on sd-card as soon as I keep my personal files here and I’d like to be protected if I lose the phone.
Solution: LUKS has suspend option when all io operation stopped. So, I’ve created luks-suspend-resume.service with the next content:
I’ve just tested the recent kernel update and it looks like this bug is really fixed! My test case is Waydroid with user data on sd-card. Previously, without my workaround, I got an i/o error after the first suspend. Now I’m able to suspend/resume several times without any issue! Thank you very much for so delicate work!
In fact, another issue with the display happen one time. Did you familiar with that? I mean the repeated messages like this:
March 23 10:11:34 pureos kernel: edt_ft5x06 2-0038: Unable to fetch data, error: -6
It floods my logs and the screen stays black. Sometime it is trying to on, I see a picture for a second or less, but finally it fails. Complete reboot fix the issue for a day or two.