public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Gavin Shan <shangw@linux•vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@kernel•crashing.org>
Cc: linuxppc-dev@lists•ozlabs.org, Gavin Shan <shangw@linux•vnet.ibm.com>
Subject: Re: [PATCH 4/5] powerpc/powernv: Patch MSI EOI handler on P8
Date: Wed, 24 Apr 2013 09:31:36 +0800	[thread overview]
Message-ID: <20130424013136.GB6527@shangw.(null)> (raw)
In-Reply-To: <1366730513.12131.5.camel@pasglop>

On Wed, Apr 24, 2013 at 01:21:53AM +1000, Benjamin Herrenschmidt wrote:
>On Tue, 2013-04-23 at 19:03 +0800, Gavin Shan wrote:
>> 
>> +static int pnv_pci_ioda_msi_eoi(struct pnv_phb *phb, unsigned int hw_irq)
>> +{
>> +       u8 p_bit = 1, q_bit = 1;
>> +       long rc;
>> +
>> +       while (p_bit || q_bit) {
>> +               rc = opal_pci_get_xive_reissue(phb->opal_id,
>> +                               hw_irq - phb->msi_base, &p_bit, &q_bit);
>> +               if (rc) {
>> +                       pr_warning("%s: Failed to get P/Q bits of IRQ#%d "
>> +                                  "on PHB#%d, rc=%ld\n", __func__, hw_irq,
>> +                                  phb->hose->global_number, rc);
>> +                       return -EIO;
>> +               }
>> +               if (!p_bit && !q_bit)
>> +                       break;
>> +
>> +               rc = opal_pci_set_xive_reissue(phb->opal_id,
>> +                               hw_irq - phb->msi_base, p_bit, q_bit);
>> +               if (rc) {
>> +                       pr_warning("%s: Failed to clear P/Q (%01d/%01d) of "
>> +                                  "IRQ#%d on PHB#%d, rc=%ld\n", __func__,
>> +                                  p_bit, q_bit, hw_irq,
>> +                                  phb->hose->global_number, rc);
>> +                       return -EIO;
>> +               }
>> +       }
>> +
>> +       return 0;
>> +}
>
>Can you turn that into a single opal_pci_msi_eoi() ? This means that a
>single MSI will trigger only one OPAL call rather than two which is
>better for performances.
>

Ok. I will add new OPAL API opal_pci_msi_eoi() and use that in next version.

>We will later implement an "optimized" variant using direct MMIO based
>on knowing specifically the HW type but not now.
>

Ok :-)

Thanks,
Gavin

  reply	other threads:[~2013-04-24  1:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-23 11:03 [PATCH v2 0/5] powerpc/powernv: PHB3 Support Gavin Shan
2013-04-23 11:03 ` [PATCH 1/5] powerpc/powernv: Supports PHB3 Gavin Shan
2013-04-23 15:19   ` Benjamin Herrenschmidt
2013-04-24  1:29     ` Gavin Shan
2013-04-23 11:03 ` [PATCH 2/5] powerpc/powernv: Retrieve IODA2 tables explicitly Gavin Shan
2013-04-23 11:03 ` [PATCH 3/5] powerpc/powernv: Add option CONFIG_POWERNV_MSI Gavin Shan
2013-04-23 11:03 ` [PATCH 4/5] powerpc/powernv: Patch MSI EOI handler on P8 Gavin Shan
2013-04-23 15:21   ` Benjamin Herrenschmidt
2013-04-24  1:31     ` Gavin Shan [this message]
2013-04-23 11:03 ` [PATCH 5/5] powerpc/powernv: TCE invalidation for PHB3 Gavin Shan
2013-04-23 15:25   ` Benjamin Herrenschmidt
2013-04-24  1:32     ` Gavin Shan

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='20130424013136.GB6527@shangw.(null)' \
    --to=shangw@linux$(echo .)vnet.ibm.com \
    --cc=benh@kernel$(echo .)crashing.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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