提交 721449bf 编写于 作者: R Robert Hancock 提交者: Jeff Garzik

sata_nv: Use notifier for completion checks

The hardware provides us a notifier register that indicates what command
tags have completed. Use this to determine which CPBs to check, rather
than blindly checking all active CPBs. This should provide a minor
performance win, since if the controller has touched some of these
incomplete CPBs, accessing them will likely result in a cache miss.
Signed-off-by: NRobert Hancock <hancockr@shaw.ca>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 ac3d6b86
......@@ -854,22 +854,14 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance)
if (status & (NV_ADMA_STAT_DONE |
NV_ADMA_STAT_CPBERR)) {
/** Check CPBs for completed commands */
if (ata_tag_valid(ap->active_tag)) {
/* Non-NCQ command */
nv_adma_check_cpb(ap, ap->active_tag,
notifier_error & (1 << ap->active_tag));
} else {
u32 check_commands = notifier | notifier_error;
int pos, error = 0;
u32 active = ap->sactive;
while ((pos = ffs(active)) && !error) {
/** Check CPBs for completed commands */
while ((pos = ffs(check_commands)) && !error) {
pos--;
error = nv_adma_check_cpb(ap, pos,
notifier_error & (1 << pos) );
active &= ~(1 << pos );
}
check_commands &= ~(1 << pos );
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册