public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Jon Hunter <jon-hunter@ti.com>
To: Jon Hunter <jon-hunter@ti.com>
Cc: linux-omap <linux-omap@vger.kernel.org>,
	Tony Lindgren <tony@atomide.com>,
	Tarun Kanti DebBarma <tarun.kanti@ti.com>
Subject: Re: [PATCH V3 06/12] ARM: OMAP1: Fix dmtimer support
Date: Mon, 4 Jun 2012 14:47:47 -0500	[thread overview]
Message-ID: <4FCD10E3.7050106@ti.com> (raw)
In-Reply-To: <1338838909-25356-7-git-send-email-jon-hunter@ti.com>


On 06/04/2012 02:41 PM, Jon Hunter wrote:
> OMAP1 dmtimer support is currently broken. When a dmtimer is requested by the
> omap_dm_timer_request() function fails to allocate a dmtimer because the call
> to clk_get() inside omap_dm_timer_prepare fails. The clk_get() fails simply
> because the clock data for the OMAP1 dmtimers is not present.
> 
> Ideally this should be fixed by moving OMAP1 dmtimers to use the clock
> framework. For now simply fix this by using the "TIMER_NEEDS_RESET" flag to
> identify an OMAP1 device and avoid calling clk_get(). Although this is not
> the ideal fix and should be corrected, this flag has already been use for the
> same purpose in omap_dm_timer_stop().
> 
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> ---
>  arch/arm/plat-omap/dmtimer.c |   16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
> index 30742d8e6..d284b5d 100644
> --- a/arch/arm/plat-omap/dmtimer.c
> +++ b/arch/arm/plat-omap/dmtimer.c
> @@ -137,11 +137,17 @@ int omap_dm_timer_prepare(struct omap_dm_timer *timer)
>  	struct dmtimer_platform_data *pdata = timer->pdev->dev.platform_data;
>  	int ret;
>  
> -	timer->fclk = clk_get(&timer->pdev->dev, "fck");
> -	if (WARN_ON_ONCE(IS_ERR_OR_NULL(timer->fclk))) {
> -		timer->fclk = NULL;
> -		dev_err(&timer->pdev->dev, ": No fclk handle.\n");
> -		return -EINVAL;
> +	/*
> +	 * FIXME: OMAP1 devices do not use the clock framework for dmtimers so
> +	 * do not call clk_get() for these devices.
> +	 */
> +	if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) {
> +		timer->fclk = clk_get(&timer->pdev->dev, "fck");
> +		if (WARN_ON_ONCE(IS_ERR_OR_NULL(timer->fclk))) {
> +			timer->fclk = NULL;
> +			dev_err(&timer->pdev->dev, ": No fclk handle.\n");
> +			return -EINVAL;
> +		}

Apparently, today is not turning out to be my day :-(

Ok, so this patch needs to be applied on top of patch #10. The flag
OMAP_TIMER_NEEDS_RESET is added in that patch. So simply re-ordering
these will work. Let me know if I should re-post.

Cheers
Jon

  reply	other threads:[~2012-06-04 19:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-04 19:41 [PATCH V3 00/12] ARM: OMAP: DMTIMER clean-up and fixes in preparation for device-tree Jon Hunter
2012-06-04 19:41 ` [PATCH V3 01/12] ARM: OMAP: Remove unnecessary clk structure Jon Hunter
2012-06-04 19:41 ` [PATCH V3 02/12] ARM: OMAP2+: Remove unused max number of timers definition Jon Hunter
2012-06-04 19:41 ` [PATCH V3 03/12] ARM: OMAP2+: Add dmtimer platform function to reserve systimers Jon Hunter
2012-06-04 19:41 ` [PATCH V3 04/12] ARM: OMAP: Add DMTIMER capability variable to represent timer features Jon Hunter
2012-06-04 19:41 ` [PATCH V3 05/12] ARM: OMAP2+: HWMOD: Correct timer device attributes Jon Hunter
2012-06-04 19:41 ` [PATCH V3 06/12] ARM: OMAP1: Fix dmtimer support Jon Hunter
2012-06-04 19:47   ` Jon Hunter [this message]
2012-06-04 19:41 ` [PATCH V3 07/12] ARM: OMAP2+: Fix external clock support for dmtimers Jon Hunter
2012-06-04 19:41 ` [PATCH V3 08/12] ARM: OMAP: Remove loses_context variable from timer platform data Jon Hunter
2012-06-04 19:41 ` [PATCH V3 09/12] ARM: OMAP: Remove timer function pointer for context loss counter Jon Hunter
2012-06-04 19:41 ` [PATCH V3 10/12] ARM: OMAP: Add flag to indicate if a timer needs a manual reset Jon Hunter
2012-06-04 19:41 ` [PATCH V3 11/12] ARM: OMAP2+: Move dmtimer clock set function to dmtimer driver Jon Hunter
2012-06-04 19:41 ` [PATCH V3 12/12] ARM: OMAP2+: Simplify dmtimer clock aliases Jon Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FCD10E3.7050106@ti.com \
    --to=jon-hunter@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tarun.kanti@ti.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox