From patchwork Mon Mar 30 20:13:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 6124871 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4F8FEBF4A6 for ; Mon, 30 Mar 2015 20:17:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 79155202AE for ; Mon, 30 Mar 2015 20:17:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8D79320303 for ; Mon, 30 Mar 2015 20:17:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ycg53-0004O0-US; Mon, 30 Mar 2015 20:14:42 +0000 Received: from mail-pd0-f176.google.com ([209.85.192.176]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ycg4b-0004BC-Ul for linux-arm-kernel@lists.infradead.org; Mon, 30 Mar 2015 20:14:14 +0000 Received: by pdcp1 with SMTP id p1so94469354pdc.3 for ; Mon, 30 Mar 2015 13:13:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=isj89153zgxm3yMfP2Z9aPwxSUvbMoB7m2mFxnEQboM=; b=SSUrADv0ETMeFsC9UB6x0pPZfHlKymFnm8uaidund5g6rNCecFhz4UM8Up4W9GJ1+6 cvmIiog3AnO3ctbUt9MldwoprfXrTdxLysRjRyDNnRhGuw0PinIMVkgUQSHWq8o2NtTQ HTKKAArHRDqo0t+H0CZMrGETMsskQ5iCUrS0A6dycHrwFK/EA1+omn7iZOAHltGKbqkl 6uEdC5i6jpnu8zeK8Fii1Qirxfxo7pQva0a3He4dDzeuz268pzxcb9QjPxod8nDxSKNR Y6QJVwKVmYMY3LT6GK40xZGVIkc6RZzIuqwqyTrHxSE9GzQIiDP8qMtNFHm09CZtGxdr 04vA== X-Gm-Message-State: ALoCoQmRWSxaGiIlXEI/kw7+ZasyHXdaAJ5oIuMaNs4DEW3uR5hmc4LgCfOjw09REPksPCp9Tfs9 X-Received: by 10.66.136.48 with SMTP id px16mr62026160pab.89.1427746432868; Mon, 30 Mar 2015 13:13:52 -0700 (PDT) Received: from t430.cg.shawcable.net ([184.64.168.246]) by mx.google.com with ESMTPSA id jy9sm11549978pbc.31.2015.03.30.13.13.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 Mar 2015 13:13:52 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 1/8] coresight: making cpu index lookup arm64 compliant Date: Mon, 30 Mar 2015 14:13:34 -0600 Message-Id: <1427746421-31360-2-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427746421-31360-1-git-send-email-mathieu.poirier@linaro.org> References: <1427746421-31360-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150330_131414_038649_ECE4B0A5 X-CRM114-Status: GOOD ( 12.89 ) X-Spam-Score: -0.7 (/) Cc: mathieu.poirier@linaro.org, kaixu.xia@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, zhang.chunyan@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, 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 Function "get_logical_index()" is not available on arm64. Instead of adding the function simply using "of_get_cpu_node()" and comparing the return value with cpu handles yields the same result. Signed-off-by: Mathieu Poirier --- drivers/coresight/of_coresight.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/coresight/of_coresight.c b/drivers/coresight/of_coresight.c index c3efa418a86d..f3cc8e97a0f8 100644 --- a/drivers/coresight/of_coresight.c +++ b/drivers/coresight/of_coresight.c @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -113,7 +114,7 @@ static int of_coresight_alloc_memory(struct device *dev, struct coresight_platform_data *of_get_coresight_platform_data( struct device *dev, struct device_node *node) { - int i = 0, ret = 0; + int i = 0, ret = 0, cpu; struct coresight_platform_data *pdata; struct of_endpoint endpoint, rendpoint; struct device *rdev; @@ -187,17 +188,10 @@ struct coresight_platform_data *of_get_coresight_platform_data( /* Affinity defaults to CPU0 */ pdata->cpu = 0; dn = of_parse_phandle(node, "cpu", 0); - if (dn) { - const u32 *cell; - int len, index; - u64 hwid; - - cell = of_get_property(dn, "reg", &len); - if (cell) { - hwid = of_read_number(cell, of_n_addr_cells(dn)); - index = get_logical_index(hwid); - if (index != -EINVAL) - pdata->cpu = index; + for (cpu = 0; dn && cpu < nr_cpu_ids; cpu++) { + if (dn == of_get_cpu_node(cpu, NULL)) { + pdata->cpu = cpu; + break; } }