From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E81F418CBE1; Mon, 23 Feb 2026 13:57:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771855038; cv=none; b=hXO8bzssOr2Zsh/zuQZupCxOTBw10LqLR8DWiC8HtALJXZo87Pj3bFXpN4cH74jBtBTxiSGL3v4Q552P0VvgigZeMoPjrj34oyIvUNjs4c+BVZBBv8gbojKWoEsJ83wg7zNshklxKPvCQEUIjsK8/uYRhVHfX0qAeCpGeEYRinM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771855038; c=relaxed/simple; bh=jimk4cgA6P8145WtS7AypZKTzXi7xwx6dJcxj5oDHJY=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=flwX8tugJZOx7xSqPu0CutCC/fPCD4FZ+kzc8geM8szI5DQ5GMxbZ/dsGzzyVSkDOPwyyyuN042Ag4S9Do+JcN5VkSh4H+oBrBGSZsWuJnS+qyZZL4N7ULQFuyrw0qZOso7k+D98tB9mAX8KccdPqFmxTGdXPKVAOwvW2ss374Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=jrkSoxxO; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="jrkSoxxO" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id A9C0B27E35; Mon, 23 Feb 2026 14:57:07 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id tac2RrMprsBW; Mon, 23 Feb 2026 14:57:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1771855027; bh=jimk4cgA6P8145WtS7AypZKTzXi7xwx6dJcxj5oDHJY=; h=Date:Cc:Subject:From:To:References:In-Reply-To; b=jrkSoxxOqv98EFGeGJpGTfbWycO470StieDpHkpvwSVYOdO+ixUJHSH0/2Txy8R4/ bCEG7Sh9Ln/4+uBuszgWxdqJp0az+MJT2XJ2HTdPUFqkGvbXlKF2zGG0nrE/bbBkpc 06Ps65NKVetf/+bipRD8EqrhjOi2Km7fG1yvBDhUUN7p7SJOleCLskPp7UyvMqRj8U yxrZARhKFgIx+l3MGQOLUht/nEYFJc875duDxCvM9BEAs0iGuIueRmgF67tCP9T3Ff HzjS4vtY86VAjSKqWBLiHJUFhdMfiuM0G6doeDKLSyUx73VJAvVZi7xajZdGJmdyAV V9p7G+qb5lXLw== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 23 Feb 2026 19:26:52 +0530 Message-Id: Cc: , , , , , , Subject: Re: [PATCH v2 06/12] mfd: sec: add support for S2MU005 PMIC From: "Kaustabh Chakraborty" To: "Sander Vanheule" , "Kaustabh Chakraborty" , =?utf-8?q?Andr=C3=A9_Draszik?= , "Lee Jones" , "Pavel Machek" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "MyungJoo Ham" , "Chanwoo Choi" , "Sebastian Reichel" , "Krzysztof Kozlowski" , "Alexandre Belloni" , "Jonathan Corbet" , "Shuah Khan" References: <20260126-s2mu005-pmic-v2-0-78f1a75f547a@disroot.org> <20260126-s2mu005-pmic-v2-6-78f1a75f547a@disroot.org> <69e2c1b1a2f3d2ed5e5da995cc5ee49bb3627597.camel@linaro.org> <4cf24e281fac45637fedf40944d8b5230c0e22d9.camel@svanheule.net> In-Reply-To: <4cf24e281fac45637fedf40944d8b5230c0e22d9.camel@svanheule.net> On 2026-02-20 17:56 +01:00, Sander Vanheule wrote: > Hi, > > On Thu, 2026-02-05 at 21:02 +0530, Kaustabh Chakraborty wrote: >> On 2026-02-04 15:23 +00:00, Andr=C3=A9 Draszik wrote: >> > On Mon, 2026-01-26 at 00:37 +0530, Kaustabh Chakraborty wrote: >> > > +static const struct regmap_config s2mu005_regmap_config =3D { >> > > + .reg_bits =3D 8, >> > > + .val_bits =3D 8, >> > > +}; >> >=20 >> > No cache? And what is the .max_register value? >> >=20 >>=20 >> This was in the previous revision, but I ended up removing it because >> (at least I thought at that time) interfered with interrupts firing in >> some way. The actual issue was unrelated, so I will add it back. >>=20 >> However, there is also another thing I see in logs: >>=20 >> sec-pmic-i2c 2-003d: using zero-initialized flat cache, this may cause >> unexpected behavior >>=20 >> This is due to REGCACHE_FLAT, I am not sure if I should just ignore >> this. > > Sorry to be late to the party, but I'm somewhat responsible for that warn= ing, so > allow me to chime in :-) > > What you are might have been seeing is REGCACHE_FLAT giving you "cached" = values > of 0x0, while the hardware actually has something else. This can cause om= itted > writes, existing (bootloader) config to overwritten, etc. > > As Andr=C3=A9 suggested, using .num_reg_defaults_raw is a possibility, bu= t then you > have to remember that the register defaults are taken to be what the hard= ware > state is at that moment, including pre-probe changes. These defaults are = used to > seed the cache (so far, so good), but this may break the contract of > regmap_sync() if you ever want to use that after actually resetting the P= MIC. > > If you want to use the flat cache, I would suggest you use REGCACHE_FLAT_= S, > which will track what has already been read from/written to hardware. You= will > also need to specifiy .max_register. I had figured that out by going through the logs, thanks. :) > > I see the other regmap_config-s in this driver also use REGCACHE_FLAT, so= you > may want to consider switching those over as well if these are also showi= ng the > new warning. > > > Best, > Sander