Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1330374ybx; Thu, 7 Nov 2019 10:27:59 -0800 (PST) X-Google-Smtp-Source: APXvYqxFfyp1f3zxMcQSRA6EqbWdWMbtdibhP6yHRkGZlkyP5E0KlAEgbabv9DvpwrlWt8/3VHGe X-Received: by 2002:a50:e8c2:: with SMTP id l2mr5199553edn.78.1573151278932; Thu, 07 Nov 2019 10:27:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573151278; cv=none; d=google.com; s=arc-20160816; b=XZfhxScasXRIOkucWAIYD8GMo/lC5strM6KVmQWwOCpBitiDNO+hnUSXMvosH5OpRQ BYeWiPO/IWB0WrTsNabg025zEExEevwxbt07uJcclRSopvmRpdNlvq1ye9Dyi9wlVPel FbYOAS6PM/FaVxHXe5moO0F2qQvcpjBM2LHlOCnWGJ5kquHYVcL32KX/bvKwj3seQ3pm HC/aIwFRXUHLZDYiEF8REBYChzSkF9vtytT82laBEDJQLuQrGhHWGMoLdNq7DMlh/Wcf Pc4OsQpoSyn5Uek+DjP1wid8r42fpAL6RJa6BrDeDaXaClNgnpAYpfGVYDiAulrrab9z Gn1A== 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:dkim-signature; bh=Oqhe1WXoIbq8yVt8OzlAqvdDOM9RGB7JcT21P0FRSQk=; b=oG6VCqidXdGe8knqdL0mwSFRxMgdUeq8X5CxfZJwSDTGBTuCatq6P7cyoZVjhRhZqG AFNhWtxfx8m+D+zVjdYdzoBqE2xKoQfN1hwBxtMQi3rrtSG+6pbvsDSpTLDjN3Y4Kbc2 ltJ4PE1Ivh0jhPf4aYgx0YIkJ/JbAjnFirQXULA95rkAaFvv3N7cG8Zaw51k7FisZv39 sLq7uM63AvAgFzWcNFARLlhosdZ5LVLmLB2Lm4RBIBbI4hn9uhVoMuZ52ktceLCxG3KE 5N97pnIt1R/Mc8DxjazsW/32Iufh0luW0NGM3ez9NjCPfUgBKuVsGiMRRC0oQazbWnE1 rl/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gerhold.net header.s=strato-dkim-0002 header.b=Qpcx2anj; 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 y56si2113715edd.275.2019.11.07.10.27.35; Thu, 07 Nov 2019 10:27:58 -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; dkim=fail header.i=@gerhold.net header.s=strato-dkim-0002 header.b=Qpcx2anj; 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 S1727389AbfKGS1C (ORCPT + 99 others); Thu, 7 Nov 2019 13:27:02 -0500 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.82]:21572 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725823AbfKGS1C (ORCPT ); Thu, 7 Nov 2019 13:27:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1573151218; s=strato-dkim-0002; d=gerhold.net; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=Oqhe1WXoIbq8yVt8OzlAqvdDOM9RGB7JcT21P0FRSQk=; b=Qpcx2anj4TqpylsWHdwrCObqloiKcit4jenBhF9RfrxvPKRiLwEXPW9Gat1mtANi7X 61aOYge/Y3MZl4bqw3u+gTunbPbeE3JQEkiuUoQow282JoCkKePfEp1VHjhXFtM3KHbM yoZWddnnfKH3DhwZsVSs68hFordkBJBNZsBwS/74CUNKZXfzEQjpv33rof57TxaXa5wS eH7fgpQRYEQGM3SNDsEM0GUFJKzj3wY+mBr8s9R7v/111flyfJMFrfF2uK4/WuNXSSes 8pRGdyrdoIjg98x9Su/a85PGdGsVDnMCS+VS8IIoTTCF1xoUIZ5ld+8rhNyjiiWuSgmG EUVQ== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQ/OcYgojyw4j34+u266EZF6ORJDd+zEsL6f" X-RZG-CLASS-ID: mo00 Received: from gerhold.net by smtp.strato.de (RZmta 44.29.0 AUTH) with ESMTPSA id e07688vA7IQpoNh (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Thu, 7 Nov 2019 19:26:51 +0100 (CET) Date: Thu, 7 Nov 2019 19:26:45 +0100 From: Stephan Gerhold To: Lee Jones Cc: daniel.thompson@linaro.org, broonie@kernel.org, arnd@arndb.de, linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, baohua@kernel.org, Barry Song Subject: Re: [PATCH 1/1] mfd: mfd-core: Honour Device Tree's request to disable a child-device Message-ID: <20191107182645.GA13813@gerhold.net> References: <20191107111950.1189-1-lee.jones@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191107111950.1189-1-lee.jones@linaro.org> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 07, 2019 at 11:19:50AM +0000, Lee Jones wrote: > Until now, MFD has assumed all child devices passed to it (via > mfd_cells) are to be registered. It does not take into account > requests from Device Tree and the like to disable child devices > on a per-platform basis. > > Well now it does. > > Link: https://www.spinics.net/lists/arm-kernel/msg366309.html > Link: https://lkml.org/lkml/2019/8/22/1350 > > Reported-by: Barry Song > Reported-by: Stephan Gerhold > Signed-off-by: Lee Jones Thanks for all your work on this issue! FWIW: Tested-by: Stephan Gerhold > --- > drivers/mfd/mfd-core.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c > index cb3e0a14bbdd..f5a73af60dd4 100644 > --- a/drivers/mfd/mfd-core.c > +++ b/drivers/mfd/mfd-core.c > @@ -152,6 +152,11 @@ static int mfd_add_device(struct device *parent, int id, > if (parent->of_node && cell->of_compatible) { > for_each_child_of_node(parent->of_node, np) { > if (of_device_is_compatible(np, cell->of_compatible)) { > + if (!of_device_is_available(np)) { > + /* Ignore disabled devices error free */ > + ret = 0; > + goto fail_alias; > + } > pdev->dev.of_node = np; > pdev->dev.fwnode = &np->fwnode; > break; > -- > 2.24.0 >