[PATCH linux dev-4.10 1/2] drivers/fsi: Defer hub master scan on probe

Christopher Bostic cbostic at linux.vnet.ibm.com
Fri Aug 4 04:53:05 AEST 2017


Prevent hub master from scanning its connected links/slaves
at probe time.  Needed to keep from creating arbitration
conflicts on the hub connected links during host boot
FSI bus accesses.

Signed-off-by: Christopher Bostic <cbostic at linux.vnet.ibm.com>
---
 drivers/fsi/fsi-core.c        | 3 +++
 drivers/fsi/fsi-master-gpio.c | 1 +
 drivers/fsi/fsi-master-hub.c  | 7 +++++++
 drivers/fsi/fsi-master.h      | 1 +
 4 files changed, 12 insertions(+)

diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index 9b83f1a..3e00398 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -927,6 +927,9 @@ int fsi_master_register(struct fsi_master *master)
 		return rc;
 	}
 
+	if (master->no_scan_on_probe)
+		return 0;
+
 	fsi_master_scan(master);
 
 	return 0;
diff --git a/drivers/fsi/fsi-master-gpio.c b/drivers/fsi/fsi-master-gpio.c
index 9e7a2ed..4e07b64 100644
--- a/drivers/fsi/fsi-master-gpio.c
+++ b/drivers/fsi/fsi-master-gpio.c
@@ -650,6 +650,7 @@ static int fsi_master_gpio_probe(struct platform_device *pdev)
 	master->master.term = fsi_master_gpio_term;
 	master->master.send_break = fsi_master_gpio_break;
 	master->master.link_enable = fsi_master_gpio_link_enable;
+	master->master.no_scan_on_probe = false;
 	platform_set_drvdata(pdev, master);
 
 	fsi_master_gpio_init(master);
diff --git a/drivers/fsi/fsi-master-hub.c b/drivers/fsi/fsi-master-hub.c
index 3223a67..94a61fc 100644
--- a/drivers/fsi/fsi-master-hub.c
+++ b/drivers/fsi/fsi-master-hub.c
@@ -244,6 +244,7 @@ static int hub_master_probe(struct device *dev)
 {
 	struct fsi_device *fsi_dev = to_fsi_dev(dev);
 	struct fsi_master_hub *hub;
+	struct device_node *np;
 	uint32_t reg, links;
 	__be32 __reg;
 	int rc;
@@ -283,6 +284,12 @@ static int hub_master_probe(struct device *dev)
 	hub->master.send_break = hub_master_break;
 	hub->master.link_enable = hub_master_link_enable;
 
+	np = dev->of_node;
+	if (of_property_read_bool(np, "no-scan-on-probe"))
+		hub->master.no_scan_on_probe = true;
+	else
+		hub->master.no_scan_on_probe = false;
+
 	dev_set_drvdata(dev, hub);
 
 	hub_master_init(hub);
diff --git a/drivers/fsi/fsi-master.h b/drivers/fsi/fsi-master.h
index 546257d..7f8e288 100644
--- a/drivers/fsi/fsi-master.h
+++ b/drivers/fsi/fsi-master.h
@@ -26,6 +26,7 @@ struct fsi_master {
 	int		idx;
 	int		n_links;
 	int		flags;
+	bool		no_scan_on_probe;
 	int		(*read)(struct fsi_master *, int link, uint8_t id,
 				uint32_t addr, void *val, size_t size);
 	int		(*write)(struct fsi_master *, int link, uint8_t id,
-- 
1.8.2.2



More information about the openbmc mailing list