From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753210AbbC3QIu (ORCPT ); Mon, 30 Mar 2015 12:08:50 -0400 Received: from bhuna.collabora.co.uk ([93.93.135.160]:43235 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752478AbbC3QIs (ORCPT ); Mon, 30 Mar 2015 12:08:48 -0400 Message-ID: <55197508.5030501@collabora.co.uk> Date: Mon, 30 Mar 2015 18:08:40 +0200 From: Javier Martinez Canillas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-Version: 1.0 To: Tomasz Figa CC: Stephen Boyd , Mike Turquette , Sylwester Nawrocki , Kukjin Kim , Olof Johansson , Doug Anderson , Krzysztof Kozlowski , Kevin Hilman , Tyler Baker , Abhilash Kesavan , Chanwoo Choi , linux-arm-kernel , "linux-samsung-soc@vger.kernel.org" , linux-kernel Subject: Re: [RFC PATCH v3 1/2] clk: samsung: Add a clock lookup function References: <1427730803-28635-1-git-send-email-javier.martinez@collabora.co.uk> <1427730803-28635-2-git-send-email-javier.martinez@collabora.co.uk> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Tomasz, On 03/30/2015 06:02 PM, Tomasz Figa wrote: > Hi Javier, > > 2015-03-31 0:53 GMT+09:00 Javier Martinez Canillas > : >> The Samsung helpers functions to register clocks, add the clock instance >> returned by the common clock framework to a lookup table that is used by >> OF to lookup the clocks. >> >> But this table could also be useful to clock drivers if they need to get >> a clock instance since the helper functions don't return them. >> >> The common clock framework __clk_lookup() function from the clk provider >> API could be used by drivers as well. But it's more efficient to use the >> Samsung specific lookup table that returns the clock instance in constant >> time, than using the __clk_lookup() function that uses the clock name as >> an index so it has a linear search time. > > Is this really something we should be concerned about? If so, maybe > the generic look-up function should be rewritten to use something > faster, such as tree or hash table? > I don't performance is a big issue here. I just thought that since the lookup table is already filled by the driver and the lookup function is one line, we could use that instead to get the performance benefit. But I don't mind to drop this patch and use the generic lookup function from the CCF API if that is preferred. > Best regards, > Tomasz > Best regards, Javier From mboxrd@z Thu Jan 1 00:00:00 1970 From: Javier Martinez Canillas Subject: Re: [RFC PATCH v3 1/2] clk: samsung: Add a clock lookup function Date: Mon, 30 Mar 2015 18:08:40 +0200 Message-ID: <55197508.5030501@collabora.co.uk> References: <1427730803-28635-1-git-send-email-javier.martinez@collabora.co.uk> <1427730803-28635-2-git-send-email-javier.martinez@collabora.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: Received: from bhuna.collabora.co.uk ([93.93.135.160]:43235 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752478AbbC3QIs (ORCPT ); Mon, 30 Mar 2015 12:08:48 -0400 In-Reply-To: Sender: linux-samsung-soc-owner@vger.kernel.org List-Id: linux-samsung-soc@vger.kernel.org To: Tomasz Figa Cc: Stephen Boyd , Mike Turquette , Sylwester Nawrocki , Kukjin Kim , Olof Johansson , Doug Anderson , Krzysztof Kozlowski , Kevin Hilman , Tyler Baker , Abhilash Kesavan , Chanwoo Choi , linux-arm-kernel , "linux-samsung-soc@vger.kernel.org" , linux-kernel Hello Tomasz, On 03/30/2015 06:02 PM, Tomasz Figa wrote: > Hi Javier, > > 2015-03-31 0:53 GMT+09:00 Javier Martinez Canillas > : >> The Samsung helpers functions to register clocks, add the clock instance >> returned by the common clock framework to a lookup table that is used by >> OF to lookup the clocks. >> >> But this table could also be useful to clock drivers if they need to get >> a clock instance since the helper functions don't return them. >> >> The common clock framework __clk_lookup() function from the clk provider >> API could be used by drivers as well. But it's more efficient to use the >> Samsung specific lookup table that returns the clock instance in constant >> time, than using the __clk_lookup() function that uses the clock name as >> an index so it has a linear search time. > > Is this really something we should be concerned about? If so, maybe > the generic look-up function should be rewritten to use something > faster, such as tree or hash table? > I don't performance is a big issue here. I just thought that since the lookup table is already filled by the driver and the lookup function is one line, we could use that instead to get the performance benefit. But I don't mind to drop this patch and use the generic lookup function from the CCF API if that is preferred. > Best regards, > Tomasz > Best regards, Javier From mboxrd@z Thu Jan 1 00:00:00 1970 From: javier.martinez@collabora.co.uk (Javier Martinez Canillas) Date: Mon, 30 Mar 2015 18:08:40 +0200 Subject: [RFC PATCH v3 1/2] clk: samsung: Add a clock lookup function In-Reply-To: References: <1427730803-28635-1-git-send-email-javier.martinez@collabora.co.uk> <1427730803-28635-2-git-send-email-javier.martinez@collabora.co.uk> Message-ID: <55197508.5030501@collabora.co.uk> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hello Tomasz, On 03/30/2015 06:02 PM, Tomasz Figa wrote: > Hi Javier, > > 2015-03-31 0:53 GMT+09:00 Javier Martinez Canillas > : >> The Samsung helpers functions to register clocks, add the clock instance >> returned by the common clock framework to a lookup table that is used by >> OF to lookup the clocks. >> >> But this table could also be useful to clock drivers if they need to get >> a clock instance since the helper functions don't return them. >> >> The common clock framework __clk_lookup() function from the clk provider >> API could be used by drivers as well. But it's more efficient to use the >> Samsung specific lookup table that returns the clock instance in constant >> time, than using the __clk_lookup() function that uses the clock name as >> an index so it has a linear search time. > > Is this really something we should be concerned about? If so, maybe > the generic look-up function should be rewritten to use something > faster, such as tree or hash table? > I don't performance is a big issue here. I just thought that since the lookup table is already filled by the driver and the lookup function is one line, we could use that instead to get the performance benefit. But I don't mind to drop this patch and use the generic lookup function from the CCF API if that is preferred. > Best regards, > Tomasz > Best regards, Javier