Skip to contentSkip to conversation

mmc: core: add the warning message when card didn't support HPI

PATCH Superseded Jaehoon Chung 3 participants 3 messages Mar 9, 2012 MMC, SD and SDIO

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: core: add the warning message when card didn't support HPI

Though card didn't support HPI,someone could use the send_hpi_cmd(). Then maybe didn't work fine.
Because card->ext_csd.hpi_cmd didn't set.
So if card didn't support hpi, return the waring message.

And CMD12's flags is MMC_RSP_R1B.

---
 drivers/mmc/core/mmc_ops.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
drivers/mmc/core/mmc_ops.c +7 -1
index 4d41fa9..395f944 100644
@@ -556,9 +556,15 @@ int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status)
 	unsigned int flags;
 	int err;
 
+	if (!card->ext_csd.hpi) {
+		pr_waring("%s: Card didn't support HPI command\n",
+				mmc_hostname(card->host));
+		return -EINVAL;
+	}
+
 	opcode = card->ext_csd.hpi_cmd;
 	if (opcode == MMC_STOP_TRANSMISSION)
-		flags = MMC_RSP_R1 | MMC_CMD_AC;
+		flags = MMC_RSP_R1B | MMC_CMD_AC;
 	else if (opcode == MMC_SEND_STATUS)
 		flags = MMC_RSP_R1 | MMC_CMD_AC;
 
#1 lore raw

Hi,

Quoted 18 lines · Jaehoon Chung

Though card didn't support HPI,someone could use the send_hpi_cmd(). Then maybe didn't work fine.
Because card->ext_csd.hpi_cmd didn't set.
So if card didn't support hpi, return the waring message.

And CMD12's flags is MMC_RSP_R1B.

---
 drivers/mmc/core/mmc_ops.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
drivers/mmc/core/mmc_ops.c +0 -0
index 4d41fa9..395f944 100644

drivers/mmc/core/mmc_ops.c int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status) · line 560

Quoted 5 lines
drivers/mmc/core/mmc_ops.c +2 -0
@@ -556,9 +556,15 @@ int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status)
 	unsigned int flags;
 	int err;
 
+	if (!card->ext_csd.hpi) {
+		pr_waring("%s: Card didn't support HPI command\n",

This isn't going to compile. Please compile test patches before sending them.

drivers/mmc/core/mmc_ops.c int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status) · line 569

Quoted 10 lines
drivers/mmc/core/mmc_ops.c +5 -1
+				mmc_hostname(card->host));
+		return -EINVAL;
+	}
+
 	opcode = card->ext_csd.hpi_cmd;
 	if (opcode == MMC_STOP_TRANSMISSION)
-		flags = MMC_RSP_R1 | MMC_CMD_AC;
+		flags = MMC_RSP_R1B | MMC_CMD_AC;
 	else if (opcode == MMC_SEND_STATUS)
 		flags = MMC_RSP_R1 | MMC_CMD_AC;

Thanks,

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
#2 lore raw

Hi Chris.

Sorry..i will resend the patch after fixed.

Best Regards,
Jaehoon Chung

2012/3/9 Chris Ball <[email protected]>:

Quoted 51 lines

Hi,

Quoted 18 lines · Jaehoon Chung

Though card didn't support HPI,someone could use the send_hpi_cmd(). Then maybe didn't work fine.
Because card->ext_csd.hpi_cmd didn't set.
So if card didn't support hpi, return the waring message.

And CMD12's flags is MMC_RSP_R1B.

---
 drivers/mmc/core/mmc_ops.c |    8 +++++++-

 1 files changed, 7 insertions(+), 1 deletions(-)
drivers/mmc/core/mmc_ops.c +0 -0
index 4d41fa9..395f944 100644

drivers/mmc/core/mmc_ops.c int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status) · line 560

Quoted 5 lines
drivers/mmc/core/mmc_ops.c +2 -0
@@ -556,9 +556,15 @@ int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status)
       unsigned int flags;
       int err;
 
+     if (!card->ext_csd.hpi) {
+             pr_waring("%s: Card didn't support HPI command\n",

This isn't going to compile.  Please compile test patches before sending them.

drivers/mmc/core/mmc_ops.c int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status) · line 569

Quoted 10 lines
drivers/mmc/core/mmc_ops.c +5 -1
+                             mmc_hostname(card->host));
+             return -EINVAL;
+     }
+
       opcode = card->ext_csd.hpi_cmd;
       if (opcode == MMC_STOP_TRANSMISSION)
-             flags = MMC_RSP_R1 | MMC_CMD_AC;
+             flags = MMC_RSP_R1B | MMC_CMD_AC;
       else if (opcode == MMC_SEND_STATUS)
               flags = MMC_RSP_R1 | MMC_CMD_AC;

Thanks,

- Chris.
--
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html