Skip to contentSkip to conversation

Black screen while resuming a SDXC (UHS) card (_mmc_sd_resume)

DISCUSSION Tim Schumacher 4 participants 4 messages Jan 23, 2020 – Jan 27, 2020 2 messages not in the archive MMC, SD and SDIO

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): CAPDyKFqo-LecRE5R4T+vrGgNs83WFmQr84oaieEUTCjLFOLXoA@mail.gmail.com

#2 lore raw
Quoted 55 lines · Ulf Hansson
Quoted 39 lines · Tim Schumacher

Hi,

I'm sending this old bug by mail since a lot of developers don't use bugzilla.

Original bug report on bugzilla by Pedro Rodrigues from 2019-01-30:

https://bugzilla.kernel.org/show_bug.cgi?id=202459

Quoted 18 lines

This bug can be found on a Lenovo Miix 320-10ICR

When using a SDXC (UHS) card, the screen becomes black if _mmc_sd_resume() is called. After some investigation, I found that an UHS card uses 1.8 V for signalling while a normal SD card uses 3.3 V. By forcing the SDXC to use 3.3 V the black screen does not appear. It seems that during a _mmc_sd_resume function call, while claiming the host, an I2C resume function is called based on an existing supplier link between the I2C bus and the card device. The problem is that if the signalling voltage is configured to 1.8 V, during the I2C resume call, the screen turns black. I was able to fix this issue by setting the initial signal voltage (3.3 V) before suspending the card, so that when the card is resumed, the voltage is in the original state. To do this I added a function call to mmc_set_initial_signal_voltage() during mmc_power_off routine (drivers/mmc/core/core.c). As I’m not an expert on Linux, I’m posting the issue and possible solution so that it could be implemented on a future release.

Quoted 1 line

Please, share your thoughts :)

I can't provide further insight but I'm interested if this is possibly the cause for the general issues people are having with the SD card reader on Lenovo Miix 320 devices.

Those issues described in posts like

https://vincent-ventures.com/2018/12/arch-linux-on-lenovo-ideapad-miix-320/
https://esc.sh/blog/linux-on-lenovo-miix-320/

Quoted 7 lines

are (1) black screen when booting with an SD card installed and (2) when inserting an SD card after booting it shows up but upon trying to access it the screen turns black until the card is removed again.

I can confirm (1) on my Lenovo Miix 320-10ICR with kernel version 5.2.11. I can also confirm that only SDXC cards are affected, SD and SDHC cards work as expected.

For the mmc community to help, you need to provide some kernel logs, output from lspci, figure out what mmc host driver that is being used, etc - in general collect more data. Then re-post the data to linux-mmc, me and a potential mmc host driver maintainer (if there is one). Yes, we can look into bugzilla as well, but first we need some more overall info in an email.

Quoted 7 lines

Most likely, if there is any response, you will be asked to test patches. So you need to be able build and boot a new kernel, but I guess you already know that part.

Kind regards
Uffe

Hi, I'm coming back to this issue now. The issue is still present in kernel version 5.4.8.

Kernel logs from boot with SD card and black screen: https://termbin.com/outp
Kernel logs from boot without SD card: https://termbin.com/dc2y

I couldn't find anything conspicuous in there, the card is working as expected. Only issue is the black screen (I'm doing these tests via SSH).

lspci output: https://termbin.com/x452

How do I figure out which mmc host driver is in use? I assume I'm
looking for one of these https://github.com/torvalds/linux/tree/master/drivers/mmc/host
I couldn't find anything like it in the kernel logs or from lsmod.

Please read the original bug report by Pedro Rodrigues quoted above. He got to the technical core of the problem already and proposed a fix I assume could be understood, sanity checked and implemented by a mmc maintainer.

Regards
Tim

#3 lore raw

+ Adrian

Quoted 76 lines · Tim Schumacher
Quoted 55 lines · Ulf Hansson
Quoted 39 lines · Tim Schumacher

Hi,

I'm sending this old bug by mail since a lot of developers don't use bugzilla.

Original bug report on bugzilla by Pedro Rodrigues from 2019-01-30:

https://bugzilla.kernel.org/show_bug.cgi?id=202459

Quoted 18 lines

This bug can be found on a Lenovo Miix 320-10ICR

When using a SDXC (UHS) card, the screen becomes black if _mmc_sd_resume() is called. After some investigation, I found that an UHS card uses 1.8 V for signalling while a normal SD card uses 3.3 V. By forcing the SDXC to use 3.3 V the black screen does not appear. It seems that during a _mmc_sd_resume function call, while claiming the host, an I2C resume function is called based on an existing supplier link between the I2C bus and the card device. The problem is that if the signalling voltage is configured to 1.8 V, during the I2C resume call, the screen turns black. I was able to fix this issue by setting the initial signal voltage (3.3 V) before suspending the card, so that when the card is resumed, the voltage is in the original state. To do this I added a function call to mmc_set_initial_signal_voltage() during mmc_power_off routine (drivers/mmc/core/core.c). As I’m not an expert on Linux, I’m posting the issue and possible solution so that it could be implemented on a future release.

Quoted 1 line

Please, share your thoughts :)

I can't provide further insight but I'm interested if this is possibly the cause for the general issues people are having with the SD card reader on Lenovo Miix 320 devices.

Those issues described in posts like

https://vincent-ventures.com/2018/12/arch-linux-on-lenovo-ideapad-miix-320/
https://esc.sh/blog/linux-on-lenovo-miix-320/

Quoted 7 lines

are (1) black screen when booting with an SD card installed and (2) when inserting an SD card after booting it shows up but upon trying to access it the screen turns black until the card is removed again.

I can confirm (1) on my Lenovo Miix 320-10ICR with kernel version 5.2.11. I can also confirm that only SDXC cards are affected, SD and SDHC cards work as expected.

For the mmc community to help, you need to provide some kernel logs, output from lspci, figure out what mmc host driver that is being used, etc - in general collect more data. Then re-post the data to linux-mmc, me and a potential mmc host driver maintainer (if there is one). Yes, we can look into bugzilla as well, but first we need some more overall info in an email.

Quoted 7 lines

Most likely, if there is any response, you will be asked to test patches. So you need to be able build and boot a new kernel, but I guess you already know that part.

Kind regards
Uffe

Hi, I'm coming back to this issue now. The issue is still present in kernel version 5.4.8.

Kernel logs from boot with SD card and black screen: https://termbin.com/outp
Kernel logs from boot without SD card: https://termbin.com/dc2y

I couldn't find anything conspicuous in there, the card is working as expected. Only issue is the black screen (I'm doing these tests via SSH).

lspci output: https://termbin.com/x452

Quoted 8 lines

How do I figure out which mmc host driver is in use? I assume I'm
looking for one of these https://github.com/torvalds/linux/tree/master/drivers/mmc/host
I couldn't find anything like it in the kernel logs or from lsmod.

Please read the original bug report by Pedro Rodrigues quoted above. He got to the technical core of the problem already and proposed a fix I assume could be understood, sanity checked and implemented by a mmc maintainer.

I have read the reports and browsed the data you provided. It seems like this is an sdhci-acpi mmc/sd controller, Adrian Hunter (Intel maintains this variant). There is one eMMC, which seems to work fine and then the SD-card that you have inserted. The SD card looks like it gets detected properly.

I don't see anything in the logs that stands out. However, I would try a couple of different SD-cards, just to see what happens (if you have more then one at hand). From that and going forward, I think I will need to defer to Adrian's help. Perhaps we can put together some debug patch for you to test, or so.

I will keep monitoring the discussion and fold in if there is anything more I can help with.

Kind regards
Uffe

#4 lore raw
Quoted 1 line · Ulf Hansson

+ Adrian

Is this the same as:

	https://lore.kernel.org/linux-mmc/[email protected]/
Quoted 105 lines · Tim Schumacher
Quoted 76 lines · Ulf Hansson
Quoted 55 lines · Tim Schumacher
Quoted 39 lines

Hi,

I'm sending this old bug by mail since a lot of developers don't use bugzilla.

Original bug report on bugzilla by Pedro Rodrigues from 2019-01-30:

https://bugzilla.kernel.org/show_bug.cgi?id=202459

Quoted 18 lines

This bug can be found on a Lenovo Miix 320-10ICR

When using a SDXC (UHS) card, the screen becomes black if _mmc_sd_resume() is called. After some investigation, I found that an UHS card uses 1.8 V for signalling while a normal SD card uses 3.3 V. By forcing the SDXC to use 3.3 V the black screen does not appear. It seems that during a _mmc_sd_resume function call, while claiming the host, an I2C resume function is called based on an existing supplier link between the I2C bus and the card device. The problem is that if the signalling voltage is configured to 1.8 V, during the I2C resume call, the screen turns black. I was able to fix this issue by setting the initial signal voltage (3.3 V) before suspending the card, so that when the card is resumed, the voltage is in the original state. To do this I added a function call to mmc_set_initial_signal_voltage() during mmc_power_off routine (drivers/mmc/core/core.c). As I’m not an expert on Linux, I’m posting the issue and possible solution so that it could be implemented on a future release.

Quoted 1 line

Please, share your thoughts :)

I can't provide further insight but I'm interested if this is possibly the cause for the general issues people are having with the SD card reader on Lenovo Miix 320 devices.

Those issues described in posts like

https://vincent-ventures.com/2018/12/arch-linux-on-lenovo-ideapad-miix-320/
https://esc.sh/blog/linux-on-lenovo-miix-320/

Quoted 7 lines

are (1) black screen when booting with an SD card installed and (2) when inserting an SD card after booting it shows up but upon trying to access it the screen turns black until the card is removed again.

I can confirm (1) on my Lenovo Miix 320-10ICR with kernel version 5.2.11. I can also confirm that only SDXC cards are affected, SD and SDHC cards work as expected.

For the mmc community to help, you need to provide some kernel logs, output from lspci, figure out what mmc host driver that is being used, etc - in general collect more data. Then re-post the data to linux-mmc, me and a potential mmc host driver maintainer (if there is one). Yes, we can look into bugzilla as well, but first we need some more overall info in an email.

Quoted 7 lines

Most likely, if there is any response, you will be asked to test patches. So you need to be able build and boot a new kernel, but I guess you already know that part.

Kind regards
Uffe

Hi, I'm coming back to this issue now. The issue is still present in kernel version 5.4.8.

Kernel logs from boot with SD card and black screen: https://termbin.com/outp
Kernel logs from boot without SD card: https://termbin.com/dc2y

I couldn't find anything conspicuous in there, the card is working as expected. Only issue is the black screen (I'm doing these tests via SSH).

lspci output: https://termbin.com/x452

Quoted 8 lines

How do I figure out which mmc host driver is in use? I assume I'm
looking for one of these https://github.com/torvalds/linux/tree/master/drivers/mmc/host
I couldn't find anything like it in the kernel logs or from lsmod.

Please read the original bug report by Pedro Rodrigues quoted above. He got to the technical core of the problem already and proposed a fix I assume could be understood, sanity checked and implemented by a mmc maintainer.

I have read the reports and browsed the data you provided. It seems like this is an sdhci-acpi mmc/sd controller, Adrian Hunter (Intel maintains this variant). There is one eMMC, which seems to work fine and then the SD-card that you have inserted. The SD card looks like it gets detected properly.

I don't see anything in the logs that stands out. However, I would try a couple of different SD-cards, just to see what happens (if you have more then one at hand). From that and going forward, I think I will need to defer to Adrian's help. Perhaps we can put together some debug patch for you to test, or so.

I will keep monitoring the discussion and fold in if there is anything more I can help with.

Kind regards
Uffe

#5 lore raw

Hi,

Quoted 6 lines · Adrian Hunter
Quoted 1 line · Ulf Hansson

+ Adrian

Is this the same as:

	https://lore.kernel.org/linux-mmc/[email protected]/

Yes the device from:
https://bugzilla.kernel.org/show_bug.cgi?id=202459

Seems to be the exact same one as the one where I'm seeing this problem and presumably the fix I wrote should work for that one too.

As discussed I still need to try an alternative fix. I hope to get around to that sometimes during the coming 2-3 days.

Regards,

Hans

Quoted 107 lines
Quoted 106 lines · Tim Schumacher
Quoted 76 lines · Ulf Hansson
Quoted 55 lines · Tim Schumacher
Quoted 39 lines

Hi,

I'm sending this old bug by mail since a lot of developers don't use bugzilla.

Original bug report on bugzilla by Pedro Rodrigues from 2019-01-30:

https://bugzilla.kernel.org/show_bug.cgi?id=202459

Quoted 18 lines

This bug can be found on a Lenovo Miix 320-10ICR

When using a SDXC (UHS) card, the screen becomes black if _mmc_sd_resume() is called. After some investigation, I found that an UHS card uses 1.8 V for signalling while a normal SD card uses 3.3 V. By forcing the SDXC to use 3.3 V the black screen does not appear. It seems that during a _mmc_sd_resume function call, while claiming the host, an I2C resume function is called based on an existing supplier link between the I2C bus and the card device. The problem is that if the signalling voltage is configured to 1.8 V, during the I2C resume call, the screen turns black. I was able to fix this issue by setting the initial signal voltage (3.3 V) before suspending the card, so that when the card is resumed, the voltage is in the original state. To do this I added a function call to mmc_set_initial_signal_voltage() during mmc_power_off routine (drivers/mmc/core/core.c). As I’m not an expert on Linux, I’m posting the issue and possible solution so that it could be implemented on a future release.

Quoted 1 line

Please, share your thoughts :)

I can't provide further insight but I'm interested if this is possibly the cause for the general issues people are having with the SD card reader on Lenovo Miix 320 devices.

Those issues described in posts like

https://vincent-ventures.com/2018/12/arch-linux-on-lenovo-ideapad-miix-320/
https://esc.sh/blog/linux-on-lenovo-miix-320/

Quoted 7 lines

are (1) black screen when booting with an SD card installed and (2) when inserting an SD card after booting it shows up but upon trying to access it the screen turns black until the card is removed again.

I can confirm (1) on my Lenovo Miix 320-10ICR with kernel version 5.2.11. I can also confirm that only SDXC cards are affected, SD and SDHC cards work as expected.

For the mmc community to help, you need to provide some kernel logs, output from lspci, figure out what mmc host driver that is being used, etc - in general collect more data. Then re-post the data to linux-mmc, me and a potential mmc host driver maintainer (if there is one). Yes, we can look into bugzilla as well, but first we need some more overall info in an email.

Quoted 7 lines

Most likely, if there is any response, you will be asked to test patches. So you need to be able build and boot a new kernel, but I guess you already know that part.

Kind regards
Uffe

Hi, I'm coming back to this issue now. The issue is still present in kernel version 5.4.8.

Kernel logs from boot with SD card and black screen: https://termbin.com/outp
Kernel logs from boot without SD card: https://termbin.com/dc2y

I couldn't find anything conspicuous in there, the card is working as expected. Only issue is the black screen (I'm doing these tests via SSH).

lspci output: https://termbin.com/x452

Quoted 8 lines

How do I figure out which mmc host driver is in use? I assume I'm
looking for one of these https://github.com/torvalds/linux/tree/master/drivers/mmc/host
I couldn't find anything like it in the kernel logs or from lsmod.

Please read the original bug report by Pedro Rodrigues quoted above. He got to the technical core of the problem already and proposed a fix I assume could be understood, sanity checked and implemented by a mmc maintainer.

I have read the reports and browsed the data you provided. It seems like this is an sdhci-acpi mmc/sd controller, Adrian Hunter (Intel maintains this variant). There is one eMMC, which seems to work fine and then the SD-card that you have inserted. The SD card looks like it gets detected properly.

I don't see anything in the logs that stands out. However, I would try a couple of different SD-cards, just to see what happens (if you have more then one at hand). From that and going forward, I think I will need to defer to Adrian's help. Perhaps we can put together some debug patch for you to test, or so.

I will keep monitoring the discussion and fold in if there is anything more I can help with.

Kind regards
Uffe