Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp361626ybt; Wed, 24 Jun 2020 00:49:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoJhGrgcK4dHCc+HqRqNlkbt/u3PnPhPeclF6uLcNn4Hl45YZxpK0QAXZ5Zxd9bki8Mo7j X-Received: by 2002:a17:906:12cd:: with SMTP id l13mr2861801ejb.96.1592984943935; Wed, 24 Jun 2020 00:49:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592984943; cv=none; d=google.com; s=arc-20160816; b=qfN4QD/2voUuwLlR6M2z1GyfKGjANJPDo19EitHEAIvC3kQjDFycpKksNxchhBHbfv 4CPkxPY5VQ/o+jZ+C2XAAMz6/EOUuEVENIFddd/qk8ooiLuExJWtYHSJuhgl4zaC2h+o ZsiZ+4o7k+e0ESx0fW95QonrIRWEsZHv+gvPbQGIP7lwFvHhY7eNzk3o7muEHFqjUIjT kpNjo2awWO9a2xTUc1RuHjnqYc/Wy35XG5z3VjVmWSrx81epWNsR4u2CsNf8DPWRCP3z yHqlPn9c0NPAiCKBgQImyHHnfkCJ3FXi0bjER4DVJ7/Njk05HcSlzmsUeBboB2Jo/51b niNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=2hYUAFhvzMgCCSNiWjkpdtB/bWo87aFoIZZzVYlQ/9w=; b=NAUFiVZIIX1LUxnYIXW5YL+i6bKlrtAo/VndaUX15Ar4r+6NVMzvHI+jQjtYvmPsJV syNJ5fPLdoqbiGNcmmwoiePXwhBah+oV53Kff/PKoB0nZk5nxO01vkd2BeyecOKS4eVV qnHfJ+J9M3y+pvZLYxa6aUjxfTDj0QKsdnY2mOq2196VivRM48CZ8X5Y8aMU0gnH/anG MjfhvzDk6sTbihFOSemrjP1qc7aesY1jqjLiEQIUFPcR8S1DpzhVpLcMivfUr8v1kc27 vKPjNHrBfNvP4fnDma+wCMQXLYPKf9JgwkVROSZ+dkRr4yCvmKe2w/ANhHEMIRvahWoH qdUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=YiPY5C5+; 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 du6si15529578ejc.189.2020.06.24.00.48.40; Wed, 24 Jun 2020 00:49:03 -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; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=YiPY5C5+; 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 S2389959AbgFXHrd (ORCPT + 99 others); Wed, 24 Jun 2020 03:47:33 -0400 Received: from ssl.serverraum.org ([176.9.125.105]:35161 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387725AbgFXHrd (ORCPT ); Wed, 24 Jun 2020 03:47:33 -0400 Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id AA52E23078; Wed, 24 Jun 2020 09:47:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1592984846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2hYUAFhvzMgCCSNiWjkpdtB/bWo87aFoIZZzVYlQ/9w=; b=YiPY5C5+haPj3daChZY5rmJFBt0WrJulwOA2RX5uN/smSDchnArLSFfL6zGXIl3JYWUG08 yufzrfcgUFeFe+Mj1Dp0Q0kQJxUQ3kWFZgG1I2b1vkWlBkHxv2MpI1tHV5CO5wEogREtSR ABcWeM+hkAKVKl6No1WvUlvw4KVkvJw= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 24 Jun 2020 09:47:20 +0200 From: Michael Walle To: Lee Jones Cc: Frank Rowand , andy.shevchenko@gmail.com, robh+dt@kernel.org, broonie@kernel.org, devicetree@vger.kernel.org, linus.walleij@linaro.org, linux@roeck-us.net, andriy.shevchenko@linux.intel.com, robin.murphy@arm.com, gregkh@linuxfoundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] mfd: core: Make a best effort attempt to match devices with the correct of_nodes In-Reply-To: <20200624064145.GC954398@dell> References: <20200611191002.2256570-1-lee.jones@linaro.org> <30f03734-61fd-1b6b-bf11-21b6423a7c50@gmail.com> <20200624064145.GC954398@dell> User-Agent: Roundcube Webmail/1.4.5 Message-ID: <7a31b34940984b3f0921ed2d4fb29a58@walle.cc> X-Sender: michael@walle.cc Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Am 2020-06-24 08:41, schrieb Lee Jones: > On Tue, 23 Jun 2020, Frank Rowand wrote: > >> On 2020-06-11 14:10, Lee Jones wrote: >> > Currently, when a child platform device (sometimes referred to as a >> > sub-device) is registered via the Multi-Functional Device (MFD) API, >> > the framework attempts to match the newly registered platform device >> > with its associated Device Tree (OF) node. Until now, the device has >> > been allocated the first node found with an identical OF compatible >> > string. Unfortunately, if there are, say for example '3' devices >> > which are to be handled by the same driver and therefore have the same >> > compatible string, each of them will be allocated a pointer to the >> > *first* node. >> >> As you mentioned elsewhere in this thread, this series "fixes" the >> problem related to the "stericsson,ab8500-pwm" compatible. >> >> I know, I said I would drop discussion of that compatible, but bear >> with me for a second. :-) >> >> The "problem" is that the devices for multiple mfd child nodes with >> the same compatible value of "stericsson,ab8500-pwm" will all have >> a pointer to the first child node. At the moment the same child >> of_node being used by more than one device does not cause any >> incorrect behavior. >> >> Just in case the driver for "stericsson,ab8500-pwm" is modified >> in a way that the child of_node needs to be distinct for each >> device, and that changes gets back ported, it would be useful >> to have Fixes: tags for this patch series. >> >> So, at your discretion (and I'll let you worry about the correct >> Fixes: tag format), this series fixes: >> >> bad76991d7847b7877ae797cc79745d82ffd9120 mfd: Register ab8500 devices >> using the newly DT:ed MFD API > > This patch isn't actually broken. > > The issue is the DTB, which [0] addresses. > > [0] > https://lkml.kernel.org/lkml/20200622083432.1491715-1-lee.jones@linaro.org/ Now, I'm confused; because this patch doesn't use the reg property but a different node name. I'd actually prefer this for any MFD driver which has multiple nodes of the same compatible string. See my reasoning here [1]. But until now, no one has responded. Thus, I'd rather see a OF_MFD_CELL_NAME() which matches the node name instead of the OF_MFD_CELL_REG() macro. This would also circumvent the fact that the unit-address has one number space. Eg. it is not possible to have: mfd { compatible = "mfd,compatible"; gpio@0 { reg = <0>; }; gpio@1 { reg = <1>; }; pwm@0 { reg = <0>; }; }; Although Rob mentioned to maybe relax that, but I sill fail to see the advantage to have an arbitrary reg property instead of a unique node name. [1] https://lore.kernel.org/linux-devicetree/0709f20bc61afb6656bc57312eb69f56@walle.cc/ -- -michael