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: Robert Hancock <hancockr@shaw.ca>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
Robert Hancock 2007-02-19 19:03:08 -06:00 коммит произвёл Jeff Garzik
Родитель ac3d6b869f
Коммит 721449bf0d
1 изменённых файлов: 7 добавлений и 15 удалений

Просмотреть файл

@ -854,22 +854,14 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance)
if (status & (NV_ADMA_STAT_DONE | if (status & (NV_ADMA_STAT_DONE |
NV_ADMA_STAT_CPBERR)) { NV_ADMA_STAT_CPBERR)) {
u32 check_commands = notifier | notifier_error;
int pos, error = 0;
/** Check CPBs for completed commands */ /** Check CPBs for completed commands */
while ((pos = ffs(check_commands)) && !error) {
if (ata_tag_valid(ap->active_tag)) { pos--;
/* Non-NCQ command */ error = nv_adma_check_cpb(ap, pos,
nv_adma_check_cpb(ap, ap->active_tag, notifier_error & (1 << pos) );
notifier_error & (1 << ap->active_tag)); check_commands &= ~(1 << pos );
} else {
int pos, error = 0;
u32 active = ap->sactive;
while ((pos = ffs(active)) && !error) {
pos--;
error = nv_adma_check_cpb(ap, pos,
notifier_error & (1 << pos) );
active &= ~(1 << pos );
}
} }
} }
} }