Linux-Doc Archive on lore.kernel.org
 help / color / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Tudor Ambarus <tudor.ambarus@microchip.com>
Cc: corbet@lwn.net, gregkh@linuxfoundation.org, rafael@kernel.org,
	khilman@kernel.org, ulf.hansson@linaro.org, len.brown@intel.com,
	lenb@kernel.org, pavel@ucw.cz, mturquette@baylibre.com,
	sboyd@kernel.org, robh+dt@kernel.org, frowand.list@gmail.com,
	maz@kernel.org, tglx@linutronix.de, saravanak@google.com,
	nicolas.ferre@microchip.com, claudiu.beznea@microchip.com,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org, linux-acpi@vger.kernel.org,
	m.szyprowski@samsung.com, geert@linux-m68k.org,
	kernel-team@android.com
Subject: Re: [PATCH] clk: Mark fwnodes when their clock provider is added
Date: Tue, 30 Mar 2021 08:42:23 -0700
Message-ID: <20210330154222.GA5411@roeck-us.net> (raw)
In-Reply-To: <20210210114435.122242-1-tudor.ambarus@microchip.com>

On Wed, Feb 10, 2021 at 01:44:34PM +0200, Tudor Ambarus wrote:
> This is a follow-up for:
> commit 3c9ea42802a1 ("clk: Mark fwnodes when their clock provider is added/removed")
> 
> The above commit updated the deprecated of_clk_add_provider(),
> but missed to update the preferred of_clk_add_hw_provider().
> Update it now.
> 
> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
> Reviewed-by: Saravana Kannan <saravanak@google.com>
> ---
>  drivers/clk/clk.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 27ff90eacb1f..9370e4dfecae 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -4594,6 +4594,8 @@ int of_clk_add_hw_provider(struct device_node *np,
>  	if (ret < 0)
>  		of_clk_del_provider(np);
>  
> +	fwnode_dev_initialized(&np->fwnode, true);
> +

This causes a crash when booting raspi2 images in qemu.

[   22.123618] Unable to handle kernel NULL pointer dereference at virtual address 00000028
[   22.123830] pgd = (ptrval)
[   22.123992] [00000028] *pgd=00000000
[   22.124579] Internal error: Oops: 5 [#1] SMP ARM
...
[   22.141624] [<c0a2f4d8>] (of_clk_add_hw_provider) from [<c0a2f54c>] (devm_of_clk_add_hw_provider+0x48/0x80)
[   22.141819] [<c0a2f54c>] (devm_of_clk_add_hw_provider) from [<c0a43ad8>] (raspberrypi_clk_probe+0x25c/0x384)
[   22.141976] [<c0a43ad8>] (raspberrypi_clk_probe) from [<c0c18da0>] (platform_probe+0x5c/0xb8)
[   22.142114] [<c0c18da0>] (platform_probe) from [<c0c16654>] (really_probe+0xf0/0x39c)
[   22.142246] [<c0c16654>] (really_probe) from [<c0c16968>] (driver_probe_device+0x68/0xc0)
[   22.142377] [<c0c16968>] (driver_probe_device) from [<c0c14834>] (bus_for_each_drv+0x84/0xc8)...

np can (and will) be NULL here. See of_clk_set_defaults().

Guenter

---
Bisect log:

# bad: [9d49ed9ca93b8c564033c1d6808017bc9052b5db] Add linux-next specific files for 20210329
# good: [0d02ec6b3136c73c09e7859f0d0e4e2c4c07b49b] Linux 5.12-rc4
git bisect start 'HEAD' 'v5.12-rc4'
# good: [4b15c5b50e5ec7f2d80275d5a150807b7b9a0a0c] Merge remote-tracking branch 'crypto/master'
git bisect good 4b15c5b50e5ec7f2d80275d5a150807b7b9a0a0c
# good: [c92ad2dfc1a3bc31afc3d41af82c38accf2c3783] Merge remote-tracking branch 'ftrace/for-next'
git bisect good c92ad2dfc1a3bc31afc3d41af82c38accf2c3783
# bad: [103c8000962c33e274244a02a0383d20fab734c9] Merge remote-tracking branch 'staging/staging-next'
git bisect bad 103c8000962c33e274244a02a0383d20fab734c9
# bad: [05ee9b17ef7af7d47395caa48db55d0e2dae64a2] Merge remote-tracking branch 'tty/tty-next'
git bisect bad 05ee9b17ef7af7d47395caa48db55d0e2dae64a2
# good: [bd91c862df59c0290c8a2e2ee6467c0ed5fb6432] Merge remote-tracking branch 'workqueues/for-next'
git bisect good bd91c862df59c0290c8a2e2ee6467c0ed5fb6432
# good: [24327c478b2fc17a01b21a4721f35f22a51fe12b] usb: mtu3: drop CONFIG_OF
git bisect good 24327c478b2fc17a01b21a4721f35f22a51fe12b
# bad: [04c49226ac79b3e5bd0f89da69a64ba2e0cccb91] Merge remote-tracking branch 'usb-serial/usb-next'
git bisect bad 04c49226ac79b3e5bd0f89da69a64ba2e0cccb91
# good: [21a292d73a6e69f31c57d36288482c40b355daf0] Merge remote-tracking branch 'drivers-x86/for-next'
git bisect good 21a292d73a6e69f31c57d36288482c40b355daf0
# bad: [b6688015151857ed3f61fa2344c4b220bc9dc4d7] regulator: qcom_spmi-regulator: Clean-up by using managed work init
git bisect bad b6688015151857ed3f61fa2344c4b220bc9dc4d7
# good: [ea718c699055c8566eb64432388a04974c43b2ea] Revert "Revert "driver core: Set fw_devlink=on by default""
git bisect good ea718c699055c8566eb64432388a04974c43b2ea
# bad: [0341ce5443949588e93581b49b934cdde2befbf8] workqueue: Add resource managed version of delayed work init
git bisect bad 0341ce5443949588e93581b49b934cdde2befbf8
# bad: [0b8bf06f67191e6a3184802a690d3f521c6d7e78] device property: Sync descriptions of swnode array and group APIs
git bisect bad 0b8bf06f67191e6a3184802a690d3f521c6d7e78
# bad: [6579c8d97ad7fc5671ee60234f3b8388abee5f77] clk: Mark fwnodes when their clock provider is added
git bisect bad 6579c8d97ad7fc5671ee60234f3b8388abee5f77
# first bad commit: [6579c8d97ad7fc5671ee60234f3b8388abee5f77] clk: Mark fwnodes when their clock provider is added

  parent reply index

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210205222651eucas1p28ef87073dea33c1c5224c14aa203bec5@eucas1p2.samsung.com>
2021-02-05 22:26 ` [PATCH v4 0/8] Make fw_devlink=on more forgiving Saravana Kannan
2021-02-05 22:26   ` [PATCH v4 1/8] driver core: fw_devlink: Detect supplier devices that will never be added Saravana Kannan
2021-02-05 22:26   ` [PATCH v4 2/8] of: property: Don't add links to absent suppliers Saravana Kannan
2021-02-09 21:25     ` Rob Herring
2021-02-05 22:26   ` [PATCH v4 3/8] driver core: Add fw_devlink.strict kernel param Saravana Kannan
2021-02-05 22:26   ` [PATCH v4 4/8] of: property: Add fw_devlink support for optional properties Saravana Kannan
2021-02-09 21:33     ` Rob Herring
2021-02-09 21:54       ` Saravana Kannan
2021-02-10  8:25         ` Geert Uytterhoeven
2021-02-05 22:26   ` [PATCH v4 5/8] driver core: fw_devlink: Handle suppliers that don't use driver core Saravana Kannan
2021-02-05 22:26   ` [PATCH v4 6/8] irqdomain: Mark fwnodes when their irqdomain is added/removed Saravana Kannan
2021-02-05 22:26   ` [PATCH v4 7/8] PM: domains: Mark fwnodes when their powerdomain " Saravana Kannan
2021-02-05 22:26   ` [PATCH v4 8/8] clk: Mark fwnodes when their clock provider " Saravana Kannan
2021-02-08 15:38     ` Rob Herring
2021-02-08 23:34       ` Saravana Kannan
2021-02-10 11:44     ` [PATCH] clk: Mark fwnodes when their clock provider is added Tudor Ambarus
2021-02-10 11:44       ` Tudor Ambarus
2021-02-11 13:00         ` Greg KH
2021-02-13  0:37           ` Stephen Boyd
     [not found]         ` <CGME20210325133159eucas1p297b769beb681743fb32d362a86cc6e3e@eucas1p2.samsung.com>
2021-03-25 13:31           ` Marek Szyprowski
2021-03-25 15:47             ` Geert Uytterhoeven
2021-03-25 18:25             ` Nicolas Saenz Julienne
2021-03-26 18:13               ` Stephen Boyd
2021-03-26 18:29                 ` Geert Uytterhoeven
     [not found]                   ` <161705310317.3012082.15148238105608149214@swboyd.mtv.corp.google.com>
2021-03-29 23:28                     ` Saravana Kannan
     [not found]                       ` <161706920822.3012082.10047587064612237296@swboyd.mtv.corp.google.com>
2021-03-30  6:58                         ` Geert Uytterhoeven
     [not found]                           ` <161715734080.2260335.881350237641202575@swboyd.mtv.corp.google.com>
2021-03-31  7:05                             ` Geert Uytterhoeven
     [not found]                               ` <161721871083.2260335.2392646934517115770@swboyd.mtv.corp.google.com>
2021-04-05 11:04                                 ` Nicolas Saenz Julienne
2021-04-21  3:26         ` Guenter Roeck
2021-04-21  7:00           ` Saravana Kannan
2021-02-10 19:13       ` Saravana Kannan
2021-03-30 15:42       ` Guenter Roeck [this message]
2021-03-30 16:26         ` Saravana Kannan
     [not found]     ` <161317679292.1254594.15797939257637374295@swboyd.mtv.corp.google.com>
2021-02-14 21:15       ` [PATCH v4 8/8] clk: Mark fwnodes when their clock provider is added/removed Saravana Kannan
2021-02-06  2:45   ` [PATCH v4 0/8] Make fw_devlink=on more forgiving Saravana Kannan
2021-02-06 19:41   ` Geert Uytterhoeven
2021-02-06 20:47     ` Saravana Kannan
2021-02-08  8:40   ` Marek Szyprowski
2021-02-08 23:57     ` Saravana Kannan
2021-02-10  8:19   ` Tudor.Ambarus
2021-02-10  8:54     ` Saravana Kannan
2021-02-10 10:02       ` Tudor.Ambarus
2021-02-10 19:14         ` Saravana Kannan
2021-02-11 13:00   ` Geert Uytterhoeven
2021-02-11 13:05     ` Geert Uytterhoeven
2021-02-12  2:59     ` Saravana Kannan
2021-02-12  8:14       ` Geert Uytterhoeven
2021-02-12 20:57         ` Saravana Kannan
2021-02-15 12:38       ` Geert Uytterhoeven
2021-02-15 21:26         ` Saravana Kannan
2021-02-16  8:05           ` Geert Uytterhoeven
2021-02-16 18:48             ` Saravana Kannan
2021-02-16 20:31               ` Geert Uytterhoeven
2021-02-17 23:57                 ` Saravana Kannan
2021-02-25  9:21                   ` Geert Uytterhoeven
2021-02-15 15:16       ` Geert Uytterhoeven
2021-02-15 21:57         ` Saravana Kannan
2021-02-16 12:58           ` Geert Uytterhoeven
2021-02-15 11:19     ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210330154222.GA5411@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=claudiu.beznea@microchip.com \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-team@android.com \
    --cc=khilman@kernel.org \
    --cc=len.brown@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=maz@kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=pavel@ucw.cz \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=saravanak@google.com \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tudor.ambarus@microchip.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Doc Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-doc/0 linux-doc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-doc linux-doc/ https://lore.kernel.org/linux-doc \
		linux-doc@vger.kernel.org
	public-inbox-index linux-doc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-doc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git