From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751323AbdEaIin (ORCPT ); Wed, 31 May 2017 04:38:43 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:58394 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751076AbdEaIil (ORCPT ); Wed, 31 May 2017 04:38:41 -0400 Date: Wed, 31 May 2017 10:38:34 +0200 (CEST) From: Thomas Gleixner To: Brian Norris cc: jeffy , LKML , dianders@chromium.org, tfiga@chromium.org, Johannes Berg Subject: Re: [PATCH] genirq: Check irq disabled & masked states in irq_shutdown In-Reply-To: <20170530233237.GA39733@google.com> Message-ID: References: <1495804658-12410-1-git-send-email-jeffy.chen@rock-chips.com> <592905F7.4010803@rock-chips.com> <20170530231956.GA25960@google.com> <20170530233237.GA39733@google.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 May 2017, Brian Norris wrote: > Sorry to respond to myself. Thomas, your reply to another mail in this > series helped me to notice: > > On Tue, May 30, 2017 at 04:19:58PM -0700, Brian Norris wrote: > > Side note: for issues like the first problem above, I wonder why there > > isn't a flag that once could pass to request_irq() that suggests the IRQ > > should be initially disabled? > > Is that what IRQ_NOAUTOEN is for? Yes. > > I know this wouldn't work for shared > > interrupts (but request_irq() could reject that combination, no?) > > Hehe, but then I see this, for example, when grepping around: > > drivers/usb/dwc3/dwc3-omap.c: > > irq_set_status_flags(omap->irq, IRQ_NOAUTOEN); > ret = devm_request_threaded_irq(dev, omap->irq, dwc3_omap_interrupt, > dwc3_omap_interrupt_thread, IRQF_SHARED, > "dwc3-omap", omap); > > IIUC, that's quite broken, no? Indeed. Because the interrupt could have been requested by some other driver already. In that case IRQ_NOAUTOEN has no effect at all. We probably should check that in __setup_irq() and yell at people. Thanks, tglx