Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1742037pxb; Wed, 9 Feb 2022 03:36:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWe387UulrMxSsaVOlulfypESPi/S7WgktYl983OEIPqYDcBZB+RlPUcyGXBNeN0qG6qic X-Received: by 2002:a17:902:ea11:: with SMTP id s17mr1728617plg.171.1644406610067; Wed, 09 Feb 2022 03:36:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644406610; cv=none; d=google.com; s=arc-20160816; b=eKqcGOr+A70VJ5n+QfL0yUn+mkJXyJYcpIFo13qWowoTqmsdMovmpVphMvDZDkH5bm 4GuI5wXeMJTeTvJaf83ttwf/ybYnde9dEWJV3oNCEioS1fLXBzYH0zENeMiayIj8JF+0 p4nSRmSYLJlrF8cduSmi9VO3uFrxv5lx5D2Z1WgDw0vgWcK2TApOhT1VSuqHfXpPTjvy 2+PrIB59gxyB3lc+uekymQX/Y62V7khWlCIpZixSue7Rk1oEtj9Z7K1IzJ1xte/aIozv zK+qGxmt1mWNldydnu5EhTb2TLkJxUwsbZDWuw7A1YGVNytD/mfIF1ZIS0Q2shr9JW2p Cjyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=nkkxloxaF4pUquRyB1WrPUg/qAN5/QHz1+sCxGlhwFs=; b=eM0H1itcZEOHIR2HhDoAsUb7QAQ/yAXP/yMn14RJz6aqxQt5aFLrh3UJT/gYgc0h+d RlrONpKjO9MhIgWG0G9fExTkgTxiPfzQgx/usOa+pi/om7WcACcvMqIaaco0082ljhMX FT/0zT3cqxz1SOrhYNaUfBsO9dIqnP93+lNofLyooi54bmtAktauHUjAWlQkIQgep4tU ic9l1WvMCldKe/RrHGNRhx6bfS5TjK7NMo78QRytdPi3FXmYcYyyg3NDP/zreSOvHTh1 H1A9VLs9W3giyjZl3GJCZwb5sb/t9GR1KyaW2p68A9lMa00pdtUVMVd/mSletoi2Bwzq wyPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=ixcsMq48; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l73si15544168pge.349.2022.02.09.03.36.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 03:36:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=ixcsMq48; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DBE49E0D58BE; Wed, 9 Feb 2022 01:54:33 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378097AbiBHOU0 (ORCPT + 99 others); Tue, 8 Feb 2022 09:20:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378114AbiBHOUV (ORCPT ); Tue, 8 Feb 2022 09:20:21 -0500 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09A0BC03FED7; Tue, 8 Feb 2022 06:20:18 -0800 (PST) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 21870EL5014985; Tue, 8 Feb 2022 07:39:59 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=PODMain02222019; bh=nkkxloxaF4pUquRyB1WrPUg/qAN5/QHz1+sCxGlhwFs=; b=ixcsMq48PQq2gk2+7pRw/0kThEXBPt6PtTBAXRttzDhrymsiFXhuYTW458wqH4WzvPKn ZKll9m2izwvudmETtqODuqKIt6QP0IGamHmUSUCPqeXN9+nCBcpB4PEafuPnDQtEJDeU ukcDEbaBQyVe0+zaGn59lmy70PiMew1Y+1xxkEZH5uv4dVML0dYdnswBd6WqzrH+HDK5 qdXgwSwZGITdu4ZD4EOGdKn21CA9KT8MkHfMI+amCzsUUyuQwckoL0tEUzYj38aZ/c11 /+V2sI2ySIAT2SGRSW7Kb/zkqdTt5omY2rgzjKOm+SP26JyGUY0VO4e2QNq5lHQYWylz 6A== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3e34y5sc49-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 08 Feb 2022 07:39:58 -0600 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Tue, 8 Feb 2022 13:39:57 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2375.18 via Frontend Transport; Tue, 8 Feb 2022 13:39:57 +0000 Received: from ediswmail.ad.cirrus.com (ediswmail.ad.cirrus.com [198.61.86.93]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 43AE3B13; Tue, 8 Feb 2022 13:39:57 +0000 (UTC) Date: Tue, 8 Feb 2022 13:39:57 +0000 From: Charles Keepax To: Marek Szyprowski CC: Prasad Kumpatla , Mark Brown , Greg Kroah-Hartman , "Rafael J. Wysocki" , , Krzysztof Kozlowski , 'Linux Samsung SOC' Subject: Re: [PATCH v2] regmap-irq: Use regmap_irq_update_bits instead of regmap_write Message-ID: <20220208133957.GC112838@ediswmail.ad.cirrus.com> References: <20220119142953.1804-1-quic_pkumpatl@quicinc.com> <39f1b598-58ca-1e3d-3065-8dd692ee7c9f@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <39f1b598-58ca-1e3d-3065-8dd692ee7c9f@samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-GUID: r7QGDAE2Izqj91E9qdhI8ZHoSsKTYhwg X-Proofpoint-ORIG-GUID: r7QGDAE2Izqj91E9qdhI8ZHoSsKTYhwg X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Tue, Feb 08, 2022 at 01:29:55PM +0100, Marek Szyprowski wrote: > Hi Prasad, > > On 19.01.2022 15:29, Prasad Kumpatla wrote: > > With the existing logic by using regmap_write() all the bits in > > the register are being updated which is not expected. To update only the > > interrupt raised bit and not tocuhing other bits, replace regmap_write() > > with regmap_irq_update_bits(). > > > > This patch is to fix the issue observed in MBHC button press/release events. > > > > Fixes: 3a6f0fb7b8eb ("regmap: irq: Add support to clear ack registers") > > Signed-off-by: Prasad Kumpatla > > There is something wrong with this patch. Since it landed in linux-next > (20220204) I get an interrupt storm on two of my test devices: > > 1. ARM 32bit Exynos4412-based Trats2 ("wm8994-codec wm8994-codec: FIFO > error" message) > > 2. ARM 64bit Exynos5433-based TM2e ("arizona spi1.0: Mixer dropped > sample" message) > > Definitely the interrupts are not acknowledged properly. Once I find > some spare time, I will check it further which regmap configuration > triggers the issue, but it is definitely related to this patch. > Reverting it on top of current linux-next fixes the issue. > Yeah I was just looking at this patch it looks a bit weird. Like most IRQ acks are write 1 to clear, so doing an update_bits seems unlikely to work, as it will ack every pending interrupt. As the whole idea of doing a regmap_write was to only write 1 to the bits that need ACKed. I suspect what is needed here is the inverted case wants an update bits but the normal case needs to stay as a regmap_write. Thanks, Charles