From patchwork Wed Mar 21 09:49:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 10299021 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1C680600F6 for ; Wed, 21 Mar 2018 09:50:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0519E297C4 for ; Wed, 21 Mar 2018 09:50:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E839D297A2; Wed, 21 Mar 2018 09:50:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22728297CF for ; Wed, 21 Mar 2018 09:50:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751464AbeCUJuf (ORCPT ); Wed, 21 Mar 2018 05:50:35 -0400 Received: from mga05.intel.com ([192.55.52.43]:40652 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751396AbeCUJue (ORCPT ); Wed, 21 Mar 2018 05:50:34 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2018 02:50:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,339,1517904000"; d="scan'208";a="39310568" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.168]) ([10.237.72.168]) by fmsmga004.fm.intel.com with ESMTP; 21 Mar 2018 02:50:31 -0700 Subject: Re: Regression in commit "mmc: sdhci-acpi: Handle return value of platform_get_irq" To: Luke Ross , Arvind Yadav , Ulf Hansson Cc: linux-mmc References: <1521574821.5234.7.camel@lukeross.name> <22afe736-1747-cb6b-ac21-2a356e65137a@intel.com> <1521622773.3465.3.camel@lukeross.name> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <4da432a8-8f6f-3544-192b-640f8c4eb0b7@intel.com> Date: Wed, 21 Mar 2018 11:49:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1521622773.3465.3.camel@lukeross.name> Content-Language: en-US Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 21/03/18 10:59, Luke Ross wrote: > On Wed, 2018-03-21 at 09:58 +0200, Adrian Hunter wrote: >> On 20/03/18 21:40, Luke Ross wrote: >>> >>> Please excuse the direct email - I'm writing to you as you were >>> connected (author/reviewer) with Linux kernel commit >>> 1b7ba57ecc864173ef42fff7f8c2e9a880b42bd2 - "mmc: sdhci-acpi: Handle >>> return value of platform_get_irq". >>> >>> Unfortunately this commit has caused a regression on hardware I >>> use, >>> and I'm looking for guidance on how best to fix this. I've raised a >>> ticket at bugzilla.kernel.org, outlining the issue: >>> >>> https://bugzilla.kernel.org/show_bug.cgi?id=199105 >>> >>> ...and I've also posted on the linux-mmc list: >>> >>> https://www.spinics.net/lists/linux-mmc/msg48411.html >>> >>> Unfortunately nobody else has, so far, been able to assist via >>> either >>> of these. >>> >>> Would it be possible for you to have a look at this? If you can >>> suggest >>> the best way to resolve this I'd be happy to try and construct a >>> suitable patch and submit it. I'd be very happy to discuss this on >>> the >>> linux-mmc list if you would prefer. >> >> On the system where you have eMMC working, please show the results >> of: >> >> cat /proc/interrupts >> >> And: >> >> grep -H . /sys/kernel/irq/0/* > > Thanks for your reply. > > /proc/interrupts: > > CPU0 CPU1 CPU2 CPU3 > 0: 13219 23168 0 0 IO-APIC 45- > fasteoi mmc0 > 1: 0 0 0 0 IO-APIC 47- > fasteoi mmc1 > 6: 0 0 0 0 IO-APIC 41- > fasteoi 8086228E:00 > 7: 0 0 0 0 IO-APIC 89- > fasteoi 8086228E:01 > 8: 0 0 0 0 IO-APIC 90- > fasteoi 8086228E:02 > 9: 0 0 0 0 IO-APIC 32- > fasteoi 808622C1:00 > 10: 274 233 0 0 IO-APIC 33- > fasteoi 808622C1:01 > 11: 5 2352 0 0 IO-APIC 34- > fasteoi 808622C1:02 > 12: 0 0 0 0 IO-APIC 35- > fasteoi 808622C1:03 > 13: 0 0 0 0 IO-APIC 36- > fasteoi 808622C1:04 > 14: 253 1323 0 0 IO-APIC 37- > fasteoi 808622C1:05 > 15: 729 435 0 0 IO-APIC 38- > fasteoi 808622C1:06 > 21: 59 101 0 0 IO-APIC 29- > fasteoi intel_sst_driver > 67: 1 0 0 0 chv- > gpio 43 volume_up > 69: 1 0 0 0 chv- > gpio 45 volume_down > 84: 0 0 0 0 chv- > gpio 3 INT3496:00 > 89: 0 0 0 0 chv-gpio 8 home > 90: 0 0 0 0 chv- > gpio 9 axp288_irq_chip > 94: 143 0 0 0 chv- > gpio 13 GDIX1001:00 > 116: 0 0 0 0 IO-APIC 9- > fasteoi INT0002 > 138: 0 0 0 0 chv-gpio 8 power > 205: 0 0 0 0 chv- > gpio 50 80860F14:01 cd > 213: 0 0 0 0 PCI-MSI 458752- > edge PCIe PME > 215: 548 9 0 0 PCI-MSI 327680- > edge xhci_hcd > 217: 1024 0 0 1733 PCI-MSI 32768- > edge i915 > 219: 0 0 0 0 INT0002 Virtual > GPIO 2 ACPI:Event > 222: 0 0 0 0 axp288_irq_chip 2 > axp288_extcon > 223: 0 0 0 0 axp288_irq_chip 3 > axp288_extcon > 224: 0 0 0 0 axp288_irq_chip 4 > axp288_charger > 230: 0 0 0 0 axp288_irq_chip 10 > axp288_charger > 231: 0 0 0 0 axp288_irq_chip 11 > axp288_charger > 232: 0 0 0 0 axp288_irq_chip 12 > axp288_charger > 233: 0 0 0 0 axp288_irq_chip 13 > axp288_charger > 236: 0 0 0 0 axp288_irq_chip 16 > axp288_fuel_gauge > 237: 0 0 0 0 axp288_irq_chip 17 > axp288_fuel_gauge > 238: 0 0 0 0 axp288_irq_chip 18 > axp288_fuel_gauge > 239: 0 0 0 0 axp288_irq_chip 19 > axp288_fuel_gauge > 240: 0 0 0 0 axp288_irq_chip 20 > axp288_charger > 241: 0 0 0 0 axp288_irq_chip 21 > axp288_charger > 242: 0 0 0 0 axp288_irq_chip 22 > axp288_charger > 243: 0 0 0 0 axp288_irq_chip 23 > axp288_charger > 244: 0 0 0 0 axp288_irq_chip 24 > axp288_fuel_gauge > 245: 0 0 0 0 axp288_irq_chip 25 > axp288_fuel_gauge > 260: 0 0 0 0 axp288_irq_chip 40 > axp288_extcon > 261: 0 0 0 0 axp288_irq_chip 41 > axp288_extcon > 263: 0 0 0 0 PCI-MSI 180224- > edge proc_thermal > 264: 21 0 0 0 PCI-MSI 425984- > edge mei_txe > 265: 280 2823 0 0 PCI-MSI 524288- > edge iwlwifi > NMI: 6 3 5 4 Non-maskable > interrupts > LOC: 19814 19515 17574 15631 Local timer > interrupts > SPU: 0 0 0 0 Spurious interrupts > PMI: 6 3 5 4 Performance > monitoring interrupts > IWI: 0 0 0 0 IRQ work interrupts > RTR: 0 0 0 0 APIC ICR read > retries > RES: 4969 3833 5244 4811 Rescheduling > interrupts > CAL: 2975 2371 2514 2386 Function call > interrupts > TLB: 694 558 311 146 TLB shootdowns > TRM: 0 0 0 0 Thermal event > interrupts > THR: 0 0 0 0 Threshold APIC > interrupts > DFR: 0 0 0 0 Deferred Error APIC > interrupts > MCE: 0 0 0 0 Machine check > exceptions > MCP: 1 1 1 1 Machine check polls > ERR: 0 > MIS: 0 > PIN: 0 0 0 0 Posted-interrupt > notification event > NPI: 0 0 0 0 Nested posted- > interrupt event > PIW: 0 0 0 0 Posted-interrupt > wakeup event > > grep -H . /sys/kernel/irq/0/* > > /sys/kernel/irq/0/actions:mmc0 > /sys/kernel/irq/0/chip_name:IO-APIC > /sys/kernel/irq/0/hwirq:45 > /sys/kernel/irq/0/name:fasteoi > /sys/kernel/irq/0/per_cpu_count:13219,19524,0,0 > /sys/kernel/irq/0/type:level > > I've also attached a dmesg to the bugzilla.kernel.org ticket. These > were all taken with a 4.13 kernel. > > I'm guessing that the above means the eMMC does have an interrupt, > IRQ0? Yes. Ulf, here is the fix: From: Adrian Hunter Date: Wed, 21 Mar 2018 11:34:44 +0200 Subject: [PATCH] mmc: sdhci-acpi: Fix IRQ 0 Zero is a valid IRQ number and is being used on some CHT tablets. Stop treating it as an error. Reported-by: Luke Ross Fixes: 1b7ba57ecc86 ("mmc: sdhci-acpi: Handle return value of platform_get_irq") Cc: Arvind Yadav Signed-off-by: Adrian Hunter Cc: stable@vger.kernel.org --- drivers/mmc/host/sdhci-acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index 4065da58789d..32321bd596d8 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -680,7 +680,7 @@ static int sdhci_acpi_probe(struct platform_device *pdev) host->hw_name = "ACPI"; host->ops = &sdhci_acpi_ops_dflt; host->irq = platform_get_irq(pdev, 0); - if (host->irq <= 0) { + if (host->irq < 0) { err = -EINVAL; goto err_free; }