0

I have a Jasper Lake mini PC with an Intel Micro SD card reader, running Ubuntu 22.04.

If I have an SD card in the reader when I boot the machine, the card is not found, no block device is created, lsblk shows only the internal storage.

If I remove and reinsert the card, the device shows up and I can mount the SD card as normal.

I've tried removing and readding the sdhci (and sdhci_pci) kernel module, but that doesn't work because the internal storage is also mmc and is removed so that I can't then run modprobe to reinstall it

Is there a way to trigger the card insertion code at boot time? Write to somewhere in /sys or /proc perhaps?

Any help would be much appreciated.

ajh499
  • 1
  • 1
  • Dirty solution : `partprobe -s` working? – K-attila- Jul 19 '22 at 13:55
  • Partprobe? I'll try it but I doubt it'll do anything, there's no block device to probe for partitions. – ajh499 Jul 19 '22 at 15:41
  • Nope, partprobe does nothing. – ajh499 Jul 19 '22 at 16:59
  • I had hoped that something like ```echo mmc0:aaaa > /sys/bus/mmc/drivers/mmcblk/bind``` would work, mmc0 is the device I'm looking for, but it doesn't exist after a reboot until an SD card is reinserted – ajh499 Jul 19 '22 at 17:01
  • Another dirty hack? https://www.skytale.net/blog/archives/24-Resetting-SATA-devices-under-Linux.html – K-attila- Jul 20 '22 at 07:53
  • @K-att- I tried a bunch of stuff like that (see my comment above) but couldn't find anything that worked. I can't use anything in /sys/block because there's nothing there until the SD card is reinserted – ajh499 Jul 20 '22 at 12:00
  • Hummm.... What happened when you insert the card? Can you check the log? – K-attila- Jul 20 '22 at 14:59

3 Answers3

0

I'm just facing exactly the same issue.

I've found some workaround but none of them work for me. I've tried with:

  1. editing Grub defaults to include pciehp.pciehp_force=1 in the command line
  2. re-scanning the PCI bus: echo 1 > /sys/bus/pci/rescan
  3. reloading kernel modules with systemctl restart systemd-modules-load.service

I've also been playing with udev with no luck.

Hope some of those hints work for you. My mini-pc is a MELE quieter 3q.

mattia.b89
  • 3,142
  • 2
  • 14
  • 39
  • Ah, that's the same minipc that I'm using. I think I found a fix, see my post above – ajh499 Jul 21 '22 at 11:02
  • fantastic mate, that did the trick. I was looking for the rights commands to remove and rescan the mmc, just as you did. Thanks! PS: I made a simple systemd service that runs the script at boot time – mgutierrez Jul 22 '22 at 13:22
0

I think I've found a solution that works for me.

Remove the mmc device, then rescan the PCI bus. After doing this the block device is created and the SD card can be mounted as normal

echo 1 > /sys/class/mmc_host/mmc0/device/remove

echo 1 > /sys/class/pci_bus/0000\:00/rescan

ajh499
  • 1
  • 1
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 31 '22 at 16:28
0

I can confirm that running the commands proposed by ajh499 does, indeed, allow one to access the microSD card without ejecting and reinserting it. If however, one needs to remove it, it is, probably safe to use the former of the two commands, because the graphical removal tool seems to not be able to allow it to be removed safely. Now, what would be nice, would be to be able to get the microSD card recognized at boot time. It is certainly possible to get it recognised, if one fits it into a (sourced separately) USB card reader, but not when the microSD card sits in the Mele quieter 3Q microSD card slot ! Annoying, since booting from a microSD card is possible in positively ancient computers. A matter for the BIOS/UEFI ?

  • This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://unix.stackexchange.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://unix.stackexchange.com/help/whats-reputation), you can also [add a bounty](https://unix.stackexchange.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/late-answers/422998) – G-Man Says 'Reinstate Monica' Sep 10 '22 at 23:55