From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7472BC4361B for ; Sun, 13 Dec 2020 19:13:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 44F4D23406 for ; Sun, 13 Dec 2020 19:13:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731991AbgLMTNb (ORCPT ); Sun, 13 Dec 2020 14:13:31 -0500 Received: from out28-98.mail.aliyun.com ([115.124.28.98]:45169 "EHLO out28-98.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726973AbgLMTNN (ORCPT ); Sun, 13 Dec 2020 14:13:13 -0500 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07921612|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_regular_dialog|0.180487-0.000463275-0.81905;FP=0|0|0|0|0|-1|-1|-1;HT=ay29a033018047190;MF=zhouyanjie@wanyeetech.com;NM=1;PH=DS;RN=7;RT=7;SR=0;TI=SMTPD_---.J6g39E6_1607886743; Received: from 192.168.10.152(mailfrom:zhouyanjie@wanyeetech.com fp:SMTPD_---.J6g39E6_1607886743) by smtp.aliyun-inc.com(10.147.40.2); Mon, 14 Dec 2020 03:12:24 +0800 Subject: Re: [PATCH] MIPS: Ingenic: Disable HPTLB for D0 XBurst CPUs too To: Paul Cercueil , Thomas Bogendoerfer Cc: Zhou Yanjie , od@zcrc.me, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20201212000354.291665-1-paul@crapouillou.net> From: Zhou Yanjie Message-ID: Date: Mon, 14 Dec 2020 03:12:23 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20201212000354.291665-1-paul@crapouillou.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paul, On 2020/12/12 上午8:03, Paul Cercueil wrote: > 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 > --- > arch/mips/kernel/cpu-probe.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c > index e6853697a056..31cb9199197c 100644 > --- a/arch/mips/kernel/cpu-probe.c > +++ b/arch/mips/kernel/cpu-probe.c > @@ -1830,16 +1830,17 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu) > */ > 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 I just noticed that I mistakenly wrote a capital 'W' in the original version. with that fixed: Reviewed-by: 周琰杰 (Zhou Yanjie) BTW: Are you planning to add support for JZ4760 recently? I am currently writing the CGU driver for JZ4775 and X2000. If you plan to add support for JZ4760, I can also write the CGU driver for JZ4760 by the way. Thanks and best regards! > - * 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);