Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp612949lqo; Wed, 8 May 2024 09:24:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXFviOYuCGsMoug11EUJ9NlObOZ+RU6YRVTrWYDbIMbB/RrG7nzeYw9QDzwwC80wAKR1swOhUL+Knyn3PO6xwmN0BnOZgWUwzwVGc1fyA== X-Google-Smtp-Source: AGHT+IF/cxX48tX/5LZlHaKoH86Od0ytJrwj5cjjn7Rs1XqWh/+TSlgyc+vqTOVON3Fo8o0Nf5Ao X-Received: by 2002:a17:906:b78d:b0:a59:b543:c9f9 with SMTP id a640c23a62f3a-a59fb920d59mr243437266b.7.1715185459457; Wed, 08 May 2024 09:24:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715185459; cv=pass; d=google.com; s=arc-20160816; b=fi2pJ4BYF+QfJQtGi9bXVxTub6bpFVJxoa/Spf1zOmriis4ody/4vV8u22w09x3oaQ VnrMuqYIODfDQDQK16uUoaPZtKRIsctmu6TWQiA07lAOLiGf7Pbi6tDDt+irYoy54dka WFq2RsHPt8VEds9IdDFbI+CQKJNU6GPvXq/MvL3pgbk/7HZTLgp8l6XRkFoEaYwAUrio beyroX0SeAM0NQsmUqV7oFP+PSp+QSQEq07sZ4+zEgeRXX852zd7xrAHRh+uo4wIh9Fb yGJh8u2hVdXlI63xKkIaLZeiRNnLWETlHyQFYnJmXHrnh/0vDKCuo/VXFf5rFKDh6M26 uVuQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:user-agent:feedback-id:dkim-signature :dkim-signature; bh=4nGit7XxeGIk2SVfnODtOYvvu5kqArp+iKedBGicZYU=; fh=iWnSgZCKk+VUZ0j6ifYvuAZgjCfrGMcnfblejRnpe2g=; b=FE+EQtg31ABJg47aDdgH8wTeSsDf7Cft0fT6UhLVFH3UB8Mi1CWO6EC2vVaCiWPHGV KZjSsuhGqegDhEe5UbjOw5bqWL4U3UKepEFcvB4TVZApZQutJduQZ5ftJ/umJN8IXn8q Hk6iqo5oXYfl6CTltTZ5MFpi/tHJW5tC9wOuOkWr6YS3084IbKq0grSIsn4g2sQmCFrL wmAu55pth56Tf7DNgCnos8cvm8iadPi3S0OhbSdg/M9ziyWKV+IYQbhlCvgYCG9W14Ne H9Y7W9K37AlH1sk79ziFVfKtVx2RdL62LpvTKLFs5+RbbXEp43SQPFm10VEnR9WfoY8E LLDw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b="M5r0f/1E"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=bzOvvdS9; arc=pass (i=1 spf=pass spfdomain=flygoat.com dkim=pass dkdomain=flygoat.com dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=flygoat.com); spf=pass (google.com: domain of linux-kernel+bounces-173538-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173538-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id lv20-20020a170906bc9400b00a5a09f6fd7fsi536622ejb.788.2024.05.08.09.24.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 09:24:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173538-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b="M5r0f/1E"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=bzOvvdS9; arc=pass (i=1 spf=pass spfdomain=flygoat.com dkim=pass dkdomain=flygoat.com dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=flygoat.com); spf=pass (google.com: domain of linux-kernel+bounces-173538-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173538-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 01AC91F22131 for ; Wed, 8 May 2024 16:24:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B2A3A12A17B; Wed, 8 May 2024 16:24:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b="M5r0f/1E"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="bzOvvdS9" Received: from fout3-smtp.messagingengine.com (fout3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEDF76D1B0; Wed, 8 May 2024 16:24:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715185450; cv=none; b=DHx9vzmZaekKwPdAIL7Gsz2QnSn+gHZEpxdYsedkqD7+ayWh5kEcrDmyJUFnzWK0mmWG/oTjNDyIBiFk9mP51fcJMLmCNDJZOa2315mrSxbKTY/Y2U95n+6FE/bmWb0ZPbo9AAvWk7FJqh+kbftAJa4xp0bkgjIOqkLjtZFw6jI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715185450; c=relaxed/simple; bh=ibNJ8Xe8MiZ/i4OLkjlyLfRh2B8XMD+/gb/5ylg6D/U=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=CyaYnjyfROxoTB198bKaKBHQlqyV9FaLxk8op6dnbglLDRRahZbg+NEbI+uSv0MP87k9kn0BNmo+0XhfG7PZwGP4kR9ei74Yng0hhVmpxY96T2lE2SkIPSAUug4Y/7KCnOgnwl5WhefA1UZ0cvkCLRtslx+0b1w36L6DIf6U5VI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=flygoat.com; spf=pass smtp.mailfrom=flygoat.com; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b=M5r0f/1E; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=bzOvvdS9; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=flygoat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flygoat.com Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailfout.nyi.internal (Postfix) with ESMTP id DDF5D1380259; Wed, 8 May 2024 12:24:07 -0400 (EDT) Received: from imap44 ([10.202.2.94]) by compute3.internal (MEProxy); Wed, 08 May 2024 12:24:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1715185447; x=1715271847; bh=4nGit7XxeGIk2SVfnODtOYvvu5kqArp+iKedBGicZYU=; b= M5r0f/1EYGGBMZdHb2yx3K2srlH9EtawFjd1OIHaqMNPGJgqZGax9dOsaauwRxgi gSinIxlrgKyYVldrm1EG9CKjma973HUuKh3TWGSaqpKve3np8dFKWWmUcv8AZApU z/IKRMxtlcEmWmp6F9vyvY8ELHu76qZ/wEuHvne8GWpMHCVglpC/cSCYsACKXlmc gElXZYJTXNlu4wTb7iiQvWPwRq9CaY8suDi26qd5nvENKrdrOcDmWBSFEemGMhpi S5hqgo5wqYWh2h+9Q7cgs3wh2OvCFxJVIcWhNqrrewym6jyL1IZVNWYFTO2gs2ke Nt5C2NmzxhB+8PcOzOu9jA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1715185447; x= 1715271847; bh=4nGit7XxeGIk2SVfnODtOYvvu5kqArp+iKedBGicZYU=; b=b zOvvdS9bVHsE0CusftMhnE2toFhTfNuk39zVNqUSBWlIHeyETt4HK12QuBRTDOde eb974p/2CNtXMYdqR+iuyTwEhfljN5u9A+GMJwHwRfwRTq2OsIZcw4OA2T9r3zZM paPt1ecjgWhoPVYaHgeyULeh7J3ijMF1pfALbPvmEhbciSf8Nt7zqdY6OAloLD6D hQeVDTr2Y5XDkLPJ43NE+0HSjvQPJauehOBqORzqMo48NTezKD/v/LcAXI3csUi5 v94cm0iRGvT0Zq+Spri84UUhWLFTzccfqjsmppHyAr8Ur/hzD3CG1sODcA0iFP1w qMdEAeB/6wt1tQbxiP48Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeftddgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdfl ihgrgihunhcujggrnhhgfdcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtoh hmqeenucggtffrrghtthgvrhhnpedufeegfeetudeghefftdehfefgveffleefgfehhfej ueegveethfduuddvieehgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 34C0D36A0074; Wed, 8 May 2024 12:24:07 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-443-g0dc955c2a-fm-20240507.001-g0dc955c2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <8d02a270-c9b7-4389-899e-cd755e55f0a4@app.fastmail.com> In-Reply-To: References: <20240507-cm_probe-v1-0-11dbfd598f3c@flygoat.com> <20240507-cm_probe-v1-3-11dbfd598f3c@flygoat.com> Date: Wed, 08 May 2024 17:23:48 +0100 From: "Jiaxun Yang" To: "Serge Semin" Cc: "paulburton@kernel.org" , "Thomas Bogendoerfer" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "linux-mips@vger.kernel.org" , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH 3/5] MIPS: Move mips_cm_probe after prom_init Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable =E5=9C=A82024=E5=B9=B45=E6=9C=888=E6=97=A5=E4=BA=94=E6=9C=88 =E4=B8=8B=E5= =8D=881:50=EF=BC=8CSerge Semin=E5=86=99=E9=81=93=EF=BC=9A > On Tue, May 07, 2024 at 10:01:51AM +0100, Jiaxun Yang wrote: >> Move mips_cm_probe after prom_init so we can use fdt functions >> in mips_cm_probe to obtain essential information. >>=20 >> Impat for all systems that may have CM in system: > >> - geneirc: Adjusted code to accommodate this change > > s/geneirc/generic > >> - Lantiq: No impact, CM configuration won't be changed at all >> - ralink: Called mips_cm_probe on it's own, in prom_init->prom_soc_in= it > >> - malta: No impact, CM address comes from CP0_CMGCR > > Are you sure about this? This was one of the problematic part I met > back when was trying to implement the feature. > arch/mips/mti-malta/malta-init.c: > prom_init() > +-> mips_cpc_probe() > +-> mips_cpc_phys_base() > +-> mips_cm_present(): mips_gcr_base !=3D NULL > +-> read_gcr_cpc_status() > +-> read_gcr_cpc_base() > +-> write_gcr_cpc_base() > > So by moving mips_cm_probe() to being executed after prom_init() the > calls-chain above will be broken since the mips_gcr_base will be left > uninitialized. Do I miss something? Hi Serge, Good catch! This is indeed a problem. I tried to dig a little bit and found that a possible solution is to move SMP initialization to device_tree_init(), as what generic platform did. I was able to test malta boot with this solution on my heavily patched QEMU, I can confirm that both CM-SMP and scache are working as expected. Will share my QEMU patches and configurations in next rev.=20 Thanks - Jiaxun > > Please, note originally the mips_cm_probe() invocation was right > above the Malta's mips_cpc_probe(): > 3af5a67c86a3 ("MIPS: Fix early CM probing") > > -Serge(y) > >>=20 >> Signed-off-by: Jiaxun Yang >> --- >> arch/mips/kernel/setup.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >>=20 >> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c >> index 12a1a4ffb602..732579c8f4f8 100644 >> --- a/arch/mips/kernel/setup.c >> +++ b/arch/mips/kernel/setup.c >> @@ -773,8 +773,8 @@ static void __init setup_rng_seed(void) >> void __init setup_arch(char **cmdline_p) >> { >> cpu_probe(); >> - mips_cm_probe(); >> prom_init(); >> + mips_cm_probe(); >> =20 >> setup_early_fdc_console(); >> #ifdef CONFIG_EARLY_PRINTK >>=20 >> --=20 >> 2.34.1 >>=20 >> --=20 - Jiaxun