From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933032AbbBQN5L (ORCPT ); Tue, 17 Feb 2015 08:57:11 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:54615 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932322AbbBQN5J (ORCPT ); Tue, 17 Feb 2015 08:57:09 -0500 Message-ID: <54E348A8.4040504@ti.com> Date: Tue, 17 Feb 2015 15:56:56 +0200 From: Roger Quadros User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Robert Abel CC: , Tony Lindgren , , , Linux Kernel Maling List Subject: Re: [PATCH 3/4] ARM OMAP2+ GPMC: fix WAITMONITORINGTIME divider bug References: <1424101741-24152-1-git-send-email-rabel@cit-ec.uni-bielefeld.de> <1424101741-24152-2-git-send-email-rabel@cit-ec.uni-bielefeld.de> <1424101741-24152-3-git-send-email-rabel@cit-ec.uni-bielefeld.de> <1424101741-24152-4-git-send-email-rabel@cit-ec.uni-bielefeld.de> <54E30972.4020107@ti.com> 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 On 17/02/15 15:48, Robert Abel wrote: > Hi Roger, > > On Tue, Feb 17, 2015 at 10:27 AM, Roger Quadros wrote: >> >> Can you please point out which DT had used this pre-divided workaround? We will have to >> fix those then. > > I didn't check. A cursory glance reveals all DTS in arch/arm/boot/dts > to use a value of 0. > >> >> Can you please rebase your patches on top of v3.19? >> gpmc.c has been moved to drivers/memory/omap-gpmc.c > > > Will do. > >> >> So all the below occurrences of "unsigned int clk_sel" become "enum gpmc_clksel". > > Yes, I should have opted for a cleaner solution from the start. > >>> +static unsigned int gpmc_ns_to_clk_ticks(unsigned int time_ns, int cs, unsigned int clk_sel) >>> { >>> unsigned long tick_ps; >>> >>> /* Calculate in picosecs to yield more exact results */ >>> - tick_ps = gpmc_get_fclk_period(); >>> + tick_ps = gpmc_get_clk_period(cs, clk_sel); >>> >>> return (time_ns * 1000 + tick_ps - 1) / tick_ps; >>> } >>> >>> +static unsigned int gpmc_ns_to_ticks(unsigned int time_ns) >>> +{ >>> + return gpmc_ns_to_clk_ticks(time_ns, 0, GPMC_FCLK); >> >> This function should have been unchanged since we're dealing with GPMC_FCLK >> and it was using gpmc_get_fclk_period(). > > > Which function? gpmc_ns_to_ticks? It still uses FCLK. I merely did not > want to have the picosecond formula in two places. I don't see a good > reason to do so now either... Agree with you. I missed to see earlier that it was getting rid of the picosecond formula. > >> >> Let's call this GPMC_SET_ONE_CLKSEL() > > > Will do. > > >> >> You will also need to correct gpmc_cs_show_timings() to show the >> correct timing for "wait-monitoring-ns" based on GPMC_CLK. > > > I was working off 3.14, checked if it worked for 3.17, so both didn't > have gpmc_cs_show_timings. I'll take a look. > Thanks. cheers, -roger From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roger Quadros Subject: Re: [PATCH 3/4] ARM OMAP2+ GPMC: fix WAITMONITORINGTIME divider bug Date: Tue, 17 Feb 2015 15:56:56 +0200 Message-ID: <54E348A8.4040504@ti.com> References: <1424101741-24152-1-git-send-email-rabel@cit-ec.uni-bielefeld.de> <1424101741-24152-2-git-send-email-rabel@cit-ec.uni-bielefeld.de> <1424101741-24152-3-git-send-email-rabel@cit-ec.uni-bielefeld.de> <1424101741-24152-4-git-send-email-rabel@cit-ec.uni-bielefeld.de> <54E30972.4020107@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: Received: from arroyo.ext.ti.com ([192.94.94.40]:54615 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932322AbbBQN5J (ORCPT ); Tue, 17 Feb 2015 08:57:09 -0500 In-Reply-To: Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Robert Abel Cc: khilman@deeprootsystems.com, Tony Lindgren , linux@arm.linux.org.uk, linux-omap@vger.kernel.org, Linux Kernel Maling List On 17/02/15 15:48, Robert Abel wrote: > Hi Roger, > > On Tue, Feb 17, 2015 at 10:27 AM, Roger Quadros wrote: >> >> Can you please point out which DT had used this pre-divided workaround? We will have to >> fix those then. > > I didn't check. A cursory glance reveals all DTS in arch/arm/boot/dts > to use a value of 0. > >> >> Can you please rebase your patches on top of v3.19? >> gpmc.c has been moved to drivers/memory/omap-gpmc.c > > > Will do. > >> >> So all the below occurrences of "unsigned int clk_sel" become "enum gpmc_clksel". > > Yes, I should have opted for a cleaner solution from the start. > >>> +static unsigned int gpmc_ns_to_clk_ticks(unsigned int time_ns, int cs, unsigned int clk_sel) >>> { >>> unsigned long tick_ps; >>> >>> /* Calculate in picosecs to yield more exact results */ >>> - tick_ps = gpmc_get_fclk_period(); >>> + tick_ps = gpmc_get_clk_period(cs, clk_sel); >>> >>> return (time_ns * 1000 + tick_ps - 1) / tick_ps; >>> } >>> >>> +static unsigned int gpmc_ns_to_ticks(unsigned int time_ns) >>> +{ >>> + return gpmc_ns_to_clk_ticks(time_ns, 0, GPMC_FCLK); >> >> This function should have been unchanged since we're dealing with GPMC_FCLK >> and it was using gpmc_get_fclk_period(). > > > Which function? gpmc_ns_to_ticks? It still uses FCLK. I merely did not > want to have the picosecond formula in two places. I don't see a good > reason to do so now either... Agree with you. I missed to see earlier that it was getting rid of the picosecond formula. > >> >> Let's call this GPMC_SET_ONE_CLKSEL() > > > Will do. > > >> >> You will also need to correct gpmc_cs_show_timings() to show the >> correct timing for "wait-monitoring-ns" based on GPMC_CLK. > > > I was working off 3.14, checked if it worked for 3.17, so both didn't > have gpmc_cs_show_timings. I'll take a look. > Thanks. cheers, -roger