* [PATCH] sata_rcar: clear STOP bit in bmdma_start() method
@ 2013-05-21 19:07 Sergei Shtylyov
2013-05-21 23:41 ` Tejun Heo
0 siblings, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2013-05-21 19:07 UTC (permalink / raw)
To: linux-ide, tj, vladimir.barinov
Iff bmdma_setup() has to stop a DMA transfer before starting a new one, then the
STOP bit in the ATAPI_CONTROL1 register will remain set (it's only cleared when
setting the START bit to 1) and then bmdma_start() method will set both START
and STOP bits simultaneously which should abort the transfer being just started.
Avoid that by explicitly clearing the STOP bit in bmdma_start() method (in this
case it will be ignored on write).
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
This patch is against 'for-3.10-fixes' branch of Tejun Heo's 'libata.git' repo.
drivers/ata/sata_rcar.c | 1 +
1 file changed, 1 insertion(+)
Index: libata/drivers/ata/sata_rcar.c
===================================================================
--- libata.orig/drivers/ata/sata_rcar.c
+++ libata/drivers/ata/sata_rcar.c
@@ -549,6 +549,7 @@ static void sata_rcar_bmdma_start(struct
/* start host DMA transaction */
dmactl = ioread32(priv->base + ATAPI_CONTROL1_REG);
+ dmactl &= ~ATAPI_CONTROL1_STOP;
dmactl |= ATAPI_CONTROL1_START;
iowrite32(dmactl, priv->base + ATAPI_CONTROL1_REG);
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sata_rcar: clear STOP bit in bmdma_start() method
2013-05-21 19:07 [PATCH] sata_rcar: clear STOP bit in bmdma_start() method Sergei Shtylyov
@ 2013-05-21 23:41 ` Tejun Heo
2013-05-22 13:12 ` Sergei Shtylyov
0 siblings, 1 reply; 4+ messages in thread
From: Tejun Heo @ 2013-05-21 23:41 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: linux-ide, vladimir.barinov
On Tue, May 21, 2013 at 11:07:54PM +0400, Sergei Shtylyov wrote:
> Iff bmdma_setup() has to stop a DMA transfer before starting a new one, then the
> STOP bit in the ATAPI_CONTROL1 register will remain set (it's only cleared when
> setting the START bit to 1) and then bmdma_start() method will set both START
> and STOP bits simultaneously which should abort the transfer being just started.
> Avoid that by explicitly clearing the STOP bit in bmdma_start() method (in this
> case it will be ignored on write).
>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Applied to libata/for-3.10-fixes w/ stable cc'd.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sata_rcar: clear STOP bit in bmdma_start() method
2013-05-21 23:41 ` Tejun Heo
@ 2013-05-22 13:12 ` Sergei Shtylyov
2013-05-23 12:14 ` Sergei Shtylyov
0 siblings, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2013-05-22 13:12 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide, vladimir.barinov
Hello.
On 22-05-2013 3:41, Tejun Heo wrote:
>> Iff bmdma_setup() has to stop a DMA transfer before starting a new one, then the
>> STOP bit in the ATAPI_CONTROL1 register will remain set (it's only cleared when
>> setting the START bit to 1) and then bmdma_start() method will set both START
>> and STOP bits simultaneously which should abort the transfer being just started.
>> Avoid that by explicitly clearing the STOP bit in bmdma_start() method (in this
>> case it will be ignored on write).
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> Applied to libata/for-3.10-fixes w/ stable cc'd.
Thanks, I forgot about -stable. Anyway, it doesn't seem that serious
as bmdma_setup() usually shouldn't abort DMA.
> Thanks.
WBR, Sergei
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sata_rcar: clear STOP bit in bmdma_start() method
2013-05-22 13:12 ` Sergei Shtylyov
@ 2013-05-23 12:14 ` Sergei Shtylyov
0 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2013-05-23 12:14 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide, vladimir.barinov
Hello.
On 22-05-2013 17:12, Sergei Shtylyov wrote:
>>> Iff bmdma_setup() has to stop a DMA transfer before starting a new
>>> one, then the
>>> STOP bit in the ATAPI_CONTROL1 register will remain set (it's only
>>> cleared when
>>> setting the START bit to 1) and then bmdma_start() method will set
>>> both START
>>> and STOP bits simultaneously which should abort the transfer being
>>> just started.
>>> Avoid that by explicitly clearing the STOP bit in bmdma_start()
>>> method (in this
>>> case it will be ignored on write).
>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>> Applied to libata/for-3.10-fixes w/ stable cc'd.
> Thanks, I forgot about -stable. Anyway, it doesn't seem that serious
> as bmdma_setup() usually shouldn't abort DMA.
Although bmdma_stop() also can stop DMA which is not as improbable
(media errors, etc.). I could have wrotten a better changelog. :-/
>> Thanks.
WBR, Sergei
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-05-23 12:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-21 19:07 [PATCH] sata_rcar: clear STOP bit in bmdma_start() method Sergei Shtylyov
2013-05-21 23:41 ` Tejun Heo
2013-05-22 13:12 ` Sergei Shtylyov
2013-05-23 12:14 ` Sergei Shtylyov
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.