From owner-svn-src-head@freebsd.org Sat Nov 4 06:19:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27D1BE664C2; Sat, 4 Nov 2017 06:19:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01C132D55; Sat, 4 Nov 2017 06:19:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA46JlnD084377; Sat, 4 Nov 2017 06:19:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA46JkBx084373; Sat, 4 Nov 2017 06:19:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201711040619.vA46JkBx084373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 4 Nov 2017 06:19:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325383 - in head/sys/dev: hpt27xx hptnr X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head/sys/dev: hpt27xx hptnr X-SVN-Commit-Revision: 325383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Nov 2017 06:19:48 -0000 Author: delphij Date: Sat Nov 4 06:19:46 2017 New Revision: 325383 URL: https://svnweb.freebsd.org/changeset/base/325383 Log: 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 MFC after: 2 weeks Modified: head/sys/dev/hpt27xx/hpt27xx_config.c head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c head/sys/dev/hptnr/hptnr_config.c head/sys/dev/hptnr/hptnr_osm_bsd.c Modified: head/sys/dev/hpt27xx/hpt27xx_config.c ============================================================================== --- head/sys/dev/hpt27xx/hpt27xx_config.c Sat Nov 4 06:15:20 2017 (r325382) +++ head/sys/dev/hpt27xx/hpt27xx_config.c Sat Nov 4 06:19:46 2017 (r325383) @@ -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: head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c ============================================================================== --- head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Sat Nov 4 06:15:20 2017 (r325382) +++ head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Sat Nov 4 06:19:46 2017 (r325383) @@ -31,7 +31,7 @@ #include #include -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: head/sys/dev/hptnr/hptnr_config.c ============================================================================== --- head/sys/dev/hptnr/hptnr_config.c Sat Nov 4 06:15:20 2017 (r325382) +++ head/sys/dev/hptnr/hptnr_config.c Sat Nov 4 06:19:46 2017 (r325383) @@ -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: head/sys/dev/hptnr/hptnr_osm_bsd.c ============================================================================== --- head/sys/dev/hptnr/hptnr_osm_bsd.c Sat Nov 4 06:15:20 2017 (r325382) +++ head/sys/dev/hptnr/hptnr_osm_bsd.c Sat Nov 4 06:19:46 2017 (r325383) @@ -32,7 +32,7 @@ #include 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;