All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][v2] therm_windtunnel doesn't work properly on PowerMac G4
@ 2014-08-01 14:00 Goffredo Baroncelli
  2014-08-01 14:00 ` [PATCH 1/4] Update drivers names to the ones invoked by i2c-powermac Goffredo Baroncelli
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Goffredo Baroncelli @ 2014-08-01 14:00 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: ", ", "


Hi All,

On a PowerMac G4 I noticed that between the kernel v3.2 and v3.14 I lost
the fan management.

I found on internet other references to this kind of problem [2]


**How reproduce:
- booting with the kernel 3.2, the fan is "quite" silent.
The module therm_windtunnel is loaded and in the log there are  
lines like:

	[ 1342.614956] CPU-temp: 58.7 C, Case: 33.7 C,  Fan: 5 (tuned +0)
	[ 1390.637793] CPU-temp: 58.6 C, Case: 33.6 C,  Fan: 5

I had also access to the temperature via the sysfs files:
/sys/devices/temperature/case_temperature  
/sys/devices/temperature/cpu_temperature


- booting with the kernel 3.14, the fan is very loud. The module 
therm_windtunnel is not loaded. In the log there aren't any message
related to the temperature. The sysfs entries don't exist.


** Analysis 
In these Apple machines the module i2c-powermac requires the
i2c drivers provided by the module therm_windtunnel.

Between the kernel v3.2 and v3.14 [1] some patches changed the 
driver name requested by the i2c-powermac module, 
so the therm_windtunnel modules is not instantiated anymore.


** Proposed solution
In the following emails I sent you 4 patches to solve this 
problem (tested on my PowerMac G4)

1) change the driver name
	therm_ds1775 -> MAC,ds1775
        therm_adm1030 -> MAC,adm1030
so the i2c driver are instantiated by i2c-powermac

2) remove the (unused) method do_attach from the i2c-driver
3) add a parameter to the therm_windtunnel module 
to control the kernel log message 
4) export the fan speed via sysfs

The patch 1) solve the problem. The patch 2) is a small cleanup.
The patch 3) allow a better control of the log in dmesg.
The patch 4) is copyied from the Bryan Christianson's patch (see
debian bug #741663)

Could you be so kindly to apply these patches ?

PS:
I am not LKML subscriber, so please put me in CC in case of reply.

BR
G.Baroncelli

Changelog:
v0: 2014/07/30
	- first issue
v1: 2014/08/01
	- protect with a mutex the check before starting the fan 
	  daemon (to protect from parallel drivers instantation)
	- reduce the number of module parameters to 1 as suggested by 
          Jean Delvare
	- export the fan speed via sysfs

[1] I think that the guilty commit is 
commit 81e5d8646ff6bf323dddcf172aa3cef84468fa12
Author: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date:   Wed Apr 18 22:16:42 2012 +0000

    i2c/powermac: Register i2c devices from device-tree
    
    This causes i2c-powermac to register i2c devices exposed in the
    device-tree, enabling new-style probing of devices.
    
    Note that we prefix the IDs with "MAC," in order to prevent the
    generic drivers from matching. This is done on purpose as we only
    want drivers specifically tested/designed to operate on powermacs
    to match.
    
    This removes the special case we had for the AMS driver, and updates
    the driver's match table instead.
    
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

[2] There is the debian bug #741663 which highlight the same problem. In
the bug discussion there is a patch like the my ones.

See also
https://lists.ozlabs.org/pipermail/linuxppc-dev/2012-July/099561.html






^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2014-08-05  8:59 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-01 14:00 [PATCH][v2] therm_windtunnel doesn't work properly on PowerMac G4 Goffredo Baroncelli
2014-08-01 14:00 ` [PATCH 1/4] Update drivers names to the ones invoked by i2c-powermac Goffredo Baroncelli
2014-08-01 14:00 ` [PATCH 2/4] Remove attach_method because un-used Goffredo Baroncelli
2014-08-01 14:00 ` [PATCH 3/4] Add the "verbose" module option Goffredo Baroncelli
2014-08-03 14:12   ` Jean Delvare
2014-08-03 15:12     ` Goffredo Baroncelli
2014-08-03 15:52       ` Jean Delvare
2014-08-03 16:36         ` Goffredo Baroncelli
2014-08-04  8:46           ` Jean Delvare
2014-08-04 17:10             ` Goffredo Baroncelli
2014-08-05  8:59               ` Jean Delvare
2014-08-01 14:00 ` [PATCH 4/4] Return the fan speed via sysfs Goffredo Baroncelli
2014-08-03 14:17   ` Jean Delvare
2014-08-03 15:27     ` Goffredo Baroncelli
2014-08-03 15:59       ` Jean Delvare
2014-08-03 16:42         ` Goffredo Baroncelli
2014-08-04  8:44           ` Jean Delvare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.