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: <e05aec1c-d305-1281-91c2-1d3e1f3ae912@9elements.com>
Date:   Wed, 30 Nov 2022 23:45:42 +0530
From:   Naresh Solanki <naresh.solanki@...ements.com>
To:     Guenter Roeck <linux@...ck-us.net>
Cc:     devicetree@...r.kernel.org, Jean Delvare <jdelvare@...e.com>,
        Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>, linux-kernel@...r.kernel.org,
        linux-hwmon@...r.kernel.org,
        Patrick Rudolph <patrick.rudolph@...ements.com>
Subject: Re: [PATCH v3 1/4] hwmon: (pmbus/core): Update regulator flag map

Hi,

On 30-11-2022 11:39 pm, Guenter Roeck wrote:
> On Wed, Nov 30, 2022 at 05:58:29PM +0100, Naresh Solanki wrote:
>> Add regulator flag map for PMBUS status byte & status input.
>>
> 
> Now you lost me. Two 1/4 patches with overlapping and different
> content ???
> 
This patch wasn't suppose to be. will check what went wrong & avoid 
these overlap in future.
> Guenter
> 
>> Signed-off-by: Naresh Solanki <Naresh.Solanki@...ements.com>
>> ---
>>   drivers/hwmon/pmbus/pmbus_core.c | 30 ++++++++++++++++++++++--------
>>   1 file changed, 22 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
>> index 95e95783972a..f5caceaaef2a 100644
>> --- a/drivers/hwmon/pmbus/pmbus_core.c
>> +++ b/drivers/hwmon/pmbus/pmbus_core.c
>> @@ -2752,6 +2752,15 @@ struct pmbus_regulator_status_category {
>>   
>>   static const struct pmbus_regulator_status_category pmbus_regulator_flag_map[] = {
>>   	{
>> +		.func = -1,
>> +		.reg = PMBUS_STATUS_BYTE,
>> +		.bits = (const struct pmbus_regulator_status_assoc[]) {
>> +			{ PB_STATUS_IOUT_OC,   REGULATOR_ERROR_OVER_CURRENT },
>> +			{ PB_STATUS_VOUT_OV,   REGULATOR_ERROR_REGULATION_OUT },
>> +			{ PB_STATUS_VIN_UV,    REGULATOR_ERROR_UNDER_VOLTAGE },
>> +			{ },
>> +		},
>> +	}, {
>>   		.func = PMBUS_HAVE_STATUS_VOUT,
>>   		.reg = PMBUS_STATUS_VOUT,
>>   		.bits = (const struct pmbus_regulator_status_assoc[]) {
>> @@ -2768,6 +2777,7 @@ static const struct pmbus_regulator_status_category pmbus_regulator_flag_map[] =
>>   			{ PB_IOUT_OC_WARNING,    REGULATOR_ERROR_OVER_CURRENT_WARN },
>>   			{ PB_IOUT_OC_FAULT,      REGULATOR_ERROR_OVER_CURRENT },
>>   			{ PB_IOUT_OC_LV_FAULT,   REGULATOR_ERROR_OVER_CURRENT },
>> +			{ PB_POUT_OP_FAULT,      REGULATOR_ERROR_OVER_CURRENT },
>>   			{ },
>>   		},
>>   	}, {
>> @@ -2778,6 +2788,18 @@ static const struct pmbus_regulator_status_category pmbus_regulator_flag_map[] =
>>   			{ PB_TEMP_OT_FAULT,      REGULATOR_ERROR_OVER_TEMP },
>>   			{ },
>>   		},
>> +	}, {
>> +		.func = PMBUS_HAVE_STATUS_INPUT,
>> +		.reg = PMBUS_STATUS_INPUT,
>> +		.bits = (const struct pmbus_regulator_status_assoc[]) {
>> +			{ PB_IIN_OC_FAULT,       REGULATOR_ERROR_OVER_CURRENT },
>> +			{ PB_IIN_OC_WARNING,     REGULATOR_ERROR_OVER_CURRENT_WARN },
>> +			{ PB_VOLTAGE_UV_FAULT,   REGULATOR_ERROR_UNDER_VOLTAGE },
>> +			{ PB_VOLTAGE_UV_WARNING, REGULATOR_ERROR_UNDER_VOLTAGE_WARN },
>> +			{ PB_VOLTAGE_OV_WARNING, REGULATOR_ERROR_OVER_VOLTAGE_WARN },
>> +			{ PB_VOLTAGE_OV_FAULT,   REGULATOR_ERROR_OVER_VOLTAGE_WARN },
>> +			{ },
>> +		},
>>   	},
>>   };
>>   
>> @@ -2834,14 +2856,6 @@ static int pmbus_regulator_get_error_flags(struct regulator_dev *rdev, unsigned
>>   		if (status & PB_STATUS_POWER_GOOD_N)
>>   			*flags |= REGULATOR_ERROR_REGULATION_OUT;
>>   	}
>> -	/*
>> -	 * Unlike most other status bits, PB_STATUS_{IOUT_OC,VOUT_OV} are
>> -	 * defined strictly as fault indicators (not warnings).
>> -	 */
>> -	if (status & PB_STATUS_IOUT_OC)
>> -		*flags |= REGULATOR_ERROR_OVER_CURRENT;
>> -	if (status & PB_STATUS_VOUT_OV)
>> -		*flags |= REGULATOR_ERROR_REGULATION_OUT;
>>   
>>   	/*
>>   	 * If we haven't discovered any thermal faults or warnings via
>>
>> base-commit: 9494c53e1389b120ba461899207ac8a3aab2632c
>> -- 
>> 2.37.3
>>

Regards,
Naresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ