linux-stable/drivers/net/can
Anssi Hannula 3486cc40cc can: xilinx_can: xcan_chip_start(): fix failure with invalid bus
Currently the xilinx_can xcan_chip_start() function, called from
.ndo_open() and via CAN_MODE_START (bus-off restart), waits for the SR
register to show the wanted operating state, with a 1 sec timeout.

However, that register bit will only be set once the HW has observed 11
consecutive recessive bits (BusIdle) on the bus.

If the bus will not see the 11 bits (e.g. it is stuck dominant), the
function will timeout and return an error. If this was done as part of a
scheduled restart from bus-off, the interface will stay in bus-off state
forever even if the bus recovers later.

According to M_CAN and FLEXCAN documentation they also wait for 11
consecutive recessive bits, but their drivers do not seem to wait for
that.

To make the behavior consistent, modify xilinx_can to also not wait for
the synchronization to complete.

The only way for users to know for sure that the bus has been joined
successfully is to see successfully received or transmitted frames. That
does not seem optimal, but it is consistent with other drivers and we
should have a properly working restart-ms with xilinx_can.

Tested on ZynqMP with Xilinx CAN-FD 1.0.

Fixes: b1201e44f5 ("can: xilinx CAN controller support")
Signed-off-by: Anssi Hannula <anssi.hannula@bitwise.fi>
Tested-by: Appana Durga Kedareswara Rao <appana.durga.rao@xilinx.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-08-13 16:42:05 +02:00
..
c_can treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
cc770 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 495 2019-06-19 17:09:52 +02:00
ifi_canfd treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
m_can can: tcan4x5x: Add tcan4x5x driver to the kernel 2019-07-24 10:31:54 +02:00
mscan treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 344 2019-06-05 17:37:07 +02:00
peak_canfd can: mark expected switch fall-throughs 2019-07-25 20:09:42 -05:00
rcar Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-06 18:44:57 -07:00
sja1000 can: sja1000: f81601: remove unused including <linux/version.h> 2019-08-13 16:37:03 +02:00
softing net/can: using dev_get_drvdata directly 2019-07-05 15:24:41 -07:00
spi Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-06 17:11:59 -07:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-06 18:44:57 -07:00
at91_can.c can: mark expected switch fall-throughs 2019-07-25 20:09:42 -05:00
dev.c can: dev: call netif_carrier_off() in register_candev() 2019-07-24 11:06:39 +02:00
flexcan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-06 18:44:57 -07:00
grcan.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
janz-ican3.c net: Remove dev_err() usage after platform_get_irq() 2019-07-30 14:37:35 -07:00
Kconfig can: kvaser_pciefd: Add driver for Kvaser PCIEcan devices 2019-07-24 10:31:53 +02:00
kvaser_pciefd.c can: kvaser_pciefd: Remove unused including <linux/version.h> 2019-08-13 16:37:03 +02:00
led.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
Makefile can: kvaser_pciefd: Add driver for Kvaser PCIEcan devices 2019-07-24 10:31:53 +02:00
pch_can.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 340 2019-06-05 17:37:07 +02:00
rx-offload.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 344 2019-06-05 17:37:07 +02:00
slcan.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
sun4i_can.c net: Remove dev_err() usage after platform_get_irq() 2019-07-30 14:37:35 -07:00
ti_hecc.c can: ti_hecc: ti_hecc_mailbox_read(): remove set but not used variable 'mbx_mask' 2019-08-13 16:40:29 +02:00
vcan.c drivers/net: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
vxcan.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 344 2019-06-05 17:37:07 +02:00
xilinx_can.c can: xilinx_can: xcan_chip_start(): fix failure with invalid bus 2019-08-13 16:42:05 +02:00