From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752488AbdCNOt3 (ORCPT ); Tue, 14 Mar 2017 10:49:29 -0400 Received: from muru.com ([72.249.23.125]:39416 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751673AbdCNOsm (ORCPT ); Tue, 14 Mar 2017 10:48:42 -0400 Date: Tue, 14 Mar 2017 07:48:37 -0700 From: Tony Lindgren To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] genirq: Fix handle_nested_irq() for IRQF_SHARED Message-ID: <20170314144837.GZ20572@atomide.com> References: <20170314005240.18911-1-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Thomas Gleixner [170314 01:40]: > On Mon, 13 Mar 2017, Tony Lindgren wrote: > > > Shared interrupts can be registered with handle_nested_irq(), but > > currently only one of the registered handlers gets called. > > > > The use of shared interrupts with handle_nested_irq() is probably rare, > > but at least a case of a shared VBUS interrupt between USB PHY and > > battery charger drivers for a PMIC makes sense. > > > > Typically for_each_action_of_desc() gets called via handle_irq_event() > > at _handle_irq_event_percpu(), but handle_nested_irq() is different > > because of it's dummy irq_nested_primary_handler(). > > > > Let's fix the issue by calling the handler for all the entries in > > the action list. > > > > Fixes: 399b5da29b9f ("genirq: Support nested threaded irq handling") > > It's not a fix, it's an extension. The nested facility was not meant to > handle shared interrupts in the first place. I really hope that hardware > folks finally understand that irq sharing is crap and broken... Yes totally. > > + for_each_action_of_desc(desc, action) { > > + action_ret = action->thread_fn(action->irq, action->dev_id); > > + if (!noirqdebug) > > + note_interrupt(desc, action_ret); > > This is wrong. See how __handle_irq_event_percpu() does this. But no need > to resend. See: > > http://lkml.kernel.org/r/1488904098-5350-1-git-send-email-ckeepax@opensource.wolfsonmicro.com Oh OK yeah makes sense, my patch is overwriting action_ret.. Thanks, Tony