Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1801003ybt; Sat, 27 Jun 2020 21:36:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9URUwAfV6MDBvxpN1Wd59adBe7rZamWXVDIdbjPyONfQscZYcjU439CWE0nGQ+3C4+od1 X-Received: by 2002:a05:6402:377:: with SMTP id s23mr11498341edw.200.1593318971654; Sat, 27 Jun 2020 21:36:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593318971; cv=none; d=google.com; s=arc-20160816; b=oXEoo/3buO0ayaAAWYv+nMrsjZSnSnW0Ox4pp/2hci/9a/UfP183tTJxip6DNh5sYt ieDntJN0Ynx8EBCEBSxAK5lnX11ttStW3PW3BWs2IM3uDt/H4s/HSpi7hAO7HFU+e4RA bSMSpYHiwyMiom8EFpikPdBPVSSs6CkFm9g9NPNNB43qUvxzL6Se879QcmfLUUpwM2mJ 9uZPPPDtG8rfg/b6XjupUQ3nypkKM2h3XroFoivvR4HRNbHYS4mTG7hVGmLgdnr1iYuL Rs9ksjQI1LCHqbxvAawFfMa3yBTM0fAaBKZ238dXgeCmPzdlacDfTAesncego5tPTz52 9bKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:from:references:in-reply-to :message-id:cc:to; bh=guifUSJYKvBnhwBBxt10LM7qoYnqpdPaj/A+WQP+9MA=; b=MUdtudCfycg+RcuQvCEMxnX3jFsBvIoyxdJorRgKgs4PbaATzyOFCr5s0XoKmJX+qj ub6HwyZAaaJLgjkECJd1Sc1JJTRYTABD2gdrBWSqTcMXC8EuJwzbtQg5AJsup6N9mf5R +nGP1eydRxBPBQ1k8aGenhgpxodqLDszILtPKKmc6VyWMJVwJd5dyg8zp3hGSEUmQMwC 0DvCTM/oiO1FH8foqh0w4AFK7Xeugga++zcLrMcsqzCSiSMOHF53NEq2iVSnV7yBwXUT XpAEQ9HfGlOPHYcuW2i2mR1NrQFQSdjrncFv3kIuGDZQGIFylOtVDbG6+YteyrHs/EyZ jJFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mb7si13559004ejb.316.2020.06.27.21.35.49; Sat, 27 Jun 2020 21:36:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725965AbgF1EcZ (ORCPT + 99 others); Sun, 28 Jun 2020 00:32:25 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:34188 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726035AbgF1Ebq (ORCPT ); Sun, 28 Jun 2020 00:31:46 -0400 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id 62DBC2967C; Sun, 28 Jun 2020 00:31:43 -0400 (EDT) To: Benjamin Herrenschmidt Cc: Joshua Thompson , Geert Uytterhoeven , linux-m68k@lists.linux-m68k.org, Laurent Vivier , Mark Cave-Ayland , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Message-Id: <5952dd8a9bc9de90f1acc4790c51dd42b4c98065.1593318192.git.fthain@telegraphics.com.au> In-Reply-To: References: From: Finn Thain Subject: [PATCH 1/9] macintosh/via-macii: Access autopoll_devs when inside lock Date: Sun, 28 Jun 2020 14:23:12 +1000 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The interrupt handler should be excluded when accessing the autopoll_devs variable. Fixes: d95fd5fce88f0 ("m68k: Mac II ADB fixes") # v5.0+ Tested-by: Stan Johnson Signed-off-by: Finn Thain --- drivers/macintosh/via-macii.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/macintosh/via-macii.c b/drivers/macintosh/via-macii.c index ac824d7b2dcfc..6aa903529570d 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. */ -- 2.26.2