From patchwork Fri Apr 11 18:01:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhilash Kesavan X-Patchwork-Id: 3971711 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1906BBFF02 for ; Fri, 11 Apr 2014 18:04:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 327F72018A for ; Fri, 11 Apr 2014 18:04:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 588462017E for ; Fri, 11 Apr 2014 18:04:46 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYfmh-0003SZ-63; Fri, 11 Apr 2014 18:02:39 +0000 Received: from mail-pb0-x232.google.com ([2607:f8b0:400e:c01::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYfmc-00039a-10 for linux-arm-kernel@lists.infradead.org; Fri, 11 Apr 2014 18:02:34 +0000 Received: by mail-pb0-f50.google.com with SMTP id md12so5723558pbc.37 for ; Fri, 11 Apr 2014 11:02:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=FGR4VPwcaTahSy325Of4yzx3u+BJjVWSI0CK3+TAudo=; b=DtOncZYBpdCSLDdCONF/OjiLclpgD9P5zQZZNJKezzCSV6WR3a4ILa+EixLInsB98o sB9rZVpKX+VS7n06n6Ow5UwDPOurgiGCEEuJrSmEJZ1ut4HwAenBBxfqXCeCL/dOQBte ISbimk0RoBwXrddHVeWK8DUlcCLG2fkak2OUIJ7ebFNhw+4hnwINq07HRbziE9tkRTWU w++323KBfGwdgd0aw9gKH1C/1GaRMLjC/+wyc3dhB88jzKZ3+3PMFuh85X+hyV1ZlhSS MgHy3j/jWcVxX08cJRvh1Vo+xckgB5RRuN9Yfd+BKDB0iJkk1vyX7oOJS9KnYG16lNlg 2WIA== X-Received: by 10.68.240.68 with SMTP id vy4mr28665582pbc.127.1397239332827; Fri, 11 Apr 2014 11:02:12 -0700 (PDT) Received: from localhost.localdomain ([122.171.66.111]) by mx.google.com with ESMTPSA id h6sm16993556pbl.75.2014.04.11.11.02.07 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Apr 2014 11:02:12 -0700 (PDT) From: Abhilash Kesavan To: abrestic@chromium.org, thomas.ab@samsung.com, inderpal.s@samsung.com, lorenzo.pieralisi@arm.com, linux-arm-kernel@lists.infradead.org, kgene.kim@samsung.com, nicolas.pitre@linaro.org, Dave.Martin@arm.com, t.figa@samsung.com Subject: [PATCH 2/5] drivers/bus: arm-cci: Add common control interface for ACE ports Date: Fri, 11 Apr 2014 23:31:48 +0530 Message-Id: <1397239311-27717-3-git-send-email-a.kesavan@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1397239311-27717-1-git-send-email-a.kesavan@samsung.com> References: <1397239311-27717-1-git-send-email-a.kesavan@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140411_110234_087111_FA87D780 X-CRM114-Status: GOOD ( 14.50 ) X-Spam-Score: 0.0 (/) Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, arnd@arndb.de, will.deacon@arm.com, robh+dt@kernel.org, grant.likely@linaro.org 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andrew Bresticker cci_disable_port_by_cpu() can be used to disable an arbitrary ACE port, but there is no C-callable way to enable an ACE port. Change cci_disable_port_by_cpu() to cci_control_port_by_cpu() to allow us to disable and enable a CPU's ACE port. Signed-off-by: Andrew Bresticker Signed-off-by: Abhilash Kesavan --- drivers/bus/arm-cci.c | 13 +++++++------ include/linux/arm-cci.h | 7 +++++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c index 5a86da9..5668b40 100644 --- a/drivers/bus/arm-cci.c +++ b/drivers/bus/arm-cci.c @@ -763,10 +763,11 @@ static void notrace cci_port_control(unsigned int port, bool enable) } /** - * cci_disable_port_by_cpu() - function to disable a CCI port by CPU + * cci_control_port_by_cpu() - function to control a CCI port by CPU * reference * - * @mpidr: mpidr of the CPU whose CCI port should be disabled + * @mpidr: mpidr of the CPU whose CCI port should be enabled/disabled + * @enable: if true enables the port, if false disables it * * Disabling a CCI port for a CPU implies disabling the CCI port * controlling that CPU cluster. Code disabling CPU CCI ports @@ -777,20 +778,20 @@ static void notrace cci_port_control(unsigned int port, bool enable) * 0 on success * -ENODEV on port look-up failure */ -int notrace cci_disable_port_by_cpu(u64 mpidr) +int notrace cci_control_port_by_cpu(u64 mpidr, bool enable) { int cpu; bool is_valid; for (cpu = 0; cpu < nr_cpu_ids; cpu++) { is_valid = cpu_port_is_valid(&cpu_port[cpu]); if (is_valid && cpu_port_match(&cpu_port[cpu], mpidr)) { - cci_port_control(cpu_port[cpu].port, false); + cci_port_control(cpu_port[cpu].port, enable); return 0; } } return -ENODEV; } -EXPORT_SYMBOL_GPL(cci_disable_port_by_cpu); +EXPORT_SYMBOL_GPL(cci_control_port_by_cpu); /** * cci_enable_port_for_self() - enable a CCI port for calling CPU @@ -936,7 +937,7 @@ int notrace __cci_control_port_by_index(u32 port, bool enable) /* * CCI control for ports connected to CPUS is extremely fragile * and must be made to go through a specific and controlled - * interface (ie cci_disable_port_by_cpu(); control by general purpose + * interface (ie cci_control_port_by_cpu(); control by general purpose * indexing is therefore disabled for ACE ports. */ if (ports[port].type == ACE_PORT) diff --git a/include/linux/arm-cci.h b/include/linux/arm-cci.h index 79d6edf..c6c3ed0 100644 --- a/include/linux/arm-cci.h +++ b/include/linux/arm-cci.h @@ -29,7 +29,7 @@ struct device_node; #ifdef CONFIG_ARM_CCI extern bool cci_probed(void); extern int cci_ace_get_port(struct device_node *dn); -extern int cci_disable_port_by_cpu(u64 mpidr); +extern int cci_control_port_by_cpu(u64 mpidr, bool enable); extern int __cci_control_port_by_device(struct device_node *dn, bool enable); extern int __cci_control_port_by_index(u32 port, bool enable); #else @@ -38,7 +38,10 @@ static inline int cci_ace_get_port(struct device_node *dn) { return -ENODEV; } -static inline int cci_disable_port_by_cpu(u64 mpidr) { return -ENODEV; } +static inline int cci_disable_port_by_cpu(u64 mpidr, bool enable) +{ + return -ENODEV; +} static inline int __cci_control_port_by_device(struct device_node *dn, bool enable) {