From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967020AbcA1QWv (ORCPT ); Thu, 28 Jan 2016 11:22:51 -0500 Received: from www.linutronix.de ([62.245.132.108]:33549 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966462AbcA1QWq (ORCPT ); Thu, 28 Jan 2016 11:22:46 -0500 Date: Thu, 28 Jan 2016 17:21:41 +0100 (CET) From: Thomas Gleixner To: Ulf Hansson cc: Russell King - ARM Linux , Haibo Chen , linux-mmc , "linux-kernel@vger.kernel.org" , Jon Hunter Subject: Re: [PATCH] mmc: sdhci: disable irq in sdhci host suspend ranther than free this irq In-Reply-To: Message-ID: References: <1453974146-20951-1-git-send-email-haibo.chen@nxp.com> <20160128102057.GJ10826@n2100.arm.linux.org.uk> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 28 Jan 2016, Ulf Hansson wrote: > On 28 January 2016 at 11:20, Russell King - ARM Linux > wrote: > >> - free_irq(host->irq, host); > >> + disable_irq(host->irq); > > > > This is really not acceptable I'm afraid. While it's common on ARM for > > each interrupt to be uniquely allocated to a peripheral, not all SDHCI > > platforms have that luxury. > > > > SDHCI is also used on PCI, and on x86 platforms, it's common to have PCI > > interrupts shared between (sometimes many) different PCI devices. > > > > For example, on my laptop: > > > > 18: 1089806 286185 IO-APIC-fasteoi uhci_hcd:usb8, r852, mmc0 > > > > the SDHCI interrupt is shared with two other peripherals - one USB > > controller and a NAND device. > > > > Disabling the interrupt will adversely impact other peripherals and > > cause regressions where the interrupt is shared. > > I thought disable|enable_irq() was being reference counted, so it > shouldn't impact the other peripherals for shared IRQs. I might have > understood this wrong though!? It's reference counted. But it disables the irq line and not a particular interrupt handler. > Although, as if that's the case it also means that the IRQ can still > reach sdhci's irq handler as it hasn't actually been disabled. No. The result is that the other devices on the same irq line won't get any interrupt anymore. > Therefore, the only way we currently can make sure to don't get the > IRQ is to free and later re-request it. Now, apparently that has > issues when using threaded IRQ handlers. What's the issue? Thanks, tglx