From owner-p4-projects@FreeBSD.ORG Mon Nov 16 13:51:53 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 164EB1065679; Mon, 16 Nov 2009 13:51:53 +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 B639E1065676 for ; Mon, 16 Nov 2009 13:51:52 +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 A43A28FC1E for ; Mon, 16 Nov 2009 13:51:52 +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 nAGDpqPQ025772 for ; Mon, 16 Nov 2009 13:51:52 GMT (envelope-from mav@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id nAGDpqgw025770 for perforce@freebsd.org; Mon, 16 Nov 2009 13:51:52 GMT (envelope-from mav@freebsd.org) Date: Mon, 16 Nov 2009 13:51:52 GMT Message-Id: <200911161351.nAGDpqgw025770@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 170666 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: Mon, 16 Nov 2009 13:51:53 -0000 http://p4web.freebsd.org/chv.cgi?CH=170666 Change 170666 by mav@mav_mavtest on 2009/11/16 13:51:06 Disable PortMultiplier Async Notifications for time of ports reset. They are useless at that time, but confuse Marvell AHCI. Add quirk for SiI57XX Port Multipliers, to hide extra port. Affected files ... .. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_pmp.c#18 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_pmp.c#18 (text+ko) ==== @@ -63,11 +63,12 @@ typedef enum { PMP_STATE_NORMAL, PMP_STATE_PORTS, - PMP_STATE_CONFIG, + PMP_STATE_PRECONFIG, PMP_STATE_RESET, PMP_STATE_CONNECT, PMP_STATE_CHECK, PMP_STATE_CLEAR, + PMP_STATE_CONFIG, PMP_STATE_SCAN } pmp_state; @@ -436,7 +437,7 @@ pmp_default_timeout * 1000); ata_pm_read_cmd(ataio, 2, 15); break; - case PMP_STATE_CONFIG: + case PMP_STATE_PRECONFIG: cam_fill_ataio(ataio, pmp_retry_count, pmpdone, @@ -445,7 +446,7 @@ /*data_ptr*/NULL, /*dxfer_len*/0, pmp_default_timeout * 1000); - ata_pm_write_cmd(ataio, 0x60, 15, 0xf); + ata_pm_write_cmd(ataio, 0x60, 15, 0x0); break; case PMP_STATE_RESET: cam_fill_ataio(ataio, @@ -495,6 +496,17 @@ pmp_default_timeout * 1000); ata_pm_write_cmd(ataio, 1, softc->pm_step, 0xFFFFFFFF); break; + case PMP_STATE_CONFIG: + cam_fill_ataio(ataio, + pmp_retry_count, + pmpdone, + /*flags*/CAM_DIR_NONE, + 0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + pmp_default_timeout * 1000); + ata_pm_write_cmd(ataio, 0x60, 15, 0xf); + break; default: break; } @@ -554,24 +566,29 @@ (done_ccb->ataio.res.lba_mid << 16) + (done_ccb->ataio.res.lba_low << 8) + done_ccb->ataio.res.sector_count; - /* This PM declares 6 ports, while only 5 of them are real. + /* This PMP declares 6 ports, while only 5 of them are real. * Port 5 is enclosure management bridge port, which has implementation * problems, causing probe faults. Hide it for now. */ if (softc->pm_pid == 0x37261095 && softc->pm_ports == 6) softc->pm_ports = 5; - /* This PM declares 7 ports, while only 5 of them are real. + /* This PMP declares 7 ports, while only 5 of them are real. * Port 5 is some fake "Config Disk" with 640 sectors size, * port 6 is enclosure management bridge port. * Both fake ports has implementation problems, causing * probe faults. Hide them for now. */ if (softc->pm_pid == 0x47261095 && softc->pm_ports == 7) softc->pm_ports = 5; + /* These PMPs declare one more port then actually have, + * for configuration purposes. Hide it for now. */ + if (softc->pm_pid == 0x57231095 || softc->pm_pid == 0x57331095 || + softc->pm_pid == 0x57341095 || softc->pm_pid == 0x57441095) + softc->pm_ports--; printf("PM ports: %d\n", softc->pm_ports); - softc->state = PMP_STATE_CONFIG; + softc->state = PMP_STATE_PRECONFIG; xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; - case PMP_STATE_CONFIG: + case PMP_STATE_PRECONFIG: softc->pm_step = 0; softc->state = PMP_STATE_RESET; softc->reset |= ~softc->found; @@ -658,11 +675,15 @@ return; case PMP_STATE_CLEAR: softc->pm_step++; - if (softc->pm_step < softc->pm_ports) { - xpt_release_ccb(done_ccb); - xpt_schedule(periph, priority); - return; - } else if (softc->found) { + if (softc->pm_step >= softc->pm_ports) { + softc->state = PMP_STATE_CONFIG; + softc->pm_step = 0; + } + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + case PMP_STATE_CONFIG: + if (softc->found) { softc->pm_step = 0; softc->state = PMP_STATE_SCAN; work_ccb = xpt_alloc_ccb_nowait();