linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linuxppc-dev@ozlabs.org
Cc: Jeremy Kerr <jeremy.kerr@au1.ibm.com>
Subject: Re: powerpc/powernv: Support OPAL requested heartbeat
Date: Thu, 13 Nov 2014 16:29:37 +1100 (AEDT)	[thread overview]
Message-ID: <20141113052937.17DFF1400D2@ozlabs.org> (raw)
In-Reply-To: <1415772194.5124.37.camel@kernel.crashing.org>

On Wed, 2014-12-11 at 06:03:14 UTC, Benjamin Herrenschmidt wrote:
> If OPAL requests it, call it back via opal_poll_events() at a
> regular interval. Some versions of OPAL on some machines require
> this to operate some internal timeouts properly.
> 
> diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
> index f1e0d8c..0153064 100644
> --- a/arch/powerpc/platforms/powernv/opal.c
> +++ b/arch/powerpc/platforms/powernv/opal.c
> @@ -678,6 +680,49 @@ static int __init opal_init(void)
>  				   " (0x%x)\n", rc, irq, hwirq);
>  		opal_irqs[i] = irq;
>  	}
> +}
> +
> +static int kopald(void *unused)
> +{
> +	set_freezable();
> +	do {
> +		try_to_freeze();
> +		opal_poll_events(NULL);
> +		msleep_interruptible(opal_heartbeat);
> +	} while (!kthread_should_stop());
> +
> +	return 0;
> +}
> +
> +static void opal_init_heartbeat(void)
> +{
> +	/* Old firwmware, we assume the HVC heartbeat is sufficient */
> +	if (of_property_read_u32(opal_node, "ibm,heartbeat-freq",
> +				 &opal_heartbeat) != 0)

I'd assume "freq" with no units is in HZ, but looks like it's milliseconds. I
guess it's too late to rename it.

cheers

  reply	other threads:[~2014-11-13  5:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12  6:03 [PATCH] powerpc/powernv: Support OPAL requested heartbeat Benjamin Herrenschmidt
2014-11-13  5:29 ` Michael Ellerman [this message]
2014-11-13  6:42   ` Benjamin Herrenschmidt
2014-11-13  6:46     ` Jeremy Kerr
2014-11-13 16:59 ` [PATCH] " Paul Clarke
2014-11-13 20:35   ` Benjamin Herrenschmidt
2014-11-14  3:01 ` Alistair Popple
2014-11-14  4:26   ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141113052937.17DFF1400D2@ozlabs.org \
    --to=mpe@ellerman.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=jeremy.kerr@au1.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).