kernel - Fix ig4 operation for certain machines
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 21 Mar 2016 18:33:54 +0000 (11:33 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 21 Mar 2016 18:33:54 +0000 (11:33 -0700)
commit2010e26953b9dc96ac7986666ce25b0fbe38f1ca
treeabf0b36d585d3abe81a3b4c954023cee447e772c
parente3c44cf9512eaeefc854f1301b03c687a682a5b4
kernel - Fix ig4 operation for certain machines

* Some machine BIOSes use the I2C bus and leave it in a state that causes
  interrupts to not work properly due to a pending interrupt having been
  latched.

* Refactor the code a bit to clear pending interrupts when I2C is enabled.
  This fixes the primary problem.

* Also fix a possible race condition in the interrupt handler where the
  interrupt was being cleared after reading the status instead of before.
sys/bus/smbus/ichiic/ig4_iic.c