Changeset 145 for trunk/src/os2ahci/ahci.c
- Timestamp:
- Jan 5, 2013, 4:19:48 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/ahci.c
r144 r145 1305 1305 * writes), we may be stacking interrupts on top of each other. If we 1306 1306 * detect this, we'll pass this on to the engine context hook. 1307 * 1308 * Rousseau: 1309 * The "Physycal Device Driver Reference" states that it's a good idea 1310 * to disable interrupts before doing EOI so that it can proceed for this 1311 * level without being interrupted, which could cause stacked interrupts, 1312 * possibly exhausting the interrupt stack. 1313 * (?:\IBMDDK\DOCS\PDDREF.INF->Device Helper (DevHlp) Services)->EOI) 1314 * 1315 * This is what seemed to happen when running in VirtualBox. 1316 * Since in VBox the AHCI-controller is a software implementation, it is 1317 * just not fast enough to handle a large bulk of requests, like when JFS 1318 * flushes it's caches. 1319 * 1320 * Cross referencing with DANIS506 shows she does the same in the 1321 * state-machine code in s506sm.c around line 244; disable interrupts 1322 * before doing the EOI. 1323 * 1324 * Comments on the disable() function state that SMP systems should use 1325 * a spinlock, but putting the EOI before spin_unlock() did not solve the 1326 * VBox ussue. This is probably because spin_unlock() enables interrupts, 1327 * which implies we need to return from this handler with interrupts 1328 * disabled. 1307 1329 */ 1308 1330 if ((u16) (u32) (void _far *) &irq_stat < 0xf000) { 1309 1331 ddprintf("IRQ stack running low; arming engine context hook\n"); 1332 /* Rousseau: 1333 * A context hook cannot be re-armed before it has completed. 1334 * (?:\IBMDDK\DOCS\PDDREF.INF->Device Helper (DevHlp) Services)->ArmCtxHook) 1335 * Also, it is executed at task-time, thus in the context of some 1336 * application thread. Stacked interrupts with a stack below the 1337 * threshold specified above, (0xf000), will repeatly try to arm the 1338 * context hook, but since we are in an interrupted interrupt handler, 1339 * it's highly unlikely the hook has completed. 1340 * So, possibly only the first arming is succesful and subsequent armings 1341 * will fail because no task-time thread has run between the stacked 1342 * interrupts. One hint would be that if the dispatching truely worked, 1343 * excessive stacked interrupts in VBox would not be a problem. 1344 * This needs some more investigation. 1345 */ 1310 1346 DevHelp_ArmCtxHook(0, engine_ctxhook_h); 1311 1347 // DevHelp_EOI(irq); 1312 1348 } else { 1313 1349 spin_lock(drv_lock); 1314 1350 trigger_engine(); 1351 // DevHelp_EOI(irq); 1315 1352 spin_unlock(drv_lock); 1316 1353 } 1317 1354 /* disable interrupts to prevent stacking. (See comments above) */ 1355 disable(); 1318 1356 /* complete the interrupt */ 1319 1357 DevHelp_EOI(irq);
Note:
See TracChangeset
for help on using the changeset viewer.