linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] mmc-utils: add SanDisk to manufacturer database
@ 2023-05-22 21:48 Enrico Jorns
  2023-05-22 21:48 ` [PATCH 2/3] mmc-utils: fix printing OID for mmc in non-verbose mode Enrico Jorns
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Enrico Jorns @ 2023-05-22 21:48 UTC (permalink / raw)
  To: linux-mmc; +Cc: Avri Altman, Ulf Hansson, ejo

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
---
 lsmmc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lsmmc.c b/lsmmc.c
index 55da3aa..da9d69e 100644
--- a/lsmmc.c
+++ b/lsmmc.c
@@ -239,6 +239,11 @@ struct ids_database database[] = {
 		.id = 0x44,
 		.manufacturer = "ATP",
 	},
+	{
+		.type = "mmc",
+		.id = 0x45,
+		.manufacturer = "SanDisk Corporation",
+	},
 	{
 		.type = "mmc",
 		.id = 0x2c,
-- 
2.39.2


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

* [PATCH 2/3] mmc-utils: fix printing OID for mmc in non-verbose mode
  2023-05-22 21:48 [PATCH 1/3] mmc-utils: add SanDisk to manufacturer database Enrico Jorns
@ 2023-05-22 21:48 ` Enrico Jorns
  2023-05-24  6:45   ` Avri Altman
  2023-05-24 15:15   ` Ulf Hansson
  2023-05-22 21:48 ` [PATCH 3/3] mmc-utils: do not hide CID manufacturer information Enrico Jorns
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 9+ messages in thread
From: Enrico Jorns @ 2023-05-22 21:48 UTC (permalink / raw)
  To: linux-mmc; +Cc: Avri Altman, Ulf Hansson, ejo

It is parsed as an integer and printed as a char which does not really
make sense.
E.g. if OID is '0' (which does not seem to be uncommon), then this
prints a '\0' character and makes output nearly unreadable/unparsable.

Also, do not print it like it would be a string, instead use 0x<digit>
format.

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
---
 lsmmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lsmmc.c b/lsmmc.c
index da9d69e..cea43af 100644
--- a/lsmmc.c
+++ b/lsmmc.c
@@ -636,10 +636,10 @@ void print_mmc_cid(struct config *config, char *cid)
 		printf("\tCRC: 0x%02x\n", crc);
 	} else {
 		if (config->mmc_ids[mid])
-			printf("manufacturer: '%s' '%c'\n",
+			printf("manufacturer: '%s' 0x%01x\n",
 			       config->mmc_ids[mid], oid);
 		else
-			printf("manufacturer: 'Unlisted' '%c'\n", oid);
+			printf("manufacturer: 'Unlisted' 0x%01x\n", oid);
 
 		printf("product: '%s' %u.%u\n", pnm, prv_major, prv_minor);
 		printf("serial: 0x%08x\n", psn);
-- 
2.39.2


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

* [PATCH 3/3] mmc-utils: do not hide CID manufacturer information
  2023-05-22 21:48 [PATCH 1/3] mmc-utils: add SanDisk to manufacturer database Enrico Jorns
  2023-05-22 21:48 ` [PATCH 2/3] mmc-utils: fix printing OID for mmc in non-verbose mode Enrico Jorns
@ 2023-05-22 21:48 ` Enrico Jorns
  2023-05-24  6:48   ` Avri Altman
  2023-05-24 15:15   ` Ulf Hansson
  2023-05-24  6:41 ` [PATCH 1/3] mmc-utils: add SanDisk to manufacturer database Avri Altman
  2023-05-24 15:15 ` Ulf Hansson
  3 siblings, 2 replies; 9+ messages in thread
From: Enrico Jorns @ 2023-05-22 21:48 UTC (permalink / raw)
  To: linux-mmc; +Cc: Avri Altman, Ulf Hansson, ejo

Reading the MID just to convert it to 'Unlisted' is quite unhelpful for
an info command.
Due to the (constantly increasing) amount of valid MIDs it is quite
unlikely to we have it in the database already anyway.

Thus simply always print the manufacturer ID as 0xNN and understand the
manufacturer name as an additional information held in parenthesis.

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
---
 lsmmc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lsmmc.c b/lsmmc.c
index cea43af..54c3167 100644
--- a/lsmmc.c
+++ b/lsmmc.c
@@ -636,10 +636,10 @@ void print_mmc_cid(struct config *config, char *cid)
 		printf("\tCRC: 0x%02x\n", crc);
 	} else {
 		if (config->mmc_ids[mid])
-			printf("manufacturer: '%s' 0x%01x\n",
-			       config->mmc_ids[mid], oid);
+			printf("manufacturer: 0x%02x (%s) oid: 0x%01x\n",
+			       mid, config->mmc_ids[mid], oid);
 		else
-			printf("manufacturer: 'Unlisted' 0x%01x\n", oid);
+			printf("manufacturer: 0x%02x (Unlisted) oid: 0x%01x\n", mid, oid);
 
 		printf("product: '%s' %u.%u\n", pnm, prv_major, prv_minor);
 		printf("serial: 0x%08x\n", psn);
-- 
2.39.2


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

* RE: [PATCH 1/3] mmc-utils: add SanDisk to manufacturer database
  2023-05-22 21:48 [PATCH 1/3] mmc-utils: add SanDisk to manufacturer database Enrico Jorns
  2023-05-22 21:48 ` [PATCH 2/3] mmc-utils: fix printing OID for mmc in non-verbose mode Enrico Jorns
  2023-05-22 21:48 ` [PATCH 3/3] mmc-utils: do not hide CID manufacturer information Enrico Jorns
@ 2023-05-24  6:41 ` Avri Altman
  2023-05-24 15:15 ` Ulf Hansson
  3 siblings, 0 replies; 9+ messages in thread
From: Avri Altman @ 2023-05-24  6:41 UTC (permalink / raw)
  To: Enrico Jorns, linux-mmc; +Cc: Ulf Hansson

> 
> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Acked-by: Avri Altman <avri.altman@wdc.com>

> ---
>  lsmmc.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/lsmmc.c b/lsmmc.c
> index 55da3aa..da9d69e 100644
> --- a/lsmmc.c
> +++ b/lsmmc.c
> @@ -239,6 +239,11 @@ struct ids_database database[] = {
>                 .id = 0x44,
>                 .manufacturer = "ATP",
>         },
> +       {
> +               .type = "mmc",
> +               .id = 0x45,
> +               .manufacturer = "SanDisk Corporation",
> +       },
>         {
>                 .type = "mmc",
>                 .id = 0x2c,
> --
> 2.39.2


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

* RE: [PATCH 2/3] mmc-utils: fix printing OID for mmc in non-verbose mode
  2023-05-22 21:48 ` [PATCH 2/3] mmc-utils: fix printing OID for mmc in non-verbose mode Enrico Jorns
@ 2023-05-24  6:45   ` Avri Altman
  2023-05-24 15:15   ` Ulf Hansson
  1 sibling, 0 replies; 9+ messages in thread
From: Avri Altman @ 2023-05-24  6:45 UTC (permalink / raw)
  To: Enrico Jorns, linux-mmc; +Cc: Ulf Hansson

> 
> It is parsed as an integer and printed as a char which does not really
> make sense.
> E.g. if OID is '0' (which does not seem to be uncommon), then this
> prints a '\0' character and makes output nearly unreadable/unparsable.
> 
> Also, do not print it like it would be a string, instead use 0x<digit>
> format.
> 
> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Reviewed-by: Avri Altman <avri.altman@wdc.com>

> ---
>  lsmmc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lsmmc.c b/lsmmc.c
> index da9d69e..cea43af 100644
> --- a/lsmmc.c
> +++ b/lsmmc.c
> @@ -636,10 +636,10 @@ void print_mmc_cid(struct config *config, char *cid)
>                 printf("\tCRC: 0x%02x\n", crc);
>         } else {
>                 if (config->mmc_ids[mid])
> -                       printf("manufacturer: '%s' '%c'\n",
> +                       printf("manufacturer: '%s' 0x%01x\n",
>                                config->mmc_ids[mid], oid);
>                 else
> -                       printf("manufacturer: 'Unlisted' '%c'\n", oid);
> +                       printf("manufacturer: 'Unlisted' 0x%01x\n", oid);
> 
>                 printf("product: '%s' %u.%u\n", pnm, prv_major, prv_minor);
>                 printf("serial: 0x%08x\n", psn);
> --
> 2.39.2


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

* RE: [PATCH 3/3] mmc-utils: do not hide CID manufacturer information
  2023-05-22 21:48 ` [PATCH 3/3] mmc-utils: do not hide CID manufacturer information Enrico Jorns
@ 2023-05-24  6:48   ` Avri Altman
  2023-05-24 15:15   ` Ulf Hansson
  1 sibling, 0 replies; 9+ messages in thread
From: Avri Altman @ 2023-05-24  6:48 UTC (permalink / raw)
  To: Enrico Jorns, linux-mmc; +Cc: Ulf Hansson

> Reading the MID just to convert it to 'Unlisted' is quite unhelpful for an info
> command.
> Due to the (constantly increasing) amount of valid MIDs it is quite unlikely to
> we have it in the database already anyway.
> 
> Thus simply always print the manufacturer ID as 0xNN and understand the
> manufacturer name as an additional information held in parenthesis.
> 
> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Reviewed-by: Avri Altman <avri.altman@wdc.com>

> ---
>  lsmmc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/lsmmc.c b/lsmmc.c
> index cea43af..54c3167 100644
> --- a/lsmmc.c
> +++ b/lsmmc.c
> @@ -636,10 +636,10 @@ void print_mmc_cid(struct config *config, char *cid)
>                 printf("\tCRC: 0x%02x\n", crc);
>         } else {
>                 if (config->mmc_ids[mid])
> -                       printf("manufacturer: '%s' 0x%01x\n",
> -                              config->mmc_ids[mid], oid);
> +                       printf("manufacturer: 0x%02x (%s) oid: 0x%01x\n",
> +                              mid, config->mmc_ids[mid], oid);
>                 else
> -                       printf("manufacturer: 'Unlisted' 0x%01x\n", oid);
> +                       printf("manufacturer: 0x%02x (Unlisted) oid:
> + 0x%01x\n", mid, oid);
> 
>                 printf("product: '%s' %u.%u\n", pnm, prv_major, prv_minor);
>                 printf("serial: 0x%08x\n", psn);
> --
> 2.39.2


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

* Re: [PATCH 1/3] mmc-utils: add SanDisk to manufacturer database
  2023-05-22 21:48 [PATCH 1/3] mmc-utils: add SanDisk to manufacturer database Enrico Jorns
                   ` (2 preceding siblings ...)
  2023-05-24  6:41 ` [PATCH 1/3] mmc-utils: add SanDisk to manufacturer database Avri Altman
@ 2023-05-24 15:15 ` Ulf Hansson
  3 siblings, 0 replies; 9+ messages in thread
From: Ulf Hansson @ 2023-05-24 15:15 UTC (permalink / raw)
  To: Enrico Jorns; +Cc: linux-mmc, Avri Altman

On Mon, 22 May 2023 at 23:49, Enrico Jorns <ejo@pengutronix.de> wrote:
>
> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>

Applied to git.kernel.org/pub/scm/utils/mmc/mmc-utils.git master, thanks!

Kind regards
Uffe


> ---
>  lsmmc.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/lsmmc.c b/lsmmc.c
> index 55da3aa..da9d69e 100644
> --- a/lsmmc.c
> +++ b/lsmmc.c
> @@ -239,6 +239,11 @@ struct ids_database database[] = {
>                 .id = 0x44,
>                 .manufacturer = "ATP",
>         },
> +       {
> +               .type = "mmc",
> +               .id = 0x45,
> +               .manufacturer = "SanDisk Corporation",
> +       },
>         {
>                 .type = "mmc",
>                 .id = 0x2c,
> --
> 2.39.2
>

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

* Re: [PATCH 2/3] mmc-utils: fix printing OID for mmc in non-verbose mode
  2023-05-22 21:48 ` [PATCH 2/3] mmc-utils: fix printing OID for mmc in non-verbose mode Enrico Jorns
  2023-05-24  6:45   ` Avri Altman
@ 2023-05-24 15:15   ` Ulf Hansson
  1 sibling, 0 replies; 9+ messages in thread
From: Ulf Hansson @ 2023-05-24 15:15 UTC (permalink / raw)
  To: Enrico Jorns; +Cc: linux-mmc, Avri Altman

On Mon, 22 May 2023 at 23:49, Enrico Jorns <ejo@pengutronix.de> wrote:
>
> It is parsed as an integer and printed as a char which does not really
> make sense.
> E.g. if OID is '0' (which does not seem to be uncommon), then this
> prints a '\0' character and makes output nearly unreadable/unparsable.
>
> Also, do not print it like it would be a string, instead use 0x<digit>
> format.
>
> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>

Applied to git.kernel.org/pub/scm/utils/mmc/mmc-utils.git master, thanks!

Kind regards
Uffe


> ---
>  lsmmc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lsmmc.c b/lsmmc.c
> index da9d69e..cea43af 100644
> --- a/lsmmc.c
> +++ b/lsmmc.c
> @@ -636,10 +636,10 @@ void print_mmc_cid(struct config *config, char *cid)
>                 printf("\tCRC: 0x%02x\n", crc);
>         } else {
>                 if (config->mmc_ids[mid])
> -                       printf("manufacturer: '%s' '%c'\n",
> +                       printf("manufacturer: '%s' 0x%01x\n",
>                                config->mmc_ids[mid], oid);
>                 else
> -                       printf("manufacturer: 'Unlisted' '%c'\n", oid);
> +                       printf("manufacturer: 'Unlisted' 0x%01x\n", oid);
>
>                 printf("product: '%s' %u.%u\n", pnm, prv_major, prv_minor);
>                 printf("serial: 0x%08x\n", psn);
> --
> 2.39.2
>

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

* Re: [PATCH 3/3] mmc-utils: do not hide CID manufacturer information
  2023-05-22 21:48 ` [PATCH 3/3] mmc-utils: do not hide CID manufacturer information Enrico Jorns
  2023-05-24  6:48   ` Avri Altman
@ 2023-05-24 15:15   ` Ulf Hansson
  1 sibling, 0 replies; 9+ messages in thread
From: Ulf Hansson @ 2023-05-24 15:15 UTC (permalink / raw)
  To: Enrico Jorns; +Cc: linux-mmc, Avri Altman

On Mon, 22 May 2023 at 23:49, Enrico Jorns <ejo@pengutronix.de> wrote:
>
> Reading the MID just to convert it to 'Unlisted' is quite unhelpful for
> an info command.
> Due to the (constantly increasing) amount of valid MIDs it is quite
> unlikely to we have it in the database already anyway.
>
> Thus simply always print the manufacturer ID as 0xNN and understand the
> manufacturer name as an additional information held in parenthesis.
>
> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>

Applied to git.kernel.org/pub/scm/utils/mmc/mmc-utils.git master, thanks!

Kind regards
Uffe


> ---
>  lsmmc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lsmmc.c b/lsmmc.c
> index cea43af..54c3167 100644
> --- a/lsmmc.c
> +++ b/lsmmc.c
> @@ -636,10 +636,10 @@ void print_mmc_cid(struct config *config, char *cid)
>                 printf("\tCRC: 0x%02x\n", crc);
>         } else {
>                 if (config->mmc_ids[mid])
> -                       printf("manufacturer: '%s' 0x%01x\n",
> -                              config->mmc_ids[mid], oid);
> +                       printf("manufacturer: 0x%02x (%s) oid: 0x%01x\n",
> +                              mid, config->mmc_ids[mid], oid);
>                 else
> -                       printf("manufacturer: 'Unlisted' 0x%01x\n", oid);
> +                       printf("manufacturer: 0x%02x (Unlisted) oid: 0x%01x\n", mid, oid);
>
>                 printf("product: '%s' %u.%u\n", pnm, prv_major, prv_minor);
>                 printf("serial: 0x%08x\n", psn);
> --
> 2.39.2
>

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

end of thread, other threads:[~2023-05-24 15:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-22 21:48 [PATCH 1/3] mmc-utils: add SanDisk to manufacturer database Enrico Jorns
2023-05-22 21:48 ` [PATCH 2/3] mmc-utils: fix printing OID for mmc in non-verbose mode Enrico Jorns
2023-05-24  6:45   ` Avri Altman
2023-05-24 15:15   ` Ulf Hansson
2023-05-22 21:48 ` [PATCH 3/3] mmc-utils: do not hide CID manufacturer information Enrico Jorns
2023-05-24  6:48   ` Avri Altman
2023-05-24 15:15   ` Ulf Hansson
2023-05-24  6:41 ` [PATCH 1/3] mmc-utils: add SanDisk to manufacturer database Avri Altman
2023-05-24 15:15 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).