Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752216AbbHSSUh (ORCPT ); Wed, 19 Aug 2015 14:20:37 -0400 Received: from mail-io0-f172.google.com ([209.85.223.172]:35791 "EHLO mail-io0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751120AbbHSSUf (ORCPT ); Wed, 19 Aug 2015 14:20:35 -0400 MIME-Version: 1.0 In-Reply-To: <20150819164115.GG13546@localhost> References: <20150819164115.GG13546@localhost> From: Michal Suchanek Date: Wed, 19 Aug 2015 20:19:55 +0200 Message-ID: Subject: Re: [PATCH 2/2] dmaengine: pl330: event debug messages. To: Vinod Koul Cc: Dan Williams , dmaengine , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3213 Lines: 81 On 19 August 2015 at 18:41, Vinod Koul wrote: > On Tue, Jul 28, 2015 at 10:49:33AM +0000, Michal Suchanek wrote: >> In pl330.c is a define which enables very verbose decoding of genereted >> programs. >> >> Also add decoding of thread abort states and signalled events. >> >> Signed-off-by: Michal Suchanek >> --- >> drivers/dma/pl330.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++- >> 1 file changed, 53 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c >> index 257e0d9..9b02936 100644 >> --- a/drivers/dma/pl330.c >> +++ b/drivers/dma/pl330.c >> @@ -1318,6 +1318,10 @@ static int _setup_req(unsigned dry_run, struct pl330_thread *thrd, >> u8 *buf = req->mc_cpu; >> int off = 0; >> >> + if (!dry_run) >> + dev_dbg(thrd->dmac->ddma.dev, >> + "setting up request on thread %i", thrd->id); >> + >> PL330_DBGMC_START(req->mc_bus); >> >> /* DMAMOV CCR, ccr */ >> @@ -1545,6 +1549,20 @@ static int pl330_update(struct pl330_dmac *pl330) >> pl330->dmac_tbd.reset_mngr = true; >> else >> pl330->dmac_tbd.reset_mngr = false; >> +#ifdef PL330_DEBUG_MCGEN > do we need this here? It's very verbose so I used the define for verbose debug since there is one already. > >> + if (val) { >> + val = readl(regs + FTM); >> + dev_info(pl330->ddma.dev, >> + "Manager thread fault %s%s%s%s%s%s", >> + (val & (1 << 30)) ? "dbg iface" : "sys mem", >> + (val & (1 << 16)) ? " fetch error" : "", >> + (val & (1 << 5)) ? " event sec error" : "", >> + (val & (1 << 4)) ? " channel sec error" : "", >> + (val & (1 << 1)) ? " invalid operand" : "", >> + (val & (1 << 0)) ? " invalid instruction" : "" >> + ); >> + } >> +#endif >> >> val = readl(regs + FSC) & ((1 << pl330->pcfg.num_chan) - 1); >> pl330->dmac_tbd.reset_chan |= val; >> @@ -1552,10 +1570,41 @@ static int pl330_update(struct pl330_dmac *pl330) >> int i = 0; >> while (i < pl330->pcfg.num_chan) { >> if (val & (1 << i)) { >> + u32 fault = readl(regs + FTC(i)); >> +#ifdef PL330_DEBUG_MCGEN >> + dev_info(pl330->ddma.dev, >> + "DMA thread fault" >> + "%s%s%s%s%s%s%s%s%s%s%s%s", > This break grep! also looks very ugly and should be a dev_debug rather It looks ugly indeed but I have no idea how to decode flag bitfield into string in some more sensible way. If you have an example of nice code doing this please share. I did not even hit this one since the thread just stalls waiting for device and does not fault in my case. Thanks Michal -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/