From patchwork Mon Dec 2 11:08:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 21924 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CA7AE23FCF for ; Mon, 2 Dec 2013 11:09:35 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id p10sf32867403pdj.11 for ; Mon, 02 Dec 2013 03:09:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=J4eYYAdumv5LTAqkByK0YAk1MivqZ+7blONZHbws1IY=; b=JWK5mex+DmgXAobQOmmWTopSDTx6YE/6eajdN15wNr4p1dl+GpQ+VbtHzbQ0tdIr1A kEH6VlvYOsSoB3Hfviwi58+kXohVJTcMAi8a6Oc1/CBQFljV+1I9SuLH5eF8s1ZoheeX nNnqwdLdrePBrI00C4UjmQOWkUVL8o2IFejxTLaiMAmZ3RgcJuUQtxHs4LO1LmJkmeje XHwQoHbjgphbUeFI53P991L3ojqXS3UZ1k7j9C93jQFJ3wnP6XLn+6UYf+Q14OqGSlNg Q9j/1Tz33jjYQfcss0FIkT7+Zeu8AASejuYiBHNkUfjzIlI6rItpGK5swFE0EM83leFA smFg== X-Gm-Message-State: ALoCoQkA4ymd0j9lIZyYEJz7KRZvYPlFY1oyaZswZaGsPdugbJ65Ph0pGmRG4+pMCt+5i1G8OhxM X-Received: by 10.66.137.43 with SMTP id qf11mr6197597pab.28.1385982574825; Mon, 02 Dec 2013 03:09:34 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.130.195 with SMTP id og3ls4729516qeb.62.gmail; Mon, 02 Dec 2013 03:09:34 -0800 (PST) X-Received: by 10.52.113.97 with SMTP id ix1mr5486107vdb.9.1385982574702; Mon, 02 Dec 2013 03:09:34 -0800 (PST) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id c8si29420192vcq.138.2013.12.02.03.09.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Dec 2013 03:09:34 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id ks9so8156711vcb.40 for ; Mon, 02 Dec 2013 03:09:34 -0800 (PST) X-Received: by 10.52.233.197 with SMTP id ty5mr22466vdc.48.1385982574513; Mon, 02 Dec 2013 03:09:34 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp110792vcz; Mon, 2 Dec 2013 03:09:33 -0800 (PST) X-Received: by 10.204.101.132 with SMTP id c4mr37387bko.165.1385982573064; Mon, 02 Dec 2013 03:09:33 -0800 (PST) Received: from mail-bk0-f48.google.com (mail-bk0-f48.google.com [209.85.214.48]) by mx.google.com with ESMTPS id qs9si12336755bkb.33.2013.12.02.03.09.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Dec 2013 03:09:32 -0800 (PST) Received-SPF: neutral (google.com: 209.85.214.48 is neither permitted nor denied by best guess record for domain of andre.przywara@linaro.org) client-ip=209.85.214.48; Received: by mail-bk0-f48.google.com with SMTP id v10so5325595bkz.35 for ; Mon, 02 Dec 2013 03:09:31 -0800 (PST) X-Received: by 10.205.64.209 with SMTP id xj17mr177728bkb.76.1385982571384; Mon, 02 Dec 2013 03:09:31 -0800 (PST) Received: from slackpad.drs.calxeda.com (f053082149.adsl.alicedsl.de. [78.53.82.149]) by mx.google.com with ESMTPSA id z6sm74390807bkn.8.2013.12.02.03.09.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Dec 2013 03:09:30 -0800 (PST) From: Andre Przywara To: Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com Cc: julien.grall@linaro.org, xen-devel@lists.xenproject.org, patches@linaro.org, Andre Przywara Subject: [PATCH v2 2/6] arm: move GIC SGI kicking into separate function Date: Mon, 2 Dec 2013 12:08:54 +0100 Message-Id: <1385982538-17855-3-git-send-email-andre.przywara@linaro.org> X-Mailer: git-send-email 1.7.12.1 In-Reply-To: <1385982538-17855-1-git-send-email-andre.przywara@linaro.org> References: <1385982538-17855-1-git-send-email-andre.przywara@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: andre.przywara@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Currently we unconditionally send SGIs to all cores on SMP bringup. PSCI will not need this, so we move this into a function and call it explicitly from the platforms that need it. This gets us get rid of the empty cpu_up() platform functions in ARM32 and the comment in there. Signed-off-by: Andre Przywara Acked-by: Julien Grall --- xen/arch/arm/arm64/smpboot.c | 2 +- xen/arch/arm/platform.c | 2 +- xen/arch/arm/platforms/exynos5.c | 11 +---------- xen/arch/arm/platforms/omap5.c | 11 +---------- xen/arch/arm/platforms/vexpress.c | 10 +--------- xen/arch/arm/smpboot.c | 15 ++++++++++----- xen/include/asm-arm/smp.h | 2 ++ 7 files changed, 17 insertions(+), 36 deletions(-) diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c index 8696ed6..6a34bd4 100644 --- a/xen/arch/arm/arm64/smpboot.c +++ b/xen/arch/arm/arm64/smpboot.c @@ -38,7 +38,7 @@ static int __init smp_spin_table_cpu_up(int cpu) sev(); - return 0; + return cpu_up_send_sgi(cpu); } static void __init smp_spin_table_init(int cpu, struct dt_device_node *dn) diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c index a7f9ee4..056d462 100644 --- a/xen/arch/arm/platform.c +++ b/xen/arch/arm/platform.c @@ -112,7 +112,7 @@ int __init platform_cpu_up(int cpu) if ( platform && platform->cpu_up ) return platform->cpu_up(cpu); - return -EAGAIN; + return -ENODEV; } int __init platform_smp_init(void) diff --git a/xen/arch/arm/platforms/exynos5.c b/xen/arch/arm/platforms/exynos5.c index 0e76cac..7880815 100644 --- a/xen/arch/arm/platforms/exynos5.c +++ b/xen/arch/arm/platforms/exynos5.c @@ -85,15 +85,6 @@ static int __init exynos5_smp_init(void) return 0; } -static int __init exynos5_cpu_up(int cpu) -{ - /* Nothing to do here, the generic sev() will suffice to kick CPUs - * out of either the firmware or our own smp_up_cpu gate, - * depending on where they have ended up. */ - - return 0; -} - static void exynos5_reset(void) { void __iomem *pmu; @@ -137,7 +128,7 @@ PLATFORM_START(exynos5, "SAMSUNG EXYNOS5") .init_time = exynos5_init_time, .specific_mapping = exynos5_specific_mapping, .smp_init = exynos5_smp_init, - .cpu_up = exynos5_cpu_up, + .cpu_up = cpu_up_send_sgi, .reset = exynos5_reset, .quirks = exynos5_quirks, .blacklist_dev = exynos5_blacklist_dev, diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c index 54fa5ff..4be8e8e 100644 --- a/xen/arch/arm/platforms/omap5.c +++ b/xen/arch/arm/platforms/omap5.c @@ -144,15 +144,6 @@ static int __init omap5_smp_init(void) return 0; } -static int __init omap5_cpu_up(int cpu) -{ - /* Nothing to do here, the generic sev() will suffice to kick CPUs - * out of either the firmware or our own smp_up_cpu gate, - * depending on where they have ended up. */ - - return 0; -} - static uint32_t omap5_quirks(void) { return PLATFORM_QUIRK_DOM0_MAPPING_11; @@ -169,7 +160,7 @@ PLATFORM_START(omap5, "TI OMAP5") .init_time = omap5_init_time, .specific_mapping = omap5_specific_mapping, .smp_init = omap5_smp_init, - .cpu_up = omap5_cpu_up, + .cpu_up = cpu_up_send_sgi, .quirks = omap5_quirks, PLATFORM_END diff --git a/xen/arch/arm/platforms/vexpress.c b/xen/arch/arm/platforms/vexpress.c index 9056366..6132056 100644 --- a/xen/arch/arm/platforms/vexpress.c +++ b/xen/arch/arm/platforms/vexpress.c @@ -144,14 +144,6 @@ static int __init vexpress_smp_init(void) return 0; } -static int __init vexpress_cpu_up(int cpu) -{ - /* Nothing to do here, the generic sev() will suffice to kick CPUs - * out of either the firmware or our own smp_up_cpu gate, - * depending on where they have ended up. */ - - return 0; -} #endif static const char * const vexpress_dt_compat[] __initconst = @@ -180,7 +172,7 @@ PLATFORM_START(vexpress, "VERSATILE EXPRESS") .compatible = vexpress_dt_compat, #ifdef CONFIG_ARM_32 .smp_init = vexpress_smp_init, - .cpu_up = vexpress_cpu_up, + .cpu_up = cpu_up_send_sgi, #endif .reset = vexpress_reset, .blacklist_dev = vexpress_blacklist_dev, diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index 6b4a18c..52cef30 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -343,6 +343,16 @@ void stop_cpu(void) wfi(); } +int __init cpu_up_send_sgi(int cpu) +{ + /* We don't know the GIC ID of the CPU until it has woken up, so just + * signal everyone and rely on our own smp_up_cpu gate to ensure only + * the one we want gets through. */ + send_SGI_allbutself(GIC_SGI_EVENT_CHECK); + + return 0; +} + /* Bring up a remote CPU */ int __cpu_up(unsigned int cpu) { @@ -376,11 +386,6 @@ int __cpu_up(unsigned int cpu) return rc; } - /* We don't know the GIC ID of the CPU until it has woken up, so just signal - * everyone and rely on our own smp_up_cpu gate to ensure only the one we - * want gets through. */ - send_SGI_allbutself(GIC_SGI_EVENT_CHECK); - while ( !cpu_online(cpu) ) { cpu_relax(); diff --git a/xen/include/asm-arm/smp.h b/xen/include/asm-arm/smp.h index 1485cc6..a1de03c 100644 --- a/xen/include/asm-arm/smp.h +++ b/xen/include/asm-arm/smp.h @@ -21,6 +21,8 @@ extern int arch_smp_init(void); extern int arch_cpu_init(int cpu, struct dt_device_node *dn); extern int arch_cpu_up(int cpu); +int cpu_up_send_sgi(int cpu); + /* Secondary CPU entry point */ extern void init_secondary(void);