All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jeffery <andrew@aj.id.au>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	openbmc@lists.ozlabs.org
Subject: Re: [PATCH linux dev-4.13 3/4] fsi/occ: Nicer error messages when talking to a host that isn't ready
Date: Mon, 21 May 2018 15:00:47 +0930	[thread overview]
Message-ID: <1526880647.2645672.1378951184.5EC6A9F7@webmail.messagingengine.com> (raw)
In-Reply-To: <20180518013500.18005-3-benh@kernel.crashing.org>

On Fri, 18 May 2018, at 11:04, Benjamin Herrenschmidt wrote:
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Reviewed-by: Andrew Jeffery <andrew@aj.id.au>

> ---
>  drivers/fsi/fsi-occ.c      | 12 ++++++++++++
>  drivers/hwmon/occ/common.c |  9 +++++++--
>  2 files changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/fsi/fsi-occ.c b/drivers/fsi/fsi-occ.c
> index 7a5afa78fb6b..4bda1b435ecb 100644
> --- a/drivers/fsi/fsi-occ.c
> +++ b/drivers/fsi/fsi-occ.c
> @@ -484,6 +484,10 @@ static int occ_getsram(struct device *sbefifo, u32 
> address, u8 *data,
>  		rc = sbefifo_submit(sbefifo, cmd, 5, resp, &resp_len);
>  		if (rc == 0)
>  			rc = sbefifo_parse_status(0xa403, resp, resp_len, &resp_len);
> +		if (rc == -ESHUTDOWN) {
> +			pr_info("occ: Host not ready\n");
> +			return rc;
> +		}
>  		if (rc) {
>  			if (rc < 0)
>  				pr_err("occ: FSI error %d, retrying sram read\n", rc);
> @@ -548,6 +552,10 @@ static int occ_putsram(struct device *sbefifo, u32 
> address, u8 *data,
>  
>  		resp_len = OCC_SBE_STATUS_WORDS;
>  		rc = sbefifo_submit(sbefifo, buf, cmd_len, buf, &resp_len);
> +		if (rc == -ESHUTDOWN) {
> +			pr_info("occ: Host not ready\n");
> +			return rc;
> +		}
>  		if (rc == 0)
>  			rc = sbefifo_parse_status(0xa404, buf, resp_len, &resp_len);
>  		if (rc) {
> @@ -604,6 +612,10 @@ static int occ_trigger_attn(struct device *sbefifo)
>  		buf[6] = 0;
>  
>  		rc = sbefifo_submit(sbefifo, buf, 7, buf, &resp_len);
> +		if (rc == -ESHUTDOWN) {
> +			pr_info("occ: Host not ready\n");
> +			return rc;
> +		}
>  		if (rc == 0)
>  			rc = sbefifo_parse_status(0xa404, buf, resp_len, &resp_len);
>  		if (rc) {
> diff --git a/drivers/hwmon/occ/common.c b/drivers/hwmon/occ/common.c
> index 88c32915b8bf..10f5c0586d47 100644
> --- a/drivers/hwmon/occ/common.c
> +++ b/drivers/hwmon/occ/common.c
> @@ -1350,8 +1350,13 @@ int occ_setup(struct occ *occ, const char *name)
>  	/* no need to lock */
>  	rc = occ_poll(occ);
>  	if (rc < 0) {
> -		dev_err(occ->bus_dev, "failed to get OCC poll response: %d\n",
> -			rc);
> +		/*
> +		 * If the error is -ESHUTDOWN, fail silently, as this happen in
> +		 * normal circumstances when the driver is loaded too early
> +		 */
> +		if (rc != -ESHUTDOWN)
> +			dev_err(occ->bus_dev, "failed to get OCC poll response: %d\n",
> +				rc);
>  		return rc;
>  	}
>  
> -- 
> 2.17.0
> 

  reply	other threads:[~2018-05-21  5:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18  1:34 [PATCH linux dev-4.13 1/4] fsi/occ: Add retries on SBE errors Benjamin Herrenschmidt
2018-05-18  1:34 ` [PATCH linux dev-4.13 2/4] fsi/occ: Add Retries on checksum errors Benjamin Herrenschmidt
2018-05-21  5:26   ` Andrew Jeffery
2018-05-21 14:48     ` Benjamin Herrenschmidt
2018-05-21 18:58       ` Eddie James
2018-05-21 22:55         ` Benjamin Herrenschmidt
2018-05-22  0:36         ` Benjamin Herrenschmidt
2018-05-22 14:06           ` Eddie James
2018-05-18  1:34 ` [PATCH linux dev-4.13 3/4] fsi/occ: Nicer error messages when talking to a host that isn't ready Benjamin Herrenschmidt
2018-05-21  5:30   ` Andrew Jeffery [this message]
2018-05-18  1:35 ` [PATCH linux dev-4.13 4/4] fsi/occ: Don't set driver data late Benjamin Herrenschmidt
2018-05-21  5:44   ` Andrew Jeffery
2018-05-21  5:14 ` [PATCH linux dev-4.13 1/4] fsi/occ: Add retries on SBE errors Andrew Jeffery
2018-05-21  8:33   ` Benjamin Herrenschmidt
2018-05-21 18:48     ` Eddie James
2018-05-21 22:53       ` Benjamin Herrenschmidt
2018-05-22 14:09         ` Eddie James

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=1526880647.2645672.1378951184.5EC6A9F7@webmail.messagingengine.com \
    --to=andrew@aj.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=openbmc@lists.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 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.