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=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 9C48BC43381 for ; Mon, 15 Feb 2021 21:58:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A1D464DFF for ; Mon, 15 Feb 2021 21:58:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229811AbhBOV6c (ORCPT ); Mon, 15 Feb 2021 16:58:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229706AbhBOV6b (ORCPT ); Mon, 15 Feb 2021 16:58:31 -0500 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E586C06178A for ; Mon, 15 Feb 2021 13:57:38 -0800 (PST) Received: by mail-yb1-xb36.google.com with SMTP id 133so8561824ybd.5 for ; Mon, 15 Feb 2021 13:57:38 -0800 (PST) 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=6sRa/U5Kzs1JI5RnyoYklyv1NRbU9v8LrTPHarr/PE8=; b=gJEho7HAFjs40VouEGob2eg5Oy9aEdcZUBjHihE6mZQzi6czZHwv0m73BpYkXKdo5q 68ZV+goSq9Fae1dld8Dj2zZYLuDTZktAzE0ZwFkpES3da8W1hs5RObUljgUwwZubEMQR Ca4nrFf96n+Kq21fygN6AVWqtnC1b+1lh90Ad/OFDLwRqlp57eBni+kkmVmwYsQmfAjJ NcDt4L5//G6ue+WDbsA4Z4M/o7lFxOzbQQJ4D6/zpk72I1HGrEAZGi0vXqowaDBLiSCa tPx3s6gkUPD/Kyv6NGu1ljv+0hfUIqhnOIrU799/0jGVFl7RUVlE+Da+9mHdD+VFVUH6 Lj/Q== 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=6sRa/U5Kzs1JI5RnyoYklyv1NRbU9v8LrTPHarr/PE8=; b=hjU8duPCKIFBgNLj/JLpTl6SWh7OJIIlumIHgXTupEv4KoRBoT2q7oQnp64FQQcq0B ftHU1m0RGOLZrLYkODmGKN/VVZDUwyZ1XU2bKEeHx/j3dA2gAUPn5f3tAmo2BwUz1f0u Zv+IDM19c9wwuIVmPrt/w9wPegPwhfMFUliSbZLscBib7TihCTTgay5Yfm9Bde8sc2yK dGW7C4zrrMG9ZVDICkgqPQfmFA05ynqPx8agCL2fgoyeVJpaxqweVF1b2rN/qrEZqtVl uDzQuMa2tRfBVpOWnpX0qmJknmhICxHMZ83Voq2I3INPAkW+vk4wwDLf1C2djlhDbtp6 OVvA== X-Gm-Message-State: AOAM532FFZ8JNBR0scLuIk7zWyXmCJ7dOy6OknH6fGvM6jmluXzEWYc6 2nUqe0NBSGB8N3KTClDo1hOTQ7P12r7xglq5QiKQ8w== X-Google-Smtp-Source: ABdhPJwKttGJ/WSxMO3AOYN0BMrFeAFmWmg7rlKUzB3nt2oaOmB07PQ56EVlNxhui2daNXPCPW1sMy0iGvA9c5ZrRD4= X-Received: by 2002:a25:aa43:: with SMTP id s61mr27067882ybi.32.1613426257227; Mon, 15 Feb 2021 13:57:37 -0800 (PST) MIME-Version: 1.0 References: <20210205222644.2357303-1-saravanak@google.com> In-Reply-To: From: Saravana Kannan Date: Mon, 15 Feb 2021 13:57:00 -0800 Message-ID: Subject: Re: [PATCH v4 0/8] Make fw_devlink=on more forgiving To: Geert Uytterhoeven Cc: Jonathan Corbet , Greg Kroah-Hartman , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Len Brown , Len Brown , Pavel Machek , Michael Turquette , Stephen Boyd , Rob Herring , Frank Rowand , Marc Zyngier , Thomas Gleixner , "open list:DOCUMENTATION" , Linux Kernel Mailing List , Linux PM list , linux-clk , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , ACPI Devel Maling List , Marek Szyprowski , Android Kernel Team , Linux-Renesas Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org Hi Geert, On Mon, Feb 15, 2021 at 7:16 AM Geert Uytterhoeven wrote: > > Hi Saravana, > > On Fri, Feb 12, 2021 at 4:00 AM Saravana Kannan wrote: > > On Thu, Feb 11, 2021 at 5:00 AM Geert Uytterhoeven wrote: > > > 1. R-Car Gen2 (Koelsch), R-Car Gen3 (Salvator-X(S), Ebisu). > > > > > > - Commit 2dfc564bda4a31bc ("soc: renesas: rcar-sysc: Mark device > > > node OF_POPULATED after init") is no longer needed (but already > > > queued for v5.12 anyway) > > > > Rob doesn't like the proliferation of OF_POPULATED and we don't need > > it anymore, so maybe work it out with him? It's a balance between some > > wasted memory (struct device(s)) vs not proliferating OF_POPULATED. > > > > 2. SH/R-Mobile AG5 (kzm9g), APE6 (ape6evm), A1 (armadillo800-eva) > > > > > > - "PATCH] soc: renesas: rmobile-sysc: Set OF_POPULATED and absorb > > > reset handling" is no longer needed > > > https://lore.kernel.org/linux-arm-kernel/20210205133319.1921108-1-geert+renesas@glider.be/ > > > > Good to see more evidence that this series is fixing things at a more > > generic level. > > I spoke too soon: if CONFIG_POWER_RESET_RMOBILE=n, > booting fails again, as everything is waiting on the system controller, > which never becomes available. > Rcar-sysc doesn't suffer from this problem, cfr. above. > Perhaps because the rmobile-sysc bindings use a hierarchical instead > of a linear PM domain description, and thus consumers point to the > children of the system controller node? > Cfr. system-controller@e6180000 in arch/arm/boot/dts/r8a7740.dtsi. Ok, I see what's going on. The problem is that the "power domain" fwnode being registered is not the node that contains the "compatible" property and becomes a device. So this patch[1] is not helping here. Fix is to do something like this (to avoid using OF_POPULATED flag and breaking reset): diff --git a/drivers/soc/renesas/rmobile-sysc.c b/drivers/soc/renesas/rmobile-sysc.c index 9046b8c933cb..b7e66139ef7d 100644 --- a/drivers/soc/renesas/rmobile-sysc.c +++ b/drivers/soc/renesas/rmobile-sysc.c @@ -344,6 +344,7 @@ static int __init rmobile_init_pm_domains(void) of_node_put(np); break; } + fwnode_dev_initialized(&np->fwnode, true); } put_special_pds(); Can you give it a shot? [1] - https://lore.kernel.org/lkml/20210205222644.2357303-8-saravanak@google.com/ > > > - On R-Mobile A1, I get a BUG and a memory leak: > > > > > > BUG: spinlock bad magic on CPU#0, swapper/1 > > > lock: lcdc0_device+0x10c/0x308, .magic: 00000000, .owner: > > > /-1, .owner_cpu: 0 > > > CPU: 0 PID: 1 Comm: swapper Not tainted > > > 5.11.0-rc5-armadillo-00032-gf0a85c26907e #266 > > > Hardware name: Generic R8A7740 (Flattened Device Tree) > > > [] (unwind_backtrace) from [] > > > (show_stack+0x10/0x14) > > > [] (show_stack) from [] > > > (do_raw_spin_lock+0x20/0x94) > > > [] (do_raw_spin_lock) from [] > > > (dev_pm_get_subsys_data+0x30/0xa0) > > > [] (dev_pm_get_subsys_data) from [] > > > (genpd_add_device+0x34/0x1c0) > > > [] (genpd_add_device) from [] > > > (of_genpd_add_device+0x34/0x4c) > > > [] (of_genpd_add_device) from [] > > > (board_staging_register_device+0xf8/0x118) > > > [] (board_staging_register_device) from > > This is indeed a pre-existing problem. > of_genpd_add_device() is called before platform_device_register(), > as it needs to attach the genpd before the device is probed. > But the spinlock is only initialized when the device is registered. > This was masked before due to an unrelated wait context check failure, > which disabled any further spinlock checks, and exposed by fw_devlinks > changing probe order. > Patch sent. > "[PATCH] staging: board: Fix uninitialized spinlock when attaching genpd" > https://lore.kernel.org/r/20210215151405.2551143-1-geert+renesas@glider.be > Great! Thanks, Saravana