linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH][0/2] RTAS MSI
Date: Wed, 09 Aug 2006 20:27:08 +1000	[thread overview]
Message-ID: <1155119228.6949.24.camel@localhost.localdomain> (raw)
In-Reply-To: <F5E5EF18-6452-4E9D-8A43-6D1CE9C3E43E@kernel.crashing.org>

[-- Attachment #1: Type: text/plain, Size: 2225 bytes --]

On Wed, 2006-08-09 at 11:52 +0200, Segher Boessenkool wrote:
> > I was just re-reading this thread and this got me thinking. I think  
> > the
> > current code does violate this rule if firmware has allocated more  
> > than
> > one MSI to the device.
> >
> > In rtas_enable_msi() we ask firmware how many MSIs the device has been
> > given (by firmware), we then return one to the driver, but leave any
> > extras configured.
> >
> > So this might lead to the state where the card has been configured to
> > use x MSIs, but we only tell the driver about 1 of them. I don't know
> > enough PCI to grok if that's going to be a problem.
> 
> A device could in principle happily start using all MSIs it has been
> assigned as soon as its global interrupt enable bit is set.  So lying
> to the driver about what MSIs are enabled can in principle cause nasty
> problems.
> 
> In reality however, on any (recent) device, every interrupt cause also
> has its own enable bits that the driver needs to set.  So we're sort-of
> safe here.

Yeah ok, I thought that was probably the answer - it's possible, but
probably not a problem IRL.

> Eventually, we should change the API for pci_enable_msi() so that it
> can enable multiple MSIs as well; an arch implementation can always
> choose to do just one.  This lets us roll the APIs for MSI and MSI-X
> into one as well btw -- always a good thing!

Yeah. Looking at the way drivers use the current API (and there's only a
few), they generally seem to try to enable n MSI-X vectors, then
fallback to a single MSI then LSI. And then there's some that just want
a single MSI as a drop-in replacement for LSI.

So I think we could have pci_enable_msi(dev), which would enable a
single MSI _or_ MSI-X vector, depending on what's available. That'd be
used by drivers that just want a simple replacement for LSI. And then
pci_enable_multi_msi(dev, num_irqs) which would give the driver num_irqs
MSI or MSI-X vectors.

cheers

-- 
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

  reply	other threads:[~2006-08-09 10:27 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-27 18:15 [PATCH][0/2] RTAS MSI Jake Moilanen
2006-07-27 18:17 ` [PATCH][1/2] export msi symbols Jake Moilanen
2006-07-27 18:41   ` Segher Boessenkool
2006-07-27 18:27 ` [PATCH][2/2] RTAS MSI Jake Moilanen
2006-07-27 18:46   ` Segher Boessenkool
2006-07-27 18:50     ` Segher Boessenkool
2006-07-27 19:34     ` Jake Moilanen
2006-07-27 20:35       ` Segher Boessenkool
2006-07-31  4:07   ` Paul Mackerras
2006-07-31 19:55     ` Jake Moilanen
2006-07-31  4:33   ` Michael Ellerman
2006-07-31 20:47     ` Jake Moilanen
2006-07-31 21:01     ` Jake Moilanen
2006-08-01 23:26       ` Michael Ellerman
2006-08-02  5:35         ` Segher Boessenkool
2006-08-02  9:04       ` Michael Ellerman
2006-08-09  9:50         ` Benjamin Herrenschmidt
2006-08-10  8:03           ` Michael Ellerman
2006-08-10  8:18             ` Benjamin Herrenschmidt
2006-07-28  4:56 ` [PATCH][0/2] " Benjamin Herrenschmidt
2006-07-28 18:43   ` Segher Boessenkool
2006-07-28 18:42     ` Jake Moilanen
2006-07-28 18:53       ` Segher Boessenkool
2006-08-09  2:23     ` Michael Ellerman
2006-08-09  9:52       ` Segher Boessenkool
2006-08-09 10:27         ` Michael Ellerman [this message]
2006-08-09 15:41           ` Benjamin Herrenschmidt
2006-08-10  8:22             ` Michael Ellerman
2006-08-10  9:23               ` Benjamin Herrenschmidt
2006-08-09 15:38       ` Benjamin Herrenschmidt

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=1155119228.6949.24.camel@localhost.localdomain \
    --to=michael@ellerman.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    --cc=segher@kernel.crashing.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).