From patchwork Thu Apr 6 11:47:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Temerkhanov X-Patchwork-Id: 9666913 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 B8E6C601EB for ; Thu, 6 Apr 2017 11:48:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A92FB28501 for ; Thu, 6 Apr 2017 11:48:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DF8928534; Thu, 6 Apr 2017 11:48:24 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham 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 50C1A28501 for ; Thu, 6 Apr 2017 11:48:24 +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:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=yTJUS3S6EUztcwW3SBcjdpxOWp88vq1keuLosEAo7p4=; b=aLYe0MKGfu7Nu2 qaF0XOCC/DltT7Q1Rpa2kCBh79tqsQUYFPjtQ3Rb7B965yzgEHUGB9iuC9SgYNs+rdJTgnFKu3whT Q+JU186JXDKTu/C/gTh13PVUXazaa2a/6ik/f3f2BHSF7udq17UIOwkyEw5ZsyZkQ//9EfeClVYvp yJLc8yAR5hNEVHyEn4W9iE0+Rp2iJ4h+pFHtOPkq4xSKqM08X+kn3pqGQVj1FHRuRY00jqSfcejUt q3w6IlhorwBp8I+a5NkV2bJ7Z7/oj3aHe6JzlI6tSFA19xVTBXVDe37II/Dy2x/9RAC7y6HsWTQon hc4rAuhMxhIwTMe/XqSw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cw5ti-000622-Cj; Thu, 06 Apr 2017 11:48:18 +0000 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cw5te-000613-Hh for linux-arm-kernel@lists.infradead.org; Thu, 06 Apr 2017 11:48:16 +0000 Received: by mail-qk0-x243.google.com with SMTP id p22so5419137qka.0 for ; Thu, 06 Apr 2017 04:47:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=K9qlw+R8oTgAjI+x7L9yvllrMT92LQ1iGXlgW0ZWvZA=; b=OsUFo7ZjbQ553Ld2KByYnhPAnHbXC+9/ygzMqrQnnBMAHIeE8wyp2s0GtazPTAHkd3 lMD3UjSHb42IXyMYt4dRLd/U87qOXTQYV+ZkzFot8SPCvUprhPs6LPt4GPAInJoXyVkx UcCK8bMRG2eHm7TG51f+vDxstiraoWeEvtBb+JtwQozEJY0/r9hI8RCEsaX8jg/JuVEM zZ16X8oRGykdf0o/luO8AEWobEImYwb2MHB+cf10yWxJ2FJaGst+ZfRbr+spHl4UNGYK yaEy/Q+Tj1Yiacb5L9PwhFoUQFniLeF7fOg9KboH3IKk89lc7f2pfYGxuhP3hFVKclYX TrnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=K9qlw+R8oTgAjI+x7L9yvllrMT92LQ1iGXlgW0ZWvZA=; b=HLHZr6LsMcjIsuAxi/IzCC58/CiFn61KuoTGFFenuRRtDgqIF8IF8dtuvdh7KVLjC8 CF1f/seZxDgbxMfS4HEG643IusNlfC5rUJCzw5UGSqMCyMpevo9F80hbHaWsyuuC+DhC 18C4igtAawRsu7NojKi/KeV6GDecbQMF0i63ZEgQ/ULEVDy69MHBz3ROkbZJwBSt4kFs UYRYdsz0KENG+9FmgsO8oDLyhDWgOZGgzzyBZ614aQnk82hKvxCZsS/GNzScKC2oVEcx OyykSS+6h628VTein8+3I1JQmOF/Nzkrt8t4THopkbO7JllyNgcBb5356s12ZWSnrXPK vT+g== X-Gm-Message-State: AFeK/H3iKnU1ctxAj1nqRJssM7Bck5o8wb57r8ABiQvNMEx8o/ZEu5NiBTIE2oAUNvcqCg== X-Received: by 10.55.126.2 with SMTP id z2mr35817440qkc.126.1491479270983; Thu, 06 Apr 2017 04:47:50 -0700 (PDT) Received: from localhost.localdomain (64.2.3.196.ptr.us.xo.net. [64.2.3.196]) by smtp.gmail.com with ESMTPSA id 16sm787607qkk.2.2017.04.06.04.47.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Apr 2017 04:47:50 -0700 (PDT) From: Sergey Temerkhanov To: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] arm64: acpi: Support PCI devices numa_node property in ACPI mode Date: Thu, 6 Apr 2017 11:47:11 +0000 Message-Id: <20170406114711.17261-1-s.temerkhanov@gmail.com> X-Mailer: git-send-email 2.12.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170406_044814_687325_4EEAABE9 X-CRM114-Status: GOOD ( 11.66 ) 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: , 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 This commit modifies ARM64-specific ACPI PCI support functions to properly set the numa_node property on host bridges and thus on PCI devices. Such support requires _PXM objects to be set in DSDT/SSDT tables describing PCI root bridges Signed-off-by: Sergey Temerkhanov --- arch/arm64/kernel/pci.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index 4f0e3ebfea4b..c45c7a26f984 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -81,7 +81,16 @@ int raw_pci_write(unsigned int domain, unsigned int bus, int pcibus_to_node(struct pci_bus *bus) { - return dev_to_node(&bus->dev); + struct pci_config_window *cfg = bus->sysdata; + struct acpi_device *adev = NULL; + struct device *dev; + + if (!acpi_disabled) + adev = to_acpi_device(cfg->parent); + + dev = adev ? &adev->dev : &bus->dev; + + return dev_to_node(dev); } EXPORT_SYMBOL(pcibus_to_node); @@ -186,6 +195,8 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) struct pci_bus *bus, *child; struct acpi_pci_root_ops *root_ops; + set_dev_node(&root->device->dev, node); + ri = kzalloc_node(sizeof(*ri), GFP_KERNEL, node); if (!ri) return NULL;