Received: by 10.192.165.156 with SMTP id m28csp651584imm; Wed, 11 Apr 2018 05:20:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Zmj/DUCNx1+Hb2zYSdYtDVH5ZALWzzwKVJ/gixYzyIFCIqiu47jW8nEVABN6a7Wwr8zPR X-Received: by 10.101.97.163 with SMTP id i3mr3332025pgv.447.1523449209415; Wed, 11 Apr 2018 05:20:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523449209; cv=none; d=google.com; s=arc-20160816; b=Gc9qmfYcZY+5hmD3U3Xc2t93Lhhv1v3PzosANAF6Gd5z1wAoSDrh3eyY0pThcvx0ji 1iddHeUYT8GhltivMZWfGg1HBgYWllmrcxOMLxj8MB0yCl5/zAsIlV5Vi6SvB9VWRSF7 VwcouxEbYtqTeBa7clod9X9E5RwK0O/a8QryQyAczu+eqOo0Au1Y0N5H6iGYG/9r+VK8 1MN1bMOZaN+nsrlfYnMP1nDV2QBCGiWsD/6cwsnun66mM9QIY8bWHLo+SC31d8Blfgjb B0wLu2MsiyTYKz7RHlqdu/Gnv11HdznomI07DIdIV/s13Xsua6fxFIq4RCE9TtbUa+AX C4pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=MYUUTrgSAjdY28dbyrXql8qMppvWHjmL+F4W3musMbA=; b=ZBJcA16tCNC73Me1JnigozrZoKQ/pj0+vv07vlYPV2I5ub7DpcrqSutpdDCSqcdP8b kiuL8ZTD3zSm363LV/Rk3uNWZUVtnZhe82Nn999gB4dUgOqnVlXzXQMM3Mhkjuz9043a laqrxTbPSgLBSb4j55EBoN7rLIcu9j/LBqdqiR7CEObqP/DUqOuL4z0FYY8894nj4LWv HU6f6VTyL0Gs9lsFKQlDRyXTsbn+V/RZpw76ylI9vUmbsg4S1QoVitDD0YND0r0DG71k 1m5lGhpi+CUg4b6nEzfcxwlCV+p1vXl8zK9FV4IUwv5qoyTjEne2qnhu/gQwVfdKUuoc k+0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e/LlSOUG; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q61-v6si951808plb.719.2018.04.11.05.19.32; Wed, 11 Apr 2018 05:20:09 -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=@linaro.org header.s=google header.b=e/LlSOUG; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752915AbeDKMNb (ORCPT + 99 others); Wed, 11 Apr 2018 08:13:31 -0400 Received: from mail-oi0-f50.google.com ([209.85.218.50]:45979 "EHLO mail-oi0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752482AbeDKMN3 (ORCPT ); Wed, 11 Apr 2018 08:13:29 -0400 Received: by mail-oi0-f50.google.com with SMTP id 71-v6so1445781oie.12 for ; Wed, 11 Apr 2018 05:13:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=MYUUTrgSAjdY28dbyrXql8qMppvWHjmL+F4W3musMbA=; b=e/LlSOUGKmyEzsNplTO8okSZb6TpuL1/3CwVnWmJwrmRN+DSutqoUYooq1sukY43yz rAZkTmV1K32LlYbHqPkZOiLY4WmwTiTaGqqzH+0ytEpGdH0eDQc9edt48iq4GtlYBLyM n/UoqjxF9GApXBa662Hy+eOxRz0TSiMoh5GSg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=MYUUTrgSAjdY28dbyrXql8qMppvWHjmL+F4W3musMbA=; b=lQEPgFU82cY8tEbLT2HTCGe39wbXnxi9ZYrHv7JPVYXQDXuutedcXtOf48EfWLxLWA PwyKdbwGm/OneVT7xMYQZMXagVWnogzR/0rUN2e9VXkDRRiAPreZ/qxoJe9jUojKC7Iy a2lgdITQ09VEhYOao1QaIHBnIrXHSjhcLtsEkc7ogGJb5JQcXIqaFhxe4a9aVqpDxY22 CRTTIB2hz8iJ6+GeABUVtiQF2IMdLawMCCw6ejuGObxQXZCBYzdMRFj1QVTME9iApsWc zndYadGaoPDzsAeR46Sh9Ed0OUnmeib3XKVw9cK0dRGhECd53SLH89B3YeGcNuRHch8W 61Pg== X-Gm-Message-State: ALQs6tCnZuXI2UM5KmXZ9F3rHEGCiApbHrH/Krv4gQuMh8dN6WL3hdnP 5uPuEy+Pf8cJ48eXYRTMhmd8wGug6Pz9rTd2G/mk1Q== X-Received: by 2002:aca:3d82:: with SMTP id k124-v6mr2951347oia.168.1523448808921; Wed, 11 Apr 2018 05:13:28 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:7081:0:0:0:0:0 with HTTP; Wed, 11 Apr 2018 05:13:28 -0700 (PDT) In-Reply-To: <20180411093634.GC6014@localhost> References: <0c2b76aba6a49e583f920ae582d6815fa9cc4361.1523346135.git.baolin.wang@linaro.org> <20180411093634.GC6014@localhost> From: Baolin Wang Date: Wed, 11 Apr 2018 20:13:28 +0800 Message-ID: Subject: Re: [PATCH 4/5] dmaengine: sprd: Add Spreadtrum DMA configuration To: Vinod Koul Cc: Dan Williams , Eric Long , Mark Brown , dmaengine@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vinod, On 11 April 2018 at 17:36, Vinod Koul wrote: > On Tue, Apr 10, 2018 at 03:46:06PM +0800, Baolin Wang wrote: > >> +/* >> + * struct sprd_dma_config - DMA configuration structure >> + * @config: dma slave channel config >> + * @fragment_len: specify one fragment transfer length >> + * @block_len: specify one block transfer length >> + * @transcation_len: specify one transcation transfer length >> + * @wrap_ptr: wrap pointer address, once the transfer address reaches the >> + * 'wrap_ptr', the next transfer address will jump to the 'wrap_to' address. >> + * @wrap_to: wrap jump to address >> + * @req_mode: specify the DMA request mode >> + * @int_mode: specify the DMA interrupt type >> + */ >> +struct sprd_dma_config { >> + struct dma_slave_config config; >> + u32 fragment_len; > > why not use _maxburst? Yes, I can use maxburst. > >> + u32 block_len; >> + u32 transcation_len; > > what does block and transaction len refer to here Our DMA has 3 transfer mode: transaction transfer, block transfer and fragment transfer. One transaction transfer can contain several blocks transfer, and each block can be set proper block step. One block can contain several fragments transfer with proper fragment step. It can generate interrupts when one transaction transfer or block transfer or fragment transfer is completed if user set the interrupt type. So here we should set the length for transaction transfer, block transfer and fragment transfer. > >> + phys_addr_t wrap_ptr; >> + phys_addr_t wrap_to; > > this sound sg_list to me, why are we not using that here It is similar to sg list, but it is not one software action, we have hardware registers to help to jump one specified address. > >> + enum sprd_dma_req_mode req_mode; > > Looking at definition of request mode we have frag, block, transaction list > etc.. That should depend upon dma request. If you have been asked to > transfer a list, you shall configure list mode. if it is a single > transaction then it should be transaction mode! If I understand your points correctly, you mean we can specify the request mode when requesting one slave channel by 'dma_request_slave_channel()'. But we need change the request mode dynamically following different transfer task for this channel, so I am afraid we can not specify the request mode of this channel at requesting time. > >> + enum sprd_dma_int_type int_mode; > > Here again I think driver needs to take a call based on dma_ctrl_flags. The 'dma_ctrl_flags' defines DMA_PREP_INTERRUPT flag to indicate if a interrupt is needed after transfer, but it can not distinguish Spreadtrum special interrupt type of DMA. So can I pass the interrupt type as one parameter for 'device_prep_slave_sg' interface? Very appreciated for your useful comments. -- Baolin.wang Best Regards