* [PATCH] mmc-utils: Fix reported offset for enhanced user area start address
@ 2016-08-25 4:23 tomas.melin
2016-08-25 7:05 ` Ulf Hansson
0 siblings, 1 reply; 3+ messages in thread
From: tomas.melin @ 2016-08-25 4:23 UTC (permalink / raw)
To: linux-mmc; +Cc: tomas.melin
Block-addressed devices should have address multiplied with sector size.
Clarify with comment how is_blockaddressed() is calculated.
Signed-off-by: Tomas Melin<tomas.melin@vaisala.com>
---
mmc_cmds.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mmc_cmds.c b/mmc_cmds.c
index 295d505..21ddd55 100644
--- a/mmc_cmds.c
+++ b/mmc_cmds.c
@@ -794,7 +794,7 @@ unsigned int get_sector_count(__u8 *ext_csd)
int is_blockaddresed(__u8 *ext_csd)
{
unsigned int sectors = get_sector_count(ext_csd);
-
+ /* over 2GiB devices are block-addressed */
return (sectors > (2u * 1024 * 1024 * 1024) / 512);
}
@@ -1659,7 +1659,7 @@ int do_read_extcsd(int nargs, char **argv)
printf("Enhanced User Data Start Address"
" [ENH_START_ADDR]: 0x%06x\n", regl);
printf(" i.e. %lu bytes offset\n", (is_blockaddresed(ext_csd) ?
- 1l : 512l) * regl);
+ 512l : 1l) * regl);
/* A441]: reserved [135] */
printf("Bad Block Management mode"
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc-utils: Fix reported offset for enhanced user area start address
2016-08-25 4:23 [PATCH] mmc-utils: Fix reported offset for enhanced user area start address tomas.melin
@ 2016-08-25 7:05 ` Ulf Hansson
[not found] ` <CAG=SpYEaoOk7Wr1oqPvuSGQePods1TUcZazF928We3+5uz5rFw@mail.gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Ulf Hansson @ 2016-08-25 7:05 UTC (permalink / raw)
To: tomas.melin; +Cc: linux-mmc, Chris Ball
+ Chris
On 25 August 2016 at 06:23, <tomas.melin@vaisala.com> wrote:
> Block-addressed devices should have address multiplied with sector size.
>
> Clarify with comment how is_blockaddressed() is calculated.
>
> Signed-off-by: Tomas Melin<tomas.melin@vaisala.com>
Chris Ball maintains mmc-utils, you need to send these changes to him.
I have added him on cc this time.
Kind regards
Uffe
> ---
> mmc_cmds.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mmc_cmds.c b/mmc_cmds.c
> index 295d505..21ddd55 100644
> --- a/mmc_cmds.c
> +++ b/mmc_cmds.c
> @@ -794,7 +794,7 @@ unsigned int get_sector_count(__u8 *ext_csd)
> int is_blockaddresed(__u8 *ext_csd)
> {
> unsigned int sectors = get_sector_count(ext_csd);
> -
> + /* over 2GiB devices are block-addressed */
> return (sectors > (2u * 1024 * 1024 * 1024) / 512);
> }
>
> @@ -1659,7 +1659,7 @@ int do_read_extcsd(int nargs, char **argv)
> printf("Enhanced User Data Start Address"
> " [ENH_START_ADDR]: 0x%06x\n", regl);
> printf(" i.e. %lu bytes offset\n", (is_blockaddresed(ext_csd) ?
> - 1l : 512l) * regl);
> + 512l : 1l) * regl);
>
> /* A441]: reserved [135] */
> printf("Bad Block Management mode"
> --
> 2.1.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc-utils: Fix reported offset for enhanced user area start address
[not found] ` <CAG=SpYEaoOk7Wr1oqPvuSGQePods1TUcZazF928We3+5uz5rFw@mail.gmail.com>
@ 2016-09-01 5:56 ` tomas.melin
0 siblings, 0 replies; 3+ messages in thread
From: tomas.melin @ 2016-09-01 5:56 UTC (permalink / raw)
To: chris; +Cc: ulf.hansson, linux-mmc, tomas.melin
Thanks for applying the patches, however, it looks as commit 752072dafe9cb8 got merged wrong and a few
changes were left out. The below patch still needs to be applied.
Tomas
---
Subject: [PATCH] Add missing -c for write_reliability
Fixes upstream-merge in 752072dafe9cb8957efb5b0ca707043e19f7ce13
Write_reliability -c addition from patch was missing.
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
---
mmc_cmds.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/mmc_cmds.c b/mmc_cmds.c
index 2790ead..6b86115 100644
--- a/mmc_cmds.c
+++ b/mmc_cmds.c
@@ -1234,11 +1234,14 @@ int do_write_reliability_set(int nargs, char **argv)
int partition;
char *device;
- CHECK(nargs != 4, "Usage: mmc write_reliability set <-y|-n> "
+ CHECK(nargs != 4, "Usage: mmc write_reliability set <-y|-n|-c> "
"<partition> </path/to/mmcblkX>\n", exit(1));
- if (!strcmp("-y", argv[1]))
+ if (!strcmp("-y", argv[1])) {
dry_run = 0;
+ } else if (!strcmp("-c", argv[1])) {
+ dry_run = 2;
+ }
partition = strtol(argv[2], NULL, 10);
device = argv[3];
--
2.1.4
---
On 08/29/2016 07:05 PM, Chris Ball wrote:
> Thanks Ulf! Tomas, I've applied all five of your recent patches to mmc-utils master, I had to rebase them so please check that the merge looks good, thanks!
>
> - Chris.
>
> On Thu, Aug 25, 2016 at 3:05 AM, Ulf Hansson <ulf.hansson@linaro.org <mailto:ulf.hansson@linaro.org>> wrote:
>
> + Chris
>
> On 25 August 2016 at 06:23, <tomas.melin@vaisala.com <mailto:tomas.melin@vaisala.com>> wrote:
> > Block-addressed devices should have address multiplied with sector size.
> >
> > Clarify with comment how is_blockaddressed() is calculated.
> >
> > Signed-off-by: Tomas Melin<tomas.melin@vaisala.com <mailto:tomas.melin@vaisala.com>>
>
> Chris Ball maintains mmc-utils, you need to send these changes to him.
> I have added him on cc this time.
>
> Kind regards
> Uffe
>
> > ---
> > mmc_cmds.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/mmc_cmds.c b/mmc_cmds.c
> > index 295d505..21ddd55 100644
> > --- a/mmc_cmds.c
> > +++ b/mmc_cmds.c
> > @@ -794,7 +794,7 @@ unsigned int get_sector_count(__u8 *ext_csd)
> > int is_blockaddresed(__u8 *ext_csd)
> > {
> > unsigned int sectors = get_sector_count(ext_csd);
> > -
> > + /* over 2GiB devices are block-addressed */
> > return (sectors > (2u * 1024 * 1024 * 1024) / 512);
> > }
> >
> > @@ -1659,7 +1659,7 @@ int do_read_extcsd(int nargs, char **argv)
> > printf("Enhanced User Data Start Address"
> > " [ENH_START_ADDR]: 0x%06x\n", regl);
> > printf(" i.e. %lu bytes offset\n", (is_blockaddresed(ext_csd) ?
> > - 1l : 512l) * regl);
> > + 512l : 1l) * regl);
> >
> > /* A441]: reserved [135] */
> > printf("Bad Block Management mode"
> > --
> > 2.1.4
>
>
>
>
> --
> Chris Ball <http://printf.net/>
>
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-01 5:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-25 4:23 [PATCH] mmc-utils: Fix reported offset for enhanced user area start address tomas.melin
2016-08-25 7:05 ` Ulf Hansson
[not found] ` <CAG=SpYEaoOk7Wr1oqPvuSGQePods1TUcZazF928We3+5uz5rFw@mail.gmail.com>
2016-09-01 5:56 ` tomas.melin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.