From patchwork Fri Mar 6 12:47:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 11423813 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 467B992A for ; Fri, 6 Mar 2020 12:49:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 229DA2084E for ; Fri, 6 Mar 2020 12:49:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727291AbgCFMtU (ORCPT ); Fri, 6 Mar 2020 07:49:20 -0500 Received: from mail.baikalelectronics.com ([87.245.175.226]:35734 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727366AbgCFMtU (ORCPT ); Fri, 6 Mar 2020 07:49:20 -0500 Received: from localhost (unknown [127.0.0.1]) by mail.baikalelectronics.ru (Postfix) with ESMTP id CB9728030793; Fri, 6 Mar 2020 12:49:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at baikalelectronics.ru Received: from mail.baikalelectronics.ru ([127.0.0.1]) by localhost (mail.baikalelectronics.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7kX8u0FVca63; Fri, 6 Mar 2020 15:49:18 +0300 (MSK) From: To: Thomas Bogendoerfer CC: Serge Semin , Serge Semin , Alexey Malahov , Paul Burton , Ralf Baechle , , Subject: [PATCH 20/22] mips: csrc-r4k: Decrease r4k-clocksource rating if CPU_FREQ enabled Date: Fri, 6 Mar 2020 15:47:03 +0300 In-Reply-To: <20200306124705.6595-1-Sergey.Semin@baikalelectronics.ru> References: <20200306124705.6595-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Message-Id: <20200306124918.CB9728030793@mail.baikalelectronics.ru> Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org From: Serge Semin Commit 07d69579e7fe ("MIPS: Don't register r4k sched clock when CPUFREQ enabled") disabled the r4k-clock usage for scheduler ticks counting due to the scheduler being non-tolerant for unstable clocks sources. For the same reason the clock should be used in the system clocksource framework only as a last resort if CPU frequency may change. Signed-off-by: Serge Semin Signed-off-by: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle --- arch/mips/kernel/csrc-r4k.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/mips/kernel/csrc-r4k.c b/arch/mips/kernel/csrc-r4k.c index eed099f35bf1..78ffc105226c 100644 --- a/arch/mips/kernel/csrc-r4k.c +++ b/arch/mips/kernel/csrc-r4k.c @@ -71,7 +71,11 @@ int __init init_r4k_clocksource(void) return -ENXIO; /* Calculate a somewhat reasonable rating value */ +#ifndef CONFIG_CPU_FREQ clocksource_mips.rating = 200 + mips_hpt_frequency / 10000000; +#else + clocksource_mips.rating = 99; +#endif /* * R2 onwards makes the count accessible to user mode so it can be used