|
| 1 | +Add 'delay' module param to the driver. |
| 2 | + |
| 3 | +From: Cumulus Networks <support@cumulusnetworks.com> |
| 4 | + |
| 5 | +This is needed on S6000 for safe PMBUS access. |
| 6 | +Without setting the 'delay', the ismt driver throws 'completion wait |
| 7 | +timed out' error message. |
| 8 | +--- |
| 9 | + drivers/i2c/busses/i2c-ismt.c | 13 ++++++++++--- |
| 10 | + 1 file changed, 10 insertions(+), 3 deletions(-) |
| 11 | + |
| 12 | +diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c |
| 13 | +index a35a27c32..b89fbb60d 100644 |
| 14 | +--- a/drivers/i2c/busses/i2c-ismt.c |
| 15 | ++++ b/drivers/i2c/busses/i2c-ismt.c |
| 16 | +@@ -66,6 +66,7 @@ |
| 17 | + #include <linux/i2c.h> |
| 18 | + #include <linux/acpi.h> |
| 19 | + #include <linux/interrupt.h> |
| 20 | ++#include <linux/delay.h> |
| 21 | + |
| 22 | + #include <linux/io-64-nonatomic-lo-hi.h> |
| 23 | + |
| 24 | +@@ -190,9 +191,12 @@ static const struct pci_device_id ismt_ids[] = { |
| 25 | + MODULE_DEVICE_TABLE(pci, ismt_ids); |
| 26 | + |
| 27 | + /* Bus speed control bits for slow debuggers - refer to the docs for usage */ |
| 28 | +-static unsigned int bus_speed; |
| 29 | ++static unsigned int bus_speed = 100; |
| 30 | ++static unsigned int delay = 1000; |
| 31 | + module_param(bus_speed, uint, S_IRUGO); |
| 32 | +-MODULE_PARM_DESC(bus_speed, "Bus Speed in kHz (0 = BIOS default)"); |
| 33 | ++MODULE_PARM_DESC(bus_speed, "Bus Speed in kHz (1000 by default)"); |
| 34 | ++module_param(delay, uint, S_IRUGO); |
| 35 | ++MODULE_PARM_DESC(delay, "Delay in microsecs before access (1000 by default)"); |
| 36 | + |
| 37 | + /** |
| 38 | + * __ismt_desc_dump() - dump the contents of a specific descriptor |
| 39 | +@@ -400,6 +404,9 @@ static int ismt_access(struct i2c_adapter *adap, u16 addr, |
| 40 | + struct device *dev = &priv->pci_dev->dev; |
| 41 | + u8 *dma_buffer = PTR_ALIGN(&priv->buffer[0], 16); |
| 42 | + |
| 43 | ++ if (delay > 0) |
| 44 | ++ udelay(delay); |
| 45 | ++ |
| 46 | + desc = &priv->hw[priv->head]; |
| 47 | + |
| 48 | + /* Initialize the DMA buffer */ |
| 49 | +@@ -759,7 +766,7 @@ static void ismt_hw_init(struct ismt_priv *priv) |
| 50 | + bus_speed = 1000; |
| 51 | + break; |
| 52 | + } |
| 53 | +- dev_dbg(dev, "SMBus clock is running at %d kHz\n", bus_speed); |
| 54 | ++ dev_info(dev, "SMBus clock is running at %d kHz with delay %d us\n", bus_speed, delay); |
| 55 | + } |
| 56 | + |
| 57 | + /** |
0 commit comments