From: "Alastair D'Silva" <alastair@au1.ibm.com>
To: Greg Kurz <groug@kaod.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org,
Andrew Donnellan <andrew.donnellan@au1.ibm.com>,
Frederic Barrat <fbarrat@linux.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 6/7] ocxl: afu_irq only deals with IRQ IDs, not offsets
Date: Wed, 20 Mar 2019 11:28:43 +1100 [thread overview]
Message-ID: <20fc6ceee1d45e3d4e71e3ac6887ef2860a1c341.camel@au1.ibm.com> (raw)
In-Reply-To: <20190315145639.4ae9e257@bahia.lab.toulouse-stg.fr.ibm.com>
On Fri, 2019-03-15 at 14:56 +0100, Greg Kurz wrote:
> On Wed, 13 Mar 2019 15:15:21 +1100
> "Alastair D'Silva" <alastair@au1.ibm.com> wrote:
>
> > From: Alastair D'Silva <alastair@d-silva.org>
> >
> > The use of offsets is required only in the frontend, so alter
> > the IRQ API to only work with IRQ IDs in the backend.
> >
> > Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
> > ---
> > drivers/misc/ocxl/afu_irq.c | 31 +++++++++++++------------
> > ------
> > drivers/misc/ocxl/context.c | 7 +++++--
> > drivers/misc/ocxl/file.c | 13 ++++++++-----
> > drivers/misc/ocxl/ocxl_internal.h | 10 ++++++----
> > drivers/misc/ocxl/trace.h | 12 ++++--------
> > 5 files changed, 36 insertions(+), 37 deletions(-)
> >
> > diff --git a/drivers/misc/ocxl/afu_irq.c
> > b/drivers/misc/ocxl/afu_irq.c
> > index 11ab996657a2..1885c472df58 100644
> > --- a/drivers/misc/ocxl/afu_irq.c
> > +++ b/drivers/misc/ocxl/afu_irq.c
> > @@ -14,14 +14,14 @@ struct afu_irq {
> > struct eventfd_ctx *ev_ctx;
> > };
> >
> > -static int irq_offset_to_id(struct ocxl_context *ctx, u64 offset)
> > +int ocxl_irq_offset_to_id(struct ocxl_context *ctx, u64 offset)
> > {
> > return (offset - ctx->afu->irq_base_offset) >> PAGE_SHIFT;
> > }
> >
> > -static u64 irq_id_to_offset(struct ocxl_context *ctx, int id)
> > +u64 ocxl_irq_id_to_offset(struct ocxl_context *ctx, int irq_id)
> > {
> > - return ctx->afu->irq_base_offset + (id << PAGE_SHIFT);
> > + return ctx->afu->irq_base_offset + (irq_id << PAGE_SHIFT);
> > }
> >
> > static irqreturn_t afu_irq_handler(int virq, void *data)
> > @@ -69,7 +69,7 @@ static void release_afu_irq(struct afu_irq *irq)
> > kfree(irq->name);
> > }
> >
> > -int ocxl_afu_irq_alloc(struct ocxl_context *ctx, u64 *irq_offset)
> > +int ocxl_afu_irq_alloc(struct ocxl_context *ctx, int *irq_id)
> > {
> > struct afu_irq *irq;
> > int rc;
> > @@ -101,10 +101,7 @@ int ocxl_afu_irq_alloc(struct ocxl_context
> > *ctx, u64 *irq_offset)
> > if (rc)
> > goto err_alloc;
> >
> > - *irq_offset = irq_id_to_offset(ctx, irq->id);
>
> This should be replaced by:
>
> *irq_id = irq->id;
>
Whoops, good catch, thanks :)
--
Alastair D'Silva
Open Source Developer
Linux Technology Centre, IBM Australia
mob: 0423 762 819
next prev parent reply other threads:[~2019-03-20 0:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-13 4:15 [PATCH 0/7] Refactor OCXL driver to allow external drivers to use it Alastair D'Silva
2019-03-13 4:15 ` [PATCH 1/7] ocxl: Provide global MMIO accessors for external drivers Alastair D'Silva
2019-03-13 18:06 ` Frederic Barrat
2019-03-15 4:11 ` Andrew Donnellan
2019-03-13 4:15 ` [PATCH 2/7] ocxl: Allow external drivers to use OpenCAPI contexts Alastair D'Silva
2019-03-13 18:20 ` Frederic Barrat
2019-03-13 4:15 ` [PATCH 3/7] ocxl: Split pci.c Alastair D'Silva
2019-03-14 16:48 ` Frederic Barrat
2019-03-13 4:15 ` [PATCH 4/7] ocxl: Don't pass pci_dev around Alastair D'Silva
2019-03-14 17:00 ` Frederic Barrat
2019-03-15 3:32 ` Andrew Donnellan
2019-03-13 4:15 ` [PATCH 5/7] ocxl: Create a clear delineation between ocxl backend & frontend Alastair D'Silva
2019-03-14 16:27 ` Frederic Barrat
2019-03-13 4:15 ` [PATCH 6/7] ocxl: afu_irq only deals with IRQ IDs, not offsets Alastair D'Silva
2019-03-15 13:56 ` Greg Kurz
2019-03-20 0:28 ` Alastair D'Silva [this message]
2019-03-13 4:15 ` [PATCH 7/7] ocxl: move event_fd handling to frontend Alastair D'Silva
2019-03-20 5:08 ` [PATCH v2 0/7] Refactor OCXL driver to allow external drivers to use it Alastair D'Silva
2019-03-20 5:08 ` [PATCH v2 1/7] ocxl: Split pci.c Alastair D'Silva
2019-03-20 5:08 ` [PATCH v2 2/7] ocxl: Don't pass pci_dev around Alastair D'Silva
2019-03-20 5:08 ` [PATCH v2 3/7] ocxl: Create a clear delineation between ocxl backend & frontend Alastair D'Silva
2019-03-22 17:38 ` Frederic Barrat
2019-03-20 5:08 ` [PATCH v2 4/7] ocxl: Allow external drivers to use OpenCAPI contexts Alastair D'Silva
2019-03-20 5:08 ` [PATCH v2 5/7] ocxl: afu_irq only deals with IRQ IDs, not offsets Alastair D'Silva
2019-03-20 5:08 ` [PATCH v2 6/7] ocxl: move event_fd handling to frontend Alastair D'Silva
2019-03-20 5:08 ` [PATCH v2 7/7] ocxl: Provide global MMIO accessors for external drivers Alastair D'Silva
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=20fc6ceee1d45e3d4e71e3ac6887ef2860a1c341.camel@au1.ibm.com \
--to=alastair@au1.ibm.com \
--cc=andrew.donnellan@au1.ibm.com \
--cc=arnd@arndb.de \
--cc=fbarrat@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=groug@kaod.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.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).