Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4086373ybi; Mon, 29 Jul 2019 18:58:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzVSPaU5WcbitDGfSJQNm0d1dO9zGaGLjcYEAKZvItTDhBjLOxruWu7CPLHyMdGLSXzrpxf X-Received: by 2002:a62:6c1:: with SMTP id 184mr38448647pfg.230.1564451901078; Mon, 29 Jul 2019 18:58:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564451901; cv=none; d=google.com; s=arc-20160816; b=zJRE6JD140yz/D+0XxOWvxpPXOkG6kHdv8W98mvxMHKEO3OU63PiEjG9BYOf5asJTG xZSlvYqPgEGAPIxKAHbJVy6xXzTfeUputd87tn2klURSyucAkTg5ET7cWBOJzLw2GI8b SdVQs5KkZggxNA6RaWytlMNdWAORchjdRqop2GqlqPF9aD4ssvQkeLpQrhNotieEL7yS /TnmPgvBQpQ98N/xyF4FH5cblua5tCS4pigaWD98ACZ96413+/ZJO26pQMEJwym9vsWZ EJKA+VjMI5OXZ9hun37ViZZR7aviaCTEe2mlsnROHyAvuaACLA9BM0Q5uiB3nnV3kFpi RBvg== 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=EjzwxKpFH2LU6ZeE6ryDkysPaxoOtKM285ZBmIPu8S0=; b=YuDiDy8aZX/k2zim77AStCWbxO5KIPmCUTwUx58ST5p5i8Y1goxOZmOlqLszj+tKv6 ywwtz3RTmVdrw8rE22e4IRFcEx3W9KyfmfJ8Vg8zN3EWLuhT9l8eRnKJ2ydiA5g3N3+n tWQZcYwsy1K3uVAOPTVSB6bplFISb5DhYiEXusyGCgshaKbNSjXezwgrkMZE+Ynr3riQ N6SCkucenJ7t3YcewhZRast/XKcYiEK6tfzb0gQle97kCaV9L3MNFFmUu8X5cZM66eDd 6kPaob9M+2hGEVQm6PfnFhk+3Fmuuj0wdmKDOcHRz6UYoWB6Zrq2xFvE4mPxtcTzTasG Kwgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ygHs1i7X; 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 d34si27031600pld.54.2019.07.29.18.58.05; Mon, 29 Jul 2019 18:58:21 -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=ygHs1i7X; 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 S2390668AbfG2TuU (ORCPT + 99 others); Mon, 29 Jul 2019 15:50:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:41198 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390307AbfG2TuT (ORCPT ); Mon, 29 Jul 2019 15:50:19 -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 C811F2054F; Mon, 29 Jul 2019 19:50:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429818; bh=zimYNY4jqQ2lB3DCL75INZHEHcqjlWA5sJkudNM4oww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ygHs1i7XJW91gZkBalhs9pXOVzYeDcyijRBW0ZiJmYa8D1TY0sxgIWl3bNYJGUGaU uXxYOkqAuz/ZDDf5iH/taGYvVI1NJ3320bPAHYRVS3wr0sU/ofMbx9GEaQ5t7zbvdp Rw3iRI14irvpBExQ/LTbA0RpB7TtfOaRj5+PUfow= 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 5.2 104/215] powerpc/4xx/uic: clear pending interrupt after irq type/pol change Date: Mon, 29 Jul 2019 21:21:40 +0200 Message-Id: <20190729190757.048544672@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@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 31f12ad37a98..36fb66ce54cf 100644 --- a/arch/powerpc/platforms/4xx/uic.c +++ b/arch/powerpc/platforms/4xx/uic.c @@ -154,6 +154,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