From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933714AbdCJJRq (ORCPT ); Fri, 10 Mar 2017 04:17:46 -0500 Received: from smtprelay.synopsys.com ([198.182.47.9]:48397 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933091AbdCJJRm (ORCPT ); Fri, 10 Mar 2017 04:17:42 -0500 From: Vlad Zakharov To: "tglx@linutronix.de" , "linux-kernel@vger.kernel.org" CC: "daniel.lezcano@linaro.org" , "john.stultz@linaro.org" , "linux-pm@vger.kernel.org" , "linux-snps-arc@lists.infradead.org" Subject: update timer frequencies Thread-Topic: update timer frequencies Thread-Index: AQHSmX8fiZkS29Hly0CVfpkf5BIhWA== Date: Fri, 10 Mar 2017 09:17:21 +0000 Message-ID: <1489137441.2333.46.camel@synopsys.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.121.8.100] Content-Type: text/plain; charset="utf-8" Content-ID: <1C1DBD0AC475144C93E4B200EB5D5D5B@internal.synopsys.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v2A9HrMD022077 Hello, I am trying to implement a cpufreq driver for ARC CPUs.  The point is that ARC timers (including those are used for timekeeping) are driven by the same clock as ARC CPU core(s). So if cpufreq driver changes CPU frequency timers frequency also updates.  I added notification handler to ARC timer driver were I attempted to update clocksource frequency with "__clocksource_update_freq_hz()" but I found that actually the frequency didn't update.  During my further investigation I mentioned that timekeeping framework doesn't allow frequency changes for more than 11%. This is quiet frustratingly: ARC cores supports such adjustments themselves but current framework API doesn't give us a chance to use this functionality and in fact it even forbids CPU frequency changes in runtime at all. Maybe I am mistaken and there is some way to get this going? Or maybe we can add some minor changes to timekeeping framework to resolve this issue (special flag that allows such changes or something like this?). Thanks. -- Best regards, Vlad Zakharov From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vlad Zakharov Subject: update timer frequencies Date: Fri, 10 Mar 2017 09:17:21 +0000 Message-ID: <1489137441.2333.46.camel@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Content-Language: en-US Content-ID: <1C1DBD0AC475144C93E4B200EB5D5D5B@internal.synopsys.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+gla-linux-snps-arc=m.gmane.org@lists.infradead.org To: "tglx@linutronix.de" , "linux-kernel@vger.kernel.org" Cc: "linux-snps-arc@lists.infradead.org" , "daniel.lezcano@linaro.org" , "john.stultz@linaro.org" , "linux-pm@vger.kernel.org" List-Id: linux-pm@vger.kernel.org SGVsbG8sDQoNCkkgYW0gdHJ5aW5nIHRvIGltcGxlbWVudCBhIGNwdWZyZXEgZHJpdmVyIGZvciBB UkMgQ1BVcy7CoA0KVGhlIHBvaW50IGlzIHRoYXQgQVJDIHRpbWVycyAoaW5jbHVkaW5nIHRob3Nl IGFyZSB1c2VkIGZvciB0aW1la2VlcGluZykgYXJlIGRyaXZlbiBieSB0aGUgc2FtZSBjbG9jayBh cyBBUkMgQ1BVIGNvcmUocykuDQoNClNvIGlmIGNwdWZyZXEgZHJpdmVyIGNoYW5nZXMgQ1BVIGZy ZXF1ZW5jeSB0aW1lcnMgZnJlcXVlbmN5IGFsc28gdXBkYXRlcy7CoA0KSSBhZGRlZCBub3RpZmlj YXRpb24gaGFuZGxlciB0byBBUkMgdGltZXIgZHJpdmVyIHdlcmUgSSBhdHRlbXB0ZWQgdG8gdXBk YXRlIGNsb2Nrc291cmNlIGZyZXF1ZW5jeSB3aXRoDQoiX19jbG9ja3NvdXJjZV91cGRhdGVfZnJl cV9oeigpIiBidXQgSSBmb3VuZCB0aGF0IGFjdHVhbGx5IHRoZ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W5mcmFkZWFkLm9yZy9tYWlsbWFuL2xpc3RpbmZv L2xpbnV4LXNucHMtYXJj From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladislav.Zakharov@synopsys.com (Vlad Zakharov) Date: Fri, 10 Mar 2017 09:17:21 +0000 Subject: update timer frequencies List-ID: Message-ID: <1489137441.2333.46.camel@synopsys.com> To: linux-snps-arc@lists.infradead.org Hello, I am trying to implement a cpufreq driver for ARC CPUs.? The point is that ARC timers (including those are used for timekeeping) are driven by the same clock as ARC CPU core(s). So if cpufreq driver changes CPU frequency timers frequency also updates.? I added notification handler to ARC timer driver were I attempted to update clocksource frequency with "__clocksource_update_freq_hz()" but I found that actually the frequency didn't update.? During my further investigation I mentioned that timekeeping framework doesn't allow frequency changes for more than 11%. This is quiet frustratingly: ARC cores supports such adjustments themselves but current framework API doesn't give us a chance to use this functionality and in fact it even forbids CPU frequency changes in runtime at all. Maybe I am mistaken and there is some way to get this going? Or maybe we can add some minor changes to timekeeping framework to resolve this issue (special flag that allows such changes or something like this?). Thanks. -- Best regards, Vlad Zakharov