Skip to contentSkip to conversation

acpi, property: Export acpi_dev_prop_read_single call.

PATCH In review David Daney 4 participants 10 messages Aug 4, 2015 – Aug 5, 2015 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi, property: Export acpi_dev_prop_read_single call.

From: Tomasz Nowicki <[email protected]>

Fixes the following build error when building drivers as modules:

ERROR: "acpi_dev_prop_read_single" [drivers/net/phy/mdio-octeon.ko] undefined!
ERROR: "acpi_dev_prop_read_single" [drivers/net/ethernet/cavium/thunder/thunder_bgx.ko] undefined!

---
 drivers/acpi/property.c | 1 +
 1 file changed, 1 insertion(+)
drivers/acpi/property.c +1 -0
index 7836e2e..237e3c5 100644
@@ -432,6 +432,7 @@ int acpi_dev_prop_read_single(struct acpi_device *adev, const char *propname,
 	}
 	return ret;
 }
+EXPORT_SYMBOL_GPL(acpi_dev_prop_read_single);
 
 static int acpi_copy_property_array_u8(const union acpi_object *items, u8 *val,
 				       size_t nval)
Signature · 1 line
1.7.11.7
#1 lore raw
Quoted 6 lines · David Daney

From: Tomasz Nowicki <[email protected]>

Fixes the following build error when building drivers as modules:

ERROR: "acpi_dev_prop_read_single" [drivers/net/phy/mdio-octeon.ko] undefined!
ERROR: "acpi_dev_prop_read_single" [drivers/net/ethernet/cavium/thunder/thunder_bgx.ko] undefined!

Can you please tell me why the drivers in question use that function directly, although they aren't supposed to?

Clearly, their authors had not tried to build them as modules or they would have noticed the problem at the development stage already.

What would be wrong with using the generic device properties API instead?

Quoted 21 lines
---
 drivers/acpi/property.c | 1 +
 1 file changed, 1 insertion(+)
drivers/acpi/property.c +1 -0
index 7836e2e..237e3c5 100644
@@ -432,6 +432,7 @@ int acpi_dev_prop_read_single(struct acpi_device *adev, const char *propname,
 	}
 	return ret;
 }
+EXPORT_SYMBOL_GPL(acpi_dev_prop_read_single);
 
 static int acpi_copy_property_array_u8(const union acpi_object *items, u8 *val,
 				       size_t nval)
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#2 lore raw
Quoted 8 lines · Rafael J. Wysocki
Quoted 6 lines · David Daney

From: Tomasz Nowicki <[email protected]>

Fixes the following build error when building drivers as modules:

ERROR: "acpi_dev_prop_read_single" [drivers/net/phy/mdio-octeon.ko] undefined!
ERROR: "acpi_dev_prop_read_single" [drivers/net/ethernet/cavium/thunder/thunder_bgx.ko] undefined!

Quoted 8 lines

Can you please tell me why the drivers in question use that function directly, although they aren't supposed to?

Clearly, their authors had not tried to build them as modules or they would have noticed the problem at the development stage already.

What would be wrong with using the generic device properties API instead?

Yes, you are right. We should use:
int device_property_read_u64_array(struct device *dev, const char *propname, u64 *val, size_t nval);

Regards,
Tomasz

#3 lore raw
Quoted 14 lines · Tomasz Nowicki
Quoted 13 lines · Rafael J. Wysocki
Quoted 8 lines · David Daney

From: Tomasz Nowicki <[email protected]>

Fixes the following build error when building drivers as modules:

ERROR: "acpi_dev_prop_read_single" [drivers/net/phy/mdio-octeon.ko]
undefined!
ERROR: "acpi_dev_prop_read_single"
[drivers/net/ethernet/cavium/thunder/thunder_bgx.ko] undefined!

Can you please tell me why the drivers in question use that function directly, although they aren't supposed to?

Quoted 9 lines
Quoted 5 lines

Clearly, their authors had not tried to build them as modules or they would have noticed the problem at the development stage already.

What would be wrong with using the generic device properties API instead?

Yes, you are right. We should use:
int device_property_read_u64_array(struct device *dev, const char *propname, u64 *val, size_t nval);

Thanks all, for the review and suggestions. We we try the suggested approach and see how it goes...

Thanks again,
David Daney

#4 lore raw
Quoted 21 lines · David Daney
Quoted 20 lines · Tomasz Nowicki
Quoted 19 lines · Rafael J. Wysocki
Quoted 8 lines · David Daney

From: Tomasz Nowicki <[email protected]>

Fixes the following build error when building drivers as modules:

ERROR: "acpi_dev_prop_read_single" [drivers/net/phy/mdio-octeon.ko]
undefined!
ERROR: "acpi_dev_prop_read_single"
[drivers/net/ethernet/cavium/thunder/thunder_bgx.ko] undefined!

Can you please tell me why the drivers in question use that function directly, although they aren't supposed to?

Clearly, their authors had not tried to build them as modules or they would have noticed the problem at the development stage already.

What would be wrong with using the generic device properties API instead?

Quoted 8 lines
Quoted 4 lines

Yes, you are right. We should use:
int device_property_read_u64_array(struct device *dev, const char *propname, u64 *val, size_t nval);

Thanks all, for the review and suggestions. We we try the suggested approach and see how it goes...

Actually I don't think device_property_read_u64_array() will work.

We are traversing a reference to a different acpi_device via acpi_dev_get_property_reference(), so there is no struct device * available for a call to device_property_read_u64_array(). This looks like a deficiency in the device_property_* framework, so for the time being I guess we will call acpi_dev_get_property(), which is exported, and decode the thing in the driver.

David Daney

#5 lore raw
Quoted 27 lines · David Daney
Quoted 26 lines · David Daney
Quoted 24 lines · Tomasz Nowicki
Quoted 10 lines · Rafael J. Wysocki
Quoted 8 lines · David Daney

From: Tomasz Nowicki <[email protected]>

Fixes the following build error when building drivers as modules:

ERROR: "acpi_dev_prop_read_single" [drivers/net/phy/mdio-octeon.ko]
undefined!
ERROR: "acpi_dev_prop_read_single"
[drivers/net/ethernet/cavium/thunder/thunder_bgx.ko] undefined!

Quoted 9 lines

Can you please tell me why the drivers in question use that function directly, although they aren't supposed to?

Clearly, their authors had not tried to build them as modules or they would have noticed the problem at the development stage already.

What would be wrong with using the generic device properties API instead?

Yes, you are right. We should use:
int device_property_read_u64_array(struct device *dev, const char *propname, u64 *val, size_t nval);

Quoted 8 lines
Quoted 3 lines

Thanks all, for the review and suggestions. We we try the suggested approach and see how it goes...

Actually I don't think device_property_read_u64_array() will work.

We are traversing a reference to a different acpi_device via acpi_dev_get_property_reference(),

Why?

Quoted 5 lines

so there is no struct device *
available for a call to device_property_read_u64_array(). This looks like a deficiency in the device_property_* framework, so for the time being I guess we will call acpi_dev_get_property(), which is exported, and decode the thing in the driver.

Please don't.

I'd like to understand what's missing.

Thanks,
Rafael

#6 lore raw
Quoted 32 lines · Rafael J. Wysocki
Quoted 31 lines · David Daney
Quoted 29 lines · David Daney
Quoted 17 lines · Tomasz Nowicki
Quoted 16 lines · Rafael J. Wysocki
Quoted 8 lines · David Daney

From: Tomasz Nowicki <[email protected]>

Fixes the following build error when building drivers as modules:

ERROR: "acpi_dev_prop_read_single" [drivers/net/phy/mdio-octeon.ko]
undefined!
ERROR: "acpi_dev_prop_read_single"
[drivers/net/ethernet/cavium/thunder/thunder_bgx.ko] undefined!

Can you please tell me why the drivers in question use that function directly, although they aren't supposed to?

Clearly, their authors had not tried to build them as modules or they would have noticed the problem at the development stage already.

Quoted 7 lines
Quoted 3 lines

What would be wrong with using the generic device properties API instead?

Yes, you are right. We should use:
int device_property_read_u64_array(struct device *dev, const char *propname, u64 *val, size_t nval);

Thanks all, for the review and suggestions. We we try the suggested approach and see how it goes...

Quoted 6 lines
Quoted 4 lines

Actually I don't think device_property_read_u64_array() will work.

We are traversing a reference to a different acpi_device via acpi_dev_get_property_reference(),

Why?

Network device has a "phy-handle" (traversed with acpi_dev_get_property_reference()), and we want to get some properties of that phy.

I could turn the question around to you: Why export acpi_dev_get_property_reference()? If there is a reason to export that, then you should let people use the result.

Quoted 14 lines
Quoted 6 lines

so there is no struct device *
available for a call to device_property_read_u64_array(). This looks like a deficiency in the device_property_* framework, so for the time being I guess we will call acpi_dev_get_property(), which is exported, and decode the thing in the driver.

Please don't.

I'd like to understand what's missing.

Thanks,
Rafael

#7 lore raw
Quoted 40 lines · David Daney
Quoted 32 lines · Rafael J. Wysocki
Quoted 31 lines · David Daney
Quoted 29 lines · David Daney
Quoted 17 lines · Tomasz Nowicki
Quoted 16 lines · Rafael J. Wysocki
Quoted 8 lines · David Daney

From: Tomasz Nowicki <[email protected]>

Fixes the following build error when building drivers as modules:

ERROR: "acpi_dev_prop_read_single" [drivers/net/phy/mdio-octeon.ko]
undefined!
ERROR: "acpi_dev_prop_read_single"
[drivers/net/ethernet/cavium/thunder/thunder_bgx.ko] undefined!

Can you please tell me why the drivers in question use that function directly, although they aren't supposed to?

Clearly, their authors had not tried to build them as modules or they would have noticed the problem at the development stage already.

Quoted 7 lines
Quoted 3 lines

What would be wrong with using the generic device properties API instead?

Yes, you are right. We should use:
int device_property_read_u64_array(struct device *dev, const char *propname, u64 *val, size_t nval);

Thanks all, for the review and suggestions. We we try the suggested approach and see how it goes...

Quoted 6 lines
Quoted 4 lines

Actually I don't think device_property_read_u64_array() will work.

We are traversing a reference to a different acpi_device via acpi_dev_get_property_reference(),

Why?

Quoted 7 lines

Network device has a "phy-handle" (traversed with acpi_dev_get_property_reference()), and we want to get some properties of that phy.

I could turn the question around to you: Why export acpi_dev_get_property_reference()? If there is a reason to export that, then you should let people use the result.

The GPIO core uses it and you *can* use the result (please see my other message).

I wonder how does the ACPI table in question look like. Do you have an acpidump output from that system by any chance?

Thanks,
Rafael

#8 lore raw
Quoted 45 lines · Rafael J. Wysocki
Quoted 44 lines · David Daney
Quoted 32 lines · Rafael J. Wysocki
Quoted 31 lines · David Daney
Quoted 29 lines · David Daney
Quoted 17 lines · Tomasz Nowicki
Quoted 16 lines · Rafael J. Wysocki
Quoted 8 lines · David Daney

From: Tomasz Nowicki <[email protected]>

Fixes the following build error when building drivers as modules:

ERROR: "acpi_dev_prop_read_single" [drivers/net/phy/mdio-octeon.ko]
undefined!
ERROR: "acpi_dev_prop_read_single"
[drivers/net/ethernet/cavium/thunder/thunder_bgx.ko] undefined!

Can you please tell me why the drivers in question use that function directly, although they aren't supposed to?

Clearly, their authors had not tried to build them as modules or they would have noticed the problem at the development stage already.

Quoted 7 lines
Quoted 3 lines

What would be wrong with using the generic device properties API instead?

Yes, you are right. We should use:
int device_property_read_u64_array(struct device *dev, const char *propname, u64 *val, size_t nval);

Thanks all, for the review and suggestions. We we try the suggested approach and see how it goes...

Quoted 6 lines
Quoted 4 lines

Actually I don't think device_property_read_u64_array() will work.

We are traversing a reference to a different acpi_device via acpi_dev_get_property_reference(),

Why?

Network device has a "phy-handle" (traversed with acpi_dev_get_property_reference()), and we want to get some properties of that phy.

Quoted 6 lines
Quoted 3 lines

I could turn the question around to you: Why export acpi_dev_get_property_reference()? If there is a reason to export that, then you should let people use the result.

The GPIO core uses it and you *can* use the result (please see my other message).

It was somewhat of a rhetorical question.

I would actually like to do as you suggest, so I am looking at unwinding the driver code to use the interfaces you suggest.

It is a multi-step process for me though. First I had to make the existing code work. I now have it working, so next I will try to fix it.

Quoted 3 lines

I wonder how does the ACPI table in question look like. Do you have an acpidump output from that system by any chance?

Not handy. I will be producing one soon though.

The good news is that I can change the firmware to make it correct if it has problems.

Thanks for your patience,
David Daney

#9 lore raw
In reply to Rafael J. Wysocki
Quoted 45 lines · Rafael J. Wysocki
Quoted 27 lines · David Daney
Quoted 26 lines · David Daney
Quoted 24 lines · Tomasz Nowicki
Quoted 10 lines · Rafael J. Wysocki
Quoted 8 lines · David Daney

From: Tomasz Nowicki <[email protected]>

Fixes the following build error when building drivers as modules:

ERROR: "acpi_dev_prop_read_single" [drivers/net/phy/mdio-octeon.ko]
undefined!
ERROR: "acpi_dev_prop_read_single"
[drivers/net/ethernet/cavium/thunder/thunder_bgx.ko] undefined!

Quoted 9 lines

Can you please tell me why the drivers in question use that function directly, although they aren't supposed to?

Clearly, their authors had not tried to build them as modules or they would have noticed the problem at the development stage already.

What would be wrong with using the generic device properties API instead?

Yes, you are right. We should use:
int device_property_read_u64_array(struct device *dev, const char *propname, u64 *val, size_t nval);

Quoted 8 lines
Quoted 3 lines

Thanks all, for the review and suggestions. We we try the suggested approach and see how it goes...

Actually I don't think device_property_read_u64_array() will work.

We are traversing a reference to a different acpi_device via acpi_dev_get_property_reference(),

Why?

Quoted 5 lines

so there is no struct device *
available for a call to device_property_read_u64_array(). This looks like a deficiency in the device_property_* framework, so for the time being I guess we will call acpi_dev_get_property(), which is exported, and decode the thing in the driver.

Quoted 3 lines

Please don't.

I'd like to understand what's missing.

Moreover, even if you have no struct device, you still can use fwnode_property_read_u64_array(), can't you?

Thanks,
Rafael