linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: subpagetest: fix wrong written check in function write_eraseblock2
@ 2017-06-01  9:01 xiaolei.li-NuS5LvNUpcJWk0Htik3J/w
  2017-06-01 19:23 ` Richard Weinberger
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: xiaolei.li-NuS5LvNUpcJWk0Htik3J/w @ 2017-06-01  9:01 UTC (permalink / raw)
  To: boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
	computersforpeace-Re5JQEeQqe8AvxtiuMwx3w
  Cc: linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	xiaolei.li-NuS5LvNUpcJWk0Htik3J/w,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	dwmw2-wEGCiKHe2LqWVfeAwA7xHQ

From: Xiaolei Li <xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>

Write size in function write_eraseblock2 is subpgsize * k.
It is wrong to check whether written is equal to subpgsize after each
mtd_write.

Signed-off-by: Xiaolei Li <xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
 drivers/mtd/tests/subpagetest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/tests/subpagetest.c b/drivers/mtd/tests/subpagetest.c
index aecc6ce..fa2519a 100644
--- a/drivers/mtd/tests/subpagetest.c
+++ b/drivers/mtd/tests/subpagetest.c
@@ -102,7 +102,7 @@ static int write_eraseblock2(int ebnum)
 		if (unlikely(err || written != subpgsize * k)) {
 			pr_err("error: write failed at %#llx\n",
 			       (long long)addr);
-			if (written != subpgsize) {
+			if (written != subpgsize * k) {
 				pr_err("  write size: %#x\n",
 				       subpgsize * k);
 				pr_err("  written: %#08zx\n",
-- 
1.9.1

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

* Re: [PATCH] mtd: subpagetest: fix wrong written check in function write_eraseblock2
  2017-06-01  9:01 [PATCH] mtd: subpagetest: fix wrong written check in function write_eraseblock2 xiaolei.li-NuS5LvNUpcJWk0Htik3J/w
@ 2017-06-01 19:23 ` Richard Weinberger
       [not found] ` <1496307679-16245-1-git-send-email-xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
  2017-06-08 23:43 ` Brian Norris
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Weinberger @ 2017-06-01 19:23 UTC (permalink / raw)
  To: xiaolei.li
  Cc: Boris Brezillon, David Oberhollenzer,
	linux-mtd@lists.infradead.org, linux-mediatek, Brian Norris,
	David Woodhouse

On Thu, Jun 1, 2017 at 11:01 AM,  <xiaolei.li@mediatek.com> wrote:
> From: Xiaolei Li <xiaolei.li@mediatek.com>
>
> Write size in function write_eraseblock2 is subpgsize * k.
> It is wrong to check whether written is equal to subpgsize after each
> mtd_write.
>
> Signed-off-by: Xiaolei Li <xiaolei.li@mediatek.com>
> ---
>  drivers/mtd/tests/subpagetest.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/tests/subpagetest.c b/drivers/mtd/tests/subpagetest.c
> index aecc6ce..fa2519a 100644
> --- a/drivers/mtd/tests/subpagetest.c
> +++ b/drivers/mtd/tests/subpagetest.c
> @@ -102,7 +102,7 @@ static int write_eraseblock2(int ebnum)
>                 if (unlikely(err || written != subpgsize * k)) {
>                         pr_err("error: write failed at %#llx\n",
>                                (long long)addr);
> -                       if (written != subpgsize) {
> +                       if (written != subpgsize * k) {
>                                 pr_err("  write size: %#x\n",
>                                        subpgsize * k);
>                                 pr_err("  written: %#08zx\n",

Reviewed-by: Richard Weinberger <richard@nod.at>

-- 
Thanks,
//richard

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH] mtd: subpagetest: fix wrong written check in function write_eraseblock2
       [not found] ` <1496307679-16245-1-git-send-email-xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
@ 2017-06-02  7:14   ` Boris Brezillon
  0 siblings, 0 replies; 4+ messages in thread
From: Boris Brezillon @ 2017-06-02  7:14 UTC (permalink / raw)
  To: xiaolei.li-NuS5LvNUpcJWk0Htik3J/w
  Cc: linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	computersforpeace-Re5JQEeQqe8AvxtiuMwx3w,
	dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu, 1 Jun 2017 17:01:19 +0800
<xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> wrote:

> From: Xiaolei Li <xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> 
> Write size in function write_eraseblock2 is subpgsize * k.
> It is wrong to check whether written is equal to subpgsize after each
> mtd_write.
> 
> Signed-off-by: Xiaolei Li <xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>

Acked-by: Boris Brezillon <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>

> ---
>  drivers/mtd/tests/subpagetest.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/tests/subpagetest.c b/drivers/mtd/tests/subpagetest.c
> index aecc6ce..fa2519a 100644
> --- a/drivers/mtd/tests/subpagetest.c
> +++ b/drivers/mtd/tests/subpagetest.c
> @@ -102,7 +102,7 @@ static int write_eraseblock2(int ebnum)
>  		if (unlikely(err || written != subpgsize * k)) {
>  			pr_err("error: write failed at %#llx\n",
>  			       (long long)addr);
> -			if (written != subpgsize) {
> +			if (written != subpgsize * k) {
>  				pr_err("  write size: %#x\n",
>  				       subpgsize * k);
>  				pr_err("  written: %#08zx\n",

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

* Re: [PATCH] mtd: subpagetest: fix wrong written check in function write_eraseblock2
  2017-06-01  9:01 [PATCH] mtd: subpagetest: fix wrong written check in function write_eraseblock2 xiaolei.li-NuS5LvNUpcJWk0Htik3J/w
  2017-06-01 19:23 ` Richard Weinberger
       [not found] ` <1496307679-16245-1-git-send-email-xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
@ 2017-06-08 23:43 ` Brian Norris
  2 siblings, 0 replies; 4+ messages in thread
From: Brian Norris @ 2017-06-08 23:43 UTC (permalink / raw)
  To: xiaolei.li; +Cc: boris.brezillon, linux-mediatek, dwmw2, linux-mtd

On Thu, Jun 01, 2017 at 05:01:19PM +0800, xiaolei.li@mediatek.com wrote:
> From: Xiaolei Li <xiaolei.li@mediatek.com>
> 
> Write size in function write_eraseblock2 is subpgsize * k.
> It is wrong to check whether written is equal to subpgsize after each
> mtd_write.
> 
> Signed-off-by: Xiaolei Li <xiaolei.li@mediatek.com>

Applied to l2-mtd.git

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2017-06-08 23:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-01  9:01 [PATCH] mtd: subpagetest: fix wrong written check in function write_eraseblock2 xiaolei.li-NuS5LvNUpcJWk0Htik3J/w
2017-06-01 19:23 ` Richard Weinberger
     [not found] ` <1496307679-16245-1-git-send-email-xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2017-06-02  7:14   ` Boris Brezillon
2017-06-08 23:43 ` Brian Norris

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).