Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp530859pxb; Wed, 3 Mar 2021 09:00:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJwV+O4mCRkeDTBptcLvkGQAT139maO1eZRDXhppejy8nutxfjgxvbbbTTi3D1zVmzWu8L6r X-Received: by 2002:a17:906:5a8f:: with SMTP id l15mr7222123ejq.462.1614790812319; Wed, 03 Mar 2021 09:00:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614790812; cv=none; d=google.com; s=arc-20160816; b=XeR+v4nGmXcDy15KMck9wfQbT2Ttpo/LL7+nfwMlRTU4CKQaCxzwKZzVJkpTUsF/AH pcx164Bt4FtZBiYGogb7TttLqVafMY03jrV39DupwEivsNaiTGJ2xEHlXJcTAii+ZKvJ w1PFoA1LqX9pwR2W7sF/Ydx4NldTpgWgs+OyH4UQ0iJRpK1Wl7OpuwsPyT13K2VkDmGl zyZWx/z/+2m24JKtsg83m9LfTrDRWjXp2/1qSXnlKRcOWIc+7+TQXUKMmUr/u81X5uOj oeD+yKAGwsNoHcRbQq5XgAsq6meMZ+ieaH1thWWCPVQ742xO0LsS8xYgO4+3jVCVRQaD E5pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YdGK4HBT715IFoqKhd4lADef7WbILMDJCQAe9p3ojwM=; b=MF09bEFwBzdiyWXeUC6PeU18FdzK2/5uL1b0bv8ONVsOBvUqkNQgsAnEMd35qJ2Fvv j8NRDuYtBFS19ud1FlRE8CvEhKlaoi/Iwm2+eEkqYt5k38DmBSAoww9eyLYnA3j1wkcg Nf1Cxlje8x31+02/ANx5mpfRs5yOB8u3CtN53x0aJqTnn1Rsb19oUbEftyB1rrAvf6o3 tf01bezQ23lp6FjzLzC5PNUtaS+EwgBsV9jiBEsGWB6MP1b9GgLtTDX4N/Gn8792J0IR /gEh3FjIcIAhDEXcxcsNtNh7XGt9/bm+X7GyR8nVn0Ub4UeBlZsVMzScacz7NVngekLp zPqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uA3zDX2l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y18si553300edr.411.2021.03.03.08.59.26; Wed, 03 Mar 2021 09:00:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uA3zDX2l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376654AbhCBA3w (ORCPT + 99 others); Mon, 1 Mar 2021 19:29:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:47658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240139AbhCASdx (ORCPT ); Mon, 1 Mar 2021 13:33:53 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id DC5C665233; Mon, 1 Mar 2021 17:26:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614619576; bh=0z3WB6fxxIRpXJVqt7kYMNPzomhDGaiSxTU+Sip1pak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uA3zDX2lcotTL0/cPp2QQ42b2Ha2L57Xmw/odlg1ITM+xEEbqQnnf7UqvkyTLQIg2 aMB6F20bUPuQpR8y7IhFYK9ZAiRGQm+xNn+6d6IufYil/sr8gRC838uwYrOzGwaT+H R+DuxbfN3sb7WCBaw8fGMwOu3Mv9wtpqdi8IHiCc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Cercueil , =?UTF-8?q?=E5=91=A8=E7=90=B0=E6=9D=B0=20 ?= , Thomas Bogendoerfer Subject: [PATCH 5.10 505/663] MIPS: Ingenic: Disable HPTLB for D0 XBurst CPUs too Date: Mon, 1 Mar 2021 17:12:33 +0100 Message-Id: <20210301161206.828394015@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Cercueil commit a5360958a3cd1d876aae1f504ae014658513e1af upstream. The JZ4760 has the HPTLB as well, but has a XBurst CPU with a D0 CPUID. Disable the HPTLB for all XBurst CPUs with a D0 CPUID. In the case where there is no HPTLB (e.g. for older SoCs), this won't have any side effect. Fixes: b02efeb05699 ("MIPS: Ingenic: Disable abandoned HPTLB function.") Cc: # 5.4 Signed-off-by: Paul Cercueil Reviewed-by: 周琰杰 (Zhou Yanjie) Signed-off-by: Thomas Bogendoerfer Signed-off-by: Greg Kroah-Hartman --- arch/mips/kernel/cpu-probe.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c @@ -1830,16 +1830,17 @@ static inline void cpu_probe_ingenic(str */ case PRID_COMP_INGENIC_D0: c->isa_level &= ~MIPS_CPU_ISA_M32R2; - break; + fallthrough; /* * The config0 register in the XBurst CPUs with a processor ID of - * PRID_COMP_INGENIC_D1 has an abandoned huge page tlb mode, this - * mode is not compatible with the MIPS standard, it will cause - * tlbmiss and into an infinite loop (line 21 in the tlb-funcs.S) - * when starting the init process. After chip reset, the default - * is HPTLB mode, Write 0xa9000000 to cp0 register 5 sel 4 to - * switch back to VTLB mode to prevent getting stuck. + * PRID_COMP_INGENIC_D0 or PRID_COMP_INGENIC_D1 has an abandoned + * huge page tlb mode, this mode is not compatible with the MIPS + * standard, it will cause tlbmiss and into an infinite loop + * (line 21 in the tlb-funcs.S) when starting the init process. + * After chip reset, the default is HPTLB mode, Write 0xa9000000 + * to cp0 register 5 sel 4 to switch back to VTLB mode to prevent + * getting stuck. */ case PRID_COMP_INGENIC_D1: write_c0_page_ctrl(XBURST_PAGECTRL_HPTLB_DIS);