lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABqG17hE+2F9y1=JZFRuJtLecFtx0XJBzt-a0HSyE3VRoqdzCQ@mail.gmail.com>
Date: Fri, 3 May 2024 00:04:29 +0530
From: Naresh Solanki <naresh.solanki@...ements.com>
To: Guenter Roeck <linux@...ck-us.net>
Cc: Jean Delvare <jdelvare@...e.com>, linux-hwmon@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] hwmon (max6639): Use regmap

Hi Guenter,

On Thu, 2 May 2024 at 23:52, Guenter Roeck <linux@...ck-us.net> wrote:
>
> On 5/2/24 10:25, Naresh Solanki wrote:
> [ ... ]
>
> >>> +     u8 pwm[MAX6639_NDEV];           /* Register value: Duty cycle 0..120 */
> >>
> >> pwm caching needs to be dropped as well. It is no longer initialized in
> >> max6639_init_client(), but updated and later used in pwm_store() and
> >> pwm_show(). Looking at the datasheet, the pwm registers are volatile
> >> and should not be cached in the first place.
> > Yes. I did that but found that the register is write only. i.e.,
>
> Odd. The datasheet says that it is r/w or, rather, that reading it returns
> the _current_ pwm value and writing it sets the target pwm value in pwm mode.
>
> What happens when the register is read ?
Upon revisiting the datasheet and conducting further testing, it appears that
my previous response was inaccurate.
After testing, it's clear that it reads what is being written & hence
it's perfectly
fine to remove variable pwm[] from local caching.
Verified using below command:
----
i2cset -f -y 130 0x2e 0x26 0x10; i2cget -f -y 130 0x2e 0x26
0x10
----

Regards,
Naresh

>
> Thanks,
> Guenter
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ