ACPI/APEI: Add parameter check before error injection
authorChen Gong <gong.chen@linux.intel.com>
Thu, 6 Jun 2013 22:20:51 +0000 (15:20 -0700)
committerTony Luck <tony.luck@intel.com>
Thu, 6 Jun 2013 22:20:51 +0000 (15:20 -0700)
commitc5a130325f13b219438cb100e2da71a3e31199f3
treea57ee8ac08e1e479078d3e773a87eea3eccae130
parentb8edb64119b4e8158f268e250dcb9919a3b7ccea
ACPI/APEI: Add parameter check before error injection

When param1 is enabled in EINJ but not assigned with a valid
value, sometimes it will cause the error like below:

APEI: Can not request [mem 0x7aaa7000-0x7aaa7007] for APEI EINJ Trigger registers

It is because some firmware will access target address specified in
param1 to trigger the error when injecting memory error. This will
cause resource conflict with regular memory. So It must be removed
from trigger table resources, but incorrect param1/param2
combination will stop this action. Add extra check to avoid
this kind of error.

Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
drivers/acpi/apei/einj.c
kernel/resource.c