From: Stephen Boyd <sboyd@kernel.org>
To: Brian Masney <bmasney@redhat.com>, ping.gao <ping.gao@samsung.com>
Cc: mturquette@baylibre.com, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org, hy50.seo@samsung.com,
kwangwon.min@samsung.com
Subject: Re: [PATCH] drivers: clk: keystone: Fix parameter judgment in clk_prepare
Date: Thu, 22 Jan 2026 19:08:48 -0700 [thread overview]
Message-ID: <176913412868.4027.13825615091172956270@lazor> (raw)
In-Reply-To: <aXKzYgVBLnYgwZ27@redhat.com>
Quoting Brian Masney (2026-01-22 16:31:46)
>
> Just to help Stephen: It looks like this is what ultimately causes the
> problem:
>
> dw_mci_probe() in drivers/mmc/host/dw_mmc.c sets up host->ciu_clk, and
> if an error is returned by devm_clk_get(), it leaves the error pointer in
> host->ciu_clk, and the probe continues normally. Later
> dw_mci_runtime_resume() calls clk_prepare_enable() on host->ciu_clk with
> the error pointer.
>
> Additionally, clk_unprepare() already has this IS_ERR_OR_NULL() check.
>
> Stephen: Do you think that clk_enable() should also be updated as well?
> I see that clk_disable() also has the IS_ERR_OR_NULL() check.
No. We ignore error pointers in the disable and unprepare case to
simplify error paths, see commit 63589e92c2d9 ("clk: Ignore error and
NULL pointers passed to clk_{unprepare, disable}()"). With the usage of
devm though I'm not sure that error paths are a real thing anymore, but
it's nice to let drivers have one goto label instead of a million
different ones if they're not using devm.
Not ignoring error pointers in the enable and prepare path is
intentional. Fix the driver.
next prev parent reply other threads:[~2026-01-23 2:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20260122100703epcas5p13f4647a5e62546abc3021383134e824a@epcas5p1.samsung.com>
2026-01-22 10:11 ` ping.gao
2026-01-22 23:31 ` Brian Masney
2026-01-23 2:08 ` Stephen Boyd [this message]
[not found] <CGME20260121070041epcas5p4687d60f28911c7e97497a80adb87232c@epcas5p4.samsung.com>
2026-01-21 7:05 ` ping.gao
2026-01-22 17:56 ` Ulf Hansson
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=176913412868.4027.13825615091172956270@lazor \
--to=sboyd@kernel.org \
--cc=bmasney@redhat.com \
--cc=hy50.seo@samsung.com \
--cc=kwangwon.min@samsung.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=ping.gao@samsung.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®