Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1461263 > unrolled thread

[v.1] clocksource:clps711x-timer:- Unmap a region obtained by remap

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2016-08-12 16:50 +0200
Last post2016-08-22 19:50 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [v.1] clocksource:clps711x-timer:- Unmap a region obtained by remap Arvind Yadav <arvind.yadav.cs@gmail.com> - 2016-08-12 16:50 +0200
    Re: [v.1] clocksource:clps711x-timer:- Unmap a region obtained by  remap Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-08-16 15:10 +0200
      Re: [v.1] clocksource:clps711x-timer:- Unmap a region obtained by  remap arvind Yadav <arvind.yadav.cs@gmail.com> - 2016-08-22 19:50 +0200

#1461263 — [v.1] clocksource:clps711x-timer:- Unmap a region obtained by remap

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2016-08-12 16:50 +0200
Subject[v.1] clocksource:clps711x-timer:- Unmap a region obtained by remap
Message-ID<s5lWy-2UE-35@gated-at.bofh.it>
iounmap frees the mapping when timer id is not matching.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/clocksource/clps711x-timer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clocksource/clps711x-timer.c b/drivers/clocksource/clps711x-timer.c
index 84aed78..deaca51 100644
--- a/drivers/clocksource/clps711x-timer.c
+++ b/drivers/clocksource/clps711x-timer.c
@@ -116,6 +116,7 @@ static int __init clps711x_timer_init(struct device_node *np)
 	case CLPS711X_CLKSRC_CLOCKEVENT:
 		return _clps711x_clkevt_init(clock, base, irq);
 	default:
+		iounmap(base);
 		return -EINVAL;
 	}
 }
-- 
2.7.4

[toc] | [next] | [standalone]


#1463768 — Re: [v.1] clocksource:clps711x-timer:- Unmap a region obtained by remap

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2016-08-16 15:10 +0200
SubjectRe: [v.1] clocksource:clps711x-timer:- Unmap a region obtained by remap
Message-ID<s6MhX-3vc-13@gated-at.bofh.it>
In reply to#1461263
Hi Arvind,

On 08/11/2016 07:41 PM, Arvind Yadav wrote:
> iounmap frees the mapping when timer id is not matching.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---

Even if this fix is correct, it does actually rollback a minimalist part
of what was done and only if the clock type is wrong. Can you properly
handle the undo from the different init functions and regarding their
success/error ?

Thanks.

  -- Daniel

>  drivers/clocksource/clps711x-timer.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/clocksource/clps711x-timer.c b/drivers/clocksource/clps711x-timer.c
> index 84aed78..deaca51 100644
> --- a/drivers/clocksource/clps711x-timer.c
> +++ b/drivers/clocksource/clps711x-timer.c
> @@ -116,6 +116,7 @@ static int __init clps711x_timer_init(struct device_node *np)
>  	case CLPS711X_CLKSRC_CLOCKEVENT:
>  		return _clps711x_clkevt_init(clock, base, irq);
>  	default:
> +		iounmap(base);
>  		return -EINVAL;
>  	}
>  }
> 


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

[toc] | [prev] | [next] | [standalone]


#1467859 — Re: [v.1] clocksource:clps711x-timer:- Unmap a region obtained by remap

Fromarvind Yadav <arvind.yadav.cs@gmail.com>
Date2016-08-22 19:50 +0200
SubjectRe: [v.1] clocksource:clps711x-timer:- Unmap a region obtained by remap
Message-ID<s91we-Tx-29@gated-at.bofh.it>
In reply to#1463768

On Tuesday 16 August 2016 06:34 PM, Daniel Lezcano wrote:
> Hi Arvind,
>
> On 08/11/2016 07:41 PM, Arvind Yadav wrote:
>> iounmap frees the mapping when timer id is not matching.
>>
>> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
>> ---
> Even if this fix is correct, it does actually rollback a minimalist part
> of what was done and only if the clock type is wrong. Can you properly
> handle the undo from the different init functions and regarding their
> success/error ?
>
> Thanks.
>
>    -- Daniel
As per your concern, I have done the changes.
please review it.

--Arvind
>>   drivers/clocksource/clps711x-timer.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/clocksource/clps711x-timer.c b/drivers/clocksource/clps711x-timer.c
>> index 84aed78..deaca51 100644
>> --- a/drivers/clocksource/clps711x-timer.c
>> +++ b/drivers/clocksource/clps711x-timer.c
>> @@ -116,6 +116,7 @@ static int __init clps711x_timer_init(struct device_node *np)
>>   	case CLPS711X_CLKSRC_CLOCKEVENT:
>>   		return _clps711x_clkevt_init(clock, base, irq);
>>   	default:
>> +		iounmap(base);
>>   		return -EINVAL;
>>   	}
>>   }
>>
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web