Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6571419ybx; Mon, 11 Nov 2019 11:08:26 -0800 (PST) X-Google-Smtp-Source: APXvYqyQuSNolok9FYv+XEi0PbbOdA1v6rxSBSU8/rUAKUI6DIOIcCRnUM0Ug/F2fi3Y6DQYkE1/ X-Received: by 2002:a05:6402:512:: with SMTP id m18mr28567487edv.250.1573499306144; Mon, 11 Nov 2019 11:08:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573499306; cv=none; d=google.com; s=arc-20160816; b=M8VG4tLjxQbqciU/n+R7LBRE78xCWo9HaMJyUgph8W0IXZV1b0R4DUxKHG45e21nx3 B+pOYdwI4NmvwO0Ch0aM0xlbM9aanQNJxubL/ztRRbTcBU0iiRwlgr5nsMQ0rGlh9yyR Y7t3DOVDuNMdNpgYD7KT7XA5ou9yqvkrlwqZsQ6spada5R9J5k3ZW/lYb3Ojtvrz+6u0 9E/RzcoAMJJzTAZXfN0IITw1GuU2AcEv01ck8XhcRhILUPZFbbZ6BwFBRiOICzRzWC94 a5elLnCenHYWGE5XyowXZhoN7L/nULg9lQdcqrR8X1g4CCMI/IJ3Dp5+3bYey9yXXTO7 RBvA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u1p8atkT/RwlX11NTpFgQJ6o0PVacpoeXHvfBWSUiyw=; b=sGPYLRy99BepC3yLYOLyPV3sSdONUV1eFoB6EsfxVcYcdSu7FDPD1VqVR4pSk5+4AD AFKs/Q4M9zNuSCVxf3AKcQasCCt1LqY1O4JOzREcSK7OfkaK3HoXUGrygnJuXUp8UuGF /sNzT67N3/6b5kGEfsr6EZL10pxreuMdEHn4N8ZSaJU2ORlk6mR45Ug8N94FKglNB+/g mwzEES4E4SGKBHzOrCMO+NSGV2+2EDar6pu69YZwIlbp5ZnFGMT4KdCHB/92ADVvufWh 2opV9MCt2SQvnEiC1VZSpd6BqSl3QuAUmpbGx/7vPv0UX/qnavuK5vCs58zVqnFzRwy9 llbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=obtWx5Ax; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ca22si10088392ejb.22.2019.11.11.11.08.00; Mon, 11 Nov 2019 11:08:26 -0800 (PST) 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=@kernel.org header.s=default header.b=obtWx5Ax; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729510AbfKKSmZ (ORCPT + 99 others); Mon, 11 Nov 2019 13:42:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:33538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729496AbfKKSmU (ORCPT ); Mon, 11 Nov 2019 13:42:20 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E76AF214E0; Mon, 11 Nov 2019 18:42:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497739; bh=U+Q2q91h71IfZLyPrlsO+f3m6IWcblCUU/aQJzpN5uU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=obtWx5AxBh5Jm+HIcGDKSAXCZf1+0zFmOu23ALmO4fKQURRhF49fssOj5DlajgH27 nr0z21uCHQeQSzWkC0Xzi//rWDHxULwZuCa/3cqwMk6N0Yw4t9kc8P+nebEA/s+j4c cXqt9clJVMQbTxNxdIUAjE2F6V5TbQXT2tM+Fez0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ondrej Jirman , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH 4.19 036/125] ARM: sunxi: Fix CPU powerdown on A83T Date: Mon, 11 Nov 2019 19:27:55 +0100 Message-Id: <20191111181445.383112547@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181438.945353076@linuxfoundation.org> References: <20191111181438.945353076@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ondrej Jirman commit e690053e97e7a9c968df9a97cef9089dfa8e6a44 upstream. 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 Acked-by: Chen-Yu Tsai Cc: stable@vger.kernel.org Signed-off-by: Maxime Ripard Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-sunxi/mc_smp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/arch/arm/mach-sunxi/mc_smp.c +++ b/arch/arm/mach-sunxi/mc_smp.c @@ -478,14 +478,18 @@ static void sunxi_mc_smp_cpu_die(unsigne 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);