[Tinyos-devel] Resource arbitration bug in SerialP
Kevin Klues
klueska at gmail.com
Mon Sep 8 07:57:30 PDT 2008
After glancing briefly at the code, it looks to me like there are more
things wrong here than the simple fix you propose. Until now, no one
has really arbitrated access to the serial stack i.e. it has been a
dedicated resource on most platforms. Because of this, it seems like
it doesn't follow the proper semantics for SplitControl.start() and
SplitControl.stop() as outlined in TEP115. A proper fix would be to
get it in line with these specifications so that putting a resource
arbiter around it can work properly.
Kevin
On Mon, Sep 8, 2008 at 3:23 AM, Maxime Muller - s h o c k f i s h /
<maxime at shockfish.com> wrote:
> Hi there,
>
> Francois Ingelrest from LCAV @ epfl noticed a bug in
> $TOSDIR/lib/serial/SerialP.nc
>
> Description:
> A call to SplitControl.stop() will eventually set txState to
> TXSTATE_INACTIVE. Then calling SplitControl.start() wont set txState to
> TXSTATE_IDLE thus locking the resource.
>
> Possible fix:
>
> task void startDoneTask() {
> if(call SerialControl.start()==SUCCESS) {
> if(txState == TXSTATE_INACTIVE)
> txInit();
> signal SplitControl.startDone(SUCCESS);
> } else signal SplitControl.startDone(FAIL);
> }
>
> imho, the rx part should be ok as void rx_state_machine(...) restores
> the right state.
>
> Kind Regards,
> maxime
> _______________________________________________
> Tinyos-devel mailing list
> Tinyos-devel at millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-devel
>
--
~Kevin
More information about the Tinyos-devel
mailing list