Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1568536pxk; Fri, 2 Oct 2020 13:00:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZvDGghYYSuZ2vF68RJuURsN3OKyw0ObrNowCnkrJi/tFekimofJ1x4BXhA4JHRNQGc95X X-Received: by 2002:a17:906:5812:: with SMTP id m18mr4055118ejq.204.1601668846743; Fri, 02 Oct 2020 13:00:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601668846; cv=none; d=google.com; s=arc-20160816; b=CYbZVVkAo4me6LFLr7c5dmnMyMoB12Ecb+Z1j6d1+NzaV66laJq/8qpZK34sfaMgSE Xc1pMr9+oRsBecd1mOtkx8W65jdTCV6R04FCrjN1DHAGp2/HphNFiNCRRxnGP3SIokq3 h852V0llDRCgymFErF2kVx+lgIeJUxlo1pXsFR8HhvYibz2pv0LgiMQeDLrLllIt7RFb 1qCW3KCplUsZA+PKuVU4NIVl0TqaO/GXA9VZcjZfHunai2fRxMa8HGAdBVRA0oqTGG72 pgasSypapZNBmZ9PesgkLyh5qrhU0Wb1lqubqrmCablNRsx+2KAqkUps8T7kxUae+J1j tMjA== 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=ovDZo6QnGnQC0kINVGF5qf4WbCs4Yqe98wIOWANbtKg=; b=f5Fic7vnpmy0OvwnwlukO4N7s5LfMdgRraiOhmOa+wAypOoFlhu4BDI9d+CtmPm1w6 xqqpJ1JdSmUsGgFuvSpKk0/bSxRjGYoY6VZQVaLDT0pEivNnzrYvI0PH2rqs2aICzzC3 /emudCdAAYfMNUPMXnD+OHZCJEMqG4JNrVP+HklsaeAJpXFoe3rpBj0p4GoEJihdPkon bJSthfDfm6VBscswY/0y9HyMtDMT8eEPp9GEIbTnrfOZrvYuWDOlM5Rm7fImRhRNX1Ch L1z5o35e0qmIJm7ufloMehyrwLIHnsEcpRz7EtB+6gFDAB5FcYbr3HEqAOmhp/Kepe3a LdcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=UzeMUDhD; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g2si1724795ejp.429.2020.10.02.13.00.24; Fri, 02 Oct 2020 13:00:46 -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=@google.com header.s=20161025 header.b=UzeMUDhD; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725613AbgJBT5I (ORCPT + 99 others); Fri, 2 Oct 2020 15:57:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725283AbgJBT5I (ORCPT ); Fri, 2 Oct 2020 15:57:08 -0400 Received: from mail-yb1-xb44.google.com (mail-yb1-xb44.google.com [IPv6:2607:f8b0:4864:20::b44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0C14C0613D0 for ; Fri, 2 Oct 2020 12:57:07 -0700 (PDT) Received: by mail-yb1-xb44.google.com with SMTP id h9so2002084ybm.4 for ; Fri, 02 Oct 2020 12:57:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ovDZo6QnGnQC0kINVGF5qf4WbCs4Yqe98wIOWANbtKg=; b=UzeMUDhDnRK5Zj4JKpjmSyH6QyQJIplVfeAecbSXbr+GqkaKcz+A2xs23EVpwVIP4A DiVMo1auRWW9uWTP56jwFTybtxfbB6NboEImXqe06VB/E3S+3guRXb5TR7YEyEI8vwG1 Xwi1HqMzpvRGjLqYPDzI3UV7LAbl7nllJHjSzT6DlKLb7lFcfUogx5YirNM1QU4Ls4M9 lmVfrMK8cyWkA/JedCBYimVYMP9CGz8Ds+xrrdCZBf2rUSTLa7978K4T1IlUmLT1Zii/ fxSQYoPETD6BVfAtupoW0bFMe7rsMae1Uo28zoBg2pb6Yf7foybVXpwbW7g+qke2xieM 2NaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ovDZo6QnGnQC0kINVGF5qf4WbCs4Yqe98wIOWANbtKg=; b=b08GUVs8ipYGGPla9hc5OJYrBlKihlaK6bMPXZ+ndFqPDWww8xDvpkt9kXrAZKC9qs EQhkJP0gOUmMLJBg30xv6zS/MqqpaxGYjrcNQVoCCF7J1WMaZnwb8sa5wjkGq7rHDWqI q20Wu6wkdow658Yt7FLCIha3bsgyo3MzVh8P7pykC0FfNU3kwVJs2JlWCqSZe3VECxHt y5oXkTC/F0Ap/OyEQGdHr/dNm/XPS0RjY5gDq0OsACF2zfSp2S8eren6d1XhX+RivqaJ meYQttCT2yPwWbQJmIN9RVFdPde/M0JM9j6fevj+Ak+/1DPtCFZqPfDx7ghoLIZ9zAf5 2VyA== X-Gm-Message-State: AOAM532aypxITCQF2sA/9KwxbVg1FegfE8lpwyTQ+VWrhocg33DGAglY bFS8MSZSZK7zkX1JRanxqXTfO8pEheam5614wEA7iQ== X-Received: by 2002:a25:c512:: with SMTP id v18mr5323591ybe.20.1601668626877; Fri, 02 Oct 2020 12:57:06 -0700 (PDT) MIME-Version: 1.0 References: <20201001225952.3676755-1-saravanak@google.com> <20201002175423.GE3933@pendragon.ideasonboard.com> <20201002182712.GF3933@pendragon.ideasonboard.com> <11018e7e-a6a1-2df6-5639-821a7c0cb68b@ti.com> In-Reply-To: <11018e7e-a6a1-2df6-5639-821a7c0cb68b@ti.com> From: Saravana Kannan Date: Fri, 2 Oct 2020 12:56:30 -0700 Message-ID: Subject: Re: [PATCH v1] of: platform: Batch fwnode parsing in the init_machine() path To: Grygorii Strashko Cc: Laurent Pinchart , Rob Herring , Frank Rowand , Geert Uytterhoeven , Greg Kroah-Hartman , 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" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 2, 2020 at 11:35 AM 'Grygorii Strashko' via kernel-team wrote: > > hi Saravana, > > On 02/10/2020 21:27, Laurent Pinchart wrote: > > Hi Saravana, > > > > On Fri, Oct 02, 2020 at 10:58:55AM -0700, Saravana Kannan wrote: > >> On Fri, Oct 2, 2020 at 10:55 AM Laurent Pinchart wrote: > >>> 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 > >>> ? > >> > >> So I take it the patch I sent out didn't work for you? Can you tell me > >> what machine/DT you are using? > > > > I've replied to the patch: > > > > Based on v5.9-rc5, before the patch: > > > > [ 0.652887] cpuidle: using governor menu > > [ 12.349476] No ATAGs? > > > > After the patch: > > > > [ 0.650460] cpuidle: using governor menu > > [ 12.262101] No ATAGs? > > > > I'm using an AM57xx EVM, whose DT is not upstream, but it's essentially > > a am57xx-beagle-x15-revb1.dts (it includes that DTS) with a few > > additional nodes for GPIO keys, LCD panel, backlight and touchscreen. > > > > hope you are receiving my mails as I've provided you with all required information already [1] Laurent/Grygorii, Looks like I'm definitely missing emails. Sorry about the confusion. I have some other urgent things on my plate right now. Is it okay if I get to this in a day or two? In the end, we'll find a solution that addresses most/all of the delay. Thanks, Saravana