public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: "ping.gao" <ping.gao@samsung.com>
To: shawn.lin@rock-chips.com, ulf.hansson@linaro.org,
	jh80.chung@samsung.com, krzk+dt@kernel.org, conor+dt@kernel.org,
	robh@kernel.org
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, hy50.seo@samsung.com,
	kwangwon.min@samsung.com, ping.gao@samsung.com
Subject: [PATCH v3 2/3] mmc: dw_mmc: Using devm_clk_get_optional() for biu_clk
Date: Thu, 26 Feb 2026 17:10:27 +0800	[thread overview]
Message-ID: <20260226091027.300564-1-ping.gao@samsung.com> (raw)
In-Reply-To: <CGME20260123085150epcas5p42f2cc04843ae7657380b2968261246cb@epcas5p4.samsung.com>

By using devm_clk_get_optional, if clk is optional for device and not define in dts
it will return NULL, then clk_prepare_enable/clk_disable_unprepare for biu_clk is safe to
bail out internally.

before biu_clk in dwmmc driver devm_clk_get fail, but it's ERR_PTR,
not null,it will panic when call clk_prepare
log is below:
[7:   binder:436_2: 4998] Unable to handle kernel paging request at virtual address fffffffffffffffe
[7:   binder:436_2: 4998] Mem abort info:
[7:   binder:436_2: 4998]   ESR = 0x0000000096000005
[7:   binder:436_2: 4998]   EC = 0x25: DABT (current EL), IL = 32 bits
[7:   binder:436_2: 4998]   SET = 0, FnV = 0
[7:   binder:436_2: 4998]   EA = 0, S1PTW = 0
[7:   binder:436_2: 4998]   FSC = 0x05: level 1 translation fault
...
[7:   binder:436_2: 4998] Call trace:
[7:   binder:436_2: 4998]  clk_prepare+0x10/0x24
[7:   binder:436_2: 4998]  dw_mci_runtime_resume+0x50/0x2d8 [dw_mmc_samsung cd210e210975263404c28fc89778f369f8398f0c]
[7:   binder:436_2: 4998]  dw_mci_exynos_runtime_resume+0x18/0x58 [dw_mmc_exynos_samsung 2735a594c7c9c9e8c65b0b87523fbf70dcaabfff]
[7:   binder:436_2: 4998]  pm_generic_runtime_resume+0x40/0x58
[7:   binder:436_2: 4998]  pm_runtime_force_resume+0x9c/0x134
[7:   binder:436_2: 4998]  platform_pm_resume+0x40/0x8c
[7:   binder:436_2: 4998]  dpm_run_callback+0x64/0x230
[7:   binder:436_2: 4998]  __device_resume+0x1d8/0x394
[7:   binder:436_2: 4998]  dpm_resume+0x110/0x2b8
[7:   binder:436_2: 4998]  dpm_resume_end+0x1c/0x38
[7:   binder:436_2: 4998]  suspend_devices_and_enter+0x828/0xab0
[7:   binder:436_2: 4998]  pm_suspend+0x334/0x618
[7:   binder:436_2: 4998]  state_store+0x104/0x144
[7:   binder:436_2: 4998]  kobj_attr_store+0x30/0x48
[7:   binder:436_2: 4998]  sysfs_kf_write+0x54/0x6c
[7:   binder:436_2: 4998]  kernfs_fop_write_iter+0x104/0x1a8
[7:   binder:436_2: 4998]  vfs_write+0x24c/0x2f4
[7:   binder:436_2: 4998]  ksys_write+0x78/0xe8
[7:   binder:436_2: 4998]  __arm64_sys_write+0x1c/0x2c
[7:   binder:436_2: 4998]  invoke_syscall+0x58/0x114
[7:   binder:436_2: 4998]  el0_svc_common+0xac/0xe0
[7:   binder:436_2: 4998]  do_el0_svc+0x1c/0x28
[7:   binder:436_2: 4998]  el0_svc+0x38/0x68
[7:   binder:436_2: 4998]  el0t_64_sync_handler+0x68/0xbc
[7:   binder:436_2: 4998]  el0t_64_sync+0x1a8/0x1ac

Signed-off-by: ping.gao <ping.gao@samsung.com>
---
 drivers/mmc/host/dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index c5db92bbb094..6bcc1e7233c0 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -3375,7 +3375,7 @@ int dw_mci_probe(struct dw_mci *host)
 					     "platform data not available\n");
 	}
 
-	host->biu_clk = devm_clk_get(host->dev, "biu");
+	host->biu_clk = devm_clk_get_optional(host->dev, "biu");
 	if (IS_ERR(host->biu_clk)) {
 		dev_dbg(host->dev, "biu clock not available\n");
 		ret = PTR_ERR(host->biu_clk);
-- 
2.50.1


  parent reply	other threads:[~2026-02-26  9:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260123085150epcas5p42f2cc04843ae7657380b2968261246cb@epcas5p4.samsung.com>
2026-01-23  8:56 ` [PATCH] drivers: dw_mmc: Replace devm_clk_get with devm_clk_get_optional ping.gao
2026-01-23  9:46   ` Ulf Hansson
2026-02-11  9:56   ` Shawn Lin
2026-02-11  8:18 ` ping.gao
2026-02-12 10:36 ` ping.gao
2026-02-12 10:45   ` Shawn Lin
2026-02-13  3:08 ` [PATCH v2 1/3] mmc: dw_mmc: Using devm_clk_get_optional() for biu_clk ping.gao
2026-02-13  3:24   ` Shawn Lin
2026-02-13  3:08 ` [PATCH v2 2/3] mmc: dw_mmc-k3: before set biu_clk rate, check biu_clk available or not ping.gao
2026-02-13  3:30   ` Shawn Lin
2026-02-13  3:09 ` [PATCH v2 3/3] dt-bindings: mmc: synopsys-dw-mshc: clk is not a must of two ping.gao
2026-02-13  3:14   ` Shawn Lin
2026-02-13  7:37   ` Krzysztof Kozlowski
2026-02-13  5:34 ` [PATCH v3 1/3] dt-bindings: mmc: synopsys-dw-mshc: No need to enforce setting two clocks ping.gao
2026-02-13  7:37   ` Krzysztof Kozlowski
2026-02-13  5:34 ` [PATCH v3 2/3] mmc: dw_mmc-k3: before set biu_clk rate, check biu_clk available or not ping.gao
2026-02-13  5:34 ` [PATCH v3 3/3] mmc: dw_mmc: Using devm_clk_get_optional() for biu_clk ping.gao
2026-02-26  9:09 ` [PATCH v3 1/3] mmc: dw_mmc-k3: before set biu_clk rate, check biu_clk available or not ping.gao
2026-02-26  9:10 ` ping.gao [this message]
2026-02-26  9:10 ` [PATCH v3 3/3] dt-bindings: mmc: synopsys-dw-mshc: No need to enforce setting two clocks ping.gao
2026-02-27  7:50   ` Krzysztof Kozlowski
2026-02-27  7:52     ` Krzysztof Kozlowski
2026-02-27  7:51   ` Krzysztof Kozlowski
2026-02-27  7:53     ` Krzysztof Kozlowski
2026-02-28  3:13 ` ping.gao
2026-02-28  9:46   ` Krzysztof Kozlowski

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=20260226091027.300564-1-ping.gao@samsung.com \
    --to=ping.gao@samsung.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hy50.seo@samsung.com \
    --cc=jh80.chung@samsung.com \
    --cc=krzk+dt@kernel.org \
    --cc=kwangwon.min@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=shawn.lin@rock-chips.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
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