]> git.baikalelectronics.ru Git - kernel.git/commit
x86/apic: Read Error Status Register correctly
authorRichard Weinberger <richard@nod.at>
Tue, 14 Jan 2014 07:44:47 +0000 (08:44 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 14 Jan 2014 13:05:36 +0000 (14:05 +0100)
commit96afda7e03368bba80a2c289a34525a76e449b78
tree27ee649bd8612ab1e0f3e531ce952e9b4f50b8e4
parentf1f6da94d81a8d49f4fd56ccfa5cee67e895df9f
x86/apic: Read Error Status Register correctly

Currently we do a read, a dummy write and a final read to fetch
the error code. The value from the final read is taken.
This is not the recommended way and leads to corrupted/lost ESR
values.

Intel(c) 64 and IA-32 Architectures Software Developer's Manual,
Combined Volumes 1, 2ABC, 3ABC, Section 10.5.3 states:

  Before attempt to read from the ESR, software should first
  write to it. (The value written does not affect the values read
  subsequently; only zero may be written in x2APIC mode.) This
  write clears any previously logged errors and updates the ESR
  with any errors detected since the last write to the ESR.
  This write also rearms the APIC error interrupt triggering
  mechanism.

This patch removes the first read such that we are conform with
the manual.

On my (very old) Pentium MMX SMP system this patch fixes the
issue that APIC errors:

  a) are not always reported and
  b) are reported with false error numbers.

Signed-off-by: Richard Weinberger <richard@nod.at>
Cc: seiji.aguchi@hds.com
Cc: rientjes@google.com
Cc: konrad.wilk@oracle.com
Cc: bp@alien8.de
Cc: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/1389685487-20872-1-git-send-email-richard@nod.at
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/apic/apic.c