Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp546400yba; Fri, 26 Apr 2019 04:53:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhZodqDTOyfsRvsu99c8NsMUHguNaHoJRvTDUXlWqRtSSDb/EnTIGw/+0jdHnWPfsEnU54 X-Received: by 2002:a62:51c5:: with SMTP id f188mr7813517pfb.239.1556279621867; Fri, 26 Apr 2019 04:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556279621; cv=none; d=google.com; s=arc-20160816; b=088jON05ihslM9Ew/5ggW5kqOuWLhPEJRWDcfyIESgWP1By3z4BEZKsSE1HspzbDY0 jQrCJoQwgdcQeX3L5KVuhDbwqdvqnZqb/eBGlztsBwbqjeysIyrLOKj7MGH1IPDOfeVO EhWTnwyJdqmAJeN/prXRBWa1fMsA9PoLTIlJ2z5qfC43nBegWJ9D/YjM5m/QWcG/edd9 pONxmDwQYryVe1bYaoFqNdYKU434HYmS5QzH86Rz2e/pgpno4vQqx6NKQHa2dSemDj+C U/+ApV8hBkDEF2J/7zcH3eN8/l3Y3iA0HpjwwWdrW2GvNAz6NvZiSHUTyDbvD2P7HVOI jMYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LZ5Qv/YQjGqrh5rV0qs/SK0IK2+EYPab21TCB5E/Z7g=; b=AmSrH7TXYFt2DduCvEbpNKICv5qAO1URlIAAMc/4zN3Wkjeu5VL0cu1ZAsYlyDMAkk XBhsHAW5DE/D2vrAhaLOBvxzTxtU+8lES4bUkP5PF9+o0qgns2IOsVVSGEvfn7yeboXf H9wGw53pjbX8jgqbBcN6Qn4y3G2huk3WgCejDPzhodsb3oXjovrg3EOvRGA61D2vKnKO GToQu9CXS9oD5sx95hOeTAZaYY514V916/Eg1cw0U9uYk+QuaKQ31wHySNZbNtOnYEeG 9uDMNGu/ervCwMRVLIhzW+7hYJYa/weXvdQuGMFIko7OExEATE/D7NUJsLXlnr1b3MA1 gQUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OE7X96wL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si23797442pgc.307.2019.04.26.04.53.27; Fri, 26 Apr 2019 04:53:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OE7X96wL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726257AbfDZLu4 (ORCPT + 99 others); Fri, 26 Apr 2019 07:50:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:43630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbfDZLuz (ORCPT ); Fri, 26 Apr 2019 07:50:55 -0400 Received: from localhost (unknown [171.76.113.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F40FA2084F; Fri, 26 Apr 2019 11:50:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556279454; bh=Lwhq3yGTLwZBXZG7d5cZPZUNHsm6dVmKEROQ8WGGliM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OE7X96wLJ7r/44OQU/ONgLqbtBQX7QoV3QL1ig4fkpoXr7iI9ywW2ec1D04l93k/o qEsS92zXBO446tnIdei/yZe7BrE6iVH4dpvvqCqm9Owdwl+33QHhP+Hj059DB0P8U1 TRQHEwHFiJULFK9HMQ55/A1W3iZRkSIxmrbBO9Ks= Date: Fri, 26 Apr 2019 17:20:47 +0530 From: Vinod Koul To: Peng Ma Cc: dan.j.williams@intel.com, leoyang.li@nxp.com, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dmaengine: fsl-qdma: fixed the source/destination descriptior format Message-ID: <20190426115047.GW28103@vkoul-mobl> References: <20190419084629.41742-1-peng.ma@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190419084629.41742-1-peng.ma@nxp.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19-04-19, 08:46, Peng Ma wrote: > CMD of Source/Destination descriptior format should be lower of s/descriptior/descriptor > struct fsl_qdma_engine number data address. > > Signed-off-by: Peng Ma > --- > drivers/dma/fsl-qdma.c | 29 ++++++++++++++++++----------- > 1 files changed, 18 insertions(+), 11 deletions(-) > > diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c > index aa1d0ae..542765a 100644 > --- a/drivers/dma/fsl-qdma.c > +++ b/drivers/dma/fsl-qdma.c > @@ -113,6 +113,7 @@ > /* Field definition for Descriptor offset */ > #define QDMA_CCDF_STATUS 20 > #define QDMA_CCDF_OFFSET 20 > +#define QDMA_SDDF_CMD(x) (((u64)(x)) << 32) > > /* Field definition for safe loop count*/ > #define FSL_QDMA_HALT_COUNT 1500 > @@ -214,6 +215,12 @@ struct fsl_qdma_engine { > > }; > > +static inline void > +qdma_sddf_set_cmd(struct fsl_qdma_format *sddf, u32 val) > +{ > + sddf->data = QDMA_SDDF_CMD(val); > +} > + > static inline u64 > qdma_ccdf_addr_get64(const struct fsl_qdma_format *ccdf) > { > @@ -341,6 +348,7 @@ static void fsl_qdma_free_chan_resources(struct dma_chan *chan) > static void fsl_qdma_comp_fill_memcpy(struct fsl_qdma_comp *fsl_comp, > dma_addr_t dst, dma_addr_t src, u32 len) > { > + u32 cmd; > struct fsl_qdma_format *sdf, *ddf; > struct fsl_qdma_format *ccdf, *csgf_desc, *csgf_src, *csgf_dest; > > @@ -353,6 +361,7 @@ static void fsl_qdma_comp_fill_memcpy(struct fsl_qdma_comp *fsl_comp, > > memset(fsl_comp->virt_addr, 0, FSL_QDMA_COMMAND_BUFFER_SIZE); > memset(fsl_comp->desc_virt_addr, 0, FSL_QDMA_DESCRIPTOR_BUFFER_SIZE); > + > /* Head Command Descriptor(Frame Descriptor) */ > qdma_desc_addr_set64(ccdf, fsl_comp->bus_addr + 16); > qdma_ccdf_set_format(ccdf, qdma_ccdf_get_offset(ccdf)); > @@ -369,14 +378,14 @@ static void fsl_qdma_comp_fill_memcpy(struct fsl_qdma_comp *fsl_comp, > /* This entry is the last entry. */ > qdma_csgf_set_f(csgf_dest, len); > /* Descriptor Buffer */ > - sdf->data = > - cpu_to_le64(FSL_QDMA_CMD_RWTTYPE << > - FSL_QDMA_CMD_RWTTYPE_OFFSET); > - ddf->data = > - cpu_to_le64(FSL_QDMA_CMD_RWTTYPE << > - FSL_QDMA_CMD_RWTTYPE_OFFSET); > - ddf->data |= > - cpu_to_le64(FSL_QDMA_CMD_LWC << FSL_QDMA_CMD_LWC_OFFSET); > + cmd = cpu_to_le32(FSL_QDMA_CMD_RWTTYPE << > + FSL_QDMA_CMD_RWTTYPE_OFFSET); > + qdma_sddf_set_cmd(sdf, cmd); > + > + cmd = cpu_to_le32(FSL_QDMA_CMD_RWTTYPE << > + FSL_QDMA_CMD_RWTTYPE_OFFSET); > + cmd |= cpu_to_le32(FSL_QDMA_CMD_LWC << FSL_QDMA_CMD_LWC_OFFSET); > + qdma_sddf_set_cmd(ddf, cmd); > } > > /* > @@ -701,10 +710,8 @@ static irqreturn_t fsl_qdma_error_handler(int irq, void *dev_id) > > intr = qdma_readl(fsl_qdma, status + FSL_QDMA_DEDR); > > - if (intr) { > + if (intr) > dev_err(fsl_qdma->dma_dev.dev, "DMA transaction error!\n"); > - return IRQ_NONE; > - } this seems unrelated can you explain? > > qdma_writel(fsl_qdma, FSL_QDMA_DEDR_CLEAR, status + FSL_QDMA_DEDR); > return IRQ_HANDLED; > -- > 1.7.1 -- ~Vinod