Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3816379ybi; Mon, 29 Jul 2019 13:11:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXifUdfVMTlGVnXjdPumcWxuWKkD+UUPNn8meGTAR9ykinV5sj9wcO9ro+Qk8Kh5e3QKPG X-Received: by 2002:a63:ff03:: with SMTP id k3mr10436910pgi.40.1564431076817; Mon, 29 Jul 2019 13:11:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564431076; cv=none; d=google.com; s=arc-20160816; b=Ah3vcr8auHbaw0BWjRSBGfBuq/FtaSrRMh6SahyukMZJntvnFcpn4GD31OTHtissWD 5WEeoG0bI79CyBMHlNn6QDOP+cx2HWyNHS/1FASjL9npbD2arCUhbG9CH7r6ML9jqjYD uguKtheJqo4obVAsT5MRt470Xh2Vtm5EMXMF0OMr+MCMEBY3dYWdHoADCg5eK7Td3Hiy CKLzK15FxQtW2MyVh3D+uskNZ9Mkyp8qbye0lUfDSyVyCyl0QoJ/KAAbTYgBASf/30x8 hkWH07xPIcYHsodkrRyKLysUFsvhrF3oDMml22bEcwNwMCQaaGJ1z8jqtDCMINtbk+nT tPjw== 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=ro2zsl0iyapZAQKHBiy546HDgdKDAANvldJY9RIy9t8=; b=q/pl95N7iBBiJAHIv9dLRZL/yUatSO+Z+k5kith3m4X2CRk1AkPCBLIuHgl+sRAeLO vZs/qYvf+nPYCDcX5Yte8s7028m2XbO9IpQx9NRQnbYENY+oElYTNYA79AbpPznfplfl f22x6p9tKRb8AZSvTLzbSrTcvii8+vfXanJN3KhB8T6I3AbXTDsYwpRQDboES6vDYq/U +xwTmv3KH+p31srReCgzs4GzuCkP68fvL84FIstxDox6Bl1CSvIY8jUj7EEQoq52gX3u izpo+/UMiV6Sf1CeTztyAsIAFTcnyjIfjEC0HzizMddzE+1n8wYpDczd8mdU/+rXH2GV EiKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Q3q+/pos"; 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 x130si32448971pgx.526.2019.07.29.13.11.01; Mon, 29 Jul 2019 13:11:16 -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="Q3q+/pos"; 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 S1730389AbfG2UJX (ORCPT + 99 others); Mon, 29 Jul 2019 16:09:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:51266 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729333AbfG2Tgs (ORCPT ); Mon, 29 Jul 2019 15:36:48 -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 D385B2171F; Mon, 29 Jul 2019 19:36:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429007; bh=Sfb8OS3U2e2x5qmCLlDtDVvs6ClLocIR+p5SM0N5PPc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q3q+/posYvnjyWJiiyannv8RqngyXH1IDXW8V30wQn2i/5tpDgjQnhV9m5lFvagua rCkGDEpky7g3Mf3+jhI1qEoM38FqRgcZSpVslNVvZbotm5IJsURmImQJgzqFgyGPxK nqnyvNzQ2gYoW15bbg9mxvfW8XdAPBS40o3g8OaI= 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.14 255/293] powerpc/4xx/uic: clear pending interrupt after irq type/pol change Date: Mon, 29 Jul 2019 21:22:26 +0200 Message-Id: <20190729190843.975767237@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@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/platforms/4xx/uic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/4xx/uic.c b/arch/powerpc/platforms/4xx/uic.c index 8b4dd0da0839..9e27cfe27026 100644 --- a/arch/powerpc/platforms/4xx/uic.c +++ b/arch/powerpc/platforms/4xx/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