Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754925AbdCGJYA (ORCPT ); Tue, 7 Mar 2017 04:24:00 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:38713 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752390AbdCGJXP (ORCPT ); Tue, 7 Mar 2017 04:23:15 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.wolfsonmicro.com Date: Tue, 7 Mar 2017 09:15:06 +0000 From: Charles Keepax To: Thomas Gleixner CC: , Subject: Re: [PATCH] genirq: Fix handling of nested shared IRQs Message-ID: <20170307091506.GC6986@localhost.localdomain> References: <1488816484-6029-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 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-1703070079 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1614 Lines: 47 On Mon, Mar 06, 2017 at 07:05:39PM +0100, Thomas Gleixner wrote: > On Mon, 6 Mar 2017, Charles Keepax wrote: > > > 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. > > That was never meant to deal with nested shaed interrupts, so the $subject > is misleading. This is not a fix, it's a functional extension. > > Aside of that, please structure the changelog in paragraphs instead of one > big lump. > > 1) Context > 2) Problem > 3) Solution > > See also Documentation/process/submitting-patches.rst and please search > there for "This patch" ..... > > > @@ -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 { > > for_each_action_of_desc() please > > > + action_ret = action->thread_fn(action->irq, action->dev_id); > > + if (!noirqdebug) > > + note_interrupt(desc, action_ret); > > That's wrong. See __handle_irq_event_percpu() for the correct handling of > shared interrupts vs. note_interrupt() > Thanks for the pointers, I will look at those and respin the patch. Thanks, Charles