diff options
| -rw-r--r-- | arch/i386/kernel/apic.c | 15 | ||||
| -rw-r--r-- | arch/x86_64/kernel/apic.c | 15 |
2 files changed, 26 insertions, 4 deletions
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index 5f197e197c55..7ce09492fc0c 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c | |||
| @@ -157,7 +157,7 @@ void clear_local_APIC(void) | |||
| 157 | maxlvt = get_maxlvt(); | 157 | maxlvt = get_maxlvt(); |
| 158 | 158 | ||
| 159 | /* | 159 | /* |
| 160 | * Masking an LVT entry on a P6 can trigger a local APIC error | 160 | * Masking an LVT entry can trigger a local APIC error |
| 161 | * if the vector is zero. Mask LVTERR first to prevent this. | 161 | * if the vector is zero. Mask LVTERR first to prevent this. |
| 162 | */ | 162 | */ |
| 163 | if (maxlvt >= 3) { | 163 | if (maxlvt >= 3) { |
| @@ -1118,7 +1118,18 @@ void disable_APIC_timer(void) | |||
| 1118 | unsigned long v; | 1118 | unsigned long v; |
| 1119 | 1119 | ||
| 1120 | v = apic_read(APIC_LVTT); | 1120 | v = apic_read(APIC_LVTT); |
| 1121 | apic_write_around(APIC_LVTT, v | APIC_LVT_MASKED); | 1121 | /* |
| 1122 | * When an illegal vector value (0-15) is written to an LVT | ||
| 1123 | * entry and delivery mode is Fixed, the APIC may signal an | ||
| 1124 | * illegal vector error, with out regard to whether the mask | ||
| 1125 | * bit is set or whether an interrupt is actually seen on input. | ||
| 1126 | * | ||
| 1127 | * Boot sequence might call this function when the LVTT has | ||
| 1128 | * '0' vector value. So make sure vector field is set to | ||
| 1129 | * valid value. | ||
| 1130 | */ | ||
| 1131 | v |= (APIC_LVT_MASKED | LOCAL_TIMER_VECTOR); | ||
| 1132 | apic_write_around(APIC_LVTT, v); | ||
| 1122 | } | 1133 | } |
| 1123 | } | 1134 | } |
| 1124 | 1135 | ||
diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c index 396e125cb212..b2ead91df218 100644 --- a/arch/x86_64/kernel/apic.c +++ b/arch/x86_64/kernel/apic.c | |||
| @@ -100,7 +100,7 @@ void clear_local_APIC(void) | |||
| 100 | maxlvt = get_maxlvt(); | 100 | maxlvt = get_maxlvt(); |
| 101 | 101 | ||
| 102 | /* | 102 | /* |
| 103 | * Masking an LVT entry on a P6 can trigger a local APIC error | 103 | * Masking an LVT entry can trigger a local APIC error |
| 104 | * if the vector is zero. Mask LVTERR first to prevent this. | 104 | * if the vector is zero. Mask LVTERR first to prevent this. |
| 105 | */ | 105 | */ |
| 106 | if (maxlvt >= 3) { | 106 | if (maxlvt >= 3) { |
| @@ -851,7 +851,18 @@ void disable_APIC_timer(void) | |||
| 851 | unsigned long v; | 851 | unsigned long v; |
| 852 | 852 | ||
| 853 | v = apic_read(APIC_LVTT); | 853 | v = apic_read(APIC_LVTT); |
| 854 | apic_write(APIC_LVTT, v | APIC_LVT_MASKED); | 854 | /* |
| 855 | * When an illegal vector value (0-15) is written to an LVT | ||
| 856 | * entry and delivery mode is Fixed, the APIC may signal an | ||
| 857 | * illegal vector error, with out regard to whether the mask | ||
| 858 | * bit is set or whether an interrupt is actually seen on input. | ||
| 859 | * | ||
| 860 | * Boot sequence might call this function when the LVTT has | ||
| 861 | * '0' vector value. So make sure vector field is set to | ||
| 862 | * valid value. | ||
| 863 | */ | ||
| 864 | v |= (APIC_LVT_MASKED | LOCAL_TIMER_VECTOR); | ||
| 865 | apic_write(APIC_LVTT, v); | ||
| 855 | } | 866 | } |
| 856 | } | 867 | } |
| 857 | 868 | ||
