From patchwork Fri Apr 18 02:30:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 28605 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2A1AA21890 for ; Fri, 18 Apr 2014 02:31:15 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id i17sf4111098qcy.7 for ; Thu, 17 Apr 2014 19:31:14 -0700 (PDT) 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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=JRqXKXzVvAOZsUWD9bW584w8XHl1LY3zFx/HDF0PQ5g=; b=ey7t4O/A64J+ws5ZSVpvIWGsV5sIYBkHkkJcOUUKH2dmk4PsUXTYmdcornink1GbCh wT68VQyB3xTqCAyckd/pVvgmrie/MpVH54lDK/BYLWQJoutgxlu954HhEYVzQ/XVBugh 620ooIjAqi1F0mOid2j0MwEm9x2LmBPR+8dl/a4W/+BdYCRs4QFmB760Zz1L1awYLB88 ylSiYAZdjsJ7b8L4AINbOXSjHpiH8Z+Gx6pb1YR0CFMyrzfxKGdHIhBRjmts8RROiWsk MNEe0MdyVy9iccUgiYS1dN+Wpxaq6Ps1Y1VAw7y2ZzPLXq8W1hbReravxkdC/FT3/d7X Tt4w== X-Gm-Message-State: ALoCoQlJdsetg8aAnB2patDJad3PxfqSmHT25xuRAZR7yzveFn4GCftscRbM9M8dBckxdGMCfMx5 X-Received: by 10.224.6.198 with SMTP id a6mr7389495qaa.6.1397788274856; Thu, 17 Apr 2014 19:31:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.163 with SMTP id a32ls1336677qgf.73.gmail; Thu, 17 Apr 2014 19:31:14 -0700 (PDT) X-Received: by 10.58.207.74 with SMTP id lu10mr14594553vec.15.1397788274742; Thu, 17 Apr 2014 19:31:14 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id wd2si4755096veb.59.2014.04.17.19.31.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Apr 2014 19:31:14 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id jy13so1819899veb.16 for ; Thu, 17 Apr 2014 19:31:14 -0700 (PDT) X-Received: by 10.58.201.5 with SMTP id jw5mr14310463vec.6.1397788274650; Thu, 17 Apr 2014 19:31:14 -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.221.72 with SMTP id ib8csp80008vcb; Thu, 17 Apr 2014 19:31:14 -0700 (PDT) X-Received: by 10.66.230.166 with SMTP id sz6mr19373381pac.127.1397788273448; Thu, 17 Apr 2014 19:31:13 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si15554312pbc.329.2014.04.17.19.31.12; Thu, 17 Apr 2014 19:31:12 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751746AbaDRCbL (ORCPT + 26 others); Thu, 17 Apr 2014 22:31:11 -0400 Received: from mail-ig0-f180.google.com ([209.85.213.180]:43018 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751413AbaDRCaX (ORCPT ); Thu, 17 Apr 2014 22:30:23 -0400 Received: by mail-ig0-f180.google.com with SMTP id c1so271420igq.13 for ; Thu, 17 Apr 2014 19:30:23 -0700 (PDT) X-Received: by 10.50.57.109 with SMTP id h13mr843806igq.3.1397788222951; Thu, 17 Apr 2014 19:30:22 -0700 (PDT) Received: from localhost.localdomain (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPSA id m8sm673967igx.9.2014.04.17.19.30.21 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Apr 2014 19:30:22 -0700 (PDT) From: Alex Elder To: bcm@fixthebug.org, mporter@linaro.org Cc: bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/10] ARM: bcm: don't special-case CPU 0 in bcm_kona_smc() Date: Thu, 17 Apr 2014 21:30:10 -0500 Message-Id: <1397788215-20279-6-git-send-email-elder@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1397788215-20279-1-git-send-email-elder@linaro.org> References: <1397788215-20279-1-git-send-email-elder@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: elder@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.171 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , There's logic in bcm_kona_smc() to ensure __bcm_kona_smc() gets called on CPU 0; if already executing on CPU 0, that function is called directly. The direct call is not protected from interrupts, however, which is not safe. Note that smp_call_function_single() is designed to handle the case where the target cpu is the current one. It also gets a reference to the CPU and disables IRQs across the call. So we can simplify things and at the same time be protected against interrupts by calling smp_call_function_single() unconditionally. Signed-off-by: Alex Elder Reviewed-by: Tim Kryger Reviewed-by: Markus Mayer Reviewed-by: Matt Porter --- arch/arm/mach-bcm/bcm_kona_smc.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/arm/mach-bcm/bcm_kona_smc.c b/arch/arm/mach-bcm/bcm_kona_smc.c index 47cf360..6fdcf96 100644 --- a/arch/arm/mach-bcm/bcm_kona_smc.c +++ b/arch/arm/mach-bcm/bcm_kona_smc.c @@ -114,12 +114,7 @@ unsigned bcm_kona_smc(unsigned service_id, unsigned arg0, unsigned arg1, * Due to a limitation of the secure monitor, we must use the SMP * infrastructure to forward all secure monitor calls to Core 0. */ - if (get_cpu() != 0) - smp_call_function_single(0, __bcm_kona_smc, (void *)&data, 1); - else - __bcm_kona_smc(&data); - - put_cpu(); + smp_call_function_single(0, __bcm_kona_smc, &data, 1); return data.result; }