From: Michael Ellerman <michael@ellerman.id.au>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: Lan Chunhe-B25806 <B25806@freescale.com>, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] powerpc/fsl: Add multiple MSI bank support
Date: Fri, 19 Mar 2010 14:06:54 +1100 [thread overview]
Message-ID: <1268968014.30747.136.camel@concordia> (raw)
In-Reply-To: <1268923993-26689-1-git-send-email-galak@kernel.crashing.org>
[-- Attachment #1: Type: text/plain, Size: 1738 bytes --]
On Thu, 2010-03-18 at 09:53 -0500, Kumar Gala wrote:
> From: Lan Chunhe-B25806 <B25806@freescale.com>
>
> Freescale QorIQ P4080 has three MSI banks and the original code
> can not work well. This patch adds multiple MSI banks support for
> Freescale processor.
>
> Signed-off-by: Lan Chunhe-B25806 <b25806@freescale.com>
> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
> @@ -146,9 +149,13 @@ static int fsl_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
> unsigned int virq;
> struct msi_desc *entry;
> struct msi_msg msg;
> - struct fsl_msi *msi_data = fsl_msi;
> + struct fsl_msi *msi_data;
>
> list_for_each_entry(entry, &pdev->msi_list, list) {
> + if (entry->irq == NO_IRQ)
> + continue;
This looks wrong, entry->irq should always be 0 here because it was just
kzalloc'ed - you should only be doing this check in teardown.
> - WARN_ON(ppc_md.setup_msi_irqs);
> - ppc_md.setup_msi_irqs = fsl_setup_msi_irqs;
> - ppc_md.teardown_msi_irqs = fsl_teardown_msi_irqs;
> - ppc_md.msi_check_device = fsl_msi_check_device;
> + /* The multiple setting ppc_md.setup_msi_irqs will not harm things */
> + if (!ppc_md.setup_msi_irqs) {
> + ppc_md.setup_msi_irqs = fsl_setup_msi_irqs;
> + ppc_md.teardown_msi_irqs = fsl_teardown_msi_irqs;
> + ppc_md.msi_check_device = fsl_msi_check_device;
> + } else if (ppc_md.setup_msi_irqs != fsl_setup_msi_irqs) {
> + dev_err(&dev->dev, "Different MSI driver already installed!\n");
> + err = -EBUSY; /* or some other error code */
> + goto error_out;
> + }
I liked it the way it was, because having two competing MSI backends
means something's probably not going to work. But it's your driver so
whatever you like.
cheers
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2010-03-19 3:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-18 14:53 [PATCH] powerpc/fsl: Add multiple MSI bank support Kumar Gala
2010-03-19 3:06 ` Michael Ellerman [this message]
2010-03-19 15:15 ` Kumar Gala
2010-03-21 23:04 ` Michael Ellerman
2010-03-22 2:31 ` Timur Tabi
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=1268968014.30747.136.camel@concordia \
--to=michael@ellerman.id.au \
--cc=B25806@freescale.com \
--cc=galak@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.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).