<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/power/power_supply_core.c, branch v3.0.89</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>power_supply: Initialize changed_work before calling device_add</title>
<updated>2011-02-22T10:01:42+00:00</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2011-02-21T14:34:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=97774672573ac4355bd12cf84b202555c1131b69'/>
<id>97774672573ac4355bd12cf84b202555c1131b69</id>
<content type='text'>
Calling device_add causes an inital uevent for that device to be generated.
The power_supply uevent function calls the drivers get_property function,
which might causes the driver to update its state, which again might
causes the driver to call power_supply_changed(). Since the power_supplys
changed_work has not been initialized at this point the behavior is
undefined and can result in an OOPS.

This patch fixes the issue by initializing the power_supplys changed_work
prior to adding the power_supplys device to the device tree.

Reported-by: Grazvydas Ignotas &lt;notasas@gmail.com&gt;
Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Tested-by: Grazvydas Ignotas &lt;notasas@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Calling device_add causes an inital uevent for that device to be generated.
The power_supply uevent function calls the drivers get_property function,
which might causes the driver to update its state, which again might
causes the driver to call power_supply_changed(). Since the power_supplys
changed_work has not been initialized at this point the behavior is
undefined and can result in an OOPS.

This patch fixes the issue by initializing the power_supplys changed_work
prior to adding the power_supplys device to the device tree.

Reported-by: Grazvydas Ignotas &lt;notasas@gmail.com&gt;
Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Tested-by: Grazvydas Ignotas &lt;notasas@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power_supply: Don't use flush_scheduled_work()</title>
<updated>2010-12-21T23:39:56+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-12-11T16:51:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bc51e7ff521f28a7f14dc2f25307ad9101d1305a'/>
<id>bc51e7ff521f28a7f14dc2f25307ad9101d1305a</id>
<content type='text'>
flush_scheduled_work() is deprecated and scheduled to be removed.

In battery drivers, the work can be canceled on probe failure and
removal and should be flushed on suspend.  Replace
flush_scheduled_work() usages with direct cancels and flushes.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
flush_scheduled_work() is deprecated and scheduled to be removed.

In battery drivers, the work can be canceled on probe failure and
removal and should be flushed on suspend.  Replace
flush_scheduled_work() usages with direct cancels and flushes.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power_supply: Fix use after free and memory leak</title>
<updated>2010-12-21T23:39:55+00:00</updated>
<author>
<name>Vasiliy Kulikov</name>
<email>segoon@openwall.com</email>
</author>
<published>2010-11-19T18:41:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3a2dbd611b38cf9a026c0099a85701ad183d1949'/>
<id>3a2dbd611b38cf9a026c0099a85701ad183d1949</id>
<content type='text'>
device_unregister() might free its argument.  This leads to freed
memory use in kfree().  Also use put_device() instead of kfree()
as dev may be already used in another layer after call to device_add().

Signed-off-by: Vasiliy Kulikov &lt;segoon@openwall.com&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
device_unregister() might free its argument.  This leads to freed
memory use in kfree().  Also use put_device() instead of kfree()
as dev may be already used in another layer after call to device_add().

Signed-off-by: Vasiliy Kulikov &lt;segoon@openwall.com&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power_supply: Use attribute groups</title>
<updated>2010-05-19T08:14:28+00:00</updated>
<author>
<name>Anton Vorontsov</name>
<email>cbouatmailru@gmail.com</email>
</author>
<published>2010-05-18T19:49:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5f487cd34f4337f9bc27ca19da72a39d1b0a0ab4'/>
<id>5f487cd34f4337f9bc27ca19da72a39d1b0a0ab4</id>
<content type='text'>
This fixes a race between power supply device and initial
attributes creation, plus makes it possible to implement
writable properties.

[Daniel Mack - removed superflous return statement
 and dropped .mode attribute from POWER_SUPPLY_ATTR]

Suggested-by: Greg KH &lt;gregkh@suse.de&gt;
Suggested-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
Tested-by: Daniel Mack &lt;daniel@caiaq.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes a race between power supply device and initial
attributes creation, plus makes it possible to implement
writable properties.

[Daniel Mack - removed superflous return statement
 and dropped .mode attribute from POWER_SUPPLY_ATTR]

Suggested-by: Greg KH &lt;gregkh@suse.de&gt;
Suggested-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
Tested-by: Daniel Mack &lt;daniel@caiaq.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power_supply: get_by_name and set_charged functionality</title>
<updated>2009-07-30T13:49:15+00:00</updated>
<author>
<name>Daniel Mack</name>
<email>daniel@caiaq.de</email>
</author>
<published>2009-07-23T18:35:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e5f5ccb646bc6009572b5c23201b5e81638ff150'/>
<id>e5f5ccb646bc6009572b5c23201b5e81638ff150</id>
<content type='text'>
This adds a function that indicates that a battery is fully charged.
It also includes functions to get a power_supply device from the class
of registered devices by name reference. These can be used to find a
specific battery to call power_supply_set_battery_charged() on.

Some battery drivers might need this information to calibrate
themselves.

Signed-off-by: Daniel Mack &lt;daniel@caiaq.de&gt;
Cc: Ian Molton &lt;spyro@f2s.com&gt;
Cc: Anton Vorontsov &lt;cbou@mail.ru&gt;
Cc: Matt Reimer &lt;mreimer@vpop.net&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds a function that indicates that a battery is fully charged.
It also includes functions to get a power_supply device from the class
of registered devices by name reference. These can be used to find a
specific battery to call power_supply_set_battery_charged() on.

Some battery drivers might need this information to calibrate
themselves.

Signed-off-by: Daniel Mack &lt;daniel@caiaq.de&gt;
Cc: Ian Molton &lt;spyro@f2s.com&gt;
Cc: Anton Vorontsov &lt;cbou@mail.ru&gt;
Cc: Matt Reimer &lt;mreimer@vpop.net&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power_supply: EXPORT_SYMBOL cleanups</title>
<updated>2009-07-30T13:49:00+00:00</updated>
<author>
<name>Daniel Mack</name>
<email>daniel@caiaq.de</email>
</author>
<published>2009-07-30T13:42:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ff3417e7effe57cc002a8882a48bcb8e1a7e7267'/>
<id>ff3417e7effe57cc002a8882a48bcb8e1a7e7267</id>
<content type='text'>
While I'm at it, cleanup the power supply code so that EXPORT_SYMBOL_GPL
appears directly after the symbole declaration. checkpatch.pl wants it
that way.

Signed-off-by: Daniel Mack &lt;daniel@caiaq.de&gt;
Cc: Ian Molton &lt;spyro@f2s.com&gt;
Cc: Matt Reimer &lt;mreimer@vpop.net&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While I'm at it, cleanup the power supply code so that EXPORT_SYMBOL_GPL
appears directly after the symbole declaration. checkpatch.pl wants it
that way.

Signed-off-by: Daniel Mack &lt;daniel@caiaq.de&gt;
Cc: Ian Molton &lt;spyro@f2s.com&gt;
Cc: Matt Reimer &lt;mreimer@vpop.net&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6</title>
<updated>2008-10-18T16:28:24+00:00</updated>
<author>
<name>Anton Vorontsov</name>
<email>cbouatmailru@gmail.com</email>
</author>
<published>2008-10-18T16:28:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ed8c3174dd227031d1f3b9fa4fbb512f8f623434'/>
<id>ed8c3174dd227031d1f3b9fa4fbb512f8f623434</id>
<content type='text'>
Conflicts:

	drivers/power/Makefile
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Conflicts:

	drivers/power/Makefile
</pre>
</div>
</content>
</entry>
<entry>
<title>device create: misc: convert device_create_drvdata to device_create</title>
<updated>2008-10-16T16:24:43+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@suse.de</email>
</author>
<published>2008-07-22T03:03:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a9b12619f7b6f19c871437ec24a088787a04b1de'/>
<id>a9b12619f7b6f19c871437ec24a088787a04b1de</id>
<content type='text'>
Now that device_create() has been audited, rename things back to the
original call to be sane.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that device_create() has been audited, rename things back to the
original call to be sane.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>power_supply: Add function to return system-wide power state</title>
<updated>2008-08-31T22:42:54+00:00</updated>
<author>
<name>Matthew Garrett</name>
<email>mjg59@srcf.ucam.org</email>
</author>
<published>2008-08-26T20:09:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=942ed161944b3476639916cf544e6975b29c985a'/>
<id>942ed161944b3476639916cf544e6975b29c985a</id>
<content type='text'>
Certain drivers benefit from knowing whether the system is on ac or
battery, for instance when determining which backlight registers to
read. This adds a simple call to determine whether there's an online
power supply other than any batteries.

Signed-off-by: Matthew Garrett &lt;mjg@redhat.com&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Certain drivers benefit from knowing whether the system is on ac or
battery, for instance when determining which backlight registers to
read. This adds a simple call to determine whether there's an online
power supply other than any batteries.

Signed-off-by: Matthew Garrett &lt;mjg@redhat.com&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Driver Core: add ability for class_for_each_device to start in middle of list</title>
<updated>2008-07-22T04:54:47+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@suse.de</email>
</author>
<published>2008-05-22T21:21:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=93562b537659fc0f63920fd4d9d24f54e434f4c4'/>
<id>93562b537659fc0f63920fd4d9d24f54e434f4c4</id>
<content type='text'>
This mirrors the functionality that driver_for_each_device has as well.

We add a start variable, and all callers of the function are fixed up at
the same time.

The block layer will be using this new functionality in a follow-on
patch.


Cc: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This mirrors the functionality that driver_for_each_device has as well.

We add a start variable, and all callers of the function are fixed up at
the same time.

The block layer will be using this new functionality in a follow-on
patch.


Cc: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
</feed>
