Re: [patch] IBM HDAPS accelerometer driver.

Pavel Machek
2005-08-29T09:10:52Z

Hi!

> > > >>I think he doesn't need to export it at all and he should write code to
> > > >>park and disable hard disk instead.
> > > >>(in userspace it's unsolvable --- i.e. you can't enable hard disk when
> > > >>detected stable condition if the daemon is swapped out on that hard disk)
> > > >
> > > >man mlockall() :-).
> > >
> > > You also must not use any syscall that allocates even temporary memory in
> > > kernel (select, poll, many others ...) or that waits on semaphore that
> > > might be held while allocating memory (i.e. audit and rewrite ide ioctl
> > > path).
> >
> > Kernel module would have exactly same problem.
>
> It has control of its memory allocations.

It will have to be carefull with doing calls that allocate memory, and
to avoid semaphores that may block it...

> > > And you need extra flags to protect the daemon from being killed at
> > > shutdown or blocked at suspend.
> >
> > Why?
>
> Because the disk must be unlocked even if the laptop falls down while
> a suspension or shutdown are under way.
> And it should work until the heads are parked anyway.

It can't. It has to be user controllable at any point, or you will not
be able to shutdown your notebook while on bumpy road.

Anyone who wants to put it into kernel _please_ read that IBM
paper. It is really complex, with some signal processing, and it goes
wrong at times, so it needs UI so you can disable it.

Pavel
--
if you have sharp zaurus hardware you don't need... you know my address