From patchwork Mon Jan 29 16:49:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 10190117 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 476716020C for ; Mon, 29 Jan 2018 16:49:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3616B23B34 for ; Mon, 29 Jan 2018 16:49:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AD94284FC; Mon, 29 Jan 2018 16:49:52 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B0DDF23B34 for ; Mon, 29 Jan 2018 16:49:51 +0000 (UTC) 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=CIwvbVMZReI4R/nmKNkZOlU7VFqBduhnf6AvrIWITwM=; b=T64 NEw4hNDCtWyRsrJnKhV0GDDolRtuDnVmInLvXTRVZl71UeSH5ONuqUVreTCVS290M+ZFRox9Na40Z bXxy1uTC8MJ91ilugyldXEe6Z8W6oCqVYMtEIWXamJATrAm0/0Mysrn3hsduF3tz1y/uqgOrkDSjr YdWwQPYfALZ0NkDob2wWtoTacOcU2TatQIh+xxRLdKMkbb3DHw3CC4IsGYdU8DHhaqIDnxc1rzOYH 5M5oves/EmgFzO/nCRWWbRwTqQOHiAlChScnDH48kM7oXj6S9kfqTVeBKgm0x+AoSj05tF4mJjUYx h8pib/sHoGPLE3vkfuGKPeirXwmALZQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1egCcw-0004Ua-2U; Mon, 29 Jan 2018 16:49:50 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1egCct-0004RE-0g for linux-arm-kernel@lists.infradead.org; Mon, 29 Jan 2018 16:49:48 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 22F42609F3; Mon, 29 Jan 2018 16:49:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1517244576; bh=P8vTxoxRT3iGek8uJYX6PCVwv5QZZQgpdU+fjlG87AY=; h=From:To:Cc:Subject:Date:From; b=bO2qyzBoSWL+Blm8bQfklUKp7vkaNxSGB+EWU3vU8btFRhYMjiUEzdCvx0QmwppPK lnWguj0yPMq0SLHDkTpuTYAwvudCEf4zfJMYHJJ+9WksuEmImlgBT5Ng/+Z6VoVKvO eN6tHEZBZAL0rjR8Fx9KwyMq3rKrCL9Yq9ZVLicw= Received: from sboyd-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sboyd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 02104609F3; Mon, 29 Jan 2018 16:49:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1517244575; bh=P8vTxoxRT3iGek8uJYX6PCVwv5QZZQgpdU+fjlG87AY=; h=From:To:Cc:Subject:Date:From; b=hn111d67Hmc6m23CQtgxgy3soQF4yjKpad1U+cPkoTWYcgU9G/cx+st4b5pdT4wYp bFw6NHVv3UEi+M+AYS2mYh5cHqUr1OjPhJQiGjCegRkEnKfojwv+7x8t9+NqNZ+x0r AaI82zlb6GTMEomCZG1jLt/a4MClQzge5ZwQuZZQ= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 02104609F3 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sboyd@codeaurora.org From: Stephen Boyd To: Thomas Gleixner , Jason Cooper , Marc Zyngier Subject: [PATCH] irqchip/gic-v3: Ignore disabled ITS nodes Date: Mon, 29 Jan 2018 08:49:33 -0800 Message-Id: <20180129164933.25479-1-sboyd@codeaurora.org> X-Mailer: git-send-email 2.15.0.374.g5f9953d2c365 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, Rajendra Nayak , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On some platforms there's an ITS available but it's not enabled because reading or writing the registers is denied by the firmware. In fact, reading or writing them will cause the system to reset. We could remove the node from DT in such a case, but it's better to skip nodes that are marked as "disabled" in DT so that we can describe the hardware that exists and use the status property to indicate how the firmware has configured things. Cc: Marc Zyngier Cc: Rajendra Nayak Signed-off-by: Stephen Boyd --- drivers/irqchip/irq-gic-v3-its-pci-msi.c | 2 ++ drivers/irqchip/irq-gic-v3-its-platform-msi.c | 2 ++ drivers/irqchip/irq-gic-v3-its.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3-its-pci-msi.c b/drivers/irqchip/irq-gic-v3-its-pci-msi.c index 77931214d954..6b5f50e1fc72 100644 --- a/drivers/irqchip/irq-gic-v3-its-pci-msi.c +++ b/drivers/irqchip/irq-gic-v3-its-pci-msi.c @@ -132,6 +132,8 @@ static int __init its_pci_of_msi_init(void) for (np = of_find_matching_node(NULL, its_device_id); np; np = of_find_matching_node(np, its_device_id)) { + if (!of_device_is_available(np)) + continue; if (!of_property_read_bool(np, "msi-controller")) continue; diff --git a/drivers/irqchip/irq-gic-v3-its-platform-msi.c b/drivers/irqchip/irq-gic-v3-its-platform-msi.c index 833a90fe33ae..8881a053c173 100644 --- a/drivers/irqchip/irq-gic-v3-its-platform-msi.c +++ b/drivers/irqchip/irq-gic-v3-its-platform-msi.c @@ -154,6 +154,8 @@ static void __init its_pmsi_of_init(void) for (np = of_find_matching_node(NULL, its_device_id); np; np = of_find_matching_node(np, its_device_id)) { + if (!of_device_is_available(np)) + continue; if (!of_property_read_bool(np, "msi-controller")) continue; diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 284738add89b..a84ee6ce244d 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1815,6 +1815,8 @@ static int __init its_of_probe(struct device_node *node) for (np = of_find_matching_node(node, its_device_id); np; np = of_find_matching_node(np, its_device_id)) { + if (!of_device_is_available(np)) + continue; if (!of_property_read_bool(np, "msi-controller")) { pr_warn("%s: no msi-controller property, ITS ignored\n", np->full_name);