All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stuart Yoder <stuart.yoder@nxp.com>
To: <gregkh@linuxfoundation.org>
Cc: <german.rivera@nxp.com>, <devel@driverdev.osuosl.org>,
	<linux-kernel@vger.kernel.org>, <agraf@suse.de>, <arnd@arndb.de>,
	<leoyang.li@nxp.com>, Stuart Yoder <stuart.yoder@nxp.com>
Subject: [PATCH 10/11] staging: fsl-mc: properly set hwirq in msi set_desc
Date: Wed, 22 Jun 2016 16:40:51 -0500	[thread overview]
Message-ID: <1466631652-25731-11-git-send-email-stuart.yoder@nxp.com> (raw)
In-Reply-To: <1466631652-25731-1-git-send-email-stuart.yoder@nxp.com>

For an MSI domain the hwirq is an arbitrary but unique
id to identify an interrupt.  Previously the hwirq was set to
the MSI index of the interrupt, but that only works if there is
one DPRC.  Additional DPRCs require an expanded namespace.  Use
both the ICID (which is unique per DPRC) and the MSI index to
compose a hwirq value.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
---
 drivers/staging/fsl-mc/bus/mc-msi.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/fsl-mc/bus/mc-msi.c b/drivers/staging/fsl-mc/bus/mc-msi.c
index e202b2b..c7be156 100644
--- a/drivers/staging/fsl-mc/bus/mc-msi.c
+++ b/drivers/staging/fsl-mc/bus/mc-msi.c
@@ -20,11 +20,26 @@
 #include "../include/mc-sys.h"
 #include "dprc-cmd.h"
 
+/*
+ * Generate a unique ID identifying the interrupt (only used within the MSI
+ * irqdomain.  Combine the icid with the interrupt index.
+ */
+static irq_hw_number_t fsl_mc_domain_calc_hwirq(struct fsl_mc_device *dev,
+						struct msi_desc *desc)
+{
+	/*
+	 * Make the base hwirq value for ICID*10000 so it is readable
+	 * as a decimal value in /proc/interrupts.
+	 */
+	return (irq_hw_number_t)(desc->fsl_mc.msi_index + (dev->icid * 10000));
+}
+
 static void fsl_mc_msi_set_desc(msi_alloc_info_t *arg,
 				struct msi_desc *desc)
 {
 	arg->desc = desc;
-	arg->hwirq = (irq_hw_number_t)desc->fsl_mc.msi_index;
+	arg->hwirq = fsl_mc_domain_calc_hwirq(to_fsl_mc_device(desc->dev),
+					      desc);
 }
 
 static void fsl_mc_msi_update_dom_ops(struct msi_domain_info *info)
-- 
1.9.0

  parent reply	other threads:[~2016-06-22 22:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 21:40 [PATCH 00/11] staging: fsl-mc: module loading support, fixes, and cleanup Stuart Yoder
2016-06-22 21:40 ` [PATCH 01/11] staging: fsl-mc: add support for the modalias sysfs attribute Stuart Yoder
2016-06-22 21:40 ` [PATCH 02/11] staging: fsl-mc: implement uevent callback and set the modalias Stuart Yoder
2016-06-22 21:40 ` [PATCH 03/11] staging: fsl-mc: clean up the device id struct Stuart Yoder
2016-06-29 15:03   ` Matthias Brugger
2016-06-22 21:40 ` [PATCH 04/11] staging: fsl-mc: add support for device table matching Stuart Yoder
2016-06-22 21:40 ` [PATCH 05/11] staging: fsl-mc: export mc_get_version Stuart Yoder
2016-06-22 21:40 ` [PATCH 06/11] staging: fsl-mc: make fsl_mc_is_root_dprc() global Stuart Yoder
2016-06-29 14:17   ` Matthias Brugger
2016-06-29 14:25     ` Stuart Yoder
2016-06-29 15:01       ` Matthias Brugger
2016-06-22 21:40 ` [PATCH 07/11] staging: fsl-mc: fix asymmetry in destroy of mc_io Stuart Yoder
2016-06-22 21:40 ` [PATCH 08/11] staging: fsl-mc: dprc: add missing irq free Stuart Yoder
2016-06-22 21:40 ` [PATCH 09/11] staging: fsl-mc: dprc: fix ordering problem freeing resources in remove of dprc Stuart Yoder
2016-06-22 21:40 ` Stuart Yoder [this message]
2016-06-22 21:40 ` [PATCH 11/11] staging: fsl-mc: convert mc command build/parse to use C structs Stuart Yoder

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=1466631652-25731-11-git-send-email-stuart.yoder@nxp.com \
    --to=stuart.yoder@nxp.com \
    --cc=agraf@suse.de \
    --cc=arnd@arndb.de \
    --cc=devel@driverdev.osuosl.org \
    --cc=german.rivera@nxp.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=leoyang.li@nxp.com \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.