From: Vinod Koul <vkoul@kernel.org> To: Peng Ma <peng.ma@nxp.com> Cc: dan.j.williams@intel.com, leoyang.li@nxp.com, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org Subject: [V3,1/2] dmaengine: fsl-dpaa2-qdma: Add the DPDMAI(Data Path DMA Interface) support Date: Fri, 26 Apr 2019 18:15:50 +0530 [thread overview] Message-ID: <20190426124550.GE28103@vkoul-mobl> (raw) 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!
WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vkoul@kernel.org> To: Peng Ma <peng.ma@nxp.com> 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 Date: Fri, 26 Apr 2019 18:15:50 +0530 [thread overview] Message-ID: <20190426124550.GE28103@vkoul-mobl> (raw) Message-ID: <20190426124550.w30GPk4Poc8EIGwj-1WkFTpz4LdwDdvlm6avaXL9qCw@z> (raw) In-Reply-To: <20190409072212.15860-1-peng.ma@nxp.com> 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
next prev reply other threads:[~2019-04-26 12:45 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-04-09 7:22 [V3,1/2] dmaengine: fsl-dpaa2-qdma: Add the DPDMAI(Data Path DMA Interface) support Peng Ma 2019-04-09 7:22 ` [V3 1/2] " Peng Ma 2019-04-09 7:22 ` [V3,2/2] dmaengine: fsl-dpaa2-qdma: Add NXP dpaa2 qDMA controller driver for Layerscape SoCs Peng Ma 2019-04-09 7:22 ` [V3 2/2] " Peng Ma 2019-04-29 5:32 ` [V3,2/2] " Vinod Koul 2019-04-29 5:32 ` [V3 2/2] " Vinod Koul 2019-06-10 9:51 ` [EXT] " Peng Ma 2019-06-13 11:03 ` Vinod Koul 2019-06-14 1:41 ` Peng Ma 2019-04-26 12:45 ` Vinod Koul [this message] 2019-04-26 12:45 ` [V3 1/2] dmaengine: fsl-dpaa2-qdma: Add the DPDMAI(Data Path DMA Interface) support Vinod Koul 2019-05-28 4:47 ` [EXT] " Peng Ma 2019-05-28 9:46 ` Joe Perches
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190426124550.GE28103@vkoul-mobl \ --to=vkoul@kernel.org \ --cc=dan.j.williams@intel.com \ --cc=dmaengine@vger.kernel.org \ --cc=leoyang.li@nxp.com \ --cc=linux-kernel@vger.kernel.org \ --cc=peng.ma@nxp.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).