Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7038199ybi; Thu, 13 Jun 2019 08:32:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyi/SFKQoGNbyWv6stKfUw+XFmnbhb8gJvNTa6ZR5I2UjXeOA03FmzcRNh7J73ZUkUP829y X-Received: by 2002:a17:90a:17cb:: with SMTP id q69mr6274469pja.8.1560439933129; Thu, 13 Jun 2019 08:32:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560439933; cv=none; d=google.com; s=arc-20160816; b=c1sUjrdD2gBYAzlmZxC2XnmPyLYQR2mZkhu4PW2pIJWI/7itRHtc7lSLbT2rQvFPRV 4Wek2LzDbp0VZJ2A71FnJjMHdUp2B0H5B180D9LbTrLAUpfldnMXpW3AyWS2pxF+hKxp Vw6C8Tn0+sfNxm24daBku+b645G3Ujae1rbCFZAfUw262gg5PvHwE/ZI5PnwfxlG1xqW k9Kjtet/5A6kUB6mFeadBvNMzAzUOjPwVdohkVWFQF8jvm3fs3i7K8WbEKVUoAKsyWgl BM8JwyyKuw+zCa83WnoZpQDRi69cIWGBD7580+vMIpDA4+2LNE00RwUc8TD3+R8HA2Yf D4BA== 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=bd0F5gglXgwIgRJIIX4ph7ujbRPZkOpse+DhXs30SIs=; b=kUTxZ0YtV6iXEaPp1cp38IuFtSIhgmB+vrJYjiJLRKORBTaPZlxMbas51RfgXJ+lYX FU90n1EHMMlOPy5Hho3I38DoHUMzOU+jF70PBafL8CjPpXgEUOYefhqDYLlUAMeCeyr1 uatqEMXNXfdxq0G3bWtUI7gd74ozJAJQ4k9ggXCJ8oKli5F5eFyZDmvhAh5DV9uQ114s WvlS7bDWvf8xebw0F4WJyeQmSG9SqeoUQNcCBNzCIIHvb/1dxZYy8+5eKnvpo9LTrogc UqZbu/Q2tkiDY6/9N4hdp7ZjVf9bSM58yumU7xMh5cI7EkUzEp0YBFSS3f7/fXPNYp+c XHOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kbIaeXp+; 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 u67si3619734pfu.154.2019.06.13.08.31.57; Thu, 13 Jun 2019 08:32:13 -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=kbIaeXp+; 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 S1727136AbfFMPa7 (ORCPT + 99 others); Thu, 13 Jun 2019 11:30:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:55520 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728641AbfFMLGe (ORCPT ); Thu, 13 Jun 2019 07:06:34 -0400 Received: from localhost (unknown [122.167.115.6]) (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 6B0A221721; Thu, 13 Jun 2019 11:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560423993; bh=XDQr+qoInVgE+aU3q1x+Me+5mPriKhlcp+T0v66tN24=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kbIaeXp+vdvXnTR8du/ADgav63Wt6IyfifVXvc+ctveMuww6Bv2hPf0Rujo7CQpef UpUNMStJma1uV7zaK0E723Fzrhay3rM0To+8T3uMKE43AHidiii+2Kg2CmGUqYtOEc TsleUH3XXu9p1eikRsOp7D+fYd7mruK71+g0so60= Date: Thu, 13 Jun 2019 16:33:25 +0530 From: Vinod Koul To: Peng Ma Cc: "dan.j.williams@intel.com" , Leo Li , "linux-kernel@vger.kernel.org" , "dmaengine@vger.kernel.org" Subject: Re: [EXT] Re: [V3 2/2] dmaengine: fsl-dpaa2-qdma: Add NXP dpaa2 qDMA controller driver for Layerscape SoCs Message-ID: <20190613110325.GD9160@vkoul-mobl.Dlink> References: <20190409072212.15860-1-peng.ma@nxp.com> <20190409072212.15860-2-peng.ma@nxp.com> <20190429053203.GF3845@vkoul-mobl.Dlink> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 10-06-19, 09:51, Peng Ma wrote: > >> + goto err; > >> + > >> + comp_temp->fl_virt_addr = > >> + (void *)((struct dpaa2_fd *) > >> + comp_temp->fd_virt_addr + 1); > > > >casts and pointer math, what could go wrong!! This doesnt smell right! > > > >> + comp_temp->fl_bus_addr = comp_temp->fd_bus_addr + > >> + sizeof(struct dpaa2_fd); > > > >why not use fl_virt_addr and get the bus_address? > What you mean is I should use virt_to_phys to get the bus_address? Yes instead of maintaining both pointers, just use one and then when required use one to get other. For bus address I would prefer dma_map_single rather than virt_to_phys() -- ~Vinod