Received: by 10.223.176.5 with SMTP id f5csp1007360wra; Tue, 30 Jan 2018 23:30:28 -0800 (PST) X-Google-Smtp-Source: AH8x226Rf7Mzru+nk26bTIZ7rqlmeKjrtAPY81GJ8V4ktnIABTynZIXw9xrJ+SL6VYnvJU+8t8R2 X-Received: by 2002:a17:902:e85:: with SMTP id 5-v6mr21863123plx.208.1517383827996; Tue, 30 Jan 2018 23:30:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517383827; cv=none; d=google.com; s=arc-20160816; b=cj2clrCS8dgDhzAjKwjxGPnXCwtWA7ojc4OO8Hyp8neo9XnqptmaWZa3MxEezLSwiq 1mfzVUwbl7sqlWVSVYSDZqM7viaiDgb+Dtpi90LCwaNeNxN6KmKiM1g3HpIF9Oo3u3Kr n9RzP4Cen5qkMPErXP8KgWebMYahyBVNm8lKQSe9f/nsrSp6iEUJhQJwDRg5dUOQ7ME5 3Sch3zU7VY73tyZFFxsP8BMcqMWorJBSQRXRJXtwZdpDACT4bEd3uiFCdrsPPvdZKAvR 3TEyeR+6/lWYSpGlfWufOasthVjpt4w44clgPWQZt+qEj1a62iIBJd/KptwSUeeS7odM /Igw== 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:arc-authentication-results; bh=HYgrArfb4oxdgyXcn/Oxqjgt92mc8M1FcYR4Hsq8Alk=; b=R5GGy61xFM79sYd/tFhcBSjCR9G13QQcOigrzQo+V+CoDjg4LDy8Rksp7VINLbK2Fa D/iwoJuhuV1hkJIa6eCFRlQFVBdhrEPg5oa7HkOsrfGOxP/f596kEG50yIg8Hr/sxr1G XzWAX8HzhqJK/52Dk25RohG8lPtVoARsDQFET86Atjy3o3Hybp69ZZs+DAVOMLK0lEoy QMUWpHCZZIEukCPms5b4e7rO4I1wy3j3C/5NzF+epRPleX0jU0JLgoXS+DQAGr1lemzM zey8ZW8IOOMPT39J0x32Tmy6gbIWnJHDTx3uxHCrioTpBqjZOl1OXRDpt5MIlv83MgfU Q4+Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10-v6si8711929plm.539.2018.01.30.23.30.13; Tue, 30 Jan 2018 23:30:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752921AbeAaH3Z (ORCPT + 99 others); Wed, 31 Jan 2018 02:29:25 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:34919 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752877AbeAaH3W (ORCPT ); Wed, 31 Jan 2018 02:29:22 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id CB12C21A2A; Wed, 31 Jan 2018 08:29:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 8400421A29; Wed, 31 Jan 2018 08:29:10 +0100 (CET) Date: Wed, 31 Jan 2018 08:29:10 +0100 From: Maxime Ripard To: Thierry Reding Cc: Arnd Bergmann , Dave Martin , Linus Walleij , Yong Deng , 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 , Benjamin Gaignard , Ramesh Shanmugasundaram , Sakari Ailus , Rick Chang , Linux Media Mailing List , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux ARM , "linux-kernel@vger.kernel.org" , linux-sunxi , megous@megous.com, Thomas Petazzoni Subject: Re: [PATCH v6 2/2] media: V3s: Add support for Allwinner CSI. Message-ID: <20180131072910.ajp3jc5dmetsjtf2@flea.lan> References: <1516695531-23349-1-git-send-email-yong.deng@magewell.com> <20180129082533.6edmqgbauo6q5dgz@flea.lan> <20180130075441.rqxzkwero6sdfak6@flea.lan> <20180130095916.GA23047@ulmo> <20180130100150.GB23047@ulmo> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rfbwayh24geptepy" Content-Disposition: inline In-Reply-To: <20180130100150.GB23047@ulmo> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --rfbwayh24geptepy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Thierry, On Tue, Jan 30, 2018 at 11:01:50AM +0100, Thierry Reding wrote: > On Tue, Jan 30, 2018 at 10:59:16AM +0100, Thierry Reding wrote: > > On Tue, Jan 30, 2018 at 10:24:48AM +0100, Arnd Bergmann wrote: > > > On Tue, Jan 30, 2018 at 8:54 AM, Maxime Ripard > > > wrote: > > > > On Mon, Jan 29, 2018 at 03:34:02PM +0100, Arnd Bergmann wrote: > > > >> On Mon, Jan 29, 2018 at 10:25 AM, Linus Walleij > > > >> wrote: > > > >> > On Mon, Jan 29, 2018 at 9:25 AM, Maxime Ripard > > > >> > wrote: > > > >> >> On Sat, Jan 27, 2018 at 05:14:26PM +0100, Linus Walleij wrote: > > >=20 > > > >> > > > >> At one point we had discussed adding a 'dma-masters' property that > > > >> lists all the buses on which a device can be a dma master, and > > > >> the respective properties of those masters (iommu, coherency, > > > >> offset, ...). > > > >> > > > >> IIRC at the time we decided that we could live without that comple= xity, > > > >> but perhaps we cannot. > > > > > > > > Are you talking about this ? > > > > https://elixir.free-electrons.com/linux/latest/source/Documentation= /devicetree/bindings/dma/dma.txt#L41 > > > > > > > > It doesn't seem to be related to that issue to me. And in our > > > > particular cases, all the devices are DMA masters, the RAM is just > > > > mapped to another address. > > >=20 > > > No, that's not the one I was thinking of. The idea at the time was mu= ch > > > more generic, and not limited to dma engines. I don't recall the deta= ils, > > > but I think that Thierry was either involved or made the proposal at = the > > > time. > >=20 > > Yeah, I vaguely remember discussing something like this before. A quick > > search through my inbox yielded these two threads, mostly related to > > IOMMU but I think there were some mentions about dma-ranges and so on as > > well. I'll have to dig deeper into those threads to refresh my memories, > > but I won't get around to it until later today. > >=20 > > If someone wants to read up on this in the meantime, here are the links: > >=20 > > https://lkml.org/lkml/2014/4/27/346 > > http://lists.infradead.org/pipermail/linux-arm-kernel/2014-May/257200.= html > >=20 > > From a quick glance the issue of dma-ranges was something that we hand- > > waved at the time. >=20 > Also found this, which seems to be relevant as well: >=20 > http://lists.infradead.org/pipermail/linux-arm-kernel/2014-May/252715.ht= ml >=20 > Adding Dave. Thanks for the pointers, I started to read through it. I guess we have to come up with two solutions here: a short term one to address the users we already have in the kernel properly, and a long term one where we could use that discussion as a starting point. For the short term one, could we just set the device dma_pfn_offset to PHYS_OFFSET at probe time, and use our dma_addr_t directly later on, or would this also cause some issues? For the long term plan, from what I read from the discussion, it's mostly centered around IOMMU indeed, and we don't have that. What we would actually need is to break the assumption that the DMA "parent" bus is the DT node's parent bus. And I guess this could be done quite easily by adding a dma-parent property with a phandle to the bus controller, that would have a dma-ranges property of its own with the proper mapping described there. It should be simple enough to support, but is there anything that could prevent something like that to work properly (such as preventing further IOMMU-related developments that were described in those mail threads). Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --rfbwayh24geptepy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAlpxcEUACgkQ0rTAlCFN r3T2zA/9FwmqAFo8tTvTspqxcBsIgAlXJ+zZUt1DoML9YsalHWVymmP2NGBq/G/m sLlXKrm+o3q8ZpwKr6zUQASTHqtCKxVpdNOVXQxcjjCGbY+Ms7fNlqfsq/xXCHJI Z/0AR6SADbpRD0cZeP81JKm6w8r9LTcqMT0ENCiJwG6IjgGfXQPjsOY5jhzJjd0s FDRZCisLcY/HmxMJlcyPe8zpwJkt3B3WXhVz0s4H4rNhf5pwwMLHfEpsWahCV8kn xvQriKkvaCdGxYaAB2bhQLJWJJGzyrKo7EdiGkNMBeADwCIFwRNl5Zv37cFsEiTO 2pUWIipWRX5/bMB/foc0tnhQP51LNqhZKLgMHNhquy0tXkJnk55eEqzVqiSeZfpW m7dQDJzzhPUMJOOQwPJ9ZMF2O6C2mdCxLJsknm2qalJMQzLhWtAtXZqwRS2tLVmp UzyjFgoeXavdDfgr29cAONC6RxgBJvLa8ns/dMPa1MzSIKe4a7J2JqsP+yHgYHDn Xsxkj4s376J94TYCvlFAJhxpzEQKGfqTuBmn7xdIfneoyh8ShbJXxsF2TbvmIf7Q gTrsSK52oxt/wB4PQY2QrIZNcl57854NvydnNGPwbidsmdHBZvc+CKhl7O552FZA llMiD66QJ2BQu00vmP1VGZRh28G9gncnpJdRFuuO2UYJYahVjz0= =9BwO -----END PGP SIGNATURE----- --rfbwayh24geptepy--