[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <56328447-4cab-4446-b8be-63fad2a6217f@oss.qualcomm.com>
Date: Mon, 20 Oct 2025 16:19:19 +0100
From: Srinivas Kandagatla <srinivas.kandagatla@....qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>,
Alexey Klimov <alexey.klimov@...aro.org>
Cc: broonie@...nel.org, gregkh@...uxfoundation.org, srini@...nel.org,
rafael@...nel.org, dakr@...nel.org, make24@...as.ac.cn, steev@...i.org,
linux-kernel@...r.kernel.org, linux-sound@...r.kernel.org,
linux-arm-msm@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] regmap: slimbus: fix bus_context pointer in
__devm_regmap_init_slimbus
On 10/20/25 12:15 PM, Dmitry Baryshkov wrote:
> On Mon, Oct 20, 2025 at 02:55:57AM +0100, Alexey Klimov wrote:
>> Commit 4e65bda8273c ("ASoC: wcd934x: fix error handling in
>> wcd934x_codec_parse_data()") revealed the problem in slimbus regmap.
>> That commit breaks audio playback, for instance, on sdm845 Thundercomm
>> Dragonboard 845c board:
>>
>>
>> The __devm_regmap_init_slimbus() started to be used instead of
>> __regmap_init_slimbus() after the commit mentioned above and turns out
>> the incorrect bus_context pointer (3rd argument) was used in
>> __devm_regmap_init_slimbus(). It should be &slimbus->dev. Correct it.
>> The wcd934x codec seems to be the only (or the first) user of
>> devm_regmap_init_slimbus() but we should fix till the point where
>> __devm_regmap_init_slimbus() was introduced therefore two "Fixes" tags.
>>
>> Fixes: 4e65bda8273c ("ASoC: wcd934x: fix error handling in wcd934x_codec_parse_data()")
>> Fixes: 7d6f7fb053ad ("regmap: add SLIMbus support")
>> Cc: stable@...r.kernel.org
>> Cc: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
>> Cc: Ma Ke <make24@...as.ac.cn>
>> Cc: Steev Klimaszewski <steev@...i.org>
>> Cc: Srinivas Kandagatla <srini@...nel.org>
>> Signed-off-by: Alexey Klimov <alexey.klimov@...aro.org>
>> ---
>>
>> The patch/fix is for the current 6.18 development cycle
>> since it is fixes the regression introduced in 6.18.0-rc1.
>>
>> drivers/base/regmap/regmap-slimbus.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/base/regmap/regmap-slimbus.c b/drivers/base/regmap/regmap-slimbus.c
>> index 54eb7d227cf4..edfee18fbea1 100644
>> --- a/drivers/base/regmap/regmap-slimbus.c
>> +++ b/drivers/base/regmap/regmap-slimbus.c
>> @@ -63,7 +63,7 @@ struct regmap *__devm_regmap_init_slimbus(struct slim_device *slimbus,
>> if (IS_ERR(bus))
>> return ERR_CAST(bus);
>>
>> - return __devm_regmap_init(&slimbus->dev, bus, &slimbus, config,
>> + return __devm_regmap_init(&slimbus->dev, bus, &slimbus->dev, config,
>
> Looking at regmap_slimbus_write(), the correct bus context should be
> just 'slimbus' (which is equal to '&slimbus->dev', because dev is the
> first field in struct slimbus_device. So, while the patch is correct,
> I'd suggest just passing slimbus (and fixing __regmap_init_slimbus()
> too).
+1
I agree, it adds more clarity to just pass slimbus instead of dev.
--srini> >> lock_key, lock_name);
>> }
>> EXPORT_SYMBOL_GPL(__devm_regmap_init_slimbus);
>> --
>> 2.47.3
>>
>
Powered by blists - more mailing lists