[PATCH] ppc64: Thermal control for SMU based machiens

Christoph Hellwig hch at lst.de
Mon Nov 7 15:49:23 EST 2005


On Mon, Nov 07, 2005 at 02:30:28PM +1100, Benjamin Herrenschmidt wrote:
> This adds a new thermal control framework for PowerMac, along with the
> implementation for PowerMac8,1, PowerMac8,2 (iMac G5 rev 1 and 2), and
> PowerMac9,1 (latest single CPU desktop). In the future, I expect to move
> the older G5 thermal control to the new framework as well.

the core code doesn't seem to be mac-specific, could you please move
it to common code?  Especially the userland callout should be shared
with existing drivers on sparc64 and ia64.  I don't request you to move
those over yet, I'll work with the maintainer to get there later.

What about creating drivers/windfarm/ and move all the files there?

> +struct wf_sensor_ops {
> +	int			(*get_value)(struct wf_sensor *sr, s32 *val);
> +	void			(*release)(struct wf_sensor *sr);
> +        struct module           *owner;

tabs instead of spaces here :)

> +#include <linux/config.h>

not needed anymore, latest mainline includes the CONFIG_ symbols
automatically.

> +#include <linux/smp_lock.h>

not needed.


> +int wf_register_client(struct notifier_block *nb)
> +{
> +	int rc;
> +	struct wf_control *ct;
> +	struct wf_sensor *sr;
> +
> +	down(&wf_lock);
> +	rc = notifier_chain_register(&wf_client_list, nb);
> +	if (rc != 0)
> +		goto bail;
> +	wf_client_count++;
> +	list_for_each_entry(ct, &wf_controls, link)
> +		wf_notify(WF_EVENT_NEW_CONTROL, ct);
> +	list_for_each_entry(sr, &wf_sensors, link)
> +		wf_notify(WF_EVENT_NEW_SENSOR, sr);
> +	if (wf_client_count == 1)
> +		wf_start_thread();
> + bail:
> +	up(&wf_lock);
> +	return rc;
> +}

shouldn't clients get proper methods instead of the notifier_block mess?

> Index: linux-work/drivers/macintosh/windfarm_smu_controls.c
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ linux-work/drivers/macintosh/windfarm_smu_controls.c	2005-11-07 13:30:46.000000000 +1100
> @@ -0,0 +1,274 @@

no copyright notices?



More information about the Linuxppc64-dev mailing list