Re: [PATCH] clocksource: fix read and iounmap of incorrect variable

2017-06-12 Thread Daniel Lezcano
On 10/06/2017 11:49, Marc Zyngier wrote:
> On Fri, Jun 09 2017 at  5:26:32 pm BST, frowand.l...@gmail.com wrote:
>> From: Frank Rowand 
>>
>> Fix boot warning 'Trying to vfree() nonexistent vm area'
>> from arch_timer_mem_of_init().
>>
>> Refactored code attempts to read and iounmap using address frame
>> instead of address ioremap(frame->cntbase).
>>
>> Fixes: c389d701dfb70 ("clocksource: arm_arch_timer: split MMIO timer 
>> probing.")
>>
>> Signed-off-by: Frank Rowand 
>> ---

[ ... ]

> Ah, nice find.
> 
> Acked-by: Marc Zyngier 
> 
> Thomas, Daniel: Can you queue this for the next -rc please?

Yep, applied to my tree.

Thanks.

  -- Daniel


-- 
  Linaro.org │ Open source software for ARM SoCs

Follow Linaro:   Facebook |
 Twitter |
 Blog



Re: [PATCH] clocksource: fix read and iounmap of incorrect variable

2017-06-12 Thread Daniel Lezcano
On 10/06/2017 11:49, Marc Zyngier wrote:
> On Fri, Jun 09 2017 at  5:26:32 pm BST, frowand.l...@gmail.com wrote:
>> From: Frank Rowand 
>>
>> Fix boot warning 'Trying to vfree() nonexistent vm area'
>> from arch_timer_mem_of_init().
>>
>> Refactored code attempts to read and iounmap using address frame
>> instead of address ioremap(frame->cntbase).
>>
>> Fixes: c389d701dfb70 ("clocksource: arm_arch_timer: split MMIO timer 
>> probing.")
>>
>> Signed-off-by: Frank Rowand 
>> ---

[ ... ]

> Ah, nice find.
> 
> Acked-by: Marc Zyngier 
> 
> Thomas, Daniel: Can you queue this for the next -rc please?

Yep, applied to my tree.

Thanks.

  -- Daniel


-- 
  Linaro.org │ Open source software for ARM SoCs

Follow Linaro:   Facebook |
 Twitter |
 Blog



Re: [PATCH] clocksource: fix read and iounmap of incorrect variable

2017-06-10 Thread Marc Zyngier
On Fri, Jun 09 2017 at  5:26:32 pm BST, frowand.l...@gmail.com wrote:
> From: Frank Rowand 
>
> Fix boot warning 'Trying to vfree() nonexistent vm area'
> from arch_timer_mem_of_init().
>
> Refactored code attempts to read and iounmap using address frame
> instead of address ioremap(frame->cntbase).
>
> Fixes: c389d701dfb70 ("clocksource: arm_arch_timer: split MMIO timer 
> probing.")
>
> Signed-off-by: Frank Rowand 
> ---
>
> WARNING: CPU: 0 PID: 0 at mm/vmalloc.c:1514 iounmap+0x14/0x18
> Trying to vfree() nonexistent vm area (ee821000)
> Modules linked in:
> CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.12.0-rc1-dirty #1
> Hardware name: Generic DT based system
> [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
> [] (show_stack) from [] (dump_stack+0x6c/0x8c)
> [] (dump_stack) from [] (__warn+0xd0/0xf8)
> [] (__warn) from [] (warn_slowpath_fmt+0x38/0x48)
> [] (warn_slowpath_fmt) from [] (iounmap+0x14/0x18)
> [] (iounmap) from [] (arch_timer_mem_of_init+0x224/0x414)
> [] (arch_timer_mem_of_init) from [] 
> (clocksource_probe+0x44/0xa8)
> [] (clocksource_probe) from [] (start_kernel+0x228/0x3a0)
> [] (start_kernel) from [<0020807c>] (0x20807c)
>
>  drivers/clocksource/arm_arch_timer.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clocksource/arm_arch_timer.c 
> b/drivers/clocksource/arm_arch_timer.c
> index 4bed671e490e..8b5c30062d99 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -1209,9 +1209,9 @@ static int __init arch_timer_of_init(struct device_node 
> *np)
>   return 0;
>   }
>  
> - rate = readl_relaxed(frame + CNTFRQ);
> + rate = readl_relaxed(base + CNTFRQ);
>  
> - iounmap(frame);
> + iounmap(base);
>  
>   return rate;
>  }

Ah, nice find.

Acked-by: Marc Zyngier 

Thomas, Daniel: Can you queue this for the next -rc please?

Thanks,

M.
-- 
Jazz is not dead, it just smell funny.


Re: [PATCH] clocksource: fix read and iounmap of incorrect variable

2017-06-10 Thread Marc Zyngier
On Fri, Jun 09 2017 at  5:26:32 pm BST, frowand.l...@gmail.com wrote:
> From: Frank Rowand 
>
> Fix boot warning 'Trying to vfree() nonexistent vm area'
> from arch_timer_mem_of_init().
>
> Refactored code attempts to read and iounmap using address frame
> instead of address ioremap(frame->cntbase).
>
> Fixes: c389d701dfb70 ("clocksource: arm_arch_timer: split MMIO timer 
> probing.")
>
> Signed-off-by: Frank Rowand 
> ---
>
> WARNING: CPU: 0 PID: 0 at mm/vmalloc.c:1514 iounmap+0x14/0x18
> Trying to vfree() nonexistent vm area (ee821000)
> Modules linked in:
> CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.12.0-rc1-dirty #1
> Hardware name: Generic DT based system
> [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
> [] (show_stack) from [] (dump_stack+0x6c/0x8c)
> [] (dump_stack) from [] (__warn+0xd0/0xf8)
> [] (__warn) from [] (warn_slowpath_fmt+0x38/0x48)
> [] (warn_slowpath_fmt) from [] (iounmap+0x14/0x18)
> [] (iounmap) from [] (arch_timer_mem_of_init+0x224/0x414)
> [] (arch_timer_mem_of_init) from [] 
> (clocksource_probe+0x44/0xa8)
> [] (clocksource_probe) from [] (start_kernel+0x228/0x3a0)
> [] (start_kernel) from [<0020807c>] (0x20807c)
>
>  drivers/clocksource/arm_arch_timer.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clocksource/arm_arch_timer.c 
> b/drivers/clocksource/arm_arch_timer.c
> index 4bed671e490e..8b5c30062d99 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -1209,9 +1209,9 @@ static int __init arch_timer_of_init(struct device_node 
> *np)
>   return 0;
>   }
>  
> - rate = readl_relaxed(frame + CNTFRQ);
> + rate = readl_relaxed(base + CNTFRQ);
>  
> - iounmap(frame);
> + iounmap(base);
>  
>   return rate;
>  }

Ah, nice find.

Acked-by: Marc Zyngier 

Thomas, Daniel: Can you queue this for the next -rc please?

Thanks,

M.
-- 
Jazz is not dead, it just smell funny.


Re: [PATCH] clocksource: fix read and iounmap of incorrect variable

2017-06-09 Thread Fu Wei
Hi Frank,

On 10 June 2017 at 08:26,   wrote:
> From: Frank Rowand 
>
> Fix boot warning 'Trying to vfree() nonexistent vm area'
> from arch_timer_mem_of_init().
>
> Refactored code attempts to read and iounmap using address frame
> instead of address ioremap(frame->cntbase).
>
> Fixes: c389d701dfb70 ("clocksource: arm_arch_timer: split MMIO timer 
> probing.")
>
> Signed-off-by: Frank Rowand 

Reviewed-by: Fu Wei 

> ---
>
> WARNING: CPU: 0 PID: 0 at mm/vmalloc.c:1514 iounmap+0x14/0x18
> Trying to vfree() nonexistent vm area (ee821000)
> Modules linked in:
> CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.12.0-rc1-dirty #1
> Hardware name: Generic DT based system
> [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
> [] (show_stack) from [] (dump_stack+0x6c/0x8c)
> [] (dump_stack) from [] (__warn+0xd0/0xf8)
> [] (__warn) from [] (warn_slowpath_fmt+0x38/0x48)
> [] (warn_slowpath_fmt) from [] (iounmap+0x14/0x18)
> [] (iounmap) from [] (arch_timer_mem_of_init+0x224/0x414)
> [] (arch_timer_mem_of_init) from [] 
> (clocksource_probe+0x44/0xa8)
> [] (clocksource_probe) from [] (start_kernel+0x228/0x3a0)
> [] (start_kernel) from [<0020807c>] (0x20807c)
>
>  drivers/clocksource/arm_arch_timer.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clocksource/arm_arch_timer.c 
> b/drivers/clocksource/arm_arch_timer.c
> index 4bed671e490e..8b5c30062d99 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -1209,9 +1209,9 @@ static int __init arch_timer_of_init(struct device_node 
> *np)
> return 0;
> }
>
> -   rate = readl_relaxed(frame + CNTFRQ);
> +   rate = readl_relaxed(base + CNTFRQ);
>
> -   iounmap(frame);
> +   iounmap(base);

Great thanks for your patch, this is a bug. So sorry for this typo.
It happened in my last v24 patchset: https://lkml.org/lkml/2017/4/14/363

Hope this fix can be merged ASAP.

>
> return rate;
>  }
> --
> Frank Rowand 
>



-- 
Best regards,

Fu Wei
Software Engineer
Red Hat


Re: [PATCH] clocksource: fix read and iounmap of incorrect variable

2017-06-09 Thread Fu Wei
Hi Frank,

On 10 June 2017 at 08:26,   wrote:
> From: Frank Rowand 
>
> Fix boot warning 'Trying to vfree() nonexistent vm area'
> from arch_timer_mem_of_init().
>
> Refactored code attempts to read and iounmap using address frame
> instead of address ioremap(frame->cntbase).
>
> Fixes: c389d701dfb70 ("clocksource: arm_arch_timer: split MMIO timer 
> probing.")
>
> Signed-off-by: Frank Rowand 

Reviewed-by: Fu Wei 

> ---
>
> WARNING: CPU: 0 PID: 0 at mm/vmalloc.c:1514 iounmap+0x14/0x18
> Trying to vfree() nonexistent vm area (ee821000)
> Modules linked in:
> CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.12.0-rc1-dirty #1
> Hardware name: Generic DT based system
> [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
> [] (show_stack) from [] (dump_stack+0x6c/0x8c)
> [] (dump_stack) from [] (__warn+0xd0/0xf8)
> [] (__warn) from [] (warn_slowpath_fmt+0x38/0x48)
> [] (warn_slowpath_fmt) from [] (iounmap+0x14/0x18)
> [] (iounmap) from [] (arch_timer_mem_of_init+0x224/0x414)
> [] (arch_timer_mem_of_init) from [] 
> (clocksource_probe+0x44/0xa8)
> [] (clocksource_probe) from [] (start_kernel+0x228/0x3a0)
> [] (start_kernel) from [<0020807c>] (0x20807c)
>
>  drivers/clocksource/arm_arch_timer.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clocksource/arm_arch_timer.c 
> b/drivers/clocksource/arm_arch_timer.c
> index 4bed671e490e..8b5c30062d99 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -1209,9 +1209,9 @@ static int __init arch_timer_of_init(struct device_node 
> *np)
> return 0;
> }
>
> -   rate = readl_relaxed(frame + CNTFRQ);
> +   rate = readl_relaxed(base + CNTFRQ);
>
> -   iounmap(frame);
> +   iounmap(base);

Great thanks for your patch, this is a bug. So sorry for this typo.
It happened in my last v24 patchset: https://lkml.org/lkml/2017/4/14/363

Hope this fix can be merged ASAP.

>
> return rate;
>  }
> --
> Frank Rowand 
>



-- 
Best regards,

Fu Wei
Software Engineer
Red Hat


[PATCH] clocksource: fix read and iounmap of incorrect variable

2017-06-09 Thread frowand . list
From: Frank Rowand 

Fix boot warning 'Trying to vfree() nonexistent vm area'
from arch_timer_mem_of_init().

Refactored code attempts to read and iounmap using address frame
instead of address ioremap(frame->cntbase).

Fixes: c389d701dfb70 ("clocksource: arm_arch_timer: split MMIO timer probing.")

Signed-off-by: Frank Rowand 
---

WARNING: CPU: 0 PID: 0 at mm/vmalloc.c:1514 iounmap+0x14/0x18
Trying to vfree() nonexistent vm area (ee821000)
Modules linked in:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.12.0-rc1-dirty #1
Hardware name: Generic DT based system
[] (unwind_backtrace) from [] (show_stack+0x10/0x14)
[] (show_stack) from [] (dump_stack+0x6c/0x8c)
[] (dump_stack) from [] (__warn+0xd0/0xf8)
[] (__warn) from [] (warn_slowpath_fmt+0x38/0x48)
[] (warn_slowpath_fmt) from [] (iounmap+0x14/0x18)
[] (iounmap) from [] (arch_timer_mem_of_init+0x224/0x414)
[] (arch_timer_mem_of_init) from [] 
(clocksource_probe+0x44/0xa8)
[] (clocksource_probe) from [] (start_kernel+0x228/0x3a0)
[] (start_kernel) from [<0020807c>] (0x20807c)

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

diff --git a/drivers/clocksource/arm_arch_timer.c 
b/drivers/clocksource/arm_arch_timer.c
index 4bed671e490e..8b5c30062d99 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -1209,9 +1209,9 @@ static int __init arch_timer_of_init(struct device_node 
*np)
return 0;
}
 
-   rate = readl_relaxed(frame + CNTFRQ);
+   rate = readl_relaxed(base + CNTFRQ);
 
-   iounmap(frame);
+   iounmap(base);
 
return rate;
 }
-- 
Frank Rowand 



[PATCH] clocksource: fix read and iounmap of incorrect variable

2017-06-09 Thread frowand . list
From: Frank Rowand 

Fix boot warning 'Trying to vfree() nonexistent vm area'
from arch_timer_mem_of_init().

Refactored code attempts to read and iounmap using address frame
instead of address ioremap(frame->cntbase).

Fixes: c389d701dfb70 ("clocksource: arm_arch_timer: split MMIO timer probing.")

Signed-off-by: Frank Rowand 
---

WARNING: CPU: 0 PID: 0 at mm/vmalloc.c:1514 iounmap+0x14/0x18
Trying to vfree() nonexistent vm area (ee821000)
Modules linked in:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.12.0-rc1-dirty #1
Hardware name: Generic DT based system
[] (unwind_backtrace) from [] (show_stack+0x10/0x14)
[] (show_stack) from [] (dump_stack+0x6c/0x8c)
[] (dump_stack) from [] (__warn+0xd0/0xf8)
[] (__warn) from [] (warn_slowpath_fmt+0x38/0x48)
[] (warn_slowpath_fmt) from [] (iounmap+0x14/0x18)
[] (iounmap) from [] (arch_timer_mem_of_init+0x224/0x414)
[] (arch_timer_mem_of_init) from [] 
(clocksource_probe+0x44/0xa8)
[] (clocksource_probe) from [] (start_kernel+0x228/0x3a0)
[] (start_kernel) from [<0020807c>] (0x20807c)

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

diff --git a/drivers/clocksource/arm_arch_timer.c 
b/drivers/clocksource/arm_arch_timer.c
index 4bed671e490e..8b5c30062d99 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -1209,9 +1209,9 @@ static int __init arch_timer_of_init(struct device_node 
*np)
return 0;
}
 
-   rate = readl_relaxed(frame + CNTFRQ);
+   rate = readl_relaxed(base + CNTFRQ);
 
-   iounmap(frame);
+   iounmap(base);
 
return rate;
 }
-- 
Frank Rowand