public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Milton Miller <miltonm@bga.com>
To: benh@kernel.crashing.org
Cc: Paul Mackerras <paulus@samba.org>,
	linux-kernel@vger.kernel.org,
	Christoph Raisch <RAISCH@de.ibm.com>,
	linuxppc-dev@ozlabs.org, Jan-Bernd Themann <ossthema@de.ibm.com>,
	Sebastien Dugue <sebastien.dugue@bull.net>
Subject: Re: [PATCH HACK] powerpc: quick hack to get a functional eHEA with hardirq preemption
Date: Wed, 24 Sep 2008 22:56:54 -0500	[thread overview]
Message-ID: <9eea138fe97eb1e63e5169a4d7647883@bga.com> (raw)
In-Reply-To: <1222291005.8277.86.camel@pasglop>

On Sep 24, 2008, at 4:16 PM, Benjamin Herrenschmidt wrote:
> On Wed, 2008-09-24 at 11:42 -0500, Milton Miller wrote:
>>
>> I was trying to understand why the mask and early eoi, but I guess its
>> to handle other more limited interrupt controllers where the 
>> interrupts
>> stack in hardware instead of software.
>
> No Milton, we must do it that way, because the EOI must be done on the
> right CPU even on XICS, or we won't get the CPU priority back properly.

Ben and I had a online chat, and he pointed out I needed to be more 
specific in saying what I was thinking.

>> I think the flows we want on xics are:
>>
>> (non-threaded)
>> 	getirq (implicit source specific mask until eoi)
>> 	handle interrupt
>> 	eoi (implicit cpu priority restore)
>>
>> (threaded)
>> 	getirq (implicit source specific mask until eoi)
>> 	explicit cpu priority restore
>> 	handle interrupt
>> 	eoi (implicit cpu priority restore to same as explicit level)


cpu takes interrupt, checks soft disabled
if so,
	set hard disabled
else
	call get_irq
	if threaded
		write cppr to restore this cpu irq dispatch state to non-interrupt
		mark irq thread as irq pending
	else
		handle interrupt
		eoi (cppr = base)

irq thread will
	handle interrupt
	eoi
	wait for marked pending again

The part Ben did not follow was that the cppr write to base priority is 
done by the interrupted cpu (like the mask and eoi in the current flow) 
and only the final eoi (where the mask is in the existing flow) is done 
on which ever cpu happens to run the irq thread.


(optional) As I was discussing with Paul, when taking an irq when 
soft-disabled but still hard enabled, it is possible to write the cppr 
such that it would reject the pending irq and have it be considered for 
dispatch to another cpu.   But it would increase pathlength on both the 
go-to-hard-disabled and return-from-hard-disabled and the hardware will 
have some latency as it will likely send it back to the io source until 
it retrys, so we would only want to do this if the hard-disable period 
is sufficiently long.

milton


  reply	other threads:[~2008-09-25  3:56 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-15  8:04 [PATCH HACK] powerpc: quick hack to get a functional eHEA with hardirq preemption Sebastien Dugue
2008-09-15 12:35 ` Thomas Klein
2008-09-15 13:13   ` Sebastien Dugue
2008-09-16 11:59     ` Anton Vorontsov
2008-09-16 12:22       ` Sebastien Dugue
2008-09-18  7:53 ` Christoph Raisch
2008-09-18  9:27   ` Sebastien Dugue
2008-09-18 10:42     ` [PATCH HACK] powerpc: quick hack to get a functional eHEA with hardirq preemption, eHCA is close Christoph Raisch
2008-09-18 12:31       ` Sebastien Dugue
2008-09-23 15:43         ` Jan-Bernd Themann
2008-09-24  9:58           ` [PATCH HACK] powerpc: quick hack to get a functional eHEA with hardirq preemption Milton Miller
2008-09-24 10:17             ` Benjamin Herrenschmidt
2008-09-24 11:02               ` Milton Miller
2008-09-24 21:14                 ` Benjamin Herrenschmidt
2008-09-25  7:31                   ` Sebastien Dugue
2008-09-24 12:35               ` Sebastien Dugue
2008-09-24 21:15                 ` Benjamin Herrenschmidt
2008-09-25  7:18                   ` Sebastien Dugue
2008-09-25  7:22                     ` Benjamin Herrenschmidt
2008-09-25  7:42                       ` Sebastien Dugue
2008-09-25  8:36                         ` Benjamin Herrenschmidt
2008-09-25  8:39                           ` Sebastien Dugue
2008-09-24 12:30             ` Sebastien Dugue
2008-09-24 16:42               ` Milton Miller
2008-09-24 21:16                 ` Benjamin Herrenschmidt
2008-09-25  3:56                   ` Milton Miller [this message]
2008-09-25  8:45                 ` Sebastien Dugue
  -- strict thread matches above, loose matches on Subject: below --
2008-09-25 23:40 Milton Miller
2008-09-26  9:16 ` Sebastien Dugue

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=9eea138fe97eb1e63e5169a4d7647883@bga.com \
    --to=miltonm@bga.com \
    --cc=RAISCH@de.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=ossthema@de.ibm.com \
    --cc=paulus@samba.org \
    --cc=sebastien.dugue@bull.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox