patch: asc7621 driver bug fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



George,

Here are some suggested bug fixes for the asc7621 driver source which 
you posted to lm_sensors on 29 May.
(http://lists.lm-sensors.org/pipermail/lm-sensors/2008-May/023257.html)

Attached patch #1 contains the following fixes; I think these are 
relatively uncontroversial:

show_in10() : fix incorrect scaling of the 2 LSB of input voltages.

store_in8() : fix calculation overflow which was corrupting voltage limits.

store_temp62() : avoid compiler warning.

asc7621_params : correct fan1-fan4 alarm bit shifts

asc7621_params : correct wrong address for temp3_smoothing_enable

asc7621_update_device() : fix typos which were causing incorrect
scanning of the low priority registers.

Now for the more controversial bit:  I'm rather concerned about the 
asc7621_register_priorities array, which appears to be a kind of 
reverse-index by register address of what is in asc7621_params.  It 
contains information which is constant, and known at compile time so it 
would be better not to have to go through all the trouble of building it 
up in asc7621_init_client().  You might want to consider moving this 
work into the module start-up code, rather than the per-client 
initialisation; it only needs to happen once.  A better solution might 
be to remove it altogether.  I've tried to do this in the attached patch 
#2, which uses hard-coded register lists.  The result isn't exactly 
pretty, but doing it in a cleaner way will require a lot of rework on 
the rest of the module.  Anyway, see what you think.

BTW, IMHO the alarms should be read as high priority registers, and I've 
reflected this in the patch.

While I'm on, I'd like to say many thanks to you for taking the time and 
trouble to write this driver!  Given that Andigilog have provided such 
excellent documentation for these chips, it is a shame that there is 
still no support for them in the kernel and I hope that will soon be 
rectified.

Best wishes,

Ken.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: asc7621_patch1.diff
Url: http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20080705/f5bc8dd1/attachment.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: asc7621_patch2.diff
Url: http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20080705/f5bc8dd1/attachment-0001.pl 


[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux