Re: [PATCH] zr36067: Debugging cleanups (updated again)

"Ronald Bultje" <[email protected]>
Newsgroups gmane.comp.video.mjpeg.devel
Message-ID <[email protected]>
Hi Trent,

On 5/28/07, Trent Piepho <[email protected]> wrote:
>
> Since the sysfs entries are owned by root, making them user write only is
> pretty much the same as capable(CAP_SYS_ADMIN).  You can also set the
> vidmem
> parameter to anything you want when you load the module.


That's good then, I didn't know that. I thought it depended on the device
perms. In this case, it's probably OK.

> - pass_through: sort of 0644, although it's only after a device-close, not
> > instant-apply. If we make this 0644, on the long-run it should be
> instant
> > apply using a callback from sysfs.
>
> Is there way to make setting a sysfs parameter trigger a callback?  I
> can't
> find any drivers that do this.


I don't know, I'm not very familiar. You'd probably have to ask its authors.


> > {jpg,v4l}_{bufsize,nbufs}: I think v4l_bufsize/nbufs are per device
> > open-close, so same "objection" as above, although I'm ok with it with
> some
> > documentation that it is not instant-apply. jpg-*, as said, introduces
> > races. If possible, this would have to be sysadmin protected,
> w-protection
> > alone is not enough since most people _need_ w access to the device to
> be
> > able to write data to it (e.g. using lavplay).
>
> sysfs entries are owned by root, not the owner of the device.  The race
> introduction is a red herring.


Wait, I never complained about the race conditions in general. The only way
to prevent that is proper locking (or memory barrier), which require (as
said above) the trigger callback. What I'm complaining about here is related
to the device vs. sysfs permission thing (as said above). Since that's not
an issue, I don't mind so much, so go for it.

> debug: should obviously be in sysfs and is already instant-apply.
>
> Of course since there is no spinlock and it's not an atomic_t, there is
> still
> a race condition every single time it is used.


I don't think anyone cares if there is a race condition in debug message
output. :-).

Ronald

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

_______________________________________________
Mjpeg-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mjpeg-developer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.