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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241208171642.2bbfa5aa@jic23-huawei>
Date: Sun, 8 Dec 2024 17:16:42 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Yu-Hsian Yang <j2anfernee@...il.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
 avifishman70@...il.com, tmaimon77@...il.com, tali.perry1@...il.com,
 venture@...gle.com, yuenn@...gle.com, benjaminfair@...gle.com,
 lars@...afoo.de, robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
 nuno.sa@...log.com, dlechner@...libre.com, javier.carrasco.cruz@...il.com,
 marcelo.schmitt@...log.com, olivier.moysan@...s.st.com,
 mitrutzceclan@...il.com, tgamblin@...libre.com, matteomartelli3@...il.com,
 alisadariana@...il.com, gstols@...libre.com, thomas.bonnefille@...tlin.com,
 ramona.nechita@...log.com, mike.looijmans@...ic.nl,
 chanh@...amperecomputing.com, KWLIU@...oton.com, yhyang2@...oton.com,
 openbmc@...ts.ozlabs.org, linux-iio@...r.kernel.org,
 devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] iio: adc: add Nuvoton NCT720x ADC driver

On Wed, 4 Dec 2024 17:05:19 +0800
Yu-Hsian Yang <j2anfernee@...il.com> wrote:

> Dear Andy Shevchenko,
> 
> Andy Shevchenko <andriy.shevchenko@...ux.intel.com> 於 2024年12月4日 週三 下午12:27寫道:
> >
> > On Wed, Dec 04, 2024 at 11:20:20AM +0800, Yu-Hsian Yang wrote:  
> > > Andy Shevchenko <andriy.shevchenko@...ux.intel.com> 於 2024年12月3日 週二 下午9:50寫道:  
> > > > On Tue, Dec 03, 2024 at 05:15:40PM +0800, Eason Yang wrote:  
> >
> > ...
> >  
> > > > Second, why do you need two regmaps? How debugfs is supposed to work on the
> > > > registers that are 16-bit if you access them via 8-bit regmap and vice versa?
> > > >
> > > > Can't you simply use bulk reads/writes when it makes sense and drop 16-bit
> > > > regmap completely?  
> > >
> > > Read VIN info can use word read or byte read, and other registers
> > > should use byte read.
> > >
> > > For a reviewer's comment, If the i2c controller allows word read then the
> > > right thing is to always use it.  
> >
> > But how does this differ to bulk read of two sequential 8-bit offsets?
> > And if there is a difference, shouldn't this be addressed on regmap level for
> > all? Like testing for the supported flags and access registers based on the
> > controller capability and user request.
> >  
> 
> We would explain why we use two regmaps.
> In the beginning, we declare a property read-vin-data-size for user to
> select byte read or word read.
> After discuss with reviewers, we don't need this property.
> So I get rid of this property and take word read vin data first.
> We can't use regmap_bulk_read since the vin data is not sequential.
> 
> For Nuvoton NCT7201/NCT7202 chip,
> Take an example as to Vin1:
> The VIN reading supports Byte read (One Byte) and Word read (Two Byte)
> 
> For Byte read:
> First read Index 00h to get VIN1 MSB, then read Index 0Fh Bit 3~7 to
> get VIN1 LSB.
> Index 0Fh is a shared LSB for all VINs.
> 
> For Word read:
> Read Index 00h and get 2 Byte (VIN1 MSB and VIN1 LSB).

Yeah. This is a really weird device.  2 regmaps is probably
the best option.  The regmap access tables or functions can be used to
avoid the debugfs problem Andy mentioned.

Jonathan

> 
> > --
> > With Best Regards,
> > Andy Shevchenko
> >
> >  


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ