Linux Power Management development
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre@kernel.org>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] power_supply: sysfs: Bring back write to writeable properties
Date: Wed, 10 Jun 2015 16:46:28 +0200	[thread overview]
Message-ID: <20150610144628.GB11618@earth> (raw)
In-Reply-To: <1433725788-13693-1-git-send-email-k.kozlowski@samsung.com>

[-- Attachment #1: Type: text/plain, Size: 1122 bytes --]

Hi,

On Mon, Jun 08, 2015 at 10:09:48AM +0900, Krzysztof Kozlowski wrote:
> The fix for NULL pointer exception related to calling uevent for not
> finished probe caused to set all writeable properties as non-writeable.
> This was caused by checking if property is writeable before the initial
> increase of power supply usage counter and in the same time using
> wrapper over property_is_writeable(). The wrapper returns ENODEV if the
> usage counter is still 0.
> 
> The call trace looked like:
>   device probe:
>     power_supply_register()
>       use_cnt = 0;
>       device_add()
>         create sysfs entries
>           power_supply_attr_is_visible()
>             power_supply_property_is_writeable()
>               if (use_cnt == 0) return -ENODEV;
>       use_cnt++;
> 
> Replace the usage of wrapper with direct call to property_is_writeable()
> from driver. This should be safe call during device probe because
> implementations of this callback just return 0/1 for different
> properties and they do not access any of the driver's internal data.

Thanks, queued.

-- Sebastian

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2015-06-10 14:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-08  1:09 [PATCH] power_supply: sysfs: Bring back write to writeable properties Krzysztof Kozlowski
2015-06-10 14:46 ` Sebastian Reichel [this message]

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=20150610144628.GB11618@earth \
    --to=sre@kernel.org \
    --cc=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.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