From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756057AbdE0Kvh (ORCPT ); Sat, 27 May 2017 06:51:37 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:43968 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751968AbdE0Kvg (ORCPT ); Sat, 27 May 2017 06:51:36 -0400 Date: Sat, 27 May 2017 12:51:34 +0200 (CEST) From: Thomas Gleixner To: jeffy cc: linux-kernel@vger.kernel.org, briannorris@chromium.org, dianders@chromium.org, tfiga@chromium.org Subject: Re: [PATCH v2] genirq: Check irq disabled & masked states in irq_shutdown In-Reply-To: <59295059.7070509@rock-chips.com> Message-ID: References: <1495860765-32399-1-git-send-email-jeffy.chen@rock-chips.com> <59295059.7070509@rock-chips.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 Sat, 27 May 2017, jeffy wrote: > On 05/27/2017 04:30 PM, Thomas Gleixner wrote: > > On Sat, 27 May 2017, Jeffy Chen wrote: > > > > > If a irq is already disabled & masked, free_irq may cause a unbalanced > > > irq shutdown/disable/mask, for example: > > > > No, it's not. irq_shutdown/disable/mask are low level access functions > > which can be invoked at any given time. > > > > The only interface which has refcounting is disable/enable_irq(). > but i think it still be good trying to make them balance, at least for irq > enable/disable :) If we make them balanced then we do it proper and not just for the single issue you are facing. And we do not try. We analyze it proper and fix it. It's not rocket science, but yes it takes a bit longer than cobbling something together which works just for you. Thanks, tglx