From owner-p4-projects@FreeBSD.ORG Wed Apr 21 19:04:18 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 303211065674; Wed, 21 Apr 2010 19:04:18 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0A0F106567B for ; Wed, 21 Apr 2010 19:04:17 +0000 (UTC) (envelope-from mav@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id BE3178FC0A for ; Wed, 21 Apr 2010 19:04:17 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o3LJ4HhI061635 for ; Wed, 21 Apr 2010 19:04:17 GMT (envelope-from mav@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o3LJ4HV8061633 for perforce@freebsd.org; Wed, 21 Apr 2010 19:04:17 GMT (envelope-from mav@freebsd.org) Date: Wed, 21 Apr 2010 19:04:17 GMT Message-Id: <201004211904.o3LJ4HV8061633@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mav@freebsd.org using -f From: Alexander Motin To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 177184 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2010 19:04:18 -0000 http://p4web.freebsd.org/@@177184?ac=10 Change 177184 by mav@mav_mavtest on 2010/04/21 19:03:52 Do not allow NCQ for Gen-II chips when PMP attached. It works, but extremely slow. Move PI_TAG_ABLE check from ada driver to ATA XPT, as it should be. Affected files ... .. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_da.c#51 edit .. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_xpt.c#84 edit .. //depot/projects/scottl-camlock/src/sys/dev/mvs/mvs.c#7 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_da.c#51 (text+ko) ==== @@ -686,14 +686,10 @@ else softc->quirks = ADA_Q_NONE; - /* Check if the SIM does not want queued commands */ bzero(&cpi, sizeof(cpi)); xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NONE); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); - if (cpi.ccb_h.status != CAM_REQ_CMP || - (cpi.hba_inquiry & PI_TAG_ABLE) == 0) - softc->flags &= ~ADA_FLAG_CAN_NCQ; TASK_INIT(&softc->sysctl_task, 0, adasysctlinit, periph); ==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_xpt.c#84 (text+ko) ==== @@ -766,6 +766,7 @@ } case PROBE_IDENTIFY: { + struct ccb_pathinq cpi; int16_t *ptr; ident_buf = &softc->ident_data; @@ -840,16 +841,24 @@ ata_find_quirk(path->device); if (path->device->mintags != 0 && path->bus->sim->max_tagged_dev_openings != 0) { - /* Report SIM which tags are allowed. */ - bzero(&cts, sizeof(cts)); - xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); - cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; - cts.type = CTS_TYPE_CURRENT_SETTINGS; - cts.xport_specific.sata.tags = path->device->maxtags; - cts.xport_specific.sata.valid = CTS_SATA_VALID_TAGS; - xpt_action((union ccb *)&cts); - /* Reconfigure queues for tagged queueing. */ - xpt_start_tags(path); + /* Check if the SIM does not want queued commands. */ + bzero(&cpi, sizeof(cpi)); + xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); + cpi.ccb_h.func_code = XPT_PATH_INQ; + xpt_action((union ccb *)&cpi); + if (cpi.ccb_h.status == CAM_REQ_CMP && + (cpi.hba_inquiry & PI_TAG_ABLE)) { + /* Report SIM which tags are allowed. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); + cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + cts.xport_specific.sata.tags = path->device->maxtags; + cts.xport_specific.sata.valid = CTS_SATA_VALID_TAGS; + xpt_action((union ccb *)&cts); + /* Reconfigure queues for tagged queueing. */ + xpt_start_tags(path); + } } ata_device_transport(path); PROBE_SET_ACTION(softc, PROBE_SETMODE); ==== //depot/projects/scottl-camlock/src/sys/dev/mvs/mvs.c#7 (text+ko) ==== @@ -566,7 +566,7 @@ /* Construct SIM entry */ ch->sim = cam_sim_alloc(mvsaction, mvspoll, "mvsch", ch, device_get_unit(dev), &ch->mtx, - MVS_MAX_SLOTS - 1, (ch->quirks & MVS_Q_GENI) ? 0 : MVS_MAX_SLOTS - 1, + 2, (ch->quirks & MVS_Q_GENI) ? 0 : MVS_MAX_SLOTS - 1, devq); if (ch->sim == NULL) { device_printf(dev, "unable to allocate sim\n"); @@ -1353,7 +1353,7 @@ } bus_dmamap_sync(ch->dma.workrp_tag, ch->dma.workrp_map, BUS_DMASYNC_PREREAD); - if (cin_idx == in_idx) { + if (cin_idx == ch->in_idx) { ATA_OUTL(ch->r_mem, EDMA_RESQOP, ch->dma.workrp_bus | (cin_idx << EDMA_RESQP_ERPQP_SHIFT)); } @@ -2435,8 +2435,12 @@ cpi->version_num = 1; /* XXX??? */ cpi->hba_inquiry = PI_SDTR_ABLE; - if (!(ch->quirks & MVS_Q_GENI)) - cpi->hba_inquiry |= PI_TAG_ABLE | PI_SATAPM; + if (!(ch->quirks & MVS_Q_GENI)) { + cpi->hba_inquiry |= PI_SATAPM; + /* Gen-II is extremely slow with NCQ on PMP. */ + if ((ch->quirks & MVS_Q_GENIIE) || ch->pm_present == 0) + cpi->hba_inquiry |= PI_TAG_ABLE; + } cpi->target_sprt = 0; cpi->hba_misc = PIM_SEQSCAN; cpi->hba_eng_cnt = 0;