summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlistair Popple <alistair@popple.id.au>2018-03-02 08:18:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-30 08:52:33 +0300
commitbf3a501c1dc0bac5cdf231151157f43c2f434ab1 (patch)
tree58cc3d678de21f545107cf91811b0637d34e5241 /drivers
parentdc81e7182747fdc01268295c58d2ba138970ecbb (diff)
downloadlinux-bf3a501c1dc0bac5cdf231151157f43c2f434ab1.tar.xz
powerpc/powernv/npu: Fix deadlock in mmio_invalidate()
[ Upstream commit 2b74e2a9b39df40a2b489af2d24079617c61ee0e ] When sending TLB invalidates to the NPU we need to send extra flushes due to a hardware issue. The original implementation would lock the all the ATSD MMIO registers sequentially before unlocking and relocking each of them sequentially to do the extra flush. This introduced a deadlock as it is possible for one thread to hold one ATSD register whilst waiting for another register to be freed while the other thread is holding that register waiting for the one in the first thread to be freed. For example if there are two threads and two ATSD registers: Thread A Thread B ---------------------- Acquire 1 Acquire 2 Release 1 Acquire 1 Wait 1 Wait 2 Both threads will be stuck waiting to acquire a register resulting in an RCU stall warning or soft lockup. This patch solves the deadlock by refactoring the code to ensure registers are not released between flushes and to ensure all registers are either acquired or released together and in order. Fixes: bbd5ff50afff ("powerpc/powernv/npu-dma: Add explicit flush when sending an ATSD") Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions