scsi: mac_esp: Replace bogus memory barrier with spinlock
authorFinn Thain <fthain@telegraphics.com.au>
Sun, 2 Apr 2017 07:08:05 +0000 (17:08 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Mar 2018 10:00:15 +0000 (11:00 +0100)
commit8a15303518c005ae63ce1e22053822ea43db6dd1
tree70507f72f32a8104398c28de03d2bc61ad86b5a3
parent9338ee7eea66913d821e1db1ae7b308c1f99adbb
scsi: mac_esp: Replace bogus memory barrier with spinlock

[ Upstream commit 4da2b1eb230ba4ad19b58984dc52e05b1073df5f ]

Commit da244654c66e ("[SCSI] mac_esp: fix for quadras with two esp
chips") added mac_scsi_esp_intr() to handle the IRQ lines from a pair of
on-board ESP chips (a normal shared IRQ did not work).

Proper mutual exclusion was missing from that patch. This patch fixes
race conditions between comparison and assignment of esp_chips[]
pointers.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Reviewed-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/mac_esp.c