From patchwork Sun Jul 12 22:01:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 6773351 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4C6219F2F0 for ; Sun, 12 Jul 2015 22:02:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 506982056E for ; Sun, 12 Jul 2015 22:02:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3CD1620569 for ; Sun, 12 Jul 2015 22:02:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751958AbbGLWCD (ORCPT ); Sun, 12 Jul 2015 18:02:03 -0400 Received: from mail-ig0-f179.google.com ([209.85.213.179]:34900 "EHLO mail-ig0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751915AbbGLWB6 (ORCPT ); Sun, 12 Jul 2015 18:01:58 -0400 Received: by igcqs7 with SMTP id qs7so45073371igc.0 for ; Sun, 12 Jul 2015 15:01:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=G/0r62PaWXJ1YHagQIHY9T7i+OYlTDLsPqktueROlqs=; b=afWXACq1nDA5pGvjM74RmDBOohFf2tKJJF9xXxobtmVRwIo4GCrLrq5wU/PHYYUls8 VKuAS4K6GwqKC9BRRnR1LQOJSQKMhCDaYmMBUILo6wPnK/E7Cc4mfV1aQwe7ug79WfHO afFPuhsBkF3m+EJ1B9LnAmE1Jr0P2QphNPQ1S15ofWrm3qSrWRzLzWOfr3r3opQNQDKO twBjjjV0PZ5PAfL2uwVn5IXHB9QZ/Ek/yTep75teOL0pQZrOcyx5hyEAyNjKujE7VmoD 8wdreAkXQkXY+mQGKh5ioo9RwJCDBdAAEibS/gSRLyTCiFR546bKGjf9eI3pj33RQI28 ysig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=G/0r62PaWXJ1YHagQIHY9T7i+OYlTDLsPqktueROlqs=; b=OB/gq2ABKg5tPJA1hsKCpbTNfDvF/PLfKXuCOVSC51BBs9uLE5Le9UKjh3TnEDLIDE F/Ux2AW4yLCY+IhMUVsdjm1sOwpyBYEv82nnDbUdNQt6nJOSbkJMyAR9tSIGVB5zk+Ki CMbp8lFFQSVokvsI5vOOgp9PDufKRW3iOWOoRiEDacTTgawQJdMx+ZwE0Yq1uJtanANc MoLhz5YPrRJzlLC8fCiHjDUBZls2O6KVHphRjeLE5Cn+0hjusD+Vm6U0WwCkrMndMe/G InOg7HnGtKmTrNG02h5u2AgSjM3FnGYn1O8Ln3uZzqVLLfvh6QKgoPXJivIlTVtt5nlI /NFA== X-Gm-Message-State: ALoCoQlLR3Bwr8EJWUwLQO9JQkxO4vApiuHtGSCZ1/WhBE6IT6Fdor1pl+sU/dq3ZXXLdf5Cyj/8 X-Received: by 10.50.79.169 with SMTP id k9mr9511550igx.44.1436738517530; Sun, 12 Jul 2015 15:01:57 -0700 (PDT) Received: from localhost ([69.71.1.1]) by smtp.gmail.com with ESMTPSA id j20sm4393114igt.5.2015.07.12.15.01.55 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 12 Jul 2015 15:01:55 -0700 (PDT) Subject: [PATCH 1/3] x86, irq: Rename VECTOR_UNDEFINED and VECTOR_RETRIGGERED to IRQ_* To: Thomas Gleixner From: Bjorn Helgaas Cc: linux-arch@vger.kernel.org, linux-mips@linux-mips.org, linux-am33-list@redhat.com, linux-ia64@vger.kernel.org, linux-c6x-dev@linux-c6x.org, linux-parisc@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, adi-buildroot-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-alpha@vger.kernel.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org Date: Sun, 12 Jul 2015 17:01:54 -0500 Message-ID: <20150712220154.7166.48327.stgit@bhelgaas-glaptop2.roam.corp.google.com> In-Reply-To: <20150712215559.7166.33068.stgit@bhelgaas-glaptop2.roam.corp.google.com> References: <20150712215559.7166.33068.stgit@bhelgaas-glaptop2.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SUSPICIOUS_RECIPS, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The per-cpu vector_irq[] table is indexed by CPU vector numbers, and each entry contains an IRQ number. Rename the special values VECTOR_UNDEFINED and VECTOR_RETRIGGERED to IRQ_UNDEFINED and IRQ_RETRIGGERED to indicate that they are in the IRQ number space, not the CPU vector number space. No functional change. Signed-off-by: Bjorn Helgaas --- arch/x86/include/asm/hw_irq.h | 4 ++-- arch/x86/kernel/apic/vector.c | 14 +++++++------- arch/x86/kernel/irq.c | 12 ++++++------ arch/x86/kernel/irqinit.c | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h index 6615032..b51a1ca 100644 --- a/arch/x86/include/asm/hw_irq.h +++ b/arch/x86/include/asm/hw_irq.h @@ -182,8 +182,8 @@ extern char irq_entries_start[]; #define trace_irq_entries_start irq_entries_start #endif -#define VECTOR_UNDEFINED (-1) -#define VECTOR_RETRIGGERED (-2) +#define IRQ_UNDEFINED (-1) +#define IRQ_RETRIGGERED (-2) typedef int vector_irq_t[NR_VECTORS]; DECLARE_PER_CPU(vector_irq_t, vector_irq); diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c index 28eba2d..8ae84b4 100644 --- a/arch/x86/kernel/apic/vector.c +++ b/arch/x86/kernel/apic/vector.c @@ -170,7 +170,7 @@ next: for_each_cpu_and(new_cpu, vector_cpumask, cpu_online_mask) { if (per_cpu(vector_irq, new_cpu)[vector] > - VECTOR_UNDEFINED) + IRQ_UNDEFINED) goto next; } /* Found one! */ @@ -232,7 +232,7 @@ static void clear_irq_vector(int irq, struct apic_chip_data *data) vector = data->cfg.vector; for_each_cpu_and(cpu, data->domain, cpu_online_mask) - per_cpu(vector_irq, cpu)[vector] = VECTOR_UNDEFINED; + per_cpu(vector_irq, cpu)[vector] = IRQ_UNDEFINED; data->cfg.vector = 0; cpumask_clear(data->domain); @@ -247,7 +247,7 @@ static void clear_irq_vector(int irq, struct apic_chip_data *data) vector++) { if (per_cpu(vector_irq, cpu)[vector] != irq) continue; - per_cpu(vector_irq, cpu)[vector] = VECTOR_UNDEFINED; + per_cpu(vector_irq, cpu)[vector] = IRQ_UNDEFINED; break; } } @@ -429,12 +429,12 @@ static void __setup_vector_irq(int cpu) /* Mark the free vectors */ for (vector = 0; vector < NR_VECTORS; ++vector) { irq = per_cpu(vector_irq, cpu)[vector]; - if (irq <= VECTOR_UNDEFINED) + if (irq <= IRQ_UNDEFINED) continue; data = apic_chip_data(irq_get_irq_data(irq)); if (!cpumask_test_cpu(cpu, data->domain)) - per_cpu(vector_irq, cpu)[vector] = VECTOR_UNDEFINED; + per_cpu(vector_irq, cpu)[vector] = IRQ_UNDEFINED; } raw_spin_unlock(&vector_lock); } @@ -553,7 +553,7 @@ asmlinkage __visible void smp_irq_move_cleanup_interrupt(void) irq = __this_cpu_read(vector_irq[vector]); - if (irq <= VECTOR_UNDEFINED) + if (irq <= IRQ_UNDEFINED) continue; desc = irq_to_desc(irq); @@ -589,7 +589,7 @@ asmlinkage __visible void smp_irq_move_cleanup_interrupt(void) apic->send_IPI_self(IRQ_MOVE_CLEANUP_VECTOR); goto unlock; } - __this_cpu_write(vector_irq[vector], VECTOR_UNDEFINED); + __this_cpu_write(vector_irq[vector], IRQ_UNDEFINED); unlock: raw_spin_unlock(&desc->lock); } diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 88b36648..2949c6e 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -223,12 +223,12 @@ __visible unsigned int __irq_entry do_IRQ(struct pt_regs *regs) if (!handle_irq(irq, regs)) { ack_APIC_irq(); - if (irq != VECTOR_RETRIGGERED) { + if (irq != IRQ_RETRIGGERED) { pr_emerg_ratelimited("%s: %d.%d No irq handler for vector (irq %d)\n", __func__, smp_processor_id(), vector, irq); } else { - __this_cpu_write(vector_irq[vector], VECTOR_UNDEFINED); + __this_cpu_write(vector_irq[vector], IRQ_UNDEFINED); } } @@ -489,7 +489,7 @@ void fixup_irqs(void) for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) { unsigned int irr; - if (__this_cpu_read(vector_irq[vector]) <= VECTOR_UNDEFINED) + if (__this_cpu_read(vector_irq[vector]) <= IRQ_UNDEFINED) continue; irr = apic_read(APIC_IRR + (vector / 32 * 0x10)); @@ -502,12 +502,12 @@ void fixup_irqs(void) raw_spin_lock(&desc->lock); if (chip->irq_retrigger) { chip->irq_retrigger(data); - __this_cpu_write(vector_irq[vector], VECTOR_RETRIGGERED); + __this_cpu_write(vector_irq[vector], IRQ_RETRIGGERED); } raw_spin_unlock(&desc->lock); } - if (__this_cpu_read(vector_irq[vector]) != VECTOR_RETRIGGERED) - __this_cpu_write(vector_irq[vector], VECTOR_UNDEFINED); + if (__this_cpu_read(vector_irq[vector]) != IRQ_RETRIGGERED) + __this_cpu_write(vector_irq[vector], IRQ_UNDEFINED); } } #endif diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c index a3a5e15..fc1822d 100644 --- a/arch/x86/kernel/irqinit.c +++ b/arch/x86/kernel/irqinit.c @@ -52,7 +52,7 @@ static struct irqaction irq2 = { }; DEFINE_PER_CPU(vector_irq_t, vector_irq) = { - [0 ... NR_VECTORS - 1] = VECTOR_UNDEFINED, + [0 ... NR_VECTORS - 1] = IRQ_UNDEFINED, }; int vector_used_by_percpu_irq(unsigned int vector) @@ -60,7 +60,7 @@ int vector_used_by_percpu_irq(unsigned int vector) int cpu; for_each_online_cpu(cpu) { - if (per_cpu(vector_irq, cpu)[vector] > VECTOR_UNDEFINED) + if (per_cpu(vector_irq, cpu)[vector] > IRQ_UNDEFINED) return 1; }