public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Andrew Morton <akpm@osdl.org>, Dave Olson <olson@unixfolk.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] Initial generic hypertransport interrupt support.
Date: Tue, 11 Jul 2006 15:20:05 +1000	[thread overview]
Message-ID: <1152595205.6346.26.camel@localhost.localdomain> (raw)
In-Reply-To: <m14pxolryw.fsf@ebiederm.dsl.xmission.com>


> I didn't really expect you to have an immediate use, but the
> confirmation is nice.  The interesting part is how I have factored out
> the arch specific details. I believe this is close to the direction
> you envisioned for msi.  If you could look at the basic structure
> and confirm that the structure looks properly arch neutral that
> would be appreciated.  As time permits I want to make the msi code
> look more the this hypertransport irq code.

Ok, I'll try to have a second look in the plane :) (I'm flying off
tomorrow). If you are interested in the new IRQ infrastructure I did for
powerpc, it's now upstream (read comments in arch/powerpc/kernel/irq.c).
My idea for MSIs etc... is that I've completley disconnected linux
interrupt numbers and HW vector numbers for a given controller. Thus I
can allocate linux virtual irq numbers (including linear ranges of them
if we ever want to handle multiple MSIs (not MSI-X) etc.. However, it's
up to a given irq controller to handle it's own allocation of vectors
for those MSIs. Some controllers may have a fixed set of vectors
reserved for MSIs, or in some cases, like pSeries LPAR, the firmware
controls everything and just hands me a bunch of vectors for devices,
etc... 

That also mean that the allocation of vectors for a given controller
that can do MSI will be handled completely locally to the driver of that
controller. For example, on the Quad G5, I will have the MPIC driver
locally have a bitmap of what irq sources are used by LSIs and HT
interrupts coming from IO-APICs (pretty much the same as LSIs as far as
the driver is concerned) and will implement a local allocator to handle
the allocation of the remaining sources by MSI capable devices.

One problem I have at this point is with multiple MSIs. Our current
interface, pci_enable_msi(), is pretty much documented as only ever
enabling one MSI and I don't quite understand why we did that in the
first place. It seems ok to me to define that it can enable 2^N MSIs as
requested by the device with consecutive numbers starting at pdev->irq.
Now if we don't want to change that, I would propose that we define a
new interface, pci_enable_msi_multi(pdev, order, array) to which we can
pass a requested count (order) which has to be <= to the device number
of requested MSIs (so the driver can ask for less if it knows it doesn't
need as much as the device asks for) and the actual interrupts infos are
returned via an array identical to the one used for MSI-X. That way,
even if hardware MSI vectors still have to be naturally aligned on the
number requested and consecutive, the returned linux IRQ numbers don't
have to. In addition, by holding the list of IRQs in the same data
structure as MSI-X, this simplifies drivers who want to implement both
modes.

I don't have time to work much on the MSI aspect of things before OLS
though and I'll be away after that until end of august with only
intermittent internet access, so we'll talk about it again either at OLS
itself if we find some time, or when I'm back.

Cheers,
Ben.



  reply	other threads:[~2006-07-11  5:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-10 22:14 [PATCH 1/2] Add Hypertransport capability defines Eric W. Biederman
2006-07-10 22:26 ` [PATCH 2/2] Initial generic hypertransport interrupt support Eric W. Biederman
2006-07-10 22:39   ` Benjamin Herrenschmidt
2006-07-11  3:51     ` Eric W. Biederman
2006-07-11  5:20       ` Benjamin Herrenschmidt [this message]
2006-07-11  6:29         ` Eric W. Biederman
2006-07-11  7:29           ` Segher Boessenkool
2006-07-11  7:48             ` Eric W. Biederman
2006-07-11  9:15               ` Benjamin Herrenschmidt
2006-07-11 19:56                 ` Eric W. Biederman
2006-07-11 22:18                   ` Benjamin Herrenschmidt
2006-07-11 22:27   ` Andi Kleen
2006-07-12  3:05     ` Eric W. Biederman
2006-07-12  6:10       ` Dave Olson
2006-07-12  6:56         ` Eric W. Biederman
2006-07-13  3:56           ` Dave Olson
2006-07-13 15:13             ` Eric W. Biederman
2006-07-13 18:15               ` Dave Olson
2006-07-13 18:41                 ` Eric W. Biederman
2006-07-13 19:00                   ` Dave Olson
2006-07-13 19:20                     ` Eric W. Biederman
2006-07-13 19:34                       ` Dave Olson

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=1152595205.6346.26.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olson@unixfolk.com \
    /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