diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2015-03-18 06:27:28 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-03-18 07:34:10 -0400 |
commit | 391949b6f02121371e3d7d9082c6d17fd9853034 (patch) | |
tree | 09916f4b8983907db6a16ad6a8c731868ad869d4 | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) |
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 <u.kleine-koenig@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
-rw-r--r-- | drivers/spi/spi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index c64a3e59fce3..57a195041dc7 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
@@ -1105,13 +1105,14 @@ void spi_finalize_current_message(struct spi_master *master) | |||
1105 | "failed to unprepare message: %d\n", ret); | 1105 | "failed to unprepare message: %d\n", ret); |
1106 | } | 1106 | } |
1107 | } | 1107 | } |
1108 | |||
1109 | trace_spi_message_done(mesg); | ||
1110 | |||
1108 | master->cur_msg_prepared = false; | 1111 | master->cur_msg_prepared = false; |
1109 | 1112 | ||
1110 | mesg->state = NULL; | 1113 | mesg->state = NULL; |
1111 | if (mesg->complete) | 1114 | if (mesg->complete) |
1112 | mesg->complete(mesg->context); | 1115 | mesg->complete(mesg->context); |
1113 | |||
1114 | trace_spi_message_done(mesg); | ||
1115 | } | 1116 | } |
1116 | EXPORT_SYMBOL_GPL(spi_finalize_current_message); | 1117 | EXPORT_SYMBOL_GPL(spi_finalize_current_message); |
1117 | 1118 | ||