* [PATCH] txx9dmac: Fix clearing of CHAR register in 32-bit kernel
@ 2009-04-28 15:11 Atsushi Nemoto
2009-04-28 15:23 ` Ralf Baechle
0 siblings, 1 reply; 2+ messages in thread
From: Atsushi Nemoto @ 2009-04-28 15:11 UTC (permalink / raw)
To: linux-mips; +Cc: ralf, dan.j.williams, linux-kernel
The CHAR register is 64-bit width but 32-bit kernel uses its lower
part only. Be careful of initializing it.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
This patch is against linux-mips.org linux-queue tree.
Please queue this or fold into "DMA: TXx9 Soc DMA Controller driver" patch.
drivers/dma/txx9dmac.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/drivers/dma/txx9dmac.c b/drivers/dma/txx9dmac.c
index c655350..9aa9ea9 100644
--- a/drivers/dma/txx9dmac.c
+++ b/drivers/dma/txx9dmac.c
@@ -72,6 +72,16 @@ static void channel64_write_CHAR(const struct txx9dmac_chan *dc, dma_addr_t val)
channel64_writel(dc, CHAR, val);
}
+static void channel64_clear_CHAR(const struct txx9dmac_chan *dc)
+{
+#if defined(CONFIG_32BIT) && !defined(CONFIG_64BIT_PHYS_ADDR)
+ channel64_writel(dc, CHAR, 0);
+ channel64_writel(dc, __pad_CHAR, 0);
+#else
+ channel64_writeq(dc, CHAR, 0);
+#endif
+}
+
static dma_addr_t channel_read_CHAR(const struct txx9dmac_chan *dc)
{
if (is_dmac64(dc))
@@ -318,7 +328,7 @@ static void txx9dmac_reset_chan(struct txx9dmac_chan *dc)
{
channel_writel(dc, CCR, TXX9_DMA_CCR_CHRST);
if (is_dmac64(dc)) {
- channel_writeq(dc, CHAR, 0);
+ channel64_clear_CHAR(dc);
channel_writeq(dc, SAR, 0);
channel_writeq(dc, DAR, 0);
} else {
--
1.5.6.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] txx9dmac: Fix clearing of CHAR register in 32-bit kernel
2009-04-28 15:11 [PATCH] txx9dmac: Fix clearing of CHAR register in 32-bit kernel Atsushi Nemoto
@ 2009-04-28 15:23 ` Ralf Baechle
0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2009-04-28 15:23 UTC (permalink / raw)
To: Atsushi Nemoto; +Cc: linux-mips, dan.j.williams, linux-kernel
On Wed, Apr 29, 2009 at 12:11:15AM +0900, Atsushi Nemoto wrote:
> The CHAR register is 64-bit width but 32-bit kernel uses its lower
> part only. Be careful of initializing it.
>
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> ---
> This patch is against linux-mips.org linux-queue tree.
> Please queue this or fold into "DMA: TXx9 Soc DMA Controller driver" patch.
Done. Thanks!
Ralf
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-04-28 15:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-28 15:11 [PATCH] txx9dmac: Fix clearing of CHAR register in 32-bit kernel Atsushi Nemoto
2009-04-28 15:23 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).