lkml.org 
[lkml]   [2012]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] uio: add warning to documentation
On Wed, Dec 12, 2012 at 01:45:34AM +0100, Benedikt Spranger wrote:
> On Tue, 11 Dec 2012 15:18:16 -0800
> Greg KH <gregkh@linuxfoundation.org> wrote:
>
> > > -<function>open()</function>, you will probably also want a custom
> > > +<function>release()</function>, you will probably also want a
> > > custom <function>release()</function> function.
> > That sentance no longer makes sense.
> DUH! will fix...
>
> > > +</para><para>CAVE: The release hook may be processed, even if a
> > > mmap is aktive.
> > Huh?
> OK, think about a user of uio_pdrv_genirq and you did your
> powermanagement well. The user open the UIO device, do a mmap() and
> close the UIO device. Then he access the given pointer and wonders why
> the system is stuck. It is a bad idea to disable clocks on release
> while a mmap is active.

A UIO user is root and can do lots of bad things if they are foolish,
are we supposed to enumerate all of them? :)

> > > +Disabling clocks or other powermanagement functionality may cause
> > > a system +crash, hangup or other unwanted sideeffects.
> > > +</para><para><emphasis>The mmap() function shall add an extra
> > > reference to the file associated with the file descriptor fildes
> > > which is not removed by a subsequent close() on that file
> > > descriptor. This reference shall be removed when there are no more
> > > mappings to the file.</emphasis></para><para> +<link
> > > xlink:href="http://pubs.opengroup.org/onlinepubs/009695399/functions/mmap.html">IEEE
> > > Std 1003.1, 2004 Edition, mmap()</link>
> >
> > It's not up to us to document the mmap system call here, you should
> > know how to use it if you write a program with it, right?
> Its not the user of mmap(), it is for the driver programmer. It is a
> bad idea to do every kind of powermanagement function in the release
> hook.

I agree, but how can a driver programmer use that information properly
here?

greg k-h


\
 
 \ /
  Last update: 2012-12-12 07:01    [W:0.239 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site