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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <40594542-ac60-0ff7-8474-a93f678a99be@quicinc.com>
Date: Wed, 22 May 2024 16:26:41 +0530
From: Mohammad Rafi Shaik <quic_mohs@...cinc.com>
To: Mark Brown <broonie@...nel.org>
CC: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        Banajit Goswami
	<bgoswami@...cinc.com>,
        Liam Girdwood <lgirdwood@...il.com>, Rob Herring
	<robh@...nel.org>,
        Krzysztof Kozlowski <krzk+dt@...nel.org>,
        Conor Dooley
	<conor+dt@...nel.org>, Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai
	<tiwai@...e.com>, <alsa-devel@...a-project.org>,
        <linux-arm-msm@...r.kernel.org>, <linux-sound@...r.kernel.org>,
        <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <quic_rohkumar@...cinc.com>, <quic_pkumpatl@...cinc.com>
Subject: Re: [PATCH v4 2/7] ASoC: codecs: wcd937x-sdw: add SoundWire driver

On 5/16/2024 5:17 PM, Mark Brown wrote:
> On Thu, May 16, 2024 at 10:17:56AM +0530, Mohammad Rafi Shaik wrote:
> 
>> +static const struct reg_default wcd937x_defaults[] = {
> 
>> +	{ WCD937X_DIGITAL_EFUSE_REG_0,				0x00 },
>> +	{ WCD937X_DIGITAL_EFUSE_REG_1,				0xff },
>> +	{ WCD937X_DIGITAL_EFUSE_REG_2,				0xff },
>> +	{ WCD937X_DIGITAL_EFUSE_REG_3,				0xff },
> 
> Given the name I'd expect these to vary per device so not have default
> values.  In general ID, status or volatile registers probably shouldn't
> have defaults since they should be read from the device.
> 

Thanks for the review,

Will cleanup those.
>> +static bool wcd937x_readonly_register(struct device *dev, unsigned int reg)
>> +{
>> +	switch (reg) {
> 
>> +	case WCD937X_DIGITAL_CHIP_ID0:
>> +	case WCD937X_DIGITAL_CHIP_ID1:
>> +	case WCD937X_DIGITAL_CHIP_ID2:
>> +	case WCD937X_DIGITAL_CHIP_ID3:
> 
>> +	case WCD937X_DIGITAL_EFUSE_REG_0:
>> +	case WCD937X_DIGITAL_EFUSE_REG_1:
>> +	case WCD937X_DIGITAL_EFUSE_REG_2:
> 
>> +	.readable_reg = wcd937x_readable_register,
>> +	.writeable_reg = wcd937x_rdwr_register,
>> +	.volatile_reg = wcd937x_readonly_register,
> 
> It's not a bug per se since things will work but you should probably
> have separate volatile and read only checks, things like the ID and
> efuse registers are read only but they shouldn't vary at runtime so
> could be cached and not volatile.

ACK,

Will cleanup and improve.

Thanks & Regards,
Rafi.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ