linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] MFD for v6.1
@ 2022-10-06  9:02 Lee Jones
  2022-10-07 19:20 ` pr-tracker-bot
  2022-10-08 15:39 ` Jason A. Donenfeld
  0 siblings, 2 replies; 12+ messages in thread
From: Lee Jones @ 2022-10-06  9:02 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel Mailing List

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

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [GIT PULL] MFD for v6.1
  2022-10-06  9:02 [GIT PULL] MFD for v6.1 Lee Jones
@ 2022-10-07 19:20 ` pr-tracker-bot
  2022-10-08 15:39 ` Jason A. Donenfeld
  1 sibling, 0 replies; 12+ messages in thread
From: pr-tracker-bot @ 2022-10-07 19:20 UTC (permalink / raw)
  To: Lee Jones; +Cc: Linus Torvalds, Linux Kernel Mailing List

The pull request you sent on Thu, 6 Oct 2022 10:02:03 +0100:

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

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/ae9559594cb851aff774d5bea243b84c6acf761d

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [GIT PULL] MFD for v6.1
  2022-10-06  9:02 [GIT PULL] MFD for v6.1 Lee Jones
  2022-10-07 19:20 ` pr-tracker-bot
@ 2022-10-08 15:39 ` Jason A. Donenfeld
  2022-10-08 15:47   ` [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()" Jason A. Donenfeld
  1 sibling, 1 reply; 12+ messages in thread
From: Jason A. Donenfeld @ 2022-10-08 15:39 UTC (permalink / raw)
  To: Lee Jones, Andy Shevchenko; +Cc: Linus Torvalds, Linux Kernel Mailing List

Hi Lee, Andy,

On Thu, Oct 06, 2022 at 10:02:03AM +0100, Lee Jones wrote:
>    - 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"
  2022-10-08 15:39 ` Jason A. Donenfeld
@ 2022-10-08 15:47   ` Jason A. Donenfeld
  2022-10-08 16:45     ` Linus Torvalds
                       ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Jason A. Donenfeld @ 2022-10-08 15:47 UTC (permalink / raw)
  To: arnd, lee, linux-kernel, andriy.shevchenko, torvalds; +Cc: 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.

Cc: Lee Jones <lee@kernel.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Fixes: 72a95859728a ("mfd: syscon: Remove repetition of the regmap_get_val_endian()")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 drivers/mfd/syscon.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index 9489e80e905a..bdb2ce7ff03b 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -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
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"
  2022-10-08 15:47   ` [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()" Jason A. Donenfeld
@ 2022-10-08 16:45     ` Linus Torvalds
  2022-10-08 19:07       ` Andy Shevchenko
  2022-10-11  9:44     ` Andy Shevchenko
  2022-10-18  7:23     ` Lee Jones
  2 siblings, 1 reply; 12+ messages in thread
From: Linus Torvalds @ 2022-10-08 16:45 UTC (permalink / raw)
  To: Jason A. Donenfeld; +Cc: arnd, lee, linux-kernel, andriy.shevchenko

On Sat, Oct 8, 2022 at 8:47 AM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
>
> 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"
  2022-10-08 16:45     ` Linus Torvalds
@ 2022-10-08 19:07       ` Andy Shevchenko
  2022-10-10  7:48         ` Lee Jones
  2022-10-11  7:39         ` Lee Jones
  0 siblings, 2 replies; 12+ messages in thread
From: Andy Shevchenko @ 2022-10-08 19:07 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Jason A. Donenfeld, arnd, lee, linux-kernel

On Sat, Oct 08, 2022 at 09:45:16AM -0700, Linus Torvalds wrote:
> On Sat, Oct 8, 2022 at 8:47 AM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> >
> > 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.

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.

>  (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!

> 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.

> 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.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"
  2022-10-08 19:07       ` Andy Shevchenko
@ 2022-10-10  7:48         ` Lee Jones
  2022-10-10 15:25           ` Jason A. Donenfeld
  2022-10-11  7:39         ` Lee Jones
  1 sibling, 1 reply; 12+ messages in thread
From: Lee Jones @ 2022-10-10  7:48 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Linus Torvalds, Jason A. Donenfeld, arnd, linux-kernel

On Sat, 08 Oct 2022, Andy Shevchenko wrote:
> > 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?

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"
  2022-10-10  7:48         ` Lee Jones
@ 2022-10-10 15:25           ` Jason A. Donenfeld
  0 siblings, 0 replies; 12+ messages in thread
From: Jason A. Donenfeld @ 2022-10-10 15:25 UTC (permalink / raw)
  To: Lee Jones; +Cc: Andy Shevchenko, Linus Torvalds, arnd, linux-kernel

On Mon, Oct 10, 2022 at 08:48:02AM +0100, Lee Jones wrote:
> On Sat, 08 Oct 2022, Andy Shevchenko wrote:
> > > 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"
  2022-10-08 19:07       ` Andy Shevchenko
  2022-10-10  7:48         ` Lee Jones
@ 2022-10-11  7:39         ` Lee Jones
  2022-10-11  9:44           ` Andy Shevchenko
  1 sibling, 1 reply; 12+ messages in thread
From: Lee Jones @ 2022-10-11  7:39 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Linus Torvalds, Jason A. Donenfeld, arnd, linux-kernel

On Sat, 08 Oct 2022, Andy Shevchenko wrote:

> On Sat, Oct 08, 2022 at 09:45:16AM -0700, Linus Torvalds wrote:
> > On Sat, Oct 8, 2022 at 8:47 AM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> > >
> > > 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.
> 
> 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.
> 
> >  (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!
> 
> > 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.
> 
> > 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?

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"
  2022-10-08 15:47   ` [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()" Jason A. Donenfeld
  2022-10-08 16:45     ` Linus Torvalds
@ 2022-10-11  9:44     ` Andy Shevchenko
  2022-10-18  7:23     ` Lee Jones
  2 siblings, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2022-10-11  9:44 UTC (permalink / raw)
  To: Jason A. Donenfeld; +Cc: arnd, lee, linux-kernel, torvalds

On Sat, Oct 08, 2022 at 09:47:00AM -0600, Jason A. Donenfeld wrote:
> 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.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

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

> Cc: Lee Jones <lee@kernel.org>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Fixes: 72a95859728a ("mfd: syscon: Remove repetition of the regmap_get_val_endian()")
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
>  drivers/mfd/syscon.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
> index 9489e80e905a..bdb2ce7ff03b 100644
> --- a/drivers/mfd/syscon.c
> +++ b/drivers/mfd/syscon.c
> @@ -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
> -- 
> 2.37.3
> 
> 

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"
  2022-10-11  7:39         ` Lee Jones
@ 2022-10-11  9:44           ` Andy Shevchenko
  0 siblings, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2022-10-11  9:44 UTC (permalink / raw)
  To: Lee Jones; +Cc: Linus Torvalds, Jason A. Donenfeld, arnd, linux-kernel

On Tue, Oct 11, 2022 at 08:39:23AM +0100, Lee Jones wrote:
> On Sat, 08 Oct 2022, Andy Shevchenko wrote:
> > On Sat, Oct 08, 2022 at 09:45:16AM -0700, Linus Torvalds wrote:

...

> > > 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.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"
  2022-10-08 15:47   ` [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()" Jason A. Donenfeld
  2022-10-08 16:45     ` Linus Torvalds
  2022-10-11  9:44     ` Andy Shevchenko
@ 2022-10-18  7:23     ` Lee Jones
  2 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2022-10-18  7:23 UTC (permalink / raw)
  To: Jason A. Donenfeld; +Cc: arnd, linux-kernel, andriy.shevchenko, torvalds

On Sat, 08 Oct 2022, Jason A. Donenfeld wrote:

> 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 <lee@kernel.org>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Fixes: 72a95859728a ("mfd: syscon: Remove repetition of the regmap_get_val_endian()")
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
>  drivers/mfd/syscon.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

Applied, thanks.

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-10-18  7:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-06  9:02 [GIT PULL] MFD for v6.1 Lee Jones
2022-10-07 19:20 ` pr-tracker-bot
2022-10-08 15:39 ` Jason A. Donenfeld
2022-10-08 15:47   ` [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()" Jason A. Donenfeld
2022-10-08 16:45     ` Linus Torvalds
2022-10-08 19:07       ` Andy Shevchenko
2022-10-10  7:48         ` Lee Jones
2022-10-10 15:25           ` Jason A. Donenfeld
2022-10-11  7:39         ` Lee Jones
2022-10-11  9:44           ` Andy Shevchenko
2022-10-11  9:44     ` Andy Shevchenko
2022-10-18  7:23     ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).