Received: by 10.223.176.5 with SMTP id f5csp707920wra; Sat, 27 Jan 2018 08:15:45 -0800 (PST) X-Google-Smtp-Source: AH8x225tTB9b49PGqx4WcqfvRXlQhGOAaxZUTV9R+YBAF4ceOgBkvU3aVDo0R+rZe1xWL2EkKmrf X-Received: by 10.99.112.70 with SMTP id a6mr17707131pgn.152.1517069745785; Sat, 27 Jan 2018 08:15:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517069745; cv=none; d=google.com; s=arc-20160816; b=U14qZebv4NYTCVqy0RE76s5HCY4AWd2IbZ+jgnOJFjTTgDmBbzBCDKmcNa/bqjlVnD GsDGFuyySjW988LQBtLFDguh8f/XmFuucQcs2bVl3nlE1UDF21dE8YPpsMqrsLQ2gD4D /Ceud8ZuECw89zjYX1G7GwBl0m9iuT/6+Fq9VnLPkKQZi3Dx40UPEeX6JZxvCgbpcMOY eBg5v2NJ120v2fvcO5QY6nRsBSH0W7QeX4gIWcnpEjICPYm/t27PiOVyadkUAOf0Yz3/ vn4n1aYA2AkctQhVR9GzP9aHy5WVy2Ij0+v4cE6jUjsEb3g9KVhZHUit3ibeoc44svoM 4VKg== 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=kWQRGZO35zIBNE9uuQ77XZFVyuIORmBgB1ZFc/FpDso=; b=DlJJNUHel63M16hfJzDARoJHkGcXEtid3VDZpQu52lF5mih5wuJuxuv1PYEWBfDZNH hpSgujlr+s8Ek8B5umFXijLIhUPQuTq5/NKRFbnLcB0fBQPCPSwoMx5Se3spHJ+Ae6rZ WRBQuB4MB2blpj0KTC0/37mg6Sp3/vcDEOLfblfZgizF7U+4t4dxfUN3wTNyvcT44h8g JXM397wQU5WZpb95xzcJMvyNbg+0kuDQVbYwqC+abvUz0fOBHFADuHThAY85aEUe9pPV H5eLIHyY9qKtSqHor5116zTA7pGk11VXW9R8a9rDLPcv2Guqq6sz7X4ChjCl7Tbn/vvR Fw5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S/3CcfLe; 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 h1-v6si5542445pln.138.2018.01.27.08.15.31; Sat, 27 Jan 2018 08:15:45 -0800 (PST) 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=S/3CcfLe; 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 S1753174AbeA0QOa (ORCPT + 99 others); Sat, 27 Jan 2018 11:14:30 -0500 Received: from mail-io0-f193.google.com ([209.85.223.193]:43278 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752690AbeA0QO1 (ORCPT ); Sat, 27 Jan 2018 11:14:27 -0500 Received: by mail-io0-f193.google.com with SMTP id 72so3395771iom.10 for ; Sat, 27 Jan 2018 08:14:27 -0800 (PST) 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=kWQRGZO35zIBNE9uuQ77XZFVyuIORmBgB1ZFc/FpDso=; b=S/3CcfLeQZq+aEAQZoD46Skl08QQ0fmTCx9QlHh2ahxUF9ptiqMZaiPRt64gTKU0w8 /EnjHF04jpKbqe5lYv5CJFm2EIcRU9wocl4oHhPsTTRmptx9/P7LCq6oAZr7T6UYyAwy 16HGdz/0+zu4S9fhKoWL4xsOw8HIxQ8Dbzj8U= 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=kWQRGZO35zIBNE9uuQ77XZFVyuIORmBgB1ZFc/FpDso=; b=hgdKC/H0Pd9xX8TzSPu6dxX1bN6OasYc5NEbacUmViWnKmpgihiPWiMUL4lGQDRnk0 19XGyMGfwYBE3xX/3IFq8d+AjCxOYHawM/Yjtfqu/GpYawN06y8O96dJ+BfzH4QCp5iy HXMywxdtv9tOdb5odxOo8AwWPiHlNvoU9d6vs5qLrQXNI7NNJ/KCYMHmo2Ck/3CGLfFK xDxkWo0Y3AnUkFVWFIDp6AehjYCKZylm26J/iqscZ2GkpOcDOxWIDwdjxozo5ezfRWFV cz3AKfqaAyMR8RxL89tpt0NrwQR3pdhX8AK1AEiBVYcl7unOQEWBzouS6Mg8ACxzL0Py K0Rw== X-Gm-Message-State: AKwxytdTj7rmFIx3aL4sa4pf6pse+aJ2p35G7pj0SFkbln8zZZvYZtIV HTk8kT8p3oTTxgnjao9asVDOHmU9XnZGDLMyiaX0yA== X-Received: by 10.107.104.17 with SMTP id d17mr12225321ioc.138.1517069667035; Sat, 27 Jan 2018 08:14:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.102.131 with HTTP; Sat, 27 Jan 2018 08:14:26 -0800 (PST) In-Reply-To: <1516695531-23349-1-git-send-email-yong.deng@magewell.com> References: <1516695531-23349-1-git-send-email-yong.deng@magewell.com> From: Linus Walleij Date: Sat, 27 Jan 2018 17:14:26 +0100 Message-ID: Subject: Re: [PATCH v6 2/2] media: V3s: Add support for Allwinner CSI. To: Yong Deng Cc: Maxime Ripard , Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Chen-Yu Tsai , "David S. Miller" , Greg Kroah-Hartman , Hans Verkuil , Randy Dunlap , Stanimir Varbanov , Hugues Fruchet , Yannick Fertre , Philipp Zabel , Arnd Bergmann , Benjamin Gaignard , Ramesh Shanmugasundaram , Sakari Ailus , Rick Chang , linux-media@vger.kernel.org, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux ARM , "linux-kernel@vger.kernel.org" , linux-sunxi , megous@megous.com 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 On Tue, Jan 23, 2018 at 9:18 AM, Yong Deng wrote: > Allwinner V3s SoC features two CSI module. CSI0 is used for MIPI CSI-2 > interface and CSI1 is used for parallel interface. This is not > documented in datasheet but by test and guess. > > This patch implement a v4l2 framework driver for it. > > Currently, the driver only support the parallel interface. MIPI-CSI2, > ISP's support are not included in this patch. > > Tested-by: Maxime Ripard > Signed-off-by: Yong Deng This is cool stuff :) > +void sun6i_csi_update_buf_addr(struct sun6i_csi *csi, dma_addr_t addr) > +{ > + struct sun6i_csi_dev *sdev = sun6i_csi_to_dev(csi); > + /* transform physical address to bus address */ > + dma_addr_t bus_addr = addr - PHYS_OFFSET; I am sorry if this is an unjustified drive-by comment. Maybe you have already investigate other ways to do this. Accessing PHYS_OFFSET directly seems unintuitive and not good practice. But normally an dma_addr_t only comes from some function inside such as: dma_alloc_coherent() for a contigous buffer which is coherent in physical memory, or from some buffer <= 64KB that is switching ownership between device and CPU explicitly with dma_map* or so. Did you check with Documentation/DMA-API.txt? Yours, Linus Walleij