From patchwork Fri Jul 12 08:13:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13731379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E8EB5C3DA45 for ; Fri, 12 Jul 2024 08:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=/Q6SnWYOKzUq/XdFAkjsYAi7SrIZAt1+X/u8VIJ4I4U=; b=vmwF813K2bytifW86KhhThRt0v BpwlEPW7uoFikLZMevZWjvXCiSstaa7onURjdO23if5d1cCk8XSFNsKB8pUxJz/3S3xlrGItfdePm byJzTny4eVBs9jix7oMpKVAfxownLDem47fisGG/ZlX9d2NRYH9Q/vmLgv2tJJY5DRv3GFNNILNwK HwsNygjckpd7m2qINg+X7R8wZuQ1h9vWVuE9rCmvk4q6E65tXKAx75LR1tIOSYjnTTbZCJMk5ZVXP EMwSNfbX2qXRVdDRE6OaSZQQUrohPut+Ly8oWrnIL6H/OMVFWKyC6lyoeHKccrk5+N/wAdA58LdNz 8aRh5UEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSBPJ-0000000GrGN-0tqG; Fri, 12 Jul 2024 08:13:33 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSBP0-0000000GrBT-15O1 for linux-arm-kernel@lists.infradead.org; Fri, 12 Jul 2024 08:13:16 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-58e76294858so5020439a12.0 for ; Fri, 12 Jul 2024 01:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1720771992; x=1721376792; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/Q6SnWYOKzUq/XdFAkjsYAi7SrIZAt1+X/u8VIJ4I4U=; b=r2U2PhPi6UypqV8TsTHnJ7ZKftlOX6CkrI2VH4FKMHwgRypagiVYG2LwnSc6F8vWqA v/JOt5Ll/3tk4IP+b/rBPMC8GWLTGdtzZSC2kAJumfkz8Z0cn3pPRA6SjRiSP7no872A 8wx/YoRkXni5BbZ7xSlZSgr367BWW7M4PG9h7HII1MM+ce15RZbgli1+nqS0rRRAuCK9 8Ej5dGGsxjLQ26Uzz67hzOyfbT+GRsGqwYAGVq5t9Tej4qU0XZhAp6dLHYbFzrt64mcB 3lTgb1Cxmeai784J/wrPAkUC1sTHlkevDiEUf7aLNTr8KPoC3g4etOeWU1qhfJ1xw7Uf Gjgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720771992; x=1721376792; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/Q6SnWYOKzUq/XdFAkjsYAi7SrIZAt1+X/u8VIJ4I4U=; b=nXUZtgu0s5ZdieP5tDBenlq0Qp2WK3HY0Cn4pLMIcp6VNI+ZeLrXgBu54MYGoov7GK AFJOokN6z4M6SWtgexqlBqDEfg4IHRofOJZQfOSfY/qQTfxQuAq6NUFxx2dDOYeoNKYA jojML5m5LRII8VjBCCmSKiLHXRSpRSDBRj5Y6iYUnDNHaSD+cEmS+31oowqwGmpXIFEG DC9qATzXfbw6HmO5maTAiWs9zzHotbhhaIFMXesSYd+WXfzO/9HuvpUHZcfJg4VAYe00 xMDrq/jvhq0wakMSWjhobDsmsauc1JZOrh3VhdbAOnSKhD7mnvVbL0GXa7K9lLCgjXMW QtlQ== X-Gm-Message-State: AOJu0YxsE3xCnc/bSDDSQmm+KxLqcp65fdGClgGSTFWsUqE1s4T2NUg8 7tukPi1aBxqXb1G0J4l9n8CDqQC1mDyE6NB0V91uQhJXeHPUGt+RFti+NohN5Bw= X-Google-Smtp-Source: AGHT+IHS7NGDaHTwuQMcCRnAhVHpnO0Iy67ZsHPpJfoW4fp+aCGsThqN0bMCirfMABK2IWPna2AbbA== X-Received: by 2002:a17:907:7288:b0:a72:9ebe:29da with SMTP id a640c23a62f3a-a799d3a4505mr164750266b.35.1720771992103; Fri, 12 Jul 2024 01:13:12 -0700 (PDT) Received: from localhost (p50915eb1.dip0.t-ipconnect.de. [80.145.94.177]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a780a6bc8b8sm323532166b.30.2024.07.12.01.13.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jul 2024 01:13:11 -0700 (PDT) From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Thomas Petazzoni Cc: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2] ARM: mvebu: Warn about memory chunks too small for DDR training Date: Fri, 12 Jul 2024 10:13:01 +0200 Message-ID: <20240712081302.901842-2-u.kleine-koenig@baylibre.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1571; i=u.kleine-koenig@baylibre.com; h=from:subject; bh=pb0TlP7XYrBHDz8iFTvePFAyTHjlNJw8n32MhNfvpa8=; b=owGbwMvMwMXY3/A7olbonx/jabUkhrQJT/sde2N5bnK5hi1gl9K9tjuub6vtV71VVjlZe6bML Q+bI1LbyWjMwsDIxSArpshi37gm06pKLrJz7b/LMINYmUCmMHBxCsBEwqQ4GFa4Z27zYPM472wm 48VSdPsHc6dQhWm78XeN7epcpzPirTM/L7WZMLPnvtyMgul8p4oK5LsvP8j48sm8brVv4JkIwbf 6LxqKI9JFDzaf21b5N9/nuYR8xqXlMnlBC/gfl82R7HieI92loB+2vnTBRy1O/0k70nmPVazUmf 6A/dtH11eqhh3aqkqf+OufL27kmfii95iypu6jAmZrDp2LG/4y6jCc1jnb/PVKnHu8HOs5h/4dd vqmx3WSir+zRBj7rTMNfvTjM8e9fbvKQnZuE203WN16b/nxA4+iNHoWLNcMMFm59+JJcftNizg7 Zr9Rsm+NTtV72pfo5zW34ejLnWXr99zRdVsaoeQu99EcAA== X-Developer-Key: i=u.kleine-koenig@baylibre.com; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240712_011314_420383_8F4A390F X-CRM114-Status: GOOD ( 14.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org For each memory region the first 10K are reserved for DDR training. Emit a warning if the area happens to be smaller than these 10K. This should not happen, but if it does this message simplifies diagnosing the problem. This fixes a W=1 compiler error: arch/arm/mach-mvebu/board-v7.c: In function ‘mvebu_scan_mem’: arch/arm/mach-mvebu/board-v7.c:84:27: error: variable ‘size’ set but not used [-Werror=unused-but-set-variable] 84 | u64 base, size; | ^~~~ Signed-off-by: Uwe Kleine-König Reviewed-by: Andrew Lunn --- Hello, the (implicit) first iteration of this patch is available at https://lore.kernel.org/linux-arm-kernel/20240708093145.1398949-2-u.kleine-koenig@baylibre.com/ In this v2 the size variable is evaluated to emit a warning instead of being dropped, which was done in v1. Best regards Uwe arch/arm/mach-mvebu/board-v7.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c index fd5d0c8ff695..04ad651d13a0 100644 --- a/arch/arm/mach-mvebu/board-v7.c +++ b/arch/arm/mach-mvebu/board-v7.c @@ -86,6 +86,9 @@ static int __init mvebu_scan_mem(unsigned long node, const char *uname, base = dt_mem_next_cell(dt_root_addr_cells, ®); size = dt_mem_next_cell(dt_root_size_cells, ®); + if (size < MVEBU_DDR_TRAINING_AREA_SZ) + pr_warn("Too little memory to reserve for DDR training\n"); + memblock_reserve(base, MVEBU_DDR_TRAINING_AREA_SZ); }