Ignore:
Timestamp:
Mar 1, 2011, 10:10:11 AM (14 years ago)
Author:
chris
Message:

Version 1.06
============

  • Finally came across a BIOS which accesses the ICH7/8 controller via SATA registers (i.e. not AHCI mode). This required a few changes to the code at boot time because it turned out that COMRESETs are required whenever switching to/from AHCI mode to allow the AHCI or SATA controller to re-discover the attached devices:
  • 'init_reset' will now be forced on when finding a controller in non-AHCI mode at boot time.
  • A COMRESET is initiated for each implemented port after turning off AHCI mode when restoring the BIOS configuration; this is done only for Intel controllers at this point because they map the AHCI port SCR MMIO registers even when not in AHCI mode.
  • apm_suspend() has been adjusted to restore the BIOS configuration to prevent needless timeouts when the BIOS takes over during suspend or power-off operations.
  • Small changes to the functions which save/restore BIOS/port settings to avoid pitfalls; among others, the port save/restore code now also saves and restores the port's engine status.
  • Improvements to debug logging around port resets.
  • Moved code to clear pending interrupts from ahci_reset_port() to ahci_stop_port() because both need it and resetting a port involves stopping it, first.
  • NCQ mode has found to cause problems on a Dell D630. This may be related to the hard disk used for the test but since I've never seen more than one queued command regardless of the I/O load (even during simulaneous xcopy operations), NCQ mode is now off by default and needs to be turned on via the /N switch (i.e. the the /N switch now has a reversed meaning).
  • Removed the code which attempts to establish another MMIO base address in case the one assigned by the BIOS can't be reserved via resource manager; if there's a conflict, it's extremely unlikely we would ever be able to restore the BIOS MMIO address at boot time without the BIOS clashing with whatever conflicts with the MMIO address, thus there's no point trying to do any of this.
  • Implemented a reset context hook watchdog; in the early boot phase, some components apparently don't yield the CPU so the context hook will never execute without the watchdog. Now we'll give the context hook 10 seconds to execute, otherwise the watchdog will expire and we'll call the context hook directly from the corresponding timer callback.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/os2ahci.c

    r77 r80  
    101101/* apapter/port-specific options saved when parsing the command line */
    102102u8              emulate_scsi[MAX_AD][AHCI_MAX_PORTS];
    103 u8              disable_ncq[MAX_AD][AHCI_MAX_PORTS];
     103u8              enable_ncq[MAX_AD][AHCI_MAX_PORTS];
    104104u8              link_speed[MAX_AD][AHCI_MAX_PORTS];
    105105u8              link_power[MAX_AD][AHCI_MAX_PORTS];
     
    261261      case 'n':
    262262        /* disable NCQ */
    263         set_port_option(disable_ncq, !invert_option);
     263        set_port_option(enable_ncq, !invert_option);
    264264        break;
    265265
     
    789789 *        requests.
    790790 *
    791  *        In order to support applications that can't deal with ATAPI devies
     791 *        In order to support applications that can't deal with ATAPI devices
    792792 *        (i.e. need a SCSI adapter) os2ahci will optionally report ATAPI
    793793 *        dvices as SCSI devices. The corresponding SCSI adapter doesn't
    794  *        really  exist and is only reported here for the IOCM_GET_DEVICETABLE
     794 *        really exist and is only reported here for the IOCM_GET_DEVICETABLE
    795795 *        request. The units attached to this adapter will use the real HW
    796796 *        unit IDs, thus we'll never receive a command specific to the
     
    11641164
    11651165/******************************************************************************
    1166  * Complete an IORB. It should be called without the adapter-level spinlock
     1166 * Complete an IORB. This should be called without the adapter-level spinlock
    11671167 * to allow the IORB completion routine to perform whatever processing it
    11681168 * requires. This implies that the IORB should no longer be in any global
     
    12201220/******************************************************************************
    12211221 * Lock the adapter, waiting for availability if necessary. This is expected
    1222  * to be called without the driver-level spinlock aquired.
     1222 * to be called at task/request time without the driver-level spinlock
     1223 * aquired. Don't call at interrupt time.
    12231224 */
    12241225void lock_adapter(AD_INFO *ai)
     
    12821283   */
    12831284  DevHelp_ArmCtxHook(0, reset_ctxhook_h);
     1285
     1286  /* Set up a watchdog timer which calls the context hook manually in case
     1287   * some kernel thread is looping around the IORB_COMPLETE status bit
     1288   * without yielding the CPU (kernel threads don't preempt). This shouldn't
     1289   * happen per design because kernel threads are supposed to yield but it
     1290   * does in the early boot phase.
     1291   */
     1292  ADD_StartTimerMS(&th_reset_watchdog, 5000, (PFN) reset_watchdog, 0, 0);
     1293}
     1294
     1295/******************************************************************************
     1296 * Reset handler watchdog. If a timeout occurs, a context hook is armed which
     1297 * will execute as soon as a kernel thread yields the CPU. However, some
     1298 * kernel components won't yield the CPU during the early boot phase and the
     1299 * only way to kick some sense into those components is to run the context
     1300 * hook right inside this timer callback. Not exactly pretty, especially
     1301 * considering the fact that context hooks were implemented to prevent running
     1302 * lengthy operations like a port reset at task time, but without this
     1303 * watchdog mechanism we run the risk of getting completely stalled by device
     1304 * problems during the early boot phase.
     1305 */
     1306void _cdecl _far reset_watchdog(ULONG timer_handle, ULONG p1,
     1307                                ULONG p2)
     1308{
     1309  /* reset watchdog timer */
     1310  ADD_CancelTimer(timer_handle);
     1311  dprintf("reset watchdog invoked\n");
     1312
     1313  /* call context hook manually */
     1314  reset_ctxhook(0);
    12841315}
    12851316
Note: See TracChangeset for help on using the changeset viewer.