linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Tresidder <rtresidd@electromag.com.au>
To: David Lechner <david@lechnology.com>,
	linux-pm@vger.kernel.org, Sebastian Reichel <sre@kernel.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Nick Crews <ncrews@chromium.org>,
	andrew.smirnov@gmail.com, Guenter Roeck <groeck@chromium.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 1/1] power/supply/powersupply_sysfs: Add of_node name to uevent message if available
Date: Fri, 26 Jul 2019 17:43:44 +0800	[thread overview]
Message-ID: <54e304f6-d689-acf7-eb63-5dc6e29235ea@electromag.com.au> (raw)
In-Reply-To: <f6082ff8-b9fc-a52d-ad48-fc1b348246f4@electromag.com.au>

As per David's suggestion
I did a quick refactor of the of_device_uevent() call to handle a 
device_node "of_device_node_uevent()" instead of a device and ran into a 
problem.
Was getting stack dumps (via a WARN message) generated out of 
add_uevent_var() for any power supply device.
It was trigered in the first check of
     if (env->envp_idx >= ARRAY_SIZE(env->envp)) {
     ...
of that add_uevent_var function.
So it looks like to many value pairs were being shoved into the event?
envp array is set to a fixed length of 32 via the UEVENT_NUM_ENVP value 
in kobject.h

I verified it had nothing to do with with the refactor by backing it out 
and simply adding a few more
dummy add_uevent_var calls in the power_supply_uevent call..

so there appears to be a hard limit on this.. which we are very near for 
the power supply stuff.

Thoughts?

Thanks
    Richard Tresidder

On 26/07/2019 12:51 pm, Richard Tresidder wrote:
> Hi David
>   That call requires a struct device *
> But the of_node pointer is located in the struct power_supply
> Seems the of_node value in the base device* is null, and often is.
> I find it hard at times to figure out which one of these to reference 
> as things seem to be duplicated in a lot of places..
>
> Should that call potentially be refactored to take a device_node * 
> instead of a device *
>
> **
> Regards
>    Richard Tresidder
>
> On 26/07/2019 10:40 am, Richard Tresidder wrote:
>> Hi David
>>   That it would be. I wasn't aware of that call.
>> I'll give it a crack and send in a new version of the patch.
>>
>> Cheers
>>   Richard Tresidder
>>
>> Richard Tresidder
>> On 25/07/2019 10:08 pm, David Lechner wrote:
>>> On 7/25/19 2:47 AM, Richard Tresidder wrote:
>>>> If the of_node name of the supply is available from the devicetree 
>>>> binding
>>>> then include it under the var POWER_SUPPLY_OF_NODE_NAME.
>>>> This helps where a consistent name is known via the device tree 
>>>> binding
>>>> but it is hard to identify based on the usual enumeration process.
>>>>
>>>
>>> Would it be possible to use of_device_uevent() instead of 
>>> introducing a new
>>> property?
>>>
>>>
>>>
>>
>>
>>
>
>
>


  reply	other threads:[~2019-07-26  9:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25  7:47 [PATCH 1/1] power/supply/powersupply_sysfs: Add of_node name to uevent message if available Richard Tresidder
2019-07-25 14:08 ` David Lechner
2019-07-26  2:40   ` Richard Tresidder
2019-07-26  4:51     ` Richard Tresidder
2019-07-26  9:43       ` Richard Tresidder [this message]
2019-07-26 20:45 ` kbuild test robot
2019-07-29  8:32 ` kbuild test robot

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=54e304f6-d689-acf7-eb63-5dc6e29235ea@electromag.com.au \
    --to=rtresidd@electromag.com.au \
    --cc=andrew.smirnov@gmail.com \
    --cc=david@lechnology.com \
    --cc=enric.balletbo@collabora.com \
    --cc=groeck@chromium.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=ncrews@chromium.org \
    --cc=sre@kernel.org \
    --cc=tglx@linutronix.de \
    /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).