[PATCH linux dev-4.10 13/16] Revert "drivers/fsi: GPIO stability changes for Cronus/Hostboot"
Andrew Jeffery
andrew at aj.id.au
Thu Feb 15 23:36:03 AEDT 2018
This reverts commit cecf390c294cd6cf1080ed45cf0966691879750d.
The cost of reading OCC hwmon attributes is reduced by roughly 50%[0] when we
do not incur large delays between cycles in the FSI GPIO master. No impact was
observed on the stability of Hostboot by reverting the delays, though
admittedly it was not tested with Cronus.
[0] Down from ~0.5 to ~0.25 seconds
Signed-off-by: Andrew Jeffery <andrew at aj.id.au>
---
drivers/fsi/fsi-master-gpio.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/fsi/fsi-master-gpio.c b/drivers/fsi/fsi-master-gpio.c
index 3d31e50269fe..485ecb88b115 100644
--- a/drivers/fsi/fsi-master-gpio.c
+++ b/drivers/fsi/fsi-master-gpio.c
@@ -15,7 +15,7 @@
#include "fsi-master.h"
-#define FSI_GPIO_STD_DLY 3 /* Standard pin delay in uS */
+#define FSI_GPIO_STD_DLY 1 /* Standard pin delay in nS */
#define FSI_ECHO_DELAY_CLOCKS 16 /* Number clocks for echo delay */
#define FSI_PRE_BREAK_CLOCKS 50 /* Number clocks to prep for break */
#define FSI_BREAK_CLOCKS 256 /* Number of clocks to issue break */
@@ -78,10 +78,10 @@ static void clock_toggle(struct fsi_master_gpio *master, int count)
int i;
for (i = 0; i < count; i++) {
+ ndelay(FSI_GPIO_STD_DLY);
gpiod_set_value(master->gpio_clk, 0);
- udelay(FSI_GPIO_STD_DLY);
+ ndelay(FSI_GPIO_STD_DLY);
gpiod_set_value(master->gpio_clk, 1);
- udelay(FSI_GPIO_STD_DLY);
}
}
@@ -89,6 +89,7 @@ static int sda_in(struct fsi_master_gpio *master)
{
int in;
+ ndelay(FSI_GPIO_STD_DLY);
in = gpiod_get_value(master->gpio_data);
return in ? 1 : 0;
}
--
2.14.1
More information about the openbmc
mailing list