From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76159C43603 for ; Mon, 9 Dec 2019 19:31:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 476F4205ED for ; Mon, 9 Dec 2019 19:31:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="KIjyedjy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726509AbfLITbp (ORCPT ); Mon, 9 Dec 2019 14:31:45 -0500 Received: from mail-qk1-f201.google.com ([209.85.222.201]:42632 "EHLO mail-qk1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726342AbfLITbp (ORCPT ); Mon, 9 Dec 2019 14:31:45 -0500 Received: by mail-qk1-f201.google.com with SMTP id m13so10660591qka.9 for ; Mon, 09 Dec 2019 11:31:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=prB1mk9zvmGsCm6yR+oUx6Ow5sTMlrAQcgGbY8ED3/U=; b=KIjyedjy8nKNq/kpAMbwxkGMECaIvC3qdOkXTSD8uZOSbIA1zqIMm+d3v2GbyU9CsC cewFDS9udMTcBDkUKZUS6p0AzmHYec6yPjkNtBiJZWVnBSF29uq9nXNAZDuzByhgHKGI ud9yyn+iZ2S5WHgMw26FIeid04csehS+Fyof2aQAmzeurrobWJFSe1wjhKgN98C+hUsq +em5TRFqHNGUupbBoZEuGtb1MxxLbu7ZE5qh/qvhG83X9bXVs4NUhouWhSvPe9WStWxm JzpxqaZiGGvDXbAfO+PtALH4PaAOqAlVhkJqJJNAqh2Fx2P4mXyhyZfE24NwwRNXHjBc 4Eng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=prB1mk9zvmGsCm6yR+oUx6Ow5sTMlrAQcgGbY8ED3/U=; b=pMmDNpMmmdAS3OTb8kEtx0qRJD3j+aR7Vz1+UybWh8YKCAgamKy+t50+rjtx7kcs+A gIA5D/S9S/RJ2tUoVG7uvyhoYTOvxrb6SzJKp83jBi0P2H7sybMvgqAlmHebK6kFAuQX 5tNUXhI+ZY2KFhBnZqyuwyPyeewKJZB55QO09QLzyLYuE4pVJatT/MqlXEs+RaqfJCyt DsoXZKN3Mf5WejX7jtbpFVkIrl9xD3+Lt6tOeoMVrOSPNO1rK9BRCiLBdCIGDh8sOCUa pfKcZJnZRR4qP88T7w+5VtiSwJoIiy5ihUk12lbwX1mlbLw9AA64vnKRgxaWMB+vd1wN z9lA== X-Gm-Message-State: APjAAAWcG1cga04yimVYrpDic7O8lXfPa+kkPmtJeOAEAGk4S2MlZgZ5 l8d099pyhAnaWYYiDNkF/GW8l4WoNzvXO74= X-Google-Smtp-Source: APXvYqw9GHdPYoc93yCyiJKvU4kxnAKjk+GlfxyVvVSYOkfPpKh49jd7LxoXpmTmYo3eAgsuBRRMGKQCgC8Tku8= X-Received: by 2002:ac8:5155:: with SMTP id h21mr26336525qtn.174.1575919904561; Mon, 09 Dec 2019 11:31:44 -0800 (PST) Date: Mon, 9 Dec 2019 11:31:19 -0800 Message-Id: <20191209193119.147056-1-saravanak@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.24.0.393.g34dc348eaf-goog Subject: [PATCH v3] of/platform: Unconditionally pause/resume sync state during kernel init From: Saravana Kannan To: Rob Herring , Frank Rowand , Greg Kroah-Hartman , Saravana Kannan Cc: kernel test robot , kernel-team@android.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Commit 5e6669387e22 ("of/platform: Pause/resume sync state during init and of_platform_populate()") paused/resumed sync state during init only if Linux had parsed and populated a devicetree. However, the check for that (of_have_populated_dt()) can change after of_platform_default_populate_init() executes. One example of this is when devicetree unittests are enabled. This causes an unmatched pause/resume of sync state. To avoid this, just unconditionally pause/resume sync state during init. Fixes: 5e6669387e22 ("of/platform: Pause/resume sync state during init and of_platform_populate()") Reported-by: kernel test robot Signed-off-by: Saravana Kannan Reviewed-by: Frank Rowand --- v1->v2: - Updated the commit text to address Frank's comments - Added Frank's R-b v2->v3: - Added this change log to address Greg's comments drivers/of/platform.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index d93891a05f60..3371e4a06248 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -518,10 +518,11 @@ static int __init of_platform_default_populate_init(void) { struct device_node *node; + device_links_supplier_sync_state_pause(); + if (!of_have_populated_dt()) return -ENODEV; - device_links_supplier_sync_state_pause(); /* * Handle certain compatibles explicitly, since we don't want to create * platform_devices for every node in /reserved-memory with a @@ -545,8 +546,7 @@ arch_initcall_sync(of_platform_default_populate_init); static int __init of_platform_sync_state_init(void) { - if (of_have_populated_dt()) - device_links_supplier_sync_state_resume(); + device_links_supplier_sync_state_resume(); return 0; } late_initcall_sync(of_platform_sync_state_init); -- 2.24.0.393.g34dc348eaf-goog