diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c index 5acb9a35d0c5..0d37b067874c 100644 --- a/sys/cam/ata/ata_xpt.c +++ b/sys/cam/ata/ata_xpt.c @@ -1212,7 +1212,8 @@ ata_scan_bus(struct cam_periph *periph, union ccb *request_ccb) take_next: /* Take next device. Wrap from 15 (PM) to 0. */ scan_info->counter = (scan_info->counter + 1 ) & 0x0f; - if (scan_info->counter >= scan_info->cpi->max_target+1) { + if (scan_info->counter > scan_info->cpi->max_target - + ((scan_info->cpi->hba_inquiry & PI_SATAPM) ? 1 : 0)) { xpt_free_ccb(work_ccb); xpt_free_ccb((union ccb *)scan_info->cpi); request_ccb = scan_info->request_ccb; diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c index 86c1f167b66c..485ac3d5ce4b 100644 --- a/sys/dev/ahci/ahci.c +++ b/sys/dev/ahci/ahci.c @@ -1967,7 +1967,7 @@ ahciaction(struct cam_sim *sim, union ccb *ccb) cpi->hba_misc = PIM_SEQSCAN; cpi->hba_eng_cnt = 0; if (ch->caps & AHCI_CAP_SPM) - cpi->max_target = 14; + cpi->max_target = 15; else cpi->max_target = 0; cpi->max_lun = 0; diff --git a/sys/dev/siis/siis.c b/sys/dev/siis/siis.c index 3344bc07b47f..207713722d0f 100644 --- a/sys/dev/siis/siis.c +++ b/sys/dev/siis/siis.c @@ -1584,7 +1584,7 @@ siisaction(struct cam_sim *sim, union ccb *ccb) cpi->target_sprt = 0; cpi->hba_misc = PIM_SEQSCAN; cpi->hba_eng_cnt = 0; - cpi->max_target = 14; + cpi->max_target = 15; cpi->max_lun = 0; cpi->initiator_id = 0; cpi->bus_id = cam_sim_bus(sim);