Re: [PATCH 1/3] dmaengine: dw-axi-dmac: dump channel registers on error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21/07/2022 13:30, Vinod Koul wrote:
On 08-07-22, 18:01, Ben Dooks wrote:
On channel error, dump the channel register state before
the channel's LLI entries to see what the controller was
actually doing when the error happend.

Signed-off-by: Ben Dooks <ben.dooks@xxxxxxxxxx>
---
  .../dma/dw-axi-dmac/dw-axi-dmac-platform.c    | 28 +++++++++++++++++++
  1 file changed, 28 insertions(+)

diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index e9c9bcb1f5c2..75c537153e92 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -79,6 +79,20 @@ axi_chan_iowrite64(struct axi_dma_chan *chan, u32 reg, u64 val)
  	iowrite32(upper_32_bits(val), chan->chan_regs + reg + 4);
  }
+static inline u64
+axi_chan_ioread64(struct axi_dma_chan *chan, u32 reg)
+{
+	u32 high, low;
+	u64 result;
+
+	low = ioread32(chan->chan_regs + reg);
+	high = ioread32(chan->chan_regs + reg + 4);
+
+	result = low;
+	result |= (u64)high << 32;
+	return result;
+}

Better to use helpers like lo_hi_readq()?

Will go check on those, thanks.



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux