Skip to content

flexcan: fix hanging flexcan_close()

Marc Kleine-Budde linux-can 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 0 repliesNew
  2. v15 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- 5/5: remove redundant flexcan_chip_interrupts_disable(dev) Thanks Joakim Zhang

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5can: flexcan: factor out enabling and disabling of interrupts into separate functiondrivers/net/can/flexcan.c+27 -140 replies
2/5can: flexcan: move enabling/disabling of interrupts from flexcan_chip_{start,stop}() to callersdrivers/net/can/flexcan.c+9 -40 replies
3/5can: flexcan: flexcan_rx_offload_setup(): factor out mailbox and rx-offload setup into separate functiondrivers/net/can/flexcan.c+42 -320 replies
4/5can: flexcan: flexcan_open(): completely initialize controller before requesting IRQdrivers/net/can/flexcan.c+11 -100 replies
5/5can: flexcan: flexcan_close(): change order if commands to properly shut down the controllerdrivers/net/can/flexcan.c+3 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [net-next v2 PATCH 0/5] flexcan: fix hanging flexcan_close()

Hello,

There haven been reports, that the flexcan_close() soradically hangs during simultanious ifdown, sending of CAN messages and probably open CAN bus:

| (__schedule) from [<808bbd34>] (schedule+0x90/0xb8)
| (schedule) from [<808bf274>] (schedule_timeout+0x1f8/0x24c)
| (schedule_timeout) from [<8016be44>] (msleep+0x18/0x1c)
| (msleep) from [<80746a64>] (napi_disable+0x60/0x70)
| (napi_disable) from [<8052fdd0>] (flexcan_close+0x2c/0x140)
| (flexcan_close) from [<80744930>] (__dev_close_many+0xb8/0xd8)
| (__dev_close_many) from [<8074db9c>] (__dev_change_flags+0xd0/0x1a0)
| (__dev_change_flags) from [<8074dc84>] (dev_change_flags+0x18/0x48)
| (dev_change_flags) from [<80760c24>] (do_setlink+0x44c/0x7b4)
| (do_setlink) from [<80761560>] (rtnl_newlink+0x374/0x68c)

I was unable to reproduce the issue, but a cleanup of the flexcan close sequence has probably fixed the problem at the reporting user.

As this fix spans 5 patches and changes the flexcan_open() and flexcan_close() are rather big, I'm reluctant to push this via net/master now. So I think this series should go via net-next/master in my next pull request.

changes since v1:
- 5/5: remove redundant flexcan_chip_interrupts_disable(dev) Thanks Joakim Zhang

regards,
Marc