Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 May 2012 08:30:10 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r235982 - head/sys/cam/ata
Message-ID:  <201205250830.q4P8UAwV090637@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205250830.q4P8UAwV090637>