From patchwork Thu Jan 4 12:50:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 123408 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp11389144qgn; Thu, 4 Jan 2018 04:51:00 -0800 (PST) X-Google-Smtp-Source: ACJfBot/7mUd1IkTmg/rEganYqk3t6ExZK9SixfDzndlVL9B5dvYY1V3noEJ78DOXwrEk3R84fpC X-Received: by 10.99.121.67 with SMTP id u64mr3909908pgc.432.1515070260137; Thu, 04 Jan 2018 04:51:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515070260; cv=none; d=google.com; s=arc-20160816; b=UQCwKKz8l8m++xg9fjGQuNa0GcvEcgUB7yM6834fc46aeUtQKc4eWPjLzzqLuu4r+o E8tndPhl5TW5fLk9mhMVGeEats5h7M2G2Ptm8Z9i4IWxCIZLkSXmZnhKWqFB/r5/ZEpK Tj1qezJNtAPk6sPeNhdKguKQAkUPvKOi+33S12nWAPP+SCG5q+AOeRezOu/76uxvxdnq IWpXczrsMzzU2DOa7E6VnT2SwMc/YX/SBQyW8lBYju+PSECjVAcgR+R1S26wuIlz8ECg uRSESZbGxFOqKFwuDoO9nxstlNnsLM/D+2Jn2UCI6mWePD0QnYsVK79IgWZWjstGPVCs TbXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=aYe1lJbLfbshJOHVG74zj+FsJCcR295dTE8Mph/in/M=; b=miBA9pftYwXLrn56UNUiloiDH/Ah+fuZRGyREDAhr2npzEfnqPrPB50OAqCipMRkVP YzTCyCXmUtoe/ivhzwz4Dw9kJvb8oqmFlkj8kZO5VI7Z99e9QSqpPPPZymd+0ulSXK9m /bbQX1SGvUlS1irda4s2h+THEgixXbPXJLYnm9vAiIo6WqbEQn6ZZjCh8hdYfu2Nshfs akx+fDQLtTv6NqbU6PqtoVNk/m7ngo9NBi+dKw9TQ4e3emV7fBFTRvZGy5UWO8wTTiZ9 /R/0rgLCQaStf0Y88kj2mU0YPNVEc6fYXw1LWnWKYoadjWo5gwMYVqx8EFAPTVBZQn8R bd5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iwHNanb/; 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 c80si2283237pfb.307.2018.01.04.04.50.59; Thu, 04 Jan 2018 04:51:00 -0800 (PST) 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=iwHNanb/; 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 S1752435AbeADMu4 (ORCPT + 27 others); Thu, 4 Jan 2018 07:50:56 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:41545 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752271AbeADMuy (ORCPT ); Thu, 4 Jan 2018 07:50:54 -0500 Received: by mail-wm0-f68.google.com with SMTP id g75so3331473wme.0 for ; Thu, 04 Jan 2018 04:50:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=aYe1lJbLfbshJOHVG74zj+FsJCcR295dTE8Mph/in/M=; b=iwHNanb/8aH4jCVcbO7hIromg0o34QmXru/1zpLK8Bl/QkTg9xyyPt5HrSGu5TOplm pooR+Pz07B55mGkzLhQ4MDAL1XrFctMFR7Iscp7SdQwb8t3DN/9BmAh4/ysXmy9R+BOe lbibAf0jsIEFm2tFpnoUnEvzOmoC+B+I7ghQM= 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; bh=aYe1lJbLfbshJOHVG74zj+FsJCcR295dTE8Mph/in/M=; b=okSKFdCDDlsUqG2+YBJBpLLup9uo/maFDGl+zNxWDdge/+Cfjk+ZzJAwGA27LsT2jv C67W24MZlN4vkhZiJqoQNz1RxriWYiOC3Z3WmXuxYWgO9hpc2e+LG5xYj91QtnhwlY2/ Njk9YhLLlekOem3Yhgp9CrFUYMlUZKBiX6oIq0w6JmJC2EpJruBvJ2jN79+kUNb+GUnW z58t/0uqL07bv/frk7qIsLXVp+6sNRd7/tYGIfSwELoKbEhK7YkOwdL9fJSjeQ6azAtS VhLb6T36de0NtvmIvYwxFlx0qD6FKIbE7exRnRQ/wlPjLOnXMAFj1QN09Uzxzq/+SZq9 BJoA== X-Gm-Message-State: AKGB3mJ3LTQUvZjHGw4bR7BFd0nP9sy4SM2bEDJ4ViAa2d0w4Faumfd8 XRlLWFcwioz9JFpplvDnoVqw7A== X-Received: by 10.28.71.76 with SMTP id u73mr3743369wma.77.1515070253453; Thu, 04 Jan 2018 04:50:53 -0800 (PST) Received: from mai.lan ([2001:41d0:fe90:b800:c10d:405d:d60:60bb]) by smtp.gmail.com with ESMTPSA id d71sm3668348wma.7.2018.01.04.04.50.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jan 2018 04:50:52 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org, tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, benjamin.gaignard@linaro.org Subject: [PATCH 00/12] clocksource/drivers/stm32: Consolidate the timer Date: Thu, 4 Jan 2018 13:50:16 +0100 Message-Id: <1515070228-10481-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series fixes an issue in the stm32 driver and adds the clocksource. Previous discussion for the stm32 changes ended up in no consensus because of the 16bits and 32bits timers. The proposed change were removing the 16bits timers or wasn't providing the changes in a sane way. This series fixes a bug when several timers are enabled in the DT. Now, the DT can enable any timer 16bits or 32bits and the time framework will choose the one with the best rating. So 16bits timer removal is no longer needed. The fix is written in a way it can picked up for stable@. When the driver is dealing with a 16bits timer, it computes and sets the prescaler to a value as the timer was running at 10MHz. It is a good trade off between wrapping interval and resolution. The oneshot mode is implemented and the periodic mode of the timer is replaced by the register comparison, that allows to have a free running wheel for the clocksource. After setting the scene by encaspulating the code, the clocksource is added and again it relies on the time framework to choose the right one. On this platform, the armv7_systick clocksource is better than the 16bits timers, so if only 16bits are used, only the clockevents will be used, the clocksource will be the armv7_systick. In addition the timer delay is added, it saves 90ms of boot time. A couple of trivial changes are done in timer-of in order to make the stm32 code nicer and more self-contained. Benjamin Gaignard (4): clocksource/drivers/stm32: Convert the driver to timer-of clocksource/drivers/stm32: Compute a prescaler value with a targeted rate clocksource/drivers/stm32: Add the oneshot mode clocksource/drivers/stm32: Add the clocksource Daniel Lezcano (8): clocksource/drivers/timer-of: Store the device node pointer clocksource/drivers/timer-of: Don't request the resource by name clocksource/drivers/stm32: Fix kernel panic with multiple timers clocksource/drivers/stm32: Use the node name as timer name clocksource/drivers/stm32: Encapsulate the timer width sorting out function clocksource/drivers/stm32: Encapsulate more the clockevent code clocksource/drivers/stm32: Add the timer delay clocksource/drivers/stm32: Start the timer's counter sooner drivers/clocksource/Kconfig | 1 + drivers/clocksource/timer-of.c | 11 +- drivers/clocksource/timer-of.h | 1 + drivers/clocksource/timer-stm32.c | 358 ++++++++++++++++++++++++++------------ 4 files changed, 260 insertions(+), 111 deletions(-) -- 2.7.4