Hi, On Mon, Jan 28, 2019 at 02:02:31PM +0300, Alexander Shiyan wrote: > Ok, lets try to use usleep_range(500, 2000). Can you test this? Still fails the same way. (diff attached as before.) Regards, Andreas Henriksson
diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c index e90817608645..319a3d1e80ca 100644 --- a/drivers/net/can/spi/mcp251x.c +++ b/drivers/net/can/spi/mcp251x.c @@ -215,8 +215,6 @@ #define TX_ECHO_SKB_MAX 1 -#define MCP251X_OST_DELAY_MS (5) - #define DEVICE_NAME "mcp251x" static int mcp251x_enable_dma; /* Enable SPI DMA. Default: 0 (Off) */ @@ -630,7 +628,7 @@ static int mcp251x_hw_reset(struct spi_device *spi) int ret; /* Wait for oscillator startup timer after power up */ - mdelay(MCP251X_OST_DELAY_MS); + usleep_range(500, 2000); priv->spi_tx_buf[0] = INSTRUCTION_RESET; ret = mcp251x_spi_trans(spi, 1); @@ -638,7 +636,7 @@ static int mcp251x_hw_reset(struct spi_device *spi) return ret; /* Wait for oscillator startup timer after reset */ - mdelay(MCP251X_OST_DELAY_MS); + usleep_range(500, 2000); reg = mcp251x_read_reg(spi, CANSTAT); if ((reg & CANCTRL_REQOP_MASK) != CANCTRL_REQOP_CONF)