Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp2338943ybn; Thu, 26 Sep 2019 10:22:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSkWFGFlUXKIeFizj+dEvLnCbL2txQ4PYoDQLlbHtxpf7L8xgtYDmmLMnbluSdo+7N8vRr X-Received: by 2002:a17:906:4ec2:: with SMTP id i2mr4232032ejv.83.1569518564487; Thu, 26 Sep 2019 10:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569518564; cv=none; d=google.com; s=arc-20160816; b=QJ/zesBO33acU16Ya5QXq8ifvrUEx91F/O6jXS1mtZ33aaPtN5/hHAZUCjjk/K6HGc svqBAUwPQupS3JwmiPjUFf3ZLwpeKdKbX9glr+xkAg+fIDOMMN5q1oj2vuYrBXbdn1qj Z8UmnnBrDBd203CoCHiMmPgxiovfpwv23/oS5WeF3ka5p74spN2MJMWdKerCHAZrdK1Q xUdKZQ2CRdQWCib6X4sxJEzXfm+KB9ZfoYnYFxcTcPRtylF+HTuDHZ+ZkCdFwQvD2+AH i1G95hkdeoPoHGHe18wprDgMchR7AKeFpNBzYlNFid1Nmr5Kcz7M3412dHjUMGRcr8fl ie6A== 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=GAnaavwIetiqm3q0ID7fjoq9uqyNoujrVRTPM2TJD1U=; b=mwKAWdQFKzSQN82B2xUegMozzZlUtOYuFuZgi7O5g+2pi0Z3boyVcqu8TXCiYcC29b VDB+Qht13yRCgxQ3yCqtaXKe8vFNVO7pR2LXNCRraIKz4FZyvuXybyjGIVSP2Za4/QaD IEI7llcVOWwr+Fra7mAE5KgyTi6SGjC9I2AFOTvYN2Jke8AoXOKlT07j/hWLo+0DxQLF aMz9CUKqJL3T5yGKMhm+Bp3wyU+aCA4cpSHGjrNKDlJMaNurHmYKGzKwNHTQU7316DI6 n7FgBtC9ItqmFpdbg5PxV0jZ4u43uujmrO1JCWBu6NNN4FRMIQAKf6Kyn5Jmw88XoFoA wMzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=G0UMPdSp; 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 p36si1794934edc.373.2019.09.26.10.22.20; Thu, 26 Sep 2019 10:22:44 -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=G0UMPdSp; 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 S1727784AbfIZRTD (ORCPT + 99 others); Thu, 26 Sep 2019 13:19:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:59238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727662AbfIZRTD (ORCPT ); Thu, 26 Sep 2019 13:19:03 -0400 Received: from localhost (unknown [12.206.46.59]) (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 73638222C7; Thu, 26 Sep 2019 17:19:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569518342; bh=Iemf5tRfr5wOSFqa/aWWGJKPJS18KwjXC9W3m7Fd1pc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=G0UMPdSphtNsXSVixlIKQElNjAwFdXB0CIEWwEfcwGvIGlmRhn8/AJd2FEnSVlfDu Vlt3oaxizv34tN5YIvB165H2FC50Nbc2i9mR6dBdao0kNZfi0ySeeYa8esbWVtbwu7 A0DJRLq/6PDEGmFTemYnmPBKXbKIxbR3ECuVWwcs= Date: Thu, 26 Sep 2019 10:18:01 -0700 From: Vinod Koul To: Radhey Shyam Pandey Cc: "dan.j.williams@intel.com" , Michal Simek , "nick.graumann@gmail.com" , "andrea.merello@gmail.com" , Appana Durga Kedareswara Rao , "mcgrof@kernel.org" , "dmaengine@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH -next 3/8] dmaengine: xilinx_dma: Introduce xilinx_dma_get_residue Message-ID: <20190926171801.GM3824@vkoul-mobl> References: <1567701424-25658-1-git-send-email-radhey.shyam.pandey@xilinx.com> <1567701424-25658-4-git-send-email-radhey.shyam.pandey@xilinx.com> <20190925210123.GL3824@vkoul-mobl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26-09-19, 05:52, Radhey Shyam Pandey wrote: > > > + * VDMA and simple mode do not support residue reporting, so the > > > + * residue field will always be 0. > > > + */ > > > + if (chan->xdev->dma_config->dmatype == XDMA_TYPE_VDMA || > > !chan->has_sg) > > > + return residue; > > > > why not check this in status callback? > Assuming we mean to move vdma and non-sg check to xilinx_dma_tx_status. > Just a thought- Keeping this check in xilinx_dma_get_residue provides > an abstraction and caller can simply call this func with knowing about > IP config specific residue calculation. Considering this point does it > looks ok ? well you are checking either way, so calling the lower level function only when you need it makes more sense! -- ~Vinod