* [U-Boot] [PATCH] mmc: Remove incorrect cmd->flags usage
@ 2012-09-06 20:36 Andy Fleming
2012-09-06 23:24 ` Marek Vasut
0 siblings, 1 reply; 3+ messages in thread
From: Andy Fleming @ 2012-09-06 20:36 UTC (permalink / raw)
To: u-boot
There were a couple of drivers that were actually using the flags
field of the cmd structure, despite the fact that no one ever
*set* that field. When we removed the field, those drivers failed
to compile. Replaced the references with the correct usage of
resp_type.
Signed-off-by: Andy Fleming <afleming@freescale.com>
---
I've gone and applied this to the mmc repository, as it's more
correct than the current implementation. I don't anticipate any
problems, but the pl180 and pxa folks should make sure their
drivers still work.
drivers/mmc/arm_pl180_mmci.c | 2 +-
drivers/mmc/pxa_mmc_gen.c | 8 +++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
index db2c7ab..af1380a 100644
--- a/drivers/mmc/arm_pl180_mmci.c
+++ b/drivers/mmc/arm_pl180_mmci.c
@@ -52,7 +52,7 @@ static int wait_for_command_end(struct mmc *dev, struct mmc_cmd *cmd)
debug("CMD%d time out\n", cmd->cmdidx);
return TIMEOUT;
} else if ((hoststatus & SDI_STA_CCRCFAIL) &&
- (cmd->flags & MMC_RSP_CRC)) {
+ (cmd->resp_type & MMC_RSP_CRC)) {
printf("CMD%d CRC error\n", cmd->cmdidx);
return -EILSEQ;
}
diff --git a/drivers/mmc/pxa_mmc_gen.c b/drivers/mmc/pxa_mmc_gen.c
index 2c5bf17..b3ec441 100644
--- a/drivers/mmc/pxa_mmc_gen.c
+++ b/drivers/mmc/pxa_mmc_gen.c
@@ -118,7 +118,7 @@ static int pxa_mmc_start_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
int ret;
/* The card can send a "busy" response */
- if (cmd->flags & MMC_RSP_BUSY)
+ if (cmd->resp_type & MMC_RSP_BUSY)
cmdat |= MMC_CMDAT_BUSY;
/* Inform the controller about response type */
@@ -181,9 +181,11 @@ static int pxa_mmc_cmd_done(struct mmc *mmc, struct mmc_cmd *cmd)
/* The command response didn't arrive */
if (stat & MMC_STAT_TIME_OUT_RESPONSE)
return -ETIMEDOUT;
- else if (stat & MMC_STAT_RES_CRC_ERROR && cmd->flags & MMC_RSP_CRC) {
+ else if (stat & MMC_STAT_RES_CRC_ERROR
+ && cmd->resp_type & MMC_RSP_CRC) {
#ifdef PXAMMC_CRC_SKIP
- if (cmd->flags & MMC_RSP_136 && cmd->response[0] & (1 << 31))
+ if (cmd->resp_type & MMC_RSP_136
+ && cmd->response[0] & (1 << 31))
printf("Ignoring CRC, this may be dangerous!\n");
else
#endif
--
1.7.9.7
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] mmc: Remove incorrect cmd->flags usage
2012-09-06 20:36 [U-Boot] [PATCH] mmc: Remove incorrect cmd->flags usage Andy Fleming
@ 2012-09-06 23:24 ` Marek Vasut
2012-09-07 2:19 ` Marek Vasut
0 siblings, 1 reply; 3+ messages in thread
From: Marek Vasut @ 2012-09-06 23:24 UTC (permalink / raw)
To: u-boot
Dear Andy Fleming,
> There were a couple of drivers that were actually using the flags
> field of the cmd structure, despite the fact that no one ever
> *set* that field. When we removed the field, those drivers failed
> to compile. Replaced the references with the correct usage of
> resp_type.
I'll run duts tests on this on M28, stay tuned.
> Signed-off-by: Andy Fleming <afleming@freescale.com>
> ---
> I've gone and applied this to the mmc repository, as it's more
> correct than the current implementation. I don't anticipate any
> problems, but the pl180 and pxa folks should make sure their
> drivers still work.
>
> drivers/mmc/arm_pl180_mmci.c | 2 +-
> drivers/mmc/pxa_mmc_gen.c | 8 +++++---
> 2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
> index db2c7ab..af1380a 100644
> --- a/drivers/mmc/arm_pl180_mmci.c
> +++ b/drivers/mmc/arm_pl180_mmci.c
> @@ -52,7 +52,7 @@ static int wait_for_command_end(struct mmc *dev, struct
> mmc_cmd *cmd) debug("CMD%d time out\n", cmd->cmdidx);
> return TIMEOUT;
> } else if ((hoststatus & SDI_STA_CCRCFAIL) &&
> - (cmd->flags & MMC_RSP_CRC)) {
> + (cmd->resp_type & MMC_RSP_CRC)) {
> printf("CMD%d CRC error\n", cmd->cmdidx);
> return -EILSEQ;
> }
> diff --git a/drivers/mmc/pxa_mmc_gen.c b/drivers/mmc/pxa_mmc_gen.c
> index 2c5bf17..b3ec441 100644
> --- a/drivers/mmc/pxa_mmc_gen.c
> +++ b/drivers/mmc/pxa_mmc_gen.c
> @@ -118,7 +118,7 @@ static int pxa_mmc_start_cmd(struct mmc *mmc, struct
> mmc_cmd *cmd, int ret;
>
> /* The card can send a "busy" response */
> - if (cmd->flags & MMC_RSP_BUSY)
> + if (cmd->resp_type & MMC_RSP_BUSY)
> cmdat |= MMC_CMDAT_BUSY;
>
> /* Inform the controller about response type */
> @@ -181,9 +181,11 @@ static int pxa_mmc_cmd_done(struct mmc *mmc, struct
> mmc_cmd *cmd) /* The command response didn't arrive */
> if (stat & MMC_STAT_TIME_OUT_RESPONSE)
> return -ETIMEDOUT;
> - else if (stat & MMC_STAT_RES_CRC_ERROR && cmd->flags & MMC_RSP_CRC) {
> + else if (stat & MMC_STAT_RES_CRC_ERROR
> + && cmd->resp_type & MMC_RSP_CRC) {
> #ifdef PXAMMC_CRC_SKIP
> - if (cmd->flags & MMC_RSP_136 && cmd->response[0] & (1 << 31))
> + if (cmd->resp_type & MMC_RSP_136
> + && cmd->response[0] & (1 << 31))
> printf("Ignoring CRC, this may be dangerous!\n");
> else
> #endif
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] mmc: Remove incorrect cmd->flags usage
2012-09-06 23:24 ` Marek Vasut
@ 2012-09-07 2:19 ` Marek Vasut
0 siblings, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2012-09-07 2:19 UTC (permalink / raw)
To: u-boot
Dear Marek Vasut,
> Dear Andy Fleming,
>
> > There were a couple of drivers that were actually using the flags
> > field of the cmd structure, despite the fact that no one ever
> > *set* that field. When we removed the field, those drivers failed
> > to compile. Replaced the references with the correct usage of
> > resp_type.
>
> I'll run duts tests on this on M28, stay tuned.
[...]
Ok, seems to work on M28.
Tested-by: Marek Vasut <marex@denx.de>
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-09-07 2:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-06 20:36 [U-Boot] [PATCH] mmc: Remove incorrect cmd->flags usage Andy Fleming
2012-09-06 23:24 ` Marek Vasut
2012-09-07 2:19 ` Marek Vasut
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.