LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Industrial device driver uio/uio_*
@ 2006-09-11 17:22 Alan Cox
  2006-09-11 19:23 ` Jan Engelhardt
  2006-10-04 18:59 ` Alan Cox
  0 siblings, 2 replies; 11+ messages in thread
From: Alan Cox @ 2006-09-11 17:22 UTC (permalink / raw)
  To: akpm, linux-kernel

This passed me by while I was away so I only saw it to review in mm6. It
looks like it has a few problems...


uio_lseek locking ?

uio_read uses f->f_pos which it should never do
ditto uio_write ...

The uio_read/write functions can race seek or other read/write

The uio_read/write functions do signed maths checks on unsigned types
(size_t) so the count check fails.

Partially completed I/O returns -EFAULT, should return the length
transferred OK

The *ppos adjustment means you can get f_pos to interestingly unsafe
values. Generally speaking do

	loff_t pos = *ppos;

	do stuff with pos

	pos += movement;
	*ppos = pos;


If idev->virtaddr is an mmio object you can't use copy_from/to_user on
it

uio_event is based on sizeof(int) so makes 32bit compat code insanely
hard

event_poll is wrong - poll methods shouldn't error just return "ready"

idev->event_listener appears to have no locking versus the irq handler
and the like.

Anyone appears to be able to select any process as the task to signal or
out of range or negative values

I've not begun to look at uio_base.c in detail but it seems a lot of
code to do very little. That said I can see the problem it is trying to
solve, I'm just not sure it helps as is.

Alan


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

* Re: Industrial device driver uio/uio_*
  2006-09-11 17:22 Industrial device driver uio/uio_* Alan Cox
@ 2006-09-11 19:23 ` Jan Engelhardt
  2006-09-12  1:43   ` Greg KH
  2006-10-04 18:59 ` Alan Cox
  1 sibling, 1 reply; 11+ messages in thread
From: Jan Engelhardt @ 2006-09-11 19:23 UTC (permalink / raw)
  To: Alan Cox; +Cc: akpm, gregkh, Linux Kernel Mailing List


>Subject: Industrial device driver uio/uio_*

Hm has this now been named uio? iio may have seem strange to some, but 
uio also resembles BSD/Solaris (uio_copyin, uio_copyout, uiomove, etc.)


Jan Engelhardt
-- 

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

* Re: Industrial device driver uio/uio_*
  2006-09-11 19:23 ` Jan Engelhardt
@ 2006-09-12  1:43   ` Greg KH
  2006-09-17  9:41     ` Jan Engelhardt
  0 siblings, 1 reply; 11+ messages in thread
From: Greg KH @ 2006-09-12  1:43 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Alan Cox, akpm, Linux Kernel Mailing List

On Mon, Sep 11, 2006 at 09:23:23PM +0200, Jan Engelhardt wrote:
> 
> >Subject: Industrial device driver uio/uio_*
> 
> Hm has this now been named uio? iio may have seem strange to some, but 
> uio also resembles BSD/Solaris (uio_copyin, uio_copyout, uiomove, etc.)

Yes, I am aware of uio, we have include/linux/uio.h :)

Do you have a better name for this code?  If you don't like uio, I'm
open to new suggestions.

thanks,

greg k-h

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

* Re: Industrial device driver uio/uio_*
  2006-09-12  1:43   ` Greg KH
@ 2006-09-17  9:41     ` Jan Engelhardt
  0 siblings, 0 replies; 11+ messages in thread
From: Jan Engelhardt @ 2006-09-17  9:41 UTC (permalink / raw)
  To: Greg KH; +Cc: Alan Cox, akpm, Linux Kernel Mailing List


>> Hm has this now been named uio? iio may have seem strange to some, but 
>> uio also resembles BSD/Solaris (uio_copyin, uio_copyout, uiomove, etc.)
>
>Yes, I am aware of uio, we have include/linux/uio.h :)
>
>Do you have a better name for this code?  If you don't like uio, I'm
>open to new suggestions.

- I was fine with iio
- udio, for userspace-driven IO (my favorite should iio not make it)
- idd, since it's called "Industrial device driver"
  (don't go about calling it iddqd)

more artistic ones:
- iofu, for IO From Userspace, or, on 2nd thought, simply IO-fu (as in Kung-fu)
- something else that's not related at all? /methinks of squid,
  which, from the name, does not suggest it would be a web proxy.


Jan Engelhardt
-- 

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

* Re: Industrial device driver uio/uio_*
  2006-09-11 17:22 Industrial device driver uio/uio_* Alan Cox
  2006-09-11 19:23 ` Jan Engelhardt
@ 2006-10-04 18:59 ` Alan Cox
  2006-10-04 19:18   ` Andrew Morton
  1 sibling, 1 reply; 11+ messages in thread
From: Alan Cox @ 2006-10-04 18:59 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

Ar Llu, 2006-09-11 am 18:22 +0100, ysgrifennodd Alan Cox:
> This passed me by while I was away so I only saw it to review in mm6. It
> looks like it has a few problems...
> 

And nothing has happened since [Thats Sept 11th] even on the simple bugs
although the authors were sent a copy. At this point can the linutronix
guys either let me know if they just never got the list of flaws or can
we pull the drivers/uio stuff from -mm until its rather better ?

I would just NAK it but want to be sure the guys saw the list of
problems

Alan


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

* Re: Industrial device driver uio/uio_*
  2006-10-04 18:59 ` Alan Cox
@ 2006-10-04 19:18   ` Andrew Morton
  2006-10-04 19:32     ` Thomas Gleixner
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Morton @ 2006-10-04 19:18 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel, Thomas Gleixner, Greg KH

On Wed, 04 Oct 2006 19:59:54 +0100
Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

> Ar Llu, 2006-09-11 am 18:22 +0100, ysgrifennodd Alan Cox:
> > This passed me by while I was away so I only saw it to review in mm6. It
> > looks like it has a few problems...
> > 
> 
> And nothing has happened since [Thats Sept 11th] even on the simple bugs
> although the authors were sent a copy. At this point can the linutronix
> guys either let me know if they just never got the list of flaws or can
> we pull the drivers/uio stuff from -mm until its rather better ?
> 
> I would just NAK it but want to be sure the guys saw the list of
> problems
> 

cc's added.

Thomas has been a bit tied up with timers and interrupts of late.

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

* Re: Industrial device driver uio/uio_*
  2006-10-04 19:18   ` Andrew Morton
@ 2006-10-04 19:32     ` Thomas Gleixner
  2006-10-04 21:37       ` Alan Cox
  2006-10-05  8:12       ` Paul Mundt
  0 siblings, 2 replies; 11+ messages in thread
From: Thomas Gleixner @ 2006-10-04 19:32 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Alan Cox, linux-kernel, Greg KH

On Wed, 2006-10-04 at 12:18 -0700, Andrew Morton wrote:
> On Wed, 04 Oct 2006 19:59:54 +0100
> > I would just NAK it but want to be sure the guys saw the list of
> > problems
> > 
> 
> cc's added.
> 
> Thomas has been a bit tied up with timers and interrupts of late.

Yup. fork(tglx) still returns -ETOOMANYINSTANCES.

I have no objections, if you pull it from -mm for now. The list of flaws
is accepted and we'll work on this in foreseeable time, _IF_ there is
some basic consensus about the idea itself not being fundamentaly wrong.

	tglx



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

* Re: Industrial device driver uio/uio_*
  2006-10-04 19:32     ` Thomas Gleixner
@ 2006-10-04 21:37       ` Alan Cox
  2006-10-05  8:12       ` Paul Mundt
  1 sibling, 0 replies; 11+ messages in thread
From: Alan Cox @ 2006-10-04 21:37 UTC (permalink / raw)
  To: tglx; +Cc: Andrew Morton, linux-kernel, Greg KH

Ar Mer, 2006-10-04 am 21:32 +0200, ysgrifennodd Thomas Gleixner:
> I have no objections, if you pull it from -mm for now. The list of flaws
> is accepted and we'll work on this in foreseeable time, _IF_ there is
> some basic consensus about the idea itself not being fundamentaly wrong.

The device stuff seems ok, the class stuff seems to me overconvoluted
but I'd rather someone who knew the class stuff well (Greg thats you)
made that decision.

Alan


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

* Re: Industrial device driver uio/uio_*
  2006-10-04 19:32     ` Thomas Gleixner
  2006-10-04 21:37       ` Alan Cox
@ 2006-10-05  8:12       ` Paul Mundt
  2006-10-05 12:12         ` Alan Cox
  2006-10-06  0:37         ` Greg KH
  1 sibling, 2 replies; 11+ messages in thread
From: Paul Mundt @ 2006-10-05  8:12 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Andrew Morton, Alan Cox, linux-kernel, Greg KH

On Wed, Oct 04, 2006 at 09:32:25PM +0200, Thomas Gleixner wrote:
> On Wed, 2006-10-04 at 12:18 -0700, Andrew Morton wrote:
> > On Wed, 04 Oct 2006 19:59:54 +0100
> > > I would just NAK it but want to be sure the guys saw the list of
> > > problems
> > > 
> > 
> > cc's added.
> > 
> > Thomas has been a bit tied up with timers and interrupts of late.
> 
> Yup. fork(tglx) still returns -ETOOMANYINSTANCES.
> 
> I have no objections, if you pull it from -mm for now. The list of flaws
> is accepted and we'll work on this in foreseeable time, _IF_ there is
> some basic consensus about the idea itself not being fundamentaly wrong.
> 
I've got a few cycles I can throw at this, it's a problem space we
(Renesas) are interested in too..

Alan, is your Sept. 11 list the extent of your issues with the current
code, or was there more that you sent off-list?

I'll toss up a quick git tree for this so we don't lose anything, and
the fixes can trickle in to -mm that way, or it can just be pulled and
added back later.

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

* Re: Industrial device driver uio/uio_*
  2006-10-05  8:12       ` Paul Mundt
@ 2006-10-05 12:12         ` Alan Cox
  2006-10-06  0:37         ` Greg KH
  1 sibling, 0 replies; 11+ messages in thread
From: Alan Cox @ 2006-10-05 12:12 UTC (permalink / raw)
  To: Paul Mundt; +Cc: Thomas Gleixner, Andrew Morton, linux-kernel, Greg KH

Ar Iau, 2006-10-05 am 17:12 +0900, ysgrifennodd Paul Mundt:
> Alan, is your Sept. 11 list the extent of your issues with the current
> code, or was there more that you sent off-list?

Its the current state from the initial pass

Alan


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

* Re: Industrial device driver uio/uio_*
  2006-10-05  8:12       ` Paul Mundt
  2006-10-05 12:12         ` Alan Cox
@ 2006-10-06  0:37         ` Greg KH
  1 sibling, 0 replies; 11+ messages in thread
From: Greg KH @ 2006-10-06  0:37 UTC (permalink / raw)
  To: Paul Mundt; +Cc: Thomas Gleixner, Andrew Morton, Alan Cox, linux-kernel

On Thu, Oct 05, 2006 at 05:12:47PM +0900, Paul Mundt wrote:
> On Wed, Oct 04, 2006 at 09:32:25PM +0200, Thomas Gleixner wrote:
> > On Wed, 2006-10-04 at 12:18 -0700, Andrew Morton wrote:
> > > On Wed, 04 Oct 2006 19:59:54 +0100
> > > > I would just NAK it but want to be sure the guys saw the list of
> > > > problems
> > > > 
> > > 
> > > cc's added.
> > > 
> > > Thomas has been a bit tied up with timers and interrupts of late.
> > 
> > Yup. fork(tglx) still returns -ETOOMANYINSTANCES.
> > 
> > I have no objections, if you pull it from -mm for now. The list of flaws
> > is accepted and we'll work on this in foreseeable time, _IF_ there is
> > some basic consensus about the idea itself not being fundamentaly wrong.
> > 
> I've got a few cycles I can throw at this, it's a problem space we
> (Renesas) are interested in too..
> 
> Alan, is your Sept. 11 list the extent of your issues with the current
> code, or was there more that you sent off-list?
> 
> I'll toss up a quick git tree for this so we don't lose anything, and
> the fixes can trickle in to -mm that way, or it can just be pulled and
> added back later.

Please just send me patches and I'll update the main version that I
have, which will get pulled into -mm.

And yes, I need to look at this some more too.  I was considering just
stripping it down to the bare essencials right now, the interrupt
handling stuff, and then slowly adding pieces back when people asked for
them.

Unless people need all of the different options right now?

thanks,


greg k-h

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

end of thread, other threads:[~2006-10-06  0:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-11 17:22 Industrial device driver uio/uio_* Alan Cox
2006-09-11 19:23 ` Jan Engelhardt
2006-09-12  1:43   ` Greg KH
2006-09-17  9:41     ` Jan Engelhardt
2006-10-04 18:59 ` Alan Cox
2006-10-04 19:18   ` Andrew Morton
2006-10-04 19:32     ` Thomas Gleixner
2006-10-04 21:37       ` Alan Cox
2006-10-05  8:12       ` Paul Mundt
2006-10-05 12:12         ` Alan Cox
2006-10-06  0:37         ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).