From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755904AbdCGQz6 (ORCPT ); Tue, 7 Mar 2017 11:55:58 -0500 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:43402 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753103AbdCGQzU (ORCPT ); Tue, 7 Mar 2017 11:55:20 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.wolfsonmicro.com From: Charles Keepax To: CC: , Subject: [PATCH v2] genirq: Add support for nested shared IRQs Date: Tue, 7 Mar 2017 16:28:18 +0000 Message-ID: <1488904098-5350-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=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703070131 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I am working on a system which has an audio CODEC and two speaker amps, each of the speaker amps have an open-drain IRQ line which are connected together and attached to a pin on the audio CODEC, which is capable of functioning as an IRQ chip. The audio CODEC then in turn has its own IRQ line which heads back to the host processor. This setup necessitates having a shared nested IRQ on the audio CODEC. Currently however the kernel does not appear to support shared nested IRQs. Fortunately support is fairly easy to add, only required the modification of handle_nested_irq to call all the IRQ handlers, rather than just the first one associated with the IRQ. Signed-off-by: Charles Keepax --- Changes since v1: - Improve commit messages - Use for_each_action_of_desc - Correct handling of note_interrupt Thanks, Charles kernel/irq/chip.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index be3c34e..686be4b 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c @@ -348,7 +348,10 @@ 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); + action_ret = IRQ_NONE; + for_each_action_of_desc(desc, action) + action_ret |= action->thread_fn(action->irq, action->dev_id); + if (!noirqdebug) note_interrupt(desc, action_ret); -- 2.1.4