Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1497195pxk; Fri, 2 Oct 2020 10:57:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCn55m3ul1Ja9fM0UZL1/6xLEhnYWiuVLx6UAeLm4WcFbfUNC1jdFo8XdJBLsNp9rrJkzi X-Received: by 2002:a05:6402:13d3:: with SMTP id a19mr3560226edx.255.1601661457069; Fri, 02 Oct 2020 10:57:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601661457; cv=none; d=google.com; s=arc-20160816; b=WOuJbLDSL+Dcxf+lvPLkoihYQiFGgdA6ogiqVKkXRBLwTj5/HCkfiK9JWXVdJdx0LE B1Q5xDZDMNRSZ2aKV31+p/g/W39OpI4nwtDvu4hhJm0DTR9l9sAg42DTdbdibaOVM97W QiJ9K8qSN4g7GcEguJ0lSiZBt+sVrxW1pD7ZW6IrG5klmcK8Zqkj3W6S5NETzbaeO7ST dxuLqp39Cy/LNeTr//Ef7vcVowQzhHRBUNktnWs6jMReCTtV/fKRebwixLqW61npXB/b a2h0J2C9UxsF1/5fGoS0i9hhGc4oaku3nAVpn3nKFCUdHQQbhAjgEWnP+FxL7VExNp11 EjdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UBl5bmU6wjAl7aeUMYqrE0LYM9lqpj5F+fQx7yjf1k0=; b=nIgYHIL7BwRnpewULhaJJ8Y21C76w3M4jKgjmyBA3n8MS6eHJ80GKQMjA/Tp+3Oxv4 MwywRdv77ccEK2OWHC4cdvI6oLXln9Bx8t0YUbzhWl2Mdl5b7Ttx58AKs1qKsLbf5DEf ofPfPkTWZZkDThtBRD1lH4DiAB2kIp+Ni3lu3Z5AfwbuY6OchxE3PRx0nSxbKAK3hrss 5wqi1eckF0OsV2mqejDozu4v1i2LFjRWBdTikyF/o0tE8c2zkzNGO4/F+uktCVvmcLkL QjcdxzNslKscAYEEBI5nM8NQmB8tHsuj/0Z085elycZLVyrBY2RxCXwPGEeIEOyPRW3g cO+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=tyQZ83BX; 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 a20si2155539edj.252.2020.10.02.10.57.14; Fri, 02 Oct 2020 10:57:37 -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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=tyQZ83BX; 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 S2388184AbgJBRzF (ORCPT + 99 others); Fri, 2 Oct 2020 13:55:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726096AbgJBRzF (ORCPT ); Fri, 2 Oct 2020 13:55:05 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C41F0C0613D0; Fri, 2 Oct 2020 10:55:04 -0700 (PDT) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BE0D72A2; Fri, 2 Oct 2020 19:55:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1601661300; bh=Qf5HRVHyIghCAni0kFGOWiS+pLkA33+NJPB9Z0/mkIM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tyQZ83BXpSGafZKcDDYw5h9fnxWiy6R8cB193qxbzdZznN7LBrciEoZTVFUOZBMl+ FhKB8srgeqVzZ6BUphAZ4AsgJnwvg2ebbaPIQLjtfq5ywom1UnaILbMF0sDMhDMUZN jYIXxfd4B3aItZkQnYX08/FGcSHjOKgL+FOVFb4U= Date: Fri, 2 Oct 2020 20:54:23 +0300 From: Laurent Pinchart To: Saravana Kannan Cc: Rob Herring , Frank Rowand , Geert Uytterhoeven , Greg Kroah-Hartman , Grygorii Strashko , linux-omap , "open list:THERMAL" , Peter Ujfalusi , "Rafael J. Wysocki" , Tomi Valkeinen , Tony Lindgren , Ulf Hansson , Android Kernel Team , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v1] of: platform: Batch fwnode parsing in the init_machine() path Message-ID: <20201002175423.GE3933@pendragon.ideasonboard.com> References: <20201001225952.3676755-1-saravanak@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Saravana, On Fri, Oct 02, 2020 at 10:51:51AM -0700, Saravana Kannan wrote: > On Fri, Oct 2, 2020 at 7:08 AM Rob Herring wrote: > > On Thu, Oct 1, 2020 at 5:59 PM Saravana Kannan wrote: > > > > > > When commit 93d2e4322aa7 ("of: platform: Batch fwnode parsing when > > > adding all top level devices") optimized the fwnode parsing when all top > > > level devices are added, it missed out optimizing this for platform > > > where the top level devices are added through the init_machine() path. > > > > > > This commit does the optimization for all paths by simply moving the > > > fw_devlink_pause/resume() inside of_platform_default_populate(). > > > > > > Reported-by: Tomi Valkeinen > > > Signed-off-by: Saravana Kannan > > > --- > > > drivers/of/platform.c | 19 +++++++++++++++---- > > > 1 file changed, 15 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/of/platform.c b/drivers/of/platform.c > > > index 071f04da32c8..79972e49b539 100644 > > > --- a/drivers/of/platform.c > > > +++ b/drivers/of/platform.c > > > @@ -501,8 +501,21 @@ int of_platform_default_populate(struct device_node *root, > > > const struct of_dev_auxdata *lookup, > > > struct device *parent) > > > { > > > - return of_platform_populate(root, of_default_bus_match_table, lookup, > > > - parent); > > > + int ret; > > > + > > > + /* > > > + * fw_devlink_pause/resume() are only safe to be called around top > > > + * level device addition due to locking constraints. > > > + */ > > > + if (!root) > > > + fw_devlink_pause(); > > > + > > > + ret = of_platform_populate(root, of_default_bus_match_table, lookup, > > > + parent); > > > > of_platform_default_populate() vs. of_platform_populate() is just a > > different match table. I don't think the behavior should otherwise be > > different. > > > > There's also of_platform_probe() which has slightly different matching > > behavior. It should not behave differently either with respect to > > devlinks. > > So I'm trying to do this only when the top level devices are added for > the first time. of_platform_default_populate() seems to be the most > common path. For other cases, I think we just need to call > fw_devlink_pause/resume() wherever the top level devices are added for > the first time. As I said in the other email, we can't add > fw_devlink_pause/resume() by default to of_platform_populate(). > > Do you have other ideas for achieving "call fw_devlink_pause/resume() > only when top level devices are added for the first time"? I'm not an expert in this domain, but before investigating it, would you be able to share a hack patch that implements this (in the most simple way) to check if it actually fixes the delays I experience on my system ? -- Regards, Laurent Pinchart