All of lore.kernel.org
 help / color / mirror / Atom feed
* Splitting trigger header in two and barriers.
@ 2011-07-11 15:51 Jonathan Cameron
  2011-07-11 16:08 ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2011-07-11 15:51 UTC (permalink / raw)
  To: linux-iio, Hennerich, Michael

Hi All,

The trigger.h file merges elements I'd really rather were separate.
There are some parts that belong to drivers acting as consumers
and others to those acting as producers of triggers.
In a few cases  (e.g. lis3l02dq_ring.c) the consumer and trigger
are in the same file, but in many others the driver only supports
one or the other or has them in separate source files.

The main block to this bit of reorganization ist that some drivers
explicitly put the trigger and detach from it in their 'ring cleanup'
functions (see ad7298_ring.c ad7298_ring_cleanup.)

My original intent was that if a trigger had not been detached from
in userspace, it would not be possible to remmove the driver, so
no cleanup would occur. (basically it counts as being 'in use').

Is there a usecase that demands this explicity disconnect, or
is it simply a case that the reference counting is going wrong
somewhere and hence this was needed in the drivers?

Failing a good description of why this is there in these drivers,
I'd like to clean it out.  Will give us a much easier to follow
interface for the triggers.

Thanks,

Jonathan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Splitting trigger header in two and barriers.
  2011-07-11 15:51 Splitting trigger header in two and barriers Jonathan Cameron
@ 2011-07-11 16:08 ` Jonathan Cameron
  2011-07-11 16:41   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2011-07-11 16:08 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Hennerich, Michael

On 07/11/11 16:51, Jonathan Cameron wrote:
> Hi All,
> 
> The trigger.h file merges elements I'd really rather were separate.
> There are some parts that belong to drivers acting as consumers
> and others to those acting as producers of triggers.
> In a few cases  (e.g. lis3l02dq_ring.c) the consumer and trigger
> are in the same file, but in many others the driver only supports
> one or the other or has them in separate source files.
> 
> The main block to this bit of reorganization ist that some drivers
> explicitly put the trigger and detach from it in their 'ring cleanup'
> functions (see ad7298_ring.c ad7298_ring_cleanup.)
> 
> My original intent was that if a trigger had not been detached from
> in userspace, it would not be possible to remmove the driver, so
> no cleanup would occur. (basically it counts as being 'in use').
> 
> Is there a usecase that demands this explicity disconnect, or
> is it simply a case that the reference counting is going wrong
> somewhere and hence this was needed in the drivers?
> 
> Failing a good description of why this is there in these drivers,
> I'd like to clean it out.  Will give us a much easier to follow
> interface for the triggers.
oops, just noticed I did this first in max1363. Will hammer that hard
and see whether everything works as I think it should!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Splitting trigger header in two and barriers.
  2011-07-11 16:08 ` Jonathan Cameron
@ 2011-07-11 16:41   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2011-07-11 16:41 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Hennerich, Michael

On 07/11/11 17:08, Jonathan Cameron wrote:
> On 07/11/11 16:51, Jonathan Cameron wrote:
>> Hi All,
>>
>> The trigger.h file merges elements I'd really rather were separate.
>> There are some parts that belong to drivers acting as consumers
>> and others to those acting as producers of triggers.
>> In a few cases  (e.g. lis3l02dq_ring.c) the consumer and trigger
>> are in the same file, but in many others the driver only supports
>> one or the other or has them in separate source files.
>>
>> The main block to this bit of reorganization ist that some drivers
>> explicitly put the trigger and detach from it in their 'ring cleanup'
>> functions (see ad7298_ring.c ad7298_ring_cleanup.)
>>
>> My original intent was that if a trigger had not been detached from
>> in userspace, it would not be possible to remmove the driver, so
>> no cleanup would occur. (basically it counts as being 'in use').
>>
>> Is there a usecase that demands this explicity disconnect, or
>> is it simply a case that the reference counting is going wrong
>> somewhere and hence this was needed in the drivers?
>>
>> Failing a good description of why this is there in these drivers,
>> I'd like to clean it out.  Will give us a much easier to follow
>> interface for the triggers.
> oops, just noticed I did this first in max1363. Will hammer that hard
> and see whether everything works as I think it should!
Ah, definitely doesn't work as I thought it did. Will fix and repost
when I have a simple solution to that.  Guess when one sees unexpected
code, one should expect it to have a reason for being there!

Sorry for the noise, though the basic question still stands, even if
a little more work is needed to fix the core first.

Jonathan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-11 16:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-11 15:51 Splitting trigger header in two and barriers Jonathan Cameron
2011-07-11 16:08 ` Jonathan Cameron
2011-07-11 16:41   ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.