Skip to contentSkip to conversation

MFD for v6.1

GIT PULL Applied Lee Jones 5 participants 12 messages Oct 6, 2022 – Oct 18, 2022

Subsystems (2)
lore
Share & tools
lore

Lee Jones

author maintainer
#0 lore raw

Good morning Linus,

This PR is likely to conflict with Pinctrl.

Please take the changes made here; variable 'base' has been removed.

The following changes since commit 568035b01cfb107af8d2e4bd2fb9aea22cf5b868:

Linux 6.0-rc1 (2022-08-14 15:50:18 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git mfd-next-6.1

for you to fetch changes up to 72a95859728a7866522e6633818bebc1c2519b17:

mfd: syscon: Remove repetition of the regmap_get_val_endian() (2022-09-29 19:06:57 +0100)

----------------------------------------------------------------
- Core Frameworks
- Fix 'mfd_of_node_list' OF node entry resource leak

- New Drivers
- Add support for Ocelot VSC7512 Networking Chip
- Add support for MediaTek MT6370 subPMIC
- Add support for Richtek RT5120 (I2C) PMIC

- New Device Support
- Add support for Rockchip RV1126 and RK3588 to Syscon
- Add support for Rockchip RK817 Battery Charger to RK808
- Add support for Silergy SY7636a Voltage Regulator to Simple MFD
- Add support for Qualcomm PMP8074 PMIC to QCOM SPMI
- Add support for Secure Update to Intel M10 BMC

- New Functionality
- Provide SSP type to Intel's LPSS (PCI) SPI driver

- Fix-ups
- Remove legacy / unused code; stmpe, intel_soc_pmic_crc, syscon
- Unify / simplify; intel_soc_pmic_crc
- Trivial reordering / spelling, etc; Makefile, twl-core
- Convert to managed resources; intel_soc_pmic_crc
- Use appropriate APIs; intel_soc_pmic_crc
- strscpy() conversion; htc-i2cpld, lpc_ich, mfd-core
- GPIOD conversion; htc-i2cpld, stmpe
- Add missing header file includes; twl4030-irq
- DT goodies; stmpe, mediatek,mt6370, x-powers,axp152,

                 aspeed,ast2x00-scu, mediatek,mt8195-scpsys,
		 qcom,spmi-pmic, syscon, qcom,tcsr, rockchip,rk817,
		 sprd,ums512-glbreg, dlg,da9063

- Bug Fixes
- Properly check return values; sm501, htc-i2cpld
- Repair Two-Wire Bus Mode; da9062-core
- Fix error handling; intel_soc_pmic_core, fsl-imx25-tsadc,

                         lp8788, lp8788-irq

----------------------------------------------------------------
Alistair Francis (1):
mfd: silergy,sy7636a: Add config option MFD_SY7636A

Allen-KH Cheng (1):
dt-bindings: mfd: mediatek: Add scpsys compatible for mt8186

Andy Shevchenko (13):
mfd: intel-lpss: Provide an SSP type to the SPI driver
mfd: intel_soc_pmic_crc: Merge Intel PMIC core to crc
mfd: intel_soc_pmic: Move non-Intel Makefile entries to their own group
mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip()
mfd: intel_soc_pmic_crc: Convert to use i2c_get/set_clientdata()
mfd: intel_soc_pmic_crc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
mfd: intel_soc_pmic_crc: Drop redundant ACPI_PTR() and ifdeffery
mfd: intel_soc_pmic_crc: Convert driver to use ->probe_new()
mfd: intel_soc_pmic_crc: Replace intel_soc_pmic with crystal_cove
mfd: intel_soc_pmic_crc: Update the copyright year
mfd: intel_soc_pmic_chtdc_ti: Switch from __maybe_unused to pm_sleep_ptr() etc
mfd: twl4030: Add missed linux/device.h header
mfd: syscon: Remove repetition of the regmap_get_val_endian()

ChiYuan Huang (5):
dt-bindings: mfd: Add MediaTek MT6370
mfd: mt6370: Add MediaTek MT6370 support
mfd: rt5120: Add Richtek PMIC support
dt-binding: mfd: Add Richtek RT5120 PMIC support
dt-bindings: mfd: mt6370: Fix the indentation in the example

Chris Morgan (3):
mfd: rk808: Add Rockchip rk817 battery charger support
dt-bindings: mfd: Add Rockchip rk817 battery charger support
power: supply: Add charger driver for Rockchip RK817

Christophe JAILLET (4):
mfd: intel_soc_pmic: Fix an error handling path in intel_soc_pmic_i2c_probe()
mfd: fsl-imx25: Fix an error handling path in mx25_tsadc_setup_irq()
mfd: lp8788: Fix an error handling path in lp8788_probe()
mfd: lp8788: Fix an error handling path in lp8788_irq_init() and lp8788_irq_init()

Chunyan Zhang (1):
dt-bindings: mfd: sprd: Add bindings for ums512 global registers

Colin Foster (8):
mfd: ocelot: Add helper to get regmap from a resource
net: mdio: mscc-miim: add ability to be used in a non-mmio configuration
pinctrl: ocelot: add ability to be used in a non-mmio configuration
pinctrl: microchip-sgpio: allow sgpio driver to be used as a module
pinctrl: microchip-sgpio: add ability to be used in a non-mmio configuration
resource: add define macro for register address resources
dt-bindings: mfd: ocelot: Add bindings for VSC7512
mfd: ocelot: Add support for the vsc7512 chip via spi

Conor Dooley (1):
dt-bindings: mfd: dlg,da9063: Add missing regulator patterns

Dan Carpenter (1):
mfd: fsl-imx25: Fix check for platform_get_irq() errors

Dmitry Torokhov (1):
mfd: stmpe: Switch to using gpiod API

Francesco Dolcini (2):
mfd: stmpe: Remove rotator block from probe
mfd: stmpe: Probe sub-function by compatible

Jagan Teki (1):
dt-bindings: mfd: syscon: Add Rockchip RV1126 QoS register

Jason Wang (1):
mfd: twl-core: Fix double "to to" in comment.

Jens Hillenstedt (1):
mfd: da9061: Fix Failed to set Two-Wire Bus Mode.

Jiasheng Jiang (1):
mfd: sm501: Add check for platform_driver_register()

Krzysztof Kozlowski (9):
dt-bindings: mfd: qcom,spmi-pmic: Add missing compatibles
dt-bindings: mfd: syscon: Require specific compatible also for simple-mfd
dt-bindings: mfd: qcom,spmi-pmic: Extend example
dt-bindings: mfd: qcom,spmi-pmic: Fix regulator node schema
dt-bindings: mfd: qcom,spmi-pmic: Fix TM ADC node schema on PM8998
dt-bindings: mfd: qcom,tcsr: Add several devices
MAINTAINERS: Drop Robert Jones
dt-bindings: mfd: syscon: Drop ref from reg-io-width
dt-bindings: mfd: qcom,tcsr: Drop simple-mfd from IPQ6018

Linus Walleij (1):
mfd/omap1: htc-i2cpld: Convert to a pure GPIO driver

Luca Weiss (1):
mfd: qcom-spmi-pmic: Add pm7250b compatible

Michal Oleszczyk (1):
mfd: core: Delete corresponding OF node entries from list on MFD removal

Peng Wu (1):
mfd: htc-i2cpld: Fix an IS_ERR() vs NULL bug in htcpld_core_probe()

Rob Herring (2):
dt-bindings: mfd: aspeed,ast2x00-scu: Convert to DT schema format
dt-bindings: mfd: Add missing (unevaluated|additional)Properties on child nodes

Robert Marko (2):
dt-bindings: mfd: qcom-spmi-pmic: Add support for PMP8074
mfd: qcom-spmi-pmic: Add support for PMP8074

Russ Weight (1):
mfd: intel-m10-bmc: Add d5005 bmc secure update driver

Samuel Holland (1):
dt-bindings: mfd: x-powers,axp152: Document the AXP228 variant

Sebastian Reichel (1):
dt-bindings: mfd: syscon: Add rk3588 QoS register compatible

Tinghan Shen (1):
dt-bindings: mfd: mt8195: Add bindings for MediaTek SCPSYS

Wolfram Sang (1):
mfd: Move from strlcpy with unused retval to strscpy

Yang Yingliang (1):
mfd: ocelot-spi: Add missing MODULE_DEVICE_TABLE

 .../bindings/mfd/allwinner,sun6i-a31-prcm.yaml     |   40 +
 .../bindings/mfd/allwinner,sun8i-a23-prcm.yaml     |   10 +
 .../bindings/mfd/aspeed,ast2x00-scu.yaml           |  110 ++
 .../devicetree/bindings/mfd/aspeed-scu.txt         |   48 -
 .../devicetree/bindings/mfd/cirrus,lochnagar.yaml  |    5 +
 .../devicetree/bindings/mfd/dlg,da9063.yaml        |    7 +-
 .../devicetree/bindings/mfd/gateworks-gsc.yaml     |    5 +-
 .../devicetree/bindings/mfd/maxim,max14577.yaml    |    1 +
 .../devicetree/bindings/mfd/maxim,max77843.yaml    |    1 +
 .../devicetree/bindings/mfd/mediatek,mt6370.yaml   |  280 +++++
 .../bindings/mfd/mediatek,mt8195-scpsys.yaml       |   68 ++
 .../devicetree/bindings/mfd/mscc,ocelot.yaml       |  160 +++
 .../devicetree/bindings/mfd/qcom,spmi-pmic.yaml    |  114 +-
 .../devicetree/bindings/mfd/qcom,tcsr.yaml         |   38 +-
 .../devicetree/bindings/mfd/richtek,rt5120.yaml    |  178 +++
 .../devicetree/bindings/mfd/rockchip,rk817.yaml    |   52 +
 .../devicetree/bindings/mfd/silergy,sy7636a.yaml   |    1 +
 .../bindings/mfd/sprd,ums512-glbreg.yaml           |   71 ++
 .../devicetree/bindings/mfd/st,stm32-lptimer.yaml  |    4 +
 .../devicetree/bindings/mfd/st,stm32-timers.yaml   |    3 +
 .../devicetree/bindings/mfd/st,stmfx.yaml          |    1 +
 .../devicetree/bindings/mfd/stericsson,ab8500.yaml |   22 +
 Documentation/devicetree/bindings/mfd/syscon.yaml  |   17 +-
 .../devicetree/bindings/mfd/ti,tps65086.yaml       |    1 +
 .../devicetree/bindings/mfd/x-powers,axp152.yaml   |    4 +
 .../bindings/power/mediatek,power-controller.yaml  |    2 +-
 MAINTAINERS                                        |    8 +-
 arch/arm/boot/dts/tegra30-apalis-v1.1.dtsi         |    2 +-
 arch/arm/boot/dts/tegra30-apalis.dtsi              |    2 +-
 arch/arm/boot/dts/tegra30-colibri.dtsi             |    2 +-
 arch/arm/mach-omap1/board-htcherald.c              |    9 -
 drivers/hwmon/Kconfig                              |    1 +
 drivers/mfd/Kconfig                                |   65 +-
 drivers/mfd/Makefile                               |   15 +-
 drivers/mfd/da9062-core.c                          |    1 +
 drivers/mfd/fsl-imx25-tsadc.c                      |   34 +-
 drivers/mfd/htc-i2cpld.c                           |   60 +-
 drivers/mfd/intel-lpss-pci.c                       |  141 ++-
 drivers/mfd/intel-m10-bmc.c                        |    1 +
 drivers/mfd/intel_soc_pmic_chtdc_ti.c              |    8 +-
 drivers/mfd/intel_soc_pmic_core.c                  |  160 ---
 drivers/mfd/intel_soc_pmic_core.h                  |   25 -
 drivers/mfd/intel_soc_pmic_crc.c                   |  141 ++-
 drivers/mfd/lp8788-irq.c                           |    3 +
 drivers/mfd/lp8788.c                               |   12 +-
 drivers/mfd/lpc_ich.c                              |    2 +-
 drivers/mfd/mfd-core.c                             |    9 +-
 drivers/mfd/mt6370.c                               |  312 +++++
 drivers/mfd/mt6370.h                               |   99 ++
 drivers/mfd/ocelot-core.c                          |  161 +++
 drivers/mfd/ocelot-spi.c                           |  300 +++++
 drivers/mfd/ocelot.h                               |   49 +
 drivers/mfd/qcom-spmi-pmic.c                       |    1 +
 drivers/mfd/rk808.c                                |   16 +-
 drivers/mfd/rt5120.c                               |  124 ++
 drivers/mfd/sm501.c                                |    7 +-
 drivers/mfd/stmpe.c                                |   49 +-
 drivers/mfd/syscon.c                               |    8 -
 drivers/mfd/twl-core.c                             |    2 +-
 drivers/mfd/twl4030-irq.c                          |    1 +
 drivers/net/mdio/mdio-mscc-miim.c                  |   42 +-
 drivers/pinctrl/Kconfig                            |    5 +-
 drivers/pinctrl/pinctrl-microchip-sgpio.c          |   14 +-
 drivers/pinctrl/pinctrl-ocelot.c                   |   16 +-
 drivers/power/supply/Kconfig                       |    6 +
 drivers/power/supply/Makefile                      |    1 +
 drivers/power/supply/rk817_charger.c               | 1211 ++++++++++++++++++++
 drivers/regulator/Kconfig                          |    1 +
 include/dt-bindings/iio/adc/mediatek,mt6370_adc.h  |   18 +
 include/linux/htcpld.h                             |    2 -
 include/linux/ioport.h                             |    5 +
 include/linux/mfd/ocelot.h                         |   62 +
 include/linux/mfd/rk808.h                          |   91 ++
 73 files changed, 4071 insertions(+), 476 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/aspeed,ast2x00-scu.yaml
 delete mode 100644 Documentation/devicetree/bindings/mfd/aspeed-scu.txt
 create mode 100644 Documentation/devicetree/bindings/mfd/mediatek,mt6370.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/mediatek,mt8195-scpsys.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/richtek,rt5120.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/sprd,ums512-glbreg.yaml
 delete mode 100644 drivers/mfd/intel_soc_pmic_core.c
 delete mode 100644 drivers/mfd/intel_soc_pmic_core.h
 create mode 100644 drivers/mfd/mt6370.c
 create mode 100644 drivers/mfd/mt6370.h
 create mode 100644 drivers/mfd/ocelot-core.c
 create mode 100644 drivers/mfd/ocelot-spi.c
 create mode 100644 drivers/mfd/ocelot.h
 create mode 100644 drivers/mfd/rt5120.c
 create mode 100644 drivers/power/supply/rk817_charger.c
 create mode 100644 include/dt-bindings/iio/adc/mediatek,mt6370_adc.h
 create mode 100644 include/linux/mfd/ocelot.h
Signature · 1 line
Lee Jones [李琼斯]
#2 lore raw
In reply to Lee Jones

Hi Lee, Andy,

Quoted 4 lines · Lee Jones

- Remove legacy / unused code; stmpe, intel_soc_pmic_crc, syscon
Andy Shevchenko (13):
mfd: syscon: Remove repetition of the regmap_get_val_endian()

 drivers/mfd/syscon.c                               |    8 -

72a95859728a ("mfd: syscon: Remove repetition of the regmap_get_val_endian()") broke reboot on big endian MIPS VMs. Scroll to the bottom of
https://build.wireguard.com/linux/e8bc52cb8df80c31c73c726ab58ea9746e9ff734/mips.log
to see:

[  243.154570] reboot: Restarting system
[  244.157414] Unable to restart system
[  245.159851] Reboot failed -- System halted

Jason

#3 lore raw

PATCH 1/1 Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"

This reverts commit 72a95859728a7866522e6633818bebc1c2519b17. It broke reboots on big-endian MIPS and MIPS64 malta QEMU instances, which use the syscon driver. Little-endian is not effected, which means likely it's important to handle regmap_get_val_endian() in this function after all.

Cc Lee Jones <[email protected]>
Cc Andy Shevchenko <[email protected]>
Fixes 72a95859728a ("mfd: syscon: Remove repetition of the regmap_get_val_endian()")
---
 drivers/mfd/syscon.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/mfd/syscon.c +8 -0
index 9489e80e905a..bdb2ce7ff03b 100644
@@ -66,6 +66,14 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_clk)
 		goto err_map;
 	}
 
+	/* Parse the device's DT node for an endianness specification */
+	if (of_property_read_bool(np, "big-endian"))
+		syscon_config.val_format_endian = REGMAP_ENDIAN_BIG;
+	else if (of_property_read_bool(np, "little-endian"))
+		syscon_config.val_format_endian = REGMAP_ENDIAN_LITTLE;
+	else if (of_property_read_bool(np, "native-endian"))
+		syscon_config.val_format_endian = REGMAP_ENDIAN_NATIVE;
+
 	/*
 	 * search for reg-io-width property in DT. If it is not provided,
 	 * default to 4 bytes. regmap_init_mmio will return an error if values
Signature · 1 line
2.37.3
#4 lore raw

Re: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"

Quoted 6 lines · Jason A. Donenfeld

This reverts commit 72a95859728a7866522e6633818bebc1c2519b17. It broke reboots on big-endian MIPS and MIPS64 malta QEMU instances, which use the syscon driver. Little-endian is not effected, which means likely it's important to handle regmap_get_val_endian() in this function after all.

Hmm. The revert may indeed be the right thing to do, but we're still early in the release process, so let's go through the channels.

I do note that commit 72a95859728a points to commit 0dbdb76c0ca8 ("regmap: mmio: Parse endianness definitions from DT") as the reason why it's not necessary any more, but that commit

(a) doesn't seem to set config->val_format_endian (which somebody may
care about). It does set the operation pointers etc, but doesn't set that field.

(b) it uses regmap_get_val_endian(), which doesn't actually even look
at the OF properties unless config->val_format_endian is REGMAP_ENDIAN_DEFAULT

so the code that commit 72a95859728a removed was actually quite a bit different from the code in commit 0dbdb76c0ca8.

Maybe the problem is related to those semantic differences, and is easy to fix for somebody who knows what the heck that stuff is doing.

And if not, please just send me the revert through the normal channels. Ok?

Linus

#5 lore raw

Re: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"

Quoted 11 lines · Linus Torvalds
Quoted 6 lines · Jason A. Donenfeld

This reverts commit 72a95859728a7866522e6633818bebc1c2519b17. It broke reboots on big-endian MIPS and MIPS64 malta QEMU instances, which use the syscon driver. Little-endian is not effected, which means likely it's important to handle regmap_get_val_endian() in this function after all.

Hmm. The revert may indeed be the right thing to do, but we're still early in the release process, so let's go through the channels.

Quoted 7 lines

I do note that commit 72a95859728a points to commit 0dbdb76c0ca8 ("regmap: mmio: Parse endianness definitions from DT") as the reason why it's not necessary any more, but that commit

(a) doesn't seem to set config->val_format_endian (which somebody may
care about). It does set the operation pointers etc, but doesn't set that field.

It should.

of_syscon_register() calls to regmap_init_mmio() with syscon_config data structure as a parameter.

Before 72a95859728a the of_syscon_register() fills the val_format_endian with something it parses from DT. After that commit the default value (0) is REGMAP_ENDIAN_DEFAULT. Now when __regmap_init_mmio_clk() is called it creates a context base on DT since the field is 0.

Quoted 3 lines

(b) it uses regmap_get_val_endian(), which doesn't actually even look
at the OF properties unless config->val_format_endian is REGMAP_ENDIAN_DEFAULT

Which is 0!

Quoted 5 lines

so the code that commit 72a95859728a removed was actually quite a bit different from the code in commit 0dbdb76c0ca8.

Maybe the problem is related to those semantic differences, and is easy to fix for somebody who knows what the heck that stuff is doing.

But while looking into this, I think I know what is going on, of_syscon_register() calls regmap API with dev == NULL, hence fwnode == NULL, hence nothing to read from DT.

But default (via regmap bus configuration) is LE and LE works fine.

Quoted 1 line

And if not, please just send me the revert through the normal channels. Ok?

Yeah, revert is a good move here.

For real deduplication we need to either add a regmap_get_val_endian() kind that takes fwnode as a parameter and call it explicitly or propagate fwnode to __regmap_init_mmio_clk() somehow.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author maintainer
#6 lore raw

Re: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"

Quoted 3 lines · Andy Shevchenko
Quoted 1 line

And if not, please just send me the revert through the normal channels. Ok?

Yeah, revert is a good move here.

Thanks for the clarification Andy.

Linus, by normal channels, do you mean you'd like a follow-up PR?

Signature · 1 line
Lee Jones [李琼斯]
#7 lore raw

Re: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"

Quoted 8 lines · Lee Jones
Quoted 3 lines · Andy Shevchenko
Quoted 1 line

And if not, please just send me the revert through the normal channels. Ok?

Yeah, revert is a good move here.

Thanks for the clarification Andy.

Linus, by normal channels, do you mean you'd like a follow-up PR?

I would assume so.

What happened here is that I sent you (Lee) and Andy this patch, but also had Linus in the recipient list because I sent this as a reply to my initial message on the pull request thread, creating some ambiguity. Sometimes when Linus is on the CC like that, it's an indication that he's to take it directly. That's not the plan here. Rather, I think the idea is that you can queue it up in your tree, and send it out with the next PR of fixes for 6.1.

Jason

author maintainer
#8 lore raw

Re: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"

In reply to Andy Shevchenko
Quoted 46 lines · Andy Shevchenko
Quoted 11 lines · Linus Torvalds
Quoted 6 lines · Jason A. Donenfeld

This reverts commit 72a95859728a7866522e6633818bebc1c2519b17. It broke reboots on big-endian MIPS and MIPS64 malta QEMU instances, which use the syscon driver. Little-endian is not effected, which means likely it's important to handle regmap_get_val_endian() in this function after all.

Hmm. The revert may indeed be the right thing to do, but we're still early in the release process, so let's go through the channels.

Quoted 7 lines

I do note that commit 72a95859728a points to commit 0dbdb76c0ca8 ("regmap: mmio: Parse endianness definitions from DT") as the reason why it's not necessary any more, but that commit

(a) doesn't seem to set config->val_format_endian (which somebody may
care about). It does set the operation pointers etc, but doesn't set that field.

It should.

of_syscon_register() calls to regmap_init_mmio() with syscon_config data structure as a parameter.

Before 72a95859728a the of_syscon_register() fills the val_format_endian with something it parses from DT. After that commit the default value (0) is REGMAP_ENDIAN_DEFAULT. Now when __regmap_init_mmio_clk() is called it creates a context base on DT since the field is 0.

Quoted 3 lines

(b) it uses regmap_get_val_endian(), which doesn't actually even look
at the OF properties unless config->val_format_endian is REGMAP_ENDIAN_DEFAULT

Which is 0!

Quoted 5 lines

so the code that commit 72a95859728a removed was actually quite a bit different from the code in commit 0dbdb76c0ca8.

Maybe the problem is related to those semantic differences, and is easy to fix for somebody who knows what the heck that stuff is doing.

But while looking into this, I think I know what is going on, of_syscon_register() calls regmap API with dev == NULL, hence fwnode == NULL, hence nothing to read from DT.

Quoted 5 lines

But default (via regmap bus configuration) is LE and LE works fine.

Quoted 1 line

And if not, please just send me the revert through the normal channels. Ok?

Yeah, revert is a good move here.

Could you review and provide a tag for the revert patch please?

Signature · 1 line
Lee Jones [李琼斯]
#9 lore raw

Re: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"

Quoted 2 lines · Lee Jones
Quoted 1 line · Andy Shevchenko

On Sat, Oct 08, 2022 at 09:45:16AM -0700, Linus Torvalds wrote:

...

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

And if not, please just send me the revert through the normal channels. Ok?

Yeah, revert is a good move here.

Could you review and provide a tag for the revert patch please?

Done.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
Reviewed-by on v1 1/1
#10 lore raw

Re: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"

In reply to Jason A. Donenfeld
Quoted 5 lines · Jason A. Donenfeld

This reverts commit 72a95859728a7866522e6633818bebc1c2519b17. It broke reboots on big-endian MIPS and MIPS64 malta QEMU instances, which use the syscon driver. Little-endian is not effected, which means likely it's important to handle regmap_get_val_endian() in this function after all.

as per discussion and analysis that shows that syscon needs that code because it calls regmap_init_mmio() with dev == NULL.

Quoted 31 lines
Cc Lee Jones <[email protected]>
Cc Andy Shevchenko <[email protected]>
Fixes 72a95859728a ("mfd: syscon: Remove repetition of the regmap_get_val_endian()")
---
 drivers/mfd/syscon.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/mfd/syscon.c +8 -0
index 9489e80e905a..bdb2ce7ff03b 100644
@@ -66,6 +66,14 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_clk)
 		goto err_map;
 	}
 
+	/* Parse the device's DT node for an endianness specification */
+	if (of_property_read_bool(np, "big-endian"))
+		syscon_config.val_format_endian = REGMAP_ENDIAN_BIG;
+	else if (of_property_read_bool(np, "little-endian"))
+		syscon_config.val_format_endian = REGMAP_ENDIAN_LITTLE;
+	else if (of_property_read_bool(np, "native-endian"))
+		syscon_config.val_format_endian = REGMAP_ENDIAN_NATIVE;
+
 	/*
 	 * search for reg-io-width property in DT. If it is not provided,
 	 * default to 4 bytes. regmap_init_mmio will return an error if values
Signature · 1 line
2.37.3
Signature · 2 lines
With Best Regards,
Andy Shevchenko
author maintainer Applied
#11 lore raw

Re: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"

In reply to Jason A. Donenfeld
Quoted 6 lines · Jason A. Donenfeld

This reverts commit 72a95859728a7866522e6633818bebc1c2519b17. It broke reboots on big-endian MIPS and MIPS64 malta QEMU instances, which use the syscon driver. Little-endian is not effected, which means likely it's important to handle regmap_get_val_endian() in this function after all.

Quoted 7 lines
Cc Lee Jones <[email protected]>
Cc Andy Shevchenko <[email protected]>
Fixes 72a95859728a ("mfd: syscon: Remove repetition of the regmap_get_val_endian()")
---
 drivers/mfd/syscon.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Applied, thanks.

Signature · 1 line
Lee Jones [李琼斯]