Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752808AbcKRIrn (ORCPT ); Fri, 18 Nov 2016 03:47:43 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:63591 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752724AbcKRIrk (ORCPT ); Fri, 18 Nov 2016 03:47:40 -0500 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Krzysztof Kozlowski , Russell King , Kukjin Kim , Javier Martinez Canillas , linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Bartlomiej Zolnierkiewicz , Tomasz Figa , Ben Dooks , Sylwester Nawrocki , Lee Jones , Marek Szyprowski Subject: Re: [PATCH v2] ARM: Drop fixed 200 Hz timer requirement from Samsung platforms Date: Fri, 18 Nov 2016 09:46:47 +0100 Message-ID: <22757093.ejshJp9T7L@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <1479453418-25314-1-git-send-email-krzk@kernel.org> References: <1479453418-25314-1-git-send-email-krzk@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:+dBZloEwt9LSyJ34IwIAAdIodMm0gAqwxJ+q9xjWDh/H0ojWoY7 bhIblriZWproIWRv/jnbpIBsCIQUcEtqzvv7IWaJqF3YsKwagdl6ElES46Xri0GbYe/eqaG 1MMvh5UT/5xJhmBqKeYcA83KeEnZDDVes8M6i624OYeYWGyrEVbLmZE0wVV3rKfJU2k+EWZ RgBnzIP8xAYuP1JErilOA== X-UI-Out-Filterresults: notjunk:1;V01:K0:JyyMWYRjg/8=:TZ/fCFFGT4PbXnVCsSSm/P tryi+C9GmzDgIj9Y7fRJq5Uoycao91XuL74JbpbBFfZGPgNBQldAyuiF6XrXleFX7yDPu5bS+ 9zzMAHNyQIk9zCrE6eZL2IAbNraeM1o25dwpO0e/LkN3aD93T1CentLoBSipav0p+DlGQ3OfX 1Zn9ALBPyI5of9IppYpnBbP8WcwbAAms6BI7W4BxnJBdxSMcYLSNZdEJBUkU16u2iosofyD1V 2e+No084a+9GTEB8j5TDvGVC7ELxdPFnKGyFXWJH/UboVROcT+j1fWiiBsT4SbNmmYPs7iw6+ a4KhXGKWVcPI9jXOj1dtA0I8YAvpJftStXx04zSUA3WzuVoB0Uj3q4Njcb7M0bQBHrMgQAqhd tExm5qvBhXUzEpFENlG0qeSMEBNCCPB2iVveldC1f4ZAhlmeyNOaIdtu+MC6XET7cpX5QDBUJ ods72RSJsRZslaDT5USxSsI1NsI26RBIgNCGcDqSCfjYlfkX2w2lJhn+7JMSDj1y7D3A3SWMZ lXBcyJyNtqTyEWNUt9MpXceVJZ/vGKWXAu1WeqzDOkD5sph0aFd28BV0AA3HN2rwJL0Zx0eSc kZelqGoqWumHMnpIxF9ZJcg/7x574hY+GN9Tjhnyh3YCX7WA4V5jwkkZ3DaQ8MBchyBhIWfBa btZ4e01JjK3gFPqXaQSUEz5xGzTgR/IeFOhxqgPcW0NKtzLxeGQCpsAxOZmO1vtP4j4yJeV0g wtW43AevXFSfsMyo Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1965 Lines: 45 On Friday, November 18, 2016 9:16:58 AM CET Krzysztof Kozlowski wrote: > All Samsung platforms, including the Exynos, are selecting HZ_FIXED with > 200 Hz. Unfortunately in case of multiplatform image this affects also > other platforms when Exynos is enabled. > > This looks like an very old legacy code, dating back to initial > upstreaming of S3C24xx. Probably it was required for s3c24xx timer > driver, which was removed in commit ad38bdd15d5b ("ARM: SAMSUNG: Remove > unused plat-samsung/time.c"). > > Since then, this fixed 200 Hz spread everywhere, including out-of-tree > Samsung kernels (SoC vendor's and Tizen's). I believe this choice > was rather an effect of coincidence instead of conscious choice. > > Exynos uses its own MCT or arch timer and can work with all HZ values. > Older platforms use newer Samsung PWM timer driver which should handle > down to 100 Hz. > > Few perf mem and sched tests on Odroid XU3 board (Exynos5422, 4x Cortex > A7, 4x Cortex A15) show no regressions when switching from 200 Hz to > other values. > > Reported-by: Lee Jones > [Dropping 200_HZ from S3C/S5P suggested by Arnd] > Reported-by: Arnd Bergmann > Signed-off-by: Krzysztof Kozlowski > Cc: Kukjin Kim > Tested-by: Javier Martinez Canillas > Acked-by: Arnd Bergmann Maybe add a paragraph about the specific problem: "On s3c24xx, the PWM counter is only 16 bit wide, and with the typical 12MHz input clock that overflows every 5.5ms. This works with HZ=200 or higher but not with HZ=100 which needs a 10ms interval between ticks. On Later chips (S3C64xx, S5P and EXYNOS), the counter is 32 bits and does not have this problem. The new samsung_pwm_timer driver solves the problem by scaling the input clock by a factor of 50 on s3c24xx, which makes it less accurate but allows HZ=100 as well as CONFIG_NO_HZ with fewer wakeups". Arnd