Skip to contentSkip to conversation

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

PATCH In review Jaehoon Chung 2 participants 2 messages Mar 11, 2012 – Mar 16, 2012 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH v2 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.

---
Changelog v2:
- Fixed typo and removed the flags variable.

 drivers/mmc/core/mmc_ops.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/mmc/core/mmc_ops.c +8 -4
index 4d41fa9..30f45be 100644
@@ -553,18 +553,22 @@ int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status)
 {
 	struct mmc_command cmd = {0};
 	unsigned int opcode;
-	unsigned int flags;
 	int err;
 
+	if (!card->ext_csd.hpi) {
+		pr_warning("%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;
+		cmd.flags = MMC_RSP_R1B | MMC_CMD_AC;
 	else if (opcode == MMC_SEND_STATUS)
-		flags = MMC_RSP_R1 | MMC_CMD_AC;
+		cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
 
 	cmd.opcode = opcode;
 	cmd.arg = card->rca << 16 | 1;
-	cmd.flags = flags;
 	cmd.cmd_timeout_ms = card->ext_csd.out_of_int_time;
 
 	err = mmc_wait_for_cmd(card->host, &cmd, 0);
Signature · 1 line
1.7.4.1
#1 lore raw

Hi,

Quoted 37 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.

---
Changelog v2:
- Fixed typo and removed the flags variable.

 drivers/mmc/core/mmc_ops.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/mmc/core/mmc_ops.c +7 -2
index 4d41fa9..30f45be 100644
@@ -553,18 +553,22 @@ int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status)
 {
 	struct mmc_command cmd = {0};
 	unsigned int opcode;
-	unsigned int flags;
 	int err;
 
+	if (!card->ext_csd.hpi) {
+		pr_warning("%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;
+		cmd.flags = MMC_RSP_R1B | MMC_CMD_AC;

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

Quoted 10 lines
drivers/mmc/core/mmc_ops.c +1 -2
 	else if (opcode == MMC_SEND_STATUS)
-		flags = MMC_RSP_R1 | MMC_CMD_AC;
+		cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
 
 	cmd.opcode = opcode;
 	cmd.arg = card->rca << 16 | 1;
-	cmd.flags = flags;
 	cmd.cmd_timeout_ms = card->ext_csd.out_of_int_time;
 
 	err = mmc_wait_for_cmd(card->host, &cmd, 0);

Thanks, pushed to mmc-next for 3.4.

- Chris.

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