lkml.org 
[lkml]   [2022]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/3] dmaengine: dw-axi-dmac: dump channel registers on error
From
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@sifive.com>
>> ---
>> .../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.

\
 
 \ /
  Last update: 2022-07-22 00:19    [W:0.332 / U:1.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site