* [PATCH] mmc: jz4740: don't wait for PRG_DONE after stop command with R1 response
@ 2014-04-29 8:32 Alex Smith
2014-04-29 11:07 ` Ulf Hansson
0 siblings, 1 reply; 4+ messages in thread
From: Alex Smith @ 2014-04-29 8:32 UTC (permalink / raw)
To: linux-mmc
Cc: Alex Smith, Lars-Peter Clausen, Ulf Hansson, Chris Ball,
James Hogan
As of commit bcc3e1726d ("mmc: block: Use R1 responses for stop cmds for
read requests"), stop commands for reads do not have MMC_RSP_BUSY set.
In this case we should not wait for a PRG_DONE IRQ after sending the
stop command: it will not get raised when the busy flag is not set,
causing the request to fail with a timeout.
Signed-off-by: Alex Smith <alex.smith@imgtec.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Chris Ball <chris@printf.net>
Cc: James Hogan <james.hogan@imgtec.com>
---
drivers/mmc/host/jz4740_mmc.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c
index de2139c..1c3368b 100644
--- a/drivers/mmc/host/jz4740_mmc.c
+++ b/drivers/mmc/host/jz4740_mmc.c
@@ -515,10 +515,12 @@ static irqreturn_t jz_mmc_irq_worker(int irq, void *devid)
jz4740_mmc_send_command(host, req->stop);
- timeout = jz4740_mmc_poll_irq(host, JZ_MMC_IRQ_PRG_DONE);
- if (timeout) {
- host->state = JZ4740_MMC_STATE_DONE;
- break;
+ if (mmc_resp_type(req->stop) & MMC_RSP_BUSY) {
+ timeout = jz4740_mmc_poll_irq(host, JZ_MMC_IRQ_PRG_DONE);
+ if (timeout) {
+ host->state = JZ4740_MMC_STATE_DONE;
+ break;
+ }
}
case JZ4740_MMC_STATE_DONE:
break;
--
1.9.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mmc: jz4740: don't wait for PRG_DONE after stop command with R1 response
2014-04-29 8:32 [PATCH] mmc: jz4740: don't wait for PRG_DONE after stop command with R1 response Alex Smith
@ 2014-04-29 11:07 ` Ulf Hansson
2014-04-29 11:28 ` Lars-Peter Clausen
2014-04-29 12:11 ` Ulf Hansson
0 siblings, 2 replies; 4+ messages in thread
From: Ulf Hansson @ 2014-04-29 11:07 UTC (permalink / raw)
To: Alex Smith; +Cc: linux-mmc, Lars-Peter Clausen, Chris Ball, James Hogan
On 29 April 2014 10:32, Alex Smith <alex.smith@imgtec.com> wrote:
> As of commit bcc3e1726d ("mmc: block: Use R1 responses for stop cmds for
> read requests"), stop commands for reads do not have MMC_RSP_BUSY set.
> In this case we should not wait for a PRG_DONE IRQ after sending the
> stop command: it will not get raised when the busy flag is not set,
> causing the request to fail with a timeout.
>
> Signed-off-by: Alex Smith <alex.smith@imgtec.com>
> Cc: Lars-Peter Clausen <lars@metafoo.de>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: Chris Ball <chris@printf.net>
> Cc: James Hogan <james.hogan@imgtec.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
> drivers/mmc/host/jz4740_mmc.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c
> index de2139c..1c3368b 100644
> --- a/drivers/mmc/host/jz4740_mmc.c
> +++ b/drivers/mmc/host/jz4740_mmc.c
> @@ -515,10 +515,12 @@ static irqreturn_t jz_mmc_irq_worker(int irq, void *devid)
>
> jz4740_mmc_send_command(host, req->stop);
>
> - timeout = jz4740_mmc_poll_irq(host, JZ_MMC_IRQ_PRG_DONE);
> - if (timeout) {
> - host->state = JZ4740_MMC_STATE_DONE;
> - break;
> + if (mmc_resp_type(req->stop) & MMC_RSP_BUSY) {
> + timeout = jz4740_mmc_poll_irq(host, JZ_MMC_IRQ_PRG_DONE);
> + if (timeout) {
> + host->state = JZ4740_MMC_STATE_DONE;
> + break;
> + }
> }
> case JZ4740_MMC_STATE_DONE:
> break;
> --
> 1.9.2
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mmc: jz4740: don't wait for PRG_DONE after stop command with R1 response
2014-04-29 11:07 ` Ulf Hansson
@ 2014-04-29 11:28 ` Lars-Peter Clausen
2014-04-29 12:11 ` Ulf Hansson
1 sibling, 0 replies; 4+ messages in thread
From: Lars-Peter Clausen @ 2014-04-29 11:28 UTC (permalink / raw)
To: Ulf Hansson; +Cc: Alex Smith, linux-mmc, Chris Ball, James Hogan
On 04/29/2014 01:07 PM, Ulf Hansson wrote:
> On 29 April 2014 10:32, Alex Smith <alex.smith@imgtec.com> wrote:
>> As of commit bcc3e1726d ("mmc: block: Use R1 responses for stop cmds for
>> read requests"), stop commands for reads do not have MMC_RSP_BUSY set.
>> In this case we should not wait for a PRG_DONE IRQ after sending the
>> stop command: it will not get raised when the busy flag is not set,
>> causing the request to fail with a timeout.
>>
>> Signed-off-by: Alex Smith <alex.smith@imgtec.com>
>> Cc: Lars-Peter Clausen <lars@metafoo.de>
>> Cc: Ulf Hansson <ulf.hansson@linaro.org>
>> Cc: Chris Ball <chris@printf.net>
>> Cc: James Hogan <james.hogan@imgtec.com>
>
> Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mmc: jz4740: don't wait for PRG_DONE after stop command with R1 response
2014-04-29 11:07 ` Ulf Hansson
2014-04-29 11:28 ` Lars-Peter Clausen
@ 2014-04-29 12:11 ` Ulf Hansson
1 sibling, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2014-04-29 12:11 UTC (permalink / raw)
To: Alex Smith; +Cc: linux-mmc, Lars-Peter Clausen, Chris Ball, James Hogan
On 29 April 2014 13:07, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 29 April 2014 10:32, Alex Smith <alex.smith@imgtec.com> wrote:
>> As of commit bcc3e1726d ("mmc: block: Use R1 responses for stop cmds for
>> read requests"), stop commands for reads do not have MMC_RSP_BUSY set.
>> In this case we should not wait for a PRG_DONE IRQ after sending the
>> stop command: it will not get raised when the busy flag is not set,
>> causing the request to fail with a timeout.
>>
>> Signed-off-by: Alex Smith <alex.smith@imgtec.com>
>> Cc: Lars-Peter Clausen <lars@metafoo.de>
>> Cc: Ulf Hansson <ulf.hansson@linaro.org>
>> Cc: Chris Ball <chris@printf.net>
>> Cc: James Hogan <james.hogan@imgtec.com>
>
> Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Alex, could you please resend a new version which has been verified
using checkpatch.
Kind regards
Ulf Hansson
>
>> ---
>> drivers/mmc/host/jz4740_mmc.c | 10 ++++++----
>> 1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c
>> index de2139c..1c3368b 100644
>> --- a/drivers/mmc/host/jz4740_mmc.c
>> +++ b/drivers/mmc/host/jz4740_mmc.c
>> @@ -515,10 +515,12 @@ static irqreturn_t jz_mmc_irq_worker(int irq, void *devid)
>>
>> jz4740_mmc_send_command(host, req->stop);
>>
>> - timeout = jz4740_mmc_poll_irq(host, JZ_MMC_IRQ_PRG_DONE);
>> - if (timeout) {
>> - host->state = JZ4740_MMC_STATE_DONE;
>> - break;
>> + if (mmc_resp_type(req->stop) & MMC_RSP_BUSY) {
>> + timeout = jz4740_mmc_poll_irq(host, JZ_MMC_IRQ_PRG_DONE);
>> + if (timeout) {
>> + host->state = JZ4740_MMC_STATE_DONE;
>> + break;
>> + }
>> }
>> case JZ4740_MMC_STATE_DONE:
>> break;
>> --
>> 1.9.2
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-04-29 12:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-29 8:32 [PATCH] mmc: jz4740: don't wait for PRG_DONE after stop command with R1 response Alex Smith
2014-04-29 11:07 ` Ulf Hansson
2014-04-29 11:28 ` Lars-Peter Clausen
2014-04-29 12:11 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox