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


Groups > linux.kernel > #1211426 > unrolled thread

[PATCH -next] hrtimer: Fix hang seen if tick_init_highres() failed

Started byGuenter Roeck <linux@roeck-us.net>
First post2015-08-22 10:20 +0200
Last post2015-08-22 23:30 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH -next] hrtimer: Fix hang seen if tick_init_highres() failed Guenter Roeck <linux@roeck-us.net> - 2015-08-22 10:20 +0200
    [tip:timers/core] hrtimer: Handle failure of tick_init_highres()   gracefully tip-bot for Guenter Roeck <tipbot@zytor.com> - 2015-08-22 11:10 +0200
    Re: [PATCH -next] hrtimer: Fix hang seen if tick_init_highres()  failed Luiz Capitulino <lcapitulino@redhat.com> - 2015-08-22 23:30 +0200

#1211426 — [PATCH -next] hrtimer: Fix hang seen if tick_init_highres() failed

FromGuenter Roeck <linux@roeck-us.net>
Date2015-08-22 10:20 +0200
Subject[PATCH -next] hrtimer: Fix hang seen if tick_init_highres() failed
Message-ID<q0cbU-4UY-1@gated-at.bofh.it>
Commit 75e3b37d0598 ("hrtimer: Drop return code of hrtimer_switch_to_hres()")
drops the return code of hrtimer_switch_to_hres(). While doing so, it also
drops the return statement itself on failure. This may cause a system hang.
Seen when running arm:multi_v7_defconfig in qemu with devicetree file
vexpress-v2p-ca9.

Fixes: 75e3b37d0598 ("hrtimer: Drop return code of hrtimer_switch_to_hres()")
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 kernel/time/hrtimer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 5c4fe50e47d3..457a373e2181 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -695,6 +695,7 @@ static void hrtimer_switch_to_hres(void)
 	if (tick_init_highres()) {
 		printk(KERN_WARNING "Could not switch to high resolution "
 				    "mode on CPU %d\n", base->cpu);
+		return;
 	}
 	base->hres_active = 1;
 	hrtimer_resolution = HIGH_RES_NSEC;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1211429 — [tip:timers/core] hrtimer: Handle failure of tick_init_highres() gracefully

Fromtip-bot for Guenter Roeck <tipbot@zytor.com>
Date2015-08-22 11:10 +0200
Subject[tip:timers/core] hrtimer: Handle failure of tick_init_highres() gracefully
Message-ID<q0cYi-64e-15@gated-at.bofh.it>
In reply to#1211426
Commit-ID:  85e1cd6e769dfc84995270d0a4838021fcb8602d
Gitweb:     http://git.kernel.org/tip/85e1cd6e769dfc84995270d0a4838021fcb8602d
Author:     Guenter Roeck <linux@roeck-us.net>
AuthorDate: Sat, 22 Aug 2015 01:10:47 -0700
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Sat, 22 Aug 2015 10:57:50 +0200

hrtimer: Handle failure of tick_init_highres() gracefully

Commit 75e3b37d0598 ("hrtimer: Drop return code of hrtimer_switch_to_hres()")
drops the return code of hrtimer_switch_to_hres(). While doing so, it also
drops the return statement itself on failure. This may cause a system hang.
Seen when running arm:multi_v7_defconfig in qemu with devicetree file
vexpress-v2p-ca9.

Fixes: 75e3b37d0598 ("hrtimer: Drop return code of hrtimer_switch_to_hres()")
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: http://lkml.kernel.org/r/1440231047-16256-1-git-send-email-linux@roeck-us.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/time/hrtimer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 5c4fe50..457a373 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -695,6 +695,7 @@ static void hrtimer_switch_to_hres(void)
 	if (tick_init_highres()) {
 		printk(KERN_WARNING "Could not switch to high resolution "
 				    "mode on CPU %d\n", base->cpu);
+		return;
 	}
 	base->hres_active = 1;
 	hrtimer_resolution = HIGH_RES_NSEC;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1211510 — Re: [PATCH -next] hrtimer: Fix hang seen if tick_init_highres() failed

FromLuiz Capitulino <lcapitulino@redhat.com>
Date2015-08-22 23:30 +0200
SubjectRe: [PATCH -next] hrtimer: Fix hang seen if tick_init_highres() failed
Message-ID<q0owr-5MB-19@gated-at.bofh.it>
In reply to#1211426
On Sat, 22 Aug 2015 01:10:47 -0700
Guenter Roeck <linux@roeck-us.net> wrote:

> Commit 75e3b37d0598 ("hrtimer: Drop return code of hrtimer_switch_to_hres()")
> drops the return code of hrtimer_switch_to_hres(). While doing so, it also
> drops the return statement itself on failure. This may cause a system hang.
> Seen when running arm:multi_v7_defconfig in qemu with devicetree file
> vexpress-v2p-ca9.
> 
> Fixes: 75e3b37d0598 ("hrtimer: Drop return code of hrtimer_switch_to_hres()")
> Cc: Luiz Capitulino <lcapitulino@redhat.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Thanks for catching it Guenter!

Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>

> ---
>  kernel/time/hrtimer.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
> index 5c4fe50e47d3..457a373e2181 100644
> --- a/kernel/time/hrtimer.c
> +++ b/kernel/time/hrtimer.c
> @@ -695,6 +695,7 @@ static void hrtimer_switch_to_hres(void)
>  	if (tick_init_highres()) {
>  		printk(KERN_WARNING "Could not switch to high resolution "
>  				    "mode on CPU %d\n", base->cpu);
> +		return;
>  	}
>  	base->hres_active = 1;
>  	hrtimer_resolution = HIGH_RES_NSEC;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web