All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/powernv: check OPAL_REGISTER_DUMP_REGION calls exist
@ 2015-02-25 17:43 Cédric Le Goater
  2015-02-25 21:16 ` Stewart Smith
  0 siblings, 1 reply; 4+ messages in thread
From: Cédric Le Goater @ 2015-02-25 17:43 UTC (permalink / raw)
  To: mpe; +Cc: Cédric Le Goater, linuxppc-dev

On Open Power systems, such call fails in OPAL : 

   OPAL: Called with bad token 101 !

The check on the OPAL_UNREGISTER_DUMP_REGION call is added for 
symmetry. I did not see any errors for it.

Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
---
 arch/powerpc/platforms/powernv/opal.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: linux.git/arch/powerpc/platforms/powernv/opal.c
===================================================================
--- linux.git.orig/arch/powerpc/platforms/powernv/opal.c
+++ linux.git/arch/powerpc/platforms/powernv/opal.c
@@ -665,6 +665,11 @@ static void __init opal_dump_region_init
 	uint64_t size;
 	int rc;
 
+	if (!opal_check_token(OPAL_REGISTER_DUMP_REGION)) {
+		pr_warn("Firmware doesn't support dump region buffers\n");
+		return;
+	}
+
 	/* Register kernel log buffer */
 	addr = log_buf_addr_get();
 	size = log_buf_len_get();
@@ -794,6 +799,9 @@ void opal_shutdown(void)
 			mdelay(10);
 	}
 
+	if (!opal_check_token(OPAL_UNREGISTER_DUMP_REGION))
+		return;
+
 	/* Unregister memory dump region */
 	opal_unregister_dump_region(OPAL_DUMP_REGION_LOG_BUF);
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/powernv: check OPAL_REGISTER_DUMP_REGION calls exist
  2015-02-25 17:43 [PATCH] powerpc/powernv: check OPAL_REGISTER_DUMP_REGION calls exist Cédric Le Goater
@ 2015-02-25 21:16 ` Stewart Smith
  2015-02-25 21:28   ` Cedric Le Goater
  0 siblings, 1 reply; 4+ messages in thread
From: Stewart Smith @ 2015-02-25 21:16 UTC (permalink / raw)
  To: Cédric Le Goater, mpe; +Cc: Cédric Le Goater, linuxppc-dev

C=C3=A9dric Le Goater <clg@fr.ibm.com> writes:
> On Open Power systems, such call fails in OPAL :=20
>
>    OPAL: Called with bad token 101 !
>
> The check on the OPAL_UNREGISTER_DUMP_REGION call is added for=20
> symmetry. I did not see any errors for it.

I've already put in a patch to squash this:
Message-Id:
<1423718729-17992-2-git-send-email-stewart@linux.vnet.ibm.com>

Just waiting on mpe to merge :)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/powernv: check OPAL_REGISTER_DUMP_REGION calls exist
  2015-02-25 21:16 ` Stewart Smith
@ 2015-02-25 21:28   ` Cedric Le Goater
  2015-02-25 21:53     ` Stewart Smith
  0 siblings, 1 reply; 4+ messages in thread
From: Cedric Le Goater @ 2015-02-25 21:28 UTC (permalink / raw)
  To: Stewart Smith, mpe; +Cc: linuxppc-dev

On 02/25/2015 10:16 PM, Stewart Smith wrote:
> Cédric Le Goater <clg@fr.ibm.com> writes:
>> On Open Power systems, such call fails in OPAL : 
>>
>>    OPAL: Called with bad token 101 !
>>
>> The check on the OPAL_UNREGISTER_DUMP_REGION call is added for 
>> symmetry. I did not see any errors for it.
> 
> I've already put in a patch to squash this:
> Message-Id:
> <1423718729-17992-2-git-send-email-stewart@linux.vnet.ibm.com>
> 
> Just waiting on mpe to merge :)

ok fine, I missed it :) 

I am also tempted to fix OPAL_READ_TPO but the proper way to do this 
would be to move the lowlevel OPAL code from drivers/rtc/rtc-opal.c to 
a new file under arch/powerpc/platforms/powernv/. How does that sound ? 

Cheers,

C.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/powernv: check OPAL_REGISTER_DUMP_REGION calls exist
  2015-02-25 21:28   ` Cedric Le Goater
@ 2015-02-25 21:53     ` Stewart Smith
  0 siblings, 0 replies; 4+ messages in thread
From: Stewart Smith @ 2015-02-25 21:53 UTC (permalink / raw)
  To: Cedric Le Goater, mpe; +Cc: linuxppc-dev

Cedric Le Goater <clg@fr.ibm.com> writes:
> On 02/25/2015 10:16 PM, Stewart Smith wrote:
>> C=C3=A9dric Le Goater <clg@fr.ibm.com> writes:
>>> On Open Power systems, such call fails in OPAL :=20
>>>
>>>    OPAL: Called with bad token 101 !
>>>
>>> The check on the OPAL_UNREGISTER_DUMP_REGION call is added for=20
>>> symmetry. I did not see any errors for it.
>>=20
>> I've already put in a patch to squash this:
>> Message-Id:
>> <1423718729-17992-2-git-send-email-stewart@linux.vnet.ibm.com>
>>=20
>> Just waiting on mpe to merge :)
>
> ok fine, I missed it :)=20
>
> I am also tempted to fix OPAL_READ_TPO but the proper way to do this=20
> would be to move the lowlevel OPAL code from drivers/rtc/rtc-opal.c to=20
> a new file under arch/powerpc/platforms/powernv/. How does that sound ?=20

shouldn't we be detecting things from DT and acting on it? From a quick
glance perhaps we're not quite doing the checks in all the right places?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-25 21:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-25 17:43 [PATCH] powerpc/powernv: check OPAL_REGISTER_DUMP_REGION calls exist Cédric Le Goater
2015-02-25 21:16 ` Stewart Smith
2015-02-25 21:28   ` Cedric Le Goater
2015-02-25 21:53     ` Stewart Smith

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.