Fix record_temp_fan function in avalon driver. Patch by Xiangfu <xiangfu@openmobilefree.net>
Store the subid for the work item in avalon.
We should check for a restart message before checking for a timeout in avalon scanhash.
Check for a restart before a timeout in message parsing code in avalon.
The current hash count returned by avalon scanhash is just an obfuscated utility counter so make it explicit.
Use a separate avalon_get_reset function for resetting avalon instead of using avalon_get_result.
The read_count is unused by the avalon get result code and no longer required for avalon reset so simplify code removing it.
avalon_gets is always called from the one call site so inline it.
Use only 2 queued work arrays in avalon.
If we get a restart message in avalon_gets still check if there's a receive message to parse first without a timeout before returning AVA_GETS_RESTART.
Show error codes on select and read fail in avalon.
Make the detection of all wrong results on avalon much more conservative to avoid false positives on work restarts.
Check for AVA_GETS_RESTART when deciding if avalon has messed up.
Reuse avalon_get_work_count variable.
Show read discrepancy in avalon_get_reset.
Do sequential reads in avalon_get_reset to cope with partial reads.
Use no timeout on further reads in avalon_gets
Revert "Use only 2 queued work arrays in avalon."

This reverts commit 0ea9d68d6786473b641bc377651b908aeeab06a2.

This was leading to failure to find work items on block changes.
The result_wrong measurement for avalon is continually leading to false positives so remove it.
select() on serial usb in avalon does not work properly with zero timeout.