Re: [PATCH 2/8] ACPI: thermal: Replace pointer with name in trip_points

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 04 June 2007 12:30, Thomas Renninger wrote:

> If acpi_bus_get_device(..) fails, device will be NULL.
> I sent another patch checking for that. I couldn't find it, I redid the
> small change and test-booted (machine only has a passive tp, but I could
> see: ...devices=CPU0), seems to work.
> 
> Not sure whether the check is really needed, but I think yes. IIRC I saw
> the warn/err message for this happening ("No context for object..") for
> fan devices in some dmesg.

You'd not get those messages if CONFIG_ACPI_DEBUG=n ;-)

> 
> Thanks,
> 
>    Thomas
> 
> Show devices for active/passive cooling in thermal trip_points file
> 
> Currently the internal pointer to a ACPI handle of a device
> which is used for active/passive cooling at a certain temperature
> is exported to userspace. This pointer isn't of any use for userspace.
> 
> Instead, export the device name, so
> that automated tests (e.g. linuxfirmwarekit) can check whether the
> device (at least fans for active cooling trip points) really get activated
> on the right temperature.
> 
> Signed-off-by: Thomas Renninger <trenn@xxxxxxx>
> 
>  drivers/acpi/thermal.c |   20 ++++++++++++++------
>  1 file changed, 14 insertions(+), 6 deletions(-)
> 
> Index: linux-2.6.22-rc3/drivers/acpi/thermal.c
> ===================================================================
> --- linux-2.6.22-rc3.orig/drivers/acpi/thermal.c
> +++ linux-2.6.22-rc3/drivers/acpi/thermal.c
> @@ -827,6 +827,9 @@ static int acpi_thermal_temp_open_fs(str
>  static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
>  {
>  	struct acpi_thermal *tz = seq->private;
> +	struct acpi_device *device;
> +	acpi_status status;
> +
>  	int i = 0;
>  	int j = 0;
>  
> @@ -849,9 +852,10 @@ static int acpi_thermal_trip_seq_show(st
>  			   tz->trips.passive.tc1, tz->trips.passive.tc2,
>  			   tz->trips.passive.tsp);
>  		for (j = 0; j < tz->trips.passive.devices.count; j++) {
> -
> -			seq_printf(seq, "0x%p ",
> -				   tz->trips.passive.devices.handles[j]);
> +			status = acpi_bus_get_device(tz->trips.passive.devices.
> +						     handles[j], &device);
> +			seq_printf(seq, "%4.4s ", status ? "" :
> +				   acpi_device_bid(device));

seq_printf() with "%4.4s", NULL) will simply print "<NUL",
so this is a potential cosmetic issue only.

-Len

>  		}
>  		seq_puts(seq, "\n");
>  	}
> @@ -862,9 +866,13 @@ static int acpi_thermal_trip_seq_show(st
>  		seq_printf(seq, "active[%d]:               %ld C: devices=",
>  			   i,
>  			   KELVIN_TO_CELSIUS(tz->trips.active[i].temperature));
> -		for (j = 0; j < tz->trips.active[i].devices.count; j++)
> -			seq_printf(seq, "0x%p ",
> -				   tz->trips.active[i].devices.handles[j]);
> +		for (j = 0; j < tz->trips.active[i].devices.count; j++){
> +			status = acpi_bus_get_device(tz->trips.active[i].
> +						     devices.handles[j],
> +						     &device);
> +			seq_printf(seq, "%4.4s ", status ? "" :
> +				   acpi_device_bid(device));
> +		}
>  		seq_puts(seq, "\n");
>  	}
>  
> 
> 
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux