Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10443480ybi; Wed, 24 Jul 2019 23:19:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0JFIl0JDkRiYUQQslfnnSFva3qxAGeagwMShge6n7+DCFmbnblcRjlhaxduY+NWjMXdWG X-Received: by 2002:aa7:8d88:: with SMTP id i8mr15289275pfr.28.1564035569211; Wed, 24 Jul 2019 23:19:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564035569; cv=none; d=google.com; s=arc-20160816; b=PpztxuRqBSzXoose71mWXadvR1FZKV9imKZcUdjr1IkbWk9Bz5pjxnCdQHDY2ePtCv Oma8LIMK36sFDkJ0ck+L4bUIkITn2atI+K/mm8rZAeL67mrkZxHkVvqqawxBL6tv2fhd sCEno1xcYHeP+QLWZKuJZdnRaGYBS4M/KFiHKB7gJ3PN5ZJU2ITCIjm1duNWEbBFWxI3 Ry9Zg106wWWmdPqbTwQv0qDCvWw79g2plxrd5tLSDHFk8Yly1yaA1kv+KhqlaBaqmuYq TLmYseNe3GlY8Sbh6UtWH0/1xz8GVtq1uwHUiGAO0UCcmkFa2ZtjO9sWtTRkUdvrYc13 /AXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lzuqjKrz3yABhOu/qp3UMU2thA72aM0KeKf9rcZQojw=; b=XLBA1DiwsFZGAaDkqYKLvc1CRtE7viHDWsgm5GMCfxDG1XvdPFsZPPeV0gWbKjx7Se GI4bOeBsht2WQng27ckhhk5iZ5lOn+sKb8pNOKQW0ypNKMHb+vBCwospt+QYBQomNwa4 e5jAmFr4AEOmwME4ihQI2Gcaj3Ng5hgmzYrKAx7i/6aK1hLucXSKckX10DQB7A+haiNA 83Ph7utrLl9jHzqLYi8ga+T/G0qlILHV3zm8EWOovqaC2d9qTFkTCO4moze0V2rGqarT MODhTuML86egWF4bpfwXoTDEwi/BH/0gQblcbEQJWNE8xaCTjVHli0J59T4lbUw5EBFg fRRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q+teFw2I; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v62si19966253pgv.126.2019.07.24.23.19.14; Wed, 24 Jul 2019 23:19:29 -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=@kernel.org header.s=default header.b=q+teFw2I; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728809AbfGYFxU (ORCPT + 99 others); Thu, 25 Jul 2019 01:53:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:53750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404088AbfGYFjc (ORCPT ); Thu, 25 Jul 2019 01:39:32 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D9B3A22BF5; Thu, 25 Jul 2019 05:39:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564033171; bh=IJzPv0efnX/GIfBHuWqn6Dq8wDNwf2eZFUyHWJ0XkP4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q+teFw2IWBXjjAJR3qA7XuAaZb6QrS4LLSHiWrM3BkW5b2WClDMtT7scCSAeBg8Dh gPureYb7wlLtnl3vQjRmXBzXT8p6N7poCJME3XXRNh3mKdSeQioaV1c1bkgYz5oYAn Jhcmw16EAMrPcydnLhX4Flie5ETnYJOiR0ThbXEk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Szyprowski , Krzysztof Kozlowski , Chanwoo Choi , Daniel Lezcano , Sasha Levin Subject: [PATCH 4.19 115/271] clocksource/drivers/exynos_mct: Increase priority over ARM arch timer Date: Wed, 24 Jul 2019 21:19:44 +0200 Message-Id: <20190724191705.092643901@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 6282edb72bed5324352522d732080d4c1b9dfed6 ] 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 Signed-off-by: Sasha Levin --- drivers/clocksource/exynos_mct.c | 4 ++-- include/linux/cpuhotplug.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index d55c30f6981d..aaf5bfa9bd9c 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -211,7 +211,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, @@ -466,7 +466,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 dec0372efe2e..d67c0035165c 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_ARMADA_TIMER_STARTING, -- 2.20.1