Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9429871pxu; Mon, 28 Dec 2020 16:15:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiZShV1WtJsqmI2ZvOrxW7qSlnTp5quIIFkIiH6mY6dEy/hyxxMEhLsAAk9CiHHQWOLzXA X-Received: by 2002:a17:906:e093:: with SMTP id gh19mr43773480ejb.510.1609200909528; Mon, 28 Dec 2020 16:15:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609200909; cv=none; d=google.com; s=arc-20160816; b=IJyXW2p1EC1uIqa/ewu+6gCIKOKJufNqTJYTTCMOPFhLP0dKF3TR0cWy+3s11qL+Zv HUYy37/n+SWLL1L3WE6GcsyVXoCdIWlunJJBS/ZzPlMNqaM0zJuv0ahaYORR6t//lJ9C HtYZ6HJ8Dcqy6HUq5YWUMl9vGEZuqyCRoomeK0VwGqEOwxzYPIsee9la/GpqS+HCHRNH vJ5IcJHPkdrPq73MwI8LO9ZGQWnv39ABEPPEbr/9naLC/dyxs2ifTvAlF2wgC5VyldFn I7nMu9ayR0O1k096K3o0kJ1g6j5B92/kQIk538h5exPIHtlj2w7WgpTSeAWaDixbSveu oOmg== 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=2JBMa4TtTBwcGoEtt5e3Yv7/SXDs4M+G6/ve3WCkKrc=; b=S8Af1nDBWsTJXUFn/VWHew1iWUI5kxcLnT7klrw2qdoT3w8ak423crhlcB88rBkbg7 CTAH4HRK+3h0KJETh63JGHCxW9nAMiifGOOFm9L52J9sgBDAKc2rVUB66w41y0GMO01A HHi7iUUmCQQSfksfq+DgvinrtNKsSNkrZzftGJx0ATFAZ7wMLzIHcTejX+qEFX6OXpa9 m66JhmDaJLv+OTWiykgbmGGG7CFf3MGjqV6MfTUdUapyXOutN0Wh5ifjzmZAEx6H8iqH B0DAhmsUjMUzBhG6w08S7Fu5gUvTDTFR8Ox+S+1MeNCY5EBSB3MZXwKFtS4VpAEmUXEx Jc/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=A4uJKkR8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb26si20993925edb.382.2020.12.28.16.14.47; Mon, 28 Dec 2020 16:15:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=A4uJKkR8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2408421AbgL1PO1 (ORCPT + 99 others); Mon, 28 Dec 2020 10:14:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:41002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438187AbgL1OGp (ORCPT ); Mon, 28 Dec 2020 09:06:45 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B927E207B2; Mon, 28 Dec 2020 14:06:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164389; bh=u5X+2vQlcDHXjag+vwKfk4kgAsp+c+mxOCHIScp1xc8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A4uJKkR8SnRlNfz4tTFaifzXUrECVX4gFcNzd0Mnwb5hMu5rlDCNVjthZVr73rjCb TWRgpcY+6KFxH+On6YBvbuvzmMV81qeCyT1cA57RBRZe923zZOQv7Sk9tABPSki1UM pHMojFiYW5X7hr95NeR0l2JP4EfPCnoOEL5aSKqI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Carl Philipp Klemm , Laxminath Kasam , Merlijn Wajer , Mark Brown , Pavel Machek , Sebastian Reichel , Tim Harvey , Tony Lindgren , Lee Jones , Sasha Levin Subject: [PATCH 5.10 163/717] mfd: cpcap: Fix interrupt regression with regmap clear_ack Date: Mon, 28 Dec 2020 13:42:41 +0100 Message-Id: <20201228125028.766318260@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tony Lindgren [ Upstream commit 14639a22de657eabbb776f503a816594393cc935 ] With commit 3a6f0fb7b8eb ("regmap: irq: Add support to clear ack registers"), the cpcap interrupts are no longer getting acked properly leading to a very unresponsive device with CPUs fully loaded spinning in the threaded IRQ handlers. To me it looks like the clear_ack commit above actually fixed a long standing bug in regmap_irq_thread() where we unconditionally acked the interrupts earlier without considering ack_invert. And the issue with cpcap started happening as we now also consider ack_invert. Tim Harvey tried to fix this issue earlier with "[PATCH v2] regmap: irq: fix ack-invert", but the reading of the ack register was considered unnecessary for just ack_invert, and we did not have clear_ack available yet. As the cpcap irqs worked both with and without ack_invert earlier because of the unconditional ack, the problem remained hidden until now. Also, looks like the earlier v3.0.8 based Motorola Android Linux kernel does clear_ack style read-clear-write with "ireg_val & ~mreg_val" instead of just ack_invert style write. So let's switch cpcap to use clear_ack to fix the issue. Fixes: 3a6f0fb7b8eb ("regmap: irq: Add support to clear ack registers") Cc: Carl Philipp Klemm Cc: Laxminath Kasam Cc: Merlijn Wajer Cc: Mark Brown Cc: Pavel Machek Cc: Sebastian Reichel Cc: Tim Harvey Signed-off-by: Tony Lindgren Tested-by: Pavel Machek Reviewed-By: Tim Harvey Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/mfd/motorola-cpcap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c index 2283d88adcc25..30d82bfe5b02f 100644 --- a/drivers/mfd/motorola-cpcap.c +++ b/drivers/mfd/motorola-cpcap.c @@ -97,7 +97,7 @@ static struct regmap_irq_chip cpcap_irq_chip[CPCAP_NR_IRQ_CHIPS] = { .ack_base = CPCAP_REG_MI1, .mask_base = CPCAP_REG_MIM1, .use_ack = true, - .ack_invert = true, + .clear_ack = true, }, { .name = "cpcap-m2", @@ -106,7 +106,7 @@ static struct regmap_irq_chip cpcap_irq_chip[CPCAP_NR_IRQ_CHIPS] = { .ack_base = CPCAP_REG_MI2, .mask_base = CPCAP_REG_MIM2, .use_ack = true, - .ack_invert = true, + .clear_ack = true, }, { .name = "cpcap1-4", @@ -115,7 +115,7 @@ static struct regmap_irq_chip cpcap_irq_chip[CPCAP_NR_IRQ_CHIPS] = { .ack_base = CPCAP_REG_INT1, .mask_base = CPCAP_REG_INTM1, .use_ack = true, - .ack_invert = true, + .clear_ack = true, }, }; -- 2.27.0