Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1074660ybi; Fri, 2 Aug 2019 08:56:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqysE7TrnQ65JI7seahNia5BnW+LeJzeMlvL3WiQ6Pb9e0oSxRB+IH6Qrs9kWZrxhWL4ARYa X-Received: by 2002:a17:90a:d3d4:: with SMTP id d20mr5156549pjw.28.1564761411350; Fri, 02 Aug 2019 08:56:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564761411; cv=none; d=google.com; s=arc-20160816; b=D583yYvGu6kkiO+OcXBE6AZ+bsAzwjEaospp+N1/VJi/K85AE3mP6X3VJNSJj/qgeC Yd8DwDpq32x63R0Wx+aQ90+dep6zaCVKLmHZs5izI+NOQXs5LsklPqM4Y/C4vOK5+tHm Nn4AAHjbje+q9V47gNNs12PuCwTRN2s7VSvn6JVl5k7cYBwn7N89x3jia5EEAbdLO4v6 khkdd2Kduuo7cxFBYHyyZd5DmtW7ddLUZfoie1f3Rp8G65HBiAAGNv3g9wkmtdWew8tx 9n55yX3sgqjGC7vTaAgLbXUC7G/pa+GjQa3ZDFyL4fjkjr42WRn1L+qd+6xj2fmw+gCK hn1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=e0bGDtBbxeEUEt0oCx0jvcRj3BIN5cRiqTon/lrl8+U=; b=0XZh7x9EI4S4l3xN8CcO6X+LHHV6ibCd7YJIMMCFRYnRcg+olcoLX46AG9Slp8YcGB v9Wwk6ceJozeueu5O0PuBTUdi2Td2ZU7tqn0jMk0NzmYrhhsj3cEURRTP79M8LcbuRfP FX8vOyiFz2biJsle73E+wSEwuXU9pCbY+DU7aLHZmkwNVsJga/D34mt35avobp8U+9T0 xGHRF2EUyV0qCLZBCfzjHPGKKHcahBwjfLSRf9h+bDzgHHBopFrY1/SW5QTJFQ4ZLqoa RB02Zf+LgmHVT7cCMixju/Agpf19tfCGaCyLBxsMu2zycAMvouZwBnmS2dvlTAkEUMyf DVVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1bITs253; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g98si6957425pje.92.2019.08.02.08.56.36; Fri, 02 Aug 2019 08:56:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1bITs253; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403883AbfHBJfm (ORCPT + 99 others); Fri, 2 Aug 2019 05:35:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:36240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731210AbfHBJfi (ORCPT ); Fri, 2 Aug 2019 05:35:38 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4FB412184D; Fri, 2 Aug 2019 09:35:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564738537; bh=JvLdXu7j141+TLLTbqz/wW4nRv2BmpL+czVTejfmUKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1bITs253XKt/7VwfYceoyBklaRMzsU9EcXG0iua8QtwWANXHg++7/G3xAIp45OKlQ 8loRJIM4NG/GQDxEgTFEY9jtN1sMPJgGMaddeBBM6+bdNDj9g3pDKvW/a8BVAB38nb gY6Fch32TqvmmQLu965uNoaC8KzaeLKdf7SDGw8A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christian Lamparter , Michael Ellerman , Sasha Levin Subject: [PATCH 4.4 126/158] powerpc/4xx/uic: clear pending interrupt after irq type/pol change Date: Fri, 2 Aug 2019 11:29:07 +0200 Message-Id: <20190802092229.222140864@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092203.671944552@linuxfoundation.org> References: <20190802092203.671944552@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 3ab3a0689e74e6aa5b41360bc18861040ddef5b1 ] When testing out gpio-keys with a button, a spurious interrupt (and therefore a key press or release event) gets triggered as soon as the driver enables the irq line for the first time. This patch clears any potential bogus generated interrupt that was caused by the switching of the associated irq's type and polarity. Signed-off-by: Christian Lamparter Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/sysdev/uic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c index 6893d8f236df..225346dda151 100644 --- a/arch/powerpc/sysdev/uic.c +++ b/arch/powerpc/sysdev/uic.c @@ -158,6 +158,7 @@ static int uic_set_irq_type(struct irq_data *d, unsigned int flow_type) mtdcr(uic->dcrbase + UIC_PR, pr); mtdcr(uic->dcrbase + UIC_TR, tr); + mtdcr(uic->dcrbase + UIC_SR, ~mask); raw_spin_unlock_irqrestore(&uic->lock, flags); -- 2.20.1