[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210716210245.13240-1-alexandru.tachici@analog.com>
Date: Sat, 17 Jul 2021 00:02:44 +0300
From: <alexandru.tachici@...log.com>
To: <linux-kernel@...r.kernel.org>, <linux-spi@...r.kernel.org>,
<broonie@...nel.org>
CC: <nuno.sa@...log.com>, <bootc@...tc.net>, <swarren@...dotorg.org>,
<bcm-kernel-feedback-list@...adcom.com>, <rjui@...adcom.com>,
<f.fainelli@...il.com>, <nsaenz@...nel.org>,
Alexandru Tachici <alexandru.tachici@...log.com>
Subject: [PATCH 0/1] spi: spi-bcm2835: Fix deadlock
From: Alexandru Tachici <alexandru.tachici@...log.com>
The bcm2835_spi_transfer_one function can create a deadlock
if it is called while another thread already has the
CCF lock.
This behavior was observed at boot and when trying to
print the clk_summary debugfs. I had registered
at the time multiple clocks of AD9545 through the CCF.
Tested this using an RPi 4 connected to AD9545 through SPI.
See upstream attempt here:
https://lore.kernel.org/lkml/20210614070718.78041-3-alexandru.tachici@analog.com/T/
This can happen to any other clock that needs to read
the rate/phase from hardware using the SPI. Because
when issuing a clk_get_rate/phase, the requesting thread
already holds the CCF lock. If another thread, in this case
the one that does the spi transfer tries the same, it will cause
a deadlock. This happens by chance because not always
every spi request gets deferred to a khthread.
Alexandru Tachici (1):
spi: spi-bcm2835: Fix deadlock
drivers/spi/spi-bcm2835.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--
2.25.1
Powered by blists - more mailing lists