<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/acpi/ac.c, branch leds/master</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=leds%2Fmaster</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=leds%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2015-06-15T12:14:49Z</updated>
<entry>
<title>ACPI / AC: constify DMI system id table</title>
<updated>2015-06-15T12:14:49Z</updated>
<author>
<name>Mathias Krause</name>
<email>minipli@googlemail.com</email>
</author>
<published>2015-06-13T12:26:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=44f610cdfb8d1d134dc7756ad50287acfaee7f2e'/>
<id>urn:sha1:44f610cdfb8d1d134dc7756ad50287acfaee7f2e</id>
<content type='text'>
There is no need to have ac_dmi_table[] writeable, constify it.

Signed-off-by: Mathias Krause &lt;minipli@googlemail.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>power_supply: Change ownership from driver to core</title>
<updated>2015-03-13T22:15:51Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski@samsung.com</email>
</author>
<published>2015-03-12T07:44:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=297d716f6260cc9421d971b124ca196b957ee458'/>
<id>urn:sha1:297d716f6260cc9421d971b124ca196b957ee458</id>
<content type='text'>
Change the ownership of power_supply structure from each driver
implementing the class to the power supply core.

The patch changes power_supply_register() function thus all drivers
implementing power supply class are adjusted.

Each driver provides the implementation of power supply. However it
should not be the owner of power supply class instance because it is
exposed by core to other subsystems with power_supply_get_by_name().
These other subsystems have no knowledge when the driver will unregister
the power supply. This leads to several issues when driver is unbound -
mostly because user of power supply accesses freed memory.

Instead let the core own the instance of struct 'power_supply'.  Other
users of this power supply will still access valid memory because it
will be freed when device reference count reaches 0. Currently this
means "it will leak" but power_supply_put() call in next patches will
solve it.

This solves invalid memory references in following race condition
scenario:

Thread 1: charger manager
Thread 2: power supply driver, used by charger manager

THREAD 1 (charger manager)         THREAD 2 (power supply driver)
==========================         ==============================
psy = power_supply_get_by_name()
                                   Driver unbind, .remove
                                     power_supply_unregister()
                                     Device fully removed
psy-&gt;get_property()

The 'get_property' call is executed in invalid context because the driver was
unbound and struct 'power_supply' memory was freed.

This could be observed easily with charger manager driver (here compiled
with max17040 fuel gauge):

$ cat /sys/devices/virtual/power_supply/cm-battery/capacity &amp;
$ echo "1-0036" &gt; /sys/bus/i2c/drivers/max17040/unbind
[   55.725123] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[   55.732584] pgd = d98d4000
[   55.734060] [00000000] *pgd=5afa2831, *pte=00000000, *ppte=00000000
[   55.740318] Internal error: Oops: 80000007 [#1] PREEMPT SMP ARM
[   55.746210] Modules linked in:
[   55.749259] CPU: 1 PID: 2936 Comm: cat Tainted: G        W       3.19.0-rc1-next-20141226-00048-gf79f475f3c44-dirty #1496
[   55.760190] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[   55.766270] task: d9b76f00 ti: daf54000 task.ti: daf54000
[   55.771647] PC is at 0x0
[   55.774182] LR is at charger_get_property+0x2f4/0x36c
[   55.779201] pc : [&lt;00000000&gt;]    lr : [&lt;c034b0b4&gt;]    psr: 60000013
[   55.779201] sp : daf55e90  ip : 00000003  fp : 00000000
[   55.790657] r10: 00000000  r9 : c06e2878  r8 : d9b26c68
[   55.795865] r7 : dad81610  r6 : daec7410  r5 : daf55ebc  r4 : 00000000
[   55.802367] r3 : 00000000  r2 : daf55ebc  r1 : 0000002a  r0 : d9b26c68
[   55.808879] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   55.815994] Control: 10c5387d  Table: 598d406a  DAC: 00000015
[   55.821723] Process cat (pid: 2936, stack limit = 0xdaf54210)
[   55.827451] Stack: (0xdaf55e90 to 0xdaf56000)
[   55.831795] 5e80:                                     60000013 c01459c4 0000002a c06f8ef8
[   55.839956] 5ea0: db651000 c06f8ef8 daebac00 c04cb668 daebac08 c0346864 00000000 c01459c4
[   55.848115] 5ec0: d99eaa80 c06f8ef8 00000fff 00001000 db651000 c027f25c c027f240 d99eaa80
[   55.856274] 5ee0: d9a06c00 c0146218 daf55f18 00001000 d99eaa80 db4c18c0 00000001 00000001
[   55.864468] 5f00: daf55f80 c0144c78 c0144c54 c0107f90 00015000 d99eaab0 00000000 00000000
[   55.872603] 5f20: 000051c7 00000000 db4c18c0 c04a9370 00015000 00001000 daf55f80 00001000
[   55.880763] 5f40: daf54000 00015000 00000000 c00e53dc db4c18c0 c00e548c 0000000d 00008124
[   55.888937] 5f60: 00000001 00000000 00000000 db4c18c0 db4c18c0 00001000 00015000 c00e5550
[   55.897099] 5f80: 00000000 00000000 00001000 00001000 00015000 00000003 00000003 c000f364
[   55.905239] 5fa0: 00000000 c000f1a0 00001000 00015000 00000003 00015000 00001000 0001333c
[   55.913399] 5fc0: 00001000 00015000 00000003 00000003 00000002 00000000 00000000 00000000
[   55.921560] 5fe0: 7fffe000 be999850 0000a225 b6f3c19c 60000010 00000003 00000000 00000000
[   55.929744] [&lt;c034b0b4&gt;] (charger_get_property) from [&lt;c0346864&gt;] (power_supply_show_property+0x48/0x20c)
[   55.939286] [&lt;c0346864&gt;] (power_supply_show_property) from [&lt;c027f25c&gt;] (dev_attr_show+0x1c/0x48)
[   55.948130] [&lt;c027f25c&gt;] (dev_attr_show) from [&lt;c0146218&gt;] (sysfs_kf_seq_show+0x84/0x104)
[   55.956298] [&lt;c0146218&gt;] (sysfs_kf_seq_show) from [&lt;c0144c78&gt;] (kernfs_seq_show+0x24/0x28)
[   55.964536] [&lt;c0144c78&gt;] (kernfs_seq_show) from [&lt;c0107f90&gt;] (seq_read+0x1b0/0x484)
[   55.972172] [&lt;c0107f90&gt;] (seq_read) from [&lt;c00e53dc&gt;] (__vfs_read+0x18/0x4c)
[   55.979188] [&lt;c00e53dc&gt;] (__vfs_read) from [&lt;c00e548c&gt;] (vfs_read+0x7c/0x100)
[   55.986304] [&lt;c00e548c&gt;] (vfs_read) from [&lt;c00e5550&gt;] (SyS_read+0x40/0x8c)
[   55.993164] [&lt;c00e5550&gt;] (SyS_read) from [&lt;c000f1a0&gt;] (ret_fast_syscall+0x0/0x48)
[   56.000626] Code: bad PC value
[   56.011652] ---[ end trace 7b64343fbdae8ef1 ]---

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Reviewed-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;

[for the nvec part]
Reviewed-by: Marc Dietrich &lt;marvin24@gmx.de&gt;

[for compal-laptop.c]
Acked-by: Darren Hart &lt;dvhart@linux.intel.com&gt;

[for the mfd part]
Acked-by: Lee Jones &lt;lee.jones@linaro.org&gt;

[for the hid part]
Acked-by: Jiri Kosina &lt;jkosina@suse.cz&gt;

[for the acpi part]
Acked-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;

Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
</entry>
<entry>
<title>power_supply: Move run-time configuration to separate structure</title>
<updated>2015-03-13T22:15:12Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski@samsung.com</email>
</author>
<published>2015-03-12T07:44:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2dc9215d7c94f7f9f34ccf8b1710ad73d82f6216'/>
<id>urn:sha1:2dc9215d7c94f7f9f34ccf8b1710ad73d82f6216</id>
<content type='text'>
Add new structure 'power_supply_config' for holding run-time
initialization data like of_node, supplies and private driver data.

The power_supply_register() function is changed so all power supply
drivers need updating.

When registering the power supply this new 'power_supply_config' should be
used instead of directly initializing 'struct power_supply'. This allows
changing the ownership of power_supply structure from driver to the
power supply core in next patches.

When a driver does not use of_node or supplies then it should use NULL
as config. If driver uses of_node or supplies then it should allocate
config on stack and initialize it with proper values.

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Reviewed-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;

[for the nvec part]
Reviewed-by: Marc Dietrich &lt;marvin24@gmx.de&gt;

[for drivers/platform/x86/compal-laptop.c]
Reviewed-by: Darren Hart &lt;dvhart@linux.intel.com&gt;

[for drivers/hid/*]
Reviewed-by: Jiri Kosina &lt;jkosina@suse.cz&gt;

Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
</entry>
<entry>
<title>Revert "ACPI / AC: Remove AC's proc directory."</title>
<updated>2014-07-06T23:13:46Z</updated>
<author>
<name>Lan Tianyu</name>
<email>tianyu.lan@intel.com</email>
</author>
<published>2014-07-06T23:13:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e63f6e28dda6de3de2392ddca321e211fd860925'/>
<id>urn:sha1:e63f6e28dda6de3de2392ddca321e211fd860925</id>
<content type='text'>
Revert commit ab0fd674d6ce (ACPI / AC: Remove AC's proc directory.),
because some old tools (e.g. kpowersave from kde 3.5.10) are still
using /proc/acpi/ac_adapter.

Fixes: ab0fd674d6ce (ACPI / AC: Remove AC's proc directory.)
Reported-and-tested-by: Sorin Manolache &lt;sorinm@gmail.com&gt;
Signed-off-by: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Cc: All applicable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: Revert "ACPI / AC: convert ACPI ac driver to platform bus"</title>
<updated>2014-05-07T22:37:28Z</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2014-05-07T02:18:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=98012849e0cbf980326f8e34d571f4474866a88e'/>
<id>urn:sha1:98012849e0cbf980326f8e34d571f4474866a88e</id>
<content type='text'>
Revert commit cc8ef5270734 (ACPI / AC: convert ACPI ac driver to
platform bus) that is reported to break thermal management on
MacBook Air 2013 with ArchLinux.

Fixes: cc8ef5270734 (ACPI / AC: convert ACPI ac driver to platform bus)
References: https://bugzilla.kernel.org/show_bug.cgi?id=71711
Cc: Zhang Rui &lt;rui.zhang@intel.com&gt;
Reported-and-tested-by: Manuel Krause &lt;manuelkrause@netscape.net&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Cc: 3.13+ &lt;stable@vger.kernel.org&gt; # 3.13+
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI / AC: recheck adapter status upon battery status changes</title>
<updated>2014-03-19T00:57:47Z</updated>
<author>
<name>Alexander Mezin</name>
<email>mezin.alexander@gmail.com</email>
</author>
<published>2014-03-11T17:58:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4eee4f03ce7aea1ef212bb5c27a8b54d73315996'/>
<id>urn:sha1:4eee4f03ce7aea1ef212bb5c27a8b54d73315996</id>
<content type='text'>
On HP Pavilion dv6-6179er there are no notifications when AC adapter
is plugged/unplugged.
However, when AC status is read (acpi_ac_get_state), and if AC status
has changed, AML code triggers the notification.

This patch solves the problem by re-reading AC adapter status upon
ACPI_BATTERY_NOTIFY_STATUS notification.

Signed-off-by: Alexander Mezin &lt;mezin.alexander@gmail.com&gt;
Acked-by: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI / AC: fix AC driver compile error when CONFIG_PM_SLEEP is undefined</title>
<updated>2014-02-13T14:13:44Z</updated>
<author>
<name>Shuah Khan</name>
<email>shuah.kh@samsung.com</email>
</author>
<published>2014-02-13T03:19:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=06521c2e4a049504675f64f0a7e6d882fd364bc1'/>
<id>urn:sha1:06521c2e4a049504675f64f0a7e6d882fd364bc1</id>
<content type='text'>
The ACPI AC driver defines acpi_ac_resume() when CONFIG_PM_SLEEP is
defined.  This results in the following compile error when
CONFIG_PM_SLEEP is undefined:

drivers/acpi/ac.c:248:8: error: ‘acpi_ac_resume’ undeclared here (not in a function)

Signed-off-by: Shuah Khan &lt;shuah.kh@samsung.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'acpi-cleanup'</title>
<updated>2014-01-12T22:44:09Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2014-01-12T22:44:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=98feb7cc61c50fe0fa36eeb994d5db527ca9e103'/>
<id>urn:sha1:98feb7cc61c50fe0fa36eeb994d5db527ca9e103</id>
<content type='text'>
* acpi-cleanup: (22 commits)
  ACPI / tables: Return proper error codes from acpi_table_parse() and fix comment.
  ACPI / tables: Check if id is NULL in acpi_table_parse()
  ACPI / proc: Include appropriate header file in proc.c
  ACPI / EC: Remove unused functions and add prototype declaration in internal.h
  ACPI / dock: Include appropriate header file in dock.c
  ACPI / PCI: Include appropriate header file in pci_link.c
  ACPI / PCI: Include appropriate header file in pci_slot.c
  ACPI / EC: Mark the function acpi_ec_add_debugfs() as static in ec_sys.c
  ACPI / NVS: Include appropriate header file in nvs.c
  ACPI / OSL: Mark the function acpi_table_checksum() as static
  ACPI / processor: initialize a variable to silence compiler warning
  ACPI / processor: use ACPI_COMPANION() to get ACPI device
  ACPI: correct minor typos
  ACPI / sleep: Drop redundant acpi_disabled check
  ACPI / dock: Drop redundant acpi_disabled check
  ACPI / table: Replace '1' with specific error return values
  ACPI: remove trailing whitespace
  ACPI / IBFT: Fix incorrect &lt;acpi/acpi.h&gt; inclusion in iSCSI boot firmware module
  ACPI / i915: Fix incorrect &lt;acpi/acpi.h&gt; inclusions via &lt;linux/acpi_io.h&gt;
  SFI / ACPI: Fix warnings reported during builds with W=1
  ...

Conflicts:
	drivers/acpi/nvs.c
	drivers/hwmon/asus_atk0110.c
</content>
</entry>
<entry>
<title>ACPI / AC: change notification handler type to ACPI_ALL_NOTIFY</title>
<updated>2014-01-05T14:42:42Z</updated>
<author>
<name>Alexander Mezin</name>
<email>mezin.alexander@gmail.com</email>
</author>
<published>2014-01-04T02:07:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=50a2bc5429f07ec4d53df2d287b03bdbceb281bb'/>
<id>urn:sha1:50a2bc5429f07ec4d53df2d287b03bdbceb281bb</id>
<content type='text'>
With kernel 3.13rc5 there are no AC adapter notifications on my laptop.

Commit cc8ef5270734 "ACPI / AC: convert ACPI ac driver to platform bus"
changed the driver to listen to device notifications only. However, AML
code on my laptop notifies the driver with zero event.

This patch changes the driver to listen to all events again.

Fixes: cc8ef5270734 (ACPI / AC: convert ACPI ac driver to platform bus)
References: https://bugzilla.kernel.org/show_bug.cgi?id=67821
Signed-off-by: Alexander Mezin &lt;mezin.alexander@gmail.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: Clean up inclusions of ACPI header files</title>
<updated>2013-12-07T00:03:14Z</updated>
<author>
<name>Lv Zheng</name>
<email>lv.zheng@intel.com</email>
</author>
<published>2013-12-03T00:49:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8b48463f89429af408ff695244dc627e1acff4f7'/>
<id>urn:sha1:8b48463f89429af408ff695244dc627e1acff4f7</id>
<content type='text'>
Replace direct inclusions of &lt;acpi/acpi.h&gt;, &lt;acpi/acpi_bus.h&gt; and
&lt;acpi/acpi_drivers.h&gt;, which are incorrect, with &lt;linux/acpi.h&gt;
inclusions and remove some inclusions of those files that aren't
necessary.

First of all, &lt;acpi/acpi.h&gt;, &lt;acpi/acpi_bus.h&gt; and &lt;acpi/acpi_drivers.h&gt;
should not be included directly from any files that are built for
CONFIG_ACPI unset, because that generally leads to build warnings about
undefined symbols in !CONFIG_ACPI builds.  For CONFIG_ACPI set,
&lt;linux/acpi.h&gt; includes those files and for CONFIG_ACPI unset it
provides stub ACPI symbols to be used in that case.

Second, there are ordering dependencies between those files that always
have to be met.  Namely, it is required that &lt;acpi/acpi_bus.h&gt; be included
prior to &lt;acpi/acpi_drivers.h&gt; so that the acpi_pci_root declarations the
latter depends on are always there.  And &lt;acpi/acpi.h&gt; which provides
basic ACPICA type declarations should always be included prior to any other
ACPI headers in CONFIG_ACPI builds.  That also is taken care of including
&lt;linux/acpi.h&gt; as appropriate.

Signed-off-by: Lv Zheng &lt;lv.zheng@intel.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Matthew Garrett &lt;mjg59@srcf.ucam.org&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt; (drivers/pci stuff)
Acked-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt; (Xen stuff)
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
