Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2442045rdb; Fri, 8 Dec 2023 08:13:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHwICrtxBXUfjMhLWe/Ryx4/mUPLdV2Ip73q4KkxoQyuUD7ABbTHv3q/4fWWpVchYZdDD+t X-Received: by 2002:a5e:a60d:0:b0:7b3:e048:f8fc with SMTP id q13-20020a5ea60d000000b007b3e048f8fcmr452238ioi.1.1702052000854; Fri, 08 Dec 2023 08:13:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702052000; cv=none; d=google.com; s=arc-20160816; b=wpyUyMWVOb0uKfDiVZBMZ72ol+kcRt+UahPN0sgKBnYhZl2j4U3YqbNpU8350sUm0r 7zD31URbboZPJzEYM59ZcfuPl1OPbHPSeTNMx3jqMKC5gKvH9SROSw1OY3Pqol6QdBrs 9mweP04IgL0wwFFbvZ0taWYO7fRLssAgRzjpyNhdLDfYte0ra8vgFtcRbRxWhH1bVUZ/ Pby/AUmkJrb6TSeSj4oEeucNxTfZlwuuABybZYswtEv+lgVnhdrJWx8qjhO8meLT4TnA ZbT768UXJwf0xnnedUf265w5AYnsT/2uF3K9tW2SXiT/eTTVi86b8snNkoXu1nmzwIr7 EcBg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=p5Y4+QQx6IQCL0sfRkqEobRfltIrsUFlmPw44Fo9wsE=; fh=MwmhOnPCNEKQUh9CETmL1NjqsCe+66NMqSNy76XJ1mw=; b=kthZTrH6yadGI1Jf8s/PcTYQq7cn5TvMUAvkz81dDwTo5FqFzNqthJ1qQ+VzSSpxgU qefe3+Ry3KqXtYwM7AqgCUK10F3d55X0Pw1Om1tbTxSwViizQpxHlsIGPkBq/pygC8ao oUsNsx9+jeJoy+1fIvegxe/vSaKYTIGw5oy54h/o1LbmTfkcMD9TwjTeDAIXRpyeCloK t4rbtB7kSJ5e3IGUsf4CGJn21o60OZt6De9gpcB69c5ONrSkOYtJoA0uATpDWqsxUUvV wR0yOA43HHZeyfSSpX3KTECvoR6e7pLZY2LFKkmLilyQo9IDY/U5OoFt73nejGH4vvGm H9IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=BgBDek+l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id o2-20020a655202000000b005c666162406si1781659pgp.565.2023.12.08.08.13.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 08:13:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=BgBDek+l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id BF48D80FA9C6; Fri, 8 Dec 2023 08:13:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574160AbjLHQNG (ORCPT + 99 others); Fri, 8 Dec 2023 11:13:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573889AbjLHQMx (ORCPT ); Fri, 8 Dec 2023 11:12:53 -0500 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A30E4199D; Fri, 8 Dec 2023 08:12:59 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id A174320002; Fri, 8 Dec 2023 16:12:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1702051978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p5Y4+QQx6IQCL0sfRkqEobRfltIrsUFlmPw44Fo9wsE=; b=BgBDek+lHk8Bpj4cTc9PRqbI7zUVzeW3FrPoj/em51nDGBxq/hJRlYrswt7JH3U16LmPUP 7OcuJpBXfg5BNautwb3tkcMppVHrjGL2UBr0upJBv61qVzFLSraqD81lkFd+DilwEjjsyE beiwHotLU4X0t0IO4KroTrZ8pVo8lnXmjdXbMtT50LSWUlNY9k0vR26hmzAVMm1IXgGNhf ibUlZ+LH7GAmibJLiCx4UvTW2VWODK/RoxuY2Cx/yPg+jKU3sjd6rwuO5l75COuhmA8gRr MGm4hfceUVAvwSjZEClpiBEPDQqTHZXlc2XrXRv5u1LFT/S8NVO5uAnWI+QjEg== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?UTF-8?q?Th=C3=A9o=20Lebrun?= , Thomas Petazzoni , Vladimir Kondratiev , Gregory CLEMENT Subject: [PATCH v4 05/22] MIPS: Fix set_uncached_handler for ebase in XKPHYS Date: Fri, 8 Dec 2023 17:12:21 +0100 Message-ID: <20231208161249.1827174-6-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231208161249.1827174-1-gregory.clement@bootlin.com> References: <20231208161249.1827174-1-gregory.clement@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 08 Dec 2023 08:13:19 -0800 (PST) From: Jiaxun Yang ebase may be in XKPHYS if memblock unable to allocate memory within KSEG0 physical range. To map ebase into uncached space we just convert it back to physical address and then use platform's TO_UNCAC helper to create mapping. Co-developed-by: Vladimir Kondratiev Signed-off-by: Vladimir Kondratiev Co-developed-by: Gregory CLEMENT Signed-off-by: Jiaxun Yang Signed-off-by: Gregory CLEMENT --- arch/mips/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 60c513c51684f..230728d76d11f 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -2346,7 +2346,7 @@ static const char panic_null_cerr[] = void set_uncached_handler(unsigned long offset, void *addr, unsigned long size) { - unsigned long uncached_ebase = CKSEG1ADDR(ebase); + unsigned long uncached_ebase = TO_UNCAC(__pa(ebase)); if (!addr) panic(panic_null_cerr); -- 2.42.0