Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3099495ybi; Thu, 18 Jul 2019 21:01:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxjvQy0kivqSC1D1aScCiRF/O6Xv3hx+kmQj+0IYgWyr3jHpht9t2Ku8yTPjlO7S+47fKsr X-Received: by 2002:a63:e948:: with SMTP id q8mr49999264pgj.93.1563508894821; Thu, 18 Jul 2019 21:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563508894; cv=none; d=google.com; s=arc-20160816; b=rs3a3dYWrGrX/siqvIyXAKO3FpivMlotqB3WJD7TglVrgg2kdXQRc1xz65UimSiQpV eG+7elbldBTpeXk798Ui+cBqixsZ6nCqQpuFl0q1AR84YMEoLBlR5y5rnnu4lkV69/VO L7r2V1SgZEcxdN1Lk7b8FuzkbutE2XloKAinKDkMB3zPatOsVvr/CgaBdmsK6oQQq9Ij 3s+YniJsd2xv285WwPcOH7RrUqAbK2dGpJXvWfk57yL1EimNd5o9aG2EReQGM9ZsFvNP 6SJOXN4nnVq7yCeIv4GjEE5PrCwGf8XBlgwymu76uLtL+ZP3geqTSNp36OC3PRq2LJtK OyMQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vNiUsQNI3JUWqUgMXROlbdamHtcMkShDoyrcTvB54+A=; b=wFCM4pwJ49oh0SqupYbYr2WXeoybxfwsGiUod5S+pAuZJJJ4cFiSjT5PYe18QWGUjq gAkxPLvddBMjYIVooDlGc/PPpQK1p2Yx1resHfCvB138QEUjHcHN9/bV17GZ3rukOnwy cCLnAHl079Js5dPId7U4vdL92zhGetly0o3NbGUSf0qe9EaKnu9a+rLbYy03bCqGJu1s Lk/rvYSaD6VqRawxCtIgyYNREBYW0h0N8vvyRjhxzMfK7uHzGVehmZJA2ep3maZu3LcZ E8zNQt+M3BsUmWCM9hcvWHx0ypRLLB42/vZPfWHEnu9BLJf4urSn5rgjhdeztismuqfm APvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0Y6TxGXk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si1061552pjb.1.2019.07.18.21.01.19; Thu, 18 Jul 2019 21:01:34 -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=0Y6TxGXk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727056AbfGSEA2 (ORCPT + 99 others); Fri, 19 Jul 2019 00:00:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:60146 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727996AbfGSEAS (ORCPT ); Fri, 19 Jul 2019 00:00:18 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 897832189F; Fri, 19 Jul 2019 04:00:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508817; bh=8sW2YS7ii0lNAuJz5v+7XGJtZjSoln1Lotj6urVCiE0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0Y6TxGXkCEJKkiQEvTDF5uFTU7zehBppphgyk9gqOV69p/dCvI87EBAwS+d/5ws70 Nzhh0K19p9wlZ0o4beIaVIHVF5GOimBQtERy8vsv5Kcn5Egr3GiepIjhtQT8aeLf4T Jk75fkT5LEAwy5TOkGC+3FD/tL7Z9lhZ1LLnaq+8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christian Lamparter , Michael Ellerman , Sasha Levin , linuxppc-dev@lists.ozlabs.org Subject: [PATCH AUTOSEL 5.2 106/171] powerpc/4xx/uic: clear pending interrupt after irq type/pol change Date: Thu, 18 Jul 2019 23:55:37 -0400 Message-Id: <20190719035643.14300-106-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719035643.14300-1-sashal@kernel.org> References: <20190719035643.14300-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christian Lamparter [ 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