Browse Source

Improve the speed of hard disk reading

Machine hard disk and SSD are ok.

Change-Id: I4e55e37747c51b34ff02dacc441d4c30feb0efd0
master
WANG Yulong 6 years ago
committed by zhangbaoqi
parent
commit
447eb2c984
  1. 6
      sys/dev/pci/ahcisata.c

6
sys/dev/pci/ahcisata.c

@ -516,7 +516,7 @@ static int waiting_for_cmd_completed(volatile u8 * offset,
u32 status;
for (i = 0; ((status = readl(offset)) & sign) && i < timeout_msec; i++)
msleep(1);
;
return (i < timeout_msec) ? 0 : -1;
}
@ -742,14 +742,14 @@ static int get_ahci_device_data(u8 port, u8 * fis, int fis_len, u8 * buf,
printf("AHCI SATA error: CI is set when START is zero!\n");
};
writel_with_flush(1, port_mmio + PORT_CMD_ISSUE);
if (waiting_for_cmd_completed(port_mmio + PORT_CMD_ISSUE, 2000, 0x1)) {
if (waiting_for_cmd_completed(port_mmio + PORT_CMD_ISSUE, 2000000, 0x1)) {
printf("%s <line%d>: timeout exit! %d bytes transferred.\n", __func__, __LINE__,
pp->cmd_slot->status);
printf("PxIS: 0x%08x, PxSERR: 0x%08x\n", readl(port_mmio + PORT_IRQ_STAT), readl(port_mmio + PORT_SCR_ERR));
printf("PxTFD: 0x%08x, PxSSTS: 0x%08x\n", readl(port_mmio + PORT_TFDATA), readl(port_mmio + PORT_SCR_STAT));
if (waiting_for_cmd_completed(port_mmio + PORT_CMD_ISSUE, 2000, 0x1)) {
if (waiting_for_cmd_completed(port_mmio + PORT_CMD_ISSUE, 2000000, 0x1)) {
printf("Waiting another 2s is useless.\n");
}else{
printf("Waiting another 2s is usefull.\n");

Loading…
Cancel
Save