Re: SYSFS: need a noncaching read

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Heiko Schocher <hs@...>
Cc: <linux-kernel@...>, <linuxppc-dev@...>, Detlev Zundel <dzu@...>
Date: Wednesday, September 12, 2007 - 1:32 am

On Tue, Sep 11, 2007 at 11:43:17AM +0200, Heiko Schocher wrote:

Uuuh, uggly. Don't do that. Device drivers are there to abstract things,
not to play around with registers from userspace.


Yes, it does. What you can do is close()ing the file handle between
accesses, which makes it work but is slow.


What kind of problem do you want to solve? Userspace is for
applications, and applications usually don't have to know about hardware
details like registers. So if you have to do something every 10 ms from
userspace, your design is probably wrong.

If you absolutely need to do such things from userspace, have a look at
uio. But in most cases the answer is: make a proper abstraction for the
problem you wanna solve and write a proper driver.

Robert
-- 
Pengutronix - Linux Solutions for Science and Industry
Entwicklungszentrum Nord     http://www.pengutronix.de
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
SYSFS: need a noncaching read, Heiko Schocher, (Tue Sep 11, 5:43 am)
Re: SYSFS: need a noncaching read, Robert Schwebel, (Wed Sep 12, 1:32 am)
Re: SYSFS: need a noncaching read, Greg KH, (Wed Sep 12, 6:01 am)
Re: SYSFS: need a noncaching read, Tejun Heo, (Mon Sep 17, 1:22 am)
Re: SYSFS: need a noncaching read, Nick Piggin, (Tue Sep 11, 3:19 pm)
Re: SYSFS: need a noncaching read, Heiko Schocher, (Wed Sep 12, 7:13 am)
Re: SYSFS: need a noncaching read, Greg KH, (Wed Sep 12, 7:39 am)
Re: SYSFS: need a noncaching read, Heiko Schocher, (Wed Sep 12, 7:59 am)
Re: SYSFS: need a noncaching read, David Gibson, (Tue Sep 11, 10:05 pm)
Re: SYSFS: need a noncaching read, Michael Ellerman, (Tue Sep 11, 11:18 pm)