<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/regulator, branch v6.2</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.2</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-01-03T15:54:38Z</updated>
<entry>
<title>regulator: qcom-rpmh: PM8550 ldo11 regulator is an nldo</title>
<updated>2023-01-03T15:54:38Z</updated>
<author>
<name>Neil Armstrong</name>
<email>neil.armstrong@linaro.org</email>
</author>
<published>2023-01-02T11:23:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f528fe213a6ad21a6e8644dbd5de10dc264a89fd'/>
<id>urn:sha1:f528fe213a6ad21a6e8644dbd5de10dc264a89fd</id>
<content type='text'>
This fixes the definition of the PM8550 ldo11 regulator matching it's
capabilities since this LDO is designed to work between 1,2V and 1,5V.

Fixes: e6e3776d682d ("regulator: qcom-rpmh: Add support for PM8550 regulators")
Signed-off-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt;
Reviewed-by: Abel Vesa &lt;abel.vesa@linaro.org&gt;
Link: https://lore.kernel.org/r/20230102-topic-sm8550-upstream-fixes-reg-l11b-nldo-v1-1-d97def246338@linaro.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regulator: Merge up forgotten fix</title>
<updated>2022-12-27T17:42:08Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2022-12-27T17:42:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=74ad47c9cecf12e647061107d9f3858d82e0e5c5'/>
<id>urn:sha1:74ad47c9cecf12e647061107d9f3858d82e0e5c5</id>
<content type='text'>
I forgot to send this fix during the 6.1 cycle, make sure it gets sent
for 6.2.
</content>
</entry>
<entry>
<title>Merge tag 'regulator-fix-v6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator</title>
<updated>2022-12-23T22:38:00Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-12-23T22:38:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0a023cbb11e3d05c39dbb67317cb77ef22d47404'/>
<id>urn:sha1:0a023cbb11e3d05c39dbb67317cb77ef22d47404</id>
<content type='text'>
Pull regulator fixes from Mark Brown:
 "Two core fixes here, one for a long standing race which some Qualcomm
  systems have started triggering with their UFS driver and another
  fixing a problem with supply lookup introduced by the fixes for devm
  related use after free issues that were introduced in this merge
  window"

* tag 'regulator-fix-v6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: core: fix deadlock on regulator enable
  regulator: core: Fix resolve supply lookup issue
</content>
</entry>
<entry>
<title>regulator: core: fix deadlock on regulator enable</title>
<updated>2022-12-15T11:56:26Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan+linaro@kernel.org</email>
</author>
<published>2022-12-15T10:46:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cb3543cff90a4448ed560ac86c98033ad5fecda9'/>
<id>urn:sha1:cb3543cff90a4448ed560ac86c98033ad5fecda9</id>
<content type='text'>
When updating the operating mode as part of regulator enable, the caller
has already locked the regulator tree and drms_uA_update() must not try
to do the same in order not to trigger a deadlock.

The lock inversion is reported by lockdep as:

  ======================================================
  WARNING: possible circular locking dependency detected
  6.1.0-next-20221215 #142 Not tainted
  ------------------------------------------------------
  udevd/154 is trying to acquire lock:
  ffffc11f123d7e50 (regulator_list_mutex){+.+.}-{3:3}, at: regulator_lock_dependent+0x54/0x280

  but task is already holding lock:
  ffff80000e4c36e8 (regulator_ww_class_acquire){+.+.}-{0:0}, at: regulator_enable+0x34/0x80

  which lock already depends on the new lock.

  ...

   Possible unsafe locking scenario:

         CPU0                    CPU1
         ----                    ----
    lock(regulator_ww_class_acquire);
                                 lock(regulator_list_mutex);
                                 lock(regulator_ww_class_acquire);
    lock(regulator_list_mutex);

   *** DEADLOCK ***

just before probe of a Qualcomm UFS controller (occasionally) deadlocks
when enabling one of its regulators.

Fixes: 9243a195be7a ("regulator: core: Change voltage setting path")
Fixes: f8702f9e4aa7 ("regulator: core: Use ww_mutex for regulators locking")
Cc: stable@vger.kernel.org      # 5.0
Signed-off-by: Johan Hovold &lt;johan+linaro@kernel.org&gt;
Link: https://lore.kernel.org/r/20221215104646.19818-1-johan+linaro@kernel.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regulator: core: Fix resolve supply lookup issue</title>
<updated>2022-12-14T13:36:45Z</updated>
<author>
<name>ChiYuan Huang</name>
<email>cy_huang@richtek.com</email>
</author>
<published>2022-12-14T01:37:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0debed5b117d11e33cba52870c4dcb64f5911891'/>
<id>urn:sha1:0debed5b117d11e33cba52870c4dcb64f5911891</id>
<content type='text'>
From Marek's log, the previous change modify the parent of rdev.
https://lore.kernel.org/all/58b92e75-f373-dae7-7031-8abd465bb874@samsung.com/

In 'regulator_resolve_supply', it uses the parent DT node of rdev as the
DT-lookup starting node. But the parent DT node may not exist. This will
cause the NULL supply issue.

This patch modify the parent of rdev back to the device that provides
from 'regulator_config' in 'regulator_register'.

Fixes: 8f3cbcd6b440 ("regulator: core: Use different devices for resource allocation and DT lookup")
Reported-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Tested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: ChiYuan Huang &lt;cy_huang@richtek.com&gt;
Link: https://lore.kernel.org/r/1670981831-12583-1-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'regulator-v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator</title>
<updated>2022-12-13T20:49:59Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-12-13T20:49:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c5589c436d4646e0dc23f64264db8e04cf67c88f'/>
<id>urn:sha1:c5589c436d4646e0dc23f64264db8e04cf67c88f</id>
<content type='text'>
Pull regulator updates from Mark Brown:
 "Quite a quiet release for regulator, the diffstat is dominated by the
  I2C migration to probe_new() and the newly added MT6357 driver. We've
  just one framework addition and the rest is all new device support,
  fixes and cleanups.

  The framework addition is an API for requesting all regulators defined
  in DT, this isn't great practice but has reasonable applications when
  there is generic code handling devices on buses where the bus
  specification doesn't include power. The immediate application is MDIO
  but I believe there's others, it's another API that'll need an eye
  keeping on it for undesirable usage.

  Summary:

    - An API for requesting all regulators defined in DT

    - Conversion of lots of drivers to the I2C probe_new() API

    - Support for Mediatek MT6357, Qualcomm PM8550, PMR735a and Richtek
      RT6190"

* tag 'regulator-v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (56 commits)
  regulator: core: Use different devices for resource allocation and DT lookup
  dt-bindings: Add missing 'unevaluatedProperties' to regulator nodes
  regulator: qcom-labibb: Fix missing of_node_put() in qcom_labibb_regulator_probe()
  regulator: add mt6357 regulator
  regulator: dt-bindings: Add binding schema for mt6357 regulators
  regulator: core: fix resource leak in regulator_register()
  regulator: core: fix module refcount leak in set_supply()
  regulator: core: fix use_count leakage when handling boot-on
  regulator: rk808: Use dev_err_probe
  regulator: rk808: reduce 'struct rk808' usage
  regulator: Drop obsolete dependencies on COMPILE_TEST
  regulator: pv88080-regulator: Convert to i2c's .probe_new()
  regulator: pfuze100-regulator: Convert to i2c's .probe_new()
  regulator: isl6271a-regulator: Convert to i2c's .probe_new()
  regulator: fan53555: Convert to i2c's .probe_new()
  regulator: act8865-regulator: Convert to i2c's .probe_new()
  regulator: qcom-rpmh: Add support for PM8550 regulators
  regulator: dt-bindings: qcom,rpmh: Add compatible for PM8550
  regulator: tps65023-regulator: Convert to i2c's .probe_new()
  regulator: tps62360-regulator: Convert to i2c's .probe_new()
  ...
</content>
</entry>
<entry>
<title>regulator: core: Use different devices for resource allocation and DT lookup</title>
<updated>2022-12-08T13:02:37Z</updated>
<author>
<name>ChiYuan Huang</name>
<email>cy_huang@richtek.com</email>
</author>
<published>2022-12-06T07:22:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8f3cbcd6b440032ebc7f7d48a1689dcc70a4eb98'/>
<id>urn:sha1:8f3cbcd6b440032ebc7f7d48a1689dcc70a4eb98</id>
<content type='text'>
Following by the below discussion, there's the potential UAF issue
between regulator and mfd.
https://lore.kernel.org/all/20221128143601.1698148-1-yangyingliang@huawei.com/

From the analysis of Yingliang

CPU A				|CPU B
mt6370_probe()			|
  devm_mfd_add_devices()	|
				|mt6370_regulator_probe()
				|  regulator_register()
				|    //allocate init_data and add it to devres
				|    regulator_of_get_init_data()
i2c_unregister_device()		|
  device_del()			|
    devres_release_all()	|
      // init_data is freed	|
      release_nodes()		|
				|  // using init_data causes UAF
				|  regulator_register()

It's common to use mfd core to create child device for the regulator.
In order to do the DT lookup for init data, the child that registered
the regulator would pass its parent as the parameter. And this causes
init data resource allocated to its parent, not itself. The issue happen
when parent device is going to release and regulator core is still doing
some operation of init data constraint for the regulator of child device.

To fix it, this patch expand 'regulator_register' API to use the
different devices for init data allocation and DT lookup.

Reported-by: Yang Yingliang &lt;yangyingliang@huawei.com&gt;
Signed-off-by: ChiYuan Huang &lt;cy_huang@richtek.com&gt;
Link: https://lore.kernel.org/r/1670311341-32664-1-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regulator: qcom-labibb: Fix missing of_node_put() in qcom_labibb_regulator_probe()</title>
<updated>2022-12-07T14:19:18Z</updated>
<author>
<name>Yuan Can</name>
<email>yuancan@huawei.com</email>
</author>
<published>2022-12-03T06:21:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cf34ac6aa2b12fb0c3aacfdcae8acd7904b949ec'/>
<id>urn:sha1:cf34ac6aa2b12fb0c3aacfdcae8acd7904b949ec</id>
<content type='text'>
The reg_node needs to be released through of_node_put() in the error
handling path when of_irq_get_byname() failed.

Fixes: 390af53e0411 ("regulator: qcom-labibb: Implement short-circuit and over-current IRQs")
Signed-off-by: Yuan Can &lt;yuancan@huawei.com&gt;
Link: https://lore.kernel.org/r/20221203062109.115043-1-yuancan@huawei.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>Add MediaTek MT6357 PMIC support</title>
<updated>2022-12-02T13:53:13Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2022-12-02T13:53:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1d2633848e742be3e4dc2a7c064088a18b4756d8'/>
<id>urn:sha1:1d2633848e742be3e4dc2a7c064088a18b4756d8</id>
<content type='text'>
Merge series from Alexandre Mergnat &lt;amergnat@baylibre.com&gt;:

This adds regulator support for the MT6357 PMIC.
</content>
</entry>
<entry>
<title>regulator: add mt6357 regulator</title>
<updated>2022-12-02T12:23:19Z</updated>
<author>
<name>Fabien Parent</name>
<email>fparent@baylibre.com</email>
</author>
<published>2022-11-29T15:57:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dafc7cde23dca239987d3cd000b11cdccc3728ea'/>
<id>urn:sha1:dafc7cde23dca239987d3cd000b11cdccc3728ea</id>
<content type='text'>
Add regulator driver for the MT6357 PMIC.

Signed-off-by: Fabien Parent &lt;fparent@baylibre.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Signed-off-by: Alexandre Mergnat &lt;amergnat@baylibre.com&gt;
Link: https://lore.kernel.org/r/20221005-mt6357-support-v7-7-477e60126749@baylibre.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
</feed>
