yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] blahmartinblah:
No problem. Here you go:

[ 0.599794] mmc1: no vqmmc regulator found
[ 0.599806] mmc1: no vmmc regulator found
[ 0.600075] mmc1: sdhci_msm_check_power_status: request 2 curr_pwr_state 0 curr_io_level 0
[ 0.600099] mmc1: Received IRQ(253), status=0x2
[ 0.601811] mmc1: Handled IRQ(253), ret=0, ack=0x1
[ 0.601829] mmc1: sdhci_msm_check_power_status: request 2 done
[ 0.612910] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.623955] mmc1: sdhci_msm_check_power_status: request 8 curr_pwr_state 2 curr_io_level 8
[ 0.623961] mmc1: sdhci_msm_check_power_status: request 8 done
[ 0.629488] mmc1: SDHCI controller on 7864900.sdhci [7864900.sdhci] using 32-bit ADMA
[ 0.684156] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.684164] mmc1: sdhci_msm_check_power_status: request 1 curr_pwr_state 2 curr_io_level 8
[ 0.684178] mmc1: Received IRQ(253), status=0x1
[ 0.684797] mmc1: Handled IRQ(253), ret=0, ack=0x1
[ 0.684816] mmc1: sdhci_msm_check_power_status: request 1 done
[ 0.684824] mmc1: sdhci_msm_check_power_status: request 1 curr_pwr_state 1 curr_io_level 4
[ 0.684832] mmc1: sdhci_msm_check_power_status: request 1 done
[ 0.684845] mmc1: request to disable clocks
[ 0.688640] mmc1: sdhci_msm_enable_controller_clock: enabled controller clock
[ 0.688648] mmc1: sdhci_msm_check_power_status: request 2 curr_pwr_state 1 curr_io_level 4
[ 0.688662] mmc1: Received IRQ(253), status=0x2
[ 0.690417] mmc1: Handled IRQ(253), ret=0, ack=0x1
[ 0.690446] mmc1: sdhci_msm_check_power_status: request 2 done
[ 0.701473] mmc1: request to enable clocks
[ 0.701540] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.712572] mmc1: sdhci_msm_check_power_status: request 8 curr_pwr_state 2 curr_io_level 8
[ 0.712579] mmc1: sdhci_msm_check_power_status: request 8 done
[ 0.719075] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.721280] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.726718] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.727238] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.727245] mmc1: sdhci_msm_check_power_status: request 1 curr_pwr_state 2 curr_io_level 8
[ 0.727265] mmc1: Received IRQ(253), status=0x1
[ 0.727862] mmc1: Handled IRQ(253), ret=0, ack=0x1
[ 0.727878] mmc1: sdhci_msm_check_power_status: request 1 done
[ 0.727886] mmc1: sdhci_msm_check_power_status: request 1 curr_pwr_state 1 curr_io_level 4
[ 0.727895] mmc1: sdhci_msm_check_power_status: request 1 done
[ 0.727907] mmc1: request to disable clocks
[Miscellaneous Android Development] cool400:
Did this kernel solved the SD card problem for you?

I will try it out as soon as I'm back at my computer.

Thanks ottmi!
[Miscellaneous Android Development] blahmartinblah:
Sorry, I should have mentioned that. It didn't resolve the issue for me, but hopefully the new debug information provides Ottmi with some clues how maybe it can be fixed.

Martin
[Miscellaneous Android Development] siljaer:
This is mine, for reference:

[ 0.680305] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.680312] mmc1: sdhci_msm_check_power_status: request 1 curr_pwr_state 2 curr_io_level 8
[ 0.680327] mmc1: Received IRQ(253), status=0x1
[ 0.680947] mmc1: Handled IRQ(253), ret=0, ack=0x1
[ 0.680965] mmc1: sdhci_msm_check_power_status: request 1 done
[ 0.680973] mmc1: sdhci_msm_check_power_status: request 1 curr_pwr_state 1 curr_io_level 4
[ 0.680981] mmc1: sdhci_msm_check_power_status: request 1 done
[ 0.680993] mmc1: request to disable clocks
[ 0.684641] mmc1: sdhci_msm_enable_controller_clock: enabled controller clock
[ 0.684649] mmc1: sdhci_msm_check_power_status: request 2 curr_pwr_state 1 curr_io_level 4
[ 0.684662] mmc1: Received IRQ(253), status=0x2
[ 0.686414] mmc1: Handled IRQ(253), ret=0, ack=0x1
[ 0.686434] mmc1: sdhci_msm_check_power_status: request 2 done
[ 0.697461] mmc1: request to enable clocks
[ 0.697525] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.708578] mmc1: sdhci_msm_check_power_status: request 8 curr_pwr_state 2 curr_io_level 8
[ 0.708584] mmc1: sdhci_msm_check_power_status: request 8 done
[ 0.715079] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.717289] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.721129] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.721178] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.723371] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.749858] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.749881] mmc1: sdhci_msm_check_power_status: request 4 curr_pwr_state 2 curr_io_level 8
[ 0.749902] mmc1: Received IRQ(253), status=0x4
[ 0.750077] mmc1: Handled IRQ(253), ret=0, ack=0x4
[ 0.750103] mmc1: sdhci_msm_check_power_status: request 4 done
[ 0.760693] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x8
[ 0.770651] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x8
[ 0.773365] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:7 ctrl_2:0xc
[ 0.773495] mmc1: sdhci_msm_set_clock: setting clk rate to 100000000
[ 0.775067] mmc1: sdhci_msm_set_uhs_signaling-clock:50000000 uhs mode:7 ctrl_2:0xc
[ 0.775095] mmc1: new ultra high speed DDR50 SDHC card at address aaaa
[ 0.775387] mmcblk1: mmc1:aaaa SL16G 14.8 GiB
[ 0.787810] mmc1: sdhci_msm_set_uhs_signaling-clock:50000000 uhs mode:0 ctrl_2:0x8
[ 0.787819] mmc1: sdhci_msm_check_power_status: request 1 curr_pwr_state 2 curr_io_level 4
[ 0.787835] mmc1: Received IRQ(253), status=0x9
[ 0.788323] mmc1: Handled IRQ(253), ret=0, ack=0x5
[ 0.788341] mmc1: sdhci_msm_check_power_status: request 1 done
[ 0.788350] mmc1: sdhci_msm_check_power_status: request 1 curr_pwr_state 1 curr_io_level 8
[ 0.788355] mmc1: sdhci_msm_check_power_status: request 1 done
[ 0.788361] mmc1: request to disable clocks

it looks like the problem could be frequency scaling...
[Miscellaneous Android Development] ottmi:
This kernel doesn't fix anything. It's the same as the previous one but with verbose logging. This is just for me to understand what is going wrong..
[Miscellaneous Android Development] siljaer:
Just a non-educated guess: could it be that? https://github.com/ottmi/android_kernel_cyanogen_msm8916/commit/d1f05e4b1dc253bae075013a545a1dac70a3cb6e

As far as I have understood (little) MMC_CAP_WAIT_WHILE_BUSY capability is alternative to CMD13 polling. Problem is, there have been some issues with that:

https://patchwork.kernel.org/patch/9010851/

https://patchwork.kernel.org/patch/9237681/

Do you think that removing the MMC_CAP_WAIT_WHILE_BUSY capability (added 8 months ago) could be a quick solution while the driver is fixed for good?
[Miscellaneous Android Development] ottmi:
I didn't have time to dig into this yet. I just did a quick re-compile without MMC_CAP_WAIT_WHILE_BUSY, if anybody wants to give it a shot:

https://drive.google.com/open?id=0BwV0Nb8HTEBwbkRxTHltelUxdWs
[Miscellaneous Android Development] blahmartinblah:
I just wanted to say thank-you for everyone trying to resolve the SD card issue. A lot of people seem to be suffering from it, and I admire the determination of the developers to try fix it, even though they are not suffering from the problem themselves. Unfortunately, I think this doesn't resolve the issue. I booted this img, and the SD card was still not available. Here is the log:

[ 0.602627] mmc1: no vqmmc regulator found
[ 0.602640] mmc1: no vmmc regulator found
[ 0.602889] mmc1: sdhci_msm_check_power_status: request 2 curr_pwr_state 0 curr_io_level 0
[ 0.602911] mmc1: Received IRQ(253), status=0x2
[ 0.604617] mmc1: Handled IRQ(253), ret=0, ack=0x1
[ 0.604634] mmc1: sdhci_msm_check_power_status: request 2 done
[ 0.615717] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.626762] mmc1: sdhci_msm_check_power_status: request 8 curr_pwr_state 2 curr_io_level 8
[ 0.626768] mmc1: sdhci_msm_check_power_status: request 8 done
[ 0.632297] mmc1: SDHCI controller on 7864900.sdhci [7864900.sdhci] using 32-bit ADMA
[ 0.694234] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.694241] mmc1: sdhci_msm_check_power_status: request 1 curr_pwr_state 2 curr_io_level 8
[ 0.694258] mmc1: Received IRQ(253), status=0x1
[ 0.694867] mmc1: Handled IRQ(253), ret=0, ack=0x1
[ 0.694885] mmc1: sdhci_msm_check_power_status: request 1 done
[ 0.694894] mmc1: sdhci_msm_check_power_status: request 1 curr_pwr_state 1 curr_io_level 4
[ 0.694903] mmc1: sdhci_msm_check_power_status: request 1 done
[ 0.694915] mmc1: request to disable clocks
[ 0.698424] mmc1: sdhci_msm_enable_controller_clock: enabled controller clock
[ 0.698431] mmc1: sdhci_msm_check_power_status: request 2 curr_pwr_state 1 curr_io_level 4
[ 0.698445] mmc1: Received IRQ(253), status=0x2
[ 0.700270] mmc1: Handled IRQ(253), ret=0, ack=0x1
[ 0.700288] mmc1: sdhci_msm_check_power_status: request 2 done
[ 0.711316] mmc1: request to enable clocks
[ 0.711385] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.722433] mmc1: sdhci_msm_check_power_status: request 8 curr_pwr_state 2 curr_io_level 8
[ 0.722438] mmc1: sdhci_msm_check_power_status: request 8 done
[ 0.728970] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.731183] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.736915] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.737432] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.737439] mmc1: sdhci_msm_check_power_status: request 1 curr_pwr_state 2 curr_io_level 8
[ 0.737455] mmc1: Received IRQ(253), status=0x1
[ 0.738052] mmc1: Handled IRQ(253), ret=0, ack=0x1
[ 0.738069] mmc1: sdhci_msm_check_power_status: request 1 done
[ 0.738077] mmc1: sdhci_msm_check_power_status: request 1 curr_pwr_state 1 curr_io_level 4
[ 0.738085] mmc1: sdhci_msm_check_power_status: request 1 done
[ 0.738096] mmc1: request to disable clocks
[Miscellaneous Android Development] siljaer:
interesting:

mine:

[ 0.773365] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:7 ctrl_2:0xc
[ 0.773495] mmc1: sdhci_msm_set_clock: setting clk rate to 100000000
[ 0.775067] mmc1: sdhci_msm_set_uhs_signaling-clock:50000000 uhs mode:7 ctrl_2:0xc
[ 0.775095] mmc1: new ultra high speed DDR50 SDHC card at address aaaa
[ 0.775387] mmcblk1: mmc1:aaaa SL16G 14.8 GiB

yours:

[ 0.746004] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:2 ctrl_2:0x0
[ 0.746044] mmc1: sdhci_msm_set_clock: setting clk rate to 50000000
[ 0.747619] mmc1: sdhci_msm_set_uhs_signaling-clock:50000000 uhs mode:2 ctrl_2:0x0
[ 0.747694] mmc1: sdhci_msm_set_uhs_signaling-clock:50000000 uhs mode:2 ctrl_2:0x0
[ 0.747710] mmc1: new high speed SDHC card at address aaaa
[ 0.747992] mmcblk1: mmc1:aaaa SL32G 29.7 GiB

it's ultra high speed yet it is recognized ad high speed...
[Miscellaneous Android Development] ottmi:
Ok, I will need more debug information. [MENTION=722204]blahmartinblah[/MENTION] can you please try this kernel and post the corresponding "adb shell dmesg|grep mmc1" ?

https://drive.google.com/open?id=0BwV0Nb8HTEBwRGNsTXBtQURGSFE

I might have lost track on the sdcard bug reports: Did it ever work for you with one of my ROMs? Or only with the stock ROM ?
[Miscellaneous Android Development] ottmi:
Ok, we're getting closer:

[ 0.720187] mmc1: req failed (CMD5): -110, retrying...
[ 0.720662] mmc1: req failed (CMD5): -110, retrying...
[ 0.721134] mmc1: req failed (CMD5): -110, retrying...
[ 0.722233] mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 17 width 0 timing 0
[ 0.722249] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.722290] mmc1: clock 400000Hz busmode 1 powermode 2 cs 1 Vdd 17 width 0 timing 0
[ 0.722306] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.725043] mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 17 width 0 timing 0
[ 0.725060] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:0 ctrl_2:0x0
[ 0.761840] mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 17 width 0 timing 2
[ 0.761862] mmc1: sdhci_msm_set_uhs_signaling-clock:400000 uhs mode:2 ctrl_2:0x0
[ 0.761902] mmc1: clock 50000000Hz busmode 1 powermode 2 cs 0 Vdd 17 width 0 timing 2
[ 0.761911] mmc1: sdhci_msm_set_clock: setting clk rate to 50000000
[ 0.763689] mmc1: sdhci_msm_set_uhs_signaling-clock:50000000 uhs mode:2 ctrl_2:0x0
[ 0.763759] mmc1: clock 50000000Hz busmode 1 powermode 2 cs 0 Vdd 17 width 2 timing 2
[ 0.763770] mmc1: sdhci_msm_set_uhs_signaling-clock:50000000 uhs mode:2 ctrl_2:0x0
[ 0.763786] mmc1: new high speed SDHC card at address aaaa
[ 0.764077] mmcblk1: mmc1:aaaa SU32G 29.7 GiB

On my phone vdd switches to 1.7V wheras it sticks to 1.8V on yours and then gates the clock..

Can you please try the 20160630 kernel? No need to flash it, just extract the ZIP file and use the boot.img in there to boot your phone..
[Miscellaneous Android Development] blahmartinblah:
Interesting. Also note the first error messages in my log regarding the regulator not found. Do you get those? Presumably that is the means of adjusting Vdd.

Sure. The SD card wasn't accessible, and here is the log:

[ 0.425275] mmc1: no vqmmc regulator found
[ 0.425288] mmc1: no vmmc regulator found
[ 0.454932] mmc1: SDHCI controller on 7864900.sdhci [7864900.sdhci] using 32-bit ADMA
[Miscellaneous Android Development] blahmartinblah:
[MENTION=7319300]ottmi[/MENTION]

I reverted back to CM12.1 released 2015-11-24 by [MENTION=4628393]vickdu31[/MENTION], from this thread: http://bbs.elephone.hk/thread-9303-1-1.html#.V8QZA5grK70

The Kernel version is reported as:

3.10.49-perf

spwork@spwork #1

Thu Nov 19 16:44:54 CST 2015

The SD card seems to be working fine. I rebooted 3 times, and each time it is visible. Here is the log for this build:

<6>[ 2.998385] mmc1: no vqmmc regulator found
<6>[ 2.998394] mmc1: no vmmc regulator found
<6>[ 3.028009] mmc1: SDHCI controller on 7864900.sdhci [7864900.sdhci] using 32-bit ADMA
<6>[ 3.666781] mmc1: new ultra high speed SDR104 SDHC card at address aaaa
<6>[ 3.667068] mmcblk1: mmc1:aaaa SL32G 29.7 GiB
<3>[ 3.667319] mmc1: sdhci_cmd_irq: AUTO CMD err sts 0x00000002
<3>[ 3.667328] mmc1: data txfr (0x00200000) error: -84 after 0 ms
<6>[ 3.667332] sdhci: =========== REGISTER DUMP (mmc1)===========
<6>[ 3.667466] mmc1: clk: 200000000 clk-gated: 0 claimer: mmcqd/1 pwr: 12
<6>[ 3.667471] mmc1: rpmstatus[pltfm](runtime-suspend:usage_count:disable_depth)(0:0:0)
[Miscellaneous Android Development] ottmi:
Interesting. So it's really the stock kernel and not mdeejay's Ark Benefit kernel (which was the one from the 20160630 build).

Unfortunately, there's not much debug information in the dmesg.. Could you please post the output of this so I can see whether there's more debug output to be enabled?

adb shell cat /sys/kernel/debug/dynamic_debug/control |grep mmc
[Miscellaneous Android Development] cool400:
[MENTION=7319300]ottmi[/MENTION], [MENTION=722204]blahmartinblah[/MENTION]: I just want to thank you both really much for investigating this problem, which is affecting me too. Hopefully your research will soon lead to the solution of this annoying and weird problem!
[Miscellaneous Android Development] blahmartinblah:
Of course - can you confirm which ROM/kernel are you interested in?

I still have the CM12.1, released 2015-11-24 installed, that I downloaded from the Elephone forum. Happy to change to another if needed.

Martin.
[Miscellaneous Android Development] ottmi:
That's exactly the one I'm interested in :)
[Miscellaneous Android Development] blahmartinblah:
Sorry, do I need to do anything else? I get this error:

/system/bin/sh: cat: /sys/kernel/debug/dynamic_debug/control: No such file or directory
[Miscellaneous Android Development] ottmi:
Ok, that means that the kernel has been compiled without dynamic debug support. There is no additional debug information that could be enabled. Damn.
[Miscellaneous Android Development] siljaer:
So [MENTION=722204]blahmartinblah[/MENTION] has an SDR104

<6>[ 3.666781] mmc1: new ultra high speed SDR104 SDHC card at address aaaa

while mine is a DDR50.

That reminds me two things I've found while investigating, one is this patch for a ZTE device (but who knows whether it has been unofficially merged by oems, it dates from 2013...):

http://review.cyanogenmod.org/#/c/139116/

you can see that SDR104 mode is added.

the second is some other patch I cannot find anymore :( It was about setting a SDR over DDR preference: while DDR mode is considered more reliable, that is not true while having radio on the board, because of EMI's spectrum, so for cellular phones SDR was a better choice. I will try to find that one too....

EDIT: found it, but I don't think it really matters: https://github.com/CyanogenMod/android_kernel_zte_msm8994/commit/c4f0dc4d9e4b66fb0a770a281cdc434b412b1553
[Miscellaneous Android Development] blahmartinblah:
Thanks anyway Ottmi.

Just to clarify a few things so I can perhaps investigate further:

1. The 3.10.49-perf 20151119 kernel in the CM12.1 I tried today is taken from a previous version of the stock Elephone ROM?

2. The kernel in your CM13 ROM is built from source, but not Elephone's source?

3. Elephone must have something in the stock ROM kernel source/configuration that works well with my hardware, and we need to discover what that is?

Martin

---------- Post added at 02:19 PM ---------- Previous post was at 02:13 PM ----------

I'll see what other SD cards I can find to try. I must have some old ones around somewhere.
[Miscellaneous Android Development] siljaer:
I guess old ones (HS) should work without any problem with CM13 kernel. It's probably only UHS card that have some issue. BTW, I don't know whether every single UHS I card can support both SDR50 and DDR104 modes.
[Miscellaneous Android Development] ottmi:
And of course I have currently no UHS sdcards at my disposal.. I'm wondering whether this patch would help:

https://patchwork.kernel.org/patch/9197749/
[Miscellaneous Android Development] siljaer:
I guess the problem is that there is already support for the UHS-I mode, we would be limited to HS clock speed otherwise. I think it's the fallback to HS speed mode that isn't working most of the times: [MENTION=722204]blahmartinblah[/MENTION] had to reboot a dozen time to get his UHS card recognized ad HS. So we know that fallback can work, sometimes...
[Miscellaneous Android Development] ottmi:
I'm not sure about the UHS support. The kernel may detect that there is an UHS card in the slot, but that doesn't necessarily mean it is also operated in UHS mode..
[Miscellaneous Android Development] ottmi:
1. Yes, I think it is. Maybe [MENTION=4628393]vickdu31[/MENTION] can confirm this?

2. Yes. It's CyanogenMod's generic msm8916 kernel. Until 20160630 I've used mdeejay's Ark Benefit kernel which apparently is also different from the stock kernel - otherwise it should have worked when you tried it earlier today.

3. Exactly.

What's really odd: There's plenty of msm8916 devices out there using the same kernel and UHS cards seem to be working fine for them ?!? So if it's not the kernel source, it has to be the configuration or the hardware. Our kernel configuration is the same as the one used for the Wileyfox Swift and I didn't find any complains there about sdcards. I will check the device tree of the stock kernel once again for any parameters that could be related.

In any case, it's really tricky to debug this without being able to reproduce the actual problem. Maybe I should get an UHS card and see whether that's also causing trouble on my phone. What exact card are you using?
[Miscellaneous Android Development] cool400:
I can confirm the same behavior with my SD card: after formatting it on my PC, my phone detects it after the next boot - and as soon as I reboot, it disappears again.

Gesendet von meinem Elephone Trunk mit Tapatalk
[Miscellaneous Android Development] ottmi:
Thanks for doing these tests! I don't think it has anything to do with the filesystem. The kernel doesn't care much about it, at least at this stage. Maybe it's the cold reset after removing the card from the phone? Or the proper initialization by the PC card reader?

Could you please try and see what happens when you pull the battery, remove the card and re-insert it after a few seconds?
[Miscellaneous Android Development] blahmartinblah:
Hi ottmi.

I did actually try that, but forgot to mention.

Removing the battery and card and reinserting with no other changes did not result in the card mounting on the following boot. (tried once)

I also inserted the card in the card reader, ran chkdsk and fixed the errors and returned it to the phone. It still didn't mount - chkdsk didn't seem enough, but subsequently formatting it did work.

I'm not sure what else to do, sorry :-/
[Miscellaneous Android Development] ottmi:
The current CM13 kernel knows at least about DDR50 and HS200. But this has to be enabled for the SDHC host explicitly via the device tree. Otherwise it's not reported as a capability of the host. In the current device tree this is only enabled for the internal sdcard. So I don't really understand why it would even try to clock yours to 50 or 100 MHz..

The whole kernel code for MMC handling is really hard to read.. There's the generic mmc module that deals with the card itself. But it relies on the sdhci module to communicate with it via the host which in turn relies on the sdhci-msm module for the Qualcomm specific implementation..
[Miscellaneous Android Development] ottmi:
I don't see how formatting makes any difference, filesystem detection comes much later in the boot process. It seems like the formatting leaves the card in some (electrical) state that allows the phone to initialize it properly. But I don't understand how that could happen. Once you pull it out of the reader it should loose any state. I don't think there's much capacitance in the card that would would keep it "powered" until you put it in the phone..
[Miscellaneous Android Development] ottmi:
[MENTION=722204]blahmartinblah[/MENTION]: next try, new kernel with even more debug information:

https://drive.google.com/open?id=0BwV0Nb8HTEBwR19LQl9KQWlMaG8

Could I please get the usual "adb shell dmesg|grep mmc1" :) ?

EDIT:

Better yet, use this kernel and post the whole "adb shell dmesg" for the first minute after boot to some place like pastebin..

https://drive.google.com/open?id=0BwV0Nb8HTEBwcHVjUVdHTXN2RVk
[Miscellaneous Android Development] ottmi:
Thanks, exactly what I thought: it doesn't even get to the mmc_sd_init_card when it fails. So it doesn't even know yet whether it's a UHS card or not. Could you please try once again with the other kernel I've posted a few minutes ago?
[Miscellaneous Android Development] blahmartinblah:
Sorry I didn't see that. Here you go:

http://pastebin.com/LJ60ewDz
[Miscellaneous Android Development] ottmi:
And once more, please:

https://drive.google.com/open?id=0BwV0Nb8HTEBwLW51b1BKc1p5SzQ
[Miscellaneous Android Development] blahmartinblah:
Here you go. I think I managed to capture everything this time from initial boot, up to the launcher appearing.

I had the 16Gb Sandisk SD card installed. It wasn't mounted once the phone started up.

http://pastebin.com/Pnihxs32

Martin
[Miscellaneous Android Development] siljaer:
do you need also mine?
[Miscellaneous Android Development] blahmartinblah:
Yes please :)

I'd like to compare.
[Miscellaneous Android Development] ottmi:
It wouldn't hurt to have a reference for an UHS card :)

I think we're getting closer, the problem seems to be the mmc_wait_for_cmd() here:

https://github.com/ottmi/android_ke.../blob/cm-13.0/drivers/mmc/core/mmc_ops.c#L145

I've tried lowering the initial frequency from 400kHz to 100kHz to see whether this helps, but it seems that 400 really is the lowest value. So increased the number of retries for the ocr==0 case (which is the one that's failing) to 10, maybe this helps. [MENTION=722204]blahmartinblah[/MENTION] could you please try this kernel and come back with the usual dmesg?

https://drive.google.com/open?id=0BwV0Nb8HTEBwN2JUWEQxY1NxbWs