summaryrefslogtreecommitdiffstats
path: root/sys/dev/ahci
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2009-09-06 21:22:24 +0000
committermav <mav@FreeBSD.org>2009-09-06 21:22:24 +0000
commit210c3c474bef0404c0f553abd0bd3250013c3b4f (patch)
tree27b34aa1ef06c91033dc3dee2403ebac93513ba7 /sys/dev/ahci
parent9980b82769e3b0d18720b4381b8426d51337878b (diff)
downloadFreeBSD-src-210c3c474bef0404c0f553abd0bd3250013c3b4f.zip
FreeBSD-src-210c3c474bef0404c0f553abd0bd3250013c3b4f.tar.gz
To save small bit of CPU time, hide part of SNTF register read latency
behind other reads.
Diffstat (limited to 'sys/dev/ahci')
-rw-r--r--sys/dev/ahci/ahci.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c
index 2d8be43..273c276 100644
--- a/sys/dev/ahci/ahci.c
+++ b/sys/dev/ahci/ahci.c
@@ -891,16 +891,12 @@ ahci_phy_check_events(device_t dev)
}
static void
-ahci_notify_events(device_t dev)
+ahci_notify_events(device_t dev, u_int32_t status)
{
struct ahci_channel *ch = device_get_softc(dev);
struct cam_path *dpath;
- u_int32_t status;
int i;
- status = ATA_INL(ch->r_mem, AHCI_P_SNTF);
- if (status == 0)
- return;
ATA_OUTL(ch->r_mem, AHCI_P_SNTF, status);
if (bootverbose)
device_printf(dev, "SNTF 0x%04x\n", status);
@@ -948,7 +944,7 @@ ahci_ch_intr(void *data)
{
device_t dev = (device_t)data;
struct ahci_channel *ch = device_get_softc(dev);
- uint32_t istatus, cstatus, sstatus, ok, err;
+ uint32_t istatus, sstatus, cstatus, sntf = 0, ok, err;
enum ahci_err_type et;
int i, ccs, ncq_err = 0;
@@ -958,8 +954,10 @@ ahci_ch_intr(void *data)
return;
ATA_OUTL(ch->r_mem, AHCI_P_IS, istatus);
/* Read command statuses. */
- cstatus = ATA_INL(ch->r_mem, AHCI_P_CI);
sstatus = ATA_INL(ch->r_mem, AHCI_P_SACT);
+ cstatus = ATA_INL(ch->r_mem, AHCI_P_CI);
+ if ((istatus & AHCI_P_IX_SDB) && (ch->caps & AHCI_CAP_SSNTF))
+ sntf = ATA_INL(ch->r_mem, AHCI_P_SNTF);
/* Process PHY events */
if (istatus & (AHCI_P_IX_PRC | AHCI_P_IX_PC))
ahci_phy_check_events(dev);
@@ -1023,8 +1021,8 @@ ahci_ch_intr(void *data)
ahci_issue_read_log(dev);
}
/* Process NOTIFY events */
- if ((istatus & AHCI_P_IX_SDB) && (ch->caps & AHCI_CAP_SSNTF))
- ahci_notify_events(dev);
+ if (sntf)
+ ahci_notify_events(dev, sntf);
}
/* Must be called with channel locked. */
OpenPOWER on IntegriCloud