Message ID | 20231123152639.561231-12-gregory.clement@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp525976vqx; Thu, 23 Nov 2023 07:28:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IEyceAy4/55ImlndsoPmF8soLScOVoBsQ2p3Y7x6UnzDnBiYgAY/f7mYsz6/qd4ZO8a/p15 X-Received: by 2002:a17:902:c086:b0:1cf:8c7a:ed20 with SMTP id j6-20020a170902c08600b001cf8c7aed20mr1657925pld.27.1700753283579; Thu, 23 Nov 2023 07:28:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753283; cv=none; d=google.com; s=arc-20160816; b=paKetwcS8zai4TmZ4xbcuPv1TVkJkQsjn2V4VElovJZSX4vPuQo4wSb0OFqxwRdh7/ lkqjKkQ9lBU8e7STUGN9j0BQrobR6+5OmP2RWg+SAKiw0J7dCtpvKAhHgLne1ivvHySv V5X/QHnHu8k99fYkUIV9Ciz9OGyh6V3lY6t7Gj/x3X2w01nbhJOfcyVNeQzla3cj6Yii 2DlwNJBcqOYgfvRNV5th45W3t1o7if3mbnciMKpypApXXz3sP6DkFsCQTEAZy9mGWKAa tDV/ZVwahHjeCWe+eMs4UlW1WB4uVOtRyV7Xx5zJHGltHWqE2fowDwix9rUZ6E5JZghK FNTQ== 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=RcHHna0h/IgIzh58pWB4uS96fnTDDQBk114hJ4c/spg=; fh=t1bsw/gEI8w3DN7ouBpAewoQyybWh2yxEgAHixB9Iis=; b=GTz1MTfwevQbOjt9Okoe52ly+lCrqQ78/IPrJ1dbKWdDnmEU/4/P0Dc27aEAd/J/ni 9SKixuE/ai52Pets3eiN76spyF1reUHIxadpaeYrr8OIEkRghGXYOEXbTMQLDcjVgeO5 oJPCukwm3Inusrj8OZLbzRVxAkC29B17N8WDYZu+/ZKvVSJRJxuTzkPXdaMis/DoOguh F6B9ZEMwABclEhtdgm8CqLcooZhth383lqpA/6ZlDj00fG+mGLrkuvncqs7V3HYUcMzz ntYjeKu2bhcXlmgLrzq+V/ZrlXSghbXZsJA18ffn2cVVOcwQCSkEDbql6yEcx1oBEGT9 y0Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=E+jrrnH0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id t9-20020a170902bc4900b001cf5cd7c402si1314849plz.9.2023.11.23.07.28.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=E+jrrnH0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 05E52809779E; Thu, 23 Nov 2023 07:27:54 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346157AbjKWP1e (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Thu, 23 Nov 2023 10:27:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346147AbjKWP1C (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 23 Nov 2023 10:27:02 -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 7A1291B2; Thu, 23 Nov 2023 07:27:05 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9054A20004; Thu, 23 Nov 2023 15:27:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753224; 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=RcHHna0h/IgIzh58pWB4uS96fnTDDQBk114hJ4c/spg=; b=E+jrrnH0co7LYu4/GnGewYeLa1EUyGx6KlvfCrPmUt1PjaTCw1sLJBlY44E5cHxqYMQTvQ cSpc5252sJDrCfephHLtcbwTVgUd1qJTdCYuQsIlGC/PKrc83eGjKKTYk/31Copsxv+LCK 115+HtMK732jm6aiFTBDGa387GQ0Cu2bc00hT1XVHRzZJXYPnbXOFCeLFJqK8t0HPUxL4+ WPv5Jv+SQBtWf+OZvjeN51sV38ZgjUAvg2STXQc55653nKYzbXUO3L4dq8IeV+/RRgccL/ tphMGs94TvwtZ4ZU9dBIBCMLbe7MxNZJVJIDAIhzJFT32lopeQnw8blt5RuODw== From: Gregory CLEMENT <gregory.clement@bootlin.com> To: Paul Burton <paulburton@kernel.org>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, linux-mips@vger.kernel.org, Jiaxun Yang <jiaxun.yang@flygoat.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>, Tawfik Bayouk <tawfik.bayouk@mobileye.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= <theo.lebrun@bootlin.com>, Thomas Petazzoni <thomas.petazzoni@bootlin.com> Subject: [PATCH v2 11/21] MIPS: traps: Enhance memblock ebase allocation process Date: Thu, 23 Nov 2023 16:26:28 +0100 Message-ID: <20231123152639.561231-12-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=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:27:54 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369074925893071 X-GMAIL-MSGID: 1783369074925893071 |
Series |
Add support for the Mobileye EyeQ5 SoC
|
|
Commit Message
Gregory CLEMENT
Nov. 23, 2023, 3:26 p.m. UTC
From: Jiaxun Yang <jiaxun.yang@flygoat.com> We try to allocate from KSEG0 accessible space first, and then if we really can't allocate any memory from KSEG0 and we are sure that we support ebase in higher segment, give it another go without restriction. This can maximize the possibility of having ebase in KSEG0. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> --- arch/mips/kernel/traps.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index b6e94654f6211..68f1dd54cde1c 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -2399,7 +2399,12 @@ void __init trap_init(void) memblock_reserve(ebase_pa, vec_size); } else { vec_size = max(vec_size, PAGE_SIZE); - ebase_pa = memblock_phys_alloc(vec_size, 1 << fls(vec_size)); + ebase_pa = memblock_phys_alloc_range(vec_size, 1 << fls(vec_size), + 0x0, KSEGX_SIZE - 1); + + if (!ebase_pa && (IS_ENABLED(CONFIG_EVA) || cpu_has_ebase_wg)) + ebase_pa = memblock_phys_alloc(vec_size, 1 << fls(vec_size)); + if (!ebase_pa) panic("%s: Failed to allocate %lu bytes align=0x%x\n", __func__, vec_size, 1 << fls(vec_size));