Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1499180pxk; Fri, 2 Oct 2020 11:00:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6M7CQ5CdhBszs2OObbVAXzO5WdV+E3qJgxW8OXOhgVGCr6SoyXuMb3pVYYV6+B/rSVEbp X-Received: by 2002:a17:906:b858:: with SMTP id ga24mr3413591ejb.378.1601661658915; Fri, 02 Oct 2020 11:00:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601661658; cv=none; d=google.com; s=arc-20160816; b=Wja1aXbg9jIumhkXwbH1SAtnFFrrVwrkpqcahWr/YS4BRA27wc8Sw+XLibwo8Ovj3q ezgnFFFxmiVWAnowY3/UhSwFscSckn3TAgb+jEIAnVgNPw3xXkfYqpL61oiTiE96XfvZ qZu9AAUP/oIIs/1LBORG4UN0GkU8DgnQ8nc/TveW+bX6Ej7GGkK0rs1MHySSdvEKQRt+ GmSHdTgb6OuYj4aPlKAcXky/VIHUL3nTywYexdpAYNJ6rzpjhvm2//XyC9Oc7S68MvMA +SADgx56+aYqeOQNxHRihECilNij5uzLdn0mtDwdg7IXluQ2v76LvRTX3RT/tpu0v9PL ltXQ== 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=vZbuayUw4nR5ldchYC0QJ2SKyNmd/sp/ZArDf0aVmf4=; b=RvAOB2C/e0XRqteLpV95miEDa+ep5lofnPVXEMXvLA/Ta4KiFH8Q3YzmAndbasOXME +lqWxM1hy++CFOGM8KaDxH9ibvPInd6kMLZkz45KaLc08qFxr3pLautwCEcN5HGpI7cL 6is8fTjhI9femrsIimjYuaZSlWwedRXbQPPWd4Je6KO/mWhxdv7M3HCFyBiBhxIw5RC4 qb+gwhchXXqF1V5rnVLEKXxySYDoSBuKPpkb6mcWE8Hq+vOAOS8K7Yl2/7QPxm/4DNyS 9VkHrGqlDknSsBWoz/ycUykXNhDCOh0VdVTeNp5QepJEBo7Hjfc6Egl9IszJ8FD6Hfsl xAbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hxne4JB9; 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 ay25si1422741edb.398.2020.10.02.11.00.34; Fri, 02 Oct 2020 11:00:58 -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=hxne4JB9; 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 S2388064AbgJBR7d (ORCPT + 99 others); Fri, 2 Oct 2020 13:59:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387602AbgJBR7c (ORCPT ); Fri, 2 Oct 2020 13:59:32 -0400 Received: from mail-yb1-xb41.google.com (mail-yb1-xb41.google.com [IPv6:2607:f8b0:4864:20::b41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AEAAC0613E2 for ; Fri, 2 Oct 2020 10:59:32 -0700 (PDT) Received: by mail-yb1-xb41.google.com with SMTP id j76so1777165ybg.3 for ; Fri, 02 Oct 2020 10:59:32 -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=vZbuayUw4nR5ldchYC0QJ2SKyNmd/sp/ZArDf0aVmf4=; b=hxne4JB9HZja3FImgOTwwGft+D9UZ0uS9fK4OcJP2Eg1oroqmn/9modjXkPJGSlN8g Lh5UDYM7CynmC7F+t8Uq5psnpU8Z5iPg+RgiXlsA6p/lD2mphiU75QAqHBKi1YSqj7XW 7LoAJgH6xJq1blMl4m/G5sIIkMci/wvcZrPRhucqEIygDXBzfFT+Qf7VHFgFAyQk/z+1 F/V36+u2ogFL7XMkvpu/ekSzZkW2RoA3QWTLoD2astGElGbvCRuXZLvLQNp8zSMbfqsI izqQ+mlyGkYqerxmFose6Nqt7AAsAnO9detgWoYY7GHj8Az83ZD5RLrYOddI9P+0V/ml IIMg== 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=vZbuayUw4nR5ldchYC0QJ2SKyNmd/sp/ZArDf0aVmf4=; b=Y0zbJjIUFrnxeeO8JrOmlx0/eJAvV/z8w+YKB1vKLs3q9Fh42azpoGQ18nvfeNtI8d aBgtZX/tXSmZ+k38IrPpTiVG/QMCtMlde/i9PPlfWE6oyqx8B1Qv7BUXWMbX0AeN11J2 oXeUlDpdLx9Lfz4QqigRTVTNQGptJbvLccd1hrEy/hz7yNt70Md1mTa6vG/1ESh7R8EB MmHAue3BUFGBR1JeDll/Mu4AJb1pR0irvm6N84W/lcf3Er/j7lM7hwsFzRQdwiBdodnG FNIa/erP2zKxVvY2JWWm2+QeqcJRYJlK9VKIZEZu/PF5xWxw8W+w7urAW6mlloXUypz7 3ZYg== X-Gm-Message-State: AOAM530HvD00lYbpQBPQ5KQ5Pv71EWsVkAQUEDtBYSk7TWXz3DImwT+n OT9y/P6X05ilUsX8on/ewZ7o0i97+D32QfQcdVFLUA== X-Received: by 2002:a05:6902:725:: with SMTP id l5mr4142164ybt.346.1601661571259; Fri, 02 Oct 2020 10:59:31 -0700 (PDT) MIME-Version: 1.0 References: <20201001225952.3676755-1-saravanak@google.com> <20201002175423.GE3933@pendragon.ideasonboard.com> In-Reply-To: <20201002175423.GE3933@pendragon.ideasonboard.com> From: Saravana Kannan Date: Fri, 2 Oct 2020 10:58:55 -0700 Message-ID: Subject: Re: [PATCH v1] of: platform: Batch fwnode parsing in the init_machine() path To: Laurent Pinchart 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" 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 10:55 AM Laurent Pinchart wrote: > > 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 > ? So I take it the patch I sent out didn't work for you? Can you tell me what machine/DT you are using? -Saravana