Re: [riot-devel] LPM idle_thread

2015-05-10 Thread Kaspar Schleiser
Hi,

On 05/10/15 10:38, Oleg Hahm wrote:
>>> I would claim that this is impossible. Even a simple puts() already affects
>>> the timings, calls peripheral drivers, and may cause interrupts.
>> "the same" was bad wording. I meant semantically, like Martine initially
>> stated.
> 
> I guess you mean Ludwig. 
Yes, sorry Martine, sorry Ludwig.

> I just wanted to point out that going into powerdown
> mode (but going into *different* powerdown modes) falls into the same
> category than printing or non printing.
whatever. ;)

Kaspar
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] LPM idle_thread

2015-05-10 Thread Oleg Hahm
Hi Kaspar!

> > I would claim that this is impossible. Even a simple puts() already affects
> > the timings, calls peripheral drivers, and may cause interrupts.
> "the same" was bad wording. I meant semantically, like Martine initially
> stated.

I guess you mean Ludwig. I just wanted to point out that going into powerdown
mode (but going into *different* powerdown modes) falls into the same
category than printing or non printing.

Cheers,
Oleg
-- 
/* Fuck me gently with a chainsaw... */
linux-2.0.38/arch/sparc/kernel/ptrace.c


pgpXjY6YrS253.pgp
Description: PGP signature
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] LPM idle_thread

2015-05-10 Thread Kaspar Schleiser
Hi,

On 05/10/15 09:34, Oleg Hahm wrote:
 DEVELHELP should not be used to change the semantics of things.
>>>
>>> Can you elaborate?
>> The system should behave the same whether develhelp is used or not.
> 
> I would claim that this is impossible. Even a simple puts() already affects
> the timings, calls peripheral drivers, and may cause interrupts.
"the same" was bad wording. I meant semantically, like Martine initially
stated.

Kaspar
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] LPM idle_thread

2015-05-10 Thread Oleg Hahm
Hi!

> >> DEVELHELP should not be used to change the semantics of things.
> > 
> > Can you elaborate?
> The system should behave the same whether develhelp is used or not.

I would claim that this is impossible. Even a simple puts() already affects
the timings, calls peripheral drivers, and may cause interrupts.
 
> then the application will work correctly (e.g., handle the error) with
> DEVELHELP and probably crash without. But DEVELHELP is supposed to
> expose bugs, not work around them. So in this example, the "return
> ERROR" should be omitted.

I would guess that going into LPM_SLEEP instead of LPM_IDLE has a similar
effect than calling additional printfs (which basically means that the effect
cannot be foreseen in most cases).

Cheers,
Oleg
-- 
dprintk(5, KERN_DEBUG "Jotti is een held!\n");
linux-2.6.6/drivers/media/video/zoran_card.c


pgpfE1lgGjxcD.pgp
Description: PGP signature
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] LPM idle_thread

2015-05-10 Thread Kaspar Schleiser
Hi,

On 05/09/15 20:24, Oleg Hahm wrote:
>> DEVELHELP should not be used to change the semantics of things.
> 
> Can you elaborate?
The system should behave the same whether develhelp is used or not.

If you do something like

#ifdef DEVELHELP
if(input_not_correct)
{
print("error message");
return ERROR;
}
#endif

then the application will work correctly (e.g., handle the error) with
DEVELHELP and probably crash without. But DEVELHELP is supposed to
expose bugs, not work around them. So in this example, the "return
ERROR" should be omitted.

Kaspar
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] LPM idle_thread

2015-05-09 Thread Oleg Hahm
Hi Ludwig!

> DEVELHELP should not be used to change the semantics of things.

Can you elaborate?

Cheers,
Oleg
-- 
Perl’s 1st theorem: for each Perl script there is a more readable equivalent
assembly program.


pgpqtj0bW02LC.pgp
Description: PGP signature
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] LPM idle_thread

2015-05-09 Thread Ludwig Ortmann
Hi,

DEVELHELP should not be used to change the semantics of things.

Cheers,
Ludwig

Am 9. Mai 2015 18:43:36 MESZ, schrieb Oleg Hahm :
>Hi Frank!
>
>> why is LPM_SLEEP or LPM_POWERDOWN is commented out?
>
>I think it's mostly commented out for debugging. Debugging with power
>save
>modes can become really nasty (even printf() debugging).
>
>However, I agree this shouldn't be solved like this. Another case for
>DEVELHELP, maybe?
>
>Cheers,
>Oleg

___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] LPM idle_thread

2015-05-09 Thread Joakim Gebart
See https://github.com/RIOT-OS/RIOT/issues/2927
It's not yet been developed fully, those are just place holders. I have
proposed to use a more dynamic scheme for the LPM modes.

Best regards, Joakim
www.eistec.se
On May 9, 2015 6:40 PM, "Frank Holtz"  wrote:

> Hello,
>
> why is LPM_SLEEP or LPM_POWERDOWN is commented out?
>
> kernel_init.c:
> ---
> static void *idle_thread(void *arg)
> {
> (void) arg;
>
> while (1) {
> if (lpm_prevent_sleep) {
> lpm_set(LPM_IDLE);
> }
> else {
> lpm_set(LPM_IDLE);
> /* lpm_set(LPM_SLEEP); */
> /* lpm_set(LPM_POWERDOWN); */
> }
> }
>
> return NULL;
> }
> ---
>
> ___
> devel mailing list
> devel@riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel
>
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] LPM idle_thread

2015-05-09 Thread Oleg Hahm
Hi Frank!

> why is LPM_SLEEP or LPM_POWERDOWN is commented out?

I think it's mostly commented out for debugging. Debugging with power save
modes can become really nasty (even printf() debugging).

However, I agree this shouldn't be solved like this. Another case for
DEVELHELP, maybe?

Cheers,
Oleg
-- 
printk(KERN_WARNING "%s: Thanks, I feel much better now!\n", dev->name);
linux-2.6.6/drivers/net/de620.c


pgpMv4AtjBIsE.pgp
Description: PGP signature
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


[riot-devel] LPM idle_thread

2015-05-09 Thread Frank Holtz
Hello,

why is LPM_SLEEP or LPM_POWERDOWN is commented out?

kernel_init.c:
---
static void *idle_thread(void *arg)
{
(void) arg;

while (1) {
if (lpm_prevent_sleep) {
lpm_set(LPM_IDLE);
}
else {
lpm_set(LPM_IDLE);
/* lpm_set(LPM_SLEEP); */
/* lpm_set(LPM_POWERDOWN); */
}
}

return NULL;
}
---

___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel