[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ffa73a17-ac32-493f-b0a4-32d3ac4c9027@opensource.cirrus.com>
Date: Fri, 17 May 2024 12:58:30 +0100
From: Richard Fitzgerald <rf@...nsource.cirrus.com>
To: Guenter Roeck <linux@...ck-us.net>
CC: <broonie@...nel.org>, <linux-kernel@...r.kernel.org>,
<patches@...nsource.cirrus.com>
Subject: Re: [PATCH 04/11] regmap: kunit: Run sparse cache tests at non-zero
register addresses
On 16/05/2024 20:53, Guenter Roeck wrote:
> Hi,
>
> On Mon, Apr 08, 2024 at 03:45:53PM +0100, Richard Fitzgerald wrote:
>> Run the cache_drop() and cache_present() tests at blocks of addresses
>> that don't start at zero.
>>
>> This adds a from_reg parameter to struct regmap_test_param. This is
>> used to set the base address of the register defaults created by
>> gen_regmap().
>>
>> Extra entries are added to sparse_cache_types_list[] to test at non-zero
>> from_reg values. The cache_drop() and cache_present() tests are updated
>> to test at the given offset.
>>
>> The aim here is to add test cases to cache_drop() for the bug fixed by
>> commit 00bb549d7d63 ("regmap: maple: Fix cache corruption in
>> regcache_maple_drop()")
>>
>> But the same parameter table is used by the cache_present() test so
>> let's also update that to use from_reg.
>>
>> Signed-off-by: Richard Fitzgerald <rf@...nsource.cirrus.com>
>
> With this patch in mainline, I get lots of errors such as
>
> [ 23.494308] =============================================================================
> [ 23.496391] BUG kmalloc-64 (Tainted: G N): kmalloc Redzone overwritten
>
Just a random thought, I wonder whether in gen_regmap() this:
if (config->num_reg_defaults)
config->max_register += (config->num_reg_defaults - 1) *
config->reg_stride;
else
config->max_register += (BLOCK_TEST_SIZE * config->reg_stride);
should be:
config->max_register += max(config->num_reg_defaults - 1,
BLOCK_TEST_SIZE) * config->reg_stride;
I've only had a quick scan through the code without seeing any other
obvious problem.
Powered by blists - more mailing lists