Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3650627ybg; Mon, 28 Oct 2019 16:36:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJTvgT89O1QQLesfjj/9xJd8jxknLln8Pry00TVt9em+bS7pwT4Bb5ZhvmF6NGXaFSWiKq X-Received: by 2002:a17:906:e5a:: with SMTP id q26mr468184eji.246.1572305794037; Mon, 28 Oct 2019 16:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572305794; cv=none; d=google.com; s=arc-20160816; b=0vngfD6N+Yrra3CjcUaX35drj1uFrkBcvWiuwpHoiB1SQVmteUPtbm2d95OsjCNdoL 8fW7n5hPYUIMB+VYkhp8Yom2kRkY5Llfhqf60YRhUI6X3zkwtoVzpZRUxAblb8pL/Dcm 0rcPfqkxg6ectLW9rjrMRNpnehEzAkXswXl05cN74ZjJOjfHvuc/kpjNAMqELymrrHP9 gBFIS1++OkItr5rNO7JkErHl8TdvyVZAfF0ZemvMEhxF3Q8xtHrjBA02KgoQOYvzprzi +qKJplbA9nSvpPt1OLPn10OzHUpmuvhmWwjWgF9QRDNAHLhd2yeUmP66HIonN8Z8SRKO b2tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=MnMWrA6F5lrIbAkZRs+POJskYnxL+veI2g7HpkDR4d4=; b=FOO37dbhKjsUTUQM9o+cBaqDA6V4+FJIM4ecbFCWVkhgOWQ77xHsDLdd6NyF24HZNF djJJqRTLLH1b5R03twN/5rRip6df2J+Cmxvsc1kJFuBuR0yQLm8FsPSNi7/mSPfOVQQK RYm2rkO9VGBcqEcIT+69a8C0uxPDwzmF27dQlzk3tbMXkeesIiL9LdeRqG3rsT9FAKvc 5clk01rB0ClysB0ovZ8tmxBXvnV3rzC9VlQK3CV0HAmvnJE3Ogb8cHbFW2ZWjWoa0Y/w bkNOY2HCfblGnJCwQ1YQNkbPyJcFDxzsT5HJH097zH1Yn4Ozbw0n0UQaOGoqDpEYug6i qV+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=RVD9lhOK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v20si5800988edc.69.2019.10.28.16.36.09; Mon, 28 Oct 2019 16:36:34 -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; dkim=pass header.i=@megous.com header.s=mail header.b=RVD9lhOK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732978AbfJ1VtZ (ORCPT + 99 others); Mon, 28 Oct 2019 17:49:25 -0400 Received: from vps.xff.cz ([195.181.215.36]:50070 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730592AbfJ1VtZ (ORCPT ); Mon, 28 Oct 2019 17:49:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1572299363; bh=yfQ5bNur1qQsSwWai80uin5ZDClxDtOcYUot2/fijL0=; h=From:To:Cc:Subject:Date:From; b=RVD9lhOKFIWyR8uwdk2pCEi1JXI/uuyWgSwtBUN3we5JB1c5A5vVxcsn92C47QBc3 nU/lzm4szLyF6lnP6vBtiKuiNZ/DtVMsFUIocfOEhl1LTdROS25HWBRU2SA2j2MLqT xjJKew//0G2ek76ewJ6TrFzTUjb3lW3lW3QYv408= From: Ondrej Jirman To: linux-sunxi@googlegroups.com Cc: Ondrej Jirman , stable@vger.kernel.org, Maxime Ripard , Chen-Yu Tsai , Russell King , linux-arm-kernel@lists.infradead.org (moderated list:ARM/Allwinner sunXi SoC support), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] ARM: sunxi: Fix CPU powerdown on A83T Date: Mon, 28 Oct 2019 22:49:14 +0100 Message-Id: <20191028214914.3465156-1-megous@megous.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org PRCM_PWROFF_GATING_REG has CPU0 at bit 4 on A83T. So without this patch, instead of gating the CPU0, the whole cluster was power gated, when shutting down first CPU in the cluster. Fixes: 6961275e72a8c1 ("ARM: sun8i: smp: Add support for A83T") Signed-off-by: Ondrej Jirman Cc: stable@vger.kernel.org --- arch/arm/mach-sunxi/mc_smp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-sunxi/mc_smp.c b/arch/arm/mach-sunxi/mc_smp.c index 239084cf8192..26cbce135338 100644 --- a/arch/arm/mach-sunxi/mc_smp.c +++ b/arch/arm/mach-sunxi/mc_smp.c @@ -481,14 +481,18 @@ static void sunxi_mc_smp_cpu_die(unsigned int l_cpu) static int sunxi_cpu_powerdown(unsigned int cpu, unsigned int cluster) { u32 reg; + int gating_bit = cpu; pr_debug("%s: cluster %u cpu %u\n", __func__, cluster, cpu); if (cpu >= SUNXI_CPUS_PER_CLUSTER || cluster >= SUNXI_NR_CLUSTERS) return -EINVAL; + if (is_a83t && cpu == 0) + gating_bit = 4; + /* gate processor power */ reg = readl(prcm_base + PRCM_PWROFF_GATING_REG(cluster)); - reg |= PRCM_PWROFF_GATING_REG_CORE(cpu); + reg |= PRCM_PWROFF_GATING_REG_CORE(gating_bit); writel(reg, prcm_base + PRCM_PWROFF_GATING_REG(cluster)); udelay(20); -- 2.23.0