MLK-12064 can: flexcan: fix timeout when set small bitrate
authorDong Aisheng <aisheng.dong@nxp.com>
Mon, 4 Jan 2016 12:55:55 +0000 (20:55 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:40 +0000 (14:49 -0500)
commit0a6f960ebfbafd835da35715f8b43f946ef432a3
tree6e530fa9a02bed1dae2b25ed5c1f9f3efc26ada8
parent68b64f83806a3e69f3441ccf3d277ce23478391b
MLK-12064 can: flexcan: fix timeout when set small bitrate

Current we can meet timeout issue when setting a small bitrate
like 10000 as follows:
root@imx6qdlsolo:~# ip link set can0 up type can bitrate 10000
A link change request failed with some changes committed already.
Interface can0 may have been left with an inconsistent configuration,
please check.
RTNETLINK answers: Connection timed out

It is caused by calling of flexcan_chip_unfreeze() timeout.

Originally the code is using usleep_range(10, 20) for unfreeze operation,
but the patch (8badd65 can: flexcan: avoid calling usleep_range from
interrupt context) changed it into udelay(10) which is only a half delay
of before, there're also some other delay changes.

After only changed unfreeze delay back to udelay(20), the issue is gone.
So other timeout values are kept the same as 8badd65 changed.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
drivers/net/can/flexcan.c