Linux-mmc Archive on lore.kernel.org
 help / color / Atom feed
From: Iskren Chernev <iskren.chernev@gmail.com>
To: kernelnewbies@kernelnewbies.org
Cc: linux-mmc@vger.kernel.org
Subject: sdhci_msm issues with cold-plugged SD cards
Date: Fri, 22 May 2020 18:51:27 +0300
Message-ID: <491cfef4-4a97-b6e8-0f41-d44e1c73eea4@gmail.com> (raw)


Hello,

I'm trying to add SD Card support to a smartphone (Samsung Galaxy S5). After
configuring the sdhci-msm driver through DT, it all seems to work fine except
the case when the phone boots with the SD card inserted. If the card is
re-inserted, or the driver is polling, or the probe code is forcefully executed
a second time the card is properly detected.

I logged the SD interrupts, commands and responses, and it looks like the
hardware is returning Command Index Error and/or Command End Bit Error via the
Error Interrupt Status Register, which gets converted to -EILSEQ error. On
a second attempt (due to re-insertion, polling or re-execution) these errors
are missing, and the card behaves correctly.

On the downstream kernel, these errors resulting in EILSEQ do not appear, so it
might be related to setup. Also I see that sdhci-msm driver has hardcoded
a SDHCI_QUIRK_BROKEN_CARD_DETECTION quirk, which might imply that polling
should be used (instead Card Detection GPIO), in which case this issue won't
manifest itself. But polling wastes power, and the Card Detect pin works well,
at least for this device, so I feel it can be made better.

Any suggestions on how to track this down are appreciated!

Regards,
Iskren Chernev


             reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 15:51 Iskren Chernev [this message]
2020-05-25  9:14 ` Ulf Hansson
2020-05-26 13:01   ` Veerabhadrarao Badiganti
2020-05-27 14:55     ` Iskren Chernev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=491cfef4-4a97-b6e8-0f41-d44e1c73eea4@gmail.com \
    --to=iskren.chernev@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=linux-mmc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-mmc Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mmc/0 linux-mmc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mmc linux-mmc/ https://lore.kernel.org/linux-mmc \
		linux-mmc@vger.kernel.org
	public-inbox-index linux-mmc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-mmc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git