From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75DEFC76186 for ; Mon, 29 Jul 2019 19:50:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 480E02054F for ; Mon, 29 Jul 2019 19:50:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429828; bh=zimYNY4jqQ2lB3DCL75INZHEHcqjlWA5sJkudNM4oww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=08HeF/tbdrAikJYYR79sQjGKyre5x+SLxYIWMQLFtlw6aJ9x3X1CoCPQNtxD4WMEK /LyIr40a/Cx9FKd4oj1ARNeeLO88dCsVgCG4eU2IxEk7ZW8RSSVOLwE/V3jJrTJxZe fMlLI1sWUfiJeW6+ikG/aDGGtEBOWKA7uJeOZsuM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390663AbfG2TuT (ORCPT ); Mon, 29 Jul 2019 15:50:19 -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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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