0

Can it87 Linux driver conflict with BIOS or hardware devices (motherboard ASUS M5A99FX PRO 2)? For example, there is a function in Linux driver (drivers/hwmon/it87.c):

/*
 * Must be called with data->update_lock held, except during initialization.
 * We ignore the IT87 BUSY flag at this moment - it could lead to deadlocks,
 * would slow down the IT87 access and should not be necessary.
 */
static int it87_read_value(struct it87_data *data, u8 reg)
{
    outb_p(reg, data->addr + IT87_ADDR_REG_OFFSET);
    return inb_p(data->addr + IT87_DATA_REG_OFFSET);
}

Is the next situation possible? A firmware, running on core 0 on multicore system, writes into the "data->addr + IT87_ADDR_REG_OFFSET" register. Then Linux driver, running on core 1, executes it87_read_value and thus modifies the "data->addr + IT87_ADDR_REG_OFFSET" register. Then the firmware tries to read "data->addr + IT87_DATA_REG_OFFSET" and gets wrong data.

Also the it87 driver supports alarms: "If an alarm triggers, it will remain triggered until the hardware register is read at least once. This means that the cause for the alarm may already have disappeared! Note that in the current implementation, all hardware registers are read whenever any data is read (unless it is less than 1.5 seconds since the last update). This means that you can easily miss once-only alarms." (Linux kernel, Documentation/hwmon/it87). Is it possible that the firmware will miss an alarm if Linux driver reads the alarm register?

It seems that hardware monitoring chip is IT8721F.

Also the ASUS M5A99FX PRO 2 motherboard contains TPU (turbo processor unit) and EPU (energy processor unit). Do these chips interacts with IT8721F and can a situation similar to the described occur?

Is it known how ASUS Ai Suite interacts with the hardware? Are there a specific ACPI interface to read temperature, a fan speed and so on, which is not implemented in Linux?

Output of the "sensors" command (it87 module manually loaded):

it8721-isa-0290
Adapter: ISA adapter
in0: +2.82 V (min = +1.96 V, max = +3.04 V)
in1: +2.84 V (min = +1.27 V, max = +2.78 V) ALARM
in2: +0.95 V (min = +3.02 V, max = +2.10 V) ALARM
+3.3V: +3.29 V (min = +2.71 V, max = +4.61 V)
in4: +1.02 V (min = +2.92 V, max = +2.41 V) ALARM
in5: +2.52 V (min = +3.04 V, max = +2.23 V) ALARM
in6: +1.92 V (min = +1.48 V, max = +1.75 V) ALARM
3VSB: +2.04 V (min = +1.94 V, max = +5.93 V)
Vbat: +3.29 V 
fan1: 903 RPM (min = 22 RPM)
fan2: 0 RPM (min = 11 RPM) ALARM
fan3: 0 RPM (min = 10 RPM) ALARM
temp1: +33.0°C (low = -62.0°C, high = +109.0°C) sensor = thermistor
temp2: +32.0°C (low = -72.0°C, high = +60.0°C) sensor = thermistor
temp3: -128.0°C (low = -33.0°C, high = -125.0°C) sensor = disabled
intrusion0: OK

fan2 and fan3 are absent so 0 RPM is right.

I haven't seen any real problem while "it87" module is loaded and temperature data is being read. But I am not sure that such problem won't occur.

4
  • What kind of "firmware" do you imagine to run on core 0? The only thing that should run is a single instance of the Linux driver, so there should be no concurrency bugs.
    – dirkt
    Commented Feb 26, 2017 at 10:25
  • System management interrupt handler (part of the BIOS). It is has more privileges than the OS kernel and can run while the OS is running. I don't know whether it accesses the hardware monitoring chip while the OS is running. Maybe the SMI handler blocks access to the chip while working with it. The source code of the BIOS is closed. Commented Feb 26, 2017 at 14:23
  • You can always (1) disable SMI or (2) blacklist the Linux it87 driver. The principle "only one piece of software should control a particular piece of hardware" also applies to SMI/Linux drivers. Though the worst thing that could happen through concurrency problems would be a (single) illegal value - which isn't dangerous. If something overheats, the next read will catch it. Thermal processes are slow.
    – dirkt
    Commented Feb 26, 2017 at 16:13
  • It is possible (and safe) to disable system management interrupts and how it is better to do this? Using BIOS settings, probably disabling fan control? But the fan control can be implemented in hardware without SMI. The hardware monitoring chip also provides voltage monitoring. Is it possible that due to concurrency problems wrong voltage will be set? Commented Feb 27, 2017 at 14:53

0

You must log in to answer this question.

Browse other questions tagged .