Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4117233ybz; Tue, 28 Apr 2020 06:08:27 -0700 (PDT) X-Google-Smtp-Source: APiQypIqEn7e+0ulvhCqjizZa3+h+sVcwFIOIL/3L1KDtWZxC0T7czlhGPKdDR6V7IrZOgTLtb/2 X-Received: by 2002:a17:906:328c:: with SMTP id 12mr23149864ejw.69.1588079307096; Tue, 28 Apr 2020 06:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588079307; cv=none; d=google.com; s=arc-20160816; b=BKs//OVgNu/wej3L6Dxm7unSKTlNB4WK2yJ9xhzHCxHq0m5K8V9E0tecxB3EC1GKwd s4ddwisuTyNecduT+ZfHCLapobNbTLJMj7qJ/MzLqBbLp14nWT9+9JkLJ1EszAewbgVx 0v9ZQboQSv+ot2GDogo/IxOohQI4g58pGQWi/mV7Ga4qFvhJmGdkeM8PKnOaKVhXDRyN 1mDsCsD86Ad4B+RcIwtIKnsn7Ixvfkz08//lAgjYmBy/iRQWbFIotZoMZ8sr7Ik01tC/ guDVnBclNL0iKW4G0JVCPXzKHOR0R9B9Bh9vx63h/fTK+UuK0V4sSgp+CshrmHjUzgnd zp9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=iI7F45Z67BdWaq1WuP9dSd4j5WjFmc4dM4mZRj28Szw=; b=ixuR7tTzHDlAtXW2RxWazRWa+DqcO5HSJGu79B8AnfGNeyIuQDv5nupkFxC7c9KD1J UQisf16teJR9ytQOJvOmtKaep8BMH41E55RURSvDsDHNKzWO6XUZ6c2kqIJuRwPWELix 2ayl8iS1OYLZCtXlAAKiMY5bQM+0H/jnnaeNa+ZuSvGjDAEYmDxXtUYRMDQwWGjrz/W1 jYiNmJGwU3toKAoyNeX6zG02Bfi0NCnjoQK0H/nPmqcd6Au3DaI8u5cI5olyyoghyp22 oHZya51HoWQL0UJS39OusDi5SyCnxqaVBAIwBniX3D9ilVtMEQrRBcYSn2CFnd75RtyK berw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i14si1528446edx.256.2020.04.28.06.08.03; Tue, 28 Apr 2020 06:08:27 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726902AbgD1NG0 (ORCPT + 99 others); Tue, 28 Apr 2020 09:06:26 -0400 Received: from foss.arm.com ([217.140.110.172]:51134 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726746AbgD1NG0 (ORCPT ); Tue, 28 Apr 2020 09:06:26 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 145BA31B; Tue, 28 Apr 2020 06:06:25 -0700 (PDT) Received: from [10.57.33.170] (unknown [10.57.33.170]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 710363F68F; Tue, 28 Apr 2020 06:06:21 -0700 (PDT) Subject: Re: [PATCH v3 02/16] mfd: mfd-core: Don't overwrite the dma_mask of the child device To: Andy Shevchenko , Michael Walle Cc: 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 , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , Wim Van Sebroeck , Shawn Guo , Li Yang , Thomas Gleixner , Jason Cooper , Marc Zyngier , Mark Brown , Greg Kroah-Hartman References: <20200423174543.17161-1-michael@walle.cc> <20200423174543.17161-3-michael@walle.cc> <20200428124548.GS185537@smile.fi.intel.com> From: Robin Murphy Message-ID: <3cd3705a-4f48-6a46-e869-3ee11dc17323@arm.com> Date: Tue, 28 Apr 2020 14:06:20 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200428124548.GS185537@smile.fi.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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 :( Robin.