]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
can: mcp251xfd: move mcp251xfd_timestamp_start()/stop() into mcp251xfd_chip_start...
authorMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 11 Jan 2023 11:10:04 +0000 (12:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 Sep 2024 14:25:14 +0000 (16:25 +0200)
commit3a2532d882518058a91c57239f3dc041948cd547
treea6d9d1b2dd2d5aae5cfbbac708846f92d457d177
parentfa45741f1e908f1a28ef6f31225b2e71a2682ffa
can: mcp251xfd: move mcp251xfd_timestamp_start()/stop() into mcp251xfd_chip_start/stop()

commit a7801540f325d104de5065850a003f1d9bdc6ad3 upstream.

The mcp251xfd wakes up from Low Power or Sleep Mode when SPI activity
is detected. To avoid this, make sure that the timestamp worker is
stopped before shutting down the chip.

Split the starting of the timestamp worker out of
mcp251xfd_timestamp_init() into the separate function
mcp251xfd_timestamp_start().

Call mcp251xfd_timestamp_init() before mcp251xfd_chip_start(), move
mcp251xfd_timestamp_start() to mcp251xfd_chip_start(). In this way,
mcp251xfd_timestamp_stop() can be called unconditionally by
mcp251xfd_chip_stop().

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
drivers/net/can/spi/mcp251xfd/mcp251xfd-timestamp.c
drivers/net/can/spi/mcp251xfd/mcp251xfd.h