From patchwork Wed Jun 26 14:46:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 167809 Delivered-To: patch@linaro.org Received: by 2002:ac9:6410:0:0:0:0:0 with SMTP id r16csp870677ock; Wed, 26 Jun 2019 07:47:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqymmASdoiB2iX8kMLw1532c3FpOC2zDQXnlczObNr0TEBqUCBVg6pwLG3qU7tTZ6PGy3mJj X-Received: by 2002:a17:902:a60d:: with SMTP id u13mr6006520plq.144.1561560445809; Wed, 26 Jun 2019 07:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561560445; cv=none; d=google.com; s=arc-20160816; b=lICcw3TiOQax4essEPBHoeE8Ph3g/6pYD4Eq2m3b5hplDL+p8oVVxaI5v01H5Whw5H dUqHuhSua4742ne4+W+9bePY7cUv+otaYxhmeQ3OdmsOobIPeeOSry6jgXrB82AaLqCp OfLeV0XsBrCVAyYh5KIYXarq7+KOJTd2ACAal87jm20mcE+VIKeS5MbgC/gMIsWajnjT AtN4N23im0p3M4YUgcRgkB7SSFtPD0KOTkmU25e+3yS6ftiGHSBbaAeY3VEBgb8u+N5K vrh6CjCFBPDeuNGAyP0WA3EYmcuu+M6KYRNxeJoiM9tgJ5H9tCxFwC2G1cTEKPZX3JLa Y/lQ== 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=GnURz9uBDl/JIVDRIJyHSxWewLcsuwU4f5F+HbyZmEk=; b=yqlC597C39TYi7NpHBit8IXOPehRGve6N6ykmQQauY50HD03GBVT315OoMXckkGzWT WVhHf+GXI1ZHr3TUpxGlbTJWDJdKkcmf/0we6z83lDvPTulUAn8SNYAOl6Hx8FUvRHou oQGc23UuPB/NDRbuuSz9EmJ6XJNYKD3pbxcn+Hgw43bYchtOoDgZ7MK30VlIOkLJwLRL if7AFJsDNJ4sCMPwJt3EqeLZQp0wuVt9V4VH1Ma+EsWcNBM9GGExx0k9JQg98Ho1UXiL il6zerkRTqrmfTEypCqJb5zj4q+oLDIsbPjRg70Ifdc8qS1vV2PyEOpUlMKWmnDPdTWS 1o3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KQ5btisT; 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=pass (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 x3si3453314plv.26.2019.06.26.07.47.25; Wed, 26 Jun 2019 07:47:25 -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=pass header.i=@linaro.org header.s=google header.b=KQ5btisT; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728244AbfFZOrY (ORCPT + 30 others); Wed, 26 Jun 2019 10:47:24 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43482 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728220AbfFZOrU (ORCPT ); Wed, 26 Jun 2019 10:47:20 -0400 Received: by mail-wr1-f68.google.com with SMTP id p13so3043131wru.10 for ; Wed, 26 Jun 2019 07:47:19 -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=GnURz9uBDl/JIVDRIJyHSxWewLcsuwU4f5F+HbyZmEk=; b=KQ5btisTZtuBgX3s5dqhAy9z1WRj8n9/5MKEJo4MF5cUOEuJVWT59lzvSJli34Ae21 iV7BM1IiLxpZjlXc4U/PSvZ0uTGm9C1OZag5uvgAmapx1x4Z+V0pcz3mdcWVQiyefhE/ pJOaSeG9yj1LRqoqtf/oUXu4I8DMt8P9IC8Ti3lz+/yJeUME9lJAGcMBF/L2i2WF5yWm NTQeR3ueMzafid23YxD4WI0WnHBygKBjhcibBdd836MnpUbCNQ6ELTN7KeiQW6f42nTX 7qXi5g5P7fzqqBl2oX8lGke2ZK1QriMJLHGxHDpiwjEB6jG6B/W6SfU/gQWUU1T8wCTD B7ug== 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=GnURz9uBDl/JIVDRIJyHSxWewLcsuwU4f5F+HbyZmEk=; b=lp+OJeuWwPKjx3rCFkpkSEawprXCo3igetXKhx4vvZ02mOEUEIjUauz1TnZzKOYi3H hb9/CFd7+HTG2o/ILs+UF0FvUnwQ0FUaOUy7gdTtNlTSKUqRv51/Wigioz9ofhBNwrWL hSMYkmz6TIJ0b4EJ3PtiB2Ip5a1BZRmzWVI8J41WTgRMHKxrNiSocQ/DY15Vzkz5Et9g H+bzMjkI24F/KQ0CxsHiuQ8jmQaK9RxzFHoTbNrsNtLA11XffC7dbWRctm79dZiFbrMw IrPd9aZEDUc8Ec4PmKab5zXqNGE7deGx8mHGepRmE6EKva2/Hv/2lu0YYPZe4aKnNtgQ IBPQ== X-Gm-Message-State: APjAAAWgIFH6WQze49Cfgahi3YJA9yI1wqNeAPoAtLURsm7dW4ujToHd wc/XK/wR4iUHZYiQIh2ohURv5Q== X-Received: by 2002:adf:ce88:: with SMTP id r8mr4325093wrn.42.1561560438445; Wed, 26 Jun 2019 07:47:18 -0700 (PDT) Received: from mai.imgcgcw.net (26.92.130.77.rev.sfr.net. [77.130.92.26]) by smtp.gmail.com with ESMTPSA id h84sm2718557wmf.43.2019.06.26.07.47.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Jun 2019 07:47:17 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Marek Szyprowski , Kukjin Kim , Krzysztof Kozlowski , Will Deacon , Palmer Dabbelt , Borislav Petkov , "Rafael J. Wysocki" , Lucas Stach , "Kulkarni, Ganapatrao" , Peter Zijlstra , Guo Ren , Joseph Lo , Anju T Sudhakar , Hoan Tran , linux-arm-kernel@lists.infradead.org (moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES), linux-samsung-soc@vger.kernel.org (moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES) Subject: [PATCH 04/25] clocksource/drivers/exynos_mct: Increase priority over ARM arch timer Date: Wed, 26 Jun 2019 16:46:30 +0200 Message-Id: <20190626144651.16742-4-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190626144651.16742-1-daniel.lezcano@linaro.org> References: <20190626144651.16742-1-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Szyprowski Exynos SoCs based on CA7/CA15 have 2 timer interfaces: custom Exynos MCT (Multi Core Timer) and standard ARM Architected Timers. There are use cases, where both timer interfaces are used simultanously. One of such examples is using Exynos MCT for the main system timer and ARM Architected Timers for the KVM and virtualized guests (KVM requires arch timers). Exynos Multi-Core Timer driver (exynos_mct) must be however started before ARM Architected Timers (arch_timer), because they both share some common hardware blocks (global system counter) and turning on MCT is needed to get ARM Architected Timer working properly. To ensure selecting Exynos MCT as the main system timer, increase MCT timer rating. To ensure proper starting order of both timers during suspend/resume cycle, increase MCT hotplug priority over ARM Archictected Timers. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Reviewed-by: Chanwoo Choi Signed-off-by: Daniel Lezcano --- drivers/clocksource/exynos_mct.c | 4 ++-- include/linux/cpuhotplug.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 34bd250d46c6..6aa10cbc1d59 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -209,7 +209,7 @@ static void exynos4_frc_resume(struct clocksource *cs) static struct clocksource mct_frc = { .name = "mct-frc", - .rating = 400, + .rating = 450, /* use value higher than ARM arch timer */ .read = exynos4_frc_read, .mask = CLOCKSOURCE_MASK(32), .flags = CLOCK_SOURCE_IS_CONTINUOUS, @@ -464,7 +464,7 @@ static int exynos4_mct_starting_cpu(unsigned int cpu) evt->set_state_oneshot_stopped = set_state_shutdown; evt->tick_resume = set_state_shutdown; evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; - evt->rating = 450; + evt->rating = 500; /* use value higher than ARM arch timer */ exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET); diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index 5c6062206760..87c211adf49e 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -116,10 +116,10 @@ enum cpuhp_state { CPUHP_AP_PERF_ARM_ACPI_STARTING, CPUHP_AP_PERF_ARM_STARTING, CPUHP_AP_ARM_L2X0_STARTING, + CPUHP_AP_EXYNOS4_MCT_TIMER_STARTING, CPUHP_AP_ARM_ARCH_TIMER_STARTING, CPUHP_AP_ARM_GLOBAL_TIMER_STARTING, CPUHP_AP_JCORE_TIMER_STARTING, - CPUHP_AP_EXYNOS4_MCT_TIMER_STARTING, CPUHP_AP_ARM_TWD_STARTING, CPUHP_AP_QCOM_TIMER_STARTING, CPUHP_AP_TEGRA_TIMER_STARTING,