All of lore.kernel.org
 help / color / mirror / Atom feed
* Various ctrl and event frame work patches
@ 2011-10-27 11:17 Hans de Goede
  2011-10-27 11:17 ` [PATCH 1/6] v4l2-ctrl: Send change events to all fh for auto cluster slave controls Hans de Goede
                   ` (5 more replies)
  0 siblings, 6 replies; 23+ messages in thread
From: Hans de Goede @ 2011-10-27 11:17 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: hverkuil, Laurent Pinchart

Hi All,

This patch set obsoletes my previous "add v4l2_subscribed_event_ops" set,
while working on adding support for ctrl-events to the uvc driver I found
a few bugs in the event code, which this patchset fixes.

Regards,

Hans




^ permalink raw reply	[flat|nested] 23+ messages in thread
* Various ctrl and event frame work patches (version 2)
@ 2011-10-31 15:16 Hans de Goede
  2011-10-31 15:16 ` [PATCH 5/6] v4l2-event: Add v4l2_subscribed_event_ops Hans de Goede
  0 siblings, 1 reply; 23+ messages in thread
From: Hans de Goede @ 2011-10-31 15:16 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: hverkuil, Laurent Pinchart

Hi All,

This patch set obsoletes my previous "add v4l2_subscribed_event_ops" set,
while working on adding support for ctrl-events to the uvc driver I found
a few bugs in the event code, which this patchset fixes.

Changes since version 1:
-Added a documentation update (update v4l2-framework.txt) to:
 "v4l2-event: Add v4l2_subscribed_event_ops"

Regards,

Hans



^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: [PATCH 5/6] v4l2-event: Add v4l2_subscribed_event_ops
@ 2011-11-02 10:04 Hans de Goede
  0 siblings, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2011-11-02 10:04 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Linux Media Mailing List

Hi,

hverkuil wrote:
> > > +	if (sev->ops && sev->ops->add) {
> > > +		int ret = sev->ops->add(sev);
> > > +		if (ret) {
> > > +			sev->ops = NULL;
> > > +			v4l2_event_unsubscribe(fh, sub);
> > > +			return ret;
> > > +		}
>
> The problem here is that the event is basically available for use after the
> spin_unlock_irqrestore(), but before the sev->ops->add() call. In the past I
> just 'knew' that the event would never be generated by the control framework
> until after v4l2_ctrl_add_event was called, but this should be formalized now
> that these ops are added.
>
> I see two options:
>
> 1) Have some method to mark the sev as being 'invalid' so functions sending
> events can skip it (needed as well for your patch 4/6).
>
> 2) Document that drivers should never be able to send an event until after
> the add() callback has succeeded.
>
> I am leaning towards option 1 myself.
>
> How about leaving sev->elems at 0 until after the add() op succeeds?
>
> That's easy to test against and easy to implement.

I agree that option 1 is the best and that leaving sev->elems 0 is a good
way to do this. This will be in my next revision of this patch set.

Thanks & Regards,

Hans


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

end of thread, other threads:[~2011-11-02 10:03 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-27 11:17 Various ctrl and event frame work patches Hans de Goede
2011-10-27 11:17 ` [PATCH 1/6] v4l2-ctrl: Send change events to all fh for auto cluster slave controls Hans de Goede
2011-10-30 10:16   ` Hans Verkuil
2011-10-27 11:17 ` [PATCH 2/6] v4l2-event: Deny subscribing with a type of V4L2_EVENT_ALL Hans de Goede
2011-10-27 12:04   ` Laurent Pinchart
2011-10-30 10:17   ` Hans Verkuil
2011-10-27 11:18 ` [PATCH 3/6] v4l2-event: Remove pending events from fh event queue when unsubscribing Hans de Goede
2011-10-27 12:07   ` Laurent Pinchart
2011-10-30 10:24   ` Hans Verkuil
2011-10-27 11:18 ` [PATCH 4/6] v4l2-event: Don't set sev->fh to NULL on unsubcribe Hans de Goede
2011-10-27 12:20   ` Laurent Pinchart
2011-10-28  8:35     ` Hans de Goede
2011-10-28 11:48       ` Laurent Pinchart
2011-10-30 10:30   ` Hans Verkuil
2011-10-27 11:18 ` [PATCH 5/6] v4l2-event: Add v4l2_subscribed_event_ops Hans de Goede
2011-10-27 12:30   ` Laurent Pinchart
2011-10-28  8:37     ` Hans de Goede
2011-10-30 11:17   ` Hans Verkuil
2011-10-30 11:37     ` Hans Verkuil
2011-10-27 11:18 ` [PATCH 6/6] v4l2-ctrls: Use v4l2_subscribed_event_ops Hans de Goede
2011-10-30 11:24   ` Hans Verkuil
  -- strict thread matches above, loose matches on Subject: below --
2011-10-31 15:16 Various ctrl and event frame work patches (version 2) Hans de Goede
2011-10-31 15:16 ` [PATCH 5/6] v4l2-event: Add v4l2_subscribed_event_ops Hans de Goede
2011-11-02 10:04 Hans de Goede

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.