From: Tony Lindgren <tony@atomide.com>
To: "Que, Simon" <sque@ti.com>
Cc: Linux Omap <linux-omap@vger.kernel.org>,
"Cousson, Benoit" <b-cousson@ti.com>,
"Shilimkar, Santosh" <santosh.shilimkar@ti.com>,
"Premi, Sanjeev" <premi@ti.com>,
"Kanigeri, Hari" <h-kanigeri2@ti.com>
Subject: Re: [PATCH 3/4 v2] omap: hwspinlock: Created driver for OMAP hardware spinlock.
Date: Mon, 20 Sep 2010 12:13:52 -0700 [thread overview]
Message-ID: <20100920191351.GH4611@atomide.com> (raw)
In-Reply-To: <F39349C6FA641B4A831B7BF4EBF4D4E1480D9E48@dlee03.ent.ti.com>
* Que, Simon <sque@ti.com> [100811 17:22]:
> Created driver for OMAP hardware spinlock.
>
> - Reserved spinlocks for internal use
> - Dynamic allocation of unreserved locks
> - Lock, unlock, and trylock functions, with or without disabling irqs/preempt
> - Registered as a platform device driver
> --- /dev/null
> +++ b/arch/arm/mach-omap2/hwspinlocks.c
> @@ -0,0 +1,65 @@
> +int __init hwspinlocks_init(void)
> +{
> + int retval = 0;
> +
> + struct omap_hwmod *oh;
> + const char *oh_name, *pdev_name;
> +
> + oh_name = "spinlock";
> + oh = omap_hwmod_lookup(oh_name);
> + if (WARN_ON(oh == NULL))
> + return -EINVAL;
> +
> + pdev_name = "hwspinlock";
> +
> + /* Pass data to device initialization */
> + omap_device_build(pdev_name, 0, oh, NULL, 0, omap_spinlock_latency,
> + ARRAY_SIZE(omap_spinlock_latency), false);
> +
> + return retval;
> +}
> +postcore_initcall(hwspinlocks_init);
Is this initcall safe to run on all omaps or do you need some
extra checks for it?
> --- /dev/null
> +++ b/arch/arm/plat-omap/hwspinlock.c
> @@ -0,0 +1,353 @@
> +EXPORT_SYMBOL(hwspinlock_lock);
> +EXPORT_SYMBOL(hwspinlock_trylock);
> +EXPORT_SYMBOL(hwspinlock_unlock);
> +EXPORT_SYMBOL(hwspinlock_request);
> +EXPORT_SYMBOL(hwspinlock_request_specific);
> +EXPORT_SYMBOL(hwspinlock_free);
Do we really want to export these functions? I think we're better
off implementing low-level functions in the platform init code that
are passed to the drivers in the platform_data.
This way the drivers stay generic, and we don't add yet another
non-standard layer that will get misused all over the drivers.
If you really want to export these functions to the drivers,
then all this code should live somewherew under drivers as well.
> +static int __init hwspinlock_init(void)
> +{
> + int retval = 0;
> +
> + /* Register spinlock driver */
> + retval = platform_driver_register(&hwspinlock_driver);
> +
> + return retval;
> +}
> +postcore_initcall(hwspinlock_init);
Is this initcall safe to run on all omaps?
Tony
next prev parent reply other threads:[~2010-09-20 19:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-12 0:29 [PATCH 3/4 v2] omap: hwspinlock: Created driver for OMAP hardware spinlock Que, Simon
2010-08-12 10:01 ` Premi, Sanjeev
2010-08-13 15:21 ` Que, Simon
2010-09-20 19:13 ` Tony Lindgren [this message]
2010-09-22 15:21 ` Kanigeri, Hari
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=20100920191351.GH4611@atomide.com \
--to=tony@atomide.com \
--cc=b-cousson@ti.com \
--cc=h-kanigeri2@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=premi@ti.com \
--cc=santosh.shilimkar@ti.com \
--cc=sque@ti.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