From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King - ARM Linux Date: Mon, 02 Feb 2015 17:49:45 +0000 Subject: Re: [PATCH v13 4/6] clk: Add rate constraints to clocks Message-Id: <20150202174945.GA8670@n2100.arm.linux.org.uk> List-Id: References: <1422011024-32283-1-git-send-email-tomeu.vizoso@collabora.com> <1422011024-32283-5-git-send-email-tomeu.vizoso@collabora.com> <54CA8662.7040008@codeaurora.org> <20150131013158.GA4323@codeaurora.org> <20150201221856.421.6151@quantum> <20150202161237.GG16250@atomide.com> <20150202174646.421.52331@quantum> In-Reply-To: <20150202174646.421.52331@quantum> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-arm-kernel@lists.infradead.org On Mon, Feb 02, 2015 at 09:46:46AM -0800, Mike Turquette wrote: > This looks like mis-matched enable/disable calls. We now have unique > struct clk pointers for every call to clk_get. I haven't yet looked > through the hwmod code but I have a feeling that we're doing something > like this: > > /* enable clock */ > my_clk = clk_get(...); > clk_prepare_enable(my_clk); > clk_put(my_clk); > > /* do some work */ > do_work(); > > /* disable clock */ > my_clk = clk_get(...); > clk_disable_unprepare(my_clk); > clk_put(my_clk); > > The above pattern no longer works since my_clk will be two different > unique pointers, but it really should be one stable pointer across the > whole usage of the clk. E.g: Yes, it has always been documented that shall be the case. Anyone doing the above is basically broken. -- FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up according to speedtest.net. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932659AbbBBRuV (ORCPT ); Mon, 2 Feb 2015 12:50:21 -0500 Received: from pandora.arm.linux.org.uk ([78.32.30.218]:43220 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753287AbbBBRuS (ORCPT ); Mon, 2 Feb 2015 12:50:18 -0500 Date: Mon, 2 Feb 2015 17:49:45 +0000 From: Russell King - ARM Linux To: Mike Turquette Cc: Tony Lindgren , Geert Uytterhoeven , Tomeu Vizoso , Stephen Boyd , Linux MIPS Mailing List , "linux-doc@vger.kernel.org" , Chao Xie , Haojian Zhuang , Boris Brezillon , Jonathan Corbet , Emilio L??pez , Linux-sh list , Alex Elder , Zhangfei Gao , Bintian Wang , Matt Porter , "linux-omap@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Ralf Baechle , Tero Kristo , Manuel Lauss , Maxime Ripard , Javier Martinez Canillas Subject: Re: [PATCH v13 4/6] clk: Add rate constraints to clocks Message-ID: <20150202174945.GA8670@n2100.arm.linux.org.uk> References: <1422011024-32283-1-git-send-email-tomeu.vizoso@collabora.com> <1422011024-32283-5-git-send-email-tomeu.vizoso@collabora.com> <54CA8662.7040008@codeaurora.org> <20150131013158.GA4323@codeaurora.org> <20150201221856.421.6151@quantum> <20150202161237.GG16250@atomide.com> <20150202174646.421.52331@quantum> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150202174646.421.52331@quantum> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 02, 2015 at 09:46:46AM -0800, Mike Turquette wrote: > This looks like mis-matched enable/disable calls. We now have unique > struct clk pointers for every call to clk_get. I haven't yet looked > through the hwmod code but I have a feeling that we're doing something > like this: > > /* enable clock */ > my_clk = clk_get(...); > clk_prepare_enable(my_clk); > clk_put(my_clk); > > /* do some work */ > do_work(); > > /* disable clock */ > my_clk = clk_get(...); > clk_disable_unprepare(my_clk); > clk_put(my_clk); > > The above pattern no longer works since my_clk will be two different > unique pointers, but it really should be one stable pointer across the > whole usage of the clk. E.g: Yes, it has always been documented that shall be the case. Anyone doing the above is basically broken. -- FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up according to speedtest.net. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pandora.arm.linux.org.uk ([78.32.30.218]:40812 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S27012426AbbBBRuPhTRKW (ORCPT ); Mon, 2 Feb 2015 18:50:15 +0100 Date: Mon, 2 Feb 2015 17:49:45 +0000 From: Russell King - ARM Linux Subject: Re: [PATCH v13 4/6] clk: Add rate constraints to clocks Message-ID: <20150202174945.GA8670@n2100.arm.linux.org.uk> References: <1422011024-32283-1-git-send-email-tomeu.vizoso@collabora.com> <1422011024-32283-5-git-send-email-tomeu.vizoso@collabora.com> <54CA8662.7040008@codeaurora.org> <20150131013158.GA4323@codeaurora.org> <20150201221856.421.6151@quantum> <20150202161237.GG16250@atomide.com> <20150202174646.421.52331@quantum> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150202174646.421.52331@quantum> Return-Path: Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-subscribe: List-owner: List-post: List-archive: To: Mike Turquette Cc: Tony Lindgren , Geert Uytterhoeven , Tomeu Vizoso , Stephen Boyd , Linux MIPS Mailing List , "linux-doc@vger.kernel.org" , Chao Xie , Haojian Zhuang , Boris Brezillon , Jonathan Corbet , Emilio L??pez , Linux-sh list , Alex Elder , Zhangfei Gao , Bintian Wang , Matt Porter , "linux-omap@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Ralf Baechle , Tero Kristo , Manuel Lauss , Maxime Ripard , Javier Martinez Canillas Message-ID: <20150202174945.rqji5onR-csZ8_PR-Ays6M8fHmtVqqu5I4cy0moxryo@z> On Mon, Feb 02, 2015 at 09:46:46AM -0800, Mike Turquette wrote: > This looks like mis-matched enable/disable calls. We now have unique > struct clk pointers for every call to clk_get. I haven't yet looked > through the hwmod code but I have a feeling that we're doing something > like this: > > /* enable clock */ > my_clk = clk_get(...); > clk_prepare_enable(my_clk); > clk_put(my_clk); > > /* do some work */ > do_work(); > > /* disable clock */ > my_clk = clk_get(...); > clk_disable_unprepare(my_clk); > clk_put(my_clk); > > The above pattern no longer works since my_clk will be two different > unique pointers, but it really should be one stable pointer across the > whole usage of the clk. E.g: Yes, it has always been documented that shall be the case. Anyone doing the above is basically broken. -- FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up according to speedtest.net. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King - ARM Linux Subject: Re: [PATCH v13 4/6] clk: Add rate constraints to clocks Date: Mon, 2 Feb 2015 17:49:45 +0000 Message-ID: <20150202174945.GA8670@n2100.arm.linux.org.uk> References: <1422011024-32283-1-git-send-email-tomeu.vizoso@collabora.com> <1422011024-32283-5-git-send-email-tomeu.vizoso@collabora.com> <54CA8662.7040008@codeaurora.org> <20150131013158.GA4323@codeaurora.org> <20150201221856.421.6151@quantum> <20150202161237.GG16250@atomide.com> <20150202174646.421.52331@quantum> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20150202174646.421.52331@quantum> Sender: linux-kernel-owner@vger.kernel.org To: Mike Turquette Cc: Tony Lindgren , Geert Uytterhoeven , Tomeu Vizoso , Stephen Boyd , Linux MIPS Mailing List , "linux-doc@vger.kernel.org" , Chao Xie , Haojian Zhuang , Boris Brezillon , Jonathan Corbet , Emilio L??pez , Linux-sh list , Alex Elder , Zhangfei Gao , Bintian Wang , Matt Porter , "linux-omap@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Ralf Baechle List-Id: linux-omap@vger.kernel.org On Mon, Feb 02, 2015 at 09:46:46AM -0800, Mike Turquette wrote: > This looks like mis-matched enable/disable calls. We now have unique > struct clk pointers for every call to clk_get. I haven't yet looked > through the hwmod code but I have a feeling that we're doing something > like this: > > /* enable clock */ > my_clk = clk_get(...); > clk_prepare_enable(my_clk); > clk_put(my_clk); > > /* do some work */ > do_work(); > > /* disable clock */ > my_clk = clk_get(...); > clk_disable_unprepare(my_clk); > clk_put(my_clk); > > The above pattern no longer works since my_clk will be two different > unique pointers, but it really should be one stable pointer across the > whole usage of the clk. E.g: Yes, it has always been documented that shall be the case. Anyone doing the above is basically broken. -- FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up according to speedtest.net. From mboxrd@z Thu Jan 1 00:00:00 1970 From: linux@arm.linux.org.uk (Russell King - ARM Linux) Date: Mon, 2 Feb 2015 17:49:45 +0000 Subject: [PATCH v13 4/6] clk: Add rate constraints to clocks In-Reply-To: <20150202174646.421.52331@quantum> References: <1422011024-32283-1-git-send-email-tomeu.vizoso@collabora.com> <1422011024-32283-5-git-send-email-tomeu.vizoso@collabora.com> <54CA8662.7040008@codeaurora.org> <20150131013158.GA4323@codeaurora.org> <20150201221856.421.6151@quantum> <20150202161237.GG16250@atomide.com> <20150202174646.421.52331@quantum> Message-ID: <20150202174945.GA8670@n2100.arm.linux.org.uk> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Mon, Feb 02, 2015 at 09:46:46AM -0800, Mike Turquette wrote: > This looks like mis-matched enable/disable calls. We now have unique > struct clk pointers for every call to clk_get. I haven't yet looked > through the hwmod code but I have a feeling that we're doing something > like this: > > /* enable clock */ > my_clk = clk_get(...); > clk_prepare_enable(my_clk); > clk_put(my_clk); > > /* do some work */ > do_work(); > > /* disable clock */ > my_clk = clk_get(...); > clk_disable_unprepare(my_clk); > clk_put(my_clk); > > The above pattern no longer works since my_clk will be two different > unique pointers, but it really should be one stable pointer across the > whole usage of the clk. E.g: Yes, it has always been documented that shall be the case. Anyone doing the above is basically broken. -- FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up according to speedtest.net.