- Timestamp:
- Aug 24, 2019, 6:36:37 PM (6 years ago)
- Location:
- trunk/src/os2ahci
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/ReadMe.txt
r198 r201 1 AHCI Driver for OS/2 v2.0 61 AHCI Driver for OS/2 v2.07 2 2 3 3 Introduction … … 173 173 BASEDEV=OS2AHCI.ADD /A:0 /P:0 /I 174 174 175 Means to i ngore the disk plugged into port 0 on adapeter 0.175 Means to ignore the disk plugged into port 0 on adapeter 0. 176 176 177 177 … … 184 184 to reorder I/O requests to minimize head movements, resulting in improved 185 185 performance when executing random I/Os. In practice, this will be most 186 notic able when multiple programs request I/O services to different parts186 noticeable when multiple programs request I/O services to different parts 187 187 of the disk -- a single program typically won't queue up I/O's but instead 188 188 will wait for each I/O to complete (with the exception of programs like … … 388 388 Change Log 389 389 ========== 390 v.2.07 19-May-2019 - David Azarewicz 391 Fixed hardware failure recovery to arm ctx hook in watchdog timer. 390 392 391 393 v.2.06 19-Sep-2018 - David Azarewicz -
trunk/src/os2ahci/ahci.c
r200 r201 274 274 } 275 275 276 DPRINTF(3, "ahci_save_bios_config: BIOS AHCI mode is %d\n", ai->bios_config[HOST_CTL / sizeof(u32)] & HOST_AHCI_EN);276 DPRINTF(3,__func__": BIOS AHCI mode is %d\n", ai->bios_config[HOST_CTL / sizeof(u32)] & HOST_AHCI_EN); 277 277 278 278 if ((ai->bios_config[HOST_CTL / sizeof(u32)] & HOST_AHCI_EN) == 0 && ai->pci_vendor == PCI_VENDOR_ID_INTEL) … … 296 296 int ahci_restore_bios_config(AD_INFO *ai) 297 297 { 298 DPRINTF(3, "ahci_restore_bios_config: restoring AHCI BIOS configuration on adapter %d\n", ad_no(ai));298 DPRINTF(3,__func__": restoring AHCI BIOS configuration on adapter %d\n", ad_no(ai)); 299 299 300 300 /* Restore saved BIOS configuration; please note that HOST_CTL is restored … … 354 354 int ahci_restore_initial_config(AD_INFO *ai) 355 355 { 356 DPRINTF(3, "ahci_restore_initial_config: restoring initial configuration on adapter %d\n", ad_no(ai));356 DPRINTF(3,__func__": restoring initial configuration on adapter %d\n", ad_no(ai)); 357 357 358 358 /* restore saved BIOS configuration */ … … 535 535 int i; 536 536 537 DPRINTF(1, "ahci_complete_init: completing initialization of adapter #%d\n", ad_no(ai));537 DPRINTF(1,__func__": completing initialization of adapter #%d\n", ad_no(ai)); 538 538 539 539 if (!ai->int_set) … … 592 592 if (init_reset) 593 593 { 594 DPRINTF(3, "ahci_complete_init: resetting port %d\n", p);594 DPRINTF(3,__func__": resetting port %d\n", p); 595 595 ahci_reset_port(ai, p, 1); 596 596 } 597 597 else 598 598 { 599 DPRINTF(3, "ahci_complete_init: restarting port #%d\n", p);599 DPRINTF(3,__func__": restarting port #%d\n", p); 600 600 ahci_stop_port(ai, p); 601 601 ahci_start_port(ai, p, 1); … … 615 615 /* pci_enable_int(ai->bus, ai->dev_func); */ 616 616 617 DPRINTF(1, "ahci_complete_init: done\n");617 DPRINTF(1,__func__": done\n"); 618 618 return(0); 619 619 } … … 918 918 TIMER Timer; 919 919 920 DPRINTF(2, "ahci_reset_port: resetting port %d.%d\n", ad_no(ai), p);920 DPRINTF(2,__func__": resetting port %d.%d\n", ad_no(ai), p); 921 921 DUMP_PORT_REGS(2,ai,p); 922 922 … … 935 935 936 936 /* set link speed and power management options */ 937 DPRINTF(3, "ahci_reset_port: setting link speed and power management options\n");937 DPRINTF(3,__func__": setting link speed and power management options\n"); 938 938 tmp = readl(port_mmio + PORT_SCR_CTL) & ~0x00000fffUL; 939 939 tmp |= (link_speed[ad_no(ai)][p] & 0x0f) << 4; … … 942 942 943 943 /* issue COMRESET on the port */ 944 DPRINTF(3, "ahci_reset_port: issuing COMRESET on port %d\n", p);944 DPRINTF(3,__func__": issuing COMRESET on port %d\n", p); 945 945 writel(port_mmio + PORT_SCR_CTL, tmp | 1); 946 946 readl(port_mmio + PORT_SCR_CTL); /* flush */ … … 969 969 970 970 /* start port so we can receive the COMRESET FIS */ 971 DPRINTF(2, "ahci_reset_port: starting port %d again\n", p);971 DPRINTF(2,__func__": starting port %d again\n", p); 972 972 ahci_start_port(ai, p, ei); 973 973 … … 983 983 } 984 984 } 985 DPRINTF(3, "ahci_reset_port: PORT_TFDATA = 0x%x\n", readl(port_mmio + PORT_TFDATA));985 DPRINTF(3,__func__": PORT_TFDATA = 0x%x\n", readl(port_mmio + PORT_TFDATA)); 986 986 987 987 return(0); … … 996 996 u32 status; 997 997 998 DPRINTF(3, "ahci_start_port%d.%d\n", ad_no(ai), p);998 DPRINTF(3,__func__": %d.%d\n", ad_no(ai), p); 999 999 /* check whether device presence is detected and link established */ 1000 1000 1001 1001 status = readl(port_mmio + PORT_SCR_STAT); 1002 DPRINTF(3, "ahci_start_port: PORT_SCR_STAT = 0x%x\n", status);1002 DPRINTF(3,__func__": PORT_SCR_STAT = 0x%x\n", status); 1003 1003 if ((status & 0xf) != 3) return(-1); 1004 1004 1005 1005 /* clear SError, if any */ 1006 1006 status = readl(port_mmio + PORT_SCR_ERR); 1007 DPRINTF(3, "ahci_start_port: PORT_SCR_ERR = 0x%x\n", status);1007 DPRINTF(3,__func__": PORT_SCR_ERR = 0x%x\n", status); 1008 1008 writel(port_mmio + PORT_SCR_ERR, status); 1009 1009 … … 1093 1093 int rc; 1094 1094 1095 DPRINTF(3, "ahci_stop_port%d.%d\n", ad_no(ai), p);1095 DPRINTF(3,__func__": %d.%d\n", ad_no(ai), p); 1096 1096 1097 1097 /* disable port interrupts */ … … 1101 1101 if ((rc = ahci_stop_fis_rx(ai, p)) != 0) 1102 1102 { 1103 dprintf(0, "error: failed to stop FIS receive (%d)\n", rc);1103 dprintf(0,__func__": failed to stop FIS receive (%d)\n", rc); 1104 1104 return(rc); 1105 1105 } … … 1108 1108 if ((rc = ahci_stop_engine(ai, p)) != 0) 1109 1109 { 1110 dprintf(0, "error: failed to stop port HW engine (%d)\n", rc);1110 dprintf(0,__func__": failed to stop port HW engine (%d)\n", rc); 1111 1111 return(rc); 1112 1112 } … … 1236 1236 } 1237 1237 1238 DPRINTF(7,"---------- ahci_exec_iorb: iorb=%x\n", vIorb);1238 DPRINTF(7,"---------- "__func__": iorb=%x\n", vIorb); 1239 1239 1240 1240 /* Enable AHCI mode; apparently, the AHCI mode may end up becoming … … 1262 1262 cmd_max = ai->cmd_max; 1263 1263 } 1264 DPRINTF(8, "NCQ command; cmd_max = %d->%d\n", ai->cmd_max, cmd_max);1264 DPRINTF(8,__func__": NCQ command; cmd_max = %d->%d\n", ai->cmd_max, cmd_max); 1265 1265 } 1266 1266 … … 1315 1315 aws->cmd_slot = port->cmd_slot; 1316 1316 1317 DPRINTF(7, "Issuing command Slot=%d cmds=%x\n", port->cmd_slot, *cmds);1317 DPRINTF(7,__func__": Issuing command Slot=%d cmds=%x\n", port->cmd_slot, *cmds); 1318 1318 if (aws->is_ncq) 1319 1319 { … … 1408 1408 { 1409 1409 /* successfully prepared cmd; issue cmd and wait for completion */ 1410 DPRINTF(3,"---------- executing polled cmd on slot 0...");1410 DPRINTF(3,"---------- "__func__" executing polled cmd on slot 0..."); 1411 1411 writel(port_mmio + PORT_CMD_ISSUE, 1); 1412 1412 TimerInit(&Timer, timeout); … … 1479 1479 if (readl(port_mmio + PORT_CMD_ISSUE) & 1) 1480 1480 { 1481 DPRINTF(3, "port %d slot 0 is not idle; not executing polled cmd\n", p);1481 DPRINTF(3,__func__": port %d slot 0 is not idle; not executing polled cmd\n", p); 1482 1482 return(-1); 1483 1483 } … … 1488 1488 1489 1489 /* start command execution for slot 0 */ 1490 DPRINTF(3,"---------- executing polled cmd...");1490 DPRINTF(3,"---------- "__func__" executing polled cmd..."); 1491 1491 writel(port_mmio + PORT_CMD_ISSUE, 1); 1492 1492 … … 1540 1540 if (!ai->ports[p].devs[d].atapi) 1541 1541 { 1542 DPRINTF(2, "flushing cache on %d.%d.%d\n", ad_no(ai), p, d);1542 DPRINTF(2,__func__": flushing cache on %d.%d.%d\n", ad_no(ai), p, d); 1543 1543 return(ahci_exec_polled_cmd(ai, p, d, 30000, 1544 1544 ai->ports[p].devs[d].lba48 ? ATA_CMD_FLUSH_EXT : ATA_CMD_FLUSH, AP_END)); … … 1557 1557 int ahci_set_dev_idle(AD_INFO *ai, int p, int d, int idle) 1558 1558 { 1559 DPRINTF(3, "sending IDLE=%d command to port %d\n", idle, p);1559 DPRINTF(3,__func__": sending IDLE=%d command to port %d\n", idle, p); 1560 1560 return ahci_exec_polled_cmd(ai, p, d, 500, ATA_CMD_IDLE, AP_COUNT, idle ? 1 : 0, AP_END); 1561 1561 } … … 1615 1615 if ((u32)&irq_stat < 0xf000) 1616 1616 { 1617 DPRINTF(0, "IRQ stack running low; arming engine context hook\n");1617 DPRINTF(0,__func__": IRQ stack running low; arming engine context hook\n"); 1618 1618 /* Rousseau: 1619 1619 * A context hook cannot be re-armed before it has completed. -
trunk/src/os2ahci/ctxhook.c
r196 r201 342 342 rearm_ctx_hook = 0; 343 343 344 DPRINTF(8,"reset_ctxhook() started\n"); 344 //DPRINTF(8,"reset_ctxhook() started\n"); 345 dprintf(0, __func__": BEG\n"); 345 346 memset(&done_queue, 0x00, sizeof(done_queue)); 346 347 … … 473 474 if (rearm_ctx_hook) 474 475 { 475 msleep(250); 476 KernArmHook(reset_ctxhook_h, 0, 0); 477 } 478 476 /* we cannot rearm ourself because we will execute immediately leaving 477 * no time to process and clear the reason we need to rearm. Therefore 478 * we set the timer again. 479 */ 480 //msleep(250); 481 //KernArmHook(reset_ctxhook_h, 0, 0); 482 Timer_StartTimerMS(&th_reset_watchdog, 250, reset_watchdog, 0); 483 } 484 485 dprintf(0,__func__": END\n"); 479 486 KernThunkStackTo16(); 480 487 } -
trunk/src/os2ahci/os2ahci.c
r198 r201 1603 1603 /* reset watchdog timer */ 1604 1604 Timer_CancelTimer(timer_handle); 1605 th_reset_watchdog = 0; 1605 1606 dprintf(0,"reset watchdog invoked\n"); 1606 1607 1608 /* You cannot call the reset_ctxhook directly because it does things 1609 * that are illegal in an interrupt handler. 1610 */ 1611 1612 KernArmHook(reset_ctxhook_h, 0, 0); 1613 1607 1614 /* call context hook manually */ 1608 reset_ctxhook(0);1615 //reset_ctxhook(0); 1609 1616 } 1610 1617
Note:
See TracChangeset
for help on using the changeset viewer.