From patchwork Thu May 25 15:57:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 100521 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp830880qge; Thu, 25 May 2017 09:00:10 -0700 (PDT) X-Received: by 10.84.231.130 with SMTP id g2mr51168157plk.2.1495728010034; Thu, 25 May 2017 09:00:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495728010; cv=none; d=google.com; s=arc-20160816; b=axUN4qWKtg8l0BlKNxmqYPFDM9LuETKoQUxGjZYTWUTkjep6zmSZIPrCTPmFcm4LLu vbB2yrDKCNWmoZpbjveHy5z45kMNK4VLjSDvTdaKhoopztOzoOeq5PaXsoLAI+Myysyr wOkZfGgUmbDKqOreh6RJq+7vyKZ1x5jTPy+AVQ5etyce78RP7wAp4Kl48kcb2pGGjFE9 U+ER3+tL5MlkgpcwMpMOl5Tu9teFx5pZDeIKGWkDxxtWzSuXaAsf8XAZSJjyNMiSbJEq w0FOMGFb/pGzPfrVtKVKfu9kcbQkXystyzBt8VQsGnc5jalgy6sPT225zGuzh4lOdW4Q h7sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=udC6FncqPU5gtkx8ADgdRpDI7c40ABVrkZIkfAVlqYY=; b=KA5vw2mbL0pFnqU5sR/NoRSosXuosfnu2ZzGVgvG4QSqKGzEA2bnRqqmR38yIIg8/p 0SLYh8qD9YK9PBz63a78adMtbcArZOdV+mssP6voEoz3b+LK51D0I+wcFQeYnBTSPbSP uLiQYdAQ/DgmA96jVnouX54lyvPlaSuNihxp610Ikn2W4+3XGJUGspEzepC2mBr578z9 hh3OhxoeQCOAcpGDtQbW7YrLvnfwnoKhySs/q3X74Mq+QKJrWTRkSXblLnUPmOVoOaDp PmovihhZELs2RwvsmOx/AZSKzy65BsSqONZigWRvDPxhHoj1jmJqYBvAhrrhs6UUj+/1 +qVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si29224192plm.45.2017.05.25.09.00.09; Thu, 25 May 2017 09:00:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1165360AbdEYP7x (ORCPT + 10 others); Thu, 25 May 2017 11:59:53 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:34279 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165375AbdEYP7q (ORCPT ); Thu, 25 May 2017 11:59:46 -0400 Received: by mail-pf0-f174.google.com with SMTP id 9so171062991pfj.1 for ; Thu, 25 May 2017 08:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KAEJxJlsQyVhwB4d8GGxsab6nI8NeyaoHh9oKfAyIsc=; b=g+9WIlQxGAoWc2QWjvuP5thlkSjbsJ1DFctdQJqQeRk9W3s+pBNUWPjnQsf5Dyqsa9 oFqdQeiCUI6oCD0+3xHDUW+c9gBY0LlkOWhSLPz22rLx+Wbf5tAZE1IXj2C5F2xFO5ZC 32rzFGQMIlWOv6qju1OK19kRuh48ynbqgWTok= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KAEJxJlsQyVhwB4d8GGxsab6nI8NeyaoHh9oKfAyIsc=; b=i16JERM7J0erL4+Jw8i/TfC+iUj23LQfouovh8X1yyyfsbBmiMLSw5u3ML7SQTvsyA 5rOOwFC6lj9vmtlwCt1QMOd/xCWG/eYPVWJmuQikCdwhm7dQYKd0EDeet5wIimhwZBtA Tuyk/4D14YaBj2oHiYXBldiazsIU/8SED24lx1JU0E+7U/gYPcOWW76w2Z3p4DV/5rFR 5tTlrlhv9Ejn8dR4/VkrKjemiCQoxTPhWI9PuPcYQDoi/rnBpdEcIdR/Url40Hqdv9A8 7ciD5MxjH2+74t3/zCJIA2PjmW9oT5fq6lWJwLW6RrqvaR9mQJyHqD8v1BRyXQQphE8w 7y1A== X-Gm-Message-State: AODbwcDflyz+fE9RChdWgTorKBDC43L8QCbKEg8CDu6aMgCBj4ts4Xxl 3kyM1XIY608/wX4a X-Received: by 10.98.135.71 with SMTP id i68mr45369426pfe.92.1495727985804; Thu, 25 May 2017 08:59:45 -0700 (PDT) Received: from localhost.localdomain (li1068-205.members.linode.com. [106.184.3.205]) by smtp.gmail.com with ESMTPSA id o76sm16355942pfi.119.2017.05.25.08.59.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 May 2017 08:59:43 -0700 (PDT) From: Leo Yan To: Jonathan Corbet , Mathieu Poirier , Rob Herring , Mark Rutland , Wei Xu , Catalin Marinas , Will Deacon , Andy Gross , David Brown , Greg Kroah-Hartman , Suzuki K Poulose , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, Stephen Boyd , Mike Leach Cc: Leo Yan Subject: [PATCH v13 3/9] doc: Add coresight_cpu_debug.enable to kernel-parameters.txt Date: Thu, 25 May 2017 23:57:10 +0800 Message-Id: <1495727836-30094-4-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1495727836-30094-1-git-send-email-leo.yan@linaro.org> References: <1495727836-30094-1-git-send-email-leo.yan@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add coresight_cpu_debug.enable to kernel-parameters.txt, this flag is used to enable/disable the CPU sampling based debugging. Reviewed-by: Mathieu Poirier Signed-off-by: Leo Yan --- Documentation/admin-guide/kernel-parameters.txt | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" 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/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 15f79c2..ff67ad7 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -649,6 +649,13 @@ /proc//coredump_filter. See also Documentation/filesystems/proc.txt. + coresight_cpu_debug.enable + [ARM,ARM64] + Format: + Enable/disable the CPU sampling based debugging. + 0: default value, disable debugging + 1: enable debugging at boot time + cpuidle.off=1 [CPU_IDLE] disable the cpuidle sub-system From patchwork Thu May 25 15:57:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 100523 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp831065qge; Thu, 25 May 2017 09:00:27 -0700 (PDT) X-Received: by 10.98.103.207 with SMTP id t76mr44471140pfj.147.1495728027344; Thu, 25 May 2017 09:00:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495728027; cv=none; d=google.com; s=arc-20160816; b=CgM0b6nyWYv5g2NR7g+Li4ddpRyGSFWD1IwLsjLqhNsxtnOnCm+C3yXakkHo4/6Ba9 osXpYsq455Zre2uby3Uhgsajibig/IvkN/j+tZ4OHKXpk6cPAQ0PA9W9C2ZdgvcYPXkI ItMwesYelYrbm6SnYzMUnuHAJTOb30l68HT59g83hoeKxVyu4kVI9FyhTlcanKQCuqvS 5LreIvgMwzorr2f6ZIVY3wz8DiHvJjxkwuvFXvyoav1siDmjAKz0l76BFtJWjsV7hU63 vJPUVl6c4E82tWzYRYDD2yBJ3D5K54VhECkt/yAdLIjTMpwhpV8WVGMw3fbAp9PLdlaX /hiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=hcDcXtgP60PHO0UlA3jODhb8nyMHa+VSyO8LNe+l4yo=; b=yZZjnYbZ+kImRXond8BNkurrgO0M4dZ1JMtwkBXcckr0BCsry1uUbSElyd+pU2nrdr e9gcGh2OZi+jYHvesUGt9EqNLFWMnFrAjhHRpD9fSPMub6KzRA3hQHawgzAdOOpUvnma 9e4JnpVjm4ge5hCgV82yyWnRxk8FlffwIH8Jgvo76piAq86yItgYGBw5W7wlBeCLBniv 6n1sWMBScql9UkO68o+62grgV8a2z8g62vz0P5M8aLCpWgreKsP4yRIbhCC7W4V57RwD tqh1KfBjB/I5N1agweBW93ZDe74QVsxRjS1BbibmOQ7duKUu8mpYeCQFX0RtCBS17o/f utdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g189si26912518pgc.354.2017.05.25.09.00.26; Thu, 25 May 2017 09:00:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424515AbdEYQAL (ORCPT + 10 others); Thu, 25 May 2017 12:00:11 -0400 Received: from mail-pf0-f172.google.com ([209.85.192.172]:34449 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424486AbdEYQAG (ORCPT ); Thu, 25 May 2017 12:00:06 -0400 Received: by mail-pf0-f172.google.com with SMTP id 9so171071334pfj.1 for ; Thu, 25 May 2017 09:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KPg79NY3sGvLdvwjFFRlkg3unWx7G4i/7+aegEzxzF8=; b=CKIQaXOONjy/Hec2F7dxKndiBMhno6MDnGjh2xqKermhTm9QV+k8U4QkVdNFtmHj6j dFsObj4jlgX9L/yiFGE9k6O9J9h5Rn6+VYhWVZ0hMjkYPsLe8kcFRbDDEz/JpsLXZaBa 0d7aeG4qZJ3sU2SiElR6/OmlE7O+84Ib5nUZI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KPg79NY3sGvLdvwjFFRlkg3unWx7G4i/7+aegEzxzF8=; b=k2ROzVAWZMvlfFpNgwdHpvWtiduZr1VtcYAf6VRGXapw0pxsN5ej3I8su/ipHbnPjm tQ7CeSNuc2Z6oY1PclhpFvqedLTUWibGa9WaYut29qJubhfrukzmjptllgXoKc2prA03 /RuHZxohVF26s7CLB7GznY0wI2A386OJr4lq2Kq49jNimVtI7jUi+LB24/pmoCuTuiHt J5UPRDtrgKFYFsLeoeG0IpLa1sA0m+PLcDdgdpTvUAUm1gQAQJfRmB3IrOsxaKWMZO8N bpf36DyxoqqePxaBEGkSyTDLy/irzNtjYuUNh9b1NLhrcXZYgPVrKgxCvLri6jLmV/QY IgxQ== X-Gm-Message-State: AODbwcCsMjjZ/1VNGeVEyMYvRMnDyZhnEl4brgJSrnLwHPL4sZaEw1lx EEQnb9k1H3d+FQmg X-Received: by 10.84.217.142 with SMTP id p14mr34704846pli.192.1495728005665; Thu, 25 May 2017 09:00:05 -0700 (PDT) Received: from localhost.localdomain (li1068-205.members.linode.com. [106.184.3.205]) by smtp.gmail.com with ESMTPSA id o76sm16355942pfi.119.2017.05.25.08.59.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 May 2017 09:00:04 -0700 (PDT) From: Leo Yan To: Jonathan Corbet , Mathieu Poirier , Rob Herring , Mark Rutland , Wei Xu , Catalin Marinas , Will Deacon , Andy Gross , David Brown , Greg Kroah-Hartman , Suzuki K Poulose , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, Stephen Boyd , Mike Leach Cc: Leo Yan Subject: [PATCH v13 5/9] coresight: of_get_coresight_platform_data: Add missing of_node_put Date: Thu, 25 May 2017 23:57:12 +0800 Message-Id: <1495727836-30094-6-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1495727836-30094-1-git-send-email-leo.yan@linaro.org> References: <1495727836-30094-1-git-send-email-leo.yan@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Suzuki K Poulose The of_get_coresight_platform_data iterates over the possible CPU nodes to find a given cpu phandle. However it does not drop the reference to the node pointer returned by the of_get_coresight_platform_data. This patch also introduces another minor fix is to use of_cpu_device_node_get() to replace of_get_cpu_node(). Cc: Mathieu Poirier Reviewed-by: Suzuki K Poulose Signed-off-by: Suzuki K Poulose [Leo: minor tweaks for of_get_coresight_platform_data] Signed-off-by: Leo Yan --- drivers/hwtracing/coresight/of_coresight.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" 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/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c index 2749853..225b2dd 100644 --- a/drivers/hwtracing/coresight/of_coresight.c +++ b/drivers/hwtracing/coresight/of_coresight.c @@ -109,7 +109,8 @@ of_get_coresight_platform_data(struct device *dev, struct coresight_platform_data *pdata; struct of_endpoint endpoint, rendpoint; struct device *rdev; - struct device_node *dn; + bool found; + struct device_node *dn, *np; struct device_node *ep = NULL; struct device_node *rparent = NULL; struct device_node *rport = NULL; @@ -176,17 +177,19 @@ of_get_coresight_platform_data(struct device *dev, } while (ep); } - /* Affinity defaults to CPU0 */ - pdata->cpu = 0; dn = of_parse_phandle(node, "cpu", 0); - for (cpu = 0; dn && cpu < nr_cpu_ids; cpu++) { - if (dn == of_get_cpu_node(cpu, NULL)) { - pdata->cpu = cpu; + for_each_possible_cpu(cpu) { + np = of_cpu_device_node_get(cpu); + found = (dn == np); + of_node_put(np); + if (found) break; - } } of_node_put(dn); + /* Affinity to CPU0 if no cpu nodes are found */ + pdata->cpu = found ? cpu : 0; + return pdata; } EXPORT_SYMBOL_GPL(of_get_coresight_platform_data); From patchwork Thu May 25 15:57:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 100524 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp831203qge; Thu, 25 May 2017 09:00:42 -0700 (PDT) X-Received: by 10.99.128.72 with SMTP id j69mr45844797pgd.28.1495728042244; Thu, 25 May 2017 09:00:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495728042; cv=none; d=google.com; s=arc-20160816; b=nIRv4PhbhI/CYqd9bx8D04cS2hop6F7leCGbb+PeTALab5aWg02nSgyKBDhXygd7Oh 48nPGlkem+L70ycmavZTIVNSWGWsr1myZh6c6WmCa3txEiuO5Jo5VR9givNXdksaM27l zC6NHXVmubtOr3+lh4MMI6h17iPPA0O4LqlijioPpf6AtzvsoNH2L3eeW4UxkFqTebWx BnHVLAac3vVHAS10NsA0qUiqOum6ttwKrlKB8VaNnGU86PbssptHCyBZvjmhPS8Kw5mR HczpaU7Mqd2CG2H4wCe5HHUx1SkaGS864MoUGQqIaKSXk5Zq0rLo7NriexGl64BP8ASl jtzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=pQBhgBdAWMz2W1N5baOSR/Y3fVkFD+KZqlylO+zf+fU=; b=MOkk6vFEsc4FBHoQWSnFYzI+oWX7WEIw3UmClwYFnUATEbO5Th2EpY1xiXqtsH65SN z/+Z282TU/6TYNwSB+KHXRI03twdWlcSZ/6tm5h+pAA5FfBn3jAUPphiriwo1ueC4vkt imvQn4IjsPQ8ZGsNQ2BSxWiGt2qI7r2V8waaHMKTexjgvVVhZd2NPrCZDucDyREBJ3ba 4xGrl5gBlnYDzMgYQtGOQlNXU6lNz4GgYuydQwZCoesnCkop1tk3NrKchCE1axGt8WOa XK1siZc2+Xbju/JrgXj3u6IH+WSgOQnX65y1YLhimcEhcf+26ZIQNf7jjwzAm3C5GNSO zM6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g189si26912518pgc.354.2017.05.25.09.00.41; Thu, 25 May 2017 09:00:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936392AbdEYQAk (ORCPT + 10 others); Thu, 25 May 2017 12:00:40 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:35199 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935812AbdEYQAh (ORCPT ); Thu, 25 May 2017 12:00:37 -0400 Received: by mail-pf0-f182.google.com with SMTP id n23so171200446pfb.2 for ; Thu, 25 May 2017 09:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AUa/r/owcEkLREAOhERJKHIL8sY1rKzDXiQd4uezk7o=; b=S8hAipRx1wPhtBmUlQYiGlSUTUwDqv2/vmcKBYIVr6gz7WKjprxB0X3CpkwA2saVOS UKCtGnzbX18JbypFcuXa2x97alZ4uCrv2lTZ8XW0YKAZU0i+sn8FA/8KmthJk+he7hzB Vxjex0TEvwx/72XrsYFU1PuYbFIbMWGRa4CDo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AUa/r/owcEkLREAOhERJKHIL8sY1rKzDXiQd4uezk7o=; b=eDm5Tpqx/nWB1n67m8Cl64aeX/MnoQYQljwp7c7C4UE7oetsgfWlwJZtg1T+1KfBCB ZgQ85R04QmfN8qky1hpZgilDSD9JiSfnjf4xJzeTJk1UES53cU/xDPegkFNkmd2MMcdK oNko/d3phEqp1GD3QnMz5X/kUENyWjFwLHe5a+QcufcA2brKz7puwx39nq5H3cxuFg+u AmfTPWorUnLfJ24dYqvYMcuyC+HqAR25kXYfyeQ0Qr3PHmAqspOktxd8OIjeFW+IbZjZ wgCBGFDaorVN+wMimPBUIDDQYwCwauZLNvnp+e0uXmLLruQCR6lTyZFYNBM6BpX3iXYL otvg== X-Gm-Message-State: AODbwcC0XDalo8+jergfPSOX5B5DQW4QCvaKJcJjBcgLpmaYUAA2ccI6 c6/kFWPiRfn3XQr/ X-Received: by 10.84.248.73 with SMTP id e9mr51879843pln.76.1495728035980; Thu, 25 May 2017 09:00:35 -0700 (PDT) Received: from localhost.localdomain (li1068-205.members.linode.com. [106.184.3.205]) by smtp.gmail.com with ESMTPSA id o76sm16355942pfi.119.2017.05.25.09.00.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 May 2017 09:00:34 -0700 (PDT) From: Leo Yan To: Jonathan Corbet , Mathieu Poirier , Rob Herring , Mark Rutland , Wei Xu , Catalin Marinas , Will Deacon , Andy Gross , David Brown , Greg Kroah-Hartman , Suzuki K Poulose , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, Stephen Boyd , Mike Leach Cc: Leo Yan Subject: [PATCH v13 6/9] coresight: refactor with function of_coresight_get_cpu Date: Thu, 25 May 2017 23:57:13 +0800 Message-Id: <1495727836-30094-7-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1495727836-30094-1-git-send-email-leo.yan@linaro.org> References: <1495727836-30094-1-git-send-email-leo.yan@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This is refactor to add function of_coresight_get_cpu(), so it's used to retrieve CPU id for coresight component. Finally can use it as a common function for multiple places. Suggested-by: Mathieu Poirier Reviewed-by: Suzuki K Poulose Signed-off-by: Leo Yan --- drivers/hwtracing/coresight/of_coresight.c | 43 +++++++++++++++++++----------- include/linux/coresight.h | 3 +++ 2 files changed, 31 insertions(+), 15 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" 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/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c index 225b2dd..a187941 100644 --- a/drivers/hwtracing/coresight/of_coresight.c +++ b/drivers/hwtracing/coresight/of_coresight.c @@ -101,16 +101,40 @@ static int of_coresight_alloc_memory(struct device *dev, return 0; } +int of_coresight_get_cpu(const struct device_node *node) +{ + int cpu; + bool found; + struct device_node *dn, *np; + + dn = of_parse_phandle(node, "cpu", 0); + + /* Affinity defaults to CPU0 */ + if (!dn) + return 0; + + for_each_possible_cpu(cpu) { + np = of_cpu_device_node_get(cpu); + found = (dn == np); + of_node_put(np); + if (found) + break; + } + of_node_put(dn); + + /* Affinity to CPU0 if no cpu nodes are found */ + return found ? cpu : 0; +} +EXPORT_SYMBOL_GPL(of_coresight_get_cpu); + struct coresight_platform_data * of_get_coresight_platform_data(struct device *dev, const struct device_node *node) { - int i = 0, ret = 0, cpu; + int i = 0, ret = 0; struct coresight_platform_data *pdata; struct of_endpoint endpoint, rendpoint; struct device *rdev; - bool found; - struct device_node *dn, *np; struct device_node *ep = NULL; struct device_node *rparent = NULL; struct device_node *rport = NULL; @@ -177,18 +201,7 @@ of_get_coresight_platform_data(struct device *dev, } while (ep); } - dn = of_parse_phandle(node, "cpu", 0); - for_each_possible_cpu(cpu) { - np = of_cpu_device_node_get(cpu); - found = (dn == np); - of_node_put(np); - if (found) - break; - } - of_node_put(dn); - - /* Affinity to CPU0 if no cpu nodes are found */ - pdata->cpu = found ? cpu : 0; + pdata->cpu = of_coresight_get_cpu(node); return pdata; } diff --git a/include/linux/coresight.h b/include/linux/coresight.h index bf0aa50..d950dad 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -263,10 +263,13 @@ static inline int coresight_timeout(void __iomem *addr, u32 offset, #endif #ifdef CONFIG_OF +extern int of_coresight_get_cpu(const struct device_node *node); extern struct coresight_platform_data * of_get_coresight_platform_data(struct device *dev, const struct device_node *node); #else +static inline int of_coresight_get_cpu(const struct device_node *node) +{ return 0; } static inline struct coresight_platform_data *of_get_coresight_platform_data( struct device *dev, const struct device_node *node) { return NULL; } #endif