This is where the modular architecture of the power locks comes to play. I
think that the vanilla SplitControlPowerManager should retain a simple
policy of either ignoring the FAIL events / not releasing the resource to
the requester until it is sure that the device is on (a new request should
result in a new retry by the PM to start the device, etc.) That being said,
nothing prevent us from adding new policy in the form of a
RetryingXXXPowerManager that contains logic (either an endless task loop or
give up after N, etc.) to handle the retrying on behalf of the requester, so
whenever the grant is issued it is guaranteed that the device is on.

Vlado

On Thu, May 1, 2008 at 10:05 PM, Kevin Klues <[EMAIL PROTECTED]> wrote:

> Agreed, but what do you propose as an alternative then?  The only one
> I see is potentially exporting a new interface that a user can wire to
> that lets them decide what should be done in the case of a failure.
> Or maybe run in the loop a fixed number of times before giving up and
> passing through as if it had suceeded (possibly also signaling an
> event of some sort taht something went terribly wrong).
>
> Kevin
>
> On Thu, May 1, 2008 at 12:59 PM, Philip Levis <[EMAIL PROTECTED]> wrote:
> >
> >  On May 1, 2008, at 12:03 PM, Kevin Klues wrote:
> >
> > > As the code currently is, you're right, if start or stop ever fails,
> > > then there is a chance for lock up.  Doing a task repost after
> > > checking return conditions shuld fix this problem.  As you say though,
> > > if FAIL is returned indefinitely, then the task will be reposted
> > > forever, but then again you've got other problems if FAIL is
> > > perpetually being returned when trying to start or stop a device.....
> > > I'll check in the fix.
> > >
> >
> >  I don't think a spinning task loop is a good fix; it means that if a
> driver
> > ever fails, the MCU will not enter a low power state.
> >
> >  Phil
> >
>
>
>
> --
> ~Kevin
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to