mbox series

[v2,0/7] Really implement Qualcomm LAB/IBB regulators

Message ID 20210113194214.522238-1-angelogioacchino.delregno@somainline.org
Headers show
Series Really implement Qualcomm LAB/IBB regulators | expand

Message

AngeloGioacchino Del Regno Jan. 13, 2021, 7:42 p.m. UTC
Okay, the title may be a little "aggressive"? However, the qcom-labibb
driver wasn't really .. doing much.
The current form of this driver is only taking care of enabling or
disabling the regulators, which is pretty useless if they were not
pre-set from the bootloader, which sets them only if continuous
splash is enabled.
Moreover, some bootloaders are setting a higher voltage and/or a higher
current limit compared to what's actually required by the attached
hardware (which is, in 99.9% of the cases, a display) and this produces
a higher power consumption, higher heat output and a risk of actually
burning the display if kept up for a very long time: for example, this
is true on at least some Sony Xperia MSM8998 (Yoshino platform) and
especially on some Sony Xperia SDM845 (Tama platform) smartphones.

In any case, the main reason why this change was necessary for us is
that, during the bringup of Sony Xperia MSM8998 phones, we had an issue
with the bootloader not turning on the display and not setting the lab
and ibb regulators before booting the kernel, making it impossible to
powerup the display.

With this said, this patchset enables setting voltage, current limiting,
overcurrent and short-circuit protection.. and others, on the LAB/IBB
regulators.
Each commit in this patch series provides as many informations as
possible about what's going on and testing methodology.

Changes in v2:
 - From Mark Brown review:
   - Replaced some if branches with switch statements
   - Moved irq get and request in probe function
   - Changed short conditionals to full ones
   - Removed useless check for ocp_irq_requested
 -  Fixed issues with YAML documentation

AngeloGioacchino Del Regno (7):
  regulator: qcom-labibb: Implement voltage selector ops
  regulator: qcom-labibb: Implement current limiting
  regulator: qcom-labibb: Implement pull-down, softstart, active
    discharge
  dt-bindings: regulator: qcom-labibb: Document soft start properties
  regulator: qcom-labibb: Implement short-circuit and over-current IRQs
  dt-bindings: regulator: qcom-labibb: Document SCP/OCP interrupts
  arm64: dts: pmi8998: Add the right interrupts for LAB/IBB SCP and OCP

 .../regulator/qcom-labibb-regulator.yaml      |  30 +-
 arch/arm64/boot/dts/qcom/pmi8998.dtsi         |   8 +-
 drivers/regulator/qcom-labibb-regulator.c     | 661 +++++++++++++++++-
 3 files changed, 686 insertions(+), 13 deletions(-)

Comments

Mark Brown Jan. 15, 2021, 6:19 p.m. UTC | #1
On Wed, 13 Jan 2021 20:42:07 +0100, AngeloGioacchino Del Regno wrote:
> Okay, the title may be a little "aggressive"? However, the qcom-labibb

> driver wasn't really .. doing much.

> The current form of this driver is only taking care of enabling or

> disabling the regulators, which is pretty useless if they were not

> pre-set from the bootloader, which sets them only if continuous

> splash is enabled.

> Moreover, some bootloaders are setting a higher voltage and/or a higher

> current limit compared to what's actually required by the attached

> hardware (which is, in 99.9% of the cases, a display) and this produces

> a higher power consumption, higher heat output and a risk of actually

> burning the display if kept up for a very long time: for example, this

> is true on at least some Sony Xperia MSM8998 (Yoshino platform) and

> especially on some Sony Xperia SDM845 (Tama platform) smartphones.

> 

> [...]


Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/7] regulator: qcom-labibb: Implement voltage selector ops
      commit: dd582369c6c1f39ec475af6191a934f3e57fda35

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
AngeloGioacchino Del Regno Jan. 15, 2021, 7:15 p.m. UTC | #2
Il 15/01/21 19:19, Mark Brown ha scritto:
> On Wed, 13 Jan 2021 20:42:07 +0100, AngeloGioacchino Del Regno wrote:
>> Okay, the title may be a little "aggressive"? However, the qcom-labibb
>> driver wasn't really .. doing much.
>> The current form of this driver is only taking care of enabling or
>> disabling the regulators, which is pretty useless if they were not
>> pre-set from the bootloader, which sets them only if continuous
>> splash is enabled.
>> Moreover, some bootloaders are setting a higher voltage and/or a higher
>> current limit compared to what's actually required by the attached
>> hardware (which is, in 99.9% of the cases, a display) and this produces
>> a higher power consumption, higher heat output and a risk of actually
>> burning the display if kept up for a very long time: for example, this
>> is true on at least some Sony Xperia MSM8998 (Yoshino platform) and
>> especially on some Sony Xperia SDM845 (Tama platform) smartphones.
>>
>> [...]
> 
> Applied to
> 
>     https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
> 
> Thanks!
> 
> [1/7] regulator: qcom-labibb: Implement voltage selector ops
>        commit: dd582369c6c1f39ec475af6191a934f3e57fda35
> 
> All being well this means that it will be integrated into the linux-next
> tree (usually sometime in the next 24 hours) and sent to Linus during
> the next merge window (or sooner if it is a bug fix), however if
> problems are discovered then the patch may be dropped or reverted.
> 
> You may get further e-mails resulting from automated or manual testing
> and review of the tree, please engage with people reporting problems and
> send followup patches addressing any issues that are reported if needed.
> 
> If any updates are required or you are submitting further changes they
> should be sent as incremental updates against current git, existing
> patches will not be replaced.
> 
> Please add any relevant lists and maintainers to the CCs when replying
> to this mail.
> 
> Thanks,
> Mark
> 

Hello Mark,

Thanks for applying the commit, however, I feel like reminding you that 
setting voltage on this regulator without setting a current limit is 
really unsafe (at least, from many, many experiments) so, to ensure the 
entire safety of this code and the hardware that's attached to these 
regulators you should, please, either apply the entire series, or nothing.

My concerns are only about keeping LAB and IBB safe for everyone's hardware.

Thank you again
-- Angelo