Commit graph

1283760 commits

Author SHA1 Message Date
Arnd Bergmann
77dc111f6d Allwinner SoC driver changes for 6.11 part 2
One additional minor cleanup
 
 - Const-ify |struct regmap_config| in SRAM driver
 - Const-ify |struct regmap_bus| in Allwinner RSB bus driver
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCgAsFiEE2nN1m/hhnkhOWjtHOJpUIZwPJDAFAmaO0pcOHHdlbnNAY3Np
 ZS5vcmcACgkQOJpUIZwPJDBXtBAAiwXguzxnciKnLgRkzIj+VA/TcPU1hjOMAhE2
 Q3lKBXAclsGhMbiH7hU/rOu+aT3ChhM74Zur5X+7CvByd1syIc/Uc9hFxDCd4EBY
 codi8o1lnOh4Hy07+dfaDEX5In6ed9ACD45HSR5KxPkhJ1b3EpYurscBDgrJUllG
 YxZ/Nw3I71Z990KV8JgLJeXhV1zSQxEl5GRF4yhZPFPADaYEX8/u24s8GSJt3WGS
 syQLCuf6uxGv8ml8EozcBGuig7c/YGTZV5RWeakbczth7e6JJIZVxuq8vfgHfXjx
 sR0ZofHHuVtU2PruWo6d6eOiTTwhPyTIVP2cIanXfxjYrIq/kZ31quAXye2wiQR1
 IfygUQPi+kYXUNoFvhJzGUtd1asNpL82KrbxyM2fLj1O6SJBJZ9ORb3KjIyk04La
 AYttnwFwljdaPkX2MHGlaQnNUMGgHuJpIUeLqNZQOF8YYZGY1tO+wmJ6VbL3z4jg
 eT+78dxSej+Yd2m4ZEv1tiG2o+BXdpQQ55jxtPluO1ynwmb84RRHZ+Tmbvmj9erf
 ErXDMKrRrjxsRqxNCQ7OhdZGrBSEsG+GFkQutMdpiD+Hs5Ba6eqhRBgq06p4th8q
 rRbORTmkmgQs/doEeHAM9ns4ngBcU5f+54+7BfSVRWKIxsyJF1P1xl1JmWaaagL6
 5WbXYRY=
 =7WP1
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmaO7YgACgkQYKtH/8kJ
 UiepFQ//U7SPK+e66oSIjCT8UaC2X8/delLoBddGBV0v154QT5xTUkTvBwMYXOhn
 xzVILtLDDtDLoKwb/MjNhmvI6zljdm3qGsLUdPWhpse/nxxt5wseAIvNM870jEt6
 g45M85mRWzIq4lAzFoO0N6sLGMT5xTG8YpZAD9fwu8n27NqK4edWAsoMBvrpQm7K
 /6ynCbbI0aWxPhVm/DqKeP0sUyqIxx/BfXFOdxt0v8H3onMyJKHAAoFoL19slzHI
 mRerwZ8htZDKfu9XiWInaKD2n+qAwwLySsZgE6yjqfFxVWvGrF/Zs3DniIE3499B
 eADebhXf/XKR0eFcmVxdlDOv5JECE4tJPWvqIQfbCsIHLK5VqOJLRu6LsvOKwkzT
 u7YoJc/QAzzw3dEj6BJAXYHeME71HGiOi6aFTbafC2Kk+uFZLMUSDIqJta2Gxa1S
 56GtJF0Nq4SklDONUJGZTKPWwHgawNpNrDbb0FProI79Fb/cIEh1YNheLDCYyl60
 yqxbq2n90x115xGHYwkBi/X7SGpneP7MYG/qX0Aili8nAltFYobI5kRgvoL84Z5K
 L99oaJmqHKYLcsmTrZEIkSPtIb8TyJJqP388jCtQ2DbgERbQ8jaEpVMiXX5iVLUh
 Zg2AMF9Hp3x1Eiilfw8mcIFIMV5uhwYlGI4ZpePEZ0vsiiymlPU=
 =hq/j
 -----END PGP SIGNATURE-----

Merge tag 'sunxi-drivers-for-6.11-2' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into soc/drivers

Allwinner SoC driver changes for 6.11 part 2

One additional minor cleanup

- Const-ify |struct regmap_config| in SRAM driver
- Const-ify |struct regmap_bus| in Allwinner RSB bus driver

* tag 'sunxi-drivers-for-6.11-2' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  bus: sunxi-rsb: Constify struct regmap_bus
  soc: sunxi: sram: Constify struct regmap_config

Link: https://lore.kernel.org/r/Zo7T4YsfamN0PbYK@wens.tw
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-07-10 22:22:32 +02:00
Christian König
99194e6db5 drm/amdgpu: reject gang submit on reserved VMIDs
A gang submit won't work if the VMID is reserved and we can't flush out
VM changes from multiple engines at the same time.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 320debca1b)
2024-07-10 16:19:19 -04:00
Linus Torvalds
d6e1712b78 VFIO fix for v6.10
- Recent stable backports are exposing a bug introduced in the v6.10
    development cycle where a counter value is uninitialized.  This leads
    to regressions in userspace drivers like QEMU where where the kernel
    might ask for an arbitrary buffer size or return out of memory itself
    based on a bogus value.  Zero initialize the counter.  (Yi Liu)
 -----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEEQvbATlQL0amee4qQI5ubbjuwiyIFAmaOwiUbHGFsZXgud2ls
 bGlhbXNvbkByZWRoYXQuY29tAAoJECObm247sIsiVnoP/iAThUwMs8fQImRUXtZ5
 jcZ3ROFZieB6CywjQEswy7G/Q9F4yNgHSwcu7VD/i44q5j88HqGDf3iZ3LPEMGSm
 GHrC9ynmJWqjN5Se7kGaKDGZFxxF9P2vTxfTkSG40qkP11obmCUIsWr4IHe4IH0r
 YcKEawW92G/mp9wEPWidDJYmRy7MZe/SJMbWaF3uwDymjqJA9WJjh2QS3tiPwAc+
 xbkdgYk9JyLe0/U0uawV0jgxvqzEM+rTw4hZRmPl7Aygi7qYx1iGnzEHd5QOGZSJ
 pHPfXe0EFIY+341y0AKwezDb4Vx8+F7M0Z+xx/v1zD875y/ffCT6lX79sDzIK/MC
 zzSzLj/64S40i8sai7Ec7t5W7PlNkXurnOjBa6k3EcfOmxYr0qcQzHgDgenUeNPL
 taybZN42RqYs3TIafRtu9vScOVpDn3H/BoSwlsdEKFqUqLA/g1B7U2EPyNRVWNWR
 By0WzJTWDnhltyTrxWJ9FfuehVlXtB91ovO5Cerh4DlOdcLkJD6RfESjaOdBRf0+
 vuqfstHYQ+7nH91n9101AKKTUQEGAVh3Lp/HgLKjI/wXua4lO+1/DmFA9mlJ/H/Y
 HcIZk3flq+Bab7TvmORwDU5UjrDofu4dvp3mhFpBByvjNKKlo0mmD5Boyj7RIi+a
 vKc3rgBpL490/V//iengWDSr
 =syRE
 -----END PGP SIGNATURE-----

Merge tag 'vfio-v6.10' of https://github.com/awilliam/linux-vfio

Pull VFIO fix from Alex Williamson:

 - Recent stable backports are exposing a bug introduced in the v6.10
   development cycle where a counter value is uninitialized.  This leads
   to regressions in userspace drivers like QEMU where where the kernel
   might ask for an arbitrary buffer size or return out of memory itself
   based on a bogus value.  Zero initialize the counter.  (Yi Liu)

* tag 'vfio-v6.10' of https://github.com/awilliam/linux-vfio:
  vfio/pci: Init the count variable in collecting hot-reset devices
2024-07-10 12:00:43 -07:00
Linus Torvalds
f6963ab4b0 bcachefs fixes for 6.10-rc8
- Switch some asserts to WARN()
 - Fix a few "transaction not locked" asserts in the data read retry
   paths and backpointers gc
 - Fix a race that would cause the journal to get stuck on a flush commit
 - Add missing fsck checks for the fragmentation LRU
 - The usual assorted ssorted syzbot fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEKnAFLkS8Qha+jvQrE6szbY3KbnYFAmaOuRwACgkQE6szbY3K
 bnaCHhAAi9VRqws+zx3fSpe2OMwWqAEWA84QgIFJccy+I86d7dXkqG389gFqJwMG
 9S3BUHP1WooJmpsTRhK5cNtxZuKKOajXlxUYz3onsF7O/U3dHFY5GU7yIIjXS/0o
 q7+iryWAJ4MmlOrAJhgPMH/WlhbSVsjANUN0n/NhlOWHccFGHmpdMTb6aYzb+lfL
 iZOONKmEOR65gLzZYlO323OB2Tv00iEbOZAtxk68BLZYX+WON/j1T1A8gK4G0XSX
 8wcYpXNxGGkCufjBfAbXf4mcp/WygQq0Wj3bdVMFkZ+AwSJDcfGeK1H7f6tJ9e4n
 lqfWL4tgWIckS+41sA96B5cYry9TMDdhu3IeFaAm0ZrF55JT1JySGE1GNA+mo6xA
 mkMAqhG7rwYh6nSJfWX0Ie+zJ9TFbmi05ZbI7jaTuQjnJ5uvPpTuRfBDi+qSWmoi
 +IBDAi9hZgCUNEsLRGDm7RDQo0dpbFo6jpArn1RHK4MO/HkTrqcKpTqiGnfwFAU4
 PFxwq5G9+d38+M6YMX0tXdfQ+fdxroA6aIBJSsIpF18tPRBOBlQsM2GFP34uHbyk
 L6HOzed2QpM5ExBmViX79F+obuDQ/gzXQszYvDKL4QTFNbx43gPWRDrGm8EQen6y
 12EScamXbUWBSWnOqxscmeUsTdTKxLfw/F43JbE2fE7jSxc5tss=
 =VGT8
 -----END PGP SIGNATURE-----

Merge tag 'bcachefs-2024-07-10' of https://evilpiepirate.org/git/bcachefs

Pull bcachefs fixes from Kent Overstreet:

 - Switch some asserts to WARN()

 - Fix a few "transaction not locked" asserts in the data read retry
   paths and backpointers gc

 - Fix a race that would cause the journal to get stuck on a flush
   commit

 - Add missing fsck checks for the fragmentation LRU

 - The usual assorted ssorted syzbot fixes

* tag 'bcachefs-2024-07-10' of https://evilpiepirate.org/git/bcachefs: (22 commits)
  bcachefs: Add missing bch2_trans_begin()
  bcachefs: Fix missing error check in journal_entry_btree_keys_validate()
  bcachefs: Warn on attempting a move with no replicas
  bcachefs: bch2_data_update_to_text()
  bcachefs: Log mount failure error code
  bcachefs: Fix undefined behaviour in eytzinger1_first()
  bcachefs: Mark bch_inode_info as SLAB_ACCOUNT
  bcachefs: Fix bch2_inode_insert() race path for tmpfiles
  closures: fix closure_sync + closure debugging
  bcachefs: Fix journal getting stuck on a flush commit
  bcachefs: io clock: run timer fns under clock lock
  bcachefs: Repair fragmentation_lru in alloc_write_key()
  bcachefs: add check for missing fragmentation in check_alloc_to_lru_ref()
  bcachefs: bch2_btree_write_buffer_maybe_flush()
  bcachefs: Add missing printbuf_tabstops_reset() calls
  bcachefs: Fix loop restart in bch2_btree_transactions_read()
  bcachefs: Fix bch2_read_retry_nodecode()
  bcachefs: Don't use the new_fs() bucket alloc path on an initialized fs
  bcachefs: Fix shift greater than integer size
  bcachefs: Change bch2_fs_journal_stop() BUG_ON() to warning
  ...
2024-07-10 11:50:16 -07:00
Javier Carrasco
e4b5a39c2f bus: sunxi-rsb: Constify struct regmap_bus
`regmap_sunxi_rsb` is not modified and can be declared as const to
move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240705-sunxi-rsb-bus-const-regmap_bus-v1-1-129094960ce9@gmail.com
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2024-07-11 02:15:19 +08:00
Greg Kroah-Hartman
70c8e39440 USB-serial fixes for 6.10-rc8
Here's a fix for a long-standing issue in the mos7840 driver that can trigger
 a crash when resuming from system suspend.
 
 Included are also some new modem device ids.
 
 All have been in linux-next with no reported issues.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQQHbPq+cpGvN/peuzMLxc3C7H1lCAUCZo6w6gAKCRALxc3C7H1l
 CNPAAP0SiU/4HcMRJ/m6Q2xPiuq27Xo6yFg7kjjRiCQVObio6AEA8wjAdSiMoPhx
 p9vfS+8cvZ7z5YtxkBYPKaZsjESq+QM=
 =cW58
 -----END PGP SIGNATURE-----

Merge tag 'usb-serial-6.10-rc8' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus

Johan writes:

USB-serial fixes for 6.10-rc8

Here's a fix for a long-standing issue in the mos7840 driver that can trigger
a crash when resuming from system suspend.

Included are also some new modem device ids.

All have been in linux-next with no reported issues.

* tag 'usb-serial-6.10-rc8' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial:
  USB: serial: mos7840: fix crash on resume
  USB: serial: option: add Rolling RW350-GL variants
  USB: serial: option: add support for Foxconn T99W651
  USB: serial: option: add Netprisma LCUK54 series modules
2024-07-10 19:55:07 +02:00
Guenter Roeck
3c1ff93b4d
regmap: Implement regmap_multi_reg_read()
regmap_multi_reg_read() is similar to regmap_bilk_read() but reads from
an array of non-sequential registers.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240710015622.1960522-2-linux@roeck-us.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-10 18:45:34 +01:00
Kent Overstreet
fd80d14005 bcachefs: fix scheduling while atomic in break_cycle()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-10 12:59:28 -04:00
Javier Carrasco
9bc1e34a7b soc: sunxi: sram: Constify struct regmap_config
`sunxi_sram_regmap_config` is not modified and can be declared as const
to move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Link: https://lore.kernel.org/r/20240705-sunxi-sram-const-regmap_config-v1-1-1b997cd65d0f@gmail.com
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2024-07-11 00:47:13 +08:00
Kent Overstreet
6f692b1672 bcachefs: Fix RCU splat
Reported-by: syzbot+e74fea078710bbca6f4b@syzkaller.appspotmail.com
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-10 12:46:22 -04:00
Andre Przywara
6ed9a85f1c arm64: dts: allwinner: h616: add crypto engine node
The Allwinner H616 SoC contains a crypto engine very similar to the H6
version, but with all base addresses in the DMA descriptors shifted by
two bits. This requires a new compatible string.
Also the H616 CE relies on the internal osciallator for the TRNG
operation, so we need to reference this clock.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Link: https://lore.kernel.org/r/20240624232110.9817-5-andre.przywara@arm.com
[wens@csie.org: fix up register range size]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2024-07-11 00:43:10 +08:00
Linus Torvalds
a19ea42149 platform-drivers-x86 for v6.10-6
Highlights:
  -  Fix missing dmi_system_id array termination in toshiba_acpi introduced in 2022
 
 The following is an automated git shortlog grouped by driver:
 
 toshiba_acpi:
  -  Fix array out-of-bounds access
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEEuvA7XScYQRpenhd+kuxHeUQDJ9wFAmaOl6IUHGhkZWdvZWRl
 QHJlZGhhdC5jb20ACgkQkuxHeUQDJ9xSXwgAuGunI5/MqhsyUNDwrC8ZH1MiMUpC
 U81kNnhUn/S4Wu9nu3TunrP99hEAXY//2ImlN6QRiiSXSo95SmRRKSeipV6MeKY5
 bD7HWhUoGA0DApI94nURq85fj56yBJr649R5dEx0TV0DFvFkoZxAUpnHe5m/xtva
 RZbdl8fSpxLqV3fxeXV4b+P3UUDw2DRbI40vCSAJsQ6aJvWwKtENLdvweBJaGyjV
 5ZNJSYd1YRUK7sVoN/cJI4vKmj/qXSU531Y8SeRSzGElMDCwQ9V7kxLq7Df4H68q
 cE8czC7XlVW/t9Vlx0d29v3EzFXvflHjBcHMfpgTwJtPCz+z18rlUXXMtA==
 =f+EK
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v6.10-6' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver fix from Hans de Goede:
 "One-liner fix for a dmi_system_id array in the toshiba_acpi driver not
  being terminated properly.

  Something which somehow has escaped detection since being introduced
  in 2022 until now"

* tag 'platform-drivers-x86-v6.10-6' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
  platform/x86: toshiba_acpi: Fix array out-of-bounds access
2024-07-10 09:08:22 -07:00
Linus Torvalds
97488b92e5 ACPI fix for 6.10-rc8
Fix the sorting of _CST output data in the ACPI processor idle
 driver (Kuan-Wei Chiu).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmaOZu4SHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRx3qoQAKHev+jG4IroRaUXgMYdLp4vk9WuBgTo
 eYJgcPgKxr7jAdmfaDbZDHjCLrDbLZvxzVrUSjEfla2UDhSYIOn3DQVImWKWF3fn
 i3xtDwYmxi7+3lmmvzqaVE/Sa6hwycI3eAk1+LfBYlIC8T44FhW8uGiZg0W+1zMW
 MJ61Ea6j16xtvmdtmORRPn7QscaPZc1C4PJjNQ8/yaaI/v4CqwP+7bxQrq/kLdkj
 LH+pQhETcmIcV0u/KJmd/QHcAiU4zFI/hprXVvsiIck/7w/cmwMi17FgTbmxjwRF
 9GlHqM3Sg3TVOiKCeWJVh6MDcNnt4e/6Eb9CupI3KWzEiVk9DUaFBLeMOUcEDwxB
 n0cSJ1WzrDKyJRqWgoRBmbqK+3ywnLpYuNyZf5jQ/o+CfdZOkWkN98kl5jkswOJp
 obXLZT1CYmFmDN4XcI5GGl5v44LJLVVas2Rauc35Z7w/sk5Z1O/bOdLqMphZNkG/
 4B6Vmno4aneAyx2nWIxEmuWF0x5RTwtTwrEsg9r/9wyKwR646XcfXqwuKvmCaIKp
 NVEoZfgzKQ3JpDkHEB/XFmeaSeSv/QIm+8O2or2RXRr7MB7Q5FESRuhvkBsfQxUH
 9dqm3hU+kSd10DrsUojs4T7e67w9/WNCDZDB14EPJ1CTrm0BVdHRb6NK4GOKlnqr
 XQ34U1Vs+iNx
 =/dN3
 -----END PGP SIGNATURE-----

Merge tag 'acpi-6.10-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fix from Rafael Wysocki:
 "Fix the sorting of _CST output data in the ACPI processor idle driver
  (Kuan-Wei Chiu)"

* tag 'acpi-6.10-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: processor_idle: Fix invalid comparison with insertion sort for latency
2024-07-10 09:05:22 -07:00
Linus Torvalds
130abfe9a1 Power management fixes for 6.10-rc8
Fix two issues related to boost frequencies handling, one in the cpufreq
 core and one in the ACPI cpufreq driver (Mario Limonciello).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmaOZn8SHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxvHgP/ROsVSyywkXr9KteIgjID0U9Pte8fBAG
 YAGFHTnV+y/+NY47HHW9UCjJb84z8/QvYfzpzH5iRmO9UQBl4Jkn4VIhLOTmWUPw
 i8HhUQFTVhaRMrT6kW+V5AM0jTwUpmwcUMPbFTAPtTSQ2z1nZHjCo3eBZ5K0SZ/r
 HBh2wykMutQrI+S9vWvCBaWQDq8RbmdFngOelsPP56YeeF63RviHsTeVeQ0zsFaK
 OS1RfmlV+Ri22pVAdXvzpI09cbJ6wfHVFOuxIRMF+dbuD6Riloq1jOVHqr5iAXMK
 tRMHTpWCtzC3rYmXU4m6oXjlUOKQ7IotCpROowA5Od05ooXTYChWsH85Msg66qju
 1hC9/6ltZmEptMMfElNJCvdg6U1Y5EEnAJvuRQYluCoz8ZCH+d9I8OKyurA/QRVR
 uLP+pJk2SFxhq79ULLvCSyEWVwqDQ7dvfXvfGU5mfvQJAZc7YGHJFoN0Tor4C8JW
 b7tZwghPly8RsSIfPmWQDUUWQXud+/LTy1AVDhMthDLW6qBKhxPSXzKCt7/J4umx
 n5iHx3YoEunvcISX3gs2IdQdqaay4usCeJF6kbqchMIGXDEC3270SjOIlgDrsAmh
 jFeW7rZt38/GjgEWe0VzE4B3Xvg92f7Fg5/ItXhehkppJAhsEr6A9V1DvJZHyKAm
 D2G0sY6Cm18q
 =rCmw
 -----END PGP SIGNATURE-----

Merge tag 'pm-6.10-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
 "Fix two issues related to boost frequencies handling, one in the
  cpufreq core and one in the ACPI cpufreq driver (Mario Limonciello)"

* tag 'pm-6.10-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: ACPI: Mark boost policy as enabled when setting boost
  cpufreq: Allow drivers to advertise boost enabled
2024-07-10 09:03:21 -07:00
Linus Torvalds
d045c46c52 Thermal control fixes for 6.10-rc8
- Prevent the Power Allocator thermal governor from dereferencing a NULL
    pointer if it is bound to a tripless thermal zone (Nícolas Prado).
 
  - Prevent thermal zones enabled too early from staying effectively
    dormant forever because their temperature cannot be determined
    initially (Rafael Wysocki).
 
  - Fix list sorting during thermal zone temperature updates to ensure
    the proper ordering of trip crossing notifications (Rafael Wysocki).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmaOZdQSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxV0gQALKvi36z4lCF2NpZtncnS0TCwiqknb3h
 I5W7O28EeED/qKxtUhT0rKaFJA5py9Civ2J1xfccnsO2KLlLtZxzL2yNrHHnewGZ
 SCdVDommTh0zIw01d7h4dzFPE73cYWoX5kwsto9ty0/xi6IBt019LLCIJgB6OmqA
 pu4RoESkhxoVFNrV8dtB7Fj+IT9rIGHtC0c4DZXqIgz6MJkiNAXzwyhL2N7icxlx
 zPhDSBWv2CLTqVxFAFxSc0Hq5FUieU/vMjkrpT4liR4KuTnbqmxOw2pFdgsCf/AJ
 CKhef9aqXeoQYIMTbCreOdgAYMtNekjnUuta8OMwCxop9HCVhh1O1asMURiIX5VT
 8SRal1nDgmTXG5NR0V6TVJ2VYQ6amfqSux0B2lyxcMxr4VsY4kekpsnXXPO68rHB
 ZVCSIza/fH13dyYOrd0GC7Qz2bGRKYstiXXDZc6s69ij7ulDNpG61M49M3W1V7wk
 v2p0SZwjFax3H5DPyd7b9pvBEeAsKGCco2wm/BLauYtnciSsIQBw3Q330DGzsXBm
 EN7vGq8q/w6D6Y3S0syiRyGcaDpDK3FmZerXdASaBRNkWvnXn3fhsOngBY62+3iX
 LqVbvXar2Of//Q9NkvF3S1ko4tJF78vplqz+ScjHUnIE6kfpoby+CVupIcbVXceB
 bcsyCAFYcYlL
 =o+Gb
 -----END PGP SIGNATURE-----

Merge tag 'thermal-6.10-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull thermal control fixes from Rafael Wysocki:
 "These fix a possible NULL pointer dereference in a thermal governor,
  fix up the handling of thermal zones enabled before their temperature
  can be determined and fix list sorting during thermal zone temperature
  updates.

  Specifics:

   - Prevent the Power Allocator thermal governor from dereferencing a
     NULL pointer if it is bound to a tripless thermal zone (Nícolas
     Prado)

   - Prevent thermal zones enabled too early from staying effectively
     dormant forever because their temperature cannot be determined
     initially (Rafael Wysocki)

   - Fix list sorting during thermal zone temperature updates to ensure
     the proper ordering of trip crossing notifications (Rafael
     Wysocki)"

* tag 'thermal-6.10-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  thermal: core: Fix list sorting in __thermal_zone_device_update()
  thermal: core: Call monitor_thermal_zone() if zone temperature is invalid
  thermal: gov_power_allocator: Return early in manage if trip_max is NULL
2024-07-10 09:00:55 -07:00
Linus Torvalds
367cbaad88 Devicetree fix for 6.10, part 2:
- One fix for PASemi Nemo board interrupts
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEktVUI4SxYhzZyEuo+vtdtY28YcMFAmaNuf4ACgkQ+vtdtY28
 YcPFKQ/9HN09dn9ShKggWFJO0nJvJNcI0aObqBynHpsFSVPHiEWPeu8Td144SHvr
 ofc7UmOn80Q14O9wMkcvlZrkPAZJeBKHTwoeZ8L0bmGTwJQ/24ksqsNZGQi8zZDn
 WKhpgh8wNC4VYync51hBm2UpnPbbJJ7mZ/h6KY+TOqs7tl82bJDDmilQzNl8+Z9w
 3i8Qge1yeDmOPVKyx3RAKMu6QcqmAg3B93BVuqUpg3kyO5i4TAZfX8lb7+WI4GOL
 MmfpzRezTrY0SAlFekuJYFND6TovY5rKZHYgxoYwfHZkv9VpnjsoZ4MYpTu0NQ0l
 ZqkpD1ffGRnsYTCbGSlWufVjQT6kmLlJ3PnkuBKcPKQ1tIsECl9eq7C50845Rfma
 Qiyf8T+T3ix/rfN7OjdJsxOIbjJXb9F8nkfhprwpf1AHnsOQyhndPrIhl3NgcGXX
 uJtf+i0FbHPDqZCmMWGx6Z0xqm1jetT3QST5M4fn5rsrdA23yv1lWbuGDu50XYTP
 bsMnNP8zbZrU/oiBfehCSN4OMd13A4IakmZ9oBGIwqgGIjCpqFY4LPWHmFDDHbTv
 UDfmbl4POWClREPDuVCEXaP+imMrcyrGvjev47xEeJTDVt+rTJfTTJ1cOtjI3yfc
 W/xuTkjpvLymP8tzxLEwxsJOtPH6wbn3YQ+rzD5dwE18buucqXM=
 =2zwc
 -----END PGP SIGNATURE-----

Merge tag 'devicetree-fixes-for-6.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull devicetree fix from Rob Herring:

 - One fix for PASemi Nemo board interrupts

* tag 'devicetree-fixes-for-6.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  of/irq: Disable "interrupt-map" parsing for PASEMI Nemo
2024-07-10 08:58:50 -07:00
Uwe Kleine-König
c9a787b945 pwm: atmel-tcb: Make private data variable naming consistent
Currently the variables of type struct atmel_tcb_pwm_device
are named "tcbpwm", and variables of type atmel_tcb_pwm_chip are either
named "tcbpwm" (too!) or "tcbpwmc". Rename the chips with device name to
"tcbpwmc" to get a consistent naming.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20240709092221.47025-2-u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:55:38 +02:00
Uwe Kleine-König
c1330cb9a5 pwm: atmel-tcb: Simplify checking the companion output
The two outputs provided by the supported hardware share some settings,
so access to the other PWM is required when one of them is configured.

Instead of an explicit if to deterimine the other PWM just use
hwpwm ^ 1. Further atcbpwm is never NULL, so drop the corresponding
check.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20240709101806.52394-4-u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:55:12 +02:00
Uwe Kleine-König
9dd42d019e pwm: Allow pwm state transitions from an invalid state
While driving a PWM via the sysfs API it's hard to determine the right
order of writes to the pseudo files "period" and "duty_cycle":

If you want to go from duty_cycle/period = 50/100 to 150/300 you have to
write period first (because 150/100 is invalid). If however you start at
400/500 the duty_cycle must be configured first. The rule that works is:
If you increase period write period first, otherwise write duty_cycle
first. A complication however is that it's usually sensible to configure
the polarity before both period and duty_cycle. This can only be done if
the current state's duty_cycle and period configuration isn't bogus
though. It is still worse (but I think only theoretic) if you have a PWM
that only supports inverted polarity and you start with period = 0 and
polarity = normal. Then you can change neither period (because polarity
= normal is refused) nor polarity (because there is still period = 0).

To simplify the corner cases for userspace, let invalid target states
pass if the current state is invalid already.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/20240628103519.105020-2-u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:53:52 +02:00
Uwe Kleine-König
14b9dc66e9 pwm: xilinx: Simplify using devm_ functions
There are devm variants for clk_prepare_enable() and pwmchip_add(); and
clk_prepare_enable() can be done together with devm_clk_get(). This
allows to simplify the error paths in .probe() and drop .remove()
completely.

With the remove callback gone, the last user of platform_get_drvdata()
is gone and so the call to platform_set_drvdata() can be dropped, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
Link: https://lore.kernel.org/r/20240628063524.92907-2-u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:53:52 +02:00
Uwe Kleine-König
0007fa1292 pwm: Use guards for pwm_lookup_lock instead of explicity mutex_lock + mutex_unlock
With the compiler caring for unlocking the mutex several functions can
be simplified. Benefit from that.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/28807cb5d9dbce66860f74829c0f57cd9c01373e.1719520143.git.u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:53:52 +02:00
Uwe Kleine-König
4c50c71c69 pwm: Use guards for export->lock instead of explicity mutex_lock + mutex_unlock
With the compiler caring for unlocking the mutex several functions can
be simplified. Benefit from that.

There is just one caller left for mutex_lock(&export->lock). The code
flow is too complicated there to convert it to the compiler assisted
variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/210010f2e579a92476462726e18e0135f6854909.1719520143.git.u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:53:52 +02:00
Uwe Kleine-König
650af6c083 pwm: Use guards for pwm_lock instead of explicity mutex_lock + mutex_unlock
With the compiler caring for unlocking the mutex several functions can
be simplified. Benefit from that.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/2102fe8189bdf1f02ff3785b551a69be27a65af4.1719520143.git.u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:53:51 +02:00
Uwe Kleine-König
44ee95184e pwm: Register debugfs operations after the pwm class
While the debugfs operations don't technically depend on an initialized
class, they loop over the idr that only can get entries when the class
is properly initialized.

This also fixes the ugly (but harmless) corner case that the debugfs
file stays around after the pwm class failed to initialize.

While at it, add an appropriate error message when class initialization
fails.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/20240626222529.2901200-2-u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:53:51 +02:00
Shenwei Wang
9b22ceb31a pwm: imx-tpm: Enable pinctrl setting for sleep state
Apply the pinctrl setting of sleep state when system enters
suspend state.
Restore to the default pinctrl setting when system resumes.

Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
Link: https://lore.kernel.org/r/20240702164514.11007-1-shenwei.wang@nxp.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:53:51 +02:00
Raag Jadav
f3a616e2a8 pwm: lpss: drop redundant runtime PM handles
We no longer need empty runtime PM handles for PCI devices after
commits [1] and [2]. Drop them and let PCI core take care of power
state transitions.

[1] c5eb119007 ("PCI / PM: Allow runtime PM without callback functions")
[2] fa885b06ec ("PCI/PM: Allow runtime PM with no PM callbacks at all")

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Link: https://lore.kernel.org/r/20240605131533.20037-3-raag.jadav@intel.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:53:51 +02:00
Raag Jadav
07612a7621 pwm: lpss: use devm_pm_runtime_enable() helper
Use devm_pm_runtime_enable() helper to enable runtime PM and drop redundant
platform ->remove() callback.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Link: https://lore.kernel.org/r/20240605131533.20037-2-raag.jadav@intel.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:53:51 +02:00
Uwe Kleine-König
7cea05ae1d pwm-stm32: Make use of parametrised register definitions
There is no semantic change, but it is a nicer on the eyes of a reader,
because

	TIM_CCR1 + 4 * ch

encodes internal register knowledge, while

	TIM_CCRx(ch + 1)

keeps that information completely in the header defining the registers.

While I expected this to not result in any changes in the binary, gcc 13
(as provided by Debian in the gcc-13-arm-linux-gnueabihf 13.2.0-12cross1
package) compiles the new version with an allmodconfig to more compact
code:

	$ source/scripts/bloat-o-meter drivers/pwm/pwm-stm32.o-pre drivers/pwm/pwm-stm32.o
	add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-488 (-488)
	Function                                     old     new   delta
	stm32_pwm_get_state                          968     936     -32
	stm32_pwm_apply_locked                      1920    1464    -456

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/d7ef7a6158df4ba6687233b0e00d37796b069fb3.1718791090.git.u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:53:51 +02:00
Uwe Kleine-König
2b17a6eeb3 Immutable branch between MFD and Counter due for the v5.11 merge window
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmZ+yEcACgkQUa+KL4f8
 d2H01hAAlhfLqliQqjqTMcAUqAgpxxWeZHZedS1ODVKq0Sp25n07AULZGtL8qX30
 EQhtnmjZahixG8NrNxWW8cX8GJ4Dy0GlkFbKvlcTZdCb3OLUVetbfQm3GeTPfblo
 P6LkgI+PO3nggV3T34Cc1nJnF338pHQC7NzFdzjfxJuk4kzRdSjqlG9pRV2221pK
 oVAsmYO8jORqwzX6rj/lrrL+Hw6rlGAl2JcaD+fdiIVrkfaXRlAMaugIQ2kHmvJ5
 IN99KdXM2PMMq6Qy7XT8oQLzRqn/Gru/6bDqgpIRIWUszs1PEL4TkzfFY85+0eux
 ckOHiGm66OzeoGVw76f22yK2GKfU37kB+ykstYTfc8ERqE7EwuM5xwobR12iLjqD
 /VGSnJVshV0rgwiNOrhtW5JYK9lWaS+MCNwuBl1nNUROCgl62f6UqQXzlXE+NB0x
 LagjMTQ2w48vCb30XpDxyJlEEVI0KgC/Txotx3kEYLE+gvaWnEysvGjOvFtZPX9t
 Qb096aOfm2F6Cbsmi/u/jUaiZVh7UMNt+i+8sxt8S82lZamHbVzhNruAxtbRbVwP
 rYprJY0aZ28lLILitB7rY4HbynJJg8WYhEi+4jO2YHk+J0t2vdbT4FvrdK5pfsWW
 thSkYEPGh5VoVLjzvBgXwHGQGutrh8gR2cZ/UPBZgqEsRNi1q8A=
 =vVz7
 -----END PGP SIGNATURE-----

Merge tag 'ib-mfd-counter-v5.11' of https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into HEAD

Immutable branch between MFD and Counter due for the v5.11 merge window
2024-07-10 17:53:40 +02:00
Frank Li
30122ce2b9 dt-bindings: pwm: imx: remove interrupt property from required
The driver "drivers/pwm/pwm-imx27.c" never use interrupt. Generally pwm
hardware generate a waveform according to register timing setting. Needn't
interrupt handle at all. So remove it from "required" list.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240605220839.1398872-1-Frank.Li@nxp.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:52:47 +02:00
Junyi Zhao
2ed3284f31 pwm: meson: Add support for Amlogic S4 PWM
Add support for Amlogic S4 PWM.

Signed-off-by: Junyi Zhao <junyi.zhao@amlogic.com>
Signed-off-by: Kelvin Zhang <kelvin.zhang@amlogic.com>
Reviewed-by: George Stark <gnstark@salutedevices.com>
Link: https://lore.kernel.org/r/20240613-s4-pwm-v8-1-b5bd0a768282@amlogic.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:52:47 +02:00
Vincent Whitchurch
7f61257cd6 pwm: Add GPIO PWM driver
Add a software PWM which toggles a GPIO from a high-resolution timer.

This will naturally not be as accurate or as efficient as a hardware
PWM, but it is useful in some cases.  I have for example used it for
evaluating LED brightness handling (via leds-pwm) on a board where the
LED was just hooked up to a GPIO, and for a simple verification of the
timer frequency on another platform.

Since high-resolution timers are used, sleeping GPIO chips are not
supported and are rejected in the probe function.

Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Co-developed-by: Stefan Wahren <wahrenst@gmx.net>
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Co-developed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Link: https://lore.kernel.org/r/20240604-pwm-gpio-v7-2-6b67cf60db92@linaro.org
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:52:47 +02:00
Nicola Di Lieto
1577ddaa51 dt-bindings: pwm: Add pwm-gpio
Add bindings for PWM modulated by GPIO.

Signed-off-by: Nicola Di Lieto <nicola.dilieto@gmail.com>
Co-developed-by: Stefan Wahren <wahrenst@gmx.net>
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240604-pwm-gpio-v7-1-6b67cf60db92@linaro.org
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:52:47 +02:00
Uwe Kleine-König
da804fa9bc pwm: Drop pwm_apply_state()
This function is not supposed to be used any more since commit
c748a6d77c ("pwm: Rename pwm_apply_state() to
pwm_apply_might_sleep()") that is included in v6.8-rc1. Two kernel
releases should be enough for everyone to adapt, so drop the old
function that was introduced as a compatibility stub for the transition.

Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:52:47 +02:00
Sean Young
f8b03e5c72 bus: ts-nbus: Use pwm_apply_might_sleep()
pwm_apply_state() is deprecated since commit c748a6d77c ("pwm: Rename
pwm_apply_state() to pwm_apply_might_sleep()").

Signed-off-by: Sean Young <sean@mess.org>
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/20240614090829.560605-1-sean@mess.org
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:52:47 +02:00
Uwe Kleine-König
a96d3659c9 pwm: Remove wrong implementation details from pwm_ops's documentation
When .get_state() is called is an implementation detail that
implementors and users shouldn't care about and rely on. Additionally
it's wrong, because with PWM_DEBUG enabled it is called more often.

Just drop the wrong statement.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/611ba758d7e9fb2695e96b23cb7ceeefb6ba8513.1717756902.git.u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:52:47 +02:00
Uwe Kleine-König
d6f66e2926 pwm: Make pwm_request_from_chip() private to the core
The last user of this function outside of core.c is gone, so it can be
made static.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20240607084416.897777-8-u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:52:47 +02:00
Uwe Kleine-König
40571a5b3b pwm: cros-ec: Simplify device tree xlation
The cros-ec device tree binding only uses #pwm-cells = <1>, and so there
is no period provided in the device tree. Up to now this was handled by
hardcoding the period to the only supported value in the custom xlate
callback. Apart from that, the default xlate callback (i.e.
of_pwm_xlate_with_flags()) handles this just fine (and better, e.g. by
checking args->args_count >= 1 before accessing args->args[0]).

To simplify make use of of_pwm_xlate_with_flags(), drop the custom
callback and provide the default period in .probe() already.

Apart from simplifying the driver this also drops the last non-core user
of pwm_request_from_chip() and so makes further simplifications
possible.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20240607084416.897777-7-u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:52:47 +02:00
Uwe Kleine-König
f7d5463e2a pwm: cros-ec: Don't care about consumers in .get_state()
The get_state() callback is never called (in a visible way) after there
is a consumer for a pwm device. The core handles loosing the information
about duty_cycle just fine.

Simplify the driver accordingly.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20240607084416.897777-6-u.kleine-koenig@baylibre.com
[Drop kdoc comment for channel to make W=1 builds happy]
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:52:47 +02:00
Uwe Kleine-König
33c651a3fb pwm: Make use of a symbol namespace for the core
Define all pwm core's symbols in the namespace "PWM". The necessary
module import statement is just added to the main header, this way every
file that knows about the public functions automatically has this
namespace available.

Thanks to Biju Das for pointing out a cut'n'paste failure in my initial
patch.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/20240607160012.1206874-2-u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:52:47 +02:00
Jeff Johnson
2c69747c10 pwm: add missing MODULE_DESCRIPTION() macros
make allmodconfig && make W=1 C=1 reports:
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/pwm/pwm-imx1.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/pwm/pwm-imx27.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/pwm/pwm-intel-lgm.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/pwm/pwm-mediatek.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/pwm/pwm-pxa.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/pwm/pwm-samsung.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/pwm/pwm-spear.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/pwm/pwm-visconti.o

Add the missing invocations of the MODULE_DESCRIPTION() macro.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://lore.kernel.org/r/20240610-md-drivers-pwm-v2-1-b337cfaa70ea@quicinc.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:52:46 +02:00
Uwe Kleine-König
3555f8ff30 pwm: axi-pwmgen: Make use of regmap_clear_bits()
Instead of using regmap_update_bits() and passing val=0, better use
regmap_clear_bits().

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Acked-by: Trevor Gamblin <tgamblin@baylibre.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240606164047.534741-6-u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:52:46 +02:00
Uwe Kleine-König
32b4f1a4f0 pwm: jz4740: Another few conversions to regmap_{set,clear}_bits()
Similar to commit 7d91999954 ("pwm: jz4740: Use
regmap_{set,clear}_bits") convert two more regmap_update_bits() calls to
regmap_{set,clear}_bits() which were missed back then.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20240606164047.534741-5-u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:52:46 +02:00
Drew Fustini
41814fe5c7 pwm: Add driver for AXI PWM generator
Add support for the Analog Devices AXI PWM Generator. This device is an
FPGA-implemented peripheral used as PWM signal generator and can be
interfaced with AXI4. The register map of this peripheral makes it
possible to configure the period and duty cycle of the output signal.

Link: https://analogdevicesinc.github.io/hdl/library/axi_pwm_gen/index.html
Co-developed-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com>
Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com>
Co-developed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Drew Fustini <dfustini@baylibre.com>
Acked-by: Nuno Sa <nuno.sa@analog.com>
Co-developed-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Link: https://lore.kernel.org/r/20240605203507.1934434-3-tgamblin@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:52:46 +02:00
Drew Fustini
1edf2c2a28 dt-bindings: pwm: Add AXI PWM generator
Add Analog Devices AXI PWM generator.

Link: https://analogdevicesinc.github.io/hdl/library/axi_pwm_gen/index.html
Signed-off-by: Drew Fustini <dfustini@baylibre.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Nuno Sa <nuno.sa@analog.com>
Co-developed-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Link: https://lore.kernel.org/r/20240605203507.1934434-2-tgamblin@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:52:46 +02:00
Frank Li
307d0a70d0 dt-bindings: pwm: fsl-ftm: Convert to yaml format
Convert dt-bindings pwm-fsl-ftm.txt to yaml format.

Additional change during convert:
- "big-endian" is not required property.
- Add "sleep" to pinctrl-names.
- Change pinctrl-NNN to pinctrl-0 and pinctrl-1.
- Remove label "pwm0" in example.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240528202025.2919358-1-Frank.Li@nxp.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:52:46 +02:00
Uwe Kleine-König
37f7707077 pwm: atmel-tcb: Fix race condition and convert to guards
The hardware only supports a single period length for both PWM outputs. So
atmel_tcb_pwm_config() checks the configuration of the other output if it's
compatible with the currently requested setting. The register values are
then actually updated in atmel_tcb_pwm_enable(). To make this race free
the lock must be held during the whole process, so grab the lock in
.apply() instead of individually in atmel_tcb_pwm_disable() and
atmel_tcb_pwm_enable() which then also covers atmel_tcb_pwm_config().

To simplify handling, use the guard helper to let the compiler care for
unlocking. Otherwise unlocking would be more difficult as there is more
than one exit path in atmel_tcb_pwm_apply().

Fixes: 9421bade07 ("pwm: atmel: add Timer Counter Block PWM driver")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20240709101806.52394-3-u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
2024-07-10 17:51:04 +02:00
Yi Liu
5a88a3f67e vfio/pci: Init the count variable in collecting hot-reset devices
The count variable is used without initialization, it results in mistakes
in the device counting and crashes the userspace if the get hot reset info
path is triggered.

Fixes: f6944d4a0b ("vfio/pci: Collect hot-reset devices to local buffer")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=219010
Reported-by: Žilvinas Žaltiena <zaltys@natrix.lt>
Cc: Beld Zhang <beldzhang@gmail.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20240710004150.319105-1-yi.l.liu@intel.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2024-07-10 08:47:46 -06:00
Armin Wolf
b6e02c6b03 platform/x86: toshiba_acpi: Fix array out-of-bounds access
In order to use toshiba_dmi_quirks[] together with the standard DMI
matching functions, it must be terminated by a empty entry.

Since this entry is missing, an array out-of-bounds access occurs
every time the quirk list is processed.

Fix this by adding the terminating empty entry.

Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202407091536.8b116b3d-lkp@intel.com
Fixes: 3cb1f40dfd ("drivers/platform: toshiba_acpi: Call HCI_PANEL_POWER_ON on resume on some models")
Cc: stable@vger.kernel.org
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240709143851.10097-1-W_Armin@gmx.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2024-07-10 16:12:12 +02:00
Uwe Kleine-König
04e3bb0b00 hwmon: (pmbus/ltc4286) Drop unused i2c device ids
The driver doesn't make use of the different numbers assigned to the
different devices. So drop them.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/9a48ba0368e0c8cddc94c5e4cf3edd7eadc03a2d.1720600141.git.u.kleine-koenig@baylibre.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-10 07:11:34 -07:00