public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: greg@kroah.com, linux-kernel@vger.kernel.org
Subject: [PATCH 6/7] sst: log error returned by scu ipc read/write
Date: Wed, 17 Nov 2010 15:59:30 +0000	[thread overview]
Message-ID: <20101117155922.21681.98517.stgit@localhost.localdomain> (raw)
In-Reply-To: <20101117155748.21681.71501.stgit@localhost.localdomain>

From: Vinod Koul <vinod.koul@intel.com>

scu ipc driver fails sometimes to read/write. This add logs with register
addr and ret code when these errors occur.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/staging/intel_sst/intelmid_pvt.c |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)


diff --git a/drivers/staging/intel_sst/intelmid_pvt.c b/drivers/staging/intel_sst/intelmid_pvt.c
index e8938d9..ecf3b60 100644
--- a/drivers/staging/intel_sst/intelmid_pvt.c
+++ b/drivers/staging/intel_sst/intelmid_pvt.c
@@ -143,30 +143,29 @@ int sst_sc_reg_access(struct sc_reg_access *sc_access,
 		for (i = 0; i < num_val; i++) {
 			retval = intel_scu_ipc_iowrite8(sc_access[i].reg_addr,
 							sc_access[i].value);
-			if (retval) {
-				pr_err("sst: IPC write failed!!! %d\n", retval);
-				return retval;
-			}
+			if (retval)
+				goto err;
 		}
 	} else if (type == PMIC_READ) {
 		for (i = 0; i < num_val; i++) {
 			retval = intel_scu_ipc_ioread8(sc_access[i].reg_addr,
 							&(sc_access[i].value));
-			if (retval) {
-				pr_err("sst: IPC read failed!!!!!%d\n", retval);
-				return retval;
-			}
+			if (retval)
+				goto err;
 		}
 	} else {
 		for (i = 0; i < num_val; i++) {
 			retval = intel_scu_ipc_update_register(
 				sc_access[i].reg_addr, sc_access[i].value,
 				sc_access[i].mask);
-			if (retval) {
-				pr_err("sst: IPC Modify failed!!!%d\n", retval);
-				return retval;
-			}
+			if (retval)
+				goto err;
 		}
-	}
+		}
+	return 0;
+err:
+	pr_err("sst: IPC failed for cmd!!!%d, %d\n", retval, type);
+	pr_err("reg:0x%2x addr:0x%2x\n",
+		sc_access[i].reg_addr, sc_access[i].value);
 	return retval;
 }


  parent reply	other threads:[~2010-11-17 16:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-17 15:57 [PATCH 1/7] sst: remove rest of aava bits and aava related code Alan Cox
2010-11-17 15:58 ` [PATCH 2/7] sst: Change the SST driver PCM interface Alan Cox
2010-11-17 15:58 ` [PATCH 3/7] sst: Add runtime PM support Alan Cox
2010-11-17 15:58 ` [PATCH 4/7] sst: Construct fw string name runtime Alan Cox
2010-11-17 15:59 ` [PATCH 5/7] sst: Firmware error codes force number values Alan Cox
2010-11-17 15:59 ` Alan Cox [this message]
2010-11-17 15:59 ` [PATCH 7/7] sst: add ioctls for post processing algorithm interface Alan Cox
2010-11-17 21:18 ` [PATCH 1/7] sst: remove rest of aava bits and aava related code Greg KH

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=20101117155922.21681.98517.stgit@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.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