From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751242AbdEaJWU (ORCPT ); Wed, 31 May 2017 05:22:20 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:58640 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751021AbdEaJWS (ORCPT ); Wed, 31 May 2017 05:22:18 -0400 Date: Wed, 31 May 2017 11:22:14 +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: <20170530231956.GA25960@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> 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: > On Sat, May 27, 2017 at 10:16:37AM +0200, Thomas Gleixner wrote: > > On Sat, 27 May 2017, jeffy wrote: > > > for example when a driver(drivers/net/wireless/marvell/mwifiex/main.c) try to > > > do these: > > > > > > devm_request_irq->irq_startup->irq_enable > > > disable_irq <-- disabled and masked > > > devm_free_irq->irq_shutdown <-- disable it again > > > > This driver is broken as hell. > > No argument on the general statement :) > > > It requests the interrupt _BEFORE_ the whole > > thing is initialized. If there is a pending interrupt on that line, it will > > explode nicely before it is able to disable the irq. But that's a different > > problem. > > For that particular interrupt, it's mostly an informational interrupt > regarding wakeups. We don't do anything that could blow up there, except > report a (spurious) wakeup event. (And this spurious wakeup event only > occurs because the Wifi firmware may toggle its "wake" pin even when the > system is already awake. A weird behavior...) > > So yes, the pattern isn't great, but no, it's not going to blow up, > AFAIK. Fair enough. Thanks, tglx