[PATCH linux dev-5.7 1/2] fsi: scom: Add dev_dbg in put_scom and get_scom paths

Joel Stanley joel at jms.id.au
Wed Jul 29 21:52:43 AEST 2020


This helps understand scom failures by producing more information about
the state of the slave.

Signed-off-by: Joel Stanley <joel at jms.id.au>
---
 drivers/fsi/fsi-scom.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
index 004dc03ccf09..55f30abd20b2 100644
--- a/drivers/fsi/fsi-scom.c
+++ b/drivers/fsi/fsi-scom.c
@@ -240,6 +240,8 @@ static int handle_fsi2pib_status(struct scom_device *scom, uint32_t status)
 {
 	uint32_t dummy = -1;
 
+	dev_dbg(&scom->dev, "handle_fsi2pib_status %08x\n", status);
+
 	if (status & SCOM_STATUS_PROTECTION)
 		return -EPERM;
 	if (status & SCOM_STATUS_PARITY) {
@@ -288,8 +290,12 @@ static int put_scom(struct scom_device *scom, uint64_t value,
 	int rc, retries;
 
 	for (retries = 0; retries < SCOM_MAX_RETRIES; retries++) {
+		dev_dbg(&scom->dev, "put_scom retry %d\n", retries);
+
 		rc = raw_put_scom(scom, value, addr, &status);
 		if (rc) {
+			dev_dbg(&scom->dev, "raw_put_scom failed rc = %d\n", rc);
+
 			/* Try resetting the bridge if FSI fails */
 			if (rc != -ENODEV && retries == 0) {
 				fsi_device_write(scom->fsi_dev, SCOM_FSI2PIB_RESET_REG,
@@ -322,9 +328,13 @@ static int get_scom(struct scom_device *scom, uint64_t *value,
 	int rc, retries;
 
 	for (retries = 0; retries < SCOM_MAX_RETRIES; retries++) {
+		dev_dbg(&scom->dev, "get_scom retry %d\n", retries);
+
 		rc = raw_get_scom(scom, value, addr, &status);
 		if (rc) {
 			/* Try resetting the bridge if FSI fails */
+			dev_dbg(&scom->dev, "raw_get_scom failed rc = %d\n", rc);
+
 			if (rc != -ENODEV && retries == 0) {
 				fsi_device_write(scom->fsi_dev, SCOM_FSI2PIB_RESET_REG,
 						 &dummy, sizeof(uint32_t));
-- 
2.27.0



More information about the openbmc mailing list