From: Julien Grall <julien.grall@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Keir Fraser <keir@xen.org>,
ian.campbell@citrix.com, Julien Grall <julien.grall@linaro.org>,
tim@xen.org, stefano.stabellini@citrix.com,
Jan Beulich <jbeulich@suse.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
Xiantao Zhang <xiantao.zhang@intel.com>
Subject: [PATCH v4 17/18] xen/arm: IRQ: extend {request, setup}_irq to take an irqflags in parameter
Date: Tue, 22 Apr 2014 13:58:49 +0100 [thread overview]
Message-ID: <1398171530-27391-18-git-send-email-julien.grall@linaro.org> (raw)
In-Reply-To: <1398171530-27391-1-git-send-email-julien.grall@linaro.org>
The irqflags will be used later on ARM to know if we can shared the IRQ or not.
On x86, the irqflags should always be 0.
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: Xiantao Zhang <xiantao.zhang@intel.com>
---
Changes in v4:
- request_irq should pass irqflags to setup irq on x86
Changes in v3:
- Patch added
---
xen/arch/arm/gic.c | 2 +-
xen/arch/arm/irq.c | 6 +++---
xen/arch/arm/time.c | 6 +++---
xen/arch/x86/hpet.c | 2 +-
xen/arch/x86/i8259.c | 2 +-
xen/arch/x86/irq.c | 9 ++++++---
xen/arch/x86/time.c | 2 +-
xen/drivers/char/exynos4210-uart.c | 2 +-
xen/drivers/char/ns16550.c | 2 +-
xen/drivers/char/omap-uart.c | 2 +-
xen/drivers/char/pl011.c | 2 +-
xen/drivers/passthrough/amd/iommu_init.c | 2 +-
xen/drivers/passthrough/vtd/iommu.c | 2 +-
xen/include/xen/irq.h | 5 +++--
14 files changed, 25 insertions(+), 21 deletions(-)
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index cb40b0a..39f9621 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -885,7 +885,7 @@ void gic_dump_info(struct vcpu *v)
void __cpuinit init_maintenance_interrupt(void)
{
- request_irq(gic.maintenance_irq, maintenance_interrupt,
+ request_irq(gic.maintenance_irq, 0, maintenance_interrupt,
"irq-maintenance", NULL);
}
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 45fbadb..1bc960d 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -117,7 +117,7 @@ static inline struct domain *irq_get_domain(struct irq_desc *desc)
return desc->action->dev_id;
}
-int request_irq(unsigned int irq,
+int request_irq(unsigned int irq, unsigned int irqflags,
void (*handler)(int, void *, struct cpu_user_regs *),
const char *devname, void *dev_id)
{
@@ -144,7 +144,7 @@ int request_irq(unsigned int irq,
action->dev_id = dev_id;
action->free_on_release = 1;
- retval = setup_irq(irq, action);
+ retval = setup_irq(irq, irqflags, action);
if ( retval )
xfree(action);
@@ -252,7 +252,7 @@ static int __setup_irq(struct irq_desc *desc, struct irqaction *new)
return 0;
}
-int setup_irq(unsigned int irq, struct irqaction *new)
+int setup_irq(unsigned int irq, unsigned int irqflags, struct irqaction *new)
{
int rc;
unsigned long flags;
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 0bff747..81452b5 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -237,11 +237,11 @@ void __cpuinit init_timer_interrupt(void)
WRITE_SYSREG32(0, CNTHP_CTL_EL2); /* Hypervisor's timer disabled */
isb();
- request_irq(timer_irq[TIMER_HYP_PPI], timer_interrupt,
+ request_irq(timer_irq[TIMER_HYP_PPI], 0, timer_interrupt,
"hyptimer", NULL);
- request_irq(timer_irq[TIMER_VIRT_PPI], vtimer_interrupt,
+ request_irq(timer_irq[TIMER_VIRT_PPI], 0, vtimer_interrupt,
"virtimer", NULL);
- request_irq(timer_irq[TIMER_PHYS_NONSECURE_PPI], timer_interrupt,
+ request_irq(timer_irq[TIMER_PHYS_NONSECURE_PPI], 0, timer_interrupt,
"phytimer", NULL);
}
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 3a4f7e8..0b13f52 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -355,7 +355,7 @@ static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)
hpet_write32(cfg, HPET_Tn_CFG(ch->idx));
desc->handler = &hpet_msi_type;
- ret = request_irq(ch->msi.irq, hpet_interrupt_handler, "HPET", ch);
+ ret = request_irq(ch->msi.irq, 0, hpet_interrupt_handler, "HPET", ch);
if ( ret >= 0 )
ret = __hpet_setup_msi_irq(desc);
if ( ret < 0 )
diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c
index 6fdcce8..a0270c9 100644
--- a/xen/arch/x86/i8259.c
+++ b/xen/arch/x86/i8259.c
@@ -435,6 +435,6 @@ void __init init_IRQ(void)
outb_p(LATCH & 0xff, PIT_CH0); /* LSB */
outb(LATCH >> 8, PIT_CH0); /* MSB */
- setup_irq(2, &cascade);
+ setup_irq(2, 0, &cascade);
}
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 727472d..dafd338 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -949,7 +949,7 @@ static int __init irq_ratelimit_init(void)
}
__initcall(irq_ratelimit_init);
-int __init request_irq(unsigned int irq,
+int __init request_irq(unsigned int irq, unsigned int irqflags,
void (*handler)(int, void *, struct cpu_user_regs *),
const char * devname, void *dev_id)
{
@@ -976,7 +976,7 @@ int __init request_irq(unsigned int irq,
action->dev_id = dev_id;
action->free_on_release = 1;
- retval = setup_irq(irq, action);
+ retval = setup_irq(irq, irqflags, action);
if (retval)
xfree(action);
@@ -1005,11 +1005,14 @@ void __init release_irq(unsigned int irq, const void *dev_id)
xfree(action);
}
-int __init setup_irq(unsigned int irq, struct irqaction *new)
+int __init setup_irq(unsigned int irq, unsigned int irqflags,
+ struct irqaction *new)
{
struct irq_desc *desc;
unsigned long flags;
+ ASSERT(irqflags == 0);
+
desc = irq_to_desc(irq);
spin_lock_irqsave(&desc->lock,flags);
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 93bb5b6..c339f92 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1473,7 +1473,7 @@ void __init early_time_init(void)
printk("Detected %lu.%03lu MHz processor.\n",
cpu_khz / 1000, cpu_khz % 1000);
- setup_irq(0, &irq0);
+ setup_irq(0, 0, &irq0);
}
/* keep pit enabled for pit_broadcast working while cpuidle enabled */
diff --git a/xen/drivers/char/exynos4210-uart.c b/xen/drivers/char/exynos4210-uart.c
index 74ee578..76c0d7e 100644
--- a/xen/drivers/char/exynos4210-uart.c
+++ b/xen/drivers/char/exynos4210-uart.c
@@ -197,7 +197,7 @@ static void __init exynos4210_uart_init_postirq(struct serial_port *port)
uart->irqaction.name = "exynos4210_uart";
uart->irqaction.dev_id = port;
- if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
+ if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
dprintk(XENLOG_ERR, "Failed to allocated exynos4210_uart IRQ %d\n",
uart->irq);
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 6691806..161b251 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -609,7 +609,7 @@ static void __init ns16550_init_postirq(struct serial_port *port)
uart->irqaction.handler = ns16550_interrupt;
uart->irqaction.name = "ns16550";
uart->irqaction.dev_id = port;
- if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
+ if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
printk("ERROR: Failed to allocate ns16550 IRQ %d\n", uart->irq);
}
diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c
index e598785..a798b8d 100644
--- a/xen/drivers/char/omap-uart.c
+++ b/xen/drivers/char/omap-uart.c
@@ -205,7 +205,7 @@ static void __init omap_uart_init_postirq(struct serial_port *port)
uart->irqaction.name = "omap_uart";
uart->irqaction.dev_id = port;
- if ( setup_irq(uart->irq, &uart->irqaction) != 0 )
+ if ( setup_irq(uart->irq, 0, &uart->irqaction) != 0 )
{
dprintk(XENLOG_ERR, "Failed to allocated omap_uart IRQ %d\n",
uart->irq);
diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
index 89bda94..dd19ce8 100644
--- a/xen/drivers/char/pl011.c
+++ b/xen/drivers/char/pl011.c
@@ -137,7 +137,7 @@ static void __init pl011_init_postirq(struct serial_port *port)
uart->irqaction.handler = pl011_interrupt;
uart->irqaction.name = "pl011";
uart->irqaction.dev_id = port;
- if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
+ if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
printk("ERROR: Failed to allocate pl011 IRQ %d\n", uart->irq);
}
diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index 4686813..6ae44d9 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -815,7 +815,7 @@ static bool_t __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
handler = &iommu_msi_type;
ret = __setup_msi_irq(irq_to_desc(irq), &iommu->msi, handler);
if ( !ret )
- ret = request_irq(irq, iommu_interrupt_handler, "amd_iommu", iommu);
+ ret = request_irq(irq, 0, iommu_interrupt_handler, "amd_iommu", iommu);
if ( ret )
{
destroy_irq(irq);
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index abaa8c9..c94b0d1 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1082,7 +1082,7 @@ static int __init iommu_set_interrupt(struct acpi_drhd_unit *drhd)
desc = irq_to_desc(irq);
desc->handler = &dma_msi_type;
- ret = request_irq(irq, iommu_page_fault, "dmar", iommu);
+ ret = request_irq(irq, 0, iommu_page_fault, "dmar", iommu);
if ( ret )
{
desc->handler = &no_irq_type;
diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index 1f8bdb3..f9a18d8 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -89,9 +89,10 @@ int arch_init_one_irq_desc(struct irq_desc *);
#define irq_desc_initialized(desc) ((desc)->handler != NULL)
-extern int setup_irq(unsigned int irq, struct irqaction *);
+extern int setup_irq(unsigned int irq, unsigned int irqflags,
+ struct irqaction *);
extern void release_irq(unsigned int irq, const void *dev_id);
-extern int request_irq(unsigned int irq,
+extern int request_irq(unsigned int irq, unsigned int irqflags,
void (*handler)(int, void *, struct cpu_user_regs *),
const char * devname, void *dev_id);
--
1.7.10.4
next prev parent reply other threads:[~2014-04-22 12:59 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-22 12:58 [PATCH v4 00/18] xen/arm: Interrupt management reworking Julien Grall
2014-04-22 12:58 ` [PATCH v4 01/18] xen/arm: timer: replace timer_dt_irq by timer_get_irq Julien Grall
2014-04-22 12:58 ` [PATCH v4 02/18] xen/arm: IRQ: Use default irq callback from common code for no_irq_type Julien Grall
2014-04-22 12:58 ` [PATCH v4 03/18] xen/arm: IRQ: Rename irq_cfg into arch_irq_desc Julien Grall
2014-04-22 12:58 ` [PATCH v4 04/18] xen/arm: IRQ: move gic {, un}lock in gic_set_irq_properties Julien Grall
2014-04-22 12:58 ` [PATCH v4 05/18] xen/arm: IRQ: drop irq parameter in __setup_irq Julien Grall
2014-04-22 12:58 ` [PATCH v4 06/18] xen/arm: IRQ: remove __init from setup_dt_irq, request_dt_irq and release_irq Julien Grall
2014-04-22 12:58 ` [PATCH v4 07/18] xen/arm: IRQ: Rework gic_route_irq_to_guest function Julien Grall
2014-04-22 12:58 ` [PATCH v4 08/18] xen/arm: IRQ: Move IRQ management from gic.c to irq.c Julien Grall
2014-04-22 12:58 ` [PATCH v4 09/18] xen/arm: IRQ Introduce irq_get_domain Julien Grall
2014-04-22 12:58 ` [PATCH v4 10/18] xen/arm: IRQ: Require desc.lock be held by callers of hw_irq_controller callbacks Julien Grall
2014-04-22 12:58 ` [PATCH v4 11/18] xen/arm: IRQ: Defer routing IRQ to Xen until setup_irq() call Julien Grall
2014-04-22 12:58 ` [PATCH v4 12/18] xen/arm: IRQ: Do not allow IRQ to be shared between domains and XEN Julien Grall
2014-04-22 12:58 ` [PATCH v4 13/18] xen/serial: remove serial_dt_irq Julien Grall
2014-04-22 12:58 ` [PATCH v4 14/18] xen/arm: IRQ: Store IRQ type in arch_irq_desc Julien Grall
2014-04-23 12:26 ` Julien Grall
2014-04-23 14:04 ` Ian Campbell
2014-05-02 8:49 ` Julien Grall
2014-05-02 8:57 ` Ian Campbell
2014-05-02 9:00 ` Julien Grall
2014-04-22 12:58 ` [PATCH v4 15/18] xen/arm: IRQ: Replace {request, setup}_dt_irq by {request, setup}_irq Julien Grall
2014-04-22 13:26 ` Julien Grall
2014-04-22 12:58 ` [PATCH v4 16/18] xen: IRQ: Add dev_id parameter to release_irq Julien Grall
2014-04-22 12:58 ` Julien Grall [this message]
2014-04-22 12:58 ` [PATCH v4 18/18] xen/arm: IRQ: Handle multiple action per IRQ Julien Grall
2014-04-22 13:36 ` Jan Beulich
2014-04-23 14:07 ` Ian Campbell
2014-04-23 14:56 ` Julien Grall
2014-04-23 15:16 ` Ian Campbell
2014-04-23 15:28 ` Julien Grall
2014-04-23 15:28 ` Julien Grall
2014-05-02 8:52 ` [PATCH v4 00/18] xen/arm: Interrupt management reworking Julien Grall
2014-05-02 12:51 ` Ian Campbell
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=1398171530-27391-18-git-send-email-julien.grall@linaro.org \
--to=julien.grall@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=stefano.stabellini@citrix.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.org \
--cc=xiantao.zhang@intel.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).