Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1335293pxk; Fri, 2 Oct 2020 07:09:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6ROyu9qQ+B+oLC610Btmj37gWNwS4faowkTPgJi+Ie+lZ1zDUYg69oV7skAwHzre0HbK6 X-Received: by 2002:a17:907:20e6:: with SMTP id rh6mr2398026ejb.169.1601647790865; Fri, 02 Oct 2020 07:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601647790; cv=none; d=google.com; s=arc-20160816; b=CnAyHqQkQTn/MnKRgw/ROFPBQCWhYU33GP92zap3ngbNdp4+rRAmeXFlN+iqFIpLlf rMoOJLqtiBkcPz/oltLVy5rFkVRBv/umUDpf6v/ehUzcBrK4pnmi6DCoBB2qyGMQGeg+ g+cYBlIWi9ptXe8dg/6/9KEkg8VcAILI+XJpPIIQYrzC0myuzU0vcJhiDv6cxaBc4Wi8 kFeSpM6gqibel5pspwZCXythfV6xl0zp/wpqMdO8DGG+swiTe5OB/TQMjxBWFyZAtJoA 6czlaYqP2JeIebjS5ZzcdGZVSO1axTVHKHkMqZ36yIF/aDd48hQNlaU5Sc0GSckVxKsK 5EVg== 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=miK1JhA5tWpftPcZfucp4HN/y76YMOmtcjY0n5TstLU=; b=XZvSB6SCVb+DplXmAph+PCaTQ92HaeY6NmK2h6zPIHxMhbZx7lE4YR7WcM72nsjhMU +NVBCAg+Ja8Bwnjdcaro6Yo+5p8Kf2yKV1tTI5jbkfrZ65UyRBGT7urgE/pVh4BtmyL1 eZEJKAAz/B7FD9wrRduw8j4eqsmzm68755w0wHPk5GBpE+B2LI8y/sybXuUAlQ8oVGNE L+PZ0merxeu0Zt6xZEf4p1IPjesOWQ8bjF1q7QdeKZ/Sj9thBOsIZCDeb+VaCQeVD7ym jyo5qm4GrCEnvSpsma9gTWTp06sHHqq8hcMWNyFynr0tyTcwx+Weg8PPEckpFVUS1a7B id3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YS1CG4Oq; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w23si1091801eju.558.2020.10.02.07.09.28; Fri, 02 Oct 2020 07:09:50 -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=@kernel.org header.s=default header.b=YS1CG4Oq; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387998AbgJBOIJ (ORCPT + 99 others); Fri, 2 Oct 2020 10:08:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:50158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726017AbgJBOIJ (ORCPT ); Fri, 2 Oct 2020 10:08:09 -0400 Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3F14F207DE; Fri, 2 Oct 2020 14:08:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601647688; bh=+3VAWIyE736i8QJoJWyBkDl46THgUH5Y4ZYxc7rww6M=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=YS1CG4Oq4huZaIu8Ij+hCQ8yMeyS36kpM3ri/SpDmf7c/4ohOYavdzjqQINHrtMh8 S5TM/P/23W3g2UnzrPxSe2Cntf/zAVfCMhcH9eXkTdMJNNfMdIo/WYFPRCIjCth4PB eR0N9LtyPPEpeKWJA/sR5JRvkpq+rlfyzILcDgr4= Received: by mail-ot1-f51.google.com with SMTP id m13so1437744otl.9; Fri, 02 Oct 2020 07:08:08 -0700 (PDT) X-Gm-Message-State: AOAM531bQPWfd7wgP9QFVIN1VvpxAL30hBz5JwGPdvepdcwGWXdfPvu0 4Mu3d4ctwv3QVkGCP+HNiTLUxBF0u44Jwbp5lg== X-Received: by 2002:a9d:7998:: with SMTP id h24mr1914471otm.192.1601647687409; Fri, 02 Oct 2020 07:08:07 -0700 (PDT) MIME-Version: 1.0 References: <20201001225952.3676755-1-saravanak@google.com> In-Reply-To: <20201001225952.3676755-1-saravanak@google.com> From: Rob Herring Date: Fri, 2 Oct 2020 09:07:55 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1] of: platform: Batch fwnode parsing in the init_machine() path To: Saravana Kannan Cc: Frank Rowand , Geert Uytterhoeven , Greg Kroah-Hartman , Grygorii Strashko , Laurent Pinchart , linux-omap , "open list:THERMAL" , Peter Ujfalusi , "Rafael J. Wysocki" , Tomi Valkeinen , Tony Lindgren , Ulf Hansson , Android Kernel Team , devicetree@vger.kernel.org, "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 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. Rob