Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp144307imm; Thu, 27 Sep 2018 17:53:39 -0700 (PDT) X-Google-Smtp-Source: ACcGV63HaomoYWNBCWto+ZA8rR+DK61wYGs0iUyUeDKZUXGuV3DyjMGogv7QkOhzND6O6h5Z+iky X-Received: by 2002:a63:1566:: with SMTP id 38-v6mr12594126pgv.383.1538096019885; Thu, 27 Sep 2018 17:53:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538096019; cv=none; d=google.com; s=arc-20160816; b=TzOcssLpc9kOt7oO2Zrtz4qmIU5df3YkqrTIiWdz3r614Mm/+CBhHnG867VSp1lCXn PnAZe3VT1RYUlS7fNdNhwYiKUa5hasZkrWwx+RHM57MOQk5uNIxsvCIizYzHsJSgZdi6 Vxj2lt2w37snN9AusYuQJdIcTArWjksHccAKJc0J8/UOD45ChFX0ArPXmDlPpJ6Zm9ww GCukdsck9/mKdmejZYFERYePGsM+wua1yBj9+c6YILYRCuBSfbxC4fN5FmrxqUjsyBJM pDBGdmQB57PQEU+s+tNhqQF0WkA76dtEKDrPrW6xPyB8zcS5SCRX2OTCvluVGV/29GvC NSRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from; bh=Ez2gQqHSnnv+B7i5U7s9JzELn2IGSjLzMbTk0a5tdOM=; b=nAcGNLzCIzGgqj2OsAhoqWO8RDsOyxjKwuH5NvMUwQXz1pqe2xd/+day0oG/jrYVhX DJg5rlF97xTaNHXP7PRtPBpGSLVxU8i43NlEGgz3/FQV9DAMUqkKChuUxBgDqwclOdQp 8Mc0C3hkZ8vIT1XdjkWwWo+KP1fX9d3L1uQX4TodDChYbulPZiXqXHJE5B038ecrKUyf UHI5BR4WVR/2V4IIu8SLe95jcG+5eK5qwTPYAdFXuaIKv+Ng+ZaKkqkmbjLDFn5GNrVJ YUcv5mtgW9bRZcbwmN2itflpvrO7NL7iQj+FaqQV8YtT71Uts2XKhqBNvKUSqwKlCa2I aKMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e127-v6si3849706pfe.8.2018.09.27.17.53.23; Thu, 27 Sep 2018 17:53:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728920AbeI1HOA (ORCPT + 99 others); Fri, 28 Sep 2018 03:14:00 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:46975 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726100AbeI1HN7 (ORCPT ); Fri, 28 Sep 2018 03:13:59 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07439478|-1;CH=blue;FP=10375838790521194921|1|1|12|0|-1|-1|-1;HT=e02c03297;MF=ren_guo@c-sky.com;NM=1;PH=DS;RN=18;RT=18;SR=0;TI=SMTPD_---.CwkV9Xm_1538095933; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:SMTPD_---.CwkV9Xm_1538095933) by smtp.aliyun-inc.com(10.147.41.120); Fri, 28 Sep 2018 08:52:13 +0800 From: Guo Ren To: akpm@linux-foundation.org, arnd@arndb.de, daniel.lezcano@linaro.org, davem@davemloft.net, gregkh@linuxfoundation.org, jason@lakedaemon.net, marc.zyngier@arm.com, mark.rutland@arm.com, mchehab+samsung@kernel.org, peterz@infradead.org, robh@kernel.org, robh+dt@kernel.org, tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, devicetree@vger.kernel.org, green.hu@gmail.com, Guo Ren Subject: [PATCH V6 21/33] csky: remove irq_mapping from smp.c Date: Fri, 28 Sep 2018 08:51:18 +0800 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: <62098e7d0a7fbdd09f44d7e23333dad258a01bd2.1538058840.git.ren_guo@c-sky.com> References: <62098e7d0a7fbdd09f44d7e23333dad258a01bd2.1538058840.git.ren_guo@c-sky.com> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are some feedbacks from irqchip, and we need to adjust "smp.c & smp.h" to match the csky_mptimer modification. - Move IPI_IRQ define into drivers/irqchip/csky_mpintc.c, because it's a interrupt controller specific. - Bugfix request_irq with IPI_IRQ, we must use irq_mapping return value not directly use IPI_IRQ. The modification also involves csky_mpintc. Signed-off-by: Guo Ren --- arch/csky/include/asm/smp.h | 4 +++- arch/csky/kernel/smp.c | 27 +++++++++++++++++++-------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/arch/csky/include/asm/smp.h b/arch/csky/include/asm/smp.h index 9a53abf..f3e4f24 100644 --- a/arch/csky/include/asm/smp.h +++ b/arch/csky/include/asm/smp.h @@ -17,7 +17,9 @@ void arch_send_call_function_ipi_mask(struct cpumask *mask); void arch_send_call_function_single_ipi(int cpu); -void __init set_send_ipi(void (*func)(const unsigned long *, unsigned long)); +void __init set_send_ipi(void (*func)(const unsigned long *)); + +void __init set_ipi_irq_mapping(int (*func)(void)); #define raw_smp_processor_id() (current_thread_info()->cpu) diff --git a/arch/csky/kernel/smp.c b/arch/csky/kernel/smp.c index 522c73f..14877e2 100644 --- a/arch/csky/kernel/smp.c +++ b/arch/csky/kernel/smp.c @@ -20,8 +20,6 @@ #include #include -#define IPI_IRQ 15 - static struct { unsigned long bits ____cacheline_aligned; } ipi_data[NR_CPUS] __cacheline_aligned; @@ -56,9 +54,9 @@ static irqreturn_t handle_ipi(int irq, void *dev) return IRQ_HANDLED; } -static void (*send_arch_ipi)(const unsigned long *mask, unsigned long irq) = NULL; +static void (*send_arch_ipi)(const unsigned long *mask) = NULL; -void __init set_send_ipi(void (*func)(const unsigned long *, unsigned long)) +void __init set_send_ipi(void (*func)(const unsigned long *)) { if (send_arch_ipi) return; @@ -75,7 +73,7 @@ send_ipi_message(const struct cpumask *to_whom, enum ipi_message_type operation) set_bit(operation, &ipi_data[i].bits); smp_mb(); - send_arch_ipi(cpumask_bits(to_whom), IPI_IRQ); + send_arch_ipi(cpumask_bits(to_whom)); } void arch_send_call_function_ipi_mask(struct cpumask *mask) @@ -115,19 +113,32 @@ void __init smp_prepare_cpus(unsigned int max_cpus) } static int ipi_dummy_dev; +static int ipi_irq; void __init enable_smp_ipi(void) { - enable_percpu_irq(IPI_IRQ, 0); + enable_percpu_irq(ipi_irq, 0); +} + +static int (*arch_ipi_irq_mapping)(void) = NULL; + +void __init set_ipi_irq_mapping(int (*func)(void)) +{ + if (arch_ipi_irq_mapping) + return; + + arch_ipi_irq_mapping = func; } void __init setup_smp_ipi(void) { int rc; - irq_create_mapping(NULL, IPI_IRQ); + ipi_irq = arch_ipi_irq_mapping(); + if (ipi_irq == 0) + panic("%s IRQ mapping failed\n", __func__); - rc = request_percpu_irq(IPI_IRQ, handle_ipi, "IPI Interrupt", &ipi_dummy_dev); + rc = request_percpu_irq(ipi_irq, handle_ipi, "IPI Interrupt", &ipi_dummy_dev); if (rc) panic("%s IRQ request failed\n", __func__); -- 2.7.4