diff for duplicates of <1484158589.2619.14.camel@sandisk.com> diff --git a/a/1.txt b/N1/1.txt index c201711..32d7e99 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -35,177 +35,3 @@ and would make Linus' job harder. So I hope that you will allow me to postpone that rename until a later time ... Bart. -From justinpopo6@gmail.com Wed Jan 11 20:44:53 2017 -Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 11 Jan 2017 20:45:00 +0100 (CET) -Received: from lpdvsmtp01.broadcom.com ([192.19.211.62]:41172 "EHLO - relay.smtp.broadcom.com" rhost-flags-OK-OK-OK-OK) - by eddie.linux-mips.org with ESMTP id S23993908AbdAKToxPNcNY (ORCPT - <rfc822;linux-mips@linux-mips.org>); Wed, 11 Jan 2017 20:44:53 +0100 -Received: from mail-irv-17.broadcom.com (mail-irv-17.broadcom.com [10.15.198.34]) - by relay.smtp.broadcom.com (Postfix) with ESMTP id 04C9E2802D1; - Wed, 11 Jan 2017 11:44:50 -0800 (PST) -DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 04C9E2802D1 -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; - s=dkimrelay; t=1484163890; - bh=5WUogODucyNiaQB2A0nAyqk1OMr/MUjr0qN8UEvKlTU=; - h=From:To:Cc:Subject:Date:From; - b=fBu+HL6NSCJ1V1RmDebC9dqf9R/PbLAa8R1U4AXV0uBEWthw+a3OnfgBYN2D3Rlmu - v/ZjYWHKpBQPzEydljfwh6JsWca92Ap/r5bI3vT2cN92u75C1hKjrhkUt+ZQG/xk37 - yqai1ez63Kr6o0GHf+HpMYEuOGgKUjco7dDZa/wc= -Received: from stb-bld-02.irv.broadcom.com (stb-bld-02.broadcom.com [10.13.134.28]) - by mail-irv-17.broadcom.com (Postfix) with ESMTP id 6DAA281F52; - Wed, 11 Jan 2017 11:44:49 -0800 (PST) -From: justinpopo6@gmail.com -To: linux-mips@linux-mips.org -Cc: bcm-kernel-feedback-list@broadcom.com, leonid.yegoshin@imgtec.com, - f.fainelli@gmail.com, Justin Chen <justin.chen@broadcom.com> -Subject: [PATCH] MIPS: Add cacheinfo support -Date: Wed, 11 Jan 2017 11:44:32 -0800 -Message-Id: <20170111194432.24283-1-justinpopo6@gmail.com> -X-Mailer: git-send-email 2.11.0 -Return-Path: <justinpopo6@gmail.com> -X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) -X-Orcpt: rfc822;linux-mips@linux-mips.org -Original-Recipient: rfc822;linux-mips@linux-mips.org -X-archive-position: 56274 -X-ecartis-version: Ecartis v1.0.0 -Sender: linux-mips-bounce@linux-mips.org -Errors-to: linux-mips-bounce@linux-mips.org -X-original-sender: justinpopo6@gmail.com -Precedence: bulk -List-help: <mailto:ecartis@linux-mips.org?Subject=help> -List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips> -List-software: Ecartis version 1.0.0 -List-Id: linux-mips <linux-mips.eddie.linux-mips.org> -X-List-ID: linux-mips <linux-mips.eddie.linux-mips.org> -List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips> -List-owner: <mailto:ralf@linux-mips.org> -List-post: <mailto:linux-mips@linux-mips.org> -List-archive: <http://www.linux-mips.org/archives/linux-mips/> -X-list: linux-mips -Content-Length: 3766 -Lines: 124 - -From: Justin Chen <justin.chen@broadcom.com> - -Add cacheinfo support for MIPS architectures. - -Use information from the cpuinfo_mips struct to populate the -cacheinfo struct. This allows an architecture agnostic approach, -however this also means if cache information is not properly -populated within the cpuinfo_mips struct, there is nothing -we can do. (I.E. c-r3k.c) - -Signed-off-by: Justin Chen <justin.chen@broadcom.com> ---- - arch/mips/kernel/Makefile | 2 +- - arch/mips/kernel/cacheinfo.c | 85 ++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 86 insertions(+), 1 deletion(-) - create mode 100644 arch/mips/kernel/cacheinfo.c - -diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile -index 4a603a3..904a9c4 100644 ---- a/arch/mips/kernel/Makefile -+++ b/arch/mips/kernel/Makefile -@@ -7,7 +7,7 @@ extra-y := head.o vmlinux.lds - obj-y += cpu-probe.o branch.o elf.o entry.o genex.o idle.o irq.o \ - process.o prom.o ptrace.o reset.o setup.o signal.o \ - syscall.o time.o topology.o traps.o unaligned.o watch.o \ -- vdso.o -+ vdso.o cacheinfo.o - - ifdef CONFIG_FUNCTION_TRACER - CFLAGS_REMOVE_ftrace.o = -pg -diff --git a/arch/mips/kernel/cacheinfo.c b/arch/mips/kernel/cacheinfo.c -new file mode 100644 -index 0000000..a92bbba ---- /dev/null -+++ b/arch/mips/kernel/cacheinfo.c -@@ -0,0 +1,85 @@ -+/* -+ * MIPS cacheinfo support -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any -+ * kind, whether express or implied; without even the implied warranty -+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program. If not, see <http://www.gnu.org/licenses/>. -+ */ -+#include <linux/cacheinfo.h> -+ -+/* Populates leaf and increments to next leaf */ -+#define populate_cache(cache, leaf, c_level, c_type) \ -+ leaf->type = c_type; \ -+ leaf->level = c_level; \ -+ leaf->coherency_line_size = c->cache.linesz; \ -+ leaf->number_of_sets = c->cache.sets; \ -+ leaf->ways_of_associativity = c->cache.ways; \ -+ leaf->size = c->cache.linesz * c->cache.sets * \ -+ c->cache.ways; \ -+ leaf++; -+ -+static int __init_cache_level(unsigned int cpu) -+{ -+ struct cpuinfo_mips *c = ¤t_cpu_data; -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ int levels = 0, leaves = 0; -+ -+ /* -+ * If Dcache is not set, we assume the cache structures -+ * are not properly initialized. -+ */ -+ if (c->dcache.waysize) -+ levels += 1; -+ else -+ return -ENOENT; -+ -+ -+ leaves += (c->icache.waysize) ? 2 : 1; -+ -+ if (c->scache.waysize) { -+ levels++; -+ leaves++; -+ } -+ -+ if (c->tcache.waysize) { -+ levels++; -+ leaves++; -+ } -+ -+ this_cpu_ci->num_levels = levels; -+ this_cpu_ci->num_leaves = leaves; -+ return 0; -+} -+ -+static int __populate_cache_leaves(unsigned int cpu) -+{ -+ struct cpuinfo_mips *c = ¤t_cpu_data; -+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); -+ struct cacheinfo *this_leaf = this_cpu_ci->info_list; -+ -+ if (c->icache.waysize) { -+ populate_cache(dcache, this_leaf, 1, CACHE_TYPE_DATA); -+ populate_cache(icache, this_leaf, 1, CACHE_TYPE_INST); -+ } else { -+ populate_cache(dcache, this_leaf, 1, CACHE_TYPE_UNIFIED); -+ } -+ -+ if (c->scache.waysize) -+ populate_cache(scache, this_leaf, 2, CACHE_TYPE_UNIFIED); -+ -+ if (c->tcache.waysize) -+ populate_cache(tcache, this_leaf, 3, CACHE_TYPE_UNIFIED); -+ -+ return 0; -+} -+ -+DEFINE_SMP_CALL_CACHE_FUNCTION(init_cache_level) -+DEFINE_SMP_CALL_CACHE_FUNCTION(populate_cache_leaves) --- -2.10.2 diff --git a/a/content_digest b/N1/content_digest index 44dbd41..d081898 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -101,180 +101,6 @@ "and would make Linus' job harder. So I hope that you will allow me to\n" "postpone that rename until a later time ...\n" "\n" - "Bart.\n" - "From justinpopo6@gmail.com Wed Jan 11 20:44:53 2017\n" - "Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 11 Jan 2017 20:45:00 +0100 (CET)\n" - "Received: from lpdvsmtp01.broadcom.com ([192.19.211.62]:41172 \"EHLO\n" - " relay.smtp.broadcom.com\" rhost-flags-OK-OK-OK-OK)\n" - " by eddie.linux-mips.org with ESMTP id S23993908AbdAKToxPNcNY (ORCPT\n" - " <rfc822;linux-mips@linux-mips.org>); Wed, 11 Jan 2017 20:44:53 +0100\n" - "Received: from mail-irv-17.broadcom.com (mail-irv-17.broadcom.com [10.15.198.34])\n" - " by relay.smtp.broadcom.com (Postfix) with ESMTP id 04C9E2802D1;\n" - " Wed, 11 Jan 2017 11:44:50 -0800 (PST)\n" - "DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 04C9E2802D1\n" - "DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n" - " s=dkimrelay; t=1484163890;\n" - " bh=5WUogODucyNiaQB2A0nAyqk1OMr/MUjr0qN8UEvKlTU=;\n" - " h=From:To:Cc:Subject:Date:From;\n" - " b=fBu+HL6NSCJ1V1RmDebC9dqf9R/PbLAa8R1U4AXV0uBEWthw+a3OnfgBYN2D3Rlmu\n" - " v/ZjYWHKpBQPzEydljfwh6JsWca92Ap/r5bI3vT2cN92u75C1hKjrhkUt+ZQG/xk37\n" - " yqai1ez63Kr6o0GHf+HpMYEuOGgKUjco7dDZa/wc=\n" - "Received: from stb-bld-02.irv.broadcom.com (stb-bld-02.broadcom.com [10.13.134.28])\n" - " by mail-irv-17.broadcom.com (Postfix) with ESMTP id 6DAA281F52;\n" - " Wed, 11 Jan 2017 11:44:49 -0800 (PST)\n" - "From: justinpopo6@gmail.com\n" - "To: linux-mips@linux-mips.org\n" - "Cc: bcm-kernel-feedback-list@broadcom.com, leonid.yegoshin@imgtec.com,\n" - " f.fainelli@gmail.com, Justin Chen <justin.chen@broadcom.com>\n" - "Subject: [PATCH] MIPS: Add cacheinfo support\n" - "Date: Wed, 11 Jan 2017 11:44:32 -0800\n" - "Message-Id: <20170111194432.24283-1-justinpopo6@gmail.com>\n" - "X-Mailer: git-send-email 2.11.0\n" - "Return-Path: <justinpopo6@gmail.com>\n" - "X-Envelope-To: <\"|/home/ecartis/ecartis -s linux-mips\"> (uid 0)\n" - "X-Orcpt: rfc822;linux-mips@linux-mips.org\n" - "Original-Recipient: rfc822;linux-mips@linux-mips.org\n" - "X-archive-position: 56274\n" - "X-ecartis-version: Ecartis v1.0.0\n" - "Sender: linux-mips-bounce@linux-mips.org\n" - "Errors-to: linux-mips-bounce@linux-mips.org\n" - "X-original-sender: justinpopo6@gmail.com\n" - "Precedence: bulk\n" - "List-help: <mailto:ecartis@linux-mips.org?Subject=help>\n" - "List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>\n" - "List-software: Ecartis version 1.0.0\n" - "List-Id: linux-mips <linux-mips.eddie.linux-mips.org>\n" - "X-List-ID: linux-mips <linux-mips.eddie.linux-mips.org>\n" - "List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>\n" - "List-owner: <mailto:ralf@linux-mips.org>\n" - "List-post: <mailto:linux-mips@linux-mips.org>\n" - "List-archive: <http://www.linux-mips.org/archives/linux-mips/>\n" - "X-list: linux-mips\n" - "Content-Length: 3766\n" - "Lines: 124\n" - "\n" - "From: Justin Chen <justin.chen@broadcom.com>\n" - "\n" - "Add cacheinfo support for MIPS architectures.\n" - "\n" - "Use information from the cpuinfo_mips struct to populate the\n" - "cacheinfo struct. This allows an architecture agnostic approach,\n" - "however this also means if cache information is not properly\n" - "populated within the cpuinfo_mips struct, there is nothing\n" - "we can do. (I.E. c-r3k.c)\n" - "\n" - "Signed-off-by: Justin Chen <justin.chen@broadcom.com>\n" - "---\n" - " arch/mips/kernel/Makefile | 2 +-\n" - " arch/mips/kernel/cacheinfo.c | 85 ++++++++++++++++++++++++++++++++++++++++++++\n" - " 2 files changed, 86 insertions(+), 1 deletion(-)\n" - " create mode 100644 arch/mips/kernel/cacheinfo.c\n" - "\n" - "diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile\n" - "index 4a603a3..904a9c4 100644\n" - "--- a/arch/mips/kernel/Makefile\n" - "+++ b/arch/mips/kernel/Makefile\n" - "@@ -7,7 +7,7 @@ extra-y\t\t:= head.o vmlinux.lds\n" - " obj-y\t\t+= cpu-probe.o branch.o elf.o entry.o genex.o idle.o irq.o \\\n" - " \t\t process.o prom.o ptrace.o reset.o setup.o signal.o \\\n" - " \t\t syscall.o time.o topology.o traps.o unaligned.o watch.o \\\n" - "-\t\t vdso.o\n" - "+\t\t vdso.o cacheinfo.o\n" - " \n" - " ifdef CONFIG_FUNCTION_TRACER\n" - " CFLAGS_REMOVE_ftrace.o = -pg\n" - "diff --git a/arch/mips/kernel/cacheinfo.c b/arch/mips/kernel/cacheinfo.c\n" - "new file mode 100644\n" - "index 0000000..a92bbba\n" - "--- /dev/null\n" - "+++ b/arch/mips/kernel/cacheinfo.c\n" - "@@ -0,0 +1,85 @@\n" - "+/*\n" - "+ * MIPS cacheinfo support\n" - "+ *\n" - "+ * This program is free software; you can redistribute it and/or modify\n" - "+ * it under the terms of the GNU General Public License version 2 as\n" - "+ * published by the Free Software Foundation.\n" - "+ *\n" - "+ * This program is distributed \"as is\" WITHOUT ANY WARRANTY of any\n" - "+ * kind, whether express or implied; without even the implied warranty\n" - "+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" - "+ * GNU General Public License for more details.\n" - "+ *\n" - "+ * You should have received a copy of the GNU General Public License\n" - "+ * along with this program. If not, see <http://www.gnu.org/licenses/>.\n" - "+ */\n" - "+#include <linux/cacheinfo.h>\n" - "+\n" - "+/* Populates leaf and increments to next leaf */\n" - "+#define populate_cache(cache, leaf, c_level, c_type)\t\t\\\n" - "+\tleaf->type = c_type;\t\t\t\t\t\\\n" - "+\tleaf->level = c_level;\t\t\t\t\t\\\n" - "+\tleaf->coherency_line_size = c->cache.linesz;\t\t\\\n" - "+\tleaf->number_of_sets = c->cache.sets;\t\t\t\\\n" - "+\tleaf->ways_of_associativity = c->cache.ways;\t\t\\\n" - "+\tleaf->size = c->cache.linesz * c->cache.sets *\t\t\\\n" - "+\t\tc->cache.ways;\t\t\t\t\t\\\n" - "+\tleaf++;\n" - "+\n" - "+static int __init_cache_level(unsigned int cpu)\n" - "+{\n" - "+\tstruct cpuinfo_mips *c = ¤t_cpu_data;\n" - "+\tstruct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);\n" - "+\tint levels = 0, leaves = 0;\n" - "+\n" - "+\t/*\n" - "+\t * If Dcache is not set, we assume the cache structures\n" - "+\t * are not properly initialized.\n" - "+\t */\n" - "+\tif (c->dcache.waysize)\n" - "+\t\tlevels += 1;\n" - "+\telse\n" - "+\t\treturn -ENOENT;\n" - "+\n" - "+\n" - "+\tleaves += (c->icache.waysize) ? 2 : 1;\n" - "+\n" - "+\tif (c->scache.waysize) {\n" - "+\t\tlevels++;\n" - "+\t\tleaves++;\n" - "+\t}\n" - "+\n" - "+\tif (c->tcache.waysize) {\n" - "+\t\tlevels++;\n" - "+\t\tleaves++;\n" - "+\t}\n" - "+\n" - "+\tthis_cpu_ci->num_levels = levels;\n" - "+\tthis_cpu_ci->num_leaves = leaves;\n" - "+\treturn 0;\n" - "+}\n" - "+\n" - "+static int __populate_cache_leaves(unsigned int cpu)\n" - "+{\n" - "+\tstruct cpuinfo_mips *c = ¤t_cpu_data;\n" - "+\tstruct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);\n" - "+\tstruct cacheinfo *this_leaf = this_cpu_ci->info_list;\n" - "+\n" - "+\tif (c->icache.waysize) {\n" - "+\t\tpopulate_cache(dcache, this_leaf, 1, CACHE_TYPE_DATA);\n" - "+\t\tpopulate_cache(icache, this_leaf, 1, CACHE_TYPE_INST);\n" - "+\t} else {\n" - "+\t\tpopulate_cache(dcache, this_leaf, 1, CACHE_TYPE_UNIFIED);\n" - "+\t}\n" - "+\n" - "+\tif (c->scache.waysize)\n" - "+\t\tpopulate_cache(scache, this_leaf, 2, CACHE_TYPE_UNIFIED);\n" - "+\n" - "+\tif (c->tcache.waysize)\n" - "+\t\tpopulate_cache(tcache, this_leaf, 3, CACHE_TYPE_UNIFIED);\n" - "+\n" - "+\treturn 0;\n" - "+}\n" - "+\n" - "+DEFINE_SMP_CALL_CACHE_FUNCTION(init_cache_level)\n" - "+DEFINE_SMP_CALL_CACHE_FUNCTION(populate_cache_leaves)\n" - "-- \n" - 2.10.2 + Bart. -f92cde0719ed665b76db323abf456ab3d282db604f8fd140878893438ba2e43c +75a6d6b7674bdadeaf6da0475c68844c9e8773e1a695057610c64dd0e00f09a7
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox