Re: [PATCH 5/8] OMAP: omap_device: add usecounting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paul Walmsley <paul@xxxxxxxxx> writes:

> Hello Kevin,
>
> On Tue, 17 Nov 2009, Kevin Hilman wrote:
>
>> Add use counters to omap_device to enable multiple potential users of
>> an omap_device.  This is needed if ever there are multiple users or
>> multiple instances of a driver with a single omap_device.
>> 
>> Without usecounting, with multiple users, the first one to call idle
>> may forcibly idle the device while other users are still active.
>
> Could you please send along an example of the use case for this?  

The current use case is the serial driver (not yet ready for posting.)

While there is only a single driver bound to the omap_device, there
are effectivily multiple instances of the driver.  One for initial
init/probe requriring and early _enable, followed by _idle in the
late_init hook.  Another when the actual serial driver gets started
and the inactivity timers etc. start firing.  These usages overlap
slightly and the easiest way I saw to handle this was with
usecounting.

> I would prefer not to add usecounting at this layer unless it is
> absolutely necessary, since only one driver should be bound to a
> device at a time.

What about mulitple instances of the same driver?

Or, what about drivers like i2c which might do _enable/_idle on a
per-transfer basis and there might be multiple transfers pending at
any given time.

We already have use-counting in the clock framework for this same
purpose.  I'm essentially proposing the usecounting for the same reason,
but it also need to protect enable/idle parts of hwmod as well.

Maybe usecounting at the hwmod level is more appropriate since that's
where the problem lies.  I'm fine with that.

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

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux