From: Haren Myneni <haren@linux.ibm.com>
To: "Oliver O'Halloran" <oohall@gmail.com>
Cc: Haren Myneni <haren@linux.vnet.ibm.com>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
Device Tree <devicetree@vger.kernel.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Michael Neuling <mikey@neuling.org>,
Herbert Xu <herbert@gondor.apana.org.au>,
Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>,
hbabu@us.ibm.com
Subject: Re: [PATCH 04/14] powerpc/vas: Setup IRQ mapping and register port for each window
Date: Wed, 18 Dec 2019 15:13:01 -0800 [thread overview]
Message-ID: <1576710781.12797.10.camel@hbabu-laptop> (raw)
In-Reply-To: <CAOSf1CEvZ32xC71siuyfUQEcQ4yLoDtj2jGoc3jrmsHc0jD+Vw@mail.gmail.com>
On Wed, 2019-12-18 at 18:18 +1100, Oliver O'Halloran wrote:
> On Wed, Nov 27, 2019 at 12:07 PM Haren Myneni <haren@linux.vnet.ibm.com> wrote:
> >
> > *snip*
> >
> > @@ -36,7 +62,18 @@ static int init_vas_instance(struct platform_device *pdev)
> > return -ENODEV;
> > }
> >
> > - if (pdev->num_resources != 4) {
> > + rc = of_property_read_u64(dn, "ibm,vas-port", &port);
> > + if (rc) {
> > + pr_err("No ibm,vas-port property for %s?\n", pdev->name);
> > + /* No interrupts property */
> > + nresources = 4;
> > + }
> > +
> > + /*
> > + * interrupts property is available with 'ibm,vas-port' property.
> > + * 4 Resources and 1 IRQ if interrupts property is available.
> > + */
> > + if (pdev->num_resources != nresources) {
> > pr_err("Unexpected DT configuration for [%s, %d]\n",
> > pdev->name, vasid);
> > return -ENODEV;
>
> Right, so adding the IRQ in firmware will break the VAS driver in
> existing kernels since it changes the resource count. This is IMO a
> bug in the VAS driver that you should fix, but it does mean we need to
> think twice about having firmware assign an interrupt at boot.
Correct, Hence added vas-user-space nvram switch in skiboot.
>
> I had a closer look at this series and I'm not convinced that any
> firmware changes are actually required either. We already have OPAL
> calls for allocating an hwirq for the kernel to use and for getting
> the IRQ's XIVE trigger port (see pnv_ocxl_alloc_xive_irq() for an
> example). Why not use those here too? Doing so would allow us to
> assign interrupts to individual windows too which might be useful for
> the windows used by the kernel.
Thanks for the pointer. like using pnv_ocxl_alloc_xive_irq(), we can
disregard FW change. BTW, VAS fault handling is needed only for user
space VAS windows.
int vas_alloc_xive_irq(u32 chipid, u32 *irq, u64 *trigger_addr)
{
__be64 flags, trigger_page;
u32 hwirq;
s64 rc;
hwirq = opal_xive_allocate_irq_raw(chipid);
if (hwirq < 0)
return -ENOENT;
rc = opal_xive_get_irq_info(hwirq, &flags, NULL, &trigger_page,
NULL,
NULL);
if (rc || !trigger_page) {
xive_native_free_irq(hwirq);
return -ENOENT;
}
*irq = hwirq;
*trigger_addr = be64_to_cpu(trigger_page);
return 0;
}
We can have common function for VAS and cxl except per chip IRQ
allocation is needed for each VAS instance. I will post patch-set with
this change.
Thanks
Haren
next prev parent reply other threads:[~2019-12-18 23:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-27 1:05 [PATCH 04/14] powerpc/vas: Setup IRQ mapping and register port for each window Haren Myneni
2019-11-27 8:33 ` Christoph Hellwig
2019-12-18 7:18 ` Oliver O'Halloran
2019-12-18 23:13 ` Haren Myneni [this message]
2019-12-19 22:31 ` Haren Myneni
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=1576710781.12797.10.camel@hbabu-laptop \
--to=haren@linux.ibm.com \
--cc=devicetree@vger.kernel.org \
--cc=haren@linux.vnet.ibm.com \
--cc=hbabu@us.ibm.com \
--cc=herbert@gondor.apana.org.au \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mikey@neuling.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=oohall@gmail.com \
--cc=sukadev@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).