Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp419818rdh; Thu, 23 Nov 2023 07:28:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IEiGghoMyf1hYb9bdGCtZYxox1qdd8as+m2jEPh+40e+82DV4UpzzoOhILy6hZuOD2oJyaH X-Received: by 2002:a17:90b:4d89:b0:280:a68d:7a35 with SMTP id oj9-20020a17090b4d8900b00280a68d7a35mr5574745pjb.22.1700753310749; Thu, 23 Nov 2023 07:28:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753310; cv=none; d=google.com; s=arc-20160816; b=Ng0oHc5ontEWuPTsBj4sfOoiasXBUrhMnZhGR9ONUqtvV/J2dhT9VB9uqf1eumCAk7 dYQYBrnSuV5wsqFs+rXInqazTTtw/KZ1L2Sc6dFZHbKeopD1nVd6/WSD8a6p5PVqxYr0 q21MsKylpI+b8QRCwW5infX2/UYAjHIE/c/R2SpAHeGQtBxZmBkUf4q3g/0WqY/XsG2x 4PES+BGa1ps+QIvpfm7PNYz21YPpNY5uj6QnfbnpCEEnKg+TnToJp8C0mtiZM6qUybMA V6NTiDaPOE709jFSA3qmLGpA90uN/i1Ig4JX6E2MZg0l1bx7h1zHEMRqdTf098MdPqtl R8yA== 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=wWK6xfLplLvEvcY7Jg4NJGZvXnrqiDe4P1zn8/qCbb56WfFiB0oIcQcKR1kJTf7wBq bCgOUxvuhiniUC5exslsFepewA0X4wZUbiEkDk9xjQ03Ay6kfZz0qHTtMPAvtB+9VD/l xHvTPe0Sr+hU65Navex25UQCol85KegcpqxM9sYxux0MjvyuP1hGDH1mcLYS9z7FMWf7 UIRFOrqP21dlHyvHE5nkST3qwzrQS63bpYlLEKUvo7EDNFYSp0BmpKrUqUkuk5DWBm71 D8wlC07CNdROjzagy9AoU9fObkSgDLWsU8couXiG7UDP9HS0oAHsUS7AMnUTHb7PECi9 M1GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZyUeG8Gm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id i88-20020a17090a3de100b0028558b6968csi1463396pjc.165.2023.11.23.07.28.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZyUeG8Gm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 7724C804E796; Thu, 23 Nov 2023 07:27:28 -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 S1346093AbjKWP1F (ORCPT + 99 others); Thu, 23 Nov 2023 10:27:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346094AbjKWP04 (ORCPT ); Thu, 23 Nov 2023 10:26:56 -0500 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0B89D5E; Thu, 23 Nov 2023 07:26:57 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 218EC1C000C; Thu, 23 Nov 2023 15:26:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753216; 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=ZyUeG8Gm+sMaJnHdGPCXyZewQiTEPz/bVoTucKeHECnCDWfWMnvBBHSoXcEupsTz63mDbC mgv1l9nZz0ysBV9yMeHXBdzl9UcVtA3RyOpIks+mVM/Skpv9E2MDUwSULVDA4P73143q1X RPZsNAU1sMjISDKIX18mQx+QGGxcKUsiPwUH/ZJDXaMcUr9iJvYFlfE0d1/cCSDFWUz+54 YX1FXgRozd2wJljHojVBRzN6o2+IYS3eDYG3nVLZ0nMmPe4IidM+BZWTRx7MJEV8LBAGk1 0mC3s3QPUTiN1sO8oQTJpVCHYkvRysSuSso/qTagPSbIX+8wa9/OL+mTFZqH2w== 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 v2 05/21] MIPS: Fix set_uncached_handler for ebase in XKPHYS Date: Thu, 23 Nov 2023 16:26:22 +0100 Message-ID: <20231123152639.561231-6-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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]); Thu, 23 Nov 2023 07:27:28 -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