Tarun Kanti DebBarma <tarun.ka...@ti.com> writes:

> From: Thara Gopinath <th...@ti.com>
>
> Add dmtimer platform driver functions which include:
> (1) platform driver initialization
> (2) driver probe function
> (3) driver remove function
>
> Signed-off-by: Tarun Kanti DebBarma <tarun.ka...@ti.com>
> Signed-off-by: Thara Gopinath <th...@ti.com>
> Acked-by: Cousson, Benoit <b-cous...@ti.com>

Some locking issues below...

> ---
>  arch/arm/plat-omap/dmtimer.c              |  167 
> ++++++++++++++++++++++++++++-
>  arch/arm/plat-omap/include/plat/dmtimer.h |    2 +
>  2 files changed, 168 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
> index 1bfaf09..bfe6fd3 100644
> --- a/arch/arm/plat-omap/dmtimer.c
> +++ b/arch/arm/plat-omap/dmtimer.c
> @@ -43,6 +43,9 @@
>  #include <linux/delay.h>
>  #include <linux/io.h>
>  #include <linux/module.h>
> +#include <linux/slab.h>
> +#include <linux/err.h>
> +#include <linux/platform_device.h>
>  #include <mach/hardware.h>
>  #include <plat/dmtimer.h>
>  #include <mach/irqs.h>
> @@ -257,7 +260,8 @@ static struct omap_dm_timer *dm_timers;
>  static const char **dm_source_names;
>  static struct clk **dm_source_clocks;
>  
> -static spinlock_t dm_timer_lock;
> +static LIST_HEAD(omap_timer_list);
> +static DEFINE_SPINLOCK(dm_timer_lock);

This spinlock is being used as a mutex.  Please use a mutex instead.

>  /*
>   * Reads timer registers in posted and non-posted mode. The posted mode bit
> @@ -689,6 +693,167 @@ int omap_dm_timers_active(void)
>  }
>  EXPORT_SYMBOL_GPL(omap_dm_timers_active);
>  
> +/**
> + * omap_dm_timer_probe - probe function called for every registered device
> + * @pdev:    pointer to current timer platform device
> + *
> + * Called by driver framework at the end of device registration for all
> + * timer devices.
> + */
> +static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
> +{
> +     int ret;
> +     unsigned long flags;
> +     struct omap_dm_timer *timer;
> +     struct resource *mem, *irq, *ioarea;
> +     struct dmtimer_platform_data *pdata = pdev->dev.platform_data;
> +
> +     if (!pdata) {
> +             dev_err(&pdev->dev, "%s: no platform data\n", __func__);
> +             return -ENODEV;
> +     }
> +
> +     spin_lock_irqsave(&dm_timer_lock, flags);

Why do you need IRQ versions of the locks?   This lock is never used in
interrupt context.

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to