From patchwork Mon May 12 17:57:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 29989 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CFA32238EB for ; Mon, 12 May 2014 17:58:35 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id va2sf40815558obc.1 for ; Mon, 12 May 2014 10:58:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :list-archive:content-type:content-transfer-encoding; bh=ickLC8ETTfWYZTg2yp5CGyLrtAaMNP8TMYv3eUKYQWM=; b=O/Pc9usdzDiVqdTLmX6pBf6kBC5nisVchZTtjX5FcKXKfzFHsMaAXf/pFnzpmvJHuU 2bt1LRf3GzXDBq/4J2CcQpyvo39PnhNW5idtAWIxeDnvXl8qNwfnJ/FE/jDvRaHd0or1 rq7/s7J9/1Ju5ulmtUdSLpFfT6b/0cyEpLiGqQLRiy9BA4kmzzD0T1Gw2NE5nQvZHQAA t1pkhJl/f3vUdoSo0RTtqkuzsl3co+VicRwxFdJYinjP4yIlZL/7ivhkpsITV94ST2Xe IgXSwClNB0rjG1uBGFb4R15Q6bOGBTw09ybmCQL+YM+c2nAwTIsiuM4PGNUYR+6BIe3s nLOA== X-Gm-Message-State: ALoCoQnH4iEP5QWjFLodRSzLZ4jFZA4giEch+D0OJePtbzSM0kdGc6w9Ual65R7GrS4TQWrVW72F X-Received: by 10.50.254.1 with SMTP id ae1mr11591753igd.6.1399917515379; Mon, 12 May 2014 10:58:35 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.107.247 with SMTP id h110ls1555334qgf.44.gmail; Mon, 12 May 2014 10:58:35 -0700 (PDT) X-Received: by 10.52.229.197 with SMTP id ss5mr1515768vdc.83.1399917515151; Mon, 12 May 2014 10:58:35 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id 2si2192210vcb.124.2014.05.12.10.58.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 May 2014 10:58:35 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.179 as permitted sender) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id oy12so9174924veb.38 for ; Mon, 12 May 2014 10:58:35 -0700 (PDT) X-Received: by 10.58.123.71 with SMTP id ly7mr24371297veb.11.1399917515047; Mon, 12 May 2014 10:58:35 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp88696vcb; Mon, 12 May 2014 10:58:30 -0700 (PDT) X-Received: by 10.220.95.204 with SMTP id e12mr2079669vcn.37.1399917509627; Mon, 12 May 2014 10:58:29 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id an4si451015vdd.134.2014.05.12.10.58.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 12 May 2014 10:58:29 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WjuTt-0005iW-5r; Mon, 12 May 2014 17:57:41 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WjuTo-0005gN-9x for xen-devel@lists.xenproject.org; Mon, 12 May 2014 17:57:36 +0000 Received: from [193.109.254.147:26105] by server-2.bemta-14.messagelabs.com id 24/2B-21684-F8B01735; Mon, 12 May 2014 17:57:35 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-3.tower-27.messagelabs.com!1399917453!4270522!1 X-Originating-IP: [74.125.83.41] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, SUBJECT_RANDOMQ X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 25651 invoked from network); 12 May 2014 17:57:34 -0000 Received: from mail-ee0-f41.google.com (HELO mail-ee0-f41.google.com) (74.125.83.41) by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 12 May 2014 17:57:34 -0000 Received: by mail-ee0-f41.google.com with SMTP id t10so5054650eei.28 for ; Mon, 12 May 2014 10:57:33 -0700 (PDT) X-Received: by 10.15.45.130 with SMTP id b2mr34284118eew.28.1399917453731; Mon, 12 May 2014 10:57:33 -0700 (PDT) Received: from belegaer.uk.xensource.com ([185.25.64.249]) by mx.google.com with ESMTPSA id l3sm34404295eeo.43.2014.05.12.10.57.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 May 2014 10:57:31 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 12 May 2014 18:57:16 +0100 Message-Id: <1399917438-21475-6-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1399917438-21475-1-git-send-email-julien.grall@linaro.org> References: <1399917438-21475-1-git-send-email-julien.grall@linaro.org> Cc: Keir Fraser , ian.campbell@citrix.com, Julien Grall , tim@xen.org, stefano.stabellini@citrix.com, Jan Beulich , Suravee Suthikulpanit , Xiantao Zhang Subject: [Xen-devel] [PATCH v6 5/6] xen/arm: IRQ: extend {request, setup}_irq to take an irqflags in parameter X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: 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 Acked-by: Jan Beulich Acked-by: Ian Campbell Cc: Keir Fraser Cc: Suravee Suthikulpanit Cc: Xiantao Zhang --- 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 b9fa73d..ff1addc 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -887,7 +887,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 8e45b9e..5226b58 100644 --- a/xen/arch/arm/irq.c +++ b/xen/arch/arm/irq.c @@ -133,7 +133,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) { @@ -160,7 +160,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); @@ -268,7 +268,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 7eb480e..0395b7b 100644 --- a/xen/arch/arm/time.c +++ b/xen/arch/arm/time.c @@ -236,11 +236,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 9fec490..a71f734 100644 --- a/xen/arch/x86/i8259.c +++ b/xen/arch/x86/i8259.c @@ -433,6 +433,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 b2dbde7..a4e1656 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 404ce05..cba8729 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);