svn commit: r326006 - in stable/10/sys/dev: hpt27xx hptnr

Xin LI delphij at FreeBSD.org
Mon Nov 20 06:49:07 UTC 2017


Author: delphij
Date: Mon Nov 20 06:49:05 2017
New Revision: 326006
URL: https://svnweb.freebsd.org/changeset/base/326006

Log:
  MFC r325383:
  
  Avoid calling get_controller_count() until attaching, this would avoid
  costly PCI config space operations that slows down systems without the
  hardware.
  
  Many thanks to HighPoint for continued support of FreeBSD!
  
  Submitted by:	Steve Chang
  Reported by:	cperciva

Modified:
  stable/10/sys/dev/hpt27xx/hpt27xx_config.c
  stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
  stable/10/sys/dev/hptnr/hptnr_config.c
  stable/10/sys/dev/hptnr/hptnr_osm_bsd.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/hpt27xx/hpt27xx_config.c
==============================================================================
--- stable/10/sys/dev/hpt27xx/hpt27xx_config.c	Mon Nov 20 06:48:10 2017	(r326005)
+++ stable/10/sys/dev/hpt27xx/hpt27xx_config.c	Mon Nov 20 06:49:05 2017	(r326006)
@@ -60,7 +60,7 @@ int init_config(void)
 
 const char driver_name[] = "hpt27xx";
 const char driver_name_long[] = "RocketRAID 27xx controller driver";
-const char driver_ver[] = "v1.2.7";
+const char driver_ver[] = "v1.2.8";
 int  osm_max_targets = 0xff;
 
 

Modified: stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
==============================================================================
--- stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c	Mon Nov 20 06:48:10 2017	(r326005)
+++ stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c	Mon Nov 20 06:49:05 2017	(r326006)
@@ -31,7 +31,7 @@
 #include <dev/hpt27xx/os_bsd.h>
 #include <dev/hpt27xx/hptintf.h>
 
-static HIM *hpt_match(device_t dev)
+static HIM *hpt_match(device_t dev, int scan)
 {
 	PCI_ID pci_id;
 	HIM *him;
@@ -39,7 +39,7 @@ static HIM *hpt_match(device_t dev)
 
 	for (him = him_list; him; him = him->next) {
 		for (i=0; him->get_supported_device_id(i, &pci_id); i++) {
-			if (him->get_controller_count)
+			if (scan && him->get_controller_count)
 				him->get_controller_count(&pci_id,0,0);
 			if ((pci_get_vendor(dev) == pci_id.vid) &&
 				(pci_get_device(dev) == pci_id.did)){
@@ -54,7 +54,7 @@ static int hpt_probe(device_t dev)
 {
 	HIM *him;
 
-	him = hpt_match(dev);
+	him = hpt_match(dev, 0);
 	if (him != NULL) {
 		KdPrint(("hpt_probe: adapter at PCI %d:%d:%d, IRQ %d",
 			pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev), pci_get_irq(dev)
@@ -77,7 +77,7 @@ static int hpt_attach(device_t dev)
 	
 	KdPrint(("hpt_attach(%d/%d/%d)", pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev)));
 
-	him = hpt_match(dev);
+	him = hpt_match(dev, 1);
 	hba->ext_type = EXT_TYPE_HBA;
 	hba->ldm_adapter.him = him;
 	pci_enable_busmaster(dev);

Modified: stable/10/sys/dev/hptnr/hptnr_config.c
==============================================================================
--- stable/10/sys/dev/hptnr/hptnr_config.c	Mon Nov 20 06:48:10 2017	(r326005)
+++ stable/10/sys/dev/hptnr/hptnr_config.c	Mon Nov 20 06:49:05 2017	(r326006)
@@ -46,7 +46,7 @@ int init_config(void)
 
 const char driver_name[] = "hptnr";
 const char driver_name_long[] = "R750/DC7280 controller driver";
-const char driver_ver[] = "v1.1.4";
+const char driver_ver[] = "v1.1.5";
 int  osm_max_targets = 0xff;
 
 

Modified: stable/10/sys/dev/hptnr/hptnr_osm_bsd.c
==============================================================================
--- stable/10/sys/dev/hptnr/hptnr_osm_bsd.c	Mon Nov 20 06:48:10 2017	(r326005)
+++ stable/10/sys/dev/hptnr/hptnr_osm_bsd.c	Mon Nov 20 06:49:05 2017	(r326006)
@@ -32,7 +32,7 @@
 #include <dev/hptnr/hptintf.h>
 int msi = 0;
 int debug_flag = 0;
-static HIM *hpt_match(device_t dev)
+static HIM *hpt_match(device_t dev, int scan)
 {
 	PCI_ID pci_id;
 	HIM *him;
@@ -40,7 +40,7 @@ static HIM *hpt_match(device_t dev)
 
 	for (him = him_list; him; him = him->next) {
 		for (i=0; him->get_supported_device_id(i, &pci_id); i++) {
-			if (him->get_controller_count)
+			if (scan && him->get_controller_count)
 				him->get_controller_count(&pci_id,0,0);
 			if ((pci_get_vendor(dev) == pci_id.vid) &&
 				(pci_get_device(dev) == pci_id.did)){
@@ -56,7 +56,7 @@ static int hpt_probe(device_t dev)
 {
 	HIM *him;
 
-	him = hpt_match(dev);
+	him = hpt_match(dev, 0);
 	if (him != NULL) {
 		KdPrint(("hpt_probe: adapter at PCI %d:%d:%d, IRQ %d",
 			pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev), pci_get_irq(dev)
@@ -79,7 +79,7 @@ static int hpt_attach(device_t dev)
 	
 	KdPrint(("hpt_attach(%d/%d/%d)", pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev)));
 
-	him = hpt_match(dev);
+	him = hpt_match(dev, 1);
 	hba->ext_type = EXT_TYPE_HBA;
 	hba->ldm_adapter.him = him;
 


More information about the svn-src-all mailing list