From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6331C3A5A0 for ; Mon, 19 Aug 2019 13:29:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7985B2085A for ; Mon, 19 Aug 2019 13:29:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rBnbn6SG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7985B2085A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=hisilicon.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=G/gIMma+XdkzXH6QWDhwvslhUYwLU51OkeDQAg4Je3Y=; b=rBnbn6SGW2AW6i ecKSXiP3Emt+eNJbHghpmcGBmi7lEc8gE8RkKlWfquwij6U8h42CGuwTE2ZdAjwQ3xsvncGCZWB7V lB77f+hoKrvOrPQqkWbj39srAem6+MKQPKGNmDq4+QBVEn9YXQNqc6PhrI6W+G3fQhYYIV1wWgz00 1QkYz1PoILCUC2ohtddCuuFwUGjHpgRPXDTa/JtrjzGDejcwQ5vG3UL5AsPIdVOkC9jwftkPl0BJp 5pWJdXJxu5+DC+0GhgsjQskkS9gkVVa2+axJMhrvug5X9Di0lWuV5WIc6YtbaRqA/Cy6mJmT3vsbX FmIBoFWP3fX4qmcXVUrA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hzhio-0005ec-4q; Mon, 19 Aug 2019 13:29:18 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hzhik-0005dz-1K for linux-arm-kernel@lists.infradead.org; Mon, 19 Aug 2019 13:29:15 +0000 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 8EC5B6C097E5FE472E6A; Mon, 19 Aug 2019 21:29:11 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Mon, 19 Aug 2019 21:29:05 +0800 From: Wei Xu To: , , , , , , , , Subject: [PATCH v3] gpio: pl061: Fix the issue failed to register the ACPI interrtupion Date: Mon, 19 Aug 2019 21:27:05 +0800 Message-ID: <1566221225-5170-1-git-send-email-xuwei5@hisilicon.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190819_062914_236607_1B01AD65 X-CRM114-Status: GOOD ( 12.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: salil.mehta@huawei.com, jinying@hisilicon.com, tangkunshan@huawei.com, john.garry@huawei.com, linuxarm@huawei.com, shameerali.kolothum.thodi@huawei.com, huangdaode@hisilicon.com, jonathan.cameron@huawei.com, liguozhu@hisilicon.com, zhangyi.ac@huawei.com, shiju.jose@huawei.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Invoke acpi_gpiochip_request_interrupts after the acpi data has been attached to the pl061 acpi node to register interruption. Otherwise it will be failed to register interruption for the ACPI case. Because in the gpiochip_add_data_with_key, acpi_gpiochip_add is invoked after gpiochip_add_irqchip but at that time the acpi data has not been attached yet. Tested with below steps: qemu-system-aarch64 \ -machine virt,gic-version=3 -cpu cortex-a57 \ -m 1G,maxmem=4G,slots=4 \ -kernel Image -initrd rootfs.cpio.gz \ -net none -nographic \ -bios QEMU_EFI.fd \ -append "console=ttyAMA0 acpi=force earlycon=pl011,0x9000000" The pl061 interruption is missed and the following output is not in the /proc/interrupts on the v5.3-rc4 compared with the v5.2.0-rc7. 43: 0 ARMH0061:00 3 Edge ACPI:Event Fixes: 04ce935c6b2a ("gpio: pl061: Pass irqchip when adding gpiochip") Signed-off-by: Wei Xu --- v2 -> v3: * addressed the comments of Andy to show only affected output of /proc/interrupts and drop the whole log of v5.2.0-rc7 v1- > v2: * rebased on https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/log/?h=devel * attached the log based on QEMU v3.0.0 and Linux kernel v5.2.0-rc7 --- drivers/gpio/gpio-pl061.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 722ce5c..e1a434e 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -8,6 +8,7 @@ * * Data sheet: ARM DDI 0190B, September 2000 */ +#include #include #include #include @@ -24,6 +25,9 @@ #include #include +#include "gpiolib.h" +#include "gpiolib-acpi.h" + #define GPIODIR 0x400 #define GPIOIS 0x404 #define GPIOIBE 0x408 @@ -345,6 +349,9 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) if (ret) return ret; + if (has_acpi_companion(dev)) + acpi_gpiochip_request_interrupts(&pl061->gc); + amba_set_drvdata(adev, pl061); dev_info(dev, "PL061 GPIO chip registered\n"); -- 2.8.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel