Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-05-07 Thread Sakari Ailus
Hi Hans, On Mon, Apr 23, 2018 at 02:43:36PM +0200, Hans Verkuil wrote: > On 04/12/2018 09:11 AM, Sakari Ailus wrote: > > On Wed, Apr 11, 2018 at 01:13:44PM -0300, Mauro Carvalho Chehab wrote: > >> Em Wed, 11 Apr 2018 18:35:14 +0300 > >> Sakari Ailus escreveu: > >> > >>> On Wed, Apr 11, 2018 at 12

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-23 Thread Hans Verkuil
On 04/17/2018 06:35 AM, Alexandre Courbot wrote: > On Mon, Apr 9, 2018 at 11:21 PM Hans Verkuil wrote: > >> From: Hans Verkuil > >> Implement the core of the media request processing. > >> Drivers can bind request objects to a request. These objects >> can then be marked completed if the drive

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-23 Thread Mauro Carvalho Chehab
Em Mon, 23 Apr 2018 14:23:28 +0200 Hans Verkuil escreveu: > >> + spin_lock_irqsave(&req->lock, flags); > >> + state = req->state; > >> + spin_unlock_irqrestore(&req->lock, flags); > > > > IMO, it would be better to use an atomic var for state, having a > > lockless access to it. > > In m

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-23 Thread Hans Verkuil
On 04/12/2018 09:11 AM, Sakari Ailus wrote: > On Wed, Apr 11, 2018 at 01:13:44PM -0300, Mauro Carvalho Chehab wrote: >> Em Wed, 11 Apr 2018 18:35:14 +0300 >> Sakari Ailus escreveu: >> >>> On Wed, Apr 11, 2018 at 12:17:27PM -0300, Mauro Carvalho Chehab wrote: Em Wed, 11 Apr 2018 18:02:19 +0300

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-23 Thread Hans Verkuil
On 04/10/2018 12:32 PM, Mauro Carvalho Chehab wrote: > Em Mon, 9 Apr 2018 16:20:01 +0200 > Hans Verkuil escreveu: > >> From: Hans Verkuil >> >> Implement the core of the media request processing. >> >> Drivers can bind request objects to a request. These objects >> can then be marked completed

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-23 Thread Hans Verkuil
On 04/23/2018 01:24 PM, Hans Verkuil wrote: >>> +/** >>> + * struct media_request - Media device request >>> + * @mdev: Media device this request belongs to >>> + * @kref: Reference count >>> + * @debug_prefix: Prefix for debug messages (process name:fd) >> >> debug_str? > > Hmm, I prefer debug_pr

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-23 Thread Hans Verkuil
On 04/10/2018 10:21 AM, Tomasz Figa wrote: > Hi Hans, > > On Mon, Apr 9, 2018 at 11:21 PM Hans Verkuil wrote: > [snip] >> +static void media_request_clean(struct media_request *req) >> +{ >> + struct media_request_object *obj, *obj_safe; >> + >> + WARN_ON(req->state != MEDIA_REQUEST_S

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-16 Thread Alexandre Courbot
On Mon, Apr 9, 2018 at 11:21 PM Hans Verkuil wrote: > From: Hans Verkuil > Implement the core of the media request processing. > Drivers can bind request objects to a request. These objects > can then be marked completed if the driver finished using them, > or just be unbound if the results do

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-12 Thread Sakari Ailus
On Wed, Apr 11, 2018 at 01:13:44PM -0300, Mauro Carvalho Chehab wrote: > Em Wed, 11 Apr 2018 18:35:14 +0300 > Sakari Ailus escreveu: > > > On Wed, Apr 11, 2018 at 12:17:27PM -0300, Mauro Carvalho Chehab wrote: > > > Em Wed, 11 Apr 2018 18:02:19 +0300 > > > Sakari Ailus escreveu: > > > > > > >

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-11 Thread Mauro Carvalho Chehab
Em Wed, 11 Apr 2018 18:35:14 +0300 Sakari Ailus escreveu: > On Wed, Apr 11, 2018 at 12:17:27PM -0300, Mauro Carvalho Chehab wrote: > > Em Wed, 11 Apr 2018 18:02:19 +0300 > > Sakari Ailus escreveu: > > > > > On Wed, Apr 11, 2018 at 10:49:35AM -0300, Mauro Carvalho Chehab wrote: > > > > Em We

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-11 Thread Sakari Ailus
On Wed, Apr 11, 2018 at 12:17:27PM -0300, Mauro Carvalho Chehab wrote: > Em Wed, 11 Apr 2018 18:02:19 +0300 > Sakari Ailus escreveu: > > > On Wed, Apr 11, 2018 at 10:49:35AM -0300, Mauro Carvalho Chehab wrote: > > > Em Wed, 11 Apr 2018 16:21:16 +0300 > > > Sakari Ailus escreveu: > > > > > >

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-11 Thread Mauro Carvalho Chehab
Em Wed, 11 Apr 2018 18:02:19 +0300 Sakari Ailus escreveu: > On Wed, Apr 11, 2018 at 10:49:35AM -0300, Mauro Carvalho Chehab wrote: > > Em Wed, 11 Apr 2018 16:21:16 +0300 > > Sakari Ailus escreveu: > > > > > > > > > > Btw, this is a very good reason why you should define the ioctl to > > > >

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-11 Thread Sakari Ailus
On Wed, Apr 11, 2018 at 10:49:35AM -0300, Mauro Carvalho Chehab wrote: > Em Wed, 11 Apr 2018 16:21:16 +0300 > Sakari Ailus escreveu: > > > > > > > Btw, this is a very good reason why you should define the ioctl to > > > > > have an integer argument instead of a struct with a __s32 field > > > >

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-11 Thread Mauro Carvalho Chehab
Em Wed, 11 Apr 2018 16:21:16 +0300 Sakari Ailus escreveu: > > > > Btw, this is a very good reason why you should define the ioctl to > > > > have an integer argument instead of a struct with a __s32 field > > > > on it, as per my comment to patch 02/29: > > > > > > > > #define MEDIA_IOC

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-11 Thread Sakari Ailus
Hi Mauro, On Tue, Apr 10, 2018 at 11:51:43AM -0300, Mauro Carvalho Chehab wrote: > Em Tue, 10 Apr 2018 15:32:34 +0300 > Sakari Ailus escreveu: > > > Hi Mauro and Hans, > > > > On Tue, Apr 10, 2018 at 07:32:06AM -0300, Mauro Carvalho Chehab wrote: > > ... > > > > +static void media_request_relea

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-10 Thread Mauro Carvalho Chehab
Em Tue, 10 Apr 2018 15:32:34 +0300 Sakari Ailus escreveu: > Hi Mauro and Hans, > > On Tue, Apr 10, 2018 at 07:32:06AM -0300, Mauro Carvalho Chehab wrote: > ... > > > +static void media_request_release(struct kref *kref) > > > +{ > > > + struct media_request *req = > > > + container_of(kr

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-10 Thread Sakari Ailus
Hi Tomasz and Hans, On Tue, Apr 10, 2018 at 08:21:27AM +, Tomasz Figa wrote: > > +void media_request_cancel(struct media_request *req) > > +{ > > + struct media_request_object *obj, *obj_safe; > > + > > + if (req->state != MEDIA_REQUEST_STATE_QUEUED) > > + return; >

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-10 Thread Sakari Ailus
Hi Mauro and Hans, On Tue, Apr 10, 2018 at 07:32:06AM -0300, Mauro Carvalho Chehab wrote: ... > > +static void media_request_release(struct kref *kref) > > +{ > > + struct media_request *req = > > + container_of(kref, struct media_request, kref); > > + struct media_device *mdev = req

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-10 Thread Sakari Ailus
Hi Hans, Thanks for the update. On Mon, Apr 09, 2018 at 04:20:01PM +0200, Hans Verkuil wrote: > From: Hans Verkuil > > Implement the core of the media request processing. > > Drivers can bind request objects to a request. These objects > can then be marked completed if the driver finished usin

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-10 Thread Mauro Carvalho Chehab
Em Mon, 9 Apr 2018 16:20:01 +0200 Hans Verkuil escreveu: > From: Hans Verkuil > > Implement the core of the media request processing. > > Drivers can bind request objects to a request. These objects > can then be marked completed if the driver finished using them, > or just be unbound if the

Re: [RFCv11 PATCH 04/29] media-request: core request support

2018-04-10 Thread Tomasz Figa
Hi Hans, On Mon, Apr 9, 2018 at 11:21 PM Hans Verkuil wrote: [snip] > +static void media_request_clean(struct media_request *req) > +{ > + struct media_request_object *obj, *obj_safe; > + > + WARN_ON(req->state != MEDIA_REQUEST_STATE_CLEANING); > + > + list_for_each_entry_safe(o