diff mbox series

platform: Log error to BMC even if diag data is missing

Message ID 20200210164424.17089-1-hegdevasant@linux.vnet.ibm.com
State Accepted
Headers show
Series platform: Log error to BMC even if diag data is missing | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (179d53dfcca30436777b0c748d530a979bbc8a45)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Vasant Hegde Feb. 10, 2020, 4:44 p.m. UTC
Also fix "DESC" to ASCII conversion.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 core/platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Oliver O'Halloran Feb. 10, 2020, 11:44 p.m. UTC | #1
On Tue, Feb 11, 2020 at 3:44 AM Vasant Hegde
<hegdevasant@linux.vnet.ibm.com> wrote:
>
> Also fix "DESC" to ASCII conversion.
>
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
> ---
>  core/platform.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/core/platform.c b/core/platform.c
> index 2544f0ccf..97bc7cb6f 100644
> --- a/core/platform.c
> +++ b/core/platform.c
> @@ -94,10 +94,10 @@ static int64_t opal_cec_reboot2(uint32_t reboot_type, char *diag)
>                           "OPAL: Reboot requested due to Platform error.");
>                         if (diag) {
>                                 /* Add user section "DESC" */
> -                               log_add_section(buf, 0x44455350);
> +                               log_add_section(buf, 0x44455343);

Make it a #define. Also is this going to need to be endian swapped or
does log_add_section() handle that?

>                                 log_append_data(buf, diag, strlen(diag));
> -                               log_commit(buf);
>                         }
> +                       log_commit(buf);
>                 } else {
>                         prerror("OPAL: failed to log an error\n");
>                 }
> --
> 2.21.1
>
Oliver O'Halloran Feb. 17, 2020, 3:57 a.m. UTC | #2
On Tue, Feb 11, 2020 at 3:44 AM Vasant Hegde
<hegdevasant@linux.vnet.ibm.com> wrote:
>
> Also fix "DESC" to ASCII conversion.
>
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>

Merged as c53e33947cd73c490d49fd06b2c6741d4f7562f9

I still want you yo make that constant a #define though.
Vasant Hegde Feb. 19, 2020, 10:09 a.m. UTC | #3
On 2/11/20 5:14 AM, Oliver O'Halloran wrote:
> On Tue, Feb 11, 2020 at 3:44 AM Vasant Hegde
> <hegdevasant@linux.vnet.ibm.com> wrote:
>>
>> Also fix "DESC" to ASCII conversion.
>>
>> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
>> ---
>>   core/platform.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/core/platform.c b/core/platform.c
>> index 2544f0ccf..97bc7cb6f 100644
>> --- a/core/platform.c
>> +++ b/core/platform.c
>> @@ -94,10 +94,10 @@ static int64_t opal_cec_reboot2(uint32_t reboot_type, char *diag)
>>                            "OPAL: Reboot requested due to Platform error.");
>>                          if (diag) {
>>                                  /* Add user section "DESC" */
>> -                               log_add_section(buf, 0x44455350);
>> +                               log_add_section(buf, 0x44455343);
> 
> Make it a #define.


Agree. I will send separate patch for this.


>  Also is this going to need to be endian swapped or
> does log_add_section() handle that?

Yes. Endianess is taken care.

-Vasant
diff mbox series

Patch

diff --git a/core/platform.c b/core/platform.c
index 2544f0ccf..97bc7cb6f 100644
--- a/core/platform.c
+++ b/core/platform.c
@@ -94,10 +94,10 @@  static int64_t opal_cec_reboot2(uint32_t reboot_type, char *diag)
 			  "OPAL: Reboot requested due to Platform error.");
 			if (diag) {
 				/* Add user section "DESC" */
-				log_add_section(buf, 0x44455350);
+				log_add_section(buf, 0x44455343);
 				log_append_data(buf, diag, strlen(diag));
-				log_commit(buf);
 			}
+			log_commit(buf);
 		} else {
 			prerror("OPAL: failed to log an error\n");
 		}