devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
	Grant Likely
	<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-omap <linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>,
	Tero Kristo <t-kristo-l0cyMroinI0@public.gmane.org>,
	Tom Rini <trini-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH] of: Add generic handling for hardware incomplete fail state
Date: Tue, 12 Apr 2016 15:37:09 -0700	[thread overview]
Message-ID: <570D7895.7000606@gmail.com> (raw)
In-Reply-To: <CAL_Jsq+B67np4qcwJ2m1yz3TOzYgb7ZQtRH+vhANm9Snw5QnzQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 4/12/2016 3:20 PM, Rob Herring wrote:
> On Tue, Apr 12, 2016 at 4:41 PM, Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> On 4/12/2016 1:34 PM, Tony Lindgren wrote:
>>> Hi,
>>>
>>> * Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> [160412 13:15]:
>>>> Hi Tony,
>>>>
>>>> I agree with the need for some way of handling the incomplete
>>>> hardware issue.  I like the idea of having a uniform method for
>>>> all nodes.
>>>>
>>>> I am stumbling over what the status property is supposed to convey
>>>> and what the "fail-hw-incomplete" is meant to convey.
>>>>
>>>> The status property is meant to convey the current state of the
>>>> node.
>>>>
>>>> "fail-hw-incomplete" is meant to describe the node implementation,
>>>> saying that some portions of hardware that the driver expects to
>>>> be present do not exist.  If I understood your explanation at ELC
>>>> correctly, an examples of this could be that a uart cell is not
>>>> routed to transmit and receive data pins or the interrupt line
>>>> from the cell is not routed to an interrupt controller.  So the
>>>> node is not useful, but it makes sense to be able to power manage
>>>> the node, turning off power so that it is not wasting power.
>>>
>>> Yes cases like that are common.
>>>
>>>> It seems to me that the info that needs to be conveyed is a
>>>> description of the hardware, stating:
>>>>   - some portions or features of the node are not present and/or
>>>>     are not usable
>>>>   - power management of the node is possible
>>>>
>>>> Status of "fail-sss" is meant to indicate an error was detected in
>>>> the device, and that the error might (or might not) be repairable.
>>>>
>>>> So the difference I see is state vs hardware description.
> 
> The question to ask is are we indicating the "operational status of a
> device"? If yes, that is the definition of status and using it would
> be appropriate.
> 
> IMO, I think we are.

I see the reasoning.  I could go either way, but I lean toward thinking
of it as hardware description.


>>> OK thanks for the clarification. I don't see why "fail-hw-incomplete"
>>> could not be set dynamically during the probe in some cases based
>>> on the SoC revision detection for example. So from that point of
>>> view using status with the "fail-sss" logic would make more sense.
>>
>> If the probe detects that the device should only be power managed
>> based on the SoC revision, then it would simply be one more
>> test added at the top of probe.  The patch would change from:
>>
>>    if (of_device_is_incomplete(pdev->dev.of_node)) {
>>
>> to:
>>
>>    if (of_device_is_incomplete(pdev->dev.of_node) || socrev == XXX) {
> 
> I think Tony meant the bootloader or platform code would do this and
> tweak the DT. We don't have much of a standard API for revision
> checking, so drivers don't check SoC revisions generally.

OK, that makes more sense to me.


>> That code would be the same whether the property involved was
>> status or something else.
>>
>>>
>>>> I would prefer to come up with a new boolean property (with a
>>>> standard name that any node binding could choose to implement)
>>>> that says something like "only power management is available for
>>>> this node, do not attempt to use any other feature of the node".
>>>
>>> Heh that's going to be a long property name :) How about
>>> unusable-incomplete-idle-only :)
>>
>> Or even pm-only.  Maybe I got a little carried away with my
>> verbosity. :)
> 
> I don't think we should define it so narrowly. I think DT just
> indicates the device is in a non-usable state (somewhere between ok
> and disabled) and the driver knows what to do with that information.

My concern is that "non-usable" state is really vague.  I would
prefer that the message (however it is communicated) tells the
driver either what is usable or what is unusable.


>>>> With that change, the bulk of your patch looks good, with
>>>> minor changes:
>>>>
>>>>   __of_device_is_available() would not need to change.
>>>>
>>>>   __of_device_is_incomplete() would change to check the new
>>>>   boolean property.  (And I would suggest renaming it to
>>>>   something that conveys it is ok to power manage the
>>>>   device, but do not do anything else to the device.)
>>>
>>> I'm fine with property too, but the runtime probe fail state
>>> changes worry me a bit with that one.
>>
>> I don't understand what the concern is.  The change I suggested
>> would use exactly the same code for probe as the example patch
>> you provided, but just with a slight name change for the function.
>>
>>
>>> I think Rob also preferred to use the status though while we
>>> chatted at ELC?
>>
>> That is the impression I got too.  We'll have to see if I can
>> convince him otherwise.
> 
> I did, but I'm not wed to it. I think it depends on the question above.
> 
> Rob
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-04-12 22:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-12 18:37 [PATCH] of: Add generic handling for hardware incomplete fail state Tony Lindgren
2016-04-12 20:13 ` Frank Rowand
2016-04-12 20:34   ` Tony Lindgren
     [not found]     ` <20160412203431.GU5995-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-04-12 21:41       ` Frank Rowand
     [not found]         ` <570D6B7A.3050203-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-04-12 22:02           ` Tony Lindgren
2016-04-12 22:20           ` Rob Herring
2016-04-12 22:27             ` Tony Lindgren
2016-04-13  0:11               ` Tom Rini
     [not found]             ` <CAL_Jsq+B67np4qcwJ2m1yz3TOzYgb7ZQtRH+vhANm9Snw5QnzQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-12 22:37               ` Frank Rowand [this message]
     [not found]   ` <570D56FE.2070408-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-04-12 22:39     ` Frank Rowand
     [not found]       ` <570D7922.5020206-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-04-12 23:18         ` Tony Lindgren
2016-04-12 23:22       ` Tom Rini
2016-04-12 20:24 ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=570D7895.7000606@gmail.com \
    --to=frowand.list-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nm-l0cyMroinI0@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=t-kristo-l0cyMroinI0@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
    --cc=trini-OWPKS81ov/FWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).