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


Groups > linux.kernel > #1303596 > unrolled thread

[PATCH] ipmi: pass timeout as HZ independent value

Started byNicholas Mc Guire <hofrat@osadl.org>
First post2016-01-07 15:00 +0100
Last post2016-01-07 17:00 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ipmi: pass timeout as HZ independent value Nicholas Mc Guire <hofrat@osadl.org> - 2016-01-07 15:00 +0100
    Re: [Openipmi-developer] [PATCH] ipmi: pass timeout as HZ  independent value Nish Aravamudan <nish.aravamudan@canonical.com> - 2016-01-07 16:40 +0100
      Re: [Openipmi-developer] [PATCH] ipmi: pass timeout as HZ  independent value Nicholas Mc Guire <der.herr@hofr.at> - 2016-01-07 17:00 +0100

#1303596 — [PATCH] ipmi: pass timeout as HZ independent value

FromNicholas Mc Guire <hofrat@osadl.org>
Date2016-01-07 15:00 +0100
Subject[PATCH] ipmi: pass timeout as HZ independent value
Message-ID<qOjgC-om-7@gated-at.bofh.it>
schedule_timeout_* takes a timeout in jiffies but the code currently is
passing in a constant which makes this timeout HZ dependent, so pass it
through msecs_to_jiffies() to fix this up.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---
patch was compile tested with x86_64_defconfig + CONFIG_IPMI_HANDLER=m

Patch is against 4.4-rc8 (localversion-next is -next-20160107)

 drivers/char/ipmi/ipmi_si_intf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 9fda22e..251d546 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -1099,7 +1099,8 @@ static int ipmi_thread(void *data)
 			schedule();
 		else if (smi_result == SI_SM_IDLE) {
 			if (atomic_read(&smi_info->need_watch)) {
-				schedule_timeout_interruptible(100);
+				schedule_timeout_interruptible(
+							msecs_to_jiffies(100));
 			} else {
 				/* Wait to be woken up when we are needed. */
 				__set_current_state(TASK_INTERRUPTIBLE);
-- 
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]


#1303671 — Re: [Openipmi-developer] [PATCH] ipmi: pass timeout as HZ independent value

FromNish Aravamudan <nish.aravamudan@canonical.com>
Date2016-01-07 16:40 +0100
SubjectRe: [Openipmi-developer] [PATCH] ipmi: pass timeout as HZ independent value
Message-ID<qOkPo-1zT-13@gated-at.bofh.it>
In reply to#1303596
On 07.01.2016 [14:52:37 +0100], Nicholas Mc Guire wrote:
> schedule_timeout_* takes a timeout in jiffies but the code currently is
> passing in a constant which makes this timeout HZ dependent, so pass it
> through msecs_to_jiffies() to fix this up.
> 
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> ---
> patch was compile tested with x86_64_defconfig + CONFIG_IPMI_HANDLER=m
> 
> Patch is against 4.4-rc8 (localversion-next is -next-20160107)
> 
>  drivers/char/ipmi/ipmi_si_intf.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
> index 9fda22e..251d546 100644
> --- a/drivers/char/ipmi/ipmi_si_intf.c
> +++ b/drivers/char/ipmi/ipmi_si_intf.c
> @@ -1099,7 +1099,8 @@ static int ipmi_thread(void *data)
>  			schedule();
>  		else if (smi_result == SI_SM_IDLE) {
>  			if (atomic_read(&smi_info->need_watch)) {
> -				schedule_timeout_interruptible(100);
> +				schedule_timeout_interruptible(
> +							msecs_to_jiffies(100));

I believe you can use msleep_interruptible() for this.

-Nish
--
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]


#1303700 — Re: [Openipmi-developer] [PATCH] ipmi: pass timeout as HZ independent value

FromNicholas Mc Guire <der.herr@hofr.at>
Date2016-01-07 17:00 +0100
SubjectRe: [Openipmi-developer] [PATCH] ipmi: pass timeout as HZ independent value
Message-ID<qOl8L-1I5-41@gated-at.bofh.it>
In reply to#1303671
On Thu, Jan 07, 2016 at 07:37:29AM -0800, Nish Aravamudan wrote:
> On 07.01.2016 [14:52:37 +0100], Nicholas Mc Guire wrote:
> > schedule_timeout_* takes a timeout in jiffies but the code currently is
> > passing in a constant which makes this timeout HZ dependent, so pass it
> > through msecs_to_jiffies() to fix this up.
> > 
> > Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> > ---
> > patch was compile tested with x86_64_defconfig + CONFIG_IPMI_HANDLER=m
> > 
> > Patch is against 4.4-rc8 (localversion-next is -next-20160107)
> > 
> >  drivers/char/ipmi/ipmi_si_intf.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
> > index 9fda22e..251d546 100644
> > --- a/drivers/char/ipmi/ipmi_si_intf.c
> > +++ b/drivers/char/ipmi/ipmi_si_intf.c
> > @@ -1099,7 +1099,8 @@ static int ipmi_thread(void *data)
> >  			schedule();
> >  		else if (smi_result == SI_SM_IDLE) {
> >  			if (atomic_read(&smi_info->need_watch)) {
> > -				schedule_timeout_interruptible(100);
> > +				schedule_timeout_interruptible(
> > +							msecs_to_jiffies(100));
> 
> I believe you can use msleep_interruptible() for this.
>
yup - should be the same as its just a wrapper to 
schedule_timeout_interruptible() probably msleep_interruptible()
would be more readable than having the msecs_to_jiffies()
visible here.

thx!
hofrat
--
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