* hwmon: (nct6775) Regression Bisected
@ 2023-09-15 14:28 Doug Smythies
2023-09-15 15:00 ` Guenter Roeck
2023-09-16 9:20 ` Bagas Sanjaya
0 siblings, 2 replies; 15+ messages in thread
From: Doug Smythies @ 2023-09-15 14:28 UTC (permalink / raw)
To: 'Ahmad Khalifa', 'Guenter Roeck'
Cc: Doug Smythies, 'Jean Delvare', linux-hwmon
Kernel 6.6-rc1 has an error during boot. The guilty commit is:
b7f1f7b2523a6a4382f12fe953380b847b80e09d
hwmon: (nct6775) Additional TEMP registers for nct6799
There seems to be confusion between the indexes into
the NCT6799_ALARM_BITS array or the
NCT6779_ALARM_BITS array. I do not understand the code
and do not know if it is the indexing that is reversed or the
wrong table is being used.
The error from kern.log (edited):
================================================================================
UBSAN: shift-out-of-bounds in drivers/hwmon/nct6775-core.c:1757:39
shift exponent -1 is negative
CPU: 9 PID: 822 Comm: sensors Not tainted 6.6.0-rc1-stock2 #1165
Hardware name: ASUS System Product Name/PRIME Z490-A, BIOS 9902 09/15/2021
Call Trace:
<TASK>
dump_stack_lvl+0x48/0x70
dump_stack+0x10/0x20
ubsan_epilogue+0x9/0x40
__ubsan_handle_shift_out_of_bounds+0x10f/0x170
...
I added a "pr_info" line (in the below it was as of the prior commit,
43fbe66dc216 hwmon: Add driver for Renesas HS3001):
doug@s19:~/kernel/linux$ git diff
diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
index 33533d95cf48..12e3df84c034 100644
--- a/drivers/hwmon/nct6775-core.c
+++ b/drivers/hwmon/nct6775-core.c
@@ -1727,6 +1727,7 @@ nct6775_show_alarm(struct device *dev, struct device_attribute *attr, char *buf)
return PTR_ERR(data);
nr = data->ALARM_BITS[sattr->index];
+ pr_info("doug: nr: %d ; index %d\n", nr, sattr->index);
return sprintf(buf, "%u\n",
(unsigned int)((data->alarms >> nr) & 0x01));
}
And for b7f1f7b2523a got (edited):
nct6775_core: doug: nr: 0 ; index 0
nct6775_core: doug: nr: 1 ; index 1
nct6775_core: doug: nr: 2 ; index 2
nct6775_core: doug: nr: 3 ; index 3
nct6775_core: doug: nr: 8 ; index 4
nct6775_core: doug: nr: -1 ; index 5
================================================================================
UBSAN: shift-out-of-bounds in drivers/hwmon/nct6775-core.c:1758:39
shift exponent -1 is negative
...
nct6775_core: doug: nr: 20 ; index 6
nct6775_core: doug: nr: 16 ; index 7
nct6775_core: doug: nr: 17 ; index 8
nct6775_core: doug: nr: 24 ; index 9
nct6775_core: doug: nr: 25 ; index 10
nct6775_core: doug: nr: 26 ; index 11
nct6775_core: doug: nr: 27 ; index 12
nct6775_core: doug: nr: 28 ; index 13
nct6775_core: doug: nr: 29 ; index 14
nct6775_core: doug: nr: 6 ; index 24
nct6775_core: doug: nr: 7 ; index 25
nct6775_core: doug: nr: 11 ; index 26
nct6775_core: doug: nr: 10 ; index 27
nct6775_core: doug: nr: 23 ; index 28
nct6775_core: doug: nr: 33 ; index 29
nct6775_core: doug: nr: 12 ; index 48
nct6775_core: doug: nr: 9 ; index 49
Observe that the table seems to be
NCT6799_ALARM_BITS
But the indexes seem to be for
NCT6779_ALARM_BITS
static const s8 NCT6799_ALARM_BITS[NUM_ALARM_BITS] = {
0, 1, 2, 3, 8, -1, 20, 16, 17, 24, 25, 26, /* in0-in11 */
27, 28, 29, 30, 31, -1, -1, -1, -1, -1, -1, -1, /* in12-in23 */
6, 7, 11, 10, 23, 33, -1, -1, -1, -1, -1, -1, /* fan1-fan12 */
4, 5, 40, 41, 42, 43, 44, -1, -1, -1, -1, -1, /* temp1-temp12 */
12, 9, /* intr0-intr1 */
};
Now repeat the test as of 43fbe66dc216:
nct6775_core: doug: nr: 0 ; index 0
nct6775_core: doug: nr: 1 ; index 1
nct6775_core: doug: nr: 2 ; index 2
nct6775_core: doug: nr: 3 ; index 3
nct6775_core: doug: nr: 8 ; index 4
nct6775_core: doug: nr: 21 ; index 5
nct6775_core: doug: nr: 20 ; index 6
nct6775_core: doug: nr: 16 ; index 7
nct6775_core: doug: nr: 17 ; index 8
nct6775_core: doug: nr: 24 ; index 9
nct6775_core: doug: nr: 25 ; index 10
nct6775_core: doug: nr: 26 ; index 11
nct6775_core: doug: nr: 27 ; index 12
nct6775_core: doug: nr: 28 ; index 13
nct6775_core: doug: nr: 29 ; index 14
nct6775_core: doug: nr: 6 ; index 24
nct6775_core: doug: nr: 7 ; index 25
nct6775_core: doug: nr: 11 ; index 26
nct6775_core: doug: nr: 10 ; index 27
nct6775_core: doug: nr: 23 ; index 28
nct6775_core: doug: nr: 33 ; index 29
nct6775_core: doug: nr: 12 ; index 48
nct6775_core: doug: nr: 9 ; index 49
Observe that the table seems to be
NCT6779_ALARM_BITS
And the indexing seems to be for that
Table.
static const s8 NCT6779_ALARM_BITS[NUM_ALARM_BITS] = {
0, 1, 2, 3, 8, 21, 20, 16, 17, 24, 25, 26, /* in0-in11 */
27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* in12-in23 */
6, 7, 11, 10, 23, -1, -1, -1, -1, -1, -1, -1, /* fan1-fan12 */
4, 5, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* temp1-temp12 */
12, 9, /* intr0-intr1 */
};
You probably need this information:
nct6775: Found NCT6798D or compatible chip at 0x2e:0x290
... Doug
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: hwmon: (nct6775) Regression Bisected
2023-09-15 14:28 hwmon: (nct6775) Regression Bisected Doug Smythies
@ 2023-09-15 15:00 ` Guenter Roeck
2023-09-16 3:12 ` Guenter Roeck
2023-09-16 16:43 ` Ahmad Khalifa
2023-09-16 9:20 ` Bagas Sanjaya
1 sibling, 2 replies; 15+ messages in thread
From: Guenter Roeck @ 2023-09-15 15:00 UTC (permalink / raw)
To: Doug Smythies, 'Ahmad Khalifa'
Cc: 'Jean Delvare', linux-hwmon
Hi,
On 9/15/23 07:28, Doug Smythies wrote:
> Kernel 6.6-rc1 has an error during boot. The guilty commit is:
> b7f1f7b2523a6a4382f12fe953380b847b80e09d
> hwmon: (nct6775) Additional TEMP registers for nct6799
>
> There seems to be confusion between the indexes into
> the NCT6799_ALARM_BITS array or the
> NCT6779_ALARM_BITS array. I do not understand the code
> and do not know if it is the indexing that is reversed or the
> wrong table is being used.
>
Thanks a lot for the report. Ahmad, can you look into this ?
If it can't be fixed quickly we'll have to revert the offending patch.
Thanks,
Guenter
> The error from kern.log (edited):
>
> ================================================================================
> UBSAN: shift-out-of-bounds in drivers/hwmon/nct6775-core.c:1757:39
> shift exponent -1 is negative
> CPU: 9 PID: 822 Comm: sensors Not tainted 6.6.0-rc1-stock2 #1165
> Hardware name: ASUS System Product Name/PRIME Z490-A, BIOS 9902 09/15/2021
> Call Trace:
> <TASK>
> dump_stack_lvl+0x48/0x70
> dump_stack+0x10/0x20
> ubsan_epilogue+0x9/0x40
> __ubsan_handle_shift_out_of_bounds+0x10f/0x170
> ...
>
> I added a "pr_info" line (in the below it was as of the prior commit,
> 43fbe66dc216 hwmon: Add driver for Renesas HS3001):
>
> doug@s19:~/kernel/linux$ git diff
> diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
> index 33533d95cf48..12e3df84c034 100644
> --- a/drivers/hwmon/nct6775-core.c
> +++ b/drivers/hwmon/nct6775-core.c
> @@ -1727,6 +1727,7 @@ nct6775_show_alarm(struct device *dev, struct device_attribute *attr, char *buf)
> return PTR_ERR(data);
>
> nr = data->ALARM_BITS[sattr->index];
> + pr_info("doug: nr: %d ; index %d\n", nr, sattr->index);
> return sprintf(buf, "%u\n",
> (unsigned int)((data->alarms >> nr) & 0x01));
> }
>
> And for b7f1f7b2523a got (edited):
>
> nct6775_core: doug: nr: 0 ; index 0
> nct6775_core: doug: nr: 1 ; index 1
> nct6775_core: doug: nr: 2 ; index 2
> nct6775_core: doug: nr: 3 ; index 3
> nct6775_core: doug: nr: 8 ; index 4
> nct6775_core: doug: nr: -1 ; index 5
> ================================================================================
> UBSAN: shift-out-of-bounds in drivers/hwmon/nct6775-core.c:1758:39
> shift exponent -1 is negative
> ...
> nct6775_core: doug: nr: 20 ; index 6
> nct6775_core: doug: nr: 16 ; index 7
> nct6775_core: doug: nr: 17 ; index 8
> nct6775_core: doug: nr: 24 ; index 9
> nct6775_core: doug: nr: 25 ; index 10
> nct6775_core: doug: nr: 26 ; index 11
> nct6775_core: doug: nr: 27 ; index 12
> nct6775_core: doug: nr: 28 ; index 13
> nct6775_core: doug: nr: 29 ; index 14
> nct6775_core: doug: nr: 6 ; index 24
> nct6775_core: doug: nr: 7 ; index 25
> nct6775_core: doug: nr: 11 ; index 26
> nct6775_core: doug: nr: 10 ; index 27
> nct6775_core: doug: nr: 23 ; index 28
> nct6775_core: doug: nr: 33 ; index 29
> nct6775_core: doug: nr: 12 ; index 48
> nct6775_core: doug: nr: 9 ; index 49
>
> Observe that the table seems to be
> NCT6799_ALARM_BITS
> But the indexes seem to be for
> NCT6779_ALARM_BITS
>
> static const s8 NCT6799_ALARM_BITS[NUM_ALARM_BITS] = {
> 0, 1, 2, 3, 8, -1, 20, 16, 17, 24, 25, 26, /* in0-in11 */
> 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, -1, -1, /* in12-in23 */
> 6, 7, 11, 10, 23, 33, -1, -1, -1, -1, -1, -1, /* fan1-fan12 */
> 4, 5, 40, 41, 42, 43, 44, -1, -1, -1, -1, -1, /* temp1-temp12 */
> 12, 9, /* intr0-intr1 */
> };
>
> Now repeat the test as of 43fbe66dc216:
>
> nct6775_core: doug: nr: 0 ; index 0
> nct6775_core: doug: nr: 1 ; index 1
> nct6775_core: doug: nr: 2 ; index 2
> nct6775_core: doug: nr: 3 ; index 3
> nct6775_core: doug: nr: 8 ; index 4
> nct6775_core: doug: nr: 21 ; index 5
> nct6775_core: doug: nr: 20 ; index 6
> nct6775_core: doug: nr: 16 ; index 7
> nct6775_core: doug: nr: 17 ; index 8
> nct6775_core: doug: nr: 24 ; index 9
> nct6775_core: doug: nr: 25 ; index 10
> nct6775_core: doug: nr: 26 ; index 11
> nct6775_core: doug: nr: 27 ; index 12
> nct6775_core: doug: nr: 28 ; index 13
> nct6775_core: doug: nr: 29 ; index 14
> nct6775_core: doug: nr: 6 ; index 24
> nct6775_core: doug: nr: 7 ; index 25
> nct6775_core: doug: nr: 11 ; index 26
> nct6775_core: doug: nr: 10 ; index 27
> nct6775_core: doug: nr: 23 ; index 28
> nct6775_core: doug: nr: 33 ; index 29
> nct6775_core: doug: nr: 12 ; index 48
> nct6775_core: doug: nr: 9 ; index 49
>
> Observe that the table seems to be
> NCT6779_ALARM_BITS
> And the indexing seems to be for that
> Table.
>
> static const s8 NCT6779_ALARM_BITS[NUM_ALARM_BITS] = {
> 0, 1, 2, 3, 8, 21, 20, 16, 17, 24, 25, 26, /* in0-in11 */
> 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* in12-in23 */
> 6, 7, 11, 10, 23, -1, -1, -1, -1, -1, -1, -1, /* fan1-fan12 */
> 4, 5, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* temp1-temp12 */
> 12, 9, /* intr0-intr1 */
> };
>
> You probably need this information:
> nct6775: Found NCT6798D or compatible chip at 0x2e:0x290
>
> ... Doug
>
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: hwmon: (nct6775) Regression Bisected
2023-09-15 15:00 ` Guenter Roeck
@ 2023-09-16 3:12 ` Guenter Roeck
2023-09-16 16:43 ` Ahmad Khalifa
1 sibling, 0 replies; 15+ messages in thread
From: Guenter Roeck @ 2023-09-16 3:12 UTC (permalink / raw)
To: Doug Smythies, 'Ahmad Khalifa'
Cc: 'Jean Delvare', linux-hwmon
On 9/15/23 08:00, Guenter Roeck wrote:
> Hi,
>
> On 9/15/23 07:28, Doug Smythies wrote:
>> Kernel 6.6-rc1 has an error during boot. The guilty commit is:
>> b7f1f7b2523a6a4382f12fe953380b847b80e09d
>> hwmon: (nct6775) Additional TEMP registers for nct6799
>>
>> There seems to be confusion between the indexes into
>> the NCT6799_ALARM_BITS array or the
>> NCT6779_ALARM_BITS array. I do not understand the code
>> and do not know if it is the indexing that is reversed or the
>> wrong table is being used.
>>
>
> Thanks a lot for the report. Ahmad, can you look into this ?
> If it can't be fixed quickly we'll have to revert the offending patch.
>
I'll wait until around mid next week and then revert the offending patch
if we don't have a solution by then.
Sorry for the trouble.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: hwmon: (nct6775) Regression Bisected
2023-09-15 14:28 hwmon: (nct6775) Regression Bisected Doug Smythies
2023-09-15 15:00 ` Guenter Roeck
@ 2023-09-16 9:20 ` Bagas Sanjaya
2023-09-21 9:14 ` Linux regression tracking #update (Thorsten Leemhuis)
1 sibling, 1 reply; 15+ messages in thread
From: Bagas Sanjaya @ 2023-09-16 9:20 UTC (permalink / raw)
To: Doug Smythies, 'Ahmad Khalifa', 'Guenter Roeck'
Cc: 'Jean Delvare', Linux Hardware Monitoring,
Linux Regressions, Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 5481 bytes --]
On Fri, Sep 15, 2023 at 07:28:57AM -0700, Doug Smythies wrote:
> Kernel 6.6-rc1 has an error during boot. The guilty commit is:
> b7f1f7b2523a6a4382f12fe953380b847b80e09d
> hwmon: (nct6775) Additional TEMP registers for nct6799
>
> There seems to be confusion between the indexes into
> the NCT6799_ALARM_BITS array or the
> NCT6779_ALARM_BITS array. I do not understand the code
> and do not know if it is the indexing that is reversed or the
> wrong table is being used.
>
> The error from kern.log (edited):
>
> ================================================================================
> UBSAN: shift-out-of-bounds in drivers/hwmon/nct6775-core.c:1757:39
> shift exponent -1 is negative
> CPU: 9 PID: 822 Comm: sensors Not tainted 6.6.0-rc1-stock2 #1165
> Hardware name: ASUS System Product Name/PRIME Z490-A, BIOS 9902 09/15/2021
> Call Trace:
> <TASK>
> dump_stack_lvl+0x48/0x70
> dump_stack+0x10/0x20
> ubsan_epilogue+0x9/0x40
> __ubsan_handle_shift_out_of_bounds+0x10f/0x170
> ...
>
> I added a "pr_info" line (in the below it was as of the prior commit,
> 43fbe66dc216 hwmon: Add driver for Renesas HS3001):
>
> doug@s19:~/kernel/linux$ git diff
> diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
> index 33533d95cf48..12e3df84c034 100644
> --- a/drivers/hwmon/nct6775-core.c
> +++ b/drivers/hwmon/nct6775-core.c
> @@ -1727,6 +1727,7 @@ nct6775_show_alarm(struct device *dev, struct device_attribute *attr, char *buf)
> return PTR_ERR(data);
>
> nr = data->ALARM_BITS[sattr->index];
> + pr_info("doug: nr: %d ; index %d\n", nr, sattr->index);
> return sprintf(buf, "%u\n",
> (unsigned int)((data->alarms >> nr) & 0x01));
> }
>
> And for b7f1f7b2523a got (edited):
>
> nct6775_core: doug: nr: 0 ; index 0
> nct6775_core: doug: nr: 1 ; index 1
> nct6775_core: doug: nr: 2 ; index 2
> nct6775_core: doug: nr: 3 ; index 3
> nct6775_core: doug: nr: 8 ; index 4
> nct6775_core: doug: nr: -1 ; index 5
> ================================================================================
> UBSAN: shift-out-of-bounds in drivers/hwmon/nct6775-core.c:1758:39
> shift exponent -1 is negative
> ...
> nct6775_core: doug: nr: 20 ; index 6
> nct6775_core: doug: nr: 16 ; index 7
> nct6775_core: doug: nr: 17 ; index 8
> nct6775_core: doug: nr: 24 ; index 9
> nct6775_core: doug: nr: 25 ; index 10
> nct6775_core: doug: nr: 26 ; index 11
> nct6775_core: doug: nr: 27 ; index 12
> nct6775_core: doug: nr: 28 ; index 13
> nct6775_core: doug: nr: 29 ; index 14
> nct6775_core: doug: nr: 6 ; index 24
> nct6775_core: doug: nr: 7 ; index 25
> nct6775_core: doug: nr: 11 ; index 26
> nct6775_core: doug: nr: 10 ; index 27
> nct6775_core: doug: nr: 23 ; index 28
> nct6775_core: doug: nr: 33 ; index 29
> nct6775_core: doug: nr: 12 ; index 48
> nct6775_core: doug: nr: 9 ; index 49
>
> Observe that the table seems to be
> NCT6799_ALARM_BITS
> But the indexes seem to be for
> NCT6779_ALARM_BITS
>
> static const s8 NCT6799_ALARM_BITS[NUM_ALARM_BITS] = {
> 0, 1, 2, 3, 8, -1, 20, 16, 17, 24, 25, 26, /* in0-in11 */
> 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, -1, -1, /* in12-in23 */
> 6, 7, 11, 10, 23, 33, -1, -1, -1, -1, -1, -1, /* fan1-fan12 */
> 4, 5, 40, 41, 42, 43, 44, -1, -1, -1, -1, -1, /* temp1-temp12 */
> 12, 9, /* intr0-intr1 */
> };
>
> Now repeat the test as of 43fbe66dc216:
>
> nct6775_core: doug: nr: 0 ; index 0
> nct6775_core: doug: nr: 1 ; index 1
> nct6775_core: doug: nr: 2 ; index 2
> nct6775_core: doug: nr: 3 ; index 3
> nct6775_core: doug: nr: 8 ; index 4
> nct6775_core: doug: nr: 21 ; index 5
> nct6775_core: doug: nr: 20 ; index 6
> nct6775_core: doug: nr: 16 ; index 7
> nct6775_core: doug: nr: 17 ; index 8
> nct6775_core: doug: nr: 24 ; index 9
> nct6775_core: doug: nr: 25 ; index 10
> nct6775_core: doug: nr: 26 ; index 11
> nct6775_core: doug: nr: 27 ; index 12
> nct6775_core: doug: nr: 28 ; index 13
> nct6775_core: doug: nr: 29 ; index 14
> nct6775_core: doug: nr: 6 ; index 24
> nct6775_core: doug: nr: 7 ; index 25
> nct6775_core: doug: nr: 11 ; index 26
> nct6775_core: doug: nr: 10 ; index 27
> nct6775_core: doug: nr: 23 ; index 28
> nct6775_core: doug: nr: 33 ; index 29
> nct6775_core: doug: nr: 12 ; index 48
> nct6775_core: doug: nr: 9 ; index 49
>
> Observe that the table seems to be
> NCT6779_ALARM_BITS
> And the indexing seems to be for that
> Table.
>
> static const s8 NCT6779_ALARM_BITS[NUM_ALARM_BITS] = {
> 0, 1, 2, 3, 8, 21, 20, 16, 17, 24, 25, 26, /* in0-in11 */
> 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* in12-in23 */
> 6, 7, 11, 10, 23, -1, -1, -1, -1, -1, -1, -1, /* fan1-fan12 */
> 4, 5, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* temp1-temp12 */
> 12, 9, /* intr0-intr1 */
> };
>
> You probably need this information:
> nct6775: Found NCT6798D or compatible chip at 0x2e:0x290
>
Thanks for the regression report. I'm adding it to regzbot:
#regzbot ^introduced: b7f1f7b2523a6a
#regzbot title: shift out-of-bounds in nct6799's additional TEMP registers
--
An old man doll... just what I always wanted! - Clara
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: hwmon: (nct6775) Regression Bisected
2023-09-15 15:00 ` Guenter Roeck
2023-09-16 3:12 ` Guenter Roeck
@ 2023-09-16 16:43 ` Ahmad Khalifa
2023-09-16 17:04 ` Guenter Roeck
2023-09-17 21:17 ` Doug Smythies
1 sibling, 2 replies; 15+ messages in thread
From: Ahmad Khalifa @ 2023-09-16 16:43 UTC (permalink / raw)
To: Guenter Roeck, Doug Smythies; +Cc: 'Jean Delvare', linux-hwmon
Thanks for the detailed report, Doug.
Would you be able to test out a fix please?
It's a basic guard line as _alarm attributes are assumed to be there
when a sensor exists, but the device doesn't have an alarm for in5 (VIN8
on the device)
If you could also confirm that your /sys/class/hwmon/hwmon?/in5_alarm
file is there and showing 0, that would be great.
---
diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
index 02a7124..5470aff 100644
--- a/drivers/hwmon/nct6775-core.c
+++ b/drivers/hwmon/nct6775-core.c
@@ -1753,6 +1753,9 @@ nct6775_show_alarm(struct device *dev, struct
device_attribute *attr, char *buf)
return PTR_ERR(data);
nr = data->ALARM_BITS[sattr->index];
+ if (nr < 0)
+ return sprintf(buf, "0\n");
+
return sprintf(buf, "%u\n",
(unsigned int)((data->alarms >> nr) & 0x01));
}
---
More details - if the above patch fixes the issue...
The update of nct6798/nct6799 for additional TEMP sensors required
separating them from the previous set of devices.
Both devices are very similar.
Both do not have an alarm bit for VIN8 (index 5) where the
shift-out-of-bounds check trips.
>> nct6775_core: doug: nr: 21 ; index 5
Previously in5_alarm was pointing at bit 21 (which is bit 5 in reg
0x45b) which is reserved and *probably* always 0. With the update, 6798
was pointed at the same ALARM_BITS as 6799 as the TEMP bits are
different from other devices.
This is correct and it doesn't need to point back at the old BITS again.
However, now I realise that in*_alarm attributes can't be switched off
separately from their sensor - in5_* are all there except ALARM.
Seems the shift-out-of-bounds check was there prior to this change.
I'm not exactly sure why this didn't come up in my testing on 6.5.0.
This is the only occurrence of non-existent ALARM in the middle of other
sensors, so a simple guard check seems to be the reasonable thing here
even though it may get evaluated more times than it should.
If it's confirmed to work, I can submit a formal patch later.
Above change tested on nct6799 on 6.5.0-rc2+ with no impact or
additional dmesg output.
On 15/09/2023 16:00, Guenter Roeck wrote:
> Hi,
>
> On 9/15/23 07:28, Doug Smythies wrote:
>> Kernel 6.6-rc1 has an error during boot. The guilty commit is:
>> b7f1f7b2523a6a4382f12fe953380b847b80e09d
>> hwmon: (nct6775) Additional TEMP registers for nct6799
>>
>> There seems to be confusion between the indexes into
>> the NCT6799_ALARM_BITS array or the
>> NCT6779_ALARM_BITS array. I do not understand the code
>> and do not know if it is the indexing that is reversed or the
>> wrong table is being used.
>>
>
> Thanks a lot for the report. Ahmad, can you look into this ?
> If it can't be fixed quickly we'll have to revert the offending patch.
>
> Thanks,
> Guenter
>
>> The error from kern.log (edited):
>>
>> ================================================================================
>> UBSAN: shift-out-of-bounds in drivers/hwmon/nct6775-core.c:1757:39
>> shift exponent -1 is negative
>> CPU: 9 PID: 822 Comm: sensors Not tainted 6.6.0-rc1-stock2 #1165
>> Hardware name: ASUS System Product Name/PRIME Z490-A, BIOS 9902
>> 09/15/2021
>> Call Trace:
>> <TASK>
>> dump_stack_lvl+0x48/0x70
>> dump_stack+0x10/0x20
>> ubsan_epilogue+0x9/0x40
>> __ubsan_handle_shift_out_of_bounds+0x10f/0x170
>> ...
>>
>> I added a "pr_info" line (in the below it was as of the prior commit,
>> 43fbe66dc216 hwmon: Add driver for Renesas HS3001):
>>
>> doug@s19:~/kernel/linux$ git diff
>> diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
>> index 33533d95cf48..12e3df84c034 100644
>> --- a/drivers/hwmon/nct6775-core.c
>> +++ b/drivers/hwmon/nct6775-core.c
>> @@ -1727,6 +1727,7 @@ nct6775_show_alarm(struct device *dev, struct
>> device_attribute *attr, char *buf)
>> return PTR_ERR(data);
>>
>> nr = data->ALARM_BITS[sattr->index];
>> + pr_info("doug: nr: %d ; index %d\n", nr, sattr->index);
>> return sprintf(buf, "%u\n",
>> (unsigned int)((data->alarms >> nr) & 0x01));
>> }
>>
>> And for b7f1f7b2523a got (edited):
>>
>> nct6775_core: doug: nr: 0 ; index 0
>> nct6775_core: doug: nr: 1 ; index 1
>> nct6775_core: doug: nr: 2 ; index 2
>> nct6775_core: doug: nr: 3 ; index 3
>> nct6775_core: doug: nr: 8 ; index 4
>> nct6775_core: doug: nr: -1 ; index 5
>> ================================================================================
>> UBSAN: shift-out-of-bounds in drivers/hwmon/nct6775-core.c:1758:39
>> shift exponent -1 is negative
>> ...
>> nct6775_core: doug: nr: 20 ; index 6
>> nct6775_core: doug: nr: 16 ; index 7
>> nct6775_core: doug: nr: 17 ; index 8
>> nct6775_core: doug: nr: 24 ; index 9
>> nct6775_core: doug: nr: 25 ; index 10
>> nct6775_core: doug: nr: 26 ; index 11
>> nct6775_core: doug: nr: 27 ; index 12
>> nct6775_core: doug: nr: 28 ; index 13
>> nct6775_core: doug: nr: 29 ; index 14
>> nct6775_core: doug: nr: 6 ; index 24
>> nct6775_core: doug: nr: 7 ; index 25
>> nct6775_core: doug: nr: 11 ; index 26
>> nct6775_core: doug: nr: 10 ; index 27
>> nct6775_core: doug: nr: 23 ; index 28
>> nct6775_core: doug: nr: 33 ; index 29
>> nct6775_core: doug: nr: 12 ; index 48
>> nct6775_core: doug: nr: 9 ; index 49
>>
>> Observe that the table seems to be
>> NCT6799_ALARM_BITS
>> But the indexes seem to be for
>> NCT6779_ALARM_BITS
>>
>> static const s8 NCT6799_ALARM_BITS[NUM_ALARM_BITS] = {
>> 0, 1, 2, 3, 8, -1, 20, 16, 17, 24, 25, 26, /*
>> in0-in11 */
>> 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, -1, -1, /*
>> in12-in23 */
>> 6, 7, 11, 10, 23, 33, -1, -1, -1, -1, -1, -1, /*
>> fan1-fan12 */
>> 4, 5, 40, 41, 42, 43, 44, -1, -1, -1, -1, -1, /*
>> temp1-temp12 */
>> 12, 9, /*
>> intr0-intr1 */
>> };
>>
>> Now repeat the test as of 43fbe66dc216:
>>
>> nct6775_core: doug: nr: 0 ; index 0
>> nct6775_core: doug: nr: 1 ; index 1
>> nct6775_core: doug: nr: 2 ; index 2
>> nct6775_core: doug: nr: 3 ; index 3
>> nct6775_core: doug: nr: 8 ; index 4
>> nct6775_core: doug: nr: 21 ; index 5
>> nct6775_core: doug: nr: 20 ; index 6
>> nct6775_core: doug: nr: 16 ; index 7
>> nct6775_core: doug: nr: 17 ; index 8
>> nct6775_core: doug: nr: 24 ; index 9
>> nct6775_core: doug: nr: 25 ; index 10
>> nct6775_core: doug: nr: 26 ; index 11
>> nct6775_core: doug: nr: 27 ; index 12
>> nct6775_core: doug: nr: 28 ; index 13
>> nct6775_core: doug: nr: 29 ; index 14
>> nct6775_core: doug: nr: 6 ; index 24
>> nct6775_core: doug: nr: 7 ; index 25
>> nct6775_core: doug: nr: 11 ; index 26
>> nct6775_core: doug: nr: 10 ; index 27
>> nct6775_core: doug: nr: 23 ; index 28
>> nct6775_core: doug: nr: 33 ; index 29
>> nct6775_core: doug: nr: 12 ; index 48
>> nct6775_core: doug: nr: 9 ; index 49
>>
>> Observe that the table seems to be
>> NCT6779_ALARM_BITS
>> And the indexing seems to be for that
>> Table.
>>
>> static const s8 NCT6779_ALARM_BITS[NUM_ALARM_BITS] = {
>> 0, 1, 2, 3, 8, 21, 20, 16, 17, 24, 25, 26, /*
>> in0-in11 */
>> 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*
>> in12-in23 */
>> 6, 7, 11, 10, 23, -1, -1, -1, -1, -1, -1, -1, /*
>> fan1-fan12 */
>> 4, 5, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*
>> temp1-temp12 */
>> 12, 9, /*
>> intr0-intr1 */
>> };
>>
>> You probably need this information:
>> nct6775: Found NCT6798D or compatible chip at 0x2e:0x290
>>
>> ... Doug
>>
>>
>
--
Regards,
Ahmad
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: hwmon: (nct6775) Regression Bisected
2023-09-16 16:43 ` Ahmad Khalifa
@ 2023-09-16 17:04 ` Guenter Roeck
2023-09-16 17:45 ` Ahmad Khalifa
2023-09-16 18:09 ` Guenter Roeck
2023-09-17 21:17 ` Doug Smythies
1 sibling, 2 replies; 15+ messages in thread
From: Guenter Roeck @ 2023-09-16 17:04 UTC (permalink / raw)
To: Ahmad Khalifa, Doug Smythies; +Cc: 'Jean Delvare', linux-hwmon
On 9/16/23 09:43, Ahmad Khalifa wrote:
> Thanks for the detailed report, Doug.
> Would you be able to test out a fix please?
>
> It's a basic guard line as _alarm attributes are assumed to be there when a sensor exists, but the device doesn't have an alarm for in5 (VIN8
> on the device)
>
> If you could also confirm that your /sys/class/hwmon/hwmon?/in5_alarm
> file is there and showing 0, that would be great.
>
>
> ---
> diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
> index 02a7124..5470aff 100644
> --- a/drivers/hwmon/nct6775-core.c
> +++ b/drivers/hwmon/nct6775-core.c
> @@ -1753,6 +1753,9 @@ nct6775_show_alarm(struct device *dev, struct device_attribute *attr, char *buf)
> return PTR_ERR(data);
>
> nr = data->ALARM_BITS[sattr->index];
> + if (nr < 0)
> + return sprintf(buf, "0\n");
> +
> return sprintf(buf, "%u\n",
> (unsigned int)((data->alarms >> nr) & 0x01));
> }
> ---
>
> More details - if the above patch fixes the issue...
>
> The update of nct6798/nct6799 for additional TEMP sensors required
> separating them from the previous set of devices.
>
> Both devices are very similar.
> Both do not have an alarm bit for VIN8 (index 5) where the
> shift-out-of-bounds check trips.
>
> >> nct6775_core: doug: nr: 21 ; index 5
>
> Previously in5_alarm was pointing at bit 21 (which is bit 5 in reg
> 0x45b) which is reserved and *probably* always 0. With the update, 6798
> was pointed at the same ALARM_BITS as 6799 as the TEMP bits are
> different from other devices.
>
> This is correct and it doesn't need to point back at the old BITS again.
> However, now I realise that in*_alarm attributes can't be switched off
> separately from their sensor - in5_* are all there except ALARM.
>
> Seems the shift-out-of-bounds check was there prior to this change.
> I'm not exactly sure why this didn't come up in my testing on 6.5.0.
>
> This is the only occurrence of non-existent ALARM in the middle of other
> sensors, so a simple guard check seems to be the reasonable thing here
> even though it may get evaluated more times than it should.
>
> If it's confirmed to work, I can submit a formal patch later.
>
The proper fix should really be in nct6775_in_is_visible(),
which should drop the attribute if there is no alarm bit for it,
similar to, for example, nct6775_fan_is_visible().
Something like
int nr = index % 5; /* attribute index */
if (nr == 1 && data->ALARM_BITS[in] == -1)
return 0;
I think there is a also problem with beep attribute handling,
but that is a different bug unrelated to this one.
Guenter
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: hwmon: (nct6775) Regression Bisected
2023-09-16 17:04 ` Guenter Roeck
@ 2023-09-16 17:45 ` Ahmad Khalifa
2023-09-16 18:11 ` Guenter Roeck
2023-09-16 18:09 ` Guenter Roeck
1 sibling, 1 reply; 15+ messages in thread
From: Ahmad Khalifa @ 2023-09-16 17:45 UTC (permalink / raw)
To: Guenter Roeck, Doug Smythies; +Cc: 'Jean Delvare', linux-hwmon
On 16/09/2023 18:04, Guenter Roeck wrote:
> The proper fix should really be in nct6775_in_is_visible(),
> which should drop the attribute if there is no alarm bit for it,
> similar to, for example, nct6775_fan_is_visible().
> Something like
>
> int nr = index % 5; /* attribute index */
>
> if (nr == 1 && data->ALARM_BITS[in] == -1)
> return 0;
Perfect, that's what I looked for but couldn't figure it out in
a rush. If it's confirmed, I'll convert the fix so it hides the
attribute instead.
--
Regards,
Ahmad
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: hwmon: (nct6775) Regression Bisected
2023-09-16 17:04 ` Guenter Roeck
2023-09-16 17:45 ` Ahmad Khalifa
@ 2023-09-16 18:09 ` Guenter Roeck
1 sibling, 0 replies; 15+ messages in thread
From: Guenter Roeck @ 2023-09-16 18:09 UTC (permalink / raw)
To: Ahmad Khalifa, Doug Smythies; +Cc: 'Jean Delvare', linux-hwmon
On 9/16/23 10:04, Guenter Roeck wrote:
[ ... ]
>
> The proper fix should really be in nct6775_in_is_visible(),
> which should drop the attribute if there is no alarm bit for it,
> similar to, for example, nct6775_fan_is_visible().
> Something like
>
> int nr = index % 5; /* attribute index */
>
> if (nr == 1 && data->ALARM_BITS[in] == -1)
> return 0;
>
> I think there is a also problem with beep attribute handling,
> but that is a different bug unrelated to this one.
>
I think beep attributes are ok after all. All voltages have them,
and nct6775_fan_is_visible() already checks for beep bits.
Guenter
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: hwmon: (nct6775) Regression Bisected
2023-09-16 17:45 ` Ahmad Khalifa
@ 2023-09-16 18:11 ` Guenter Roeck
2023-09-16 19:30 ` Doug Smythies
0 siblings, 1 reply; 15+ messages in thread
From: Guenter Roeck @ 2023-09-16 18:11 UTC (permalink / raw)
To: Ahmad Khalifa, Doug Smythies; +Cc: 'Jean Delvare', linux-hwmon
On 9/16/23 10:45, Ahmad Khalifa wrote:
> On 16/09/2023 18:04, Guenter Roeck wrote:
>
>> The proper fix should really be in nct6775_in_is_visible(),
>> which should drop the attribute if there is no alarm bit for it,
>> similar to, for example, nct6775_fan_is_visible().
>> Something like
>>
>> int nr = index % 5; /* attribute index */
>>
>> if (nr == 1 && data->ALARM_BITS[in] == -1)
>> return 0;
>
> Perfect, that's what I looked for but couldn't figure it out in
> a rush. If it's confirmed, I'll convert the fix so it hides the
> attribute instead.
>
I'd suggest to just send a patch. We can always update it with v2
if a revision is needed.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: hwmon: (nct6775) Regression Bisected
2023-09-16 18:11 ` Guenter Roeck
@ 2023-09-16 19:30 ` Doug Smythies
2023-09-16 20:27 ` Guenter Roeck
0 siblings, 1 reply; 15+ messages in thread
From: Doug Smythies @ 2023-09-16 19:30 UTC (permalink / raw)
To: 'Guenter Roeck', 'Ahmad Khalifa'
Cc: 'Jean Delvare', linux-hwmon, Doug Smythies
On 2023.09.16 11:11 Guenter wrote:
> On 9/16/23 10:45, Ahmad Khalifa wrote:
>> On 16/09/2023 18:04, Guenter Roeck wrote:
>>
>>> The proper fix should really be in nct6775_in_is_visible(),
>>> which should drop the attribute if there is no alarm bit for it,
>>> similar to, for example, nct6775_fan_is_visible().
>>> Something like
>>>
>>> int nr = index % 5; /* attribute index */
>>>
>>> if (nr == 1 && data->ALARM_BITS[in] == -1)
>>> return 0;
>>
>> Perfect, that's what I looked for but couldn't figure it out in
>> a rush. If it's confirmed, I'll convert the fix so it hides the
>> attribute instead.
>>
>
> I'd suggest to just send a patch. We can always update it with v2
> if a revision is needed.
Hi,
And thanks for your quick attention on this.
If I understand all the emails correctly, the above supersedes
the previous patch suggestion.
I tested it with kernel 6.6-rc1, and it fixes the issue.
doug@s19:~/kernel/linux$ git diff
diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
index 02a71244fc3b..ead5d83f1594 100644
--- a/drivers/hwmon/nct6775-core.c
+++ b/drivers/hwmon/nct6775-core.c
@@ -1753,6 +1753,9 @@ nct6775_show_alarm(struct device *dev, struct device_attribute *attr, char *buf)
return PTR_ERR(data);
nr = data->ALARM_BITS[sattr->index];
+
+ pr_info("doug: nr: %d ; index %d\n", nr, sattr->index);
+
return sprintf(buf, "%u\n",
(unsigned int)((data->alarms >> nr) & 0x01));
}
@@ -1910,6 +1913,10 @@ static umode_t nct6775_in_is_visible(struct kobject *kobj,
struct device *dev = kobj_to_dev(kobj);
struct nct6775_data *data = dev_get_drvdata(dev);
int in = index / 5; /* voltage index */
+ int nr = index % 5; /* attribute index */
+
+ if (nr == 1 && data->ALARM_BITS[in] == -1)
+ return 0;
if (!(data->have_in & BIT(in)))
return 0;
You can see I left my pr_info statement in, and got:
Sep 16 12:16:17 s19 kernel: [ 3.091829] nct6775: Found NCT6798D or compatible chip at 0x2e:0x290
...
Sep 16 12:16:17 s19 kernel: [ 3.744414] nct6775_core: doug: nr: 0 ; index 0
Sep 16 12:16:17 s19 kernel: [ 3.744442] nct6775_core: doug: nr: 1 ; index 1
Sep 16 12:16:17 s19 kernel: [ 3.744466] nct6775_core: doug: nr: 2 ; index 2
Sep 16 12:16:17 s19 kernel: [ 3.744490] nct6775_core: doug: nr: 3 ; index 3
Sep 16 12:16:17 s19 kernel: [ 3.744514] nct6775_core: doug: nr: 8 ; index 4
Sep 16 12:16:17 s19 kernel: [ 3.744555] nct6775_core: doug: nr: 20 ; index 6
Sep 16 12:16:17 s19 kernel: [ 3.744578] nct6775_core: doug: nr: 16 ; index 7
Sep 16 12:16:17 s19 kernel: [ 3.744601] nct6775_core: doug: nr: 17 ; index 8
Sep 16 12:16:17 s19 kernel: [ 3.744625] nct6775_core: doug: nr: 24 ; index 9
Sep 16 12:16:17 s19 kernel: [ 3.744649] nct6775_core: doug: nr: 25 ; index 10
Sep 16 12:16:17 s19 kernel: [ 3.744672] nct6775_core: doug: nr: 26 ; index 11
Sep 16 12:16:17 s19 kernel: [ 3.744695] nct6775_core: doug: nr: 27 ; index 12
Sep 16 12:16:17 s19 kernel: [ 3.744718] nct6775_core: doug: nr: 28 ; index 13
Sep 16 12:16:17 s19 kernel: [ 3.744741] nct6775_core: doug: nr: 29 ; index 14
Sep 16 12:16:17 s19 kernel: [ 3.744769] nct6775_core: doug: nr: 6 ; index 24
Sep 16 12:16:17 s19 kernel: [ 3.744787] nct6775_core: doug: nr: 7 ; index 25
Sep 16 12:16:17 s19 kernel: [ 3.744805] nct6775_core: doug: nr: 11 ; index 26
Sep 16 12:16:17 s19 kernel: [ 3.744822] nct6775_core: doug: nr: 10 ; index 27
Sep 16 12:16:17 s19 kernel: [ 3.744846] nct6775_core: doug: nr: 23 ; index 28
Sep 16 12:16:17 s19 kernel: [ 3.744866] nct6775_core: doug: nr: 33 ; index 29
Sep 16 12:16:17 s19 kernel: [ 3.752903] nct6775_core: doug: nr: 12 ; index 48
Sep 16 12:16:17 s19 kernel: [ 3.752913] nct6775_core: doug: nr: 9 ; index 49
...
... Doug
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: hwmon: (nct6775) Regression Bisected
2023-09-16 19:30 ` Doug Smythies
@ 2023-09-16 20:27 ` Guenter Roeck
0 siblings, 0 replies; 15+ messages in thread
From: Guenter Roeck @ 2023-09-16 20:27 UTC (permalink / raw)
To: Doug Smythies, 'Ahmad Khalifa'
Cc: 'Jean Delvare', linux-hwmon
On 9/16/23 12:30, Doug Smythies wrote:
> On 2023.09.16 11:11 Guenter wrote:
>> On 9/16/23 10:45, Ahmad Khalifa wrote:
>>> On 16/09/2023 18:04, Guenter Roeck wrote:
>>>
>>>> The proper fix should really be in nct6775_in_is_visible(),
>>>> which should drop the attribute if there is no alarm bit for it,
>>>> similar to, for example, nct6775_fan_is_visible().
>>>> Something like
>>>>
>>>> int nr = index % 5; /* attribute index */
>>>>
>>>> if (nr == 1 && data->ALARM_BITS[in] == -1)
>>>> return 0;
>>>
>>> Perfect, that's what I looked for but couldn't figure it out in
>>> a rush. If it's confirmed, I'll convert the fix so it hides the
>>> attribute instead.
>>>
>>
>> I'd suggest to just send a patch. We can always update it with v2
>> if a revision is needed.
>
> Hi,
>
> And thanks for your quick attention on this.
>
> If I understand all the emails correctly, the above supersedes
> the previous patch suggestion.
>
> I tested it with kernel 6.6-rc1, and it fixes the issue.
>
Excellent, thanks a lot for testing!
Guenter
> doug@s19:~/kernel/linux$ git diff
> diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
> index 02a71244fc3b..ead5d83f1594 100644
> --- a/drivers/hwmon/nct6775-core.c
> +++ b/drivers/hwmon/nct6775-core.c
> @@ -1753,6 +1753,9 @@ nct6775_show_alarm(struct device *dev, struct device_attribute *attr, char *buf)
> return PTR_ERR(data);
>
> nr = data->ALARM_BITS[sattr->index];
> +
> + pr_info("doug: nr: %d ; index %d\n", nr, sattr->index);
> +
> return sprintf(buf, "%u\n",
> (unsigned int)((data->alarms >> nr) & 0x01));
> }
> @@ -1910,6 +1913,10 @@ static umode_t nct6775_in_is_visible(struct kobject *kobj,
> struct device *dev = kobj_to_dev(kobj);
> struct nct6775_data *data = dev_get_drvdata(dev);
> int in = index / 5; /* voltage index */
> + int nr = index % 5; /* attribute index */
> +
> + if (nr == 1 && data->ALARM_BITS[in] == -1)
> + return 0;
>
> if (!(data->have_in & BIT(in)))
> return 0;
>
> You can see I left my pr_info statement in, and got:
>
> Sep 16 12:16:17 s19 kernel: [ 3.091829] nct6775: Found NCT6798D or compatible chip at 0x2e:0x290
> ...
> Sep 16 12:16:17 s19 kernel: [ 3.744414] nct6775_core: doug: nr: 0 ; index 0
> Sep 16 12:16:17 s19 kernel: [ 3.744442] nct6775_core: doug: nr: 1 ; index 1
> Sep 16 12:16:17 s19 kernel: [ 3.744466] nct6775_core: doug: nr: 2 ; index 2
> Sep 16 12:16:17 s19 kernel: [ 3.744490] nct6775_core: doug: nr: 3 ; index 3
> Sep 16 12:16:17 s19 kernel: [ 3.744514] nct6775_core: doug: nr: 8 ; index 4
> Sep 16 12:16:17 s19 kernel: [ 3.744555] nct6775_core: doug: nr: 20 ; index 6
> Sep 16 12:16:17 s19 kernel: [ 3.744578] nct6775_core: doug: nr: 16 ; index 7
> Sep 16 12:16:17 s19 kernel: [ 3.744601] nct6775_core: doug: nr: 17 ; index 8
> Sep 16 12:16:17 s19 kernel: [ 3.744625] nct6775_core: doug: nr: 24 ; index 9
> Sep 16 12:16:17 s19 kernel: [ 3.744649] nct6775_core: doug: nr: 25 ; index 10
> Sep 16 12:16:17 s19 kernel: [ 3.744672] nct6775_core: doug: nr: 26 ; index 11
> Sep 16 12:16:17 s19 kernel: [ 3.744695] nct6775_core: doug: nr: 27 ; index 12
> Sep 16 12:16:17 s19 kernel: [ 3.744718] nct6775_core: doug: nr: 28 ; index 13
> Sep 16 12:16:17 s19 kernel: [ 3.744741] nct6775_core: doug: nr: 29 ; index 14
> Sep 16 12:16:17 s19 kernel: [ 3.744769] nct6775_core: doug: nr: 6 ; index 24
> Sep 16 12:16:17 s19 kernel: [ 3.744787] nct6775_core: doug: nr: 7 ; index 25
> Sep 16 12:16:17 s19 kernel: [ 3.744805] nct6775_core: doug: nr: 11 ; index 26
> Sep 16 12:16:17 s19 kernel: [ 3.744822] nct6775_core: doug: nr: 10 ; index 27
> Sep 16 12:16:17 s19 kernel: [ 3.744846] nct6775_core: doug: nr: 23 ; index 28
> Sep 16 12:16:17 s19 kernel: [ 3.744866] nct6775_core: doug: nr: 33 ; index 29
> Sep 16 12:16:17 s19 kernel: [ 3.752903] nct6775_core: doug: nr: 12 ; index 48
> Sep 16 12:16:17 s19 kernel: [ 3.752913] nct6775_core: doug: nr: 9 ; index 49
> ...
>
> ... Doug
>
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: hwmon: (nct6775) Regression Bisected
2023-09-16 16:43 ` Ahmad Khalifa
2023-09-16 17:04 ` Guenter Roeck
@ 2023-09-17 21:17 ` Doug Smythies
2023-09-18 17:02 ` Ahmad Khalifa
1 sibling, 1 reply; 15+ messages in thread
From: Doug Smythies @ 2023-09-17 21:17 UTC (permalink / raw)
To: 'Ahmad Khalifa'
Cc: 'Jean Delvare', linux-hwmon, 'Guenter Roeck',
Doug Smythies
Hi Ahmad,
On 2023.09.16 009:43 Ahmad wrote:
> Thanks for the detailed report, Doug.
> Would you be able to test out a fix please?
>
That request was superseded by a subsequent email,
already replied to.
> It's a basic guard line as _alarm attributes are assumed to be there
> when a sensor exists, but the device doesn't have an alarm for in5 (VIN8
> on the device)
>
> If you could also confirm that your /sys/class/hwmon/hwmon?/in5_alarm
> file is there and showing 0, that would be great.
But I forgot to reply to that part:
The file is there, and the content is 0.
$ ls -l /sys/class/hwmon/hwmon?/in5_alarm
-r--r--r-- 1 root root 4096 Sep 17 14:14 /sys/class/hwmon/hwmon3/in5_alarm
doug@s19:~$ ls -l /sys/devices/platform/eeepc-wmi/hwmon/hwmon4^C
doug@s19:~$ cat /sys/class/hwmon/hwmon?/in5_alarm
0
I had to go back to an unpatched kernel 6.6-rc1 for the above.
With the kernel I compiled yesterday for the test patch, the file was not there.
... Doug
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: hwmon: (nct6775) Regression Bisected
2023-09-17 21:17 ` Doug Smythies
@ 2023-09-18 17:02 ` Ahmad Khalifa
2023-09-18 18:21 ` Guenter Roeck
0 siblings, 1 reply; 15+ messages in thread
From: Ahmad Khalifa @ 2023-09-18 17:02 UTC (permalink / raw)
To: Doug Smythies
Cc: 'Jean Delvare', linux-hwmon, 'Guenter Roeck'
On 17/09/2023 22:17, Doug Smythies wrote:
> With the kernel I compiled yesterday for the test patch, the file was not there.
That's the better approach, the file shouldn't exist.
Would you like to submit that patch then? I can test it and reply with a
"Tested-by" tag after. If not, happy to submit one.
--
Regards,
Ahmad
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: hwmon: (nct6775) Regression Bisected
2023-09-18 17:02 ` Ahmad Khalifa
@ 2023-09-18 18:21 ` Guenter Roeck
0 siblings, 0 replies; 15+ messages in thread
From: Guenter Roeck @ 2023-09-18 18:21 UTC (permalink / raw)
To: Ahmad Khalifa, Doug Smythies; +Cc: 'Jean Delvare', linux-hwmon
On 9/18/23 10:02, Ahmad Khalifa wrote:
> On 17/09/2023 22:17, Doug Smythies wrote:
>> With the kernel I compiled yesterday for the test patch, the file was not there.
>
> That's the better approach, the file shouldn't exist.
> Would you like to submit that patch then? I can test it and reply with a
> "Tested-by" tag after. If not, happy to submit one.
>
I was waiting for you to submit the patch. Please do.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: hwmon: (nct6775) Regression Bisected
2023-09-16 9:20 ` Bagas Sanjaya
@ 2023-09-21 9:14 ` Linux regression tracking #update (Thorsten Leemhuis)
0 siblings, 0 replies; 15+ messages in thread
From: Linux regression tracking #update (Thorsten Leemhuis) @ 2023-09-21 9:14 UTC (permalink / raw)
To: Bagas Sanjaya, Doug Smythies, 'Ahmad Khalifa',
'Guenter Roeck'
Cc: 'Jean Delvare', Linux Hardware Monitoring,
Linux Regressions, Linux Kernel Mailing List
[TLDR: This mail in primarily relevant for Linux kernel regression
tracking. See link in footer if these mails annoy you.]
On 16.09.23 11:20, Bagas Sanjaya wrote:
> On Fri, Sep 15, 2023 at 07:28:57AM -0700, Doug Smythies wrote:
>> Kernel 6.6-rc1 has an error during boot. The guilty commit is:
>> b7f1f7b2523a6a4382f12fe953380b847b80e09d
>> hwmon: (nct6775) Additional TEMP registers for nct6799
> [...]
> Thanks for the regression report. I'm adding it to regzbot:
>
> #regzbot ^introduced: b7f1f7b2523a6a
> #regzbot title: shift out-of-bounds in nct6799's additional TEMP registers
Fix doesn't use a link regzbot is able to handle, thus point to it manually:
#regzbot fix: hwmon: (nct6775) Fix non-existent ALARM warning
#regzbot ignore-activity
Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)
--
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
That page also explains what to do if mails like this annoy you.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2023-09-21 19:41 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-15 14:28 hwmon: (nct6775) Regression Bisected Doug Smythies
2023-09-15 15:00 ` Guenter Roeck
2023-09-16 3:12 ` Guenter Roeck
2023-09-16 16:43 ` Ahmad Khalifa
2023-09-16 17:04 ` Guenter Roeck
2023-09-16 17:45 ` Ahmad Khalifa
2023-09-16 18:11 ` Guenter Roeck
2023-09-16 19:30 ` Doug Smythies
2023-09-16 20:27 ` Guenter Roeck
2023-09-16 18:09 ` Guenter Roeck
2023-09-17 21:17 ` Doug Smythies
2023-09-18 17:02 ` Ahmad Khalifa
2023-09-18 18:21 ` Guenter Roeck
2023-09-16 9:20 ` Bagas Sanjaya
2023-09-21 9:14 ` Linux regression tracking #update (Thorsten Leemhuis)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox