public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/3] mmc: dw_mmc-k3: before set biu_clk rate, check biu_clk available or not
       [not found] <CGME20260123085150epcas5p42f2cc04843ae7657380b2968261246cb@epcas5p4.samsung.com>
@ 2026-02-26  9:09 ` ping.gao
  2026-02-26  9:10 ` [PATCH v3 2/3] mmc: dw_mmc: Using devm_clk_get_optional() for biu_clk ping.gao
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: ping.gao @ 2026-02-26  9:09 UTC (permalink / raw)
  To: shawn.lin, ulf.hansson, jh80.chung, krzk+dt, conor+dt, robh
  Cc: linux-mmc, linux-kernel, devicetree, hy50.seo, kwangwon.min,
	ping.gao

If biu_clk is not available, no need to try to set and get
rate of it, just bail out and print a warning

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

diff --git a/drivers/mmc/host/dw_mmc-k3.c b/drivers/mmc/host/dw_mmc-k3.c
index ad6aa1aea549..ccb6bfe3e0ce 100644
--- a/drivers/mmc/host/dw_mmc-k3.c
+++ b/drivers/mmc/host/dw_mmc-k3.c
@@ -190,6 +190,11 @@ static void dw_mci_hi6220_set_ios(struct dw_mci *host, struct mmc_ios *ios)
 	int ret;
 	unsigned int clock;
 
+	if (IS_ERR_OR_NULL(host->biu_clk)) {
+		dev_err(host->dev, "biu_clk not available\n");
+		return;
+	}
+
 	clock = (ios->clock <= 25000000) ? 25000000 : ios->clock;
 
 	ret = clk_set_rate(host->biu_clk, clock);
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 2/3] mmc: dw_mmc: Using devm_clk_get_optional() for biu_clk
       [not found] <CGME20260123085150epcas5p42f2cc04843ae7657380b2968261246cb@epcas5p4.samsung.com>
  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
  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-28  3:13 ` ping.gao
  3 siblings, 0 replies; 9+ messages in thread
From: ping.gao @ 2026-02-26  9:10 UTC (permalink / raw)
  To: shawn.lin, ulf.hansson, jh80.chung, krzk+dt, conor+dt, robh
  Cc: linux-mmc, linux-kernel, devicetree, hy50.seo, kwangwon.min,
	ping.gao

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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 3/3] dt-bindings: mmc: synopsys-dw-mshc: No need to enforce setting two clocks
       [not found] <CGME20260123085150epcas5p42f2cc04843ae7657380b2968261246cb@epcas5p4.samsung.com>
  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 ` [PATCH v3 2/3] mmc: dw_mmc: Using devm_clk_get_optional() for biu_clk ping.gao
@ 2026-02-26  9:10 ` ping.gao
  2026-02-27  7:50   ` Krzysztof Kozlowski
  2026-02-27  7:51   ` Krzysztof Kozlowski
  2026-02-28  3:13 ` ping.gao
  3 siblings, 2 replies; 9+ messages in thread
From: ping.gao @ 2026-02-26  9:10 UTC (permalink / raw)
  To: shawn.lin, ulf.hansson, jh80.chung, krzk+dt, conor+dt, robh
  Cc: linux-mmc, linux-kernel, devicetree, hy50.seo, kwangwon.min,
	ping.gao

The driver `dw_mmc.c` now treats the biu clock as optional, so the
binding can be relaxed to allow a single clock.
Signed-off-by: ping.gao <ping.gao@samsung.com>
---
 Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.yaml b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.yaml
index a6292777e376..7a02fb6f585b 100644
--- a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.yaml
+++ b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.yaml
@@ -24,11 +24,12 @@ properties:
     maxItems: 1
 
   clocks:
-    minItems: 2
+    minItems: 1
     maxItems: 2
     description:
       Handle to "biu" and "ciu" clocks for the
       bus interface unit clock and the card interface unit clock.
+      If only one clock is present it must be "ciu" clock.
 
   clock-names:
     items:
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 3/3] dt-bindings: mmc: synopsys-dw-mshc: No need to enforce setting two clocks
  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
  1 sibling, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-27  7:50 UTC (permalink / raw)
  To: ping.gao
  Cc: shawn.lin, ulf.hansson, jh80.chung, krzk+dt, conor+dt, robh,
	linux-mmc, linux-kernel, devicetree, hy50.seo, kwangwon.min

On Thu, Feb 26, 2026 at 05:10:51PM +0800, ping.gao wrote:
> The driver `dw_mmc.c` now treats the biu clock as optional, so the
> binding can be relaxed to allow a single clock.

Not sufficient, bring also arguments in terms of hardware. If the
hardware needs biu, then this is wrong.

Missing blank line.

> Signed-off-by: ping.gao <ping.gao@samsung.com>

Are you sure your name includes "." or you just use login as name?

> ---
>  Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.yaml | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.yaml b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.yaml
> index a6292777e376..7a02fb6f585b 100644
> --- a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.yaml
> +++ b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.yaml
> @@ -24,11 +24,12 @@ properties:
>      maxItems: 1
>  
>    clocks:
> -    minItems: 2
> +    minItems: 1
>      maxItems: 2
>      description:
>        Handle to "biu" and "ciu" clocks for the
>        bus interface unit clock and the card interface unit clock.
> +      If only one clock is present it must be "ciu" clock.

Drop, don't repeat the schema.

>  
>    clock-names:
>      items:

De-synced with clock-names, so not really tested.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 3/3] dt-bindings: mmc: synopsys-dw-mshc: No need to enforce setting two clocks
  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:51   ` Krzysztof Kozlowski
  2026-02-27  7:53     ` Krzysztof Kozlowski
  1 sibling, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-27  7:51 UTC (permalink / raw)
  To: ping.gao
  Cc: shawn.lin, ulf.hansson, jh80.chung, krzk+dt, conor+dt, robh,
	linux-mmc, linux-kernel, devicetree, hy50.seo, kwangwon.min

On Thu, Feb 26, 2026 at 05:10:51PM +0800, ping.gao wrote:
> The driver `dw_mmc.c` now treats the biu clock as optional, so the
> binding can be relaxed to allow a single clock.
> Signed-off-by: ping.gao <ping.gao@samsung.com>
> ---
>  Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.yaml | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

What is this mess in threading? I see here bunch of 15 emails all mixed
up?

Do not attach (thread) your patchsets to some other threads (unrelated
or older versions). This buries them deep in the mailbox and might
interfere with applying entire sets. See also:
https://elixir.bootlin.com/linux/v6.16-rc2/source/Documentation/process/submitting-patches.rst#L830

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 3/3] dt-bindings: mmc: synopsys-dw-mshc: No need to enforce setting two clocks
  2026-02-27  7:50   ` Krzysztof Kozlowski
@ 2026-02-27  7:52     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-27  7:52 UTC (permalink / raw)
  To: ping.gao
  Cc: shawn.lin, ulf.hansson, jh80.chung, krzk+dt, conor+dt, robh,
	linux-mmc, linux-kernel, devicetree, hy50.seo, kwangwon.min

On 27/02/2026 08:50, Krzysztof Kozlowski wrote:
> On Thu, Feb 26, 2026 at 05:10:51PM +0800, ping.gao wrote:
>> The driver `dw_mmc.c` now treats the biu clock as optional, so the
>> binding can be relaxed to allow a single clock.
> 
> Not sufficient, bring also arguments in terms of hardware. If the
> hardware needs biu, then this is wrong.
> 
> Missing blank line.
> 
>> Signed-off-by: ping.gao <ping.gao@samsung.com>
> 
> Are you sure your name includes "." or you just use login as name?


And I already asked you this, so you completely ignored me!

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 3/3] dt-bindings: mmc: synopsys-dw-mshc: No need to enforce setting two clocks
  2026-02-27  7:51   ` Krzysztof Kozlowski
@ 2026-02-27  7:53     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-27  7:53 UTC (permalink / raw)
  To: ping.gao
  Cc: shawn.lin, ulf.hansson, jh80.chung, krzk+dt, conor+dt, robh,
	linux-mmc, linux-kernel, devicetree, hy50.seo, kwangwon.min

On 27/02/2026 08:51, Krzysztof Kozlowski wrote:
> On Thu, Feb 26, 2026 at 05:10:51PM +0800, ping.gao wrote:
>> The driver `dw_mmc.c` now treats the biu clock as optional, so the
>> binding can be relaxed to allow a single clock.
>> Signed-off-by: ping.gao <ping.gao@samsung.com>
>> ---
>>  Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.yaml | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> What is this mess in threading? I see here bunch of 15 emails all mixed
> up?
> 
> Do not attach (thread) your patchsets to some other threads (unrelated
> or older versions). This buries them deep in the mailbox and might
> interfere with applying entire sets. See also:
> https://elixir.bootlin.com/linux/v6.16-rc2/source/Documentation/process/submitting-patches.rst#L830

Plus I found now that you ALREADY sent v3, so you made complete mess in
duplicate and wrongly attached postings.

Slow down and re-think what are you doing.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 3/3] dt-bindings: mmc: synopsys-dw-mshc: No need to enforce setting two clocks
       [not found] <CGME20260123085150epcas5p42f2cc04843ae7657380b2968261246cb@epcas5p4.samsung.com>
                   ` (2 preceding siblings ...)
  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-28  3:13 ` ping.gao
  2026-02-28  9:46   ` Krzysztof Kozlowski
  3 siblings, 1 reply; 9+ messages in thread
From: ping.gao @ 2026-02-28  3:13 UTC (permalink / raw)
  To: krzk
  Cc: shawn.lin, ulf.hansson, krzk+dt, conor+dt, robh, jh80.chung,
	linux-mmc, linux-kernel, devicetree, hy50.seo, kwangwon.min,
	ping.gao

Hi Krzysztof,

My apologies for the messy threading and duplicate postings. I had a
misconfiguration in my mail client settings.

I will slow down, re-evaluate the hardware requirements, fix the YAML
schema synchronization, and send a clean v4 as a brand-new thread.

Best regards,
Ping Gao

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 3/3] dt-bindings: mmc: synopsys-dw-mshc: No need to enforce setting two clocks
  2026-02-28  3:13 ` ping.gao
@ 2026-02-28  9:46   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-28  9:46 UTC (permalink / raw)
  To: ping.gao
  Cc: shawn.lin, ulf.hansson, krzk+dt, conor+dt, robh, jh80.chung,
	linux-mmc, linux-kernel, devicetree, hy50.seo, kwangwon.min

On 28/02/2026 04:13, ping.gao wrote:
> Hi Krzysztof,
> 
> My apologies for the messy threading and duplicate postings. I had a
> misconfiguration in my mail client settings.
> 
> I will slow down, re-evaluate the hardware requirements, fix the YAML
> schema synchronization, and send a clean v4 as a brand-new thread.

Respond inline - I have no clue which feedback you do address and which
one you decide to ignore. Judging by v4 you still ignore some.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-02-28  9:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20260123085150epcas5p42f2cc04843ae7657380b2968261246cb@epcas5p4.samsung.com>
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 ` [PATCH v3 2/3] mmc: dw_mmc: Using devm_clk_get_optional() for biu_clk ping.gao
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox