Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp837023rwb; Thu, 4 Aug 2022 11:50:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR59QgfagZCGDQMojV5ozlOFexIlcPKIUgbbfnglVNQziA3fwyCM/Fe/hsieylvFSHqjYYSj X-Received: by 2002:a65:6d9a:0:b0:41c:c77:7b6 with SMTP id bc26-20020a656d9a000000b0041c0c7707b6mr2764582pgb.139.1659639005585; Thu, 04 Aug 2022 11:50:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659639005; cv=none; d=google.com; s=arc-20160816; b=iYc6+s/v68r49HN4ShO9JuLZp2vMuTMRj3q8W6SIWAJf2HElau5zaoQMcOOdaOa4Iy xv5oeHb0FeDnCURFxD961n+TVmG2I1rYzdqGA84mcCRY/+Wm+NQYi377y5OdUjOu8H7J eJVVciSBBKeDk0vkPc06FTy8DEE2lSNNY8pIG4Q9DySHseFeiGLN9SXOJgY1dX3ch3eG t/rZuziZwz7Jjk+9fc8/w7WTmyMiVDWxIWM7c+FJU8/d2sCpMfPm3ukJ9EkV03END/Wt YHaa8NO9nR9AG7nTneE7jw2TKEWWbW/gOkfnvYfdUZ5bYzbUwH2Wr0O/YcO1j8Q9guuL cbkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=eX8vBdPif72AOCUJ7zNNVFek4nz2akIAnOhX0YOIrkY=; b=Fz8nMXn00VUpw1a+jkT3n1Y2CvetVfPHhc5gx/qT7noEtJWshGex5wqLarNmEFDKHV 3p7KtodFLFOgZkzw67RYswKJ4BxXVOA6LiYiH5j5h/BTmvn1KQr1FrKVsjXNLaxDjpAE 9BNKTucyyUvjkvBIf9JicJhSY/0P9kjPTPv87odPxCvWjUuucNbOWwgEuQdjobL1PSxv CBBkrKksf/dt2Fxou4BrDQq2ydNdKS0kSfEWZFMlcTmCyL3rYjW1A7+sPwZFTVGA6/A5 SmsnKd9GHk5XQsU56Y8YXiB67oGBwDhT2AiaVoKm8p0MO5vvFcQAS0+tFgOXqsWTtlh8 QZxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="LuZu0Ou/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pi2-20020a17090b1e4200b001ed3b95efa5si6917809pjb.96.2022.08.04.11.49.51; Thu, 04 Aug 2022 11:50:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="LuZu0Ou/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239997AbiHDS1j (ORCPT + 99 others); Thu, 4 Aug 2022 14:27:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237530AbiHDS1h (ORCPT ); Thu, 4 Aug 2022 14:27:37 -0400 Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F8695C37A for ; Thu, 4 Aug 2022 11:27:36 -0700 (PDT) Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-3246910dac3so3569487b3.12 for ; Thu, 04 Aug 2022 11:27:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eX8vBdPif72AOCUJ7zNNVFek4nz2akIAnOhX0YOIrkY=; b=LuZu0Ou/YgZIzgjMKDbHl+R0wB/6H/k9edimEwdI91oFh0iP12UJy5wg27oD9TmSik AHBmMfm8N99XSQPgEVhEzhJnrWj+/i5saSv7vIOk45CUPV1kgZ0V/PHRd3LUHd8iQHwz p8mNT9kgcxQQ2w5IbvvDxlxdZErHgdPMfuYWqkL4eYcKMiFhSb6LaVoN7HKKLqp3yEx5 iFTMpX2iffHDNdomN48pWCVnH2Kp428CANAN4rbBjvkjEkkOkuRftYjgdIbo72JPF0ZE lPbr6jqt17aRChsotgl3Bjkg8x+1l00+OiKZ9CdNvMuWKCvOmONY0ng462Q0hJTLSovo 8/Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eX8vBdPif72AOCUJ7zNNVFek4nz2akIAnOhX0YOIrkY=; b=V/zgPuqPzsNauHP9T/yI2ZugCZWymtN2jw/YaUnwpFnWQqicm+LSETDoXJk9VL1ZrF IRgQNhIqX3vMiP0Sej6Xr1jzqQlsvt1uREeJ3KnF+jJRu1EsheaKDFs1BF44B2qOep0u Snm+jmF3Yg2QTGZR0zYjRrt6YJf8yFrXWR6WzxHFTgBLwj7TlDS+X/BL9Z7poaTRk5JX QWoJdwi/4XJHBGqfLXV+WXfvh7ru5fQVigxe77qKY3PwaxArLAOwsGHuMik13c8u5eS4 ZSMfHB45vKJUc7NKL6SPs64YRQpRo+Bi8Tcs7b2hRzjrWkaI7r5AIr9/iYMUc97ZREoQ mLVg== X-Gm-Message-State: ACgBeo3wMO3D9sKk0E24CneKgzbvQShOx5LWuiAJtIUMbgy0kWOxLseE bw7RVPA4YtuO8SUQP7PHmCm8Rrol5zuPPXC6SN0XNg== X-Received: by 2002:a81:50d4:0:b0:31f:5f85:566a with SMTP id e203-20020a8150d4000000b0031f5f85566amr2783119ywb.218.1659637655607; Thu, 04 Aug 2022 11:27:35 -0700 (PDT) MIME-Version: 1.0 References: <20220804061133.4110734-1-victor.liu@nxp.com> <20220804061133.4110734-2-victor.liu@nxp.com> In-Reply-To: From: Saravana Kannan Date: Thu, 4 Aug 2022 11:26:58 -0700 Message-ID: Subject: Re: [PATCH v3 1/3] drivers: bus: simple-pm-bus: Populate simple MFD child devices To: Rob Herring Cc: Liu Ying , devicetree@vger.kernel.org, linux-arm-kernel , "linux-kernel@vger.kernel.org" , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , NXP Linux Team , Greg Kroah-Hartman , Geert Uytterhoeven , Krzysztof Kozlowski Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 4, 2022 at 5:18 AM Rob Herring wrote: > > On Thu, Aug 4, 2022 at 12:10 AM Liu Ying wrote: > > > > There could be simple MFD device(s) connected to a simple PM bus as child > > node(s), like Freescale i.MX8qxp pixel link MSI bus. Add a child match > > table as an argument to of_platform_populate() function call to specify > > the simple MFD devices so that they can be populated. > > There could be a simple-bus under it as well. You should just use > of_platform_default_populate() instead. I'm confused why we even need this patch. Wouldn't this driver automatically probe simple-mfd buses and populate its child devices? We already have it in simple_pm_bus_of_match. I'm wondering if you are trying to workaround the behavior of having "ONLY_BUS" set in simple_pm_bus_of_match for "simple-mfd". Have you tried deleting that field and see if it does what you want? And we wouldn't need to use of_platform_default_populate() because this driver would take care of doing that recursively. Especially when you need the clocks and power domain to be able to access the child devices, you want the driver to probe and do that at each level before automatically recursively adding all the grand-children devices. -Saravana > > > > > Signed-off-by: Liu Ying > > --- > > v1->v3: > > * No change. > > > > drivers/bus/simple-pm-bus.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c > > index 6b8d6257ed8a..ff5f8ca5c024 100644 > > --- a/drivers/bus/simple-pm-bus.c > > +++ b/drivers/bus/simple-pm-bus.c > > @@ -13,6 +13,11 @@ > > #include > > #include > > > > +static const struct of_device_id simple_pm_bus_child_matches[] = { > > + { .compatible = "simple-mfd", }, > > + {} > > +}; > > + > > static int simple_pm_bus_probe(struct platform_device *pdev) > > { > > const struct device *dev = &pdev->dev; > > @@ -49,7 +54,7 @@ static int simple_pm_bus_probe(struct platform_device *pdev) > > pm_runtime_enable(&pdev->dev); > > > > if (np) > > - of_platform_populate(np, NULL, lookup, &pdev->dev); > > + of_platform_populate(np, simple_pm_bus_child_matches, lookup, &pdev->dev); > > > > return 0; > > } > > -- > > 2.25.1 > >