mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mmc: print clock frequency with recognization
       [not found] <CGME20220705001814epcas1p40a4eadbf8429f01a98bdb56f00ba3310@epcas1p4.samsung.com>
@ 2022-07-05  0:50 ` Seunghui Lee
  2022-07-12  0:08   ` Seunghui Lee
  2022-07-12 10:51   ` Ulf Hansson
  0 siblings, 2 replies; 4+ messages in thread
From: Seunghui Lee @ 2022-07-05  0:50 UTC (permalink / raw)
  To: ulf.hansson, u.kleine-koenig, gregkh, linux, alexandre.belloni,
	linux-mmc, linux-kernel
  Cc: grant.jung, jt77.jang, dh0421.hwang, junwoo80.lee, jangsub.yi,
	cw9316.lee, sh8267.baek, wkon.kim, seunghwan.hyun, Seunghui Lee

It's easy to figure out how fast frequency it has from the log.
e.g. mmc0: new ultra high speed SDR104 SDXC card
at address aaaa(clk 202000000)

Signed-off-by: Seunghui Lee <sh043.lee@samsung.com>
---
 drivers/mmc/core/bus.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 58a60afa650b..3623cc27a61c 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -348,7 +348,7 @@ int mmc_add_card(struct mmc_card *card)
 			mmc_card_ddr52(card) ? "DDR " : "",
 			type);
 	} else {
-		pr_info("%s: new %s%s%s%s%s%s card at address %04x\n",
+		pr_info("%s: new %s%s%s%s%s%s card at address %04x(clk %u)\n",
 			mmc_hostname(card->host),
 			mmc_card_uhs(card) ? "ultra high speed " :
 			(mmc_card_hs(card) ? "high speed " : ""),
@@ -356,7 +356,8 @@ int mmc_add_card(struct mmc_card *card)
 			(mmc_card_hs200(card) ? "HS200 " : ""),
 			mmc_card_hs400es(card) ? "Enhanced strobe " : "",
 			mmc_card_ddr52(card) ? "DDR " : "",
-			uhs_bus_speed_mode, type, card->rca);
+			uhs_bus_speed_mode, type, card->rca,
+			card->host->ios.clock);
 	}
 
 #ifdef CONFIG_DEBUG_FS
-- 
2.29.0


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

* RE: [PATCH] mmc: print clock frequency with recognization
  2022-07-05  0:50 ` [PATCH] mmc: print clock frequency with recognization Seunghui Lee
@ 2022-07-12  0:08   ` Seunghui Lee
  2022-07-12 10:51   ` Ulf Hansson
  1 sibling, 0 replies; 4+ messages in thread
From: Seunghui Lee @ 2022-07-12  0:08 UTC (permalink / raw)
  To: ulf.hansson, u.kleine-koenig, gregkh, linux, alexandre.belloni,
	linux-mmc, linux-kernel
  Cc: grant.jung, jt77.jang, dh0421.hwang, junwoo80.lee, jangsub.yi,
	cw9316.lee, sh8267.baek, wkon.kim, seunghwan.hyun

> -----Original Message-----
> From: Seunghui Lee <sh043.lee@samsung.com>
> Sent: Tuesday, July 5, 2022 9:51 AM
> To: ulf.hansson@linaro.org; u.kleine-koenig@pengutronix.de;
> gregkh@linuxfoundation.org; linux@dominikbrodowski.net;
> alexandre.belloni@bootlin.com; linux-mmc@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Cc: grant.jung@samsung.com; jt77.jang@samsung.com;
> dh0421.hwang@samsung.com; junwoo80.lee@samsung.com; jangsub.yi@samsung.com;
> cw9316.lee@samsung.com; sh8267.baek@samsung.com; wkon.kim@samsung.com;
> seunghwan.hyun@samsung.com; Seunghui Lee <sh043.lee@samsung.com>
> Subject: [PATCH] mmc: print clock frequency with recognization
> 
> It's easy to figure out how fast frequency it has from the log.
> e.g. mmc0: new ultra high speed SDR104 SDXC card at address aaaa(clk
> 202000000)
> 
> Signed-off-by: Seunghui Lee <sh043.lee@samsung.com>
> ---
>  drivers/mmc/core/bus.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index
> 58a60afa650b..3623cc27a61c 100644
> --- a/drivers/mmc/core/bus.c
> +++ b/drivers/mmc/core/bus.c
> @@ -348,7 +348,7 @@ int mmc_add_card(struct mmc_card *card)
>  			mmc_card_ddr52(card) ? "DDR " : "",
>  			type);
>  	} else {
> -		pr_info("%s: new %s%s%s%s%s%s card at address %04x\n",
> +		pr_info("%s: new %s%s%s%s%s%s card at
> address %04x(clk %u)\n",
>  			mmc_hostname(card->host),
>  			mmc_card_uhs(card) ? "ultra high speed " :
>  			(mmc_card_hs(card) ? "high speed " : ""), @@ -356,7
> +356,8 @@ int mmc_add_card(struct mmc_card *card)
>  			(mmc_card_hs200(card) ? "HS200 " : ""),
>  			mmc_card_hs400es(card) ? "Enhanced strobe " : "",
>  			mmc_card_ddr52(card) ? "DDR " : "",
> -			uhs_bus_speed_mode, type, card->rca);
> +			uhs_bus_speed_mode, type, card->rca,
> +			card->host->ios.clock);
>  	}
> 
>  #ifdef CONFIG_DEBUG_FS
> --
> 2.29.0
Please give me any opinion or suggestion about this commit.
Normally, the SD card's bus speed depends on both host controller and internal PLL.
There are lots of host controller vendor in the market as well.
So, we can guess the exact clock speed from this commit.


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

* Re: [PATCH] mmc: print clock frequency with recognization
  2022-07-05  0:50 ` [PATCH] mmc: print clock frequency with recognization Seunghui Lee
  2022-07-12  0:08   ` Seunghui Lee
@ 2022-07-12 10:51   ` Ulf Hansson
  1 sibling, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2022-07-12 10:51 UTC (permalink / raw)
  To: Seunghui Lee
  Cc: u.kleine-koenig, gregkh, linux, alexandre.belloni, linux-mmc,
	linux-kernel, grant.jung, jt77.jang, dh0421.hwang, junwoo80.lee,
	jangsub.yi, cw9316.lee, sh8267.baek, wkon.kim, seunghwan.hyun

On Tue, 5 Jul 2022 at 02:18, Seunghui Lee <sh043.lee@samsung.com> wrote:
>
> It's easy to figure out how fast frequency it has from the log.
> e.g. mmc0: new ultra high speed SDR104 SDXC card
> at address aaaa(clk 202000000)

Well, this information is already available through debugfs and I
think that is sufficient.

Moreover, card->host->ios.clock doesn't necessarily contain that
actual clock rate, but rather the rate that is requested by the core.
To really know the rate the bus is running on,
card->host->ios.actual_clock needs to be checked too. This too is
available through debugfs.

Kind regards
Uffe

>
> Signed-off-by: Seunghui Lee <sh043.lee@samsung.com>
> ---
>  drivers/mmc/core/bus.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
> index 58a60afa650b..3623cc27a61c 100644
> --- a/drivers/mmc/core/bus.c
> +++ b/drivers/mmc/core/bus.c
> @@ -348,7 +348,7 @@ int mmc_add_card(struct mmc_card *card)
>                         mmc_card_ddr52(card) ? "DDR " : "",
>                         type);
>         } else {
> -               pr_info("%s: new %s%s%s%s%s%s card at address %04x\n",
> +               pr_info("%s: new %s%s%s%s%s%s card at address %04x(clk %u)\n",
>                         mmc_hostname(card->host),
>                         mmc_card_uhs(card) ? "ultra high speed " :
>                         (mmc_card_hs(card) ? "high speed " : ""),
> @@ -356,7 +356,8 @@ int mmc_add_card(struct mmc_card *card)
>                         (mmc_card_hs200(card) ? "HS200 " : ""),
>                         mmc_card_hs400es(card) ? "Enhanced strobe " : "",
>                         mmc_card_ddr52(card) ? "DDR " : "",
> -                       uhs_bus_speed_mode, type, card->rca);
> +                       uhs_bus_speed_mode, type, card->rca,
> +                       card->host->ios.clock);
>         }
>
>  #ifdef CONFIG_DEBUG_FS
> --
> 2.29.0
>

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

* [PATCH] mmc: print clock frequency with recognization
       [not found] <CGME20220705001710epcas1p40c6411bd768b39a9cff1d6ce09d445dd@epcas1p4.samsung.com>
@ 2022-07-05  0:49 ` Seunghui Lee
  0 siblings, 0 replies; 4+ messages in thread
From: Seunghui Lee @ 2022-07-05  0:49 UTC (permalink / raw)
  To: ult.hansson, u.kleine-koenig, gregkh, linux, alexandre.belloni,
	linux-mmc, linux-kernel
  Cc: grant.jung, jt77.jang, dh0421.hwang, junwoo80.lee, jangsub.yi,
	cw9316.lee, sh8267.baek, wkon.kim, seunghwan.hyun, Seunghui Lee

It's easy to figure out how fast frequency it has from the log.
e.g. mmc0: new ultra high speed SDR104 SDXC card
at address aaaa(clk 202000000)

Signed-off-by: Seunghui Lee <sh043.lee@samsung.com>
---
 drivers/mmc/core/bus.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 58a60afa650b..3623cc27a61c 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -348,7 +348,7 @@ int mmc_add_card(struct mmc_card *card)
 			mmc_card_ddr52(card) ? "DDR " : "",
 			type);
 	} else {
-		pr_info("%s: new %s%s%s%s%s%s card at address %04x\n",
+		pr_info("%s: new %s%s%s%s%s%s card at address %04x(clk %u)\n",
 			mmc_hostname(card->host),
 			mmc_card_uhs(card) ? "ultra high speed " :
 			(mmc_card_hs(card) ? "high speed " : ""),
@@ -356,7 +356,8 @@ int mmc_add_card(struct mmc_card *card)
 			(mmc_card_hs200(card) ? "HS200 " : ""),
 			mmc_card_hs400es(card) ? "Enhanced strobe " : "",
 			mmc_card_ddr52(card) ? "DDR " : "",
-			uhs_bus_speed_mode, type, card->rca);
+			uhs_bus_speed_mode, type, card->rca,
+			card->host->ios.clock);
 	}
 
 #ifdef CONFIG_DEBUG_FS
-- 
2.29.0


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

end of thread, other threads:[~2022-07-12 10:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20220705001814epcas1p40a4eadbf8429f01a98bdb56f00ba3310@epcas1p4.samsung.com>
2022-07-05  0:50 ` [PATCH] mmc: print clock frequency with recognization Seunghui Lee
2022-07-12  0:08   ` Seunghui Lee
2022-07-12 10:51   ` Ulf Hansson
     [not found] <CGME20220705001710epcas1p40c6411bd768b39a9cff1d6ce09d445dd@epcas1p4.samsung.com>
2022-07-05  0:49 ` Seunghui Lee

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®