<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/acpi/battery.c, branch linux-3.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.1.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.1.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2011-08-06T02:16:42Z</updated>
<entry>
<title>Merge branch 'battery' into release</title>
<updated>2011-08-06T02:16:42Z</updated>
<author>
<name>Len Brown</name>
</author>
<published>2011-08-06T02:16:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5389102e231d5f06da8b2897336293db18af9d76'/>
<id>urn:sha1:5389102e231d5f06da8b2897336293db18af9d76</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Battery: sysfs_remove_battery(): possible circular locking</title>
<updated>2011-08-06T02:15:18Z</updated>
<author>
<name>Sergey Senozhatsky</name>
</author>
<published>2011-08-05T22:34:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=69d94ec6d83d84044252d9ba03f6a8970816e350'/>
<id>urn:sha1:69d94ec6d83d84044252d9ba03f6a8970816e350</id>
<content type='text'>
Commit 9c921c22a7f33397a6774d7fa076db9b6a0fd669
Author: Lan Tianyu &lt;tianyu.lan@intel.com&gt;

    ACPI / Battery: Resolve the race condition in the sysfs_remove_battery()

fixed BUG https://bugzilla.kernel.org/show_bug.cgi?id=35642 , but as a side
effect made lockdep unhappy with sysfs_remove_battery():

[14818.477168]
[14818.477170] =======================================================
[14818.477200] [ INFO: possible circular locking dependency detected ]
[14818.477221] 3.1.0-dbg-07865-g1280ea8-dirty #668
[14818.477236] -------------------------------------------------------
[14818.477257] s2ram/1599 is trying to acquire lock:
[14818.477276]  (s_active#8){++++.+}, at: [&lt;ffffffff81169147&gt;] sysfs_addrm_finish+0x31/0x5a
[14818.477323]
[14818.477325] but task is already holding lock:
[14818.477350]  (&amp;battery-&gt;lock){+.+.+.}, at: [&lt;ffffffffa0047278&gt;] sysfs_remove_battery+0x10/0x4b [battery]
[14818.477395]
[14818.477397] which lock already depends on the new lock.
[14818.477399]
[..]
[14818.479121] stack backtrace:
[14818.479148] Pid: 1599, comm: s2ram Not tainted 3.1.0-dbg-07865-g1280ea8-dirty #668
[14818.479175] Call Trace:
[14818.479198]  [&lt;ffffffff814828c3&gt;] print_circular_bug+0x293/0x2a4
[14818.479228]  [&lt;ffffffff81070cb5&gt;] __lock_acquire+0xfe4/0x164b
[14818.479260]  [&lt;ffffffff81169147&gt;] ? sysfs_addrm_finish+0x31/0x5a
[14818.479288]  [&lt;ffffffff810718d2&gt;] lock_acquire+0x138/0x1ac
[14818.479316]  [&lt;ffffffff81169147&gt;] ? sysfs_addrm_finish+0x31/0x5a
[14818.479345]  [&lt;ffffffff81168a79&gt;] sysfs_deactivate+0x9b/0xec
[14818.479373]  [&lt;ffffffff81169147&gt;] ? sysfs_addrm_finish+0x31/0x5a
[14818.479405]  [&lt;ffffffff81169147&gt;] sysfs_addrm_finish+0x31/0x5a
[14818.479433]  [&lt;ffffffff81167bc5&gt;] sysfs_hash_and_remove+0x54/0x77
[14818.479461]  [&lt;ffffffff811681b9&gt;] sysfs_remove_file+0x12/0x14
[14818.479488]  [&lt;ffffffff81385bf8&gt;] device_remove_file+0x12/0x14
[14818.479516]  [&lt;ffffffff81386504&gt;] device_del+0x119/0x17c
[14818.479542]  [&lt;ffffffff81386575&gt;] device_unregister+0xe/0x1a
[14818.479570]  [&lt;ffffffff813c6ef9&gt;] power_supply_unregister+0x23/0x27
[14818.479601]  [&lt;ffffffffa004729c&gt;] sysfs_remove_battery+0x34/0x4b [battery]
[14818.479632]  [&lt;ffffffffa004778f&gt;] battery_notify+0x2c/0x3a [battery]
[14818.479662]  [&lt;ffffffff8148fe82&gt;] notifier_call_chain+0x74/0xa1
[14818.479692]  [&lt;ffffffff810624b4&gt;] __blocking_notifier_call_chain+0x6c/0x89
[14818.479722]  [&lt;ffffffff810624e0&gt;] blocking_notifier_call_chain+0xf/0x11
[14818.479751]  [&lt;ffffffff8107e40e&gt;] pm_notifier_call_chain+0x15/0x27
[14818.479770]  [&lt;ffffffff8107ee1a&gt;] enter_state+0xa7/0xd5
[14818.479782]  [&lt;ffffffff8107e341&gt;] state_store+0xaa/0xc0
[14818.479795]  [&lt;ffffffff8107e297&gt;] ? pm_async_store+0x45/0x45
[14818.479807]  [&lt;ffffffff81248837&gt;] kobj_attr_store+0x17/0x19
[14818.479820]  [&lt;ffffffff81167e27&gt;] sysfs_write_file+0x103/0x13f
[14818.479834]  [&lt;ffffffff81109037&gt;] vfs_write+0xad/0x13d
[14818.479847]  [&lt;ffffffff811092b2&gt;] sys_write+0x45/0x6c
[14818.479860]  [&lt;ffffffff81492f92&gt;] system_call_fastpath+0x16/0x1b

This patch introduces separate lock to struct acpi_battery to
grab in sysfs_remove_battery() instead of battery-&gt;lock.
So fix by Lan Tianyu is still there, we just grab independent lock.

Signed-off-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Tested-by: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6</title>
<updated>2011-08-03T07:17:02Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2011-08-03T07:17:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c299eba3c5a801657f275d33be588b34831cd30e'/>
<id>urn:sha1:c299eba3c5a801657f275d33be588b34831cd30e</id>
<content type='text'>
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (28 commits)
  ACPI:  delete stale reference in kernel-parameters.txt
  ACPI: add missing _OSI strings
  ACPI: remove NID_INVAL
  thermal: make THERMAL_HWMON implementation fully internal
  thermal: split hwmon lookup to a separate function
  thermal: hide CONFIG_THERMAL_HWMON
  ACPI print OSI(Linux) warning only once
  ACPI: DMI workaround for Asus A8N-SLI Premium and Asus A8N-SLI DELUX
  ACPI / Battery: propagate sysfs error in acpi_battery_add()
  ACPI / Battery: avoid acpi_battery_add() use-after-free
  ACPI: introduce "acpi_rsdp=" parameter for kdump
  ACPI: constify ops structs
  ACPI: fix CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS
  ACPI: fix 80 char overflow
  ACPI / Battery: Resolve the race condition in the sysfs_remove_battery()
  ACPI / Battery: Add the check before refresh sysfs in the battery_notify()
  ACPI / Battery: Add the hibernation process in the battery_notify()
  ACPI / Battery: Rename acpi_battery_quirks2 with acpi_battery_quirks
  ACPI / Battery: Change 16-bit signed negative battery current into correct value
  ACPI / Battery: Add the power unit macro
  ...
</content>
</entry>
<entry>
<title>Merge branches 'acpica', 'battery', 'boot-irqs', 'bz-24492', 'bz-9528', 'from-akpm', 'kexec-param' and 'misc' into release</title>
<updated>2011-08-02T21:22:09Z</updated>
<author>
<name>Len Brown</name>
</author>
<published>2011-08-02T21:22:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4a8f5058bde15d737abe39b5bed3f21dcb6599d2'/>
<id>urn:sha1:4a8f5058bde15d737abe39b5bed3f21dcb6599d2</id>
<content type='text'>
Conflicts:
	Documentation/kernel-parameters.txt

Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
</entry>
<entry>
<title>treewide: fix potentially dangerous trailing ';' in #defined values/expressions</title>
<updated>2011-07-21T12:10:00Z</updated>
<author>
<name>Phil Carmody</name>
</author>
<published>2011-07-14T12:07:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=497888cf69bf607ac1fe061a6437e0a670b0022f'/>
<id>urn:sha1:497888cf69bf607ac1fe061a6437e0a670b0022f</id>
<content type='text'>
All these are instances of
  #define NAME value;
or
  #define NAME(params_opt) value;

These of course fail to build when used in contexts like
  if(foo $OP NAME)
  while(bar $OP NAME)
and may silently generate the wrong code in contexts such as
  foo = NAME + 1;    /* foo = value; + 1; */
  bar = NAME - 1;    /* bar = value; - 1; */
  baz = NAME &amp; quux; /* baz = value; &amp; quux; */

Reported on comp.lang.c,
Message-ID: &lt;ab0d55fe-25e5-482b-811e-c475aa6065c3@c29g2000yqd.googlegroups.com&gt;
Initial analysis of the dangers provided by Keith Thompson in that thread.

There are many more instances of more complicated macros having unnecessary
trailing semicolons, but this pile seems to be all of the cases of simple
values suffering from the problem. (Thus things that are likely to be found
in one of the contexts above, more complicated ones aren't.)

Signed-off-by: Phil Carmody &lt;ext-phil.2.carmody@nokia.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>ACPI / Battery: propagate sysfs error in acpi_battery_add()</title>
<updated>2011-07-16T22:57:24Z</updated>
<author>
<name>Stefan Hajnoczi</name>
</author>
<published>2011-07-12T08:03:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eb03cb02b74df6dd0b653d5f6d976f16a434dfaf'/>
<id>urn:sha1:eb03cb02b74df6dd0b653d5f6d976f16a434dfaf</id>
<content type='text'>
Make sure the error return from sysfs_add_battery() is checked and
propagated out from acpi_battery_add().

Signed-off-by: Stefan Hajnoczi &lt;stefanha@linux.vnet.ibm.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI / Battery: avoid acpi_battery_add() use-after-free</title>
<updated>2011-07-16T22:54:59Z</updated>
<author>
<name>Stefan Hajnoczi</name>
</author>
<published>2011-07-12T08:03:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e80bba4b5108c6479379740201b0a5d9da5ffbac'/>
<id>urn:sha1:e80bba4b5108c6479379740201b0a5d9da5ffbac</id>
<content type='text'>
When acpi_battery_add_fs() fails the error handling code does not clean
up completely.  Moreover, it does not return resulting in a
use-after-free.

Signed-off-by: Stefan Hajnoczi &lt;stefanha@linux.vnet.ibm.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: constify ops structs</title>
<updated>2011-07-16T22:36:17Z</updated>
<author>
<name>Vasiliy Kulikov</name>
</author>
<published>2011-06-25T17:07:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9c8b04be443b33939f374a811c82abeebe0a61d1'/>
<id>urn:sha1:9c8b04be443b33939f374a811c82abeebe0a61d1</id>
<content type='text'>
Structs battery_file, acpi_dock_ops, file_operations,
thermal_cooling_device_ops, thermal_zone_device_ops, kernel_param_ops
are not changed in runtime.  It is safe to make them const.
register_hotplug_dock_device() was altered to take const "ops" argument
to respect acpi_dock_ops' const notion.

Signed-off-by: Vasiliy Kulikov &lt;segoon@openwall.com&gt;
Acked-by: Jeff Garzik &lt;jgarzik@redhat.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI / Battery: Resolve the race condition in the sysfs_remove_battery()</title>
<updated>2011-07-14T04:06:19Z</updated>
<author>
<name>Lan Tianyu</name>
</author>
<published>2011-06-30T03:34:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9c921c22a7f33397a6774d7fa076db9b6a0fd669'/>
<id>urn:sha1:9c921c22a7f33397a6774d7fa076db9b6a0fd669</id>
<content type='text'>
Use battery-&gt;lock in sysfs_remove_battery() to make
checking, removing, and clearing bat.dev atomic.
This is necessary because sysfs_remove_battery() may
be invoked concurrently from different paths.

    https://bugzilla.kernel.org/show_bug.cgi?id=35642

Signed-off-by: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI / Battery: Add the check before refresh sysfs in the battery_notify()</title>
<updated>2011-07-14T04:05:45Z</updated>
<author>
<name>Lan Tianyu</name>
</author>
<published>2011-06-30T03:33:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6e17fb6aa1a67afa1827ae317c3594040f055730'/>
<id>urn:sha1:6e17fb6aa1a67afa1827ae317c3594040f055730</id>
<content type='text'>
In the commit 25be5821, add the refresh sysfs when system resumes
from suspending. But it didn't check that the battery exists. This
will cause battery sysfs files added when the battery doesn't exist.
This patch add the check before refreshing.

	https://bugzilla.kernel.org/show_bug.cgi?id=35642

Signed-off-by: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
</entry>
</feed>
