From patchwork Wed Nov 22 15:50:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 10070625 X-Patchwork-Delegate: andy.shevchenko@gmail.com 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 2B9CB601D5 for ; Wed, 22 Nov 2017 15:50:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B26829C19 for ; Wed, 22 Nov 2017 15:50:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F84E29C2D; Wed, 22 Nov 2017 15:50:38 +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 A4B6A29C19 for ; Wed, 22 Nov 2017 15:50:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751784AbdKVPug (ORCPT ); Wed, 22 Nov 2017 10:50:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40110 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751781AbdKVPuf (ORCPT ); Wed, 22 Nov 2017 10:50:35 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C4B85D689; Wed, 22 Nov 2017 15:50:35 +0000 (UTC) Received: from shalem.localdomain (ovpn-117-4.ams2.redhat.com [10.36.117.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8F1A86F115; Wed, 22 Nov 2017 15:50:34 +0000 (UTC) Subject: Re: Failed IRQ assignment for INT0002 on Braswell To: Oleksandr Natalenko Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org References: <1902393.IdeYHqtVB8@natalenko.name> <3c09b28b-6ca5-cd1c-f5c0-f7be73f1c1b4@redhat.com> <2100487.obXIbN4R9M@natalenko.name> From: Hans de Goede Message-ID: Date: Wed, 22 Nov 2017 16:50:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <2100487.obXIbN4R9M@natalenko.name> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 22 Nov 2017 15:50:35 +0000 (UTC) Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, On 22-11-17 13:48, Oleksandr Natalenko wrote: > Hi, Hans. > > On středa 22. listopadu 2017 11:48:50 CET Hans de Goede wrote: >> /* snip */ >> This should be fixed by: >> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/ke >> rnel/irq?id=382bd4de61827dbaaf5fb4fb7b1f4be4a86505e7 >> >> Which is in 4.13, but the trigger-type does not seem to be the problem in >> your case, the problem likely is the ONESHOT flag: >> >> #define IRQF_ONESHOT 0x00002000 >> >> Which appears to be set in the flags for the acpi irq handler: >> > kernel: genirq: Flags mismatch irq 9. 00010084 (INT0002) vs. 00002080 >> > (acpi) >> But that irq is requested here: >> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/driv >> ers/acpi/osl.c#n570 >> >> >> >> if (request_irq(irq, acpi_irq, IRQF_SHARED, "acpi", acpi_irq)) { >> printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq); >> ... >> >> And IRQF_ONESHOT is not passed, so I do not understand where the 00002000 in >> the acpi irq handler flags is coming from ... > > Well, looks like I know where this flag comes from. I boot this machine with > "threadirqs", and IRQF_ONESHOT description says: > > === > 52 * IRQF_ONESHOT - Interrupt is not reenabled after the hardirq handler > finished. > 53 * Used by threaded interrupts which need to keep the > 54 * irq line disabled until the threaded handler has been > run. > === > > If I boot the machine without "threadirqs", looks like the device is set up > okay. The only message I get in the kernel log is: > > === > kernel: acpi INT0002:00: Device [GPED] is in always present list > === > > Grepping for IRQ 9: > > === > kernel: ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level) > kernel: ACPI: IRQ9 used by override. > === > > and 9th interrupt shows this device: > > === > 9: 0 0 0 0 IO-APIC 9-fasteoi > acpi, INT0002 > === > > Any idea why "threadirqs" makes this fail? Yes, I think this is caused by the int0002 vgpio driver unnecessarily passing the IRQF_NO_THREAD flag, attached is a patch which should fix this, can you give this a try ? Regards, Hans Reported-by: Tested-by: Reported-by: Oleksandr Natalenko Tested-by: Oleksandr Natalenko From a68410ecefc73b538f8123c59bd6d2aade4600ba Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 22 Nov 2017 16:36:05 +0100 Subject: [PATCH v2] platform/x86: intel_int0002_vgpio: Remove IRQF_NO_THREAD irq flag Remove the IRQF_NO_THREAD irq flag, there is no need for it and it breaks irq-sharing with the "acpi" irq when passing "threadirqs" on the kernel cmdline, as the acpi/osl.c code does not pass IRQF_NO_THREAD. Reported-by: Oleksandr Natalenko Signed-off-by: Hans de Goede --- drivers/platform/x86/intel_int0002_vgpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/intel_int0002_vgpio.c b/drivers/platform/x86/intel_int0002_vgpio.c index f7b67e898abc..a473dc51b18d 100644 --- a/drivers/platform/x86/intel_int0002_vgpio.c +++ b/drivers/platform/x86/intel_int0002_vgpio.c @@ -180,7 +180,7 @@ static int int0002_probe(struct platform_device *pdev) * to gpiochip_set_chained_irqchip, because the irq is shared. */ ret = devm_request_irq(dev, irq, int0002_irq, - IRQF_SHARED | IRQF_NO_THREAD, "INT0002", chip); + IRQF_SHARED, "INT0002", chip); if (ret) { dev_err(dev, "Error requesting IRQ %d: %d\n", irq, ret); return ret; -- 2.14.3