diff mbox

[linux,v6,13/18] drivers/fsi: Minor updates to FSI core

Message ID 1477865379-11566-14-git-send-email-christopher.lee.bostic@gmail.com
State Changes Requested, archived
Headers show

Commit Message

christopher.lee.bostic@gmail.com Oct. 30, 2016, 10:09 p.m. UTC
From: Chris Bostic <cbostic@us.ibm.com>

Added some export symbols for fsi_device_read/write for FSI
client drivers.  Removed the byte swapping done on CFAM config
word reads - already in proper order.  Removed fsi_crc4 checks,
they were incorectly reporting bad crc's.  Need to evaluate
what is wrong with the method of calculation.

Add missing assignment of slave to fsi_device during scan.

Signed-off-by: Chris Bostic <cbostic@us.ibm.com>
---
 drivers/fsi/fsi-core.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Comments

Jeremy Kerr Oct. 31, 2016, 1:24 a.m. UTC | #1
Hi Chris,

> Added some export symbols for fsi_device_read/write for FSI
> client drivers.  Removed the byte swapping done on CFAM config
> word reads - already in proper order.  Removed fsi_crc4 checks,
> they were incorectly reporting bad crc's.  Need to evaluate
> what is wrong with the method of calculation.
>
> Add missing assignment of slave to fsi_device during scan.

I assume that this patch will change as you work out the issues from
some of the updates there. However, once you get this sorted, you should
squash the updates into their original patches.

Cheers,


Jeremy
christopher.lee.bostic@gmail.com Nov. 3, 2016, 4:49 p.m. UTC | #2
On Sun, Oct 30, 2016 at 8:24 PM, Jeremy Kerr <jk@ozlabs.org> wrote:
> Hi Chris,
>
>> Added some export symbols for fsi_device_read/write for FSI
>> client drivers.  Removed the byte swapping done on CFAM config
>> word reads - already in proper order.  Removed fsi_crc4 checks,
>> they were incorectly reporting bad crc's.  Need to evaluate
>> what is wrong with the method of calculation.
>>
>> Add missing assignment of slave to fsi_device during scan.
>
> I assume that this patch will change as you work out the issues from
> some of the updates there. However, once you get this sorted, you should
> squash the updates into their original patches.

Hi Jeremy,

Understood, will do that for next round.

Thanks,
Chris

>
> Cheers,
>
>
> Jeremy
diff mbox

Patch

diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index 565c7e3..95e867e 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -64,6 +64,7 @@  int fsi_device_read(struct fsi_device *dev, uint32_t addr, void *val,
 
 	return fsi_slave_read(dev->slave, dev->addr + addr, val, size);
 }
+EXPORT_SYMBOL_GPL(fsi_device_read);
 
 int fsi_device_write(struct fsi_device *dev, uint32_t addr, const void *val,
 		size_t size)
@@ -76,6 +77,7 @@  int fsi_device_write(struct fsi_device *dev, uint32_t addr, const void *val,
 
 	return fsi_slave_write(dev->slave, dev->addr + addr, val, size);
 }
+EXPORT_SYMBOL_GPL(fsi_device_write);
 
 int fsi_device_peek(struct fsi_device *dev, void *val)
 {
@@ -171,16 +173,15 @@  static int fsi_slave_scan(struct fsi_slave *slave)
 					"error reading slave registers\n");
 			return -1;
 		}
-
-		conf = be32_to_cpu(conf);
-
+/* todo: fix crc calc problems */
+#if 0
 		if (!check_crc4_u32(conf)) {
 			dev_warn(&slave->dev,
 				"crc error in slave register at 0x%04x\n",
 					i);
 			return -1;
 		}
-
+#endif
 		slots = (conf & FSI_SLAVE_CONF_SLOTS_MASK)
 			>> FSI_SLAVE_CONF_SLOTS_SHIFT;
 		version = (conf & FSI_SLAVE_CONF_VERSION_MASK)
@@ -199,6 +200,7 @@  static int fsi_slave_scan(struct fsi_slave *slave)
 			if (!dev)
 				return -ENOMEM;
 
+			dev->slave = slave;
 			dev->engine_type = type;
 			dev->version = version;
 			dev->unit = i;
@@ -252,11 +254,10 @@  static int fsi_slave_init(struct fsi_master *master,
 		return -ENODEV;
 	}
 
-	chip_id = be32_to_cpu(chip_id);
 	if (!check_crc4_u32(chip_id)) {
 		dev_warn(master->dev, "slave %02x:%02x: invalid chip id CRC!\n",
 				link, slave_id);
-		return -EIO;
+		/* todo, fix crc calc issues.  Just warn for now */
 	}
 
 	pr_debug("fsi: found chip %08x at %02x:%02x:%02x\n",