Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp600974yba; Fri, 26 Apr 2019 05:47:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzG9/W83tw0MFWzbaxljd6a8v5Tgkt0EI1dN3Q9DWcNX0Ddb7JQVzexND+a08ZLPOcGoGm3 X-Received: by 2002:a17:902:6949:: with SMTP id k9mr44859151plt.59.1556282859457; Fri, 26 Apr 2019 05:47:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556282859; cv=none; d=google.com; s=arc-20160816; b=HWSf8mZ1S6gABllTbWRBS8LlmAwOlpggIQn5P/op1X3FFbD+nwG485RDBwJ/KOhhu4 fbBrFjO1XYnyjJnl65qO9oy5hp3e8LjlQsfmeUIorcFM9Iah92X5PoyI4utplNyoTL9r 4sUzEWN6w72ukM9y7bhbLE5mu5vBQRUOOC5NVVwY+NXKxI5OWlx3gdVlUcU3gfIBzkXq iL5/aPybUNDgzcQ+E5kal+vYkbAuMnFaTpBq2NZZlarPHaMMIjD8hcG7TYsMdrd3wphE ZGQiNhbzyJoLMLSGbXFb7IEJDZPgeyiHBXCOxhuekKOHq9JVN1mRI/a+W+LF7k1CMwKl wYmQ== 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=RMhGv+ylEyFPklIWUgM75zqtoc6UXhemM20q5yzmoBI=; b=zp/UMZe5gSIM+dNgx4SPGE0/d6bnL0161S4MRM4M57bOmMS4vW7YNUV6hyTa5LCrfh uZiPr71zviXW7/MiCLDcvahlUZWgPVTRw7kp4/k1CceZllrz26HLsS6B7RyV837KlkXR p7DthezoetIKefZW3ga87ok2y+a5TBQsAOq8706cDaHFm2UXfmaWhmjxd/zuKLlHV44S a2unvcSLuExasyCW+zP7aD7jr6VxoN1yTwRiUolIFY/hdifvT9Cy2iMxz1xZp4RhN1Vp EPIqnQr2BgOavmTZpybz81UtzCLnzFcv9nrnGO+WE9vIdZAXyWDZMS5F/fzlzM6MBU+3 FGsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=N4+MwCuK; 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 f92si14866357plf.124.2019.04.26.05.47.23; Fri, 26 Apr 2019 05:47:39 -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=N4+MwCuK; 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 S1726271AbfDZMqA (ORCPT + 99 others); Fri, 26 Apr 2019 08:46:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:39540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbfDZMp5 (ORCPT ); Fri, 26 Apr 2019 08:45:57 -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 06A72206C1; Fri, 26 Apr 2019 12:45:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556282757; bh=ydMoE2lxrI6T7Lp8FQ7vaxTOP0crHdPE0/Pvavc1xig=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N4+MwCuKZi80NxAWVk7chnP02NuwecayAFdiOG7mb/zXxfop5+166celMECSOYOBE GTJakMg3B9ezWhFmK6b+nWmluePQufQg7Apmj+H+rXOKEjbZs4cRIJ8jB3RvCFHIxO 7vb+jOeDOiidDRYiCUF7ox3Obh1iw4XbHpre8s14= Date: Fri, 26 Apr 2019 18:15:50 +0530 From: Vinod Koul To: Peng Ma Cc: dan.j.williams@intel.com, leoyang.li@nxp.com, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org Subject: Re: [V3 1/2] dmaengine: fsl-dpaa2-qdma: Add the DPDMAI(Data Path DMA Interface) support Message-ID: <20190426124550.GE28103@vkoul-mobl> References: <20190409072212.15860-1-peng.ma@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190409072212.15860-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 09-04-19, 15:22, Peng Ma wrote: Subject missed PATCH tag! > The MC exports the DPDMAI object as an interface to operate the DPAA2 QDMA whats MC, DPDMAI, DPAA2 > Engine. The DPDMAI enables sending frame-based requests to QDMA and receiving > back confirmation response on transaction completion, utilizing the DPAA2 QBMan > infrastructure. DPDMAI object provides up to two priorities for processing QDMA > requests. > +int dpdmai_open(struct fsl_mc_io *mc_io, > + u32 cmd_flags, > + int dpdmai_id, > + u16 *token) could be written as: int dpdmai_open(struct fsl_mc_io *mc_io, u32 cmd_flags, int dpdmai_id, u16 *token) Looks neater, right? It would be to reread coding guidelines and run checkpatch with --strict on this > +{ > + struct fsl_mc_command cmd = { 0 }; where is this defined? > + struct dpdmai_cmd_open *cmd_params; > + int err; > + > + /* prepare command */ > + cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_OPEN, > + cmd_flags, > + 0); > + > + cmd_params = (struct dpdmai_cmd_open *)cmd.params; I dont like casts, can you explain > + cmd_params->dpdmai_id = cpu_to_le32(dpdmai_id); > + > + /* send command to mc*/ > + err = mc_send_command(mc_io, &cmd); > + if (err) > + return err; > + > + /* retrieve response parameters */ > + *token = mc_cmd_hdr_read_token(&cmd); > + return 0; > +} who will call this API? > +int dpdmai_create(struct fsl_mc_io *mc_io, > + u32 cmd_flags, > + const struct dpdmai_cfg *cfg, > + u16 *token) > +{ > + struct fsl_mc_command cmd = { 0 }; > + int err; > + > + /* prepare command */ > + cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_CREATE, > + cmd_flags, > + 0); why waste a line, last arg can be in previous line! > +int dpdmai_get_tx_queue(struct fsl_mc_io *mc_io, > + u32 cmd_flags, > + u16 token, > + u8 priority, > + struct dpdmai_tx_queue_attr *attr) > +{ > + struct fsl_mc_command cmd = { 0 }; > + struct dpdmai_cmd_queue *cmd_params; > + struct dpdmai_rsp_get_tx_queue *rsp_params; > + int err; > + > + /* prepare command */ > + cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_GET_TX_QUEUE, > + cmd_flags, > + token); > + > + cmd_params = (struct dpdmai_cmd_queue *)cmd.params; > + cmd_params->queue = priority; > + > + /* send command to mc*/ > + err = mc_send_command(mc_io, &cmd); > + if (err) > + return err; > + > + /* retrieve response parameters */ > + > + rsp_params = (struct dpdmai_rsp_get_tx_queue *)cmd.params; > + attr->fqid = le32_to_cpu(rsp_params->fqid); > + > + return 0; > +} Okay this file does not use any of dmaengine apis, is this a dmaengine driver? > diff --git a/drivers/dma/fsl-dpaa2-qdma/dpdmai.h b/drivers/dma/fsl-dpaa2-qdma/dpdmai.h > new file mode 100644 > index 0000000..c8a7b7f > --- /dev/null > +++ b/drivers/dma/fsl-dpaa2-qdma/dpdmai.h > @@ -0,0 +1,524 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* Copyright 2014-2018 NXP */ > + > +/* > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions are met: > + * * Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * * Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * * Neither the name of the above-listed copyright holders nor the > + * names of any contributors may be used to endorse or promote products > + * derived from this software without specific prior written permission. > + * > + * > + * ALTERNATIVELY, this software may be distributed under the terms of the > + * GNU General Public License ("GPL") as published by the Free Software > + * Foundation, either version 2 of that License or (at your option) any > + * later version. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" > + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE > + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > + * POSSIBILITY OF SUCH DAMAGE. > + */ we have SiPDX tag, why do you need ths here! -- ~Vinod