From patchwork Wed May 21 12:47:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kim Kukjin X-Patchwork-Id: 4216581 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DA179BEEAB for ; Wed, 21 May 2014 12:47:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 174FB2037E for ; Wed, 21 May 2014 12:47:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C24DE20377 for ; Wed, 21 May 2014 12:47:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752509AbaEUMr3 (ORCPT ); Wed, 21 May 2014 08:47:29 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:44086 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752508AbaEUMr1 (ORCPT ); Wed, 21 May 2014 08:47:27 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N5X00G6SCV0VS80@mailout1.samsung.com> for linux-samsung-soc@vger.kernel.org; Wed, 21 May 2014 21:47:24 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.51]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id FC.39.16580.C50AC735; Wed, 21 May 2014 21:47:24 +0900 (KST) X-AuditID: cbfee691-b7f2f6d0000040c4-81-537ca05c8ffe Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 1A.1A.07139.C50AC735; Wed, 21 May 2014 21:47:24 +0900 (KST) Received: from DOKGENEKIM03 ([12.36.166.133]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N5X000W6CUZ3N80@mmp1.samsung.com>; Wed, 21 May 2014 21:47:24 +0900 (KST) From: Kukjin Kim To: 'Chirantan Ekbote' , 'Sonny Rao' Cc: 'Doug Anderson' , 'Tomasz Figa' , 'David Riley' , 'Russell King' , 'Olof Johansson' , linux-arm-kernel@lists.infradead.org, 'linux-samsung-soc' References: <1400188079-21832-1-git-send-email-chirantan@chromium.org> <53752E25.9060604@gmail.com> <53753443.8010303@gmail.com> <53753C17.1090002@gmail.com> <53754CE2.3000905@gmail.com> In-reply-to: Subject: RE: [PATCH] arm: dts: exynos5: Remove multi core timer Date: Wed, 21 May 2014 21:47:20 +0900 Message-id: <033a01cf74f2$d025ce80$70716b80$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AQFNWe4+TA1MQNXEL4KV59Y8peTylALZhXo/ApWWskQBzKu2UwEvNzgeAXj0V5ABZrsOAwG+RmGhAoAKviIBmj1l9gGntPwEAYaxxaYCW8s2jJuZxJmw Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMIsWRmVeSWpSXmKPExsVy+t8zY92YBTXBBp/niVkc/tLMZPGsm8Xi 7LKDbBabHl9jtZhxfh+Txe3LvBanrn9ms3hyZiajxapdfxgdOD1amnvYPGY3XGTx2DnrLrvH gk2lHpuX1HtcOdHE6vF5k1wAexSXTUpqTmZZapG+XQJXxu5VWxkL7ohUrLiyjr2B8bZAFyMn h4SAicTco+tYIWwxiQv31rN1MXJxCAksY5T492oGE0zRvZmfWCESixgljv1azQTh/GWUWD/x JiNIFZuAhsTh98/Yuxg5OEQEwiRmHjADqWEWWMMkcXLmWajuX6wScx5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VkNhx9jUjyCoRgRZGiZMrH7BCFIlI7HvxjnECo9AsJLNmIZk1C8msWUhaFjCy rGIUTS1ILihOSs810itOzC0uzUvXS87P3cQITh/PpHcwrmqwOMQowMGoxMO7oKg6WIg1say4 MvcQowQHs5IIr/HUmmAh3pTEyqrUovz4otKc1OJDjMlAn05klhJNzgemtrySeENjEzMjSyMz CyMTc3PShJXEeQ+2WgcKCaQnlqRmp6YWpBbBbGHi4JRqYPSeWf///MLk5xwxhvOeTuPMk8jr f/z838qn1a2x0fIGcf/nzfOW79/Zqrbfc+vpTsbgHS283+SvyLewCay7ef0Iw/dN2kwph3L+ Bi2Z13NX4OC5aazLq4SnftjLUD/F7W4L1zGRouMb338SWmS3ryxr8z1+68X+PzbXzP/vedJM y/uvUc6poIlKLMUZiYZazEXFiQAENYssYwMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Chirantan Ekbote wrote: > > >>> Anyway, I'm by no means opposed to switching to arch timers. They > >>> provide a well designed, generic interface and drivers shared by > >>> multiple platforms, which means more code sharing and possibly more eyes > >>> looking at the code, which is always good. However if they don't support > >>> low power states correctly, we can't just remove MCT. > >> > >> I think low power states aren't in mainline (right?). > >> > >> One solution that might work could be to leave the device tree entry > >> alone but change the MCT init code to simply act as a no-op if it sees > >> an arch timer is in the device tree and enabled. Then when/if someone > >> got the low power states enabled we could just change source code > >> rather than dts files. > >> > Doug and I were talking about this and we think we may have a way to > have the mct and arch timers co-exist. The main issue is that the mct > (and therefore arch timer) gets cleared once during boot and every > time we do a suspend / resume. This happens in > exynos4_mct_frc_start() but it's not immediately clear to us why the > counter needs to be reset at all. If we remove the lines that clear > the counter then there is no longer an issue with having both the mct > and the arch timers on at the same time. > Yeah, actually we don't need to reset the count value after suspend/resume. So, how about following? I think, it should be fine to you. > Alternately, if there is some code that depends on the mct being reset > we could store an offset instead of clearing the counter and then > subtract that offset every time something reads it. Doug has a patch > that does this at > https://chromium-review.googlesource.com/#/c/200298/. Effectively the > visible behavior will not change. Would either of these options work? > Hmm...I cannot open the webpage :( - Kukjin --- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 8d64200..d24db6f 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -157,12 +157,15 @@ static void exynos4_mct_frc_start(u32 hi, u32 lo) { u32 reg; - exynos4_mct_write(lo, EXYNOS4_MCT_G_CNT_L); - exynos4_mct_write(hi, EXYNOS4_MCT_G_CNT_U); - reg = __raw_readl(reg_base + EXYNOS4_MCT_G_TCON); - reg |= MCT_G_TCON_START; - exynos4_mct_write(reg, EXYNOS4_MCT_G_TCON); + + if (!(reg & MCT_G_TCON_START)) { + exynos4_mct_write(lo, EXYNOS4_MCT_G_CNT_L); + exynos4_mct_write(hi, EXYNOS4_MCT_G_CNT_U); + + reg |= MCT_G_TCON_START; + exynos4_mct_write(reg, EXYNOS4_MCT_G_TCON); + } }