Re: [PATCH v3 1/2] dfu: mtd: fix the trace when limit is reached

2023-10-13 Thread Dario Binacchi
Hello Patrick,

On Mon, Jun 05, 2023 at 09:52:07AM +0200, Patrick Delaunay wrote:
> The offset variable = 'off' used in the error trace when limit is reach
> on erase operation is incorect as 'erase_op.addr' is used in the loop.
> This patch corrects the copy paste issue between the erase loop and
> the write loop.
> 
> This patch also adds the 'remaining' information to allow to debug of
> limit issues.
> 
> Fixes: 6015af28ee6d ("dfu: add backend for MTD device")
> Signed-off-by: Patrick Delaunay 
> Reviewed-by: Patrice Chotard 

Applied to nand-next,
thanks and regards

Dario
> ---
> 
> (no changes since v1)
> 
>  drivers/dfu/dfu_mtd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dfu/dfu_mtd.c b/drivers/dfu/dfu_mtd.c
> index c7075f12eca9..b764f091786d 100644
> --- a/drivers/dfu/dfu_mtd.c
> +++ b/drivers/dfu/dfu_mtd.c
> @@ -86,8 +86,8 @@ static int mtd_block_op(enum dfu_op op, struct dfu_entity 
> *dfu,
>  
>   while (remaining) {
>   if (erase_op.addr + remaining > lim) {
> - printf("Limit reached 0x%llx while erasing at 
> offset 0x%llx\n",
> -lim, off);
> + printf("Limit reached 0x%llx while erasing at 
> offset 0x%llx, remaining 0x%llx\n",
> +lim, erase_op.addr, remaining);
>   return -EIO;
>   }
>  


Re: [PATCH v3 1/2] dfu: mtd: fix the trace when limit is reached

2023-08-25 Thread Patrice CHOTARD



On 6/5/23 09:52, Patrick Delaunay wrote:
> The offset variable = 'off' used in the error trace when limit is reach
> on erase operation is incorect as 'erase_op.addr' is used in the loop.
> This patch corrects the copy paste issue between the erase loop and
> the write loop.
> 
> This patch also adds the 'remaining' information to allow to debug of
> limit issues.
> 
> Fixes: 6015af28ee6d ("dfu: add backend for MTD device")
> Signed-off-by: Patrick Delaunay 
> ---
> 
> (no changes since v1)
> 
>  drivers/dfu/dfu_mtd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dfu/dfu_mtd.c b/drivers/dfu/dfu_mtd.c
> index c7075f12eca9..b764f091786d 100644
> --- a/drivers/dfu/dfu_mtd.c
> +++ b/drivers/dfu/dfu_mtd.c
> @@ -86,8 +86,8 @@ static int mtd_block_op(enum dfu_op op, struct dfu_entity 
> *dfu,
>  
>   while (remaining) {
>   if (erase_op.addr + remaining > lim) {
> - printf("Limit reached 0x%llx while erasing at 
> offset 0x%llx\n",
> -lim, off);
> + printf("Limit reached 0x%llx while erasing at 
> offset 0x%llx, remaining 0x%llx\n",
> +lim, erase_op.addr, remaining);
>   return -EIO;
>   }
>  

Reviewed-by: Patrice Chotard 

Thanks
Patrice


[PATCH v3 1/2] dfu: mtd: fix the trace when limit is reached

2023-06-05 Thread Patrick Delaunay
The offset variable = 'off' used in the error trace when limit is reach
on erase operation is incorect as 'erase_op.addr' is used in the loop.
This patch corrects the copy paste issue between the erase loop and
the write loop.

This patch also adds the 'remaining' information to allow to debug of
limit issues.

Fixes: 6015af28ee6d ("dfu: add backend for MTD device")
Signed-off-by: Patrick Delaunay 
---

(no changes since v1)

 drivers/dfu/dfu_mtd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dfu/dfu_mtd.c b/drivers/dfu/dfu_mtd.c
index c7075f12eca9..b764f091786d 100644
--- a/drivers/dfu/dfu_mtd.c
+++ b/drivers/dfu/dfu_mtd.c
@@ -86,8 +86,8 @@ static int mtd_block_op(enum dfu_op op, struct dfu_entity 
*dfu,
 
while (remaining) {
if (erase_op.addr + remaining > lim) {
-   printf("Limit reached 0x%llx while erasing at 
offset 0x%llx\n",
-  lim, off);
+   printf("Limit reached 0x%llx while erasing at 
offset 0x%llx, remaining 0x%llx\n",
+  lim, erase_op.addr, remaining);
return -EIO;
}
 
-- 
2.25.1