<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/power, branch v3.18</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.18</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.18'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-11-15T23:22:51Z</updated>
<entry>
<title>Merge tag 'for-v3.18-rc' of git://git.infradead.org/battery-2.6</title>
<updated>2014-11-15T23:22:51Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-11-15T23:22:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ec7de6567ffdc8bdcf816365ef56bc0771afb63d'/>
<id>urn:sha1:ec7de6567ffdc8bdcf816365ef56bc0771afb63d</id>
<content type='text'>
Pull power supply updates from Sebastian Reichel:
 "Power supply and reset changes for the v3.18-rc:

   - misc. charger-manager fixes
   - year 2038 fix in ab8500_fg
   - fix error handling of bq2415x_charger"

* tag 'for-v3.18-rc' of git://git.infradead.org/battery-2.6:
  power: charger-manager: Fix accessing invalidated power supply after charger unbind
  power: charger-manager: Fix accessing invalidated power supply after fuel gauge unbind
  power: charger-manager: Avoid recursive thermal get_temp call
  power_supply: Add no_thermal property to prevent recursive get_temp calls
  power: bq2415x_charger: Fix memory leak on DTS parsing error
  power: bq2415x_charger: Properly handle ENODEV from power_supply_get_by_phandle
  power: ab8500_fg.c: use 64-bit time types
</content>
</entry>
<entry>
<title>power: charger-manager: Fix accessing invalidated power supply after charger unbind</title>
<updated>2014-10-28T02:30:21Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski@samsung.com</email>
</author>
<published>2014-10-13T13:34:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cdaf3e15385d3232b52287e50692506f8fd01a09'/>
<id>urn:sha1:cdaf3e15385d3232b52287e50692506f8fd01a09</id>
<content type='text'>
The charger manager obtained in probe references to power supplies for
all chargers with power_supply_get_by_name() for later usage. However
if such charger driver was removed then this reference would point to
old power supply (from driver which was removed).

This lead to accessing invalid memory which could be observed with:
$ echo "max77693-charger" &gt; /sys/bus/platform/drivers/max77693-charger/unbind
$ grep . /sys/devices/virtual/power_supply/battery/charger.0/*
$ grep . /sys/devices/virtual/power_supply/battery/*
[   15.339817] Unable to handle kernel paging request at virtual address 0001c12c
[   15.346187] pgd = edd08000
[   15.348814] [0001c12c] *pgd=6dce2831, *pte=00000000, *ppte=00000000
[   15.355075] Internal error: Oops: 80000007 [#1] PREEMPT SMP ARM
[   15.360967] Modules linked in:
[   15.364010] CPU: 2 PID: 1388 Comm: grep Not tainted 3.17.0-next-20141007-00027-ga95e761db1b0 #245
[   15.372859] task: ee03ad00 ti: edcf6000 task.ti: edcf6000
[   15.378241] PC is at 0x1c12c
[   15.381113] LR is at is_ext_pwr_online+0x30/0x6c
[   15.385706] pc : [&lt;0001c12c&gt;]    lr : [&lt;c0339fc4&gt;]    psr: a0000013
[   15.385706] sp : edcf7e88  ip : 00000000  fp : 00000000
[   15.397161] r10: eeb02c08  r9 : c04b1f84  r8 : eeb02c00
[   15.402369] r7 : edc69a10  r6 : eea6ac10  r5 : eea6ac10  r4 : 00000004
[   15.408878] r3 : 0001c12c  r2 : edcf7e8c  r1 : 00000004  r0 : ee914418
[   15.415390] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   15.422506] Control: 10c5387d  Table: 6dd0804a  DAC: 00000015
[   15.428236] Process grep (pid: 1388, stack limit = 0xedcf6240)
[   15.434050] Stack: (0xedcf7e88 to 0xedcf8000)
[   15.438395] 7e80:                   ee03ad00 00000000 edcf7f80 eea6aca8 edcf7ec4 c033b7b0
[   15.446554] 7ea0: 00000001 ee1cc3f0 00000004 c06e1e44 eebdc000 c06e1e44 eeb02c00 c0337144
[   15.454713] 7ec0: ee2dac68 c005cffc ee1cc3c0 c06e1e44 00000fff 00001000 eebdc000 c0278ca8
[   15.462872] 7ee0: c0278c8c ee1cc3c0 eeb7ce00 c014422c edcf7f20 00008000 ee1cc3c0 ee9a48c0
[   15.471030] 7f00: 00000001 00000001 edcf7f80 c0142d94 c0142d70 c01060f4 00021000 ee1cc3f0
[   15.479190] 7f20: 00000000 00000000 c06a2150 eebdc000 2e7ec000 ee9a48c0 00008000 00021000
[   15.487349] 7f40: edcf7f80 00008000 edcf6000 00021000 00021000 c00e39a4 00000000 ee9a48c0
[   15.495508] 7f60: 00004000 00000000 00000000 ee9a48c0 ee9a48c0 00008000 00021000 c00e3aa0
[   15.503668] 7f80: 00000000 00000000 0001f2e0 0001f2e0 00021000 00001000 00000003 c000f364
[   15.511826] 7fa0: 00000000 c000f1a0 0001f2e0 00021000 00000003 00021000 00008000 00000000
[   15.519986] 7fc0: 0001f2e0 00021000 00001000 00000003 00000001 000205e8 00000000 00021000
[   15.528145] 7fe0: 00008000 bebbe910 0000a7ad b6edc49c 60000010 00000003 aaaaaaaa aaaaaaaa
[   15.536320] [&lt;c0339fc4&gt;] (is_ext_pwr_online) from [&lt;c033b7b0&gt;] (charger_get_property+0x170/0x314)
[   15.545164] [&lt;c033b7b0&gt;] (charger_get_property) from [&lt;c0337144&gt;] (power_supply_show_property+0x48/0x20c)
[   15.554719] [&lt;c0337144&gt;] (power_supply_show_property) from [&lt;c0278ca8&gt;] (dev_attr_show+0x1c/0x48)
[   15.563577] [&lt;c0278ca8&gt;] (dev_attr_show) from [&lt;c014422c&gt;] (sysfs_kf_seq_show+0x84/0x104)
[   15.571725] [&lt;c014422c&gt;] (sysfs_kf_seq_show) from [&lt;c0142d94&gt;] (kernfs_seq_show+0x24/0x28)
[   15.579973] [&lt;c0142d94&gt;] (kernfs_seq_show) from [&lt;c01060f4&gt;] (seq_read+0x1b0/0x484)
[   15.587614] [&lt;c01060f4&gt;] (seq_read) from [&lt;c00e39a4&gt;] (vfs_read+0x88/0x144)
[   15.594552] [&lt;c00e39a4&gt;] (vfs_read) from [&lt;c00e3aa0&gt;] (SyS_read+0x40/0x8c)
[   15.601417] [&lt;c00e3aa0&gt;] (SyS_read) from [&lt;c000f1a0&gt;] (ret_fast_syscall+0x0/0x48)
[   15.608877] Code: bad PC value
[   15.611991] ---[ end trace a88fcc95208db283 ]---

The charger-manager should get reference to charger power supply on
each use of get_property callback.

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Fixes: 3bb3dbbd56ea ("power_supply: Add initial Charger-Manager driver")
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
</entry>
<entry>
<title>power: charger-manager: Fix accessing invalidated power supply after fuel gauge unbind</title>
<updated>2014-10-28T02:30:20Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski@samsung.com</email>
</author>
<published>2014-10-13T13:34:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bdbe81445407644492b9ac69a24d35e3202d773b'/>
<id>urn:sha1:bdbe81445407644492b9ac69a24d35e3202d773b</id>
<content type='text'>
The charger manager obtained reference to fuel gauge power supply in probe
with power_supply_get_by_name() for later usage. However if fuel gauge
driver was removed and re-added then this reference would point to old
power supply (from driver which was removed).

This lead to accessing old (and probably invalid) memory which could be
observed with:
$ echo "12-0036" &gt; /sys/bus/i2c/drivers/max17042/unbind
$ echo "12-0036" &gt; /sys/bus/i2c/drivers/max17042/bind
$ cat /sys/devices/virtual/power_supply/battery/capacity
[  240.480084] INFO: task cat:1393 blocked for more than 120 seconds.
[  240.484799]       Not tainted 3.17.0-next-20141007-00028-ge60b6dd79570 #203
[  240.491782] "echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  240.499589] cat             D c0469530     0  1393      1 0x00000000
[  240.505947] [&lt;c0469530&gt;] (__schedule) from [&lt;c0469d3c&gt;] (schedule_preempt_disabled+0x14/0x20)
[  240.514449] [&lt;c0469d3c&gt;] (schedule_preempt_disabled) from [&lt;c046af08&gt;] (mutex_lock_nested+0x1bc/0x458)
[  240.523736] [&lt;c046af08&gt;] (mutex_lock_nested) from [&lt;c0287a98&gt;] (regmap_read+0x30/0x60)
[  240.531647] [&lt;c0287a98&gt;] (regmap_read) from [&lt;c032238c&gt;] (max17042_get_property+0x2e8/0x350)
[  240.540055] [&lt;c032238c&gt;] (max17042_get_property) from [&lt;c03247d8&gt;] (charger_get_property+0x264/0x348)
[  240.549252] [&lt;c03247d8&gt;] (charger_get_property) from [&lt;c0320764&gt;] (power_supply_show_property+0x48/0x1e0)
[  240.558808] [&lt;c0320764&gt;] (power_supply_show_property) from [&lt;c027308c&gt;] (dev_attr_show+0x1c/0x48)
[  240.567664] [&lt;c027308c&gt;] (dev_attr_show) from [&lt;c0141fb0&gt;] (sysfs_kf_seq_show+0x84/0x104)
[  240.575814] [&lt;c0141fb0&gt;] (sysfs_kf_seq_show) from [&lt;c0140b18&gt;] (kernfs_seq_show+0x24/0x28)
[  240.584061] [&lt;c0140b18&gt;] (kernfs_seq_show) from [&lt;c0104574&gt;] (seq_read+0x1b0/0x484)
[  240.591702] [&lt;c0104574&gt;] (seq_read) from [&lt;c00e1e24&gt;] (vfs_read+0x88/0x144)
[  240.598640] [&lt;c00e1e24&gt;] (vfs_read) from [&lt;c00e1f20&gt;] (SyS_read+0x40/0x8c)
[  240.605507] [&lt;c00e1f20&gt;] (SyS_read) from [&lt;c000e760&gt;] (ret_fast_syscall+0x0/0x48)
[  240.612952] 4 locks held by cat/1393:
[  240.616589]  #0:  (&amp;p-&gt;lock){+.+.+.}, at: [&lt;c01043f4&gt;] seq_read+0x30/0x484
[  240.623414]  #1:  (&amp;of-&gt;mutex){+.+.+.}, at: [&lt;c01417dc&gt;] kernfs_seq_start+0x1c/0x8c
[  240.631086]  #2:  (s_active#31){++++.+}, at: [&lt;c01417e4&gt;] kernfs_seq_start+0x24/0x8c
[  240.638777]  #3:  (&amp;map-&gt;mutex){+.+...}, at: [&lt;c0287a98&gt;] regmap_read+0x30/0x60

The charger-manager should get reference to fuel gauge power supply on
each use of get_property callback. The thermal zone 'tzd' field of
power supply should not be used because of the same reason.

Additionally this change solves also the issue with nested
thermal_zone_get_temp() calls and related false lockdep positive for
deadlock for thermal zone's mutex [1]. When fuel gauge is used as source of
temperature then the charger manager forwards its get_temp calls to fuel
gauge thermal zone. So actually different mutexes are used (one for
charger manager thermal zone and second for fuel gauge thermal zone) but
for lockdep this is one class of mutex.

The recursion is removed by retrieving temperature through power
supply's get_property().

In case external thermal zone is used ('cm-thermal-zone' property is
present in DTS) the recursion does not exist. Charger manager simply
exports POWER_SUPPLY_PROP_TEMP_AMBIENT property (instead of
POWER_SUPPLY_PROP_TEMP) thus no thermal zone is created for this power
supply.

[1] https://lkml.org/lkml/2014/10/6/309

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Fixes: 3bb3dbbd56ea ("power_supply: Add initial Charger-Manager driver")
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
</entry>
<entry>
<title>power: charger-manager: Avoid recursive thermal get_temp call</title>
<updated>2014-10-28T02:30:19Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski@samsung.com</email>
</author>
<published>2014-10-07T15:47:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ba9c91825d4a3bb49532d4a59c72e98b529b7eff'/>
<id>urn:sha1:ba9c91825d4a3bb49532d4a59c72e98b529b7eff</id>
<content type='text'>
The charger manager supports POWER_SUPPLY_PROP_TEMP property and acts
as a thermal zone if any of these conditions match:
1. Fuel gauge used by charger manager supports POWER_SUPPLY_PROP_TEMP.
2. 'cm-thermal-zone' property is present in DTS (then it will supersede
   the fuel gauge temperature property).

However in case 1 (fuel gauge reports temperature and 'cm-thermal-zone'
is not set) the charger manager forwards its get_temp calls to fuel
gauge thermal zone.

This leads to reporting by lockdep a false positive deadlock for thermal
zone's mutex because of nested calls to thermal_zone_get_temp(). This is
false positive because these are different mutexes: one for charger
manager thermal zone and second for fuel gauge thermal zone.

Get rid of false lockdep alert and recursive call by setting
'no_thermal' property for this power supply class. The thermal zone for
charger manager won't be created (user space does not use it anyway).

The lockdep report:
[    2.540339] charger-manager charger-manager@0: Ignoring full-battery voltage threshold as it is not supplied
[    2.540351] charger-manager charger-manager@0: Ignoring full-battery full capacity threshold as it is not supplied
[    2.546296]
[    2.546302] =============================================
[    2.546305] [ INFO: possible recursive locking detected ]
[    2.546312] 3.17.0-rc6-next-20140926-00012-gbb13895e46af-dirty #39 Not tainted
[    2.546316] ---------------------------------------------
[    2.546321] swapper/0/1 is trying to acquire lock:
[    2.546348]  (&amp;tz-&gt;lock){+.+...}, at: [&lt;c0321d24&gt;] thermal_zone_get_temp+0x38/0x68
[    2.546352]
[    2.546352] but task is already holding lock:
[    2.546369]  (&amp;tz-&gt;lock){+.+...}, at: [&lt;c0321d24&gt;] thermal_zone_get_temp+0x38/0x68
[    2.546373]
[    2.546373] other info that might help us debug this:
[    2.546376]  Possible unsafe locking scenario:
[    2.546376]
[    2.546378]        CPU0
[    2.546380]        ----
[    2.546386]   lock(&amp;tz-&gt;lock);
[    2.546392]   lock(&amp;tz-&gt;lock);
[    2.546394]
[    2.546394]  *** DEADLOCK ***
[    2.546394]
[    2.546397]  May be due to missing lock nesting notation
[    2.546397]
[    2.546401] 2 locks held by swapper/0/1:
[    2.546430]  #0:  (&amp;dev-&gt;mutex){......}, at: [&lt;c02720c4&gt;] __driver_attach+0x58/0x98
[    2.546448]  #1:  (&amp;tz-&gt;lock){+.+...}, at: [&lt;c0321d24&gt;] thermal_zone_get_temp+0x38/0x68
[    2.546451]
[    2.546451] stack backtrace:
[    2.546460] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.17.0-rc6-next-20140926-00012-gbb13895e46af-dirty #39
[    2.546497] [&lt;c00140f0&gt;] (unwind_backtrace) from [&lt;c0011228&gt;] (show_stack+0x10/0x14)
[    2.546526] [&lt;c0011228&gt;] (show_stack) from [&lt;c046158c&gt;] (dump_stack+0x70/0xbc)
[    2.546554] [&lt;c046158c&gt;] (dump_stack) from [&lt;c005e32c&gt;] (validate_chain.isra.24+0x718/0x890)
[    2.546569] [&lt;c005e32c&gt;] (validate_chain.isra.24) from [&lt;c005f0a0&gt;] (__lock_acquire+0x498/0xa78)
[    2.546581] [&lt;c005f0a0&gt;] (__lock_acquire) from [&lt;c005fb50&gt;] (lock_acquire+0x78/0xb8)
[    2.546594] [&lt;c005fb50&gt;] (lock_acquire) from [&lt;c0464260&gt;] (mutex_lock_nested+0x64/0x458)
[    2.546605] [&lt;c0464260&gt;] (mutex_lock_nested) from [&lt;c0321d24&gt;] (thermal_zone_get_temp+0x38/0x68)
[    2.546634] [&lt;c0321d24&gt;] (thermal_zone_get_temp) from [&lt;c031f1e0&gt;] (charger_get_property+0x10c/0x348)
[    2.546649] [&lt;c031f1e0&gt;] (charger_get_property) from [&lt;c031af18&gt;] (power_supply_read_temp+0x28/0x58)
[    2.546662] [&lt;c031af18&gt;] (power_supply_read_temp) from [&lt;c0321d38&gt;] (thermal_zone_get_temp+0x4c/0x68)
[    2.546676] [&lt;c0321d38&gt;] (thermal_zone_get_temp) from [&lt;c03233d8&gt;] (thermal_zone_device_update+0x24/0x9c)
[    2.546687] [&lt;c03233d8&gt;] (thermal_zone_device_update) from [&lt;c0323874&gt;] (thermal_zone_device_register+0x424/0x550)
[    2.546701] [&lt;c0323874&gt;] (thermal_zone_device_register) from [&lt;c031b3c0&gt;] (__power_supply_register+0x2a4/0x348)
[    2.546714] [&lt;c031b3c0&gt;] (__power_supply_register) from [&lt;c031ff64&gt;] (charger_manager_probe+0x600/0xe5c)
[    2.546727] [&lt;c031ff64&gt;] (charger_manager_probe) from [&lt;c0273384&gt;] (platform_drv_probe+0x48/0xa4)
[    2.546746] [&lt;c0273384&gt;] (platform_drv_probe) from [&lt;c0271f54&gt;] (driver_probe_device+0x10c/0x224)
[    2.546760] [&lt;c0271f54&gt;] (driver_probe_device) from [&lt;c0272100&gt;] (__driver_attach+0x94/0x98)
[    2.546772] [&lt;c0272100&gt;] (__driver_attach) from [&lt;c0270780&gt;] (bus_for_each_dev+0x54/0x88)
[    2.546784] [&lt;c0270780&gt;] (bus_for_each_dev) from [&lt;c027173c&gt;] (bus_add_driver+0xd4/0x1d0)
[    2.546797] [&lt;c027173c&gt;] (bus_add_driver) from [&lt;c027271c&gt;] (driver_register+0x78/0xf4)
[    2.546809] [&lt;c027271c&gt;] (driver_register) from [&lt;c0008984&gt;] (do_one_initcall+0x80/0x1d4)
[    2.546829] [&lt;c0008984&gt;] (do_one_initcall) from [&lt;c0612d60&gt;] (kernel_init_freeable+0x10c/0x1d8)
[    2.546847] [&lt;c0612d60&gt;] (kernel_init_freeable) from [&lt;c045c238&gt;] (kernel_init+0x8/0xec)
[    2.546863] [&lt;c045c238&gt;] (kernel_init) from [&lt;c000e828&gt;] (ret_from_fork+0x14/0x2c)
[    2.551396] charger-manager charger-manager@0: 'chg-reg' regulator's externally_control is 0

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
</entry>
<entry>
<title>power_supply: Add no_thermal property to prevent recursive get_temp calls</title>
<updated>2014-10-28T02:30:19Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski@samsung.com</email>
</author>
<published>2014-10-07T15:47:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a69d82b9bdf1e53e94423048e8bda8c5f5a3dd4e'/>
<id>urn:sha1:a69d82b9bdf1e53e94423048e8bda8c5f5a3dd4e</id>
<content type='text'>
Add a 'no_thermal' property to the power supply class. If true then
thermal zone won't be created for this power supply in
power_supply_register().

Power supply drivers may want to set it if they support
POWER_SUPPLY_PROP_TEMP and they are forwarding this get property call to
other thermal zone.

If they won't set it lockdep may report false positive deadlock for
thermal zone's mutex because of nested calls to thermal_zone_get_temp().
First is the call to thermal_zone_get_temp() of the driver's thermal
zone. Thermal core gets POWER_SUPPLY_PROP_TEMP property from this
driver. The driver then calls other thermal zone thermal_zone_get_temp()
and returns result.

Example of such driver is charger manager.

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
</entry>
<entry>
<title>power: bq2415x_charger: Fix memory leak on DTS parsing error</title>
<updated>2014-10-28T02:30:18Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski@samsung.com</email>
</author>
<published>2014-10-15T14:25:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=21e863b233553998737e1b506c823a00bf012e00'/>
<id>urn:sha1:21e863b233553998737e1b506c823a00bf012e00</id>
<content type='text'>
Memory allocated for 'name' was leaking if required binding properties
were not present.

The memory for 'name' was allocated early at probe with kasprintf(). It
was freed in error paths executed before and after parsing DTS but not
in that error path.

Fix the error path for parsing device tree properties.

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Fixes: faffd234cf85 ("bq2415x_charger: Add DT support")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
</entry>
<entry>
<title>power: bq2415x_charger: Properly handle ENODEV from power_supply_get_by_phandle</title>
<updated>2014-10-28T02:30:08Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski@samsung.com</email>
</author>
<published>2014-10-15T14:25:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0eaf437aa14949d2230aeab7364f4ab47901304a'/>
<id>urn:sha1:0eaf437aa14949d2230aeab7364f4ab47901304a</id>
<content type='text'>
The power_supply_get_by_phandle() on error returns ENODEV or NULL.
The driver later expects obtained pointer to power supply to be
valid or NULL. If it is not NULL then it dereferences it in
bq2415x_notifier_call() which would lead to dereferencing ENODEV-value
pointer.

Properly handle the power_supply_get_by_phandle() error case by
replacing error value with NULL. This indicates that usb charger
detection won't be used.

Fix also memory leak of 'name' if power_supply_get_by_phandle() fails
with NULL and probe should defer.

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Fixes: faffd234cf85 ("bq2415x_charger: Add DT support")
Cc: &lt;stable@vger.kernel.org&gt;
[small fix regarding the missing ti,usb-charger-detection info message]
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
</entry>
<entry>
<title>power: reset: at91-reset: fix power down register</title>
<updated>2014-10-22T08:08:22Z</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@free-electrons.com</email>
</author>
<published>2014-10-20T18:27:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7cb4e717d474b118930c3b5fa3a2581eb1fdee72'/>
<id>urn:sha1:7cb4e717d474b118930c3b5fa3a2581eb1fdee72</id>
<content type='text'>
In the case of at91sam9g45_restart(), the driver is writing
AT91_DDRSDRC_LPCB_POWER_DOWN to AT91_DDRSDRC_RTR, this should actually be
AT91_DDRSDRC_LPR.

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Acked-by: Sebastian Reichel &lt;sre@kernel.org&gt;
Signed-off-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
</content>
</entry>
<entry>
<title>power: ab8500_fg.c: use 64-bit time types</title>
<updated>2014-10-15T08:37:05Z</updated>
<author>
<name>Ebru Akagunduz</name>
<email>ebru.akagunduz@gmail.com</email>
</author>
<published>2014-10-08T14:09:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8000ebf76224a01adab9c1c16c341f54706292d5'/>
<id>urn:sha1:8000ebf76224a01adab9c1c16c341f54706292d5</id>
<content type='text'>
This patch changes 32-bit time types to 64-bit in
drivers/power/ab8500_fg.c

timespec and time_t can only represent signed 32-bit
dates but the driver should represent dates that are
after January 2038. So used time64.h header file and
its proper types and functions.

Use time64_t type instead of __kernel_time_t for
time_stamps variable of ab8500_fg_avg_cap struct

Signed-off-by: Ebru Akagunduz &lt;ebru.akagunduz@gmail.com&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'for-v3.18' of git://git.infradead.org/battery-2.6</title>
<updated>2014-10-15T04:56:23Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-10-15T04:56:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=50fa86172bec2769979b5eb0cd1a244391ae4bb0'/>
<id>urn:sha1:50fa86172bec2769979b5eb0cd1a244391ae4bb0</id>
<content type='text'>
Pull power supply and reset updates from Sebastian Reichel:
 - Initial support for the following chips
   * max77836 (charger)
   * max14577 (charger)
   * bq27742 (battery gauge)
   * ltc2952 (poweroff)
   * stih416 (restart)
   * syscon-reboot (restart)
   * gpio-restart (restart)
 - cleanup of power supply core
 - misc fixes in power supply and reset drivers

* tag 'for-v3.18' of git://git.infradead.org/battery-2.6: (48 commits)
  power: ab8500_fg: Fix build warning
  Documentation: charger: max14577: Update the date of introducing ABI
  power: reset: corrections for simple syscon reboot driver
  Documentation: power: reset: Add documentation for generic SYSCON reboot driver
  power: reset: Add generic SYSCON register mapped reset
  bq27x00_battery: Fix flag reading for bq27742
  power: reset: use restart_notifier mechanism for msm-poweroff
  power: Add simple gpio-restart driver
  power: reset: st: Provide DT bindings for ST's Power Reset driver
  power: reset: Add restart functionality for STiH41x platforms
  power: charger-manager: Fix NULL pointer exception with missing cm-fuel-gauge
  power: max14577: Fix circular config SYSFS dependency
  power: gpio-charger: do not use gpio value directly
  power: max8925: Use of_get_child_by_name
  power: max8925: Fix NULL ptr dereference on memory allocation failure
  bq27x00_battery: Add support to bq27742
  Documentation: charger: max14577: Document exported sysfs entry
  devicetree: mfd: max14577: Add device tree bindings document
  power: max17040: Add ID for MAX77836 Fuel Gauge block
  charger: max14577: Configure battery-dependent settings from DTS and sysfs
  ...

Conflicts:
	drivers/power/reset/Kconfig
	drivers/power/reset/Makefile
</content>
</entry>
</feed>
