Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5256582imm; Tue, 18 Sep 2018 06:49:19 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbJOAZwM/AWfpuSiN2SUl9lnXCtv8LSbhK5xCZm+dfWo2/5i0Jf0IFr/MQsagR9wVagI5vp X-Received: by 2002:a17:902:e088:: with SMTP id cb8-v6mr29604237plb.189.1537278559750; Tue, 18 Sep 2018 06:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537278559; cv=none; d=google.com; s=arc-20160816; b=RHVQnC1JEJhxdzaSmMyVyP5UOlaGrXPv3z0/ngz8Ty6RVixVjxLsYfcMK0oM7f6svP 4IS2GXuaNOaC19i2InfKYn+EN1nNmdr4BvSdYGOJbBRfvjf3x1kRa1YpR4aretmN/Ewz O2GX/emKeM48g2eJ/FEyHVrn16Ey1kWTcUUWd/63UgOFUb0zwtDchv+4rHFc8U/OtKDL 31/xz/3KHuI3hGEwmwBLLcT6SAUtfhIu2iICaCeye07KLtErciBgQQ8Ccg714V4ysfK3 9IqpjSytI4d9qgn7hnY9xiCeXQQe4RBN5EniOvsetHMbFasZyC3aZQuOoTfnk2BVYsaf ixxA== 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=Vlq4W/bYNhJwQwGJtFSzRHvFvETZ+FiV7XzPSjldef0=; b=gz/QYmwu/Jb8tsRrfsszWbc2PWT84r8LdvlMNHIR5Hjz7mPWI8ctM5ZC/QoBledBVb aYJEoX4/jcNVJVEU99iZTIQm3vyd0sADSTV861lGMEYJ5qx3d8eNOrnwJBS02iqtxKDW vtCZuHB1Mq0nxGe6DKDWvN7H7Ay1Ylr+yR9ax1joLALbWfMFfPlDKsFP3ole9j070FpR /uQl7WPc9936vcJ9DF8GP4D5a7JZJBERrZ/NjRmLHWU289ivKh7RQ/3k4CFouGYOhTsY lxRMDJmv24/zZUq4XSavZvA5Er4G7mJ/hAH1ynXVGJJh8a85vKu1r4aMzmc7Pbe7jSv0 bmfw== 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 i8-v6si17847967pfo.128.2018.09.18.06.49.04; Tue, 18 Sep 2018 06:49:19 -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 S1730017AbeIRTVi (ORCPT + 99 others); Tue, 18 Sep 2018 15:21:38 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:44102 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729647AbeIRTVi (ORCPT ); Tue, 18 Sep 2018 15:21:38 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07484756|-1;CH=green;FP=9517861349875253737|1|1|1|0|-1|-1|-1;HT=e02c03298;MF=ren_guo@c-sky.com;NM=1;PH=DS;RN=15;RT=15;SR=0;TI=SMTPD_---.CsTjzPJ_1537278499; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:SMTPD_---.CsTjzPJ_1537278499) by smtp.aliyun-inc.com(10.147.42.241); Tue, 18 Sep 2018 21:48:20 +0800 From: Guo Ren To: tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com, robh+dt@kernel.org, mark.rutland@arm.com, arnd@arndb.de, robh@kernel.org, sfr@canb.auug.org.au Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arch@vger.kernel.org, c-sky_gcc_upstream@c-sky.com, gnu-csky@mentor.com, green.hu@gmail.com, Guo Ren Subject: [PATCH V7 2/2] csky: remove irq_mapping from smp.c. Date: Tue, 18 Sep 2018 21:48:14 +0800 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org - remove irq_mapping from smp.c to irq-driver - Add set_ipi_irq_mapping api to irq-driver - update asm/smp.h Signed-off-by: Guo Ren --- arch/csky/include/asm/smp.h | 4 ++++ arch/csky/kernel/smp.c | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/arch/csky/include/asm/smp.h b/arch/csky/include/asm/smp.h index 9a53abf..fed3a5a 100644 --- a/arch/csky/include/asm/smp.h +++ b/arch/csky/include/asm/smp.h @@ -7,6 +7,8 @@ #ifdef CONFIG_SMP +#define IPI_IRQ 15 + void __init setup_smp(void); void __init setup_smp_ipi(void); @@ -19,6 +21,8 @@ void arch_send_call_function_single_ipi(int cpu); void __init set_send_ipi(void (*func)(const unsigned long *, unsigned long)); +void __init set_ipi_irq_mapping(int (*func)(void)); + #define raw_smp_processor_id() (current_thread_info()->cpu) #endif /* CONFIG_SMP */ diff --git a/arch/csky/kernel/smp.c b/arch/csky/kernel/smp.c index 522c73f..f8343f6 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; @@ -121,13 +119,23 @@ void __init enable_smp_ipi(void) 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; + int rc, irq; - irq_create_mapping(NULL, IPI_IRQ); + irq = arch_ipi_irq_mapping(); - rc = request_percpu_irq(IPI_IRQ, handle_ipi, "IPI Interrupt", &ipi_dummy_dev); + rc = request_percpu_irq(irq, handle_ipi, "IPI Interrupt", &ipi_dummy_dev); if (rc) panic("%s IRQ request failed\n", __func__); -- 2.7.4