diff mbox series

[linux,dev-5.4,1/3] fsi: master: Remove link enable read-back

Message ID 20200406191938.31156-2-eajames@linux.ibm.com
State New
Headers show
Series fsi: Disable link when slave init fails | expand

Commit Message

Eddie James April 6, 2020, 7:19 p.m. UTC
Both the Aspeed and hub masters read back the link enable register
after enabling the link, but this is unnecessary, so remove it.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
---
 drivers/fsi/fsi-master-aspeed.c | 11 +----------
 drivers/fsi/fsi-master-hub.c    |  6 +++---
 2 files changed, 4 insertions(+), 13 deletions(-)

Comments

Andrew Jeffery April 10, 2020, 4:50 a.m. UTC | #1
On Tue, 7 Apr 2020, at 04:49, Eddie James wrote:
> Both the Aspeed and hub masters read back the link enable register
> after enabling the link, but this is unnecessary, so remove it.

Unfortunately the code isn't commented, but you're making the assertion
that it's not necessary without explaining why. Are we sure it's not
implementing a workaround e.g. to make sure the write is flushed?

Or is this assertion made on the basis that the result is unused?

Andrew
diff mbox series

Patch

diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c
index fe2da6f90590..0c04656208a6 100644
--- a/drivers/fsi/fsi-master-aspeed.c
+++ b/drivers/fsi/fsi-master-aspeed.c
@@ -306,7 +306,7 @@  static int aspeed_master_link_enable(struct fsi_master *master, int link)
 {
 	struct fsi_master_aspeed *aspeed = to_fsi_master_aspeed(master);
 	int idx, bit, ret;
-	__be32 reg, result;
+	__be32 reg;
 
 	idx = link / 32;
 	bit = link % 32;
@@ -319,15 +319,6 @@  static int aspeed_master_link_enable(struct fsi_master *master, int link)
 
 	mdelay(FSI_LINK_ENABLE_SETUP_TIME);
 
-	ret = opb_readl(aspeed, ctrl_base + FSI_MENP0 + (4 * idx), &result);
-	if (ret)
-		return ret;
-
-	if (result != reg) {
-		dev_err(aspeed->dev, "%s failed: %08x\n", __func__, result);
-		return -EIO;
-	}
-
 	return 0;
 }
 
diff --git a/drivers/fsi/fsi-master-hub.c b/drivers/fsi/fsi-master-hub.c
index def35cf92571..f89c25d68b5a 100644
--- a/drivers/fsi/fsi-master-hub.c
+++ b/drivers/fsi/fsi-master-hub.c
@@ -90,12 +90,12 @@  static int hub_master_link_enable(struct fsi_master *master, int link)
 	reg = cpu_to_be32(0x80000000 >> bit);
 
 	rc = fsi_device_write(hub->upstream, FSI_MSENP0 + (4 * idx), &reg, 4);
+	if (rc)
+		return rc;
 
 	mdelay(FSI_LINK_ENABLE_SETUP_TIME);
 
-	fsi_device_read(hub->upstream, FSI_MENP0 + (4 * idx), &reg, 4);
-
-	return rc;
+	return 0;
 }
 
 static void hub_master_release(struct device *dev)