From patchwork Wed Jan 29 18:18:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 3553711 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C5D62C02DC for ; Wed, 29 Jan 2014 18:21:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DAB5120155 for ; Wed, 29 Jan 2014 18:21:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C55592018A for ; Wed, 29 Jan 2014 18:21:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753304AbaA2STA (ORCPT ); Wed, 29 Jan 2014 13:19:00 -0500 Received: from mail-ie0-f181.google.com ([209.85.223.181]:49802 "EHLO mail-ie0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753271AbaA2SS6 (ORCPT ); Wed, 29 Jan 2014 13:18:58 -0500 Received: by mail-ie0-f181.google.com with SMTP id to1so2457270ieb.12 for ; Wed, 29 Jan 2014 10:18:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=XaXnw/68OqAO69OEM1wBNh/OsRE7X9H2vumAtGzQKfk=; b=QjE6QGbXBXM/Cf9KGYcOM10Y+eTzJ5JhLKai8Sl5o9AGB9opDzo4JgXwBE8KfKSyXD PbJxolX8yg5jVvcyOj8a0FwFl3wmfe9YnvN7HmntomPh5CEwOrDguswU8TB6cU6k4DNv kPx+u/ILPme1F3mhNblOnhiA2vNrK8rcm3zVaSMGX601k7i5vyG9H6smVvsT+RzOgBdI UtGnPVLWzPkufYdk7PEKFIBbhhOgMsUWb8wBwqEgqN9FlMItmE1q3uTxFDi+9rYguwCy tkNVVQBO/ROw/vokbxlvH2MyWkfwvAUAkNcXrfT6BKK0bDgM2Jf1va8TBN1xvP3PgxG5 94HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=XaXnw/68OqAO69OEM1wBNh/OsRE7X9H2vumAtGzQKfk=; b=iw2GB6wH0FZEayssGbccpJb3N4LpsGvD6n4+AbYWzxw3TgKvSuCfG44U/8r4hnHHq3 vt3c2cA5Klru0Ktnt+Fa+28Q/3rvmrm3mRTLGP7P+YDP8FbfxOU+WWKAW7RHZjScyYi3 zLh4ufCOX9jFLcKknov7fpwvofhZN7aFN/bZl+iw8A/6KmKXgxPJh6cES7b7T9LVO3UR JkqmxKushLqeti/6iDZxmUySihe7DjOI47CgsKXb4uEFHpeGyGp/2dhrtTxnrx2VsZ1W 8kKo+J8QQtnS/dOxLtWsYW5IAKbzvvzlddlygvOKwl8mwePj365HIXO9BMeeTUP7XV/R 6GRQ== X-Gm-Message-State: ALoCoQkF7lmdOcdcLCxhzxKphQASoQG/yYAjtg0P3fE8eJ4B+1qbCyitnRLw9yyBrh11g4B88TJDQpDJU0WJorspd74PN0+BVelX/Q9J2iVg6x/MQv+Cd2Avqz+sNkScq1qtHZD+O8/rVExRQtjVyklekXdXwbcDIdwK76RbNi3u+qm+K0Fz1MyWEJMb0KIlZk72SC1/oM2G4rDLBTQH2/AfWHAhQeZWDQ== X-Received: by 10.50.147.72 with SMTP id ti8mr30367508igb.20.1391019537655; Wed, 29 Jan 2014 10:18:57 -0800 (PST) Received: from localhost ([172.29.123.160]) by mx.google.com with ESMTPSA id f15sm11185442igd.3.2014.01.29.10.18.56 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 29 Jan 2014 10:18:56 -0800 (PST) Subject: [PATCH 12/17] ia64 / sba_iommu: Use NUMA_NO_NODE, not MAX_NUMNODES, for unknown node To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: linux-acpi@vger.kernel.org, x86@kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 29 Jan 2014 11:18:55 -0700 Message-ID: <20140129181855.15476.93329.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <20140129174106.15476.7075.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <20140129174106.15476.7075.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP MAX_NUMNODES is typically used for sizing arrays. NUMA_NO_NODE is the usual value for "we don't know what node this is on," e.g., it is the error return from acpi_get_node(). This changes the ioc->node value for unknown nodes from MAX_NUMNODES to NUMA_NO_NODE. Signed-off-by: Bjorn Helgaas --- arch/ia64/hp/common/sba_iommu.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c index 8e858b593e4f..a52d6b49b7ce 100644 --- a/arch/ia64/hp/common/sba_iommu.c +++ b/arch/ia64/hp/common/sba_iommu.c @@ -1140,11 +1140,13 @@ sba_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, #ifdef CONFIG_NUMA { + int node = ioc->node; struct page *page; - page = alloc_pages_exact_node(ioc->node == MAX_NUMNODES ? - numa_node_id() : ioc->node, flags, - get_order(size)); + if (node == NUMA_NO_NODE) + node = numa_node_id(); + + page = alloc_pages_exact_node(node, flags, get_order(size)); if (unlikely(!page)) return NULL; @@ -1914,7 +1916,7 @@ ioc_show(struct seq_file *s, void *v) seq_printf(s, "Hewlett Packard %s IOC rev %d.%d\n", ioc->name, ((ioc->rev >> 4) & 0xF), (ioc->rev & 0xF)); #ifdef CONFIG_NUMA - if (ioc->node != MAX_NUMNODES) + if (ioc->node != NUMA_NO_NODE) seq_printf(s, "NUMA node : %d\n", ioc->node); #endif seq_printf(s, "IOVA size : %ld MB\n", ((ioc->pdir_size >> 3) * iovp_size)/(1024*1024)); @@ -2022,7 +2024,7 @@ sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle) unsigned int node; int pxm; - ioc->node = MAX_NUMNODES; + ioc->node = NUMA_NO_NODE; pxm = acpi_get_pxm(handle); @@ -2031,7 +2033,7 @@ sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle) node = pxm_to_node(pxm); - if (node >= MAX_NUMNODES || !node_online(node)) + if (node == NUMA_NO_NODE || !node_online(node)) return; ioc->node = node;