diff mbox

sensor: add a compatible property

Message ID 1443103683-31310-1-git-send-email-clg@fr.ibm.com
State Accepted
Headers show

Commit Message

Cédric Le Goater Sept. 24, 2015, 2:08 p.m. UTC
OPAL needs an extra compatible property "ibm,opal-sensor" to make
module autoload work smoothly in Linux for ibmpowernv driver.

Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
---
 core/sensor.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Stewart Smith Sept. 30, 2015, 11:53 a.m. UTC | #1
Cédric Le Goater <clg@fr.ibm.com> writes:
> OPAL needs an extra compatible property "ibm,opal-sensor" to make
> module autoload work smoothly in Linux for ibmpowernv driver.

in hw/dts.c we add ibm,opal-sensor - why isn't that sufficient?
Cédric Le Goater Sept. 30, 2015, 2:56 p.m. UTC | #2
On 09/30/2015 01:53 PM, Stewart Smith wrote:
> Cédric Le Goater <clg@fr.ibm.com> writes:
>> OPAL needs an extra compatible property "ibm,opal-sensor" to make
>> module autoload work smoothly in Linux for ibmpowernv driver.
> 
> in hw/dts.c we add ibm,opal-sensor - why isn't that sufficient?

Unfortunately not. The kernel routine opal_sensor_init() initializes 
the platform device using the node "/ibm,opal/sensors" under which
an "ibm,opal-sensor" compatible property is expected. So this property
is a must have but you also need to modify the driver for autoload 
to work [1].

In fine, the "ibm,opal-sensor" compatible property under each sensor 
node is not that useful. It is used by the driver to discriminate 
valid sensor nodes. The sensor-type property has the same use but
we need both to keep compatibility between OPAL and kernel.

Ideally, the next step should be to add in opal_init() a couple of
calls to opal_pdev_init() and one specially for sensors :

	opal_pdev_init(opal_node, "ibm,opal-sensor");


In terms of compatibility, this patch does not break current kernels. 
ibmpowernv still loads manually. And the kernel patch [1] below has 
no effect on the loading unless with it used with this OPAL patch, 
in which case, autoload works.

This is clearly not a high priority change. Autoload has been broken
since the beginning. 

Do you want an updated changelog with the above ?

Thanks,

C.


[1] https://github.com/legoater/linux/commit/a691ba1c7877ab96d6660810e383cecdfb4cc347

    Sent to the sensor mailing but it seems that the list archives 
    are broken since beginning of September.
Cédric Le Goater Nov. 9, 2015, 9:23 p.m. UTC | #3
On 09/30/2015 04:56 PM, Cédric Le Goater wrote:
> 
> 
> [1] https://github.com/legoater/linux/commit/a691ba1c7877ab96d6660810e383cecdfb4cc347
> 
>     Sent to the sensor mailing but it seems that the list archives 
>     are broken since beginning of September.

The OF compatibility table entry for ibmpowernv is now merged in 
linux, it would be good to get this patch in skiboot.

Thanks,

C.
Stewart Smith Nov. 12, 2015, 1:16 a.m. UTC | #4
Cédric Le Goater <clg@fr.ibm.com> writes:
> OPAL needs an extra compatible property "ibm,opal-sensor" to make
> module autoload work smoothly in Linux for ibmpowernv driver.
>
> Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>

Thanks, merged!

I took the liberty of saying "this is probably a good tihng for stable"
and merged to stable as of fff572c0bbad746c477d733fbde5280667d931f8.

Also merged as of 881455a1b62f in master.
diff mbox

Patch

Index: skiboot.git/core/sensor.c
===================================================================
--- skiboot.git.orig/core/sensor.c
+++ skiboot.git/core/sensor.c
@@ -39,6 +39,7 @@  void sensor_init(void)
 {
 	sensor_node = dt_new(opal_node, "sensors");
 
+	dt_add_property_string(sensor_node, "compatible", "ibm,opal-sensor");
 	dts_sensor_create_nodes(sensor_node);
 
 	/* Register OPAL interface */