From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.43 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796181421; b=X4Qafi/Zb24selQmohwNk8OTrhT2BxmVbrrfbRJuFNkD3RH8j/ApvH30L5O6TzdlSbuJ vJ0bPci7G/69sboIvTdd9scXoIUytxGjWpZCSyjXEBhEktnuCzyKD4GseG8gV7MJXN7yD j439IdFUqBdp2epw6vUh2cTTWmFUqvOVbyGs0Z+AQpV61MKb2UKwvOmyWS6o9LLODMfJ7 WNUrishTHeyT3iefVT8c2f0vmio6xrQtm4VVgSCR3YWIyqb9e28zyKINBtiB81QIDDTcU jokkE1jK9nzAsyHe6VEsphfdoUUYBSNgo0wkaTSaEVwtB8ouUmc2UPGGOU/Tbfh8FKA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796181421; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=zg42j07HhZyxm5Sle/CMP5m3Fsb5VRXlaLNy87tKqm8=; b=DoWKRBotXsabbrPNnxkv/4mYLjynb3UBQ07FgeBf8lFyUisE1U6/d2x8wprpqawtzJAQ BY+R61Io4bc4MtgMZvHYAX8NWcO7JL3inlnWch2BqtLakLfipNF3ILZPqy04tJkq6GtSj HgAhvYRT+SNs4SheCY4ZDtAiKVuE18RxSw3sVM9jHM4QrGEG5ai3Kup72Io3hbc2gP5lG bLaSczgcr447UB2Umt0EaCkXY90+ypawYCTQJH6oxYywYkuk6Eq3UPgQYiUi2qrJwP930 tLTg5AtsSM78/g3sUz/46R9HEJ0c3KBy3IHnQO8LRtBPYmXviyu5aOOEjMPvaexhuQw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=b5Ipzw6C; arc=none smtp.remote-ip=209.85.221.43 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A58660A2606 for ; Wed, 2 Dec 2026 03:17:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0A58660A2606 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=b5Ipzw6C Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-498f5fa5103so7450813f8f.2 for ; Tue, 01 Dec 2026 19:17:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796181419; x=1796786219; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=zg42j07HhZyxm5Sle/CMP5m3Fsb5VRXlaLNy87tKqm8=; b=b5Ipzw6CtkZF+heENkqsXslh61oCjg0Ey8DKCyVjRmguR/NqUXQYM3MB/dR6H/cyi9 eMrmBqdYCRmUQ9CsoycyA/jqQpiqA2mLU3VUUDRIxTMl73dy62dxsZef7nRkVWLbGS3Z 2JYoCan0r7FLfWK14TcJZ6JC8F1zEQ4W7nR1ly19plLiUEAK6JYwa6JQkJkYXyy3++qR CrjwFIGFJZi1lUlueQNEpdjPI4Ba5vbz0W6XbI9ecjbXSFB7JnKiaGXcF3Gcs1TENZVu kfpbOMXVNuARsJQRcr8bFj6eArbbusdKNa4Npzq0l26OlWA6LgwYRdtarroQ0KNkzhJr iuTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796181419; x=1796786219; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=zg42j07HhZyxm5Sle/CMP5m3Fsb5VRXlaLNy87tKqm8=; b=GmM7cgvdXEPAnd+YEESBMVnt/Np9h410Jg8UP1q424SyDIEzEx0hoqIIWpPigo3PL+ HHgUpmK6HGXBS+/i8H0XEoqcmKroMVjJNfIIk/M2oDF9IG0Af3VrWvs6BnbvXiSyueak 2o8t1SnFiLcjPuGIP44H/9cSL3qC2DsgHlMpnCi+z0In5W//hEXGxKWpKDth171wVR2Q ZCI0xBJRgrBmxkSEez62w4BzywYB//1u5dWnZAB2fp7n3qFt3d0pk+JhtcSoCUDqYpWT RYuXdQYGRLN6cAeWxS0OddlupDInAWj0vry6+HOU9kNaDClV4g8vuO796zgmdR36TT3L SmDg== X-Forwarded-Encrypted: i=1; AL+hErHaejhJBj4/eUqumn5SX7wrscDH74WNiR6pTdHlTu+5VWcM0ZGImTi8klwU4EVx4WeFDguCXjhtD6k=@vger.kernel.org X-Gm-Message-State: APuU4Z/KdAuHJTxdM+wxFWlbO2Faf9Gbe5/2xLqHpqJsUPW9WCSzFUVG zil0dk57Dgs7SgjnRXGB8M190/gteV5grNUlfxucniFVQ9DFZh0SCOZn X-Gm-Gg: AZFdTZeR9fMIM8ZZ7qSS4mCGEY+eAuHPS8yt0Mxt0V5O25Wg+860LO5U+WJJ7CnjCpP 1Mr8yqha/x5Sj057qBbDvistnMwciQlqUhOALnPJlH5MsILp/u21I4kiUG/4ZXqnmOvJcY35fJg i1hTzN2G5MjAZ1us4FyCJhLJ9wPsk8Hg4jHJZ7c0AQ1uktuY9cmScErFL/BmS6VkzuEh9lKQmTU evjk68C7IbIW2W79OUglh/EDoInBLNw0v+9t2QoXn/a4Jl50Gguur2djTaumrpA47ioiH88GUZ7 l2+pU48cAD5RcW61Lbyow9Ti70l2akUBJVJGxXWDM8WURz48uOhE/8ybuy9avgwA+LGt1r1JPwD vK5pHTU5yqhMmDe9uUNjJ+mouRZej4nKw00DSAU3lDXgIsT+8ACicbc9e9fvEBUPKXfwNhRolu8 TCcqxsakHBswFmLnGvLKeneXqkSIDXV5lQkDbnfSyfvc2qzf4+AQnsfLdDAE5UmuPqyh3dWQjP/ ISxJ3SZFSdb2Jpe5+uF3GZKNPPotSGVSZ5bNwJ2A8gxoo7ItQZany+wC3oQCGoxUsNXxie6B7pc NzV3gZSvNJKd9UJXp7jBK/8Tvfntl5o5c67UQYN2APJYmWOUKpOORjjchZY= X-Received: by 2002:a05:6000:2085:b0:49c:192f:cf20 with SMTP id ffacd0b85a97d-4abacfea524mr75503162f8f.6.1796181419500; Tue, 01 Dec 2026 19:16:59 -0800 (PST) Received: from NULL.Home.net ([2001:8a0:7280:4000:12d:c3b9:cecc:8966]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4b34e9c3ffesm61468691f8f.19.2026.12.01.19.16.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 19:16:58 -0800 (PST) From: Eric Curtin To: linux-kernel@vger.kernel.org Cc: Eric Curtin , Ulf Hansson , linux-mmc@vger.kernel.org Subject: [RFC PATCH v2 03/13] mmc: mmc_test: Allocate the scratch buffer with the test buffer Date: Wed, 2 Dec 2026 03:16:24 +0000 Message-ID: <20261202031647.1690622-4-ericcurtin17@gmail.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261202031647.1690622-1-ericcurtin17@gmail.com> References: <20261202031647.1690622-1-ericcurtin17@gmail.com> X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Eric Curtin With arm64 boot-time page size selection PAGE_SIZE is not a compile-time constant. BUFFER_SIZE is derived from it, so struct mmc_test_card can no longer embed a scratch[BUFFER_SIZE] array. Make scratch a pointer into the same allocation as the flexible buffer member: allocate 2 * BUFFER_SIZE in mtf_test_write() and point scratch at the second half. No functional change for compile-time page sizes. Signed-off-by: Eric Curtin --- drivers/mmc/core/mmc_test.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c index 4dc16649e61d..686e91b36ab6 100644 --- a/drivers/mmc/core/mmc_test.c +++ b/drivers/mmc/core/mmc_test.c @@ -138,12 +138,12 @@ struct mmc_test_dbgfs_file { * @highmem: buffer for highmem tests * @area: information for performance tests * @gr: pointer to results of current testcase - * @buffer: transfer buffer + * @buffer: transfer buffer, followed by the scratch buffer */ struct mmc_test_card { struct mmc_card *card; - u8 scratch[BUFFER_SIZE]; + u8 *scratch; #ifdef CONFIG_HIGHMEM struct page *highmem; #endif @@ -3088,7 +3088,7 @@ static ssize_t mtf_test_write(struct file *file, const char __user *buf, if (ret) return ret; - test = kzalloc_flex(*test, buffer, BUFFER_SIZE); + test = kzalloc_flex(*test, buffer, 2 * BUFFER_SIZE); if (!test) return -ENOMEM; @@ -3099,6 +3099,7 @@ static ssize_t mtf_test_write(struct file *file, const char __user *buf, mmc_test_free_result(card); test->card = card; + test->scratch = test->buffer + BUFFER_SIZE; #ifdef CONFIG_HIGHMEM test->highmem = alloc_pages(GFP_KERNEL | __GFP_HIGHMEM, BUFFER_ORDER);