Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1405193

[PATCH v2 RESEND] mfd: arizona: Check if AOD interrupts are pending before dispatching

Path csiph.com!goblin3!goblin1!goblin.stu.neva.ru!nntpspool.opticnetworks.net!nntpspool01.opticnetworks.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Newsgroups linux.kernel
Subject [PATCH v2 RESEND] mfd: arizona: Check if AOD interrupts are pending before dispatching
Date Mon, 23 May 2016 11:30:02 +0200
Message-ID <rBUls-427-15@gated-at.bofh.it> (permalink)
X-Original-To <lee.jones@linaro.org>
Authentication-Results ppops.net; spf=none smtp.mailfrom=rf@opensource.wolfsonmicro.com
X-Mailer git-send-email 1.9.1
MIME-Version 1.0
Content-Type text/plain
X-Proofpoint-Spam-Details rule=notspam policy=default score=0 priorityscore=1501 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1605230114
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 43
Organization linux.* mail to news gateway
X-Original-Cc <patches@opensource.wolfsonmicro.com>, <linux-kernel@vger.kernel.org>
X-Original-Date Mon, 23 May 2016 10:23:54 +0100
X-Original-Message-ID <1463995434-6023-1-git-send-email-rf@opensource.wolfsonmicro.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1405193

Show key headers only | View raw


Previously the arizona_irq_thread implementation would call
handle_nested_irqs() to handle AOD interrupts without checking if any
were actually pending. The kernel will see these as spurious IRQs and
will eventually disable the IRQ.

This patch ensures we only launch the nested handler if there are AOD
interrupts pending in the codec.

Signed-off-by: Simon Trimmer <simont@opensource.wolfsonmicro.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
---
 drivers/mfd/arizona-irq.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c
index edeb495..5e18d3c 100644
--- a/drivers/mfd/arizona-irq.c
+++ b/drivers/mfd/arizona-irq.c
@@ -109,8 +109,20 @@ static irqreturn_t arizona_irq_thread(int irq, void *data)
 	do {
 		poll = false;
 
-		if (arizona->aod_irq_chip)
-			handle_nested_irq(irq_find_mapping(arizona->virq, 0));
+		if (arizona->aod_irq_chip) {
+			/*
+			 * Check the AOD status register to determine whether
+			 * the nested IRQ handler should be called.
+			 */
+			ret = regmap_read(arizona->regmap,
+					  ARIZONA_AOD_IRQ1, &val);
+			if (ret)
+				dev_warn(arizona->dev,
+					"Failed to read AOD IRQ1 %d\n", ret);
+			else if (val)
+				handle_nested_irq(
+					irq_find_mapping(arizona->virq, 0));
+		}
 
 		/*
 		 * Check if one of the main interrupts is asserted and only
-- 
1.9.1

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v2 RESEND] mfd: arizona: Check if AOD interrupts are pending before dispatching Richard Fitzgerald <rf@opensource.wolfsonmicro.com> - 2016-05-23 11:30 +0200

csiph-web