Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3265312ybz; Sun, 3 May 2020 22:31:50 -0700 (PDT) X-Google-Smtp-Source: APiQypItwFDYh9XldZHu+u7g1O3gyn6StcjeXA9rD9P2yenYR8jskP1yxXod0LU9Qk1ROzu968iQ X-Received: by 2002:aa7:c1cf:: with SMTP id d15mr12431897edp.266.1588570310005; Sun, 03 May 2020 22:31:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588570310; cv=none; d=google.com; s=arc-20160816; b=vogKBWmy61Z6YDYqSJbwgZH/6fIbVaXULQjaarYdhntV/BxCXJrX6RgvSMuZ8MfoFp txWldKVeo14zpMVZW89et0nMm/lnc4iSzHXfUZhSOKMxsTPsnXnDD/O2h/hZddZRF01X 9L0dc5svJbbYdU/Vv7abHuV53jEzbCq1/43fQ/SEiSXDtkC7rT9Q7gJCqMp5RBsPbF7h qo3SUzZU6r1nHr9UW/SOjEYWY/XXW99brMMsmd+/xHv6YXtJG9CdJpJ70RaqFOjDYC+c XXgpBwSiiGV0ndugcdzVh8v2VZpvJObihoKpXaFdE9XQiwiRyHZ006uLeob1jBeJ+gOC 12UA== 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=LKcv8dOm5sakzzhCBG0P0Wx4bfXdoqYQ7HTrqJMdfWU=; b=EmG08hrU9l7hJPlP5pajDO0LexCml9k2oFlJ3uM4+4QwpOzQH3xbYcSLtQopgugdII 1St9594yA+JcuPHqxpHCfUn2bGAEg8Tb7iuk4HcyOBHlvl9k7yWcZkfyjotKF27W4HRF 8DlrHd7Awq08PPvl/jMow8JURl982shWgKFxZkYWkJUmhTdkcQ+h3o4PJA1eFXS5UZPt LxgHSCn6g9ZKCIkr4jXq17TxZCXBHGuxvPJA5OYxD0oOGmQwFixWz6wrxV47AeEPs75Z IDHVjmP1qXPfKHdg89bOrmXBSjyBxz9rZxtzzY17V9Bd5QX0jAKRDnRHWNTH3h/9ZnFq 4cHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=APZ0NKpt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id x5si6313260eds.496.2020.05.03.22.31.26; Sun, 03 May 2020 22:31:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=APZ0NKpt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726891AbgEDFaD (ORCPT + 99 others); Mon, 4 May 2020 01:30:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:36380 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725859AbgEDFaD (ORCPT ); Mon, 4 May 2020 01:30:03 -0400 Received: from localhost (unknown [171.76.84.84]) (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 0EE6A20643; Mon, 4 May 2020 05:30:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588570202; bh=qb8TFTxPvAhYVp5MgrmNT6TV3hFAhoKv0fd+mmu/eVQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=APZ0NKptkV7nQmbOJVXrZ9iWMmMUmj7uJeCMSrHt7W1oMBQo2hOiesdv2pwFAdOAX n+RM1steegXVBEEFP8BhW3PsJ+at9begFNrDZryT9bPwWuktnqkKUAj8LVmqsASYwL JxanWkMRzCWA5b0BpFF1z3OMwKSLO7Spju32iFGc= Date: Mon, 4 May 2020 10:59:58 +0530 From: Vinod Koul To: Alan Mikhak Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, gustavo.pimentel@synopsys.com, dan.j.williams@intel.com, kishon@ti.com, paul.walmsley@sifive.com Subject: Re: [PATCH][next] dmaengine: dw-edma: support local dma device transfer semantics Message-ID: <20200504052958.GH1375924@vkoul-mobl> References: <1588122633-1552-1-git-send-email-alan.mikhak@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1588122633-1552-1-git-send-email-alan.mikhak@sifive.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28-04-20, 18:10, Alan Mikhak wrote: > From: Alan Mikhak > > Modify dw_edma_device_transfer() to also support the semantics of dma > device transfer for additional use cases involving pcitest utility as a > local initiator. > > For its original use case, dw-edma supported the semantics of dma device > transfer from the perspective of a remote initiator who is located across > the PCIe bus from dma channel hardware. > > To a remote initiator, DMA_DEV_TO_MEM means using a remote dma WRITE > channel to transfer from remote memory to local memory. A WRITE channel > would be employed on the remote device in order to move the contents of > remote memory to the bus destined for local memory. > > To a remote initiator, DMA_MEM_TO_DEV means using a remote dma READ > channel to transfer from local memory to remote memory. A READ channel > would be employed on the remote device in order to move the contents of > local memory to the bus destined for remote memory. > > >From the perspective of a local dma initiator who is co-located on the > same side of the PCIe bus as the dma channel hardware, the semantics of > dma device transfer are flipped. > > To a local initiator, DMA_DEV_TO_MEM means using a local dma READ channel > to transfer from remote memory to local memory. A READ channel would be > employed on the local device in order to move the contents of remote > memory to the bus destined for local memory. > > To a local initiator, DMA_MEM_TO_DEV means using a local dma WRITE channel > to transfer from local memory to remote memory. A WRITE channel would be > employed on the local device in order to move the contents of local memory > to the bus destined for remote memory. > > To support local dma initiators, dw_edma_device_transfer() is modified to > now examine the direction field of struct dma_slave_config for the channel > which initiators can configure by calling dmaengine_slave_config(). > > If direction is configured as either DMA_DEV_TO_MEM or DMA_MEM_TO_DEV, > local initiator semantics are used. If direction is a value other than > DMA_DEV_TO_MEM nor DMA_MEM_TO_DEV, then remote initiator semantics are > used. This should maintain backward compatibility with the original use > case of dw-edma. > > The dw-edma-test utility is an example of a remote initiator. From reading > its patch, dw-edma-test does not specifically set the direction field of > struct dma_slave_config. Since dw_edma_device_transfer() also does not > check the direction field of struct dma_slave_config, it seems safe to use > this convention in dw-edma to support both local and remote initiator > semantics. Applied, thanks -- ~Vinod