Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 391949b

Browse files
Uwe Kleine-Königbroonie
authored andcommitted
spi: trigger trace event for message-done before mesg->complete
With spidev the mesg->complete callback points to spidev_complete. Calling this unblocks spidev_sync and so spidev_sync_write finishes. As the struct spi_message just read is a local variable in spidev_sync_write and recording the trace event accesses this message the recording is better done first. The same can happen for spidev_sync_read. This fixes an oops observed on a 3.14-rt system with spidev activity after echo 1 > /sys/kernel/debug/tracing/events/spi/enable . Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Mark Brown <[email protected]> Cc: [email protected]
1 parent c517d83 commit 391949b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/spi/spi.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,13 +1105,14 @@ void spi_finalize_current_message(struct spi_master *master)
11051105
"failed to unprepare message: %d\n", ret);
11061106
}
11071107
}
1108+
1109+
trace_spi_message_done(mesg);
1110+
11081111
master->cur_msg_prepared = false;
11091112

11101113
mesg->state = NULL;
11111114
if (mesg->complete)
11121115
mesg->complete(mesg->context);
1113-
1114-
trace_spi_message_done(mesg);
11151116
}
11161117
EXPORT_SYMBOL_GPL(spi_finalize_current_message);
11171118

0 commit comments

Comments
 (0)