From owner-svn-src-stable@FreeBSD.ORG Fri Jun 8 20:30:38 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0712B106566C; Fri, 8 Jun 2012 20:30:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E68108FC12; Fri, 8 Jun 2012 20:30:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58KUbx1082284; Fri, 8 Jun 2012 20:30:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58KUbpM082282; Fri, 8 Jun 2012 20:30:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206082030.q58KUbpM082282@svn.freebsd.org> From: Alexander Motin Date: Fri, 8 Jun 2012 20:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236765 - stable/9/sys/cam/ata X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 20:30:38 -0000 Author: mav Date: Fri Jun 8 20:30:37 2012 New Revision: 236765 URL: http://svn.freebsd.org/changeset/base/236765 Log: MFC r235982: Add tunable/sysctl kern.cam.pmp.hide_special, controlling whether special PMP ports such as PMP configuration or SEMB should be exposed or hidden. These ports were always hidden before as useless and sometimes promatic. But with updated ses driver supporting SEMB it is no longer so straight. Keep ports hidden by default to avoid probe request ttimeouts if SEP is not connected to PMP's SEMB via I2C, that is very often situation. Modified: stable/9/sys/cam/ata/ata_pmp.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/9/sys/cam/ata/ata_pmp.c Fri Jun 8 19:21:49 2012 (r236764) +++ stable/9/sys/cam/ata/ata_pmp.c Fri Jun 8 20:30:37 2012 (r236765) @@ -126,8 +126,13 @@ static void pmpdone(struct cam_periph * #define PMP_DEFAULT_RETRY 1 #endif +#ifndef PMP_DEFAULT_HIDE_SPECIAL +#define PMP_DEFAULT_HIDE_SPECIAL 1 +#endif + static int pmp_retry_count = PMP_DEFAULT_RETRY; static int pmp_default_timeout = PMP_DEFAULT_TIMEOUT; +static int pmp_hide_special = PMP_DEFAULT_HIDE_SPECIAL; SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); @@ -137,6 +142,9 @@ TUNABLE_INT("kern.cam.pmp.retry_count", SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RW, &pmp_default_timeout, 0, "Normal I/O timeout (in seconds)"); TUNABLE_INT("kern.cam.pmp.default_timeout", &pmp_default_timeout); +SYSCTL_INT(_kern_cam_pmp, OID_AUTO, hide_special, CTLFLAG_RW, + &pmp_hide_special, 0, "Hide extra ports"); +TUNABLE_INT("kern.cam.pmp.hide_special", &pmp_hide_special); static struct periph_driver pmpdriver = { @@ -583,23 +591,33 @@ pmpdone(struct cam_periph *periph, union (ataio->res.lba_mid << 16) + (ataio->res.lba_low << 8) + ataio->res.sector_count; - /* 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 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--; + if (pmp_hide_special) { + /* + * This PMP declares 6 ports, while only 5 of them + * are real. Port 5 is a SEMB port, probing which + * causes timeouts if external SEP is not connected + * to PMP over I2C. + */ + if (softc->pm_pid == 0x37261095 && softc->pm_ports == 6) + softc->pm_ports = 5; + + /* + * This PMP declares 7 ports, while only 5 of them + * are real. Port 5 is a fake "Config Disk" with + * 640 sectors size. Port 6 is a SEMB port. + */ + if (softc->pm_pid == 0x47261095 && softc->pm_ports == 7) + softc->pm_ports = 5; + + /* + * These PMPs have extra configuration port. + */ + if (softc->pm_pid == 0x57231095 || + softc->pm_pid == 0x57331095 || + softc->pm_pid == 0x57341095 || + softc->pm_pid == 0x57441095) + softc->pm_ports--; + } printf("%s%d: %d fan-out ports\n", periph->periph_name, periph->unit_number, softc->pm_ports);