From: Matthew Dillon Date: Fri, 20 Jan 2012 19:23:54 +0000 (-0800) Subject: kernel - Fix AHCI callout timer race (2) X-Git-Tag: v3.0.0~13 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/8dc94ed93ffbc226e763c57586630a988aa57331 kernel - Fix AHCI callout timer race (2) * Fix minor bug in last commit. If the serial number does not match after the timeout is stopped we don't want to mess with the xa at all. --- diff --git a/sys/dev/disk/ahci/ahci.c b/sys/dev/disk/ahci/ahci.c index 677f776418..1716fadbc1 100644 --- a/sys/dev/disk/ahci/ahci.c +++ b/sys/dev/disk/ahci/ahci.c @@ -3573,12 +3573,12 @@ ahci_ata_cmd_done(struct ahci_ccb *ccb) if (xa->flags & ATA_F_TIMEOUT_RUNNING) { serial = ccb->ccb_xa.serial; callout_stop_sync(&ccb->ccb_timeout); - xa->flags &= ~ATA_F_TIMEOUT_RUNNING; if (serial != ccb->ccb_xa.serial) { kprintf("%s: Warning: timeout race ccb %p\n", PORTNAME(ccb->ccb_port), ccb); return; } + xa->flags &= ~ATA_F_TIMEOUT_RUNNING; } xa->flags &= ~(ATA_F_TIMEOUT_DESIRED | ATA_F_TIMEOUT_EXPIRED); ccb->ccb_port->ap_expired &= ~(1 << ccb->ccb_slot);