linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Stewart Smith <stewart@linux.vnet.ibm.com>
To: Vipin K Parashar <vipin@linux.vnet.ibm.com>,
	linuxppc-dev@lists.ozlabs.org
Cc: Vipin K Parashar <vipin@linux.vnet.ibm.com>
Subject: Re: [PATCH v2] powernv/opal: Handle OPAL_WRONG_STATE error from OPAL fails
Date: Wed, 01 Mar 2017 08:08:19 +1100	[thread overview]
Message-ID: <87h93ec9bw.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <1488276702-14646-1-git-send-email-vipin@linux.vnet.ibm.com>

Vipin K Parashar <vipin@linux.vnet.ibm.com> writes:
> Added check for OPAL_WRONG_STATE error code returned from OPAL.
> Currently Linux flashes "unexpected error" over console for this
> error. This will avoid throwing such message and return I/O error
> for such OPAL failures.
>
> Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
> ---
> Changes in v2:
>  - Added log message indicating sleeping/offline core
>    for OPAL_WRONG_STATE
>
>  arch/powerpc/platforms/powernv/opal.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
> index 86d9fde..8af230e 100644
> --- a/arch/powerpc/platforms/powernv/opal.c
> +++ b/arch/powerpc/platforms/powernv/opal.c
> @@ -869,8 +869,11 @@ int opal_error_code(int rc)
>  	case OPAL_UNSUPPORTED:		return -EIO;
>  	case OPAL_HARDWARE:		return -EIO;
>  	case OPAL_INTERNAL_ERROR:	return -EIO;
> +	case OPAL_WRONG_STATE:
> +		pr_notice("%s: Core sleeping/offline\n", __func__);
> +		return -EIO;

Since this is part of opal_error_code() though, this will be printed for
any OPAL call that returns that.

Why not have the sensor code do this:

rc = opal_sensor_read(foo)
if (rc == OPAL_WRONG_STATE)
   return -EIO;
else
   return oal_error_code(rc);

?

>  	default:
> -		pr_err("%s: unexpected OPAL error %d\n", __func__, rc);
> +		pr_err("%s: Unexpected OPAL error %d\n", __func__, rc);

Do we need this?

-- 
Stewart Smith
OPAL Architect, IBM.

  reply	other threads:[~2017-02-28 21:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-28 10:11 [PATCH v2] powernv/opal: Handle OPAL_WRONG_STATE error from OPAL fails Vipin K Parashar
2017-02-28 21:08 ` Stewart Smith [this message]
2017-03-01  6:10   ` Michael Ellerman
2017-03-02 12:30   ` Vipin K Parashar
2017-03-05  9:48     ` Vipin K Parashar

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=87h93ec9bw.fsf@linux.vnet.ibm.com \
    --to=stewart@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=vipin@linux.vnet.ibm.com \
    /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).