linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Jake Moilanen <moilanen@austin.ibm.com>
To: michael@ellerman.id.au
Cc: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH][2/2] RTAS MSI
Date: Mon, 31 Jul 2006 15:47:00 -0500	[thread overview]
Message-ID: <1154378820.29826.392.camel@goblue> (raw)
In-Reply-To: <1154320382.19883.26.camel@localhost.localdomain>


> > +int rtas_enable_msi(struct pci_dev* pdev)
> > +{
> > +	static int seq_num = 1;
> 
> Do we really want seq_num to be static? By my reading of PAPR we only
> need to maintain the seq number across calls that return -2/990x, and we
> handle that all inside this function. If it does need to be unique for
> _all_ calls, then I don't see how seq_num being static is going to work,
> a different cpu could stomp on the seq_num value between calls, which
> presumably would make firmware mad.

Bah...I thought I fixed this a long time ago....must have gotten dropped
somewhere in the mix.

> > +	int reglen;
> > +	int ret[3];
> 
> You only need ret[2] I think, the first return value (status) is handled
> inside rtas_call for you.

Yup...

> > +	int dummy;
> > +	int n_intr;
> > +	int last_virq = NO_IRQ;
> > +	int virq;
> > +	unsigned int addr;
> > +	unsigned long buid = -1;
> 
> No need to set buid to -1 as you unconditionally assign to it later.

Agreed

> > +	struct device_node * dn;
> > +
> > +	dn = pci_device_to_OF_node(pdev);
> > +
> > +	if (!of_find_property(dn, "ibm,req#msi", &dummy))
> > +		return -ENOENT;
> 
> You don't need dummy, just pass NULL.

Yup.

> > +
> > +	reg = (u32 *) get_property(dn, "reg", &reglen);
> > +	if (reg == NULL || reglen < 20)
> > +		return -ENXIO;
> > +
> > +	devfn = (reg[0] >> 8) & 0xff;
> > +	busno = (reg[0] >> 16) & 0xff;
> > +
> > +	buid = get_phb_buid(dn->parent);
> > +	addr = (busno << 16) | (devfn << 8);
> 
> Why do we need to read the reg here, can't we just use the existing
> fields? ie:
> 
>         addr = (pdev->bus->number << 16) | (pdev->devfn << 8);

Patch coming w/ all these fixes.

  reply	other threads:[~2006-07-31 20:50 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 [this message]
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
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=1154378820.29826.392.camel@goblue \
    --to=moilanen@austin.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=michael@ellerman.id.au \
    --cc=paulus@samba.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).