Message ID | 20220829164952.2672848-1-dianders@chromium.org |
---|---|
Headers | show |
Series | arm64: dts: qcom: Fix broken regulator spec on RPMH boards | expand |
On Wed, Aug 31, 2022 at 07:52:52AM -0700, Doug Anderson wrote: > Hi, > > On Tue, Aug 30, 2022 at 11:47 PM Johan Hovold <johan@kernel.org> wrote: > > > > On Mon, Aug 29, 2022 at 09:49:46AM -0700, Douglas Anderson wrote: > > > Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement > > > get_optimum_mode(), not set_load()") several boards were able to > > > change their regulator mode even though they had nothing listed in > > > "regulator-allowed-modes". After that commit (and fixes [1]) we'll be > > > stuck at the initial mode. Discussion of this (again, see [1]) has > > > resulted in the decision that the old dts files were wrong and should > > > be fixed to fully restore old functionality. > > > > > > This series attempts to fix everyone. I've kept each board in a > > > separate patch to make stable / backports work easier. > > > > Should you also update the bindings so that this can be caught during > > devicetree validation? That is, to always require > > "regulator-allowed-modes" when "regulator-allow-set-load" is specified. > > Yeah, it's probably a good idea. I'm happy to review a patch that does > that. I'm already quite a few patches deep of submitting random > cleanups because someone mentioned it in a code review. ;-) That's > actually how I got in this mess to begin with. The RPMH change was in > response to a request in a different code review. ...and that came > about in a code review that was posted in response to a comment about > how awkward setting regulator loads was... Need to get back to my day > job. Heh. > In any case, I think these dts patches are ready to land now. Yeah, as the old dtbs are now broken with newer kernels these are indeed needed. But regardless of the question of backwards compatibility, it seems that the bindings should at least reflect that the old DTs are now considered malformed. > > Perhaps at least for RPMh as it seemed you found some cases were this > > wasn't currently needed (even if that sounded like an Linux-specific > > implementation detail). > > I think you're talking about the RPM vs. RPMH difference? It's > actually not Linux specific. In RPM the API to the "hardware" > (actually a remote processor) is to pass the load. In RPMH the API to > the hardware is to pass a mode. This is why RPMH has > "regulator-allowed-modes" and "regulator-initial-mode". Both RPM and > RPMH have "regulator-allow-set-load" though... Ah, ok. And this was only an issue for Qualcomm DTs, which are the only users of "regulator-allow-set-load" in mainline. Johan
Hi, On Thu, Sep 1, 2022 at 8:52 AM Johan Hovold <johan@kernel.org> wrote: > > On Wed, Aug 31, 2022 at 07:52:52AM -0700, Doug Anderson wrote: > > Hi, > > > > On Tue, Aug 30, 2022 at 11:47 PM Johan Hovold <johan@kernel.org> wrote: > > > > > > On Mon, Aug 29, 2022 at 09:49:46AM -0700, Douglas Anderson wrote: > > > > Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement > > > > get_optimum_mode(), not set_load()") several boards were able to > > > > change their regulator mode even though they had nothing listed in > > > > "regulator-allowed-modes". After that commit (and fixes [1]) we'll be > > > > stuck at the initial mode. Discussion of this (again, see [1]) has > > > > resulted in the decision that the old dts files were wrong and should > > > > be fixed to fully restore old functionality. > > > > > > > > This series attempts to fix everyone. I've kept each board in a > > > > separate patch to make stable / backports work easier. > > > > > > Should you also update the bindings so that this can be caught during > > > devicetree validation? That is, to always require > > > "regulator-allowed-modes" when "regulator-allow-set-load" is specified. > > > > Yeah, it's probably a good idea. I'm happy to review a patch that does > > that. I'm already quite a few patches deep of submitting random > > cleanups because someone mentioned it in a code review. ;-) That's > > actually how I got in this mess to begin with. The RPMH change was in > > response to a request in a different code review. ...and that came > > about in a code review that was posted in response to a comment about > > how awkward setting regulator loads was... Need to get back to my day > > job. > > Heh. > > > In any case, I think these dts patches are ready to land now. > > Yeah, as the old dtbs are now broken with newer kernels these are indeed > needed. With the latest patches in the regulator tree things shouldn't be _too_ broken even without the dts files. Essentially things will get stuck at their initial mode (HPM). So without these patches things should all still boot but could possibly end up at a higher power state. -Doug
On Thu, Sep 01, 2022 at 05:44:03PM -0700, Doug Anderson wrote: > Hi, > > On Thu, Sep 1, 2022 at 8:52 AM Johan Hovold <johan@kernel.org> wrote: > > > > On Wed, Aug 31, 2022 at 07:52:52AM -0700, Doug Anderson wrote: > > > Hi, > > > > > > On Tue, Aug 30, 2022 at 11:47 PM Johan Hovold <johan@kernel.org> wrote: > > > > > > > > On Mon, Aug 29, 2022 at 09:49:46AM -0700, Douglas Anderson wrote: > > > > > Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement > > > > > get_optimum_mode(), not set_load()") several boards were able to > > > > > change their regulator mode even though they had nothing listed in > > > > > "regulator-allowed-modes". After that commit (and fixes [1]) we'll be > > > > > stuck at the initial mode. Discussion of this (again, see [1]) has > > > > > resulted in the decision that the old dts files were wrong and should > > > > > be fixed to fully restore old functionality. > > > > > > > > > > This series attempts to fix everyone. I've kept each board in a > > > > > separate patch to make stable / backports work easier. > > > > > > > > Should you also update the bindings so that this can be caught during > > > > devicetree validation? That is, to always require > > > > "regulator-allowed-modes" when "regulator-allow-set-load" is specified. > > > > > > Yeah, it's probably a good idea. I'm happy to review a patch that does > > > that. I'm already quite a few patches deep of submitting random > > > cleanups because someone mentioned it in a code review. ;-) That's > > > actually how I got in this mess to begin with. The RPMH change was in > > > response to a request in a different code review. ...and that came > > > about in a code review that was posted in response to a comment about > > > how awkward setting regulator loads was... Need to get back to my day > > > job. > > > > Heh. > > > > > In any case, I think these dts patches are ready to land now. > > > > Yeah, as the old dtbs are now broken with newer kernels these are indeed > > needed. > > With the latest patches in the regulator tree things shouldn't be > _too_ broken even without the dts files. Essentially things will get > stuck at their initial mode (HPM). So without these patches things > should all still boot but could possibly end up at a higher power > state. Ok, and there's also a warning during boot when that happens so that it's not a silent regression? Johan
On Wed, Aug 31, 2022 at 02:00:18PM -0500, Andrew Halaney wrote: > On Wed, Aug 31, 2022 at 07:52:52AM -0700, Doug Anderson wrote: > > Hi, > > > > On Tue, Aug 30, 2022 at 11:47 PM Johan Hovold <johan@kernel.org> wrote: > > > > > > On Mon, Aug 29, 2022 at 09:49:46AM -0700, Douglas Anderson wrote: > > > > Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement > > > > get_optimum_mode(), not set_load()") several boards were able to > > > > change their regulator mode even though they had nothing listed in > > > > "regulator-allowed-modes". After that commit (and fixes [1]) we'll be > > > > stuck at the initial mode. Discussion of this (again, see [1]) has > > > > resulted in the decision that the old dts files were wrong and should > > > > be fixed to fully restore old functionality. > > > > > > > > This series attempts to fix everyone. I've kept each board in a > > > > separate patch to make stable / backports work easier. > > > > > > Should you also update the bindings so that this can be caught during > > > devicetree validation? That is, to always require > > > "regulator-allowed-modes" when "regulator-allow-set-load" is specified. > > > > Yeah, it's probably a good idea. I'm happy to review a patch that does > > that. I'm already quite a few patches deep of submitting random > > cleanups because someone mentioned it in a code review. ;-) That's > > actually how I got in this mess to begin with. The RPMH change was in > > response to a request in a different code review. ...and that came > > about in a code review that was posted in response to a comment about > > how awkward setting regulator loads was... Need to get back to my day > > job. > > I can take a stab at this during the week here I hope.. I owe Doug for > the slew of patches and have wanted to peek at how all the dt-binding > validation stuff works anyways. > Here's my attempt after a couple hours of banging the head on the wall: https://lore.kernel.org/all/20220902185148.635292-1-ahalaney@redhat.com/ Thanks, Andrew