Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4208854ybz; Tue, 28 Apr 2020 07:31:39 -0700 (PDT) X-Google-Smtp-Source: APiQypIPtLq1wNluNh4V3uYjAs5Ag4IzHRBjyXy5uzFX8RTR6YZeagtXkUFnCeMLAazpZZ8qTJtJ X-Received: by 2002:a17:906:a2d3:: with SMTP id by19mr25262817ejb.370.1588084299672; Tue, 28 Apr 2020 07:31:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588084299; cv=none; d=google.com; s=arc-20160816; b=zmyMCrjKG8mUJaN/KHxjbIGmST1BU6ziYC3Qa/5LDzSGM2glTlLdjWdklr7+qM4rBr w1J8EzpDmG2PVTqYT4oJhxPLiSBrUZBNaOpOIoKltkjZqMh+3jQ7C6xM2Toi902hzF+z xY+4wA8YyzJSug9WDBgDvL3LNFGbV4Xz7Sao/gJJDaxkR88jnBZ5vvsrEfn+UHCgpQul lgoxowo0g6or5aWcZDGN9rkTlYoGsHDGDvlFmzKF6ElPtBizZjjKM38wO3fVIa8Qxsfy JCA+j/lE8O8aVwX8ok7BUSh+/OI5YnjpTc2YosX3joq1AhtVyoKC14IgfnXb5ks8SJjj grTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=tThNgNOEDkCv940uKyerOE1sUbA/prNylPtwfxwKmzE=; b=Fo68X/kE20WAszGNWcWcGvKj43Rj+YUid0ZeLLfR1FZIzWnjSH6aEwSh1T8pbuKYWL yOakEjX+mYgs15F2QXhv4xDyF/IlQDZ8uOZgsbD5iexeWCvdpelH4VkHrPzg0Q+Zq3i6 Q9zbBzeklPmy6fh3zG+j+EfN5LVs57UmbIzEDRZ4INzGU7il4iBdz4Wc3BFKQBasSlOX D6OMU4vQilmUvpuOwNyDIZTG6G+GS0wBBEcH8OP9iHfOxdJo8NJkALqr93U7cKtewCip xqCGPxSTN+NG1LEWjFWuEqCeI2EHNGJCyIp8/rURkP6zL5KbBDa5Sgq5YieSXryjLTYf DTwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p8si1944275ejz.441.2020.04.28.07.31.14; Tue, 28 Apr 2020 07:31:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728008AbgD1O3n (ORCPT + 99 others); Tue, 28 Apr 2020 10:29:43 -0400 Received: from mga06.intel.com ([134.134.136.31]:4285 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727108AbgD1O3n (ORCPT ); Tue, 28 Apr 2020 10:29:43 -0400 IronPort-SDR: kOZrIelPDgOUC3aJDJW9H80ah7VC/S2GDIWbHQz354UeEUlk3/wUSs6TRvijBEJrgEMrqAkN+V kbTVQZESG98A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2020 07:29:42 -0700 IronPort-SDR: vGnHmY/BqlTIl3FGa5R64rDdkwKbnMHUnpT0wYGLkHb05hlF7l+pQ52NbGLIPzbFCXoyvBDAUH qkiQUfkvunvw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,328,1583222400"; d="scan'208";a="432201423" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga005.jf.intel.com with ESMTP; 28 Apr 2020 07:29:36 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jTREw-003ZVU-6Y; Tue, 28 Apr 2020 17:29:38 +0300 Date: Tue, 28 Apr 2020 17:29:38 +0300 From: Andy Shevchenko To: Robin Murphy Cc: Michael Walle , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-pwm@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linus Walleij , Bartosz Golaszewski , Rob Herring , Jean Delvare , Guenter Roeck , Lee Jones , Thierry Reding , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Wim Van Sebroeck , Shawn Guo , Li Yang , Thomas Gleixner , Jason Cooper , Marc Zyngier , Mark Brown , Greg Kroah-Hartman Subject: Re: [PATCH v3 02/16] mfd: mfd-core: Don't overwrite the dma_mask of the child device Message-ID: <20200428142938.GX185537@smile.fi.intel.com> References: <20200423174543.17161-1-michael@walle.cc> <20200423174543.17161-3-michael@walle.cc> <20200428124548.GS185537@smile.fi.intel.com> <3cd3705a-4f48-6a46-e869-3ee11dc17323@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3cd3705a-4f48-6a46-e869-3ee11dc17323@arm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 28, 2020 at 02:06:20PM +0100, Robin Murphy wrote: > On 2020-04-28 1:45 pm, Andy Shevchenko wrote: > > On Thu, Apr 23, 2020 at 07:45:29PM +0200, Michael Walle wrote: > > > Commit cdfee5623290 ("driver core: initialize a default DMA mask for > > > platform device") initialize the DMA of a platform device. But if the > > > parent doesn't have a dma_mask set, for example if it's an I2C device, > > > the dma_mask of the child platform device will be set to zero again. > > > Which leads to many "DMA mask not set" warnings, if the MFD cell has the > > > of_compatible property set. > > > > I'm wondering why parent doesn't have it. > > Because the parent isn't on a DMA-capable bus, and thus really shouldn't > have a valid DMA configuration ever. Then how come a child is DMA capable? MFD takes a physical device node as a parent and creates one of several children with that device as a parent. DMA mask is a property of the device which *does DMA*. Obviously a child is not correct device for that. Where am I mistaken? > > I remember we have explicit patches in the past for buses such as PCI and AMBA > > to set default DMA mask for all physical devices on the respective bus, of > > course they can individually override it later. > > > > So, this seems to me a paper over the real issue (absence of default DMA mask > > where it's needed) and devices should explicitly define it if they disagree > > with default. > > > > If I'm wrong, you really need elaborate commit message much better. > > The problem here is that MFD children are created as platform devices > (regardless of what their parent is) and assigned an of_node, at which point > they look pretty much indistinguishable from SoC devices created by the > of_platform code, that *do* have to be assumed to be DMA-capable to prevent > ~90% of existing devicetrees from breaking. > > Of course the real fundamental issue is the platform bus itself, but it's > way too late to fix that :( I don't think it's an issue, rather in model you are describing. Or I miss something not so obvious. -- With Best Regards, Andy Shevchenko