Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp994817pxv; Thu, 15 Jul 2021 22:19:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+vTZyYsBObj1TTJNQWuUSk5PtfNqfCX/Zjarce7B4FOXndLvOFhI9o1SQSVSuHRU8PyGF X-Received: by 2002:a05:6402:1615:: with SMTP id f21mr11981717edv.35.1626412773353; Thu, 15 Jul 2021 22:19:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626412773; cv=none; d=google.com; s=arc-20160816; b=w52q7ld2S97OLceC1g3jExWey9xtrPASkEqfFIW+173asJnJG+nRONNFfOX3mYYwS0 sliRpaZM7rQAkFf7NmZw4yBf1s8Mnk5QJe27B8hoTO7zlDsOqO8caLMfjB3pGnsM4fNP kSp6ugRAQTckrmy97of4MXWEl0L2OqqY6lnMkHZpNWuEL4zEbNoMNLxTZlloPOp0SHxN /64Unq20YdFpi9kAeaIqu6SBBdJCsapkmJD2aAJ33eK6DMJb52ZqbY+JfOKVbUzfeBpG K2zPqX7zNYQnZD09RmMepFdkgN8Y1MdohEBAdgKn+oqEoZVnws6lSthoU14rxXRoLBgi Xe6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=URhc6K9K9YykyADttst8k0SQTfIC21/tZGDTuby5juI=; b=NivFFe0qrn0C7O9HmaGXmyHXbZY5AX0xvWFml4ejTqE4BAxOEY9qxRr0GJiRXK/wYD 5dyquzrHI/ssHpP+BgExtVDUAP5dIeM5c3y/3TxQ+bUl0awfXyjNDuXNou5WtOSE5bqP 00srgv+FnEzG39G3zk7XlvPMLOJMsCblB2H/L+XTRXuqL6eGJzHT1VqHrA4lzoBCNktk OQ4FV9JLpPctLyUiRPebjGLsoBItMDp8DYIIT5tBXUf5JD+mpSCSC1scsgS6xZNnJ1vv Ez2Eq0SFLRxqQ0QQ5Z7vrnSKxaWvMrTuhRYGa5mCQgScTWzCimUIunx8CjK24TEWWzXU UJmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b="QrZFxBX/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h3si7738685ede.293.2021.07.15.22.19.10; Thu, 15 Jul 2021 22:19:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b="QrZFxBX/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234084AbhGPFVI (ORCPT + 99 others); Fri, 16 Jul 2021 01:21:08 -0400 Received: from smtp-relay-canonical-0.canonical.com ([185.125.188.120]:43952 "EHLO smtp-relay-canonical-0.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234045AbhGPFVI (ORCPT ); Fri, 16 Jul 2021 01:21:08 -0400 Received: from [192.168.119.29] (unknown [223.104.244.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id B7849408A9; Fri, 16 Jul 2021 05:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1626412692; bh=URhc6K9K9YykyADttst8k0SQTfIC21/tZGDTuby5juI=; h=Subject:To:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=QrZFxBX/ebzqF81C9sIlK+nTKBZsiy9tyweuW6/bt/kkJwfbUMOHYM7br4WbxBu50 uBNVJRHan6Ctr/pKTWSGUPX8ZqbQYyy6u7ypHBxc61sDIg6NDviKdPcJ/w5shXE3yh RnW+b51cTWGgvYrTsEBH2QYKrRcyv56GTwDAfV/J+TCiIPY25wA1XbLusE1QsCU3zT vP9Y0HbidpZtOndNOfvq7vHQWvah0vYLadFrQ6gHxeprN7f2HJjb0MyXd7S+tx3G87 K5w5XZxMs6b3M/4f431yvaLlc/OzLZxFoC2sIRLeEYhiOwS1p5wXfVs7zHmckd+1eE ICxT2s6TKHIvA== Subject: Re: [PATCH 5.10 187/593] ACPI: resources: Add checks for ACPI IRQ override To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, jamie@audible.transient.net References: <20210712060903.591188609@linuxfoundation.org> From: Hui Wang Message-ID: <85f135af-2610-80e8-0659-30666018d893@canonical.com> Date: Fri, 16 Jul 2021 13:18:06 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/15/21 4:49 PM, Jamie Heilman wrote: > Greg Kroah-Hartman wrote: >> From: Hui Wang >> >> [ Upstream commit 0ec4e55e9f571f08970ed115ec0addc691eda613 ] >> >> The laptop keyboard doesn't work on many MEDION notebooks, but the >> keyboard works well under Windows and Unix. > This patch makes my EPIA VIA Esther system stop booting correctly. > Reverting it returns things to normal operation. The symptoms are > pretty strange. When the kernel hands off to init I get none of the > usual output from userspace, but I still get the occasional message > from the kernel as modules load. Despite some processes continuing on > in the background, I'm never able to ssh into the host, and it never > displays a getty on serial console like it should. Sending a break > and a command key over serial doesn't work like it should either. > I've found I was able to somewhat get a little bit of IO if I plugged > in a keyboard or unplugged it, like just jiggling the handle of the > usb hot plug routines was enough to get my system to reboot so I only > had to resort to hard resets a few times. At any rate, maybe this > patch wasn't really ready for stable. Hi Jamie, Could you please use acpidump to dump the acpi tables and upload them/it to: http://bugs.launchpad.net/bugs/1909814 Thanks. >> Through debugging, we found this log in the dmesg: >> >> ACPI: IRQ 1 override to edge, high >> pnp 00:03: Plug and Play ACPI device, IDs PNP0303 (active) >> >> And we checked the IRQ definition in the DSDT, it is: >> >> IRQ (Level, ActiveLow, Exclusive, ) >> {1} >> >> So the BIOS defines the keyboard IRQ to Level_Low, but the Linux >> kernel override it to Edge_High. If the Linux kernel is modified >> to skip the IRQ override, the keyboard will work normally. >> >> From the existing comment in acpi_dev_get_irqresource(), the override >> function only needs to be called when IRQ() or IRQNoFlags() is used >> to populate the resource descriptor, and according to Section 6.4.2.1 >> of ACPI 6.4 [1], if IRQ() is empty or IRQNoFlags() is used, the IRQ >> is High true, edge sensitive and non-shareable. ACPICA also assumes >> that to be the case (see acpi_rs_set_irq[] in rsirq.c). >> >> In accordance with the above, check 3 additional conditions >> (EdgeSensitive, ActiveHigh and Exclusive) when deciding whether or >> not to treat an ACPI_RESOURCE_TYPE_IRQ resource as "legacy", in which >> case the IRQ override is applicable to it. >> >> Link: https://uefi.org/specs/ACPI/6.4/06_Device_Configuration/Device_Configuration.html#irq-descriptor # [1] >> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=213031 >> BugLink: http://bugs.launchpad.net/bugs/1909814 >> Suggested-by: Rafael J. Wysocki >> Reported-by: Manuel Krause >> Tested-by: Manuel Krause >> Signed-off-by: Hui Wang >> [ rjw: Subject rewrite, changelog edits ] >> Signed-off-by: Rafael J. Wysocki >> Signed-off-by: Sasha Levin >> --- >> drivers/acpi/resource.c | 9 ++++++++- >> 1 file changed, 8 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c >> index f2f5f1dc7c61..9d82440a1d75 100644 >> --- a/drivers/acpi/resource.c >> +++ b/drivers/acpi/resource.c >> @@ -430,6 +430,13 @@ static void acpi_dev_get_irqresource(struct resource *res, u32 gsi, >> } >> } >> >> +static bool irq_is_legacy(struct acpi_resource_irq *irq) >> +{ >> + return irq->triggering == ACPI_EDGE_SENSITIVE && >> + irq->polarity == ACPI_ACTIVE_HIGH && >> + irq->shareable == ACPI_EXCLUSIVE; >> +} >> + >> /** >> * acpi_dev_resource_interrupt - Extract ACPI interrupt resource information. >> * @ares: Input ACPI resource object. >> @@ -468,7 +475,7 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index, >> } >> acpi_dev_get_irqresource(res, irq->interrupts[index], >> irq->triggering, irq->polarity, >> - irq->shareable, true); >> + irq->shareable, irq_is_legacy(irq)); >> break; >> case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: >> ext_irq = &ares->data.extended_irq; >> -- >> 2.30.2 >>