After some experimentation, I managed to get our x86 Atom flight
computer, the Advantech PCM-3363N-1GS6A1E, to operate without System
Management Interrupts (SMIs), so that we can reasonably do realtime
control on it.

Summary: Change the BIOS setting "Legacy USB support" (under Advanced)
to "Auto" rather than the default "Enable", and never boot the system
from USB (use Compact Flash instead).

I tested for SMIs using BITS (http://biosbits.org/).  With the default
setting of enabling legacy USB, I got the following results:

Testing SMI latency...
Warning: touching the keyboard can affect the results of this test.
Starting pass #1.  Calibrating the TSC.
Starting pass #2.  Wait here, I will be back in 15 seconds.
0     < t <=   1us; average =  107ns; count = 138915105
 Times between first few observations:  234ns  156ns  144ns  156ns  132ns
100us < t <=   1ms; average =  509us; count = 58
 Times between first few observations:  256ms  256ms  256ms  256ms  256ms

Summary of impact: observed maximum latency =  523us
SMI latency < 150us to minimize risk of OS timeouts FAIL
Risk of OS timeouts exists with this observed latency.
Summary: 0 passed, 1 failed


The note about testing for SMI latency < 150us represents Intel's
recommendation for stock desktops, laptops, and servers; obviously for
realtime control we'd expect even less than that.  However, the
4Hz SMIs of >500us don't meet that requirement, either.

Some investigation suggested that these SMIs might occur due to legacy
USB support, used in the BIOS to support input from USB keyboards and
booting from USB storage devices.

Given that potential culprit, I tried using BITS to perform the USB
handoff from BIOS to OS, to see if the SMIs went away once the BIOS no
longer handled USB.  The BIOS did hand off USB, but the SMIs still
continued with no change in rate or duration.

However, changing the BIOS setting for legacy USB to either "off" or
"auto" did have the desired effect.  (Note: don't change it to "off"
unless you have a PS/2 keyboard handy, since after doing so you can no
longer interact with the BIOS using a USB keyboard.)  The "auto" setting
means that the BIOS will still use legacy USB if it sees any USB devices
at boot time.  I haven't checked whether that includes non-bootable
USB devices such as our future sensor boards, or only USB input and
storage devices; if it includes *all* USB devices, then we'll have to
change it to "off".  (I currently have it set to "auto" on our board.)

With the BIOS setting changed, BITS shows that the SMIs have gone away:

Testing SMI latency...
Warning: touching the keyboard can affect the results of this test.
Starting pass #1.  Calibrating the TSC.
Starting pass #2.  Wait here, I will be back in 15 seconds.
0     < t <=   1us; average =  107ns; count = 139173406
 Times between first few observations:  252ns  150ns  138ns  144ns  120ns

Summary of impact: observed maximum latency =  252ns
Summary: 1 passed, 0 failed


Ideally, the USB handoff to the OS should disable the SMIs, but we can
work around that by changing the BIOS setting, which allows us to use
this board for realtime operation.

- Josh Triplett

_______________________________________________
psas-avionics mailing list
psas-avionics@lists.psas.pdx.edu
http://lists.psas.pdx.edu/mailman/listinfo/psas-avionics

Reply via email to