From patchwork Mon Apr 7 17:43:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 27920 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4C77320553 for ; Mon, 7 Apr 2014 17:45:06 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id j17sf29634147oag.2 for ; Mon, 07 Apr 2014 10:45:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=cDu2JPXznQtfcv8odQdcJetDRa0qFjON4rkHN65b3ZA=; b=JrR4MJdEnQwFsDkLzeO8D2/0E+R4/jfs3eAlYkImObzQ1pT1S2S+tUIOuzQQvPpo7n Gtf225FQ5PCHItyRfsg6ftFKTMt9MGHdNnlH9Txy2ScYTQybQotNbWI15NM8r5t1tkiR F0Fw11H7yRSjJ40Bi375tRmE5eXmKaQMOUdNLW8GwQp2KklcSLBj2dSYxSnCvtDtz80Y tigTP7PnjW7tG3ArCC5ZbvbbI1ljRqO+nDgVAAzDDSOL+Fv9IiS3rZ4OgAaahjVKVoKI t9xg8P4+NZ8w2OO0BUT0YR9oeoadAoO4/y5HYlEDVIm8h/WGB6+qFs2YLgvRf8CXMB1i zTHQ== X-Gm-Message-State: ALoCoQnt+JQ3QIHAXFYh0vIL/dwQUjBSAq40UI2v3726p7GQ4RAzKnCgrfS0+X/d8EVj4h+JZDI0 X-Received: by 10.43.161.202 with SMTP id mh10mr14145860icc.23.1396892706464; Mon, 07 Apr 2014 10:45:06 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.112 with SMTP id p103ls1827720qga.41.gmail; Mon, 07 Apr 2014 10:45:06 -0700 (PDT) X-Received: by 10.221.22.71 with SMTP id qv7mr1156586vcb.34.1396892706359; Mon, 07 Apr 2014 10:45:06 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id pu9si467865vec.47.2014.04.07.10.45.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Apr 2014 10:45:06 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.173 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.173; Received: by mail-vc0-f173.google.com with SMTP id il7so5697204vcb.32 for ; Mon, 07 Apr 2014 10:45:06 -0700 (PDT) X-Received: by 10.58.134.101 with SMTP id pj5mr89591veb.38.1396892706145; Mon, 07 Apr 2014 10:45:06 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp181531vcv; Mon, 7 Apr 2014 10:45:05 -0700 (PDT) X-Received: by 10.194.82.35 with SMTP id f3mr44294059wjy.36.1396892705370; Mon, 07 Apr 2014 10:45:05 -0700 (PDT) Received: from casper.infradead.org (casper.infradead.org. [2001:770:15f::2]) by mx.google.com with ESMTPS id b12si3734673wjz.239.2014.04.07.10.45.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Apr 2014 10:45:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:770:15f::2 as permitted sender) client-ip=2001:770:15f::2; Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WXDbE-0006ea-E1; Mon, 07 Apr 2014 17:44:48 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WXDbC-0005k3-68; Mon, 07 Apr 2014 17:44:46 +0000 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21] helo=cam-smtp0.cambridge.arm.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WXDb8-0005ix-T2 for linux-arm-kernel@lists.infradead.org; Mon, 07 Apr 2014 17:44:43 +0000 Received: from e102109-lin.cambridge.arm.com (e102109-lin.cambridge.arm.com [10.1.203.182]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id s37HiGag006462; Mon, 7 Apr 2014 18:44:16 +0100 From: Catalin Marinas To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] arm64: Remove boot thread synchronisation for spin-table release method Date: Mon, 7 Apr 2014 18:43:54 +0100 Message-Id: <1396892634-2461-1-git-send-email-catalin.marinas@arm.com> X-Mailer: git-send-email 1.7.12.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140407_134443_150851_FA22B6AE X-CRM114-Status: GOOD ( 13.93 ) X-Spam-Score: -2.9 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [217.140.96.21 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.3 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: catalin.marinas@arm.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.173 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The synchronisation with the boot thread already happens in __cpu_up() via wait_for_completion_timeout(). In addition, __cpu_up() calls are protected by the cpu_add_remove_lock mutex and already serialised. Signed-off-by: Catalin Marinas --- I can't see a reason why we still need the boot_lock synchronisation but happy to be proven wrong. Similarly for arch/arm, I think it can be removed in most (all?) cases. arch/arm64/kernel/smp_spin_table.c | 39 +------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/arch/arm64/kernel/smp_spin_table.c b/arch/arm64/kernel/smp_spin_table.c index 7a530d2cc807..0347d38eea29 100644 --- a/arch/arm64/kernel/smp_spin_table.c +++ b/arch/arm64/kernel/smp_spin_table.c @@ -30,7 +30,6 @@ extern void secondary_holding_pen(void); volatile unsigned long secondary_holding_pen_release = INVALID_HWID; static phys_addr_t cpu_release_addr[NR_CPUS]; -static DEFINE_RAW_SPINLOCK(boot_lock); /* * Write secondary_holding_pen_release in a way that is guaranteed to be @@ -94,14 +93,6 @@ static int smp_spin_table_cpu_prepare(unsigned int cpu) static int smp_spin_table_cpu_boot(unsigned int cpu) { - unsigned long timeout; - - /* - * Set synchronisation state between this boot processor - * and the secondary one - */ - raw_spin_lock(&boot_lock); - /* * Update the pen release flag. */ @@ -112,34 +103,7 @@ static int smp_spin_table_cpu_boot(unsigned int cpu) */ sev(); - timeout = jiffies + (1 * HZ); - while (time_before(jiffies, timeout)) { - if (secondary_holding_pen_release == INVALID_HWID) - break; - udelay(10); - } - - /* - * Now the secondary core is starting up let it run its - * calibrations, then wait for it to finish - */ - raw_spin_unlock(&boot_lock); - - return secondary_holding_pen_release != INVALID_HWID ? -ENOSYS : 0; -} - -static void smp_spin_table_cpu_postboot(void) -{ - /* - * Let the primary processor know we're out of the pen. - */ - write_pen_release(INVALID_HWID); - - /* - * Synchronise with the boot thread. - */ - raw_spin_lock(&boot_lock); - raw_spin_unlock(&boot_lock); + return 0; } const struct cpu_operations smp_spin_table_ops = { @@ -147,5 +111,4 @@ const struct cpu_operations smp_spin_table_ops = { .cpu_init = smp_spin_table_cpu_init, .cpu_prepare = smp_spin_table_cpu_prepare, .cpu_boot = smp_spin_table_cpu_boot, - .cpu_postboot = smp_spin_table_cpu_postboot, };