Skip to contentSkip to conversation

mmc: dwmmc: return a proper error code when busy

PATCH In review John Keeping 2 participants 5 messages Jan 11, 2022 – Jan 12, 2022 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: dwmmc: return a proper error code when busy

When failing to send a command because the hardware is busy, return EBUSY to indicate the cause instead of just -1.

---
 drivers/mmc/dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/dw_mmc.c +1 -1
index a949dad574..4232c5eb8c 100644
@@ -301,7 +301,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
 		flags = dwmci_set_transfer_mode(host, data);
 
 	if ((cmd->resp_type & MMC_RSP_136) && (cmd->resp_type & MMC_RSP_BUSY))
-		return -1;
+		return -EBUSY;
 
 	if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION)
 		flags |= DWMCI_CMD_ABORT_STOP;
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

Hi John,

Quoted 4 lines · John Keeping

When failing to send a command because the hardware is busy, return EBUSY to indicate the cause instead of just -1.

Best Regards,
Jaehoon Chung

Quoted 18 lines
---
 drivers/mmc/dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/dw_mmc.c +1 -1
index a949dad574..4232c5eb8c 100644
@@ -301,7 +301,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
 		flags = dwmci_set_transfer_mode(host, data);
 
 	if ((cmd->resp_type & MMC_RSP_136) && (cmd->resp_type & MMC_RSP_BUSY))
-		return -1;
+		return -EBUSY;
 
 	if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION)
 		flags |= DWMCI_CMD_ABORT_STOP;
#2 lore raw

Hi John,

Quoted 5 lines · Jaehoon Chung

Hi John,

Quoted 2 lines · John Keeping

When failing to send a command because the hardware is busy, return EBUSY to indicate the cause instead of just -1.

Is this patch same?

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Quoted 27 lines
Quoted 2 lines

Best Regards,
Jaehoon Chung

Quoted 18 lines
---
 drivers/mmc/dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/dw_mmc.c +1 -1
index a949dad574..4232c5eb8c 100644
@@ -301,7 +301,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
 		flags = dwmci_set_transfer_mode(host, data);
 
 	if ((cmd->resp_type & MMC_RSP_136) && (cmd->resp_type & MMC_RSP_BUSY))
-		return -1;
+		return -EBUSY;
 
 	if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION)
 		flags |= DWMCI_CMD_ABORT_STOP;
#3 lore raw
Quoted 8 lines · Jaehoon Chung
Quoted 3 lines · Jaehoon Chung
Quoted 2 lines · John Keeping

When failing to send a command because the hardware is busy, return EBUSY to indicate the cause instead of just -1.

Is this patch same?

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Yes, sorry - I still had the patch file lying around and passed the wrong filename to git send-email!

Quoted 28 lines
Quoted 27 lines
Quoted 2 lines

Best Regards,
Jaehoon Chung

Quoted 18 lines
---
 drivers/mmc/dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/dw_mmc.c +1 -1
index a949dad574..4232c5eb8c 100644
@@ -301,7 +301,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
 		flags = dwmci_set_transfer_mode(host, data);
 
 	if ((cmd->resp_type & MMC_RSP_136) && (cmd->resp_type & MMC_RSP_BUSY))
-		return -1;
+		return -EBUSY;
 
 	if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION)
 		flags |= DWMCI_CMD_ABORT_STOP;
#4 lore raw
Quoted 6 lines · John Keeping
Quoted 5 lines · Jaehoon Chung
Quoted 3 lines · Jaehoon Chung
Quoted 2 lines · John Keeping

When failing to send a command because the hardware is busy, return EBUSY to indicate the cause instead of just -1.

Quoted 6 lines
Quoted 3 lines

Is this patch same?

https://protect2.fireeye.com/v1/url?k=887b401c-d7e0790d-887acb53-0cc47a31cdbc-5fff461e625e1ff5&q=1&e=e07e0f85-41c3-4e09-870a-cdcb715f39aa&u=https%3A%2F%2Fpatchwork.ozlabs.org%2Fproject%2Fuboot%2Fpatch%2F20211207160935.404395-1-john%40metanate.com%2F

Yes, sorry - I still had the patch file lying around and passed the wrong filename to git send-email!

Applied with your previous patch.

Thanks!

Best Regards,
Jaehoon Chung

Quoted 30 lines
Quoted 29 lines
Quoted 28 lines
Quoted 3 lines

Best Regards,
Jaehoon Chung

Quoted 18 lines
---
 drivers/mmc/dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/dw_mmc.c +1 -1
index a949dad574..4232c5eb8c 100644
@@ -301,7 +301,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
 		flags = dwmci_set_transfer_mode(host, data);
 
 	if ((cmd->resp_type & MMC_RSP_136) && (cmd->resp_type & MMC_RSP_BUSY))
-		return -1;
+		return -EBUSY;
 
 	if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION)
 		flags |= DWMCI_CMD_ABORT_STOP;