Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Oct 2012 08:42:30 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Eitan Adler <eadler@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r241856 - in head/sys: arm/xscale/pxa dev/acpica dev/agp dev/amdsbwd dev/amdtemp dev/asmc dev/coretemp dev/e1000 dev/glxiic dev/ixgbe dev/kbdmux dev/sound/pci i386/acpica i386/bios x86/...
Message-ID:  <201210220842.31106.jhb@freebsd.org>
In-Reply-To: <201210220341.q9M3fEdu023999@svn.freebsd.org>
References:  <201210220341.q9M3fEdu023999@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday, October 21, 2012 11:41:14 pm Eitan Adler wrote:
> Author: eadler
> Date: Mon Oct 22 03:41:14 2012
> New Revision: 241856
> URL: http://svn.freebsd.org/changeset/base/241856
> 
> Log:
>   Now that device disabling is generic, remove extraneous code from the
>   device drivers that used to provide this feature.

This isn't functionally identical.  In some cases a hint to disable
unit 0 would in fact disable all units.  For example, disabling est0 and
acpi_perf0 disabled all instances of estX and acpi_perfX, not just the
first one.  You should test this on a multi-CPU machine before and after
to see the different effects.

The one in the x86 code that handles early mapping of ACPI tables before
new-bus is around is also very important (acpi_find_table()).  You just
broke booting on SMP systems where ACPI is disabled but that contain an
MADT for example (pretty much all modern x86 SMP systems).

elcr is also not a new-bus device, so removing that hint broke that
psuedo-driver as well.

It is only safe to remove these calls in new-bus attach (not probe!)
routines that are using 'device_get_unit()' and not hardcoding the
unit to 0 (unless you know for certain that there can only ever be one
instance of this device such as acpi0 or asmc0).

> Modified:
>   head/sys/arm/xscale/pxa/pxa_smi.c
>   head/sys/dev/acpica/acpi.c
>   head/sys/dev/acpica/acpi_perf.c
>   head/sys/dev/acpica/acpi_throttle.c
>   head/sys/dev/agp/agp_ali.c
>   head/sys/dev/agp/agp_amd.c
>   head/sys/dev/agp/agp_amd64.c
>   head/sys/dev/agp/agp_apple.c
>   head/sys/dev/agp/agp_i810.c
>   head/sys/dev/agp/agp_intel.c
>   head/sys/dev/agp/agp_nvidia.c
>   head/sys/dev/agp/agp_sis.c
>   head/sys/dev/agp/agp_via.c
>   head/sys/dev/amdsbwd/amdsbwd.c
>   head/sys/dev/amdtemp/amdtemp.c
>   head/sys/dev/asmc/asmc.c
>   head/sys/dev/coretemp/coretemp.c
>   head/sys/dev/e1000/if_em.c
>   head/sys/dev/e1000/if_igb.c
>   head/sys/dev/e1000/if_lem.c
>   head/sys/dev/glxiic/glxiic.c
>   head/sys/dev/ixgbe/ixgbe.c
>   head/sys/dev/ixgbe/ixv.c
>   head/sys/dev/kbdmux/kbdmux.c
>   head/sys/dev/sound/pci/emu10kx.c
>   head/sys/i386/acpica/acpi_machdep.c
>   head/sys/i386/bios/apm.c
>   head/sys/x86/cpufreq/est.c
>   head/sys/x86/cpufreq/p4tcc.c
>   head/sys/x86/isa/elcr.c
> 
> Modified: head/sys/dev/acpica/acpi_perf.c
> ==============================================================================
> --- head/sys/dev/acpica/acpi_perf.c	Mon Oct 22 03:37:00 2012	(r241855)
> +++ head/sys/dev/acpica/acpi_perf.c	Mon Oct 22 03:41:14 2012	(r241856)
> @@ -175,9 +175,6 @@ acpi_perf_probe(device_t dev)
>  	ACPI_BUFFER buf;
>  	int error, rid, type;
>  
> -	if (resource_disabled("acpi_perf", 0))
> -		return (ENXIO);
> -
>  	/*
>  	 * Check the performance state registers.  If they are of type
>  	 * "functional fixed hardware", we attach quietly since we will
> 
> Modified: head/sys/dev/acpica/acpi_throttle.c
> ==============================================================================
> --- head/sys/dev/acpica/acpi_throttle.c	Mon Oct 22 03:37:00 2012	(r241855)
> +++ head/sys/dev/acpica/acpi_throttle.c	Mon Oct 22 03:41:14 2012	(r241856)
> @@ -167,9 +167,6 @@ static int
>  acpi_throttle_probe(device_t dev)
>  {
>  
> -	if (resource_disabled("acpi_throttle", 0))
> -		return (ENXIO);
> -
>  	/*
>  	 * On i386 platforms at least, ACPI throttling is accomplished by
>  	 * the chipset modulating the STPCLK# pin based on the duty cycle.
> 
> Modified: head/sys/dev/amdsbwd/amdsbwd.c
> ==============================================================================
> --- head/sys/dev/amdsbwd/amdsbwd.c	Mon Oct 22 03:37:00 2012	(r241855)
> +++ head/sys/dev/amdsbwd/amdsbwd.c	Mon Oct 22 03:41:14 2012	(r241856)
> @@ -267,8 +267,6 @@ amdsbwd_identify(driver_t *driver, devic
>  	device_t		child;
>  	device_t		smb_dev;
>  
> -	if (resource_disabled("amdsbwd", 0))
> -		return;
>  	if (device_find_child(parent, "amdsbwd", -1) != NULL)
>  		return;
>  
> 
> Modified: head/sys/dev/amdtemp/amdtemp.c
> ==============================================================================
> --- head/sys/dev/amdtemp/amdtemp.c	Mon Oct 22 03:37:00 2012	(r241855)
> +++ head/sys/dev/amdtemp/amdtemp.c	Mon Oct 22 03:41:14 2012	(r241856)
> @@ -185,9 +185,6 @@ amdtemp_probe(device_t dev)
>  {
>  	uint32_t family, model;
>  
> -	if (resource_disabled("amdtemp", 0))
> -		return (ENXIO);
> -
>  	family = CPUID_TO_FAMILY(cpu_id);
>  	model = CPUID_TO_MODEL(cpu_id);
>  
> 
> Modified: head/sys/dev/coretemp/coretemp.c
> ==============================================================================
> --- head/sys/dev/coretemp/coretemp.c	Mon Oct 22 03:37:00 2012	(r241855)
> +++ head/sys/dev/coretemp/coretemp.c	Mon Oct 22 03:41:14 2012	(r241856)
> @@ -138,8 +138,6 @@ coretemp_identify(driver_t *driver, devi
>  static int
>  coretemp_probe(device_t dev)
>  {
> -	if (resource_disabled("coretemp", 0))
> -		return (ENXIO);
>  
>  	device_set_desc(dev, "CPU On-Die Thermal Sensors");
>  
> 
> Modified: head/sys/i386/acpica/acpi_machdep.c
> ==============================================================================
> --- head/sys/i386/acpica/acpi_machdep.c	Mon Oct 22 03:37:00 2012	(r241855)
> +++ head/sys/i386/acpica/acpi_machdep.c	Mon Oct 22 03:41:14 2012	(r241856)
> @@ -268,9 +268,6 @@ acpi_find_table(const char *sig)
>  	vm_paddr_t addr;
>  	int i, count;
>  
> -	if (resource_disabled("acpi", 0))
> -		return (0);
> -
>  	/*
>  	 * Map in the RSDP.  Since ACPI uses AcpiOsMapMemory() which in turn
>  	 * calls pmap_mapbios() to find the RSDP, we assume that we can use
> 
> Modified: head/sys/i386/bios/apm.c
> ==============================================================================
> --- head/sys/i386/bios/apm.c	Mon Oct 22 03:37:00 2012	(r241855)
> +++ head/sys/i386/bios/apm.c	Mon Oct 22 03:41:14 2012	(r241856)
> @@ -878,9 +878,6 @@ apm_identify(driver_t *driver, device_t 
>  		return;
>  	}
>  
> -	if (resource_disabled("apm", 0))
> -		return;
> -
>  	child = BUS_ADD_CHILD(parent, 0, "apm", 0);
>  	if (child == NULL)
>  		panic("apm_identify");
> 
> Modified: head/sys/x86/cpufreq/est.c
> ==============================================================================
> --- head/sys/x86/cpufreq/est.c	Mon Oct 22 03:37:00 2012	(r241855)
> +++ head/sys/x86/cpufreq/est.c	Mon Oct 22 03:41:14 2012	(r241856)
> @@ -991,9 +991,6 @@ est_probe(device_t dev)
>  	uint64_t msr;
>  	int error, type;
>  
> -	if (resource_disabled("est", 0))
> -		return (ENXIO);
> -
>  	/*
>  	 * If the ACPI perf driver has attached and is not just offering
>  	 * info, let it manage things.
> 
> Modified: head/sys/x86/cpufreq/p4tcc.c
> ==============================================================================
> --- head/sys/x86/cpufreq/p4tcc.c	Mon Oct 22 03:37:00 2012	(r241855)
> +++ head/sys/x86/cpufreq/p4tcc.c	Mon Oct 22 03:41:14 2012	(r241856)
> @@ -139,10 +139,6 @@ p4tcc_identify(driver_t *driver, device_
>  static int
>  p4tcc_probe(device_t dev)
>  {
> -
> -	if (resource_disabled("p4tcc", 0))
> -		return (ENXIO);
> -
>  	device_set_desc(dev, "CPU Frequency Thermal Control");
>  	return (0);
>  }
> 
> Modified: head/sys/x86/isa/elcr.c
> ==============================================================================
> --- head/sys/x86/isa/elcr.c	Mon Oct 22 03:37:00 2012	(r241855)
> +++ head/sys/x86/isa/elcr.c	Mon Oct 22 03:41:14 2012	(r241856)
> @@ -84,8 +84,6 @@ elcr_probe(void)
>  				printf("  E");
>  		printf("\n");
>  	}
> -	if (resource_disabled("elcr", 0))
> -		return (ENXIO);
>  	elcr_found = 1;
>  	return (0);
>  }
> 

-- 
John Baldwin



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