From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754112AbbBZSR2 (ORCPT ); Thu, 26 Feb 2015 13:17:28 -0500 Received: from down.free-electrons.com ([37.187.137.238]:46162 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753190AbbBZSR1 (ORCPT ); Thu, 26 Feb 2015 13:17:27 -0500 Date: Thu, 26 Feb 2015 19:17:24 +0100 From: Boris Brezillon To: "Rafael J. Wysocki" Cc: Thomas Gleixner , Jason Cooper , Peter Zijlstra , Mark Rutland , linux-kernel@vger.kernel.org, Nicolas Ferre , Jean-Christophe Plagniol-Villard , Alexandre Belloni , linux-arm-kernel@lists.infradead.org Subject: Re: [RFC PATCH 0/3] genirq: mixing IRQF_NO_SUSPEND and wakeup sources on shared IRQs Message-ID: <20150226191724.0ae4ca4e@bbrezillon> In-Reply-To: <8151717.nkhnGBri9h@vostro.rjw.lan> References: <1424771762-16343-1-git-send-email-boris.brezillon@free-electrons.com> <20964379.cuQSlojCVH@vostro.rjw.lan> <20150226164724.4f3c5921@bbrezillon> <8151717.nkhnGBri9h@vostro.rjw.lan> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 26 Feb 2015 19:17:03 +0100 "Rafael J. Wysocki" wrote: > On Thursday, February 26, 2015 04:47:24 PM Boris Brezillon wrote: > > On Thu, 26 Feb 2015 16:44:16 +0100 > > "Rafael J. Wysocki" wrote: [...] > > > > > > But it is still a bit risky. Namely, if the driver in question is sufficiently > > > broken (eg. it may not suspend the device and rely on the fact that its interrupt > > > handler will be run just because it is sharing a "no suspend" IRQ), we may get > > > an interrupt storm. > > > > > > Isn't that a problem? > > > > For me no (I'll fix all the drivers to handle wakeup, and they are all > > already masking interrupts coming from their side in the suspend > > callback). > > I can't talk for other people though. > > The only problem I see here is that you're not informing people that > > they are erroneously mixing IRQF_NO_SUSPEND and !IRQF_NO_SUSPEND anymore > > (you removed the warning backtrace). > > Moreover, you are replacing their handler by a stub when entering > > suspend, so they might end-up receiving spurious interrupts when > > suspended without knowing why ? > > > > How about checking if the number of actions registered with > > IRQF_NO_SUSPEND + those registered with IRQF_COND_SUSPEND (or another > > flag stating that the handler can safely be called in suspended state > > even if it didn't ask for NO_SUSPEND) are equal to the total number of > > registered actions, and complain if it's not the case. > > The same idea I had while talking to Peter over IRC. So the patch below > implements that. Yep, that's what I had in mind. -- Boris Brezillon, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com