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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19AAFC433EF for ; Mon, 25 Jul 2022 15:50:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235437AbiGYPuk (ORCPT ); Mon, 25 Jul 2022 11:50:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234646AbiGYPuj (ORCPT ); Mon, 25 Jul 2022 11:50:39 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB49EB1C6 for ; Mon, 25 Jul 2022 08:50:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6C338B80F96 for ; Mon, 25 Jul 2022 15:50:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26697C341C6; Mon, 25 Jul 2022 15:50:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658764236; bh=4fD2GsOTOoJsMiGgDCif3nW5XxvCsnZN7eGmwDSBs1g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=gW3zlJQ2oinhI3HYAmp9MIn+VRh38uwhWFxc7bjhhIpz0QkhIl9Nue1DQzeoxgsJE RZB2DwFEJARnE9Umv0Prtu4G6eaghcW3ppgfw+HsMh71ySLiq9qe0h57gxzTx1Jl7+ jbgkJ815wVO5SIXwqzg7sA7B6jtQN19nm7ljf0FDYyVO7MVGqaTGJPtIsQrcZ4cARZ xB8lE+Cl1HwY4fsBpIErsJNVraPkJi/8s6CT5iK0e3tHr+jP/rb3WVAmYbjhZNITZj WOWObVmhRo9V1SrAdAtHOzmoU79cYqooje9t09NHBGaAfYDY49+ZUeYLURH4O9m3yw oicK/v9nfsdCQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oG0Lp-009sJO-PU; Mon, 25 Jul 2022 16:50:33 +0100 Date: Mon, 25 Jul 2022 16:50:33 +0100 Message-ID: <87bktdxkc6.wl-maz@kernel.org> From: Marc Zyngier To: Marek Vasut Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski , Linus Walleij , Loic Poulain , NXP Linux Team , Peng Fan , Shawn Guo Subject: Re: [PATCH v5 0/2] gpio: mxc: Locking and direction input fix In-Reply-To: <20220725103445.88674-1-marex@denx.de> References: <20220725103445.88674-1-marex@denx.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: marex@denx.de, linux-gpio@vger.kernel.org, bgolaszewski@baylibre.com, linus.walleij@linaro.org, loic.poulain@linaro.org, linux-imx@nxp.com, peng.fan@nxp.com, shawnguo@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Mon, 25 Jul 2022 11:34:43 +0100, Marek Vasut wrote: > > The irqchip callbacks in gpio-mxc perform register read-modify-write operations > without locking, which may lead to a race condition. Add the missing locking. > > In case the GPIO is used as IRQ, make sure it is configured as input. > > Marek Vasut (2): > gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock > gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode > > drivers/gpio/gpio-mxc.c | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > > Cc: Bartosz Golaszewski > Cc: Linus Walleij > Cc: Loic Poulain > Cc: Marc Zyngier > Cc: NXP Linux Team > Cc: Peng Fan > Cc: Shawn Guo Reviewed-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.