diff options
author | mav <mav@FreeBSD.org> | 2010-01-29 12:47:04 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2010-01-29 12:47:04 +0000 |
commit | d4a8a5b0f9f19cb51454e94c77688666c9c1f5c8 (patch) | |
tree | 2694dea9ed638d13947e0ea04cee0353de5b8269 /sys/dev | |
parent | cf482307807918efe12edbfee94740f0069fc33b (diff) | |
download | FreeBSD-src-d4a8a5b0f9f19cb51454e94c77688666c9c1f5c8.zip FreeBSD-src-d4a8a5b0f9f19cb51454e94c77688666c9c1f5c8.tar.gz |
Reset port on disconnect event, to abort any running requests.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ahci/ahci.c | 14 | ||||
-rw-r--r-- | sys/dev/siis/siis.c | 14 |
2 files changed, 12 insertions, 16 deletions
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c index c54a5b1..8492725 100644 --- a/sys/dev/ahci/ahci.c +++ b/sys/dev/ahci/ahci.c @@ -1167,17 +1167,15 @@ ahci_phy_check_events(device_t dev, u_int32_t serr) u_int32_t status = ATA_INL(ch->r_mem, AHCI_P_SSTS); union ccb *ccb; - if (((status & ATA_SS_DET_MASK) == ATA_SS_DET_PHY_ONLINE) && - ((status & ATA_SS_SPD_MASK) != ATA_SS_SPD_NO_SPEED) && - ((status & ATA_SS_IPM_MASK) == ATA_SS_IPM_ACTIVE)) { - if (bootverbose) + if (bootverbose) { + if (((status & ATA_SS_DET_MASK) == ATA_SS_DET_PHY_ONLINE) && + ((status & ATA_SS_SPD_MASK) != ATA_SS_SPD_NO_SPEED) && + ((status & ATA_SS_IPM_MASK) == ATA_SS_IPM_ACTIVE)) { device_printf(dev, "CONNECT requested\n"); - ahci_reset(dev); - } else { - if (bootverbose) + } else device_printf(dev, "DISCONNECT requested\n"); - ch->devices = 0; } + ahci_reset(dev); if ((ccb = xpt_alloc_ccb_nowait()) == NULL) return; if (xpt_create_path(&ccb->ccb_h.path, NULL, diff --git a/sys/dev/siis/siis.c b/sys/dev/siis/siis.c index 630ee7b..5298c18 100644 --- a/sys/dev/siis/siis.c +++ b/sys/dev/siis/siis.c @@ -741,17 +741,15 @@ siis_phy_check_events(device_t dev) u_int32_t status = ATA_INL(ch->r_mem, SIIS_P_SSTS); union ccb *ccb; - if (((status & ATA_SS_DET_MASK) == ATA_SS_DET_PHY_ONLINE) && - ((status & ATA_SS_SPD_MASK) != ATA_SS_SPD_NO_SPEED) && - ((status & ATA_SS_IPM_MASK) == ATA_SS_IPM_ACTIVE)) { - if (bootverbose) + if (bootverbose) { + if (((status & ATA_SS_DET_MASK) == ATA_SS_DET_PHY_ONLINE) && + ((status & ATA_SS_SPD_MASK) != ATA_SS_SPD_NO_SPEED) && + ((status & ATA_SS_IPM_MASK) == ATA_SS_IPM_ACTIVE)) { device_printf(dev, "CONNECT requested\n"); - siis_reset(dev); - } else { - if (bootverbose) + } else device_printf(dev, "DISCONNECT requested\n"); - ch->devices = 0; } + siis_reset(dev); if ((ccb = xpt_alloc_ccb_nowait()) == NULL) return; if (xpt_create_path(&ccb->ccb_h.path, NULL, |