Write to an A1-rated Micro SD card failed
#1
Hello,

While attempting to perform a performance comparison of A1-rated and non-A1-rated Micro SD cards, with additonal emphasis on using F2FS instead of ext4, I've encountered a major issue with the PineBook Pro's SD card interface.  Here are more details.

In a few words, attempting to write about 14.5 GiB to a Kingston A1-rated 16 GB UHS-I Micro SD card (SDCS2/16GB) resulted in a failure and the following Linux kernel messages, after writing about 700 MiB to the card:

Code:
[ 1933.684751] mmc_host mmc1: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual 400000HZ div = 0)
[ 1933.732717] mmc_host mmc1: Bus speed (slot 0) = 148500000Hz (slot req 150000000Hz, actual 148500000HZ div = 0)
[ 1933.895841] dwmmc_rockchip fe320000.mmc: Successfully tuned phase to 78
[ 1935.187343] blk_update_request: I/O error, dev mmcblk1, sector 0 op 0x1:(WRITE) flags 0x104000 phys_seg 256 prio class 0
[ 1935.187418] Buffer I/O error on dev mmcblk1, logical block 0, lost async page write
[ 1935.187464] Buffer I/O error on dev mmcblk1, logical block 1, lost async page write
[ 1935.187495] Buffer I/O error on dev mmcblk1, logical block 2, lost async page write
[ 1935.187527] Buffer I/O error on dev mmcblk1, logical block 3, lost async page write
[ 1935.187557] Buffer I/O error on dev mmcblk1, logical block 4, lost async page write
[ 1935.187585] Buffer I/O error on dev mmcblk1, logical block 5, lost async page write
[ 1935.187614] Buffer I/O error on dev mmcblk1, logical block 6, lost async page write
[ 1935.187642] Buffer I/O error on dev mmcblk1, logical block 7, lost async page write
[ 1935.187672] Buffer I/O error on dev mmcblk1, logical block 8, lost async page write
[ 1935.187702] Buffer I/O error on dev mmcblk1, logical block 9, lost async page write
[ 1935.204901] mmc_host mmc1: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual 400000HZ div = 0)
[ 1935.253334] mmc_host mmc1: Bus speed (slot 0) = 148500000Hz (slot req 150000000Hz, actual 148500000HZ div = 0)
[ 1935.675811] dwmmc_rockchip fe320000.mmc: Successfully tuned phase to 78
[ 1937.395704] dwmmc_rockchip fe320000.mmc: Successfully tuned phase to 78
[ 1937.656483] dwmmc_rockchip fe320000.mmc: Successfully tuned phase to 78
[ 1937.886460] dwmmc_rockchip fe320000.mmc: Successfully tuned phase to 78
[ 1937.887796] blk_update_request: I/O error, dev mmcblk1, sector 16384 op 0x1:(WRITE) flags 0x104000 phys_seg 256 prio class 0
[ 1938.316467] dwmmc_rockchip fe320000.mmc: Successfully tuned phase to 78
[ 1938.333230] mmc_host mmc1: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual 400000HZ div = 0)
[ 1938.381886] mmc_host mmc1: Bus speed (slot 0) = 148500000Hz (slot req 150000000Hz, actual 148500000HZ div = 0)
[ 1938.536382] dwmmc_rockchip fe320000.mmc: Successfully tuned phase to 78
[ 1938.542689] blk_update_request: I/O error, dev mmcblk1, sector 67584 op 0x1:(WRITE) flags 0x104000 phys_seg 256 prio class 0

This happened two times in a row, which makes the issue very easily reproducible.  Unfortunately, it also caused the Linux kernel to become locked up on shutdown, requiring the laptop to be forcedly powered off.

Here are the kernel messages upon inserting the A1-rated card:

Code:
[ 1777.728204] mmc_host mmc1: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual 400000HZ div = 0)
[ 1777.881900] mmc_host mmc1: Bus speed (slot 0) = 148500000Hz (slot req 150000000Hz, actual 148500000HZ div = 0)
[ 1778.177740] dwmmc_rockchip fe320000.mmc: Successfully tuned phase to 78
[ 1778.177828] mmc1: new ultra high speed SDR104 SDHC card at address 5048
[ 1778.179620] mmcblk1: mmc1:5048 SD16G 14.4 GiB
[ 1778.189478]  mmcblk1: p1

For reference, here are also the kernel messaged upon inserting a 16 GB UHS-I Micro SD card that is not A1-rated (Kingston SDCS/16GB):

Code:
[   56.649797] mmc_host mmc1: Bus speed (slot 0) = 148500000Hz (slot req 150000000Hz, actual 148500000HZ div = 0)
[   57.093248] dwmmc_rockchip fe320000.mmc: Successfully tuned phase to 97
[   57.093339] mmc1: new ultra high speed SDR104 SDHC card at address 1234
[   57.095057] mmcblk1: mmc1:1234 SA16G 14.5 GiB
[   57.103859]  mmcblk1: p1 p2

The card that is not A1-rated works perfectly.  As perfectly as it can be expected from a Micro SD card, of course. Cool

D'oh!  My first thoughts were that I got a bad A1-rated card.  Though, testing another A1-rated card (another sample of SDCS2/16GB) resulted in the same issue.  Time to try another approach; I wrote the same 14.5 GiB to the first A1-rated card using an external multi-format USB 3.0 card reader (Kingston FCR-HS3), and the write operation completed without errors.  Another write attempt, now using an el-cheapo, generic USB 2.0 Micro-SD-only card reader, resulted in no errors as well.

As a note, the write to the A1-rated card was about 30% slower (7.5 MB/s vs. 10.5 MB/s, as printed by dd) using the USB 2.0 card reader, compared with using the USB 3.0 card reader on the same upstream USB 3.0 port.  That's curious, but I'd need to test with a better USB 2.0 card reader before drawing any conclusions.

So, there is some good and some bad news.  The good news is that my A1-rated cards are fine (I was already prepared to blame Kingston!), and the bad news is that some problems exist in the Linux kernel driver for the Micro SD card interface in the PineBook Pro; it's pretty much safe to assume that the actual Micro SD card interface hardware is not the culprit.

I'm looking into the source of the Linux kernel driver, and I'll post my findings here.  Things don't look great, there are more than a few "this hardcoded value should be safe for all SoC implementations" points in the driver.  Though, those "safe" values could be tweaked and tested.

In the meantime, if anyone else has experienced the same or similar issues, please comment here.
  Reply


Messages In This Thread
Write to an A1-rated Micro SD card failed - by dsimic - 03-15-2021, 08:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Both hinges completely failed phuzy 20 10,409 01-02-2024, 02:03 AM
Last Post: Uturn
  eMMC failed Dendrocalamus64 9 6,809 11-12-2021, 11:08 AM
Last Post: Dendrocalamus64
Question Disassembling PineBook Pro Docking Deck (due to disappeared microSD card) gritibaenz 4 4,293 04-02-2021, 06:45 PM
Last Post: tkudog
  microSD card stuck charlesnorris 7 7,825 11-19-2020, 05:11 AM
Last Post: KC9UDX
  NVME SPI Update not booting SD Card WZ9V 5 6,251 10-18-2020, 08:36 PM
Last Post: wdt
  Upgrade eMMC card - boot problems alpopa 0 2,239 09-16-2020, 12:31 PM
Last Post: alpopa
  PBP not booting screen blank after SD card boot Jakobp 10 13,478 08-18-2020, 08:56 PM
Last Post: trinapicot
  Privacy switches - cutting power to wifi card as400 1 2,732 08-10-2020, 09:48 AM
Last Post: belfastraven
  SD card slot stefan.schumacher 1 2,999 03-28-2020, 04:34 PM
Last Post: zaius
  USB-C HUB: sd card slots and USB ports not usable vfr400racer 2 4,029 12-15-2019, 03:50 AM
Last Post: vfr400racer

Forum Jump:


Users browsing this thread: 1 Guest(s)