AdeRegt/SanderOSUSB

ATA stop_cmd freezes.

iDalink opened this issue · 2 comments

Thanks to your project. I learned AHCI skills from SanderOSUSB. I test reading sector in VBox. But it will freeze at stop cmd.

void stop_cmd(HBA_PORT *port)
{
	// Clear ST (bit0)
	port->cmd &= ~HBA_PxCMD_ST;
        printf("stop_cmd\n"); 
	// Wait until FR (bit14), CR (bit15) are cleared
	while(1)
	{
		if (port->cmd & HBA_PxCMD_FR)
			continue;
		if (port->cmd & HBA_PxCMD_CR)
			continue;
		break;
	}
	printf("stop_cmd over\n");
    while(1);
	
 
	// Clear FRE (bit4)
	port->cmd &= ~HBA_PxCMD_FRE;
}

outputed log:

        printf("stop_cmd\n"); 

Thank you very much for your feedback. I will try to solve the problem. I am happy you find the code clear.

Thank you for the report. if it is allright, this issue is fixed now.