All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: adeos-main <adeos-main@gna.org>
Subject: Re: [Adeos-main] [PATCH] Restore pipeline state on exit from ipipe_suspend_domain
Date: Wed, 18 Nov 2009 18:25:48 +0100	[thread overview]
Message-ID: <4B042E1C.40505@domain.hid> (raw)
In-Reply-To: <1258564904.2348.170.camel@domain.hid>

Philippe Gerum wrote:
> On Wed, 2009-11-18 at 18:12 +0100, Jan Kiszka wrote:
>> This fixes the valid complaint about safe_halt being called with the
>> root domain unstalled.
> 
> The fix should go to the caller. ipipe_suspend_domain() acts as a
> logical barrier: after that point, you may assume that the current
> domain is unstalled.

The caller so far expect to find no interruption window between return
from ipipe_suspend_domain and yet another local_irq_disable. It expects
to remain stalled all the time until safe_halt.

Jan

> 
>> Signed-off-by: Jan Kiszka <jan.kiszka@domain.hid>
>> ---
>>  kernel/ipipe/core.c |    5 ++++-
>>  1 files changed, 4 insertions(+), 1 deletions(-)
>>
>> Applies to 2.6.31, but is relevant for older kernels as well.
>>
>> diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
>> index ffaceaa..cd946f3 100644
>> --- a/kernel/ipipe/core.c
>> +++ b/kernel/ipipe/core.c
>> @@ -615,12 +615,13 @@ void ipipe_suspend_domain(void)
>>  	struct ipipe_domain *this_domain, *next_domain;
>>  	struct ipipe_percpu_domain_data *p;
>>  	struct list_head *ln;
>> -	unsigned long flags;
>> +	unsigned long flags, saved_status;
>>
>>  	local_irq_save_hw(flags);
>>
>>  	this_domain = next_domain = __ipipe_current_domain;
>>  	p = ipipe_cpudom_ptr(this_domain);
>> +	saved_status = p->status & ~IPIPE_SYNC_MASK;
>>  	p->status &= ~(IPIPE_STALL_MASK|IPIPE_SYNC_MASK);
>>
>>  	if (p->irqpend_himask != 0)
>> @@ -654,6 +655,8 @@ sync_stage:
>>  	}
>>
>>  	__ipipe_current_domain = this_domain;
>> +	p = ipipe_cpudom_ptr(this_domain);
>> +	p->status = saved_status;
>>
>>  	local_irq_restore_hw(flags);
>>  }
> 
> 


-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux


  reply	other threads:[~2009-11-18 17:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18 16:30 [Adeos-main] ipipe_suspend_domain vs. pipeline state of caller Jan Kiszka
2009-11-18 16:49 ` Philippe Gerum
2009-11-18 17:12   ` [Adeos-main] [PATCH] Restore pipeline state on exit from ipipe_suspend_domain Jan Kiszka
2009-11-18 17:21     ` Philippe Gerum
2009-11-18 17:25       ` Jan Kiszka [this message]
2009-11-18 17:37         ` Jan Kiszka
2009-11-18 17:48           ` Philippe Gerum
2009-11-18 23:10             ` [Adeos-main] [PATCH] x86: Move ipipe_suspend_domain out of IRQ-disabled section Jan Kiszka
2009-11-18 23:13               ` Jan Kiszka
2009-11-18 17:41         ` [Adeos-main] [PATCH] Restore pipeline state on exit from ipipe_suspend_domain Philippe Gerum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B042E1C.40505@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=adeos-main@gna.org \
    --cc=rpm@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.