Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6243392iob; Tue, 10 May 2022 13:47:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHCcqHRLKol4hKdhLwli31RQZcvr+sjOrdFB/vULrBU+grpW8BsSWOo0emdvnmeWKIwn1H X-Received: by 2002:a05:6402:90d:b0:428:bda9:3e6b with SMTP id g13-20020a056402090d00b00428bda93e6bmr2478339edz.132.1652215630125; Tue, 10 May 2022 13:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652215630; cv=none; d=google.com; s=arc-20160816; b=VqPX+1r4sFWXX5xXC5brWw90JhUD4+1FjWD7RzwAJhGE05RG3q4HN8hzkVXiohsEte 1k6nBaeOll6E4/Z6xLzFVbIGvy9pYZGrKHqL5lw9AWcL5FGmcXpP59XSBgaoN6UD6tXm YKklMvhXa4OkL0ZXD1QHqehHanOHvI6TqT/PhU2XGAyaFnTLsaTy3ILhmeLsErBq2cv8 zjXPhGnpiwNVDmyJGCJQHCM8v9HcFbGu9Gz038mS1KRhys1383QtuXKhGZj4FzAdA0gA Tsfr2J7VyyJKymjHZLiDIfo4W+42ldJfi5EWn/ypDdbtE5DfYqET5exBFF1cVf5ypUgU kljg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=joArGSuE5vCFIo18Xlp26XR0UXCJnTkyaF43sPpUDwY=; b=mV7B7FhWfMQYU2G8vMMbJE1qHO6wSJEDrxhaJIFi/kAJ/FobCKN5KTc8wkgd207rsk eVLlGVT6sh8HyAV4vk2Zetf/ka0ig2v0NFHIpkalBr8ohsPVokCsYmAz52o2yKZHqAn5 2YnIaKU3yZfNE7YRMRc8GfmCj7YpIITfYi9QvU7avbnj52I54DJoWp9PLuRB4jMxC1bn JwjUKJoX/T1gnq3Ls+Q8LH/vj70+23MaKwAoGGOD+GGW/sKONgqhIO8HX8r2lmowNev/ 8tFBlhAIpPIS3uA/NhqiZBqB9mcMPBLQcJSHclHiMM6UZ1BBF7X81jYedY89vyrtrmjA tZWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=z5dYnDvL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j12-20020a508a8c000000b00427f46f080bsi184564edj.624.2022.05.10.13.46.46; Tue, 10 May 2022 13:47:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=z5dYnDvL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245189AbiEJORN (ORCPT + 99 others); Tue, 10 May 2022 10:17:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244796AbiEJNrB (ORCPT ); Tue, 10 May 2022 09:47:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B076195BE1; Tue, 10 May 2022 06:32:05 -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 dfw.source.kernel.org (Postfix) with ESMTPS id EE375615C8; Tue, 10 May 2022 13:32:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF981C385A6; Tue, 10 May 2022 13:32:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652189524; bh=/jM/xkpLU4pNVj7m9v810zL6YmMq+x9MUFy1AJ5qtFc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z5dYnDvL2tF5DuYGaVu0i82736BLzs2IQPd7M212cHJ9Mg2+WOfDXn/l27sqviXnp GPJyBPUu1TWE2am2V3x1X8P2za4gCSnMFQQSr0Plkk+ml5g1Fo+LWisTQrgnm4VAle 3CueQFoZllMt9nRSLxJAQA/ktffTKXq7TRymxHjQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Puyou Lu , Bartosz Golaszewski Subject: [PATCH 5.15 041/135] gpio: pca953x: fix irq_stat not updated when irq is disabled (irq_mask not set) Date: Tue, 10 May 2022 15:07:03 +0200 Message-Id: <20220510130741.579131175@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220510130740.392653815@linuxfoundation.org> References: <20220510130740.392653815@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Puyou Lu commit dba785798526a3282cc4d0f0ea751883715dbbb4 upstream. When one port's input state get inverted (eg. from low to hight) after pca953x_irq_setup but before setting irq_mask (by some other driver such as "gpio-keys"), the next inversion of this port (eg. from hight to low) will not be triggered any more (because irq_stat is not updated at the first time). Issue should be fixed after this commit. Fixes: 89ea8bbe9c3e ("gpio: pca953x.c: add interrupt handling capability") Signed-off-by: Puyou Lu Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman --- drivers/gpio/gpio-pca953x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -762,11 +762,11 @@ static bool pca953x_irq_pending(struct p bitmap_xor(cur_stat, new_stat, old_stat, gc->ngpio); bitmap_and(trigger, cur_stat, chip->irq_mask, gc->ngpio); + bitmap_copy(chip->irq_stat, new_stat, gc->ngpio); + if (bitmap_empty(trigger, gc->ngpio)) return false; - bitmap_copy(chip->irq_stat, new_stat, gc->ngpio); - bitmap_and(cur_stat, chip->irq_trig_fall, old_stat, gc->ngpio); bitmap_and(old_stat, chip->irq_trig_raise, new_stat, gc->ngpio); bitmap_or(new_stat, old_stat, cur_stat, gc->ngpio);