diff options
| author | Finn Thain <fthain@telegraphics.com.au> | 2020-06-28 14:23:12 +1000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-08-19 08:16:15 +0200 |
| commit | 845601756341b3b7f8022e1440e231db4ba941bd (patch) | |
| tree | 8ac7cd700ed1a231cd4a6ca0eb21e7e3619b2db4 /drivers/macintosh | |
| parent | a88f86763cbcef5410ba3cd287ced5542472e239 (diff) | |
| download | linux-845601756341b3b7f8022e1440e231db4ba941bd.tar.gz linux-845601756341b3b7f8022e1440e231db4ba941bd.tar.bz2 linux-845601756341b3b7f8022e1440e231db4ba941bd.zip | |
macintosh/via-macii: Access autopoll_devs when inside lock
[ Upstream commit 59ea38f6b3af5636edf541768a1ed721eeaca99e ]
The interrupt handler should be excluded when accessing the autopoll_devs
variable.
Fixes: d95fd5fce88f0 ("m68k: Mac II ADB fixes") # v5.0+
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/5952dd8a9bc9de90f1acc4790c51dd42b4c98065.1593318192.git.fthain@telegraphics.com.au
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/macintosh')
| -rw-r--r-- | drivers/macintosh/via-macii.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/macintosh/via-macii.c b/drivers/macintosh/via-macii.c index ac824d7b2dcf..6aa903529570 100644 --- a/drivers/macintosh/via-macii.c +++ b/drivers/macintosh/via-macii.c @@ -270,15 +270,12 @@ static int macii_autopoll(int devs) unsigned long flags; int err = 0; + local_irq_save(flags); + /* bit 1 == device 1, and so on. */ autopoll_devs = devs & 0xFFFE; - if (!autopoll_devs) - return 0; - - local_irq_save(flags); - - if (current_req == NULL) { + if (autopoll_devs && !current_req) { /* Send a Talk Reg 0. The controller will repeatedly transmit * this as long as it is idle. */ |
