Skip to contentSkip to conversation

ipmi/of: Don't use unavailable interfaces

RFC PATCH In review Benjamin Herrenschmidt 2 participants 2 messages Aug 14, 2014 – Aug 17, 2014 IPMI

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 ipmi/of: Don't use unavailable interfaces

If an IPMI controller is used by the firmware and as such marked with a reserved status, we shouldn't use it.

---

Not tested, found by inspection as we are investigating how to plumb IPMI on one of our future platforms. Our FW uses the device-tree for its own internal use and tags stuff that it reserves for itself using the "status" property. This is likely to be the case of our BT interface.

drivers/char/ipmi/ipmi_si_intf.c +3 -0
index 5d66568..4fc8931 100644
@@ -2658,6 +2658,9 @@ static int ipmi_probe(struct platform_device *dev)
 	if (!match)
 		return -EINVAL;
 
+	if (!of_device_is_available(np))
+		return -EINVAL;
+
 	ret = of_address_to_resource(np, 0, &resource);
 	if (ret) {
 		dev_warn(&dev->dev, PFX "invalid address from OF\n");
#1 lore raw
Quoted 2 lines · Benjamin Herrenschmidt

If an IPMI controller is used by the firmware and as such marked with a reserved status, we shouldn't use it.

I've added this to my IPMI tree. I can't comment on it's correctness, others would know better than me, but it seems reasonable.

Thanks,

-corey

Quoted 29 lines

---

Not tested, found by inspection as we are investigating how to plumb IPMI on one of our future platforms. Our FW uses the device-tree for its own internal use and tags stuff that it reserves for itself using the "status" property. This is likely to be the case of our BT interface.

drivers/char/ipmi/ipmi_si_intf.c +3 -1
index 5d66568..4fc8931 100644
@@ -2658,6 +2658,9 @@ static int ipmi_probe(struct platform_device *dev)
 	if (!match)
 		return -EINVAL;
 
+	if (!of_device_is_available(np))
+		return -EINVAL;
+
 	ret = of_address_to_resource(np, 0, &resource);
 	if (ret) {
 		dev_warn(&dev->dev, PFX "invalid address from OF\n");
 
 
--

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/