Skip to contentSkip to conversation

SDHCI: Modify checks to determine the presense of card.

PATCH In review Thomas Abraham 2 participants 2 messages Mar 5, 2010 – Aug 27, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SDHCI: Modify checks to determine the presense of card.

In the sdhci_request function, the card is determined to be present based on the SDCD pin status. SDHCI host controllers that do not use SDCD pin but rely on other mechanism such as external pin interrupts, update the host flags with SDHCI_DEVICE_DEAD flag based on the card insertion status. This patch modifies the sdhci_request function such that the it uses both the SDCD status and SDHCI_DEVICE_DEAD host flag to determine if the card is inserted or not.

---
 drivers/mmc/host/sdhci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/host/sdhci.c +1 -1
index c279fbc..f1a6ebe 100644
@@ -1106,7 +1106,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 		present = sdhci_readl(host, SDHCI_PRESENT_STATE) &
 				SDHCI_CARD_PRESENT;
 
-	if (!present || host->flags & SDHCI_DEVICE_DEAD) {
+	if (!present && host->flags & SDHCI_DEVICE_DEAD) {
 		host->mrq->cmd->error = -ENOMEDIUM;
 		tasklet_schedule(&host->finish_tasklet);
 	} else
Signature · 1 line
1.6.6.rc2
#1 lore raw

Hi,

This wasn't picked up -- any comments from the list?

Quoted 28 lines · Thomas Abraham

In the sdhci_request function, the card is determined to be present based on the SDCD pin status. SDHCI host controllers that do not use SDCD pin but rely on other mechanism such as external pin interrupts, update the host flags with SDHCI_DEVICE_DEAD flag based on the card insertion status. This patch modifies the sdhci_request function such that the it uses both the SDCD status and SDHCI_DEVICE_DEAD host flag to determine if the card is inserted or not.

---
 drivers/mmc/host/sdhci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/host/sdhci.c +1 -1
index c279fbc..f1a6ebe 100644
@@ -1106,7 +1106,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 		present = sdhci_readl(host, SDHCI_PRESENT_STATE) &
 				SDHCI_CARD_PRESENT;
 
-	if (!present || host->flags & SDHCI_DEVICE_DEAD) {
+	if (!present && host->flags & SDHCI_DEVICE_DEAD) {
 		host->mrq->cmd->error = -ENOMEDIUM;
 		tasklet_schedule(&host->finish_tasklet);
 	} else
Signature · 1 line
1.6.6.rc2
Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child