From e177ee5c7d78d895c927df6fd08c17fde993ca75 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BCrgen=20Wall?= <fakeEmail@fakesite.fake>
Date: Tue, 2 Oct 2012 23:59:28 +0000
Subject: [PATCH] Keep ownership change request interrupt enabled for handover
from SMM.
* Disabling all interrupts prior to ownership handover from SMM
can prevent propper OHCI and PS/2 functionality as described in #8987
and 8984. In that case SMM does not respond to the ownership change
request. As suggested by mmlr this patch attemps to resolve that by
keeping the ownership change request interrupt enabled.
* Removed an unnecessary reset upon non-responding SMM for now,
since we reset a few lines later anyway and added ToDos respectively.
That should safe a bit boot time.
---
src/add-ons/kernel/busses/usb/ohci.cpp | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/add-ons/kernel/busses/usb/ohci.cpp b/src/add-ons/kernel/busses/usb/ohci.cpp
index df38174..bd68b2e 100644
a
|
b
|
OHCI::OHCI(pci_info *info, Stack *stack)
|
206 | 206 | fInterruptEndpoints[0]->next_physical_endpoint |
207 | 207 | = fDummyIsochronous->physical_address; |
208 | 208 | |
209 | | // Disable all interrupts before handoff/reset |
210 | | _WriteReg(OHCI_INTERRUPT_DISABLE, OHCI_ALL_INTERRUPTS); |
| 209 | // Disable all but one interrupt to prevent interrupt storm during |
| 210 | // handover while keeping ownership change interrupt enabled |
| 211 | _WriteReg(OHCI_INTERRUPT_DISABLE, OHCI_ALL_INTERRUPTS & |
| 212 | ~OHCI_OWNERSHIP_CHANGE) ; |
211 | 213 | |
212 | 214 | // Determine in what context we are running (Kindly copied from FreeBSD) |
213 | 215 | uint32 control = _ReadReg(OHCI_CONTROL); |
… |
… |
OHCI::OHCI(pci_info *info, Stack *stack)
|
221 | 223 | } |
222 | 224 | |
223 | 225 | if ((control & OHCI_INTERRUPT_ROUTING) != 0) { |
224 | | TRACE_ERROR("smm does not respond. resetting...\n"); |
225 | | _WriteReg(OHCI_CONTROL, OHCI_HC_FUNCTIONAL_STATE_RESET); |
226 | | snooze(USB_DELAY_BUS_RESET); |
| 226 | TRACE_ERROR("smm does not respond.\n"); |
| 227 | |
| 228 | // ToDo: Enable this reset as soon as the non-specified |
| 229 | // reset a few lines later is replaced by a better solution. |
| 230 | //_WriteReg(OHCI_CONTROL, OHCI_HC_FUNCTIONAL_STATE_RESET); |
| 231 | //snooze(USB_DELAY_BUS_RESET); |
227 | 232 | } else |
228 | 233 | TRACE_ALWAYS("ownership change successful\n"); |
229 | 234 | } else { |
… |
… |
OHCI::OHCI(pci_info *info, Stack *stack)
|
231 | 236 | snooze(USB_DELAY_BUS_RESET); |
232 | 237 | } |
233 | 238 | |
234 | | // This reset should not be necessary according to the OHCI spec, but |
235 | | // without it some controllers do not start. |
| 239 | // ToDo: This reset delays system boot time. It should not be necessary |
| 240 | // according to the OHCI spec, but without it some controllers don't start. |
236 | 241 | _WriteReg(OHCI_CONTROL, OHCI_HC_FUNCTIONAL_STATE_RESET); |
237 | 242 | snooze(USB_DELAY_BUS_RESET); |
238 | 243 | |