From: Dmitry Safonov <dima@arista.com>
To: linux-kernel@vger.kernel.org
Cc: 0x7f454c46@gmail.com, Dmitry Safonov <dima@arista.com>,
Alex Williamson <alex.williamson@redhat.com>,
David Woodhouse <dwmw2@infradead.org>,
Ingo Molnar <mingo@kernel.org>, Joerg Roedel <joro@8bytes.org>,
Lu Baolu <baolu.lu@linux.intel.com>,
iommu@lists.linux-foundation.org
Subject: [PATCHv2 5/6] iommu/intel: Rename dmar_fault() => dmar_serve_faults()
Date: Mon, 12 Feb 2018 16:48:24 +0000 [thread overview]
Message-ID: <20180212164825.22421-6-dima@arista.com> (raw)
In-Reply-To: <20180212164825.22421-1-dima@arista.com>
Fix the return value, parameters and a bit better naming.
Signed-off-by: Dmitry Safonov <dima@arista.com>
---
drivers/iommu/dmar.c | 8 +++-----
drivers/iommu/intel-iommu.c | 2 +-
drivers/iommu/intel_irq_remapping.c | 2 +-
include/linux/dmar.h | 2 +-
4 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index 34a53aeede38..37a1147a7592 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -1635,9 +1635,8 @@ static void clear_primary_faults(struct intel_iommu *iommu)
}
#define PRIMARY_FAULT_REG_LEN (16)
-irqreturn_t dmar_fault(int irq, void *dev_id)
+void dmar_serve_faults(struct intel_iommu *iommu)
{
- struct intel_iommu *iommu = dev_id;
int reg, fault_index;
u32 fault_status;
unsigned long flag;
@@ -1706,14 +1705,13 @@ irqreturn_t dmar_fault(int irq, void *dev_id)
unlock_exit:
raw_spin_unlock_irqrestore(&iommu->register_lock, flag);
- return IRQ_HANDLED;
}
static void dmar_fault_work(struct work_struct *work)
{
struct fault *fault = container_of(work, struct fault, work);
- dmar_fault(-1, (void*)fault->iommu);
+ dmar_serve_faults(fault->iommu);
}
static irqreturn_t dmar_fault_handler(int irq, void *dev_id)
@@ -1786,7 +1784,7 @@ int __init enable_drhd_fault_handling(void)
/*
* Clear any previous faults.
*/
- dmar_fault(iommu->irq, iommu);
+ dmar_serve_faults(iommu);
fault_status = readl(iommu->reg + DMAR_FSTS_REG);
writel(fault_status, iommu->reg + DMAR_FSTS_REG);
}
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 64ad9786f5b9..3b55376b3b46 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -3015,7 +3015,7 @@ static void intel_iommu_init_qi(struct intel_iommu *iommu)
/*
* Clear any previous faults.
*/
- dmar_fault(-1, iommu);
+ dmar_serve_faults(iommu);
/*
* Disable queued invalidation if supported and already enabled
* before OS handover.
diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c
index 66f69af2c219..0958fdc76564 100644
--- a/drivers/iommu/intel_irq_remapping.c
+++ b/drivers/iommu/intel_irq_remapping.c
@@ -558,7 +558,7 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu)
/*
* Clear previous faults.
*/
- dmar_fault(-1, iommu);
+ dmar_serve_faults(iommu);
dmar_disable_qi(iommu);
if (dmar_enable_qi(iommu)) {
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index 5de4932a6ad8..6e9a5e4ac73a 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -280,7 +280,7 @@ extern void dmar_msi_mask(struct irq_data *data);
extern void dmar_msi_read(int irq, struct msi_msg *msg);
extern void dmar_msi_write(int irq, struct msi_msg *msg);
extern int dmar_set_interrupt(struct intel_iommu *iommu);
-extern irqreturn_t dmar_fault(int irq, void *dev_id);
+extern void dmar_serve_faults(struct intel_iommu *iommu);
extern int dmar_alloc_hwirq(int id, int node, void *arg);
extern void dmar_free_hwirq(int irq);
--
2.13.6
next prev parent reply other threads:[~2018-02-12 16:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-12 16:48 [PATCHv2 0/6] iommu/intel: Handle DMAR faults in a wq Dmitry Safonov
2018-02-12 16:48 ` [PATCHv2 1/6] iommu/intel: Add __init for dmar_register_bus_notifier() Dmitry Safonov
2018-02-12 16:48 ` [PATCHv2 2/6] iommu/intel: Clean/document fault status flags Dmitry Safonov
2018-02-12 16:48 ` [PATCHv2 3/6] iommu/intel: Introduce clear_primary_faults() helper Dmitry Safonov
2018-02-12 16:48 ` [PATCHv2 4/6] iommu/intel: Handle DMAR faults on workqueue Dmitry Safonov
2018-02-13 16:35 ` Joerg Roedel
2018-02-13 17:38 ` Dmitry Safonov
2018-02-15 19:09 ` Dmitry Safonov
2018-02-12 16:48 ` Dmitry Safonov [this message]
2018-02-12 16:48 ` [PATCHv2 6/6] iommu/intel: Ratelimit each dmar fault printing Dmitry Safonov
2018-02-12 17:26 ` [PATCHv3 " Dmitry Safonov
2018-02-13 16:44 ` [PATCHv2 0/6] iommu/intel: Handle DMAR faults in a wq Joerg Roedel
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=20180212164825.22421-6-dima@arista.com \
--to=dima@arista.com \
--cc=0x7f454c46@gmail.com \
--cc=alex.williamson@redhat.com \
--cc=baolu.lu@linux.intel.com \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@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 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).