From patchwork Mon Jun 27 11:26:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 9200401 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ACB2D60757 for ; Mon, 27 Jun 2016 11:29:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C62028549 for ; Mon, 27 Jun 2016 11:29:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 905A32857A; Mon, 27 Jun 2016 11:29:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0807628549 for ; Mon, 27 Jun 2016 11:29:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bHUi8-0005zf-KP; Mon, 27 Jun 2016 11:28:16 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bHUhb-0005YE-Qm for linux-arm-kernel@lists.infradead.org; Mon, 27 Jun 2016 11:27:45 +0000 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O9F00RULH5MEDB0@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 27 Jun 2016 20:27:22 +0900 (KST) X-AuditID: cbfee61b-f798b6d00000114d-c0-57710d9a11a6 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id DD.F1.04429.A9D01775; Mon, 27 Jun 2016 04:27:22 -0700 (MST) Received: from AMDC1976.DIGITAL.local ([106.120.53.102]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O9F0096JH4MNO40@mmp1.samsung.com>; Mon, 27 Jun 2016 20:27:22 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Nicolas Pitre , Lorenzo Pieralisi , Russell King , Viresh Kumar , Sudeep Holla Subject: [RFC PATCH 4/4] irqchip/gic: remove big.LITTLE switcher support Date: Mon, 27 Jun 2016 13:26:10 +0200 Message-id: <1467026770-5699-5-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1467026770-5699-1-git-send-email-b.zolnierkie@samsung.com> References: <1467026770-5699-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRmVeSWpSXmKPExsVy+t9jAd1ZvIXhBvvnqVpsnLGe1eL/4vVM Fo1LLrNYvH5haLHp8TVWi8u75rBZfO49wmjx5vcLdou/d/6xWUw/9pfN4szpS6wWmz+8ZLNY fmoHi8W157uYLTZvmspssfGrh4OAx5p5axg9Wpp72DwaDpxn8bhzbQ+bx7tz59g9Ni+p99hy tZ3Fo2/LKkaPz5vkAjijuGxSUnMyy1KL9O0SuDLOrlzFUvBBreLto1dMDYwN8l2MnBwSAiYS k9ZNZoawxSQu3FvP1sXIxSEksJRR4se8vUwQzi9GiQNXF7GCVLEJWElMbF/FCJIQEbjIKHHo 22wWEIdZYDWzxI8pc5lAqoQFPCRuzlnFDmKzCKhKXDk1AaybV8Bd4tDptYwQ++QkTh6bDBbn BKo/+OYFWK8QUM3SF+fYJjDyLmBkWMUokVqQXFCclJ5rlJdarlecmFtcmpeul5yfu4kRHNzP pHcwHt7lfohRgINRiYdXQ74gXIg1say4MvcQowQHs5IIrydPYbgQb0piZVVqUX58UWlOavEh RmkOFiVx3sf/14UJCaQnlqRmp6YWpBbBZJk4OKUaGLv+zPY3udtzkz/S64DmIhsdq91r7vTM NzBOOWUTxbrb8fDDHVGLp108c57pfOtm5jl1MyT7r83V6w36oFbU99BR+aqjb9PXj8qyXh9a 70iZ8O3Z7Bh5e1/zEZ6tUWuF+36LOgZbh+x/Vy0fvnf5999d31xXPNZPn2P4JPNwjNnFZo/m ORwZO5RYijMSDbWYi4oTAVa88t1qAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160627_042744_192953_8A80CE2D X-CRM114-Status: GOOD ( 18.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Martin , Jason Cooper , linux-pm@vger.kernel.org, Sudeep KarkadaNagesha , b.zolnierkie@samsung.com, "Rafael J. Wysocki" , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, Marc Zyngier , Thomas Gleixner , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Remove no longer needed big.LITTLE switcher support. Cc: Jason Cooper Cc: Marc Zyngier Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/irqchip/irq-gic.c | 137 ---------------------------------------------- 1 file changed, 137 deletions(-) diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 1de07eb..9237dd2 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -788,144 +788,7 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq) } #endif -#ifdef CONFIG_BL_SWITCHER -/* - * gic_send_sgi - send a SGI directly to given CPU interface number - * - * cpu_id: the ID for the destination CPU interface - * irq: the IPI number to send a SGI for - */ -void gic_send_sgi(unsigned int cpu_id, unsigned int irq) -{ - BUG_ON(cpu_id >= NR_GIC_CPU_IF); - cpu_id = 1 << cpu_id; - /* this always happens on GIC0 */ - writel_relaxed((cpu_id << 16) | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT); -} - -/* - * gic_get_cpu_id - get the CPU interface ID for the specified CPU - * - * @cpu: the logical CPU number to get the GIC ID for. - * - * Return the CPU interface ID for the given logical CPU number, - * or -1 if the CPU number is too large or the interface ID is - * unknown (more than one bit set). - */ -int gic_get_cpu_id(unsigned int cpu) -{ - unsigned int cpu_bit; - - if (cpu >= NR_GIC_CPU_IF) - return -1; - cpu_bit = gic_cpu_map[cpu]; - if (cpu_bit & (cpu_bit - 1)) - return -1; - return __ffs(cpu_bit); -} - -/* - * gic_migrate_target - migrate IRQs to another CPU interface - * - * @new_cpu_id: the CPU target ID to migrate IRQs to - * - * Migrate all peripheral interrupts with a target matching the current CPU - * to the interface corresponding to @new_cpu_id. The CPU interface mapping - * is also updated. Targets to other CPU interfaces are unchanged. - * This must be called with IRQs locally disabled. - */ -void gic_migrate_target(unsigned int new_cpu_id) -{ - unsigned int cur_cpu_id, gic_irqs, gic_nr = 0; - void __iomem *dist_base; - int i, ror_val, cpu = smp_processor_id(); - u32 val, cur_target_mask, active_mask; - - BUG_ON(gic_nr >= CONFIG_ARM_GIC_MAX_NR); - - dist_base = gic_data_dist_base(&gic_data[gic_nr]); - if (!dist_base) - return; - gic_irqs = gic_data[gic_nr].gic_irqs; - - cur_cpu_id = __ffs(gic_cpu_map[cpu]); - cur_target_mask = 0x01010101 << cur_cpu_id; - ror_val = (cur_cpu_id - new_cpu_id) & 31; - - raw_spin_lock(&irq_controller_lock); - - /* Update the target interface for this logical CPU */ - gic_cpu_map[cpu] = 1 << new_cpu_id; - - /* - * Find all the peripheral interrupts targetting the current - * CPU interface and migrate them to the new CPU interface. - * We skip DIST_TARGET 0 to 7 as they are read-only. - */ - for (i = 8; i < DIV_ROUND_UP(gic_irqs, 4); i++) { - val = readl_relaxed(dist_base + GIC_DIST_TARGET + i * 4); - active_mask = val & cur_target_mask; - if (active_mask) { - val &= ~active_mask; - val |= ror32(active_mask, ror_val); - writel_relaxed(val, dist_base + GIC_DIST_TARGET + i*4); - } - } - - raw_spin_unlock(&irq_controller_lock); - - /* - * Now let's migrate and clear any potential SGIs that might be - * pending for us (cur_cpu_id). Since GIC_DIST_SGI_PENDING_SET - * is a banked register, we can only forward the SGI using - * GIC_DIST_SOFTINT. The original SGI source is lost but Linux - * doesn't use that information anyway. - * - * For the same reason we do not adjust SGI source information - * for previously sent SGIs by us to other CPUs either. - */ - for (i = 0; i < 16; i += 4) { - int j; - val = readl_relaxed(dist_base + GIC_DIST_SGI_PENDING_SET + i); - if (!val) - continue; - writel_relaxed(val, dist_base + GIC_DIST_SGI_PENDING_CLEAR + i); - for (j = i; j < i + 4; j++) { - if (val & 0xff) - writel_relaxed((1 << (new_cpu_id + 16)) | j, - dist_base + GIC_DIST_SOFTINT); - val >>= 8; - } - } -} - -/* - * gic_get_sgir_physaddr - get the physical address for the SGI register - * - * REturn the physical address of the SGI register to be used - * by some early assembly code when the kernel is not yet available. - */ -static unsigned long gic_dist_physaddr; - -unsigned long gic_get_sgir_physaddr(void) -{ - if (!gic_dist_physaddr) - return 0; - return gic_dist_physaddr + GIC_DIST_SOFTINT; -} - -void __init gic_init_physaddr(struct device_node *node) -{ - struct resource res; - if (of_address_to_resource(node, 0, &res) == 0) { - gic_dist_physaddr = res.start; - pr_info("GIC physical location is %#lx\n", gic_dist_physaddr); - } -} - -#else #define gic_init_physaddr(node) do { } while (0) -#endif static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)