Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1290148imm; Fri, 14 Sep 2018 14:55:34 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ9we+pn1HzyrIvxccCo/6jKeL6QpVApLkZ4p3TjnhA3rxCxvNMVGvvkVy/tjbRpqAHCe/P X-Received: by 2002:a17:902:6b0b:: with SMTP id o11-v6mr13980513plk.214.1536962134233; Fri, 14 Sep 2018 14:55:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536962134; cv=none; d=google.com; s=arc-20160816; b=AU5+jAJCg47pIHx8ejHG4r0X81AUz3Tti4Tjj6E1z2t+9+G+ajLUGQFXd3nFJO2ZfM HBEXbWKdSS4RMFP+/kEQRcQqYzJZ4v5OeRUmKIRcZCFUhSpnKBYiXwm/2/bvreVkalzG TnTuI/gPaxXJeST8CDq4cjb9SoSDaK410Wi4AGeXEkHCzv2zqai7xuZmAOfAEYiCYNWq o1sBxwapQxv4kDFxWm1IK19L8/369kiQEFFryMg10cSKXy6GwbLpO2U+RPBHRYMWmhk+ OFT9PW/tRgu2wSUxTQLofOFQyXkNDJH6QBDSUyNA77u+ONii4PLl2myrZ/Gd2ocq6Ti8 yHxg== 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; bh=J+IHWj8U0EBuhMQ/xR400RF3ONcZWJq6wey7//Zeae8=; b=hHwnIcwiKT8XHgww24ESc2BhPZHWKnJnHDmJAC6EXUvZKxV82aHJpa2CEwZo9WqoQ+ gcp7bt91W2DOryZDuQdtDlUlxFtWzARQECZJ08VyLfsurCigsRaCQR9sIk2pfAVLHstF NmCLSjlpyinNTf8SHWOeh9Two8daCNGwecfVfH+8vc6nnHGP5EHXc5coM4cYFETk11Kw FSuMU+CJrIU+FVuJduAyxrXO8s2ihY1Z+K0X3xIxxZpeZodn2XD+/khg+r5vUf17z+Yp XemRbrLLnNLc+vKXzBzJdZUwGA9ecEFAC5Un8rgwcWWztqzFOqsbLZ30YN1P9bOiQ98s ztPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=B+uwYASN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g185-v6si7323744pgc.151.2018.09.14.14.55.06; Fri, 14 Sep 2018 14:55:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=B+uwYASN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728211AbeIODLT (ORCPT + 99 others); Fri, 14 Sep 2018 23:11:19 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:23763 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728064AbeIODLS (ORCPT ); Fri, 14 Sep 2018 23:11:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1536962098; x=1568498098; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=rEzYxMS1WWw1ZPTVuVRsKdHaMeMfJ1SMBUMSHZJL014=; b=B+uwYASNZs+Uus/rji0wubwlFous8O7nwEHEpMQv57YckX1z7RsTddEf kcaqr7B/g6hJTQHaEO8VY4f8BHRylWoGVkKLdezW0ihSR/xZFAT3wlFax yrJTmdLbavIYJLh9zd1ugCFJhhiDT8xMj/L5lCg8COXbGBzcW5PFMFgZD KeExjEc+qbH5EocpT48BSqA1Gmo+cgLutBLOJNgHPaX+0lvcQPUnLUpmn 2lPKGVqGja3V4E8mqIXgHdWZNHIjykyfNQB1+KOT4IataMdMubdJoXOXb BNh885fNt5H5U3bNrDxCeRqT0EqEpDThdxi/bh7Tb5UOMYYk3vzkByy9D Q==; X-IronPort-AV: E=Sophos;i="5.53,374,1531756800"; d="scan'208";a="89803051" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 15 Sep 2018 05:54:58 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 14 Sep 2018 14:41:23 -0700 Received: from jedi-01.sdcorp.global.sandisk.com (HELO jedi-01.int.fusionio.com) ([10.11.143.218]) by uls-op-cesaip02.wdc.com with ESMTP; 14 Sep 2018 14:54:58 -0700 From: Atish Patra To: palmer@sifive.com, linux-riscv@lists.infradead.org, hch@infradead.org Cc: anup@brainfault.org, atish.patra@wdc.com, mark.rutland@arm.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, Damien.LeMoal@wdc.com, marc.zyngier@arm.com, robh@kernel.org Subject: [RFC 3/3] RISC-V: Remove per cpu clocksource Date: Fri, 14 Sep 2018 14:54:56 -0700 Message-Id: <1536962096-233842-4-git-send-email-atish.patra@wdc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536962096-233842-1-git-send-email-atish.patra@wdc.com> References: <1536962096-233842-1-git-send-email-atish.patra@wdc.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is only one clocksource in RISC-V. The boot cpu initializes that clocksource. No need to keep a percpu data structure. Signed-off-by: Atish Patra --- drivers/clocksource/riscv_timer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/clocksource/riscv_timer.c b/drivers/clocksource/riscv_timer.c index 335bdb91..537c5c70 100644 --- a/drivers/clocksource/riscv_timer.c +++ b/drivers/clocksource/riscv_timer.c @@ -49,7 +49,7 @@ static unsigned long long riscv_clocksource_rdtime(struct clocksource *cs) return get_cycles64(); } -static DEFINE_PER_CPU(struct clocksource, riscv_clocksource) = { +static struct clocksource riscv_clocksource = { .name = "riscv_clocksource", .rating = 300, .mask = CLOCKSOURCE_MASK(BITS_PER_LONG), @@ -101,7 +101,6 @@ static long __init riscv_timebase_frequency(struct device_node *node) static int __init riscv_timer_init_dt(struct device_node *n) { int cpuid, hartid, error; - struct clocksource *cs; hartid = riscv_of_processor_hartid(n); cpuid = riscv_hartid_to_cpuid(hartid); @@ -110,8 +109,7 @@ static int __init riscv_timer_init_dt(struct device_node *n) return 0; riscv_timebase = riscv_timebase_frequency(n); - cs = per_cpu_ptr(&riscv_clocksource, cpuid); - clocksource_register_hz(cs, riscv_timebase); + clocksource_register_hz(&riscv_clocksource, riscv_timebase); error = cpuhp_setup_state(CPUHP_AP_RISCV_TIMER_STARTING, "clockevents/riscv/timer:starting", -- 2.7.4