public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] ipmi/of: Don't use unavailable interfaces
@ 2014-08-14  6:39 Benjamin Herrenschmidt
  2014-08-17  0:25 ` Corey Minyard
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2014-08-14  6:39 UTC (permalink / raw)
  To: Rob Herring; +Cc: Grant Likely, linux-kernel@vger.kernel.org

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

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

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.

diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 5d66568..4fc8931 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -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");



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

* Re: [RFC PATCH] ipmi/of: Don't use unavailable interfaces
  2014-08-14  6:39 [RFC PATCH] ipmi/of: Don't use unavailable interfaces Benjamin Herrenschmidt
@ 2014-08-17  0:25 ` Corey Minyard
  0 siblings, 0 replies; 2+ messages in thread
From: Corey Minyard @ 2014-08-17  0:25 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Rob Herring
  Cc: Grant Likely, linux-kernel@vger.kernel.org

On 08/14/2014 01:39 AM, Benjamin Herrenschmidt wrote:
> 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

> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>
> 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.
>
> diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
> index 5d66568..4fc8931 100644
> --- a/drivers/char/ipmi/ipmi_si_intf.c
> +++ b/drivers/char/ipmi/ipmi_si_intf.c
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


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

end of thread, other threads:[~2014-08-17  0:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-14  6:39 [RFC PATCH] ipmi/of: Don't use unavailable interfaces Benjamin Herrenschmidt
2014-08-17  0:25 ` Corey Minyard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox