Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp216131ybl; Thu, 23 Jan 2020 22:07:57 -0800 (PST) X-Google-Smtp-Source: APXvYqyK2gWXEzuNaRNDWjw3D3KsIV8mnzsRYZrZaB9rSEz3549H45ol5WWkwTIbZXFKCu9qcAQr X-Received: by 2002:a9d:7b51:: with SMTP id f17mr1547284oto.302.1579846076907; Thu, 23 Jan 2020 22:07:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579846076; cv=none; d=google.com; s=arc-20160816; b=uDQ+XvOZnq3Vu3JYXWZ8WTCvXWwWc5Ta5XNHewluqwmwvNgtk+nzES5gjiws3EWA/2 NIFLQxgf2Kq+ejv/hLvSpJor1EkzJ552F/jZtfOqtWeRW+1p5Xs7xixXoWhAnlVardHG MVScTfgexZYzTlYXavibio9pXwbwtSkff76l82rc3gKOazIGAoGifD8rskXIOhHZNQ+L R0IDyjI7qyIBLAbpHdysLcvWzz6ZxOgGIlC4rFYFFQaLNU2iBoPM9sETAknBnOaWGgA4 FeQM03I+XJM7Y3o4ZPD+nG60I4X7d9rt4r57P0w8AqCEhdi5mCjIoF88vPClXaNkaB5z zuBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=WbYLfDaV4AR8lNLXOVXpFwZe++ZjvIKVgfLKYSANLNQ=; b=onPWzFAgc9NfjFUdipibIb70H+UDjNt9l1lguEeczmiNpU9mLb25SCFcLTxGTaC7+z KLv2eECd3GgXiz3FMLgIxnznsAU302KEyGgHJhq2Irx7vy+1CxbqrBqUPgMDwTIt/QUT AUojSzl1+NraZS9/GRR7scXQVQl3IP13KWN6L37z/0/hrHrt2eRjiL6q5Zec5Ze07ltC GuJxXdX9LJJWlYBHpb9Yd7+thaCOpBGaQJnLBQgspcyxfX3l5AakiyIB92CZhh58UPiQ wm8XnKmKrYTzdX13bS3cdBq+7/snavOa0ilMPbcZio4I6ibFixxVNdLPVQxx016eIXc/ bmOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="W/ezq8gS"; 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 n1si1917101oic.225.2020.01.23.22.07.45; Thu, 23 Jan 2020 22:07:56 -0800 (PST) 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="W/ezq8gS"; 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 S1730253AbgAXGFh (ORCPT + 99 others); Fri, 24 Jan 2020 01:05:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:59104 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725817AbgAXGFh (ORCPT ); Fri, 24 Jan 2020 01:05:37 -0500 Received: from localhost (unknown [106.200.244.96]) (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 66A9D2071A; Fri, 24 Jan 2020 06:05:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579845936; bh=O4VGvtDvjcC1nUtedyxB+0sSubL0ZZpjKeBF+Knm1qw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=W/ezq8gS3TtnXkKWlPfTtCWmf4XkUckEfqJyHY5XOcwAC2mH78JB0bPXyu8/e560v +mzYxSRidBPebCaygjngo1XhHfso3c9wY+MelMtYrzeLaT0/DC1xl1pe5AyCpngVY5 RGNfGZzcZmcATxEjhx0xwf+4Apvq5hwbRUhs6sYQ= Date: Fri, 24 Jan 2020 11:35:32 +0530 From: Vinod Koul To: Sanjay R Mehta Cc: gregkh@linuxfoundation.org, dan.j.williams@intel.com, Thomas.Lendacky@amd.com, Shyam-sundar.S-k@amd.com, Nehal-bakulchandra.Shah@amd.com, robh@kernel.org, mchehab+samsung@kernel.org, davem@davemloft.net, Jonathan.Cameron@huawei.com, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org Subject: Re: [PATCH v3 2/3] dmaengine: ptdma: Register pass-through engine as a DMA resource Message-ID: <20200124060532.GD2841@vkoul-mobl> References: <1579597494-60348-1-git-send-email-Sanju.Mehta@amd.com> <1579597494-60348-3-git-send-email-Sanju.Mehta@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1579597494-60348-3-git-send-email-Sanju.Mehta@amd.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21-01-20, 03:04, Sanjay R Mehta wrote: > +static void pt_free_chan_resources(struct dma_chan *dma_chan) > +{ > + struct pt_dma_chan *chan = container_of(dma_chan, struct pt_dma_chan, > + dma_chan); > + unsigned long flags; > + > + dev_dbg(chan->pt->dev, "%s - chan=%p\n", __func__, chan); > + > + spin_lock_irqsave(&chan->lock, flags); > + > + pt_free_desc_resources(chan->pt, &chan->complete); > + pt_free_desc_resources(chan->pt, &chan->active); > + pt_free_desc_resources(chan->pt, &chan->pending); > + pt_free_desc_resources(chan->pt, &chan->created); can you use the virt-dma layer instead for list and descriptor management.. > +static enum dma_status pt_tx_status(struct dma_chan *dma_chan, > + dma_cookie_t cookie, > + struct dma_tx_state *state) > +{ > + struct pt_dma_chan *chan = container_of(dma_chan, struct pt_dma_chan, > + dma_chan); > + struct pt_dma_desc *desc; > + enum dma_status ret; > + unsigned long flags; > + > + if (chan->status == DMA_PAUSED) { > + ret = DMA_PAUSED; the pt_tx_status is for a specific cookie and not for the channel, so you need to return status of the cookie which may have been completed or pending (where pause makes sense) > +static int pt_pause(struct dma_chan *dma_chan) > +{ > + struct pt_dma_chan *chan = container_of(dma_chan, struct pt_dma_chan, > + dma_chan); > + > + chan->status = DMA_PAUSED; > + > + /*TODO: Wait for active DMA to complete before returning? */ When will the be resolved :) -- ~Vinod