<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/power, branch v6.3</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=v6.3</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-03-12T22:28:04Z</updated>
<entry>
<title>power: supply: da9150: Fix use after free bug in da9150_charger_remove due to race condition</title>
<updated>2023-03-12T22:28:04Z</updated>
<author>
<name>Zheng Wang</name>
<email>zyytlz.wz@163.com</email>
</author>
<published>2023-03-11T17:46:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=06615d11cc78162dfd5116efb71f29eb29502d37'/>
<id>urn:sha1:06615d11cc78162dfd5116efb71f29eb29502d37</id>
<content type='text'>
In da9150_charger_probe, &amp;charger-&gt;otg_work is bound with
da9150_charger_otg_work. da9150_charger_otg_ncb may be
called to start the work.

If we remove the module which will call da9150_charger_remove
to make cleanup, there may be a unfinished work. The possible
sequence is as follows:

Fix it by canceling the work before cleanup in the da9150_charger_remove

CPU0                  CPUc1

                    |da9150_charger_otg_work
da9150_charger_remove      |
power_supply_unregister  |
device_unregister   |
power_supply_dev_release|
kfree(psy)          |
                    |
                    | 	power_supply_changed(charger-&gt;usb);
                    |   //use

Fixes: c1a281e34dae ("power: Add support for DA9150 Charger")
Signed-off-by: Zheng Wang &lt;zyytlz.wz@163.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: bq24190: Fix use after free bug in bq24190_remove due to race condition</title>
<updated>2023-03-09T23:35:20Z</updated>
<author>
<name>Zheng Wang</name>
<email>zyytlz.wz@163.com</email>
</author>
<published>2023-03-09T17:47:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=47c29d69212911f50bdcdd0564b5999a559010d4'/>
<id>urn:sha1:47c29d69212911f50bdcdd0564b5999a559010d4</id>
<content type='text'>
In bq24190_probe, &amp;bdi-&gt;input_current_limit_work is bound
with bq24190_input_current_limit_work. When external power
changed, it will call bq24190_charger_external_power_changed
 to start the work.

If we remove the module which will call bq24190_remove to make
cleanup, there may be a unfinished work. The possible
sequence is as follows:

CPU0                  CPUc1

                    |bq24190_input_current_limit_work
bq24190_remove      |
power_supply_unregister  |
device_unregister   |
power_supply_dev_release|
kfree(psy)          |
                    |
                    | power_supply_get_property_from_supplier
                    |   //use

Fix it by finishing the work before cleanup in the bq24190_remove

Fixes: 97774672573a ("power_supply: Initialize changed_work before calling device_add")
Signed-off-by: Zheng Wang &lt;zyytlz.wz@163.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: axp288_fuel_gauge: Added check for negative values</title>
<updated>2023-03-09T23:20:43Z</updated>
<author>
<name>Denis Arefev</name>
<email>arefev@swemel.ru</email>
</author>
<published>2022-12-06T09:17:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bf6c880d5d1448489ebf92e2d13d5713ff644930'/>
<id>urn:sha1:bf6c880d5d1448489ebf92e2d13d5713ff644930</id>
<content type='text'>
Variable 'pirq', which may receive negative value
in platform_get_irq().
Used as an index in a function regmap_irq_get_virq().

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Denis Arefev &lt;arefev@swemel.ru&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: cros_usbpd: reclassify "default case!" as debug</title>
<updated>2023-03-09T23:20:43Z</updated>
<author>
<name>Grant Grundler</name>
<email>grundler@chromium.org</email>
</author>
<published>2022-12-12T21:38:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=14c76b2e75bca4d96e2b85a0c12aa43e84fe3f74'/>
<id>urn:sha1:14c76b2e75bca4d96e2b85a0c12aa43e84fe3f74</id>
<content type='text'>
This doesn't need to be printed every second as an error:
...
&lt;3&gt;[17438.628385] cros-usbpd-charger cros-usbpd-charger.3.auto: Port 1: default case!
&lt;3&gt;[17439.634176] cros-usbpd-charger cros-usbpd-charger.3.auto: Port 1: default case!
&lt;3&gt;[17440.640298] cros-usbpd-charger cros-usbpd-charger.3.auto: Port 1: default case!
...

Reduce priority from ERROR to DEBUG.

Signed-off-by: Grant Grundler &lt;grundler@chromium.org&gt;
Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: rk817: Fix unsigned comparison with less than zero</title>
<updated>2023-03-09T23:20:43Z</updated>
<author>
<name>Jiapeng Chong</name>
<email>jiapeng.chong@linux.alibaba.com</email>
</author>
<published>2022-12-14T03:23:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3268a4d9b0b85a4382e93bdf7be5400a73db74c5'/>
<id>urn:sha1:3268a4d9b0b85a4382e93bdf7be5400a73db74c5</id>
<content type='text'>
The tmp is defined as u32 type, which results in invalid processing of
tmp&lt;0 in function rk817_read_or_set_full_charge_on_boot(). Therefore,
drop the comparison.

drivers/power/supply/rk817_charger.c:828 rk817_read_or_set_full_charge_on_boot() warn: unsigned 'tmp' is never less than zero.
drivers/power/supply/rk817_charger.c:788 rk817_read_or_set_full_charge_on_boot() warn: unsigned 'tmp' is never less than zero.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3444
Reported-by: Abaci Robot &lt;abaci@linux.alibaba.com&gt;
Signed-off-by: Jiapeng Chong &lt;jiapeng.chong@linux.alibaba.com&gt;
Tested-by: Chris Morgan &lt;macromorgan@hotmail.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'for-v6.3-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply</title>
<updated>2023-03-04T00:33:28Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2023-03-04T00:33:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0988a0ea791999ebbf95693f2676381825b05033'/>
<id>urn:sha1:0988a0ea791999ebbf95693f2676381825b05033</id>
<content type='text'>
Pull more power supply updates from Sebastian Reichel:

 - Fix DT binding for Richtek RT9467

 - Fix a NULL pointer check in the power-supply core

 - Document meaning of absent "present" property

* tag 'for-v6.3-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply:
  dt-bindings: power: supply: Revise Richtek RT9467 compatible name
  ABI: testing: sysfs-class-power: Document absence of "present" property
  power: supply: fix null pointer check order in __power_supply_register
</content>
</entry>
<entry>
<title>power: supply: qcom_battmgr: remove bogus do_div()</title>
<updated>2023-03-01T18:41:18Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2023-02-14T13:20:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=92304df83b943776492309f42452effea0cc1089'/>
<id>urn:sha1:92304df83b943776492309f42452effea0cc1089</id>
<content type='text'>
The argument to do_div() is a 32-bit integer, and it was read from a
32-bit register so there is no point in doing a 64-bit division on it.

On 32-bit arm, do_div() causes a compile-time warning here:

    include/asm-generic/div64.h:238:22: error: passing argument 1 of '__div64_32' from incompatible pointer type [-Werror=incompatible-pointer-types]
      238 |   __rem = __div64_32(&amp;(n), __base); \
          |                      ^~~~
          |                      |
          |                      unsigned int *
    drivers/power/supply/qcom_battmgr.c:1130:4: note: in expansion of macro 'do_div'
     1130 |    do_div(battmgr-&gt;status.percent, 100);

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Acked-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Reviewed-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'soc-drivers-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc</title>
<updated>2023-02-27T18:04:49Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2023-02-27T18:04:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=11c70529983e8136ea1bd5c32e4f9cd14503c644'/>
<id>urn:sha1:11c70529983e8136ea1bd5c32e4f9cd14503c644</id>
<content type='text'>
Pull ARM SoC driver updates from Arnd Bergmann:
 "As usual, there are lots of minor driver changes across SoC platforms
  from NXP, Amlogic, AMD Zynq, Mediatek, Qualcomm, Apple and Samsung.
  These usually add support for additional chip variations in existing
  drivers, but also add features or bugfixes.

  The SCMI firmware subsystem gains a unified raw userspace interface
  through debugfs, which can be used for validation purposes.

  Newly added drivers include:

   - New power management drivers for StarFive JH7110, Allwinner D1 and
     Renesas RZ/V2M

   - A driver for Qualcomm battery and power supply status

   - A SoC device driver for identifying Nuvoton WPCM450 chips

   - A regulator coupler driver for Mediatek MT81xxv"

* tag 'soc-drivers-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (165 commits)
  power: supply: Introduce Qualcomm PMIC GLINK power supply
  soc: apple: rtkit: Do not copy the reg state structure to the stack
  soc: sunxi: SUN20I_PPU should depend on PM
  memory: renesas-rpc-if: Remove redundant division of dummy
  soc: qcom: socinfo: Add IDs for IPQ5332 and its variant
  dt-bindings: arm: qcom,ids: Add IDs for IPQ5332 and its variant
  dt-bindings: power: qcom,rpmpd: add RPMH_REGULATOR_LEVEL_LOW_SVS_L1
  firmware: qcom_scm: Move qcom_scm.h to include/linux/firmware/qcom/
  MAINTAINERS: Update qcom CPR maintainer entry
  dt-bindings: firmware: document Qualcomm SM8550 SCM
  dt-bindings: firmware: qcom,scm: add qcom,scm-sa8775p compatible
  soc: qcom: socinfo: Add Soc IDs for IPQ8064 and variants
  dt-bindings: arm: qcom,ids: Add Soc IDs for IPQ8064 and variants
  soc: qcom: socinfo: Add support for new field in revision 17
  soc: qcom: smd-rpm: Add IPQ9574 compatible
  soc: qcom: pmic_glink: remove redundant calculation of svid
  soc: qcom: stats: Populate all subsystem debugfs files
  dt-bindings: soc: qcom,rpmh-rsc: Update to allow for generic nodes
  soc: qcom: pmic_glink: add CONFIG_NET/CONFIG_OF dependencies
  soc: qcom: pmic_glink: Introduce altmode support
  ...
</content>
</entry>
<entry>
<title>Merge tag 'for-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply</title>
<updated>2023-02-25T01:04:23Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2023-02-25T01:04:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=39f013440dbf5b1f209eadb3b4665d4f0e840b5b'/>
<id>urn:sha1:39f013440dbf5b1f209eadb3b4665d4f0e840b5b</id>
<content type='text'>
Pull power supply and reset updates from Sebastian Reichel:
 "Nothing special for the power-supply subystem this time.

   - power-supply core: remove faulty cooling logic

   - convert all sysfs show() handlers from *printf() use sysfs_emit()

   - bq25890: add dual-charger support required by Lenovo Yoga Tab 3 Pro

   - bq27xxx: fix reporting critical level

   - syscon-reboot: add priority property support

   - new rt9467 charger driver

   - new rt9471 charger driver

   - new Odroid Go Ultra poweroff driver

   - misc minor fixes and cleanups"

* tag 'for-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (32 commits)
  power: reset: odroid-go-ultra: fix I2C dependency
  power: supply: leds: explicitly include linux/leds.h
  dt-bindings: power: supply: pm8941-coincell: Don't require charging properties
  dt-bindings: power: supply: pm8941-coincell: Add PM8998 compatible
  power: reset: add Odroid Go Ultra poweroff driver
  power: supply: rt9467: Fix spelling mistake "attache" -&gt; "attach"
  power: supply: rt9471: fix using wrong ce_gpio in rt9471_probe()
  power: supply: max77650: Make max77650_charger_disable() return void
  Documentation: power: rt9467: Document exported sysfs entries
  power: supply: rt9467: Add Richtek RT9467 charger driver
  dt-bindings: power: supply: Add Richtek RT9467 battery charger
  Documentation: power: rt9471: Document exported sysfs entries
  power: supply: rt9471: Add Richtek RT9471 charger driver
  dt-bindings: power: supply: Add Richtek RT9471 battery charger
  power: supply: max1721x: Use strscpy() is more robust and safer
  power: supply: test-power: use strscpy() instead of strncpy()
  power: supply: bq27xxx: fix reporting critical level
  power: supply: bq256xx: Init ichg/vbat value with chip default value
  power: supply: collie_battery: Convert to GPIO descriptors (part 2)
  power: supply: remove faulty cooling logic
  ...
</content>
</entry>
<entry>
<title>power: supply: fix null pointer check order in __power_supply_register</title>
<updated>2023-02-25T00:15:03Z</updated>
<author>
<name>qinyu</name>
<email>qinyu32@huawei.com</email>
</author>
<published>2023-02-23T08:10:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bfaecf465a058b167abc7c0dfad985f167ff3af1'/>
<id>urn:sha1:bfaecf465a058b167abc7c0dfad985f167ff3af1</id>
<content type='text'>
There is an null pointer check order issue here: if we have to
check !desc and !desc-&gt;name anyway, check it before dereferencing it in
pr_warn().

Signed-off-by: qinyu &lt;qinyu32@huawei.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
</feed>
