Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753153AbdCFQHj (ORCPT ); Mon, 6 Mar 2017 11:07:39 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:33389 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751392AbdCFQHd (ORCPT ); Mon, 6 Mar 2017 11:07:33 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.wolfsonmicro.com From: Charles Keepax To: CC: , Subject: [PATCH] genirq: Fix handling of nested shared IRQs Date: Mon, 6 Mar 2017 16:08:04 +0000 Message-ID: <1488816484-6029-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703060135 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1215 Lines: 34 When an IRQ is nested the nested handler is called directly from within the threaded handler of the parent IRQ, however, the code in handle_nested_irq only calls a single handler. This means when a shared IRQ is nested only the first of the shared IRQ handlers will be run. This patch adds a loop to move through and process all the handlers associated with the IRQ in handle_nested_irq. Signed-off-by: Charles Keepax --- kernel/irq/chip.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index be3c34e..c6c7f11 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c @@ -348,9 +348,12 @@ void handle_nested_irq(unsigned int irq) irqd_set(&desc->irq_data, IRQD_IRQ_INPROGRESS); raw_spin_unlock_irq(&desc->lock); - action_ret = action->thread_fn(action->irq, action->dev_id); - if (!noirqdebug) - note_interrupt(desc, action_ret); + do { + action_ret = action->thread_fn(action->irq, action->dev_id); + if (!noirqdebug) + note_interrupt(desc, action_ret); + action = action->next; + } while (action); raw_spin_lock_irq(&desc->lock); irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS); -- 2.1.4