Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Aug 2014 21:11:20 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r270733 - in stable/9: share/man/man4 sys/dev/mfi
Message-ID:  <201408272111.s7RLBKXj089538@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Wed Aug 27 21:11:19 2014
New Revision: 270733
URL: http://svnweb.freebsd.org/changeset/base/270733

Log:
  MFC r261491 (by ambrisko):
  Add a tunable "hw.mfi.mrsas_enable" to allow mfi(4) to drop priority and
  allow mrsas(4) from LSI to attach to newer LSI cards that are support by
  mrsas(4).  If mrsas(4) is not loaded into the system at boot then mfi(4)
  will always attach.  If a modified mrsas(4) is loaded in the system.  That
  modification is return "-30" in it's probe since that is between
  BUS_PROBE_DEFAULT and BUS_PROBE_LOW_PRIORITY.
  
  This option is controller by a new probe flag "MFI_FLAGS_MRSAS" in mfi_ident
  that denotes cards that should work with mrsas(4).  New entries that should
  have this option.
  
  This is the first step to get mrsas(4) checked into FreeBSD and to avoid
  collision with people that use mrsas(4) from LSI.  Since mfi(4) takes
  priority, then mrsas(4) users need to rebuild GENERIC.  Using the
  .disabled="1" method doesn't work since that blocks attaching and the
  probe gave it to mfi(4).
  
  MFC r267451 (by delphij):
  Correct variable for loader tunable variable hw.mfi.mrsas_enable.

Modified:
  stable/9/share/man/man4/mfi.4
  stable/9/sys/dev/mfi/mfi_pci.c
  stable/9/sys/dev/mfi/mfivar.h
Directory Properties:
  stable/9/share/man/man4/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/share/man/man4/mfi.4
==============================================================================
--- stable/9/share/man/man4/mfi.4	Wed Aug 27 21:11:19 2014	(r270732)
+++ stable/9/share/man/man4/mfi.4	Wed Aug 27 21:11:19 2014	(r270733)
@@ -72,6 +72,17 @@ If the sysctl
 .Va dev.mfi.%d.delete_busy_volumes
 is set to 1,
 then the driver will allow mounted volumes to be removed.
+.Pp
+A tunable is provided to adjust the
+.Nm
+driver's behaviour when attaching to a card.  By default the driver will
+attach to all known cards with high probe priority.  If the tunable
+.Va hw.mfi.mrsas_enable
+is set to 1,
+then the driver will reduce its probe priority to allow
+.Cd mrsas
+to attach to the card instead of
+.Nm .
 .Sh HARDWARE
 The
 .Nm

Modified: stable/9/sys/dev/mfi/mfi_pci.c
==============================================================================
--- stable/9/sys/dev/mfi/mfi_pci.c	Wed Aug 27 21:11:19 2014	(r270732)
+++ stable/9/sys/dev/mfi/mfi_pci.c	Wed Aug 27 21:11:19 2014	(r270733)
@@ -112,6 +112,11 @@ TUNABLE_INT("hw.mfi.msi", &mfi_msi);
 SYSCTL_INT(_hw_mfi, OID_AUTO, msi, CTLFLAG_RDTUN, &mfi_msi, 0,
     "Enable use of MSI interrupts");
 
+static int	mfi_mrsas_enable = 0;
+TUNABLE_INT("hw.mfi.mrsas_enable", &mfi_mrsas_enable);
+SYSCTL_INT(_hw_mfi, OID_AUTO, mrsas_enable, CTLFLAG_RDTUN, &mfi_mrsas_enable,
+     0, "Allow mrasas to take newer cards");
+
 struct mfi_ident {
 	uint16_t	vendor;
 	uint16_t	device;
@@ -120,19 +125,19 @@ struct mfi_ident {
 	int		flags;
 	const char	*desc;
 } mfi_identifiers[] = {
-	{0x1000, 0x005b, 0x1028, 0x1f2d, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Dell PERC H810 Adapter"},
-	{0x1000, 0x005b, 0x1028, 0x1f30, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Dell PERC H710 Embedded"},
-	{0x1000, 0x005b, 0x1028, 0x1f31, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Dell PERC H710P Adapter"},
-	{0x1000, 0x005b, 0x1028, 0x1f33, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Dell PERC H710P Mini (blades)"},
-	{0x1000, 0x005b, 0x1028, 0x1f34, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Dell PERC H710P Mini (monolithics)"},
-	{0x1000, 0x005b, 0x1028, 0x1f35, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Dell PERC H710 Adapter"},
-	{0x1000, 0x005b, 0x1028, 0x1f37, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Dell PERC H710 Mini (blades)"},
-	{0x1000, 0x005b, 0x1028, 0x1f38, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Dell PERC H710 Mini (monolithics)"},
-	{0x1000, 0x005b, 0x8086, 0x9265, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Intel (R) RAID Controller RS25DB080"},
-	{0x1000, 0x005b, 0x8086, 0x9285, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Intel (R) RAID Controller RS25NB008"},
-	{0x1000, 0x005b, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "ThunderBolt"},
-	{0x1000, 0x005d, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_INVADER, "Invader"},
-	{0x1000, 0x005f, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_FURY, "Fury"},
+	{0x1000, 0x005b, 0x1028, 0x1f2d, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Dell PERC H810 Adapter"},
+	{0x1000, 0x005b, 0x1028, 0x1f30, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Dell PERC H710 Embedded"},
+	{0x1000, 0x005b, 0x1028, 0x1f31, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Dell PERC H710P Adapter"},
+	{0x1000, 0x005b, 0x1028, 0x1f33, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Dell PERC H710P Mini (blades)"},
+	{0x1000, 0x005b, 0x1028, 0x1f34, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Dell PERC H710P Mini (monolithics)"},
+	{0x1000, 0x005b, 0x1028, 0x1f35, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Dell PERC H710 Adapter"},
+	{0x1000, 0x005b, 0x1028, 0x1f37, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Dell PERC H710 Mini (blades)"},
+	{0x1000, 0x005b, 0x1028, 0x1f38, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Dell PERC H710 Mini (monolithics)"},
+	{0x1000, 0x005b, 0x8086, 0x9265, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Intel (R) RAID Controller RS25DB080"},
+	{0x1000, 0x005b, 0x8086, 0x9285, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Intel (R) RAID Controller RS25NB008"},
+	{0x1000, 0x005b, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "ThunderBolt"},
+	{0x1000, 0x005d, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS| MFI_FLAGS_INVADER, "Invader"},
+	{0x1000, 0x005f, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS| MFI_FLAGS_FURY, "Fury"},
 	{0x1000, 0x0060, 0x1028, 0xffff, MFI_FLAGS_1078,  "Dell PERC 6"},
 	{0x1000, 0x0060, 0xffff, 0xffff, MFI_FLAGS_1078,  "LSI MegaSAS 1078"},
 	{0x1000, 0x0071, 0xffff, 0xffff, MFI_FLAGS_SKINNY, "Drake Skinny"},
@@ -179,7 +184,13 @@ mfi_pci_probe(device_t dev)
 
 	if ((id = mfi_find_ident(dev)) != NULL) {
 		device_set_desc(dev, id->desc);
-		return (BUS_PROBE_DEFAULT);
+
+		/* give priority to mrsas if tunable set */
+		TUNABLE_INT_FETCH("hw.mfi.mrsas_enable", &mfi_mrsas_enable);
+		if ((id->flags & MFI_FLAGS_MRSAS) && mfi_mrsas_enable)
+			return (BUS_PROBE_LOW_PRIORITY);
+		else
+			return (BUS_PROBE_DEFAULT);
 	}
 	return (ENXIO);
 }

Modified: stable/9/sys/dev/mfi/mfivar.h
==============================================================================
--- stable/9/sys/dev/mfi/mfivar.h	Wed Aug 27 21:11:19 2014	(r270732)
+++ stable/9/sys/dev/mfi/mfivar.h	Wed Aug 27 21:11:19 2014	(r270733)
@@ -199,6 +199,7 @@ struct mfi_softc {
 #define MFI_FLAGS_GEN2		(1<<6)
 #define MFI_FLAGS_SKINNY	(1<<7)
 #define MFI_FLAGS_TBOLT		(1<<8)
+#define MFI_FLAGS_MRSAS		(1<<9)
 #define MFI_FLAGS_INVADER	(1<<10)
 #define MFI_FLAGS_FURY		(1<<11)
 	// Start: LSIP200113393



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