Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1523109ybt; Mon, 15 Jun 2020 02:29:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznFZ6kuwsEe/duAP7RilN0WBqB6FBg7pRTBcWKzNHtty0EepUBeqanFSdkX0/Gr5VlJXJ5 X-Received: by 2002:a17:906:470a:: with SMTP id y10mr25964229ejq.535.1592213369479; Mon, 15 Jun 2020 02:29:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592213369; cv=none; d=google.com; s=arc-20160816; b=WVnb3QgCuqPvb4k9Y+t7xfArk3uDFnVzVA8MOemPMEdbLj+SeGDfNFMvp7Ouwj5dP/ +69veNsMn6yqS58wUIFa4gSJPujShbskNHqMRNO4GYh75dyUe4epkYGWwWPViZ1PPZcm 06yWEWIfugD+a2VWp5rY9EyG4E4i1DMVXR3wiP1VKbPRbSsCCj5hmMERzlmX5061f4Qu ljzFidGgtXzuT6OQu39bCAbobY7wbrfVf42oDB5ovhlYnQOZG8TgL8Vf0uCr5KPn83bh O9N6G32aYMXMo+bYWYK7QMnvzGit2+0EONkNeDoQQ0M3zZSxRFhR599Nz/VwiJEnUaRZ 8J0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Rzxkol7w2QC50xcBFexG/soZ0rzW0UYaIlHrmwy/Vl4=; b=V0t165fDsMAUa+94Fc2QtJ8nOCgCMoT3K3HdL0B36nmW4edxVeqOA61CXZEX+JP296 x5yJCv49pOc3oT2uSaMbqvBzWG5ankwU9asG+tRCRbVQtkn3Y664CFu0zUP/b0yXIvX7 U8cyosx9PLOZXk8smwAcdfvcdCBxFk90ibch586RkVeWCqBhW3aGniSa/udr+yvYwren JrbKgF5fYxAPzZC2zy5zxlIJwDpFh1ZGYOVsbcI8eoiKY77Pb39lxXVhgxrxoVGJtmA3 znui0FtdFKVPt/DqI8yc2H238WagJzJCGSQLdmJhMq/aZcSAWrhrbGmSXMwwgyVC2A0M aw5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lc/0UVSx"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oy15si8923761ejb.538.2020.06.15.02.29.07; Mon, 15 Jun 2020 02:29:29 -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=@linaro.org header.s=google header.b="lc/0UVSx"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729097AbgFOJ0u (ORCPT + 99 others); Mon, 15 Jun 2020 05:26:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728815AbgFOJ0u (ORCPT ); Mon, 15 Jun 2020 05:26:50 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 973E4C061A0E for ; Mon, 15 Jun 2020 02:26:48 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id g10so13864933wmh.4 for ; Mon, 15 Jun 2020 02:26:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=Rzxkol7w2QC50xcBFexG/soZ0rzW0UYaIlHrmwy/Vl4=; b=lc/0UVSxPinnkjDB/lFuqYGDeDU3GTO/xQpG14bzThYrcAzSIf4rcgTtABwesYQmpk ZeZ393630Ant4rb6ydPcR037Ny5WHbHzrVRrSUjC8OiOndguT3fbjALpGxY3uIqF4+xy G1ROVao91s3C13/YISlmmLI8VYZXLxC0P3FVJrVvPi1id7KFd427AluMHr3mqBvePJIN rfDMCdtRR2HgrtpQf9WGtvgaJlsedSjanZYR5rOamASSWWy2HcJX7fjYPARmrc4cCR3h sEOAwa/hDp/2yGmDo3eYiDgB4+0KR5/c7ELTwXQoUcAOApfqXqz7IZP19e5bpylQpseK rSeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=Rzxkol7w2QC50xcBFexG/soZ0rzW0UYaIlHrmwy/Vl4=; b=CJAIyCMrtO2Axw35/DAIFj1uyPkk5g7u/9v9e+QdwP6LGadhG6q2AT/LQNS6PdCp9E DI6e1030VpA80RbW1GIyTl0lyk1vjZdnHKfDLfuMMfVTBtZHjkmZPJ7+fv0R+3x69FCe MEHWWfRfRJUI/YlXZslCgoeqk2j7eJjDq3CDWSELdjY9bOWGEChK9KHJZSGpoVuTtzkR /Ceda0M452qKtvMD2/8UyMXGjKUIVIEipR3Ljl37hSkeoYNb415BgOOcnFBkq68pxK+P QZfwnVh0FKZoEthw3cEgmbyc9zse2A+a5PCq7Vv/khD/lEMDuBsLrWGYS6h8hnh2osSH 3J2A== X-Gm-Message-State: AOAM5332zvO6CRifxXRIrKC+kYKvgNgm/TclArymTZe4RQZVaBPIKwZY oeBFpq9P9PZgpqP+DqYZqc0i9Q== X-Received: by 2002:a1c:790a:: with SMTP id l10mr11470065wme.80.1592213207106; Mon, 15 Jun 2020 02:26:47 -0700 (PDT) Received: from dell ([2.27.167.101]) by smtp.gmail.com with ESMTPSA id k21sm24685707wrd.24.2020.06.15.02.26.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 02:26:46 -0700 (PDT) Date: Mon, 15 Jun 2020 10:26:44 +0100 From: Lee Jones To: Frank Rowand Cc: andy.shevchenko@gmail.com, michael@walle.cc, 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 Message-ID: <20200615092644.GA2608702@dell> References: <20200611191002.2256570-1-lee.jones@linaro.org> <4b188fb5-6667-720d-46e1-6f103efe8966@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4b188fb5-6667-720d-46e1-6f103efe8966@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 14 Jun 2020, Frank Rowand wrote: > Hi Lee, > > I'm looking at 5.8-rc1. > > The only use of OF_MFD_CELL() where the same compatible is specified > for multiple elements of a struct mfd_cell array is for compatible > "stericsson,ab8500-pwm" in drivers/mfd/ab8500-core.c: > > OF_MFD_CELL("ab8500-pwm", > NULL, NULL, 0, 1, "stericsson,ab8500-pwm"), > OF_MFD_CELL("ab8500-pwm", > NULL, NULL, 0, 2, "stericsson,ab8500-pwm"), > OF_MFD_CELL("ab8500-pwm", > NULL, NULL, 0, 3, "stericsson,ab8500-pwm"), > > The only .dts or .dtsi files where I see compatible "stericsson,ab8500-pwm" > are: > > arch/arm/boot/dts/ste-ab8500.dtsi > arch/arm/boot/dts/ste-ab8505.dtsi > > These two .dtsi files only have a single node with this compatible. > Chasing back to .dts and .dtsi files that include these two .dtsi > files, I see no case where there are multiple nodes with this > compatible. > > So it looks to me like there is no .dts in mainline that is providing > the three "stericsson,ab8500-pwm" nodes that drivers/mfd/ab8500-core.c > is expecting. No case that there are multiple mfd child nodes where > mfd_add_device() would assign the first of n child nodes with the > same compatible to multiple devices. > > So it appears to me that drivers/mfd/ab8500-core.c is currently broken. > Am I missing something here? > > If I am correct, then either drivers/mfd/ab8500-core.c or > ste-ab8500.dtsi and ste-ab8505.dtsi need to be fixed. Your analysis is correct. Although it's not "broken", it just works when it really shouldn't. I will be fixing the 'ab8500-pwm' case in due course. > Moving forward, your proposed OF_MFD_CELL_REG() method seems a good > approach (I have not completely read the actual code in the patch yet > though). Thanks. -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog