From owner-svn-src-all@FreeBSD.ORG Fri May 25 08:30:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6262B1065676; Fri, 25 May 2012 08:30:10 +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 4DABA8FC1A; Fri, 25 May 2012 08:30:10 +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 q4P8UA9V090639; Fri, 25 May 2012 08:30:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P8UAwV090637; Fri, 25 May 2012 08:30:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205250830.q4P8UAwV090637@svn.freebsd.org> From: Alexander Motin Date: Fri, 25 May 2012 08:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235982 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 08:30:10 -0000 Author: mav Date: Fri May 25 08:30:09 2012 New Revision: 235982 URL: http://svn.freebsd.org/changeset/base/235982 Log: 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: head/sys/cam/ata/ata_pmp.c Modified: head/sys/cam/ata/ata_pmp.c ============================================================================== --- head/sys/cam/ata/ata_pmp.c Fri May 25 08:17:59 2012 (r235981) +++ head/sys/cam/ata/ata_pmp.c Fri May 25 08:30:09 2012 (r235982) @@ -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; static 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);