Commit graph

1255 commits

Author SHA1 Message Date
Tony Lindgren
e5deb8f76e bus: ti-sysc: Fix SYSC_QUIRK_SWSUP_SIDLE_ACT handling for uart wake-up
The uarts should be tagged with SYSC_QUIRK_SWSUP_SIDLE instead of
SYSC_QUIRK_SWSUP_SIDLE_ACT. The difference is that SYSC_QUIRK_SWSUP_SIDLE
is used to force idle target modules rather than block idle during usage.

The SYSC_QUIRK_SWSUP_SIDLE_ACT should disable autoidle and wake-up when
a target module is active, and configure autoidle and wake-up when a
target module is inactive. We are missing configuring the target module
on sysc_disable_module(), and missing toggling of the wake-up bit.

Let's fix the issue to allow uart wake-up to work.

Fixes: fb685f1c19 ("bus: ti-sysc: Handle swsup idle mode quirks")
Tested-by: Dhruva Gole <d-gole@ti.com>
Tested-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-09-13 10:24:53 +03:00
Adam Ford
11729caa52 bus: ti-sysc: Fix missing AM35xx SoC matching
Commit feaa8baee8 ("bus: ti-sysc: Implement SoC revision handling")
created a list of SoC types searching for strings based on names
and wildcards which associates the SoC to different families.

The OMAP34xx and OMAP35xx are treated as SOC_3430 while
OMAP36xx and OMAP37xx are treated as SOC_3630, but the AM35xx
isn't listed.

The AM35xx is mostly an OMAP3430, and a later commit a12315d6d2
("bus: ti-sysc: Make omap3 gpt12 quirk handling SoC specific") looks
for the SOC type and behaves in a certain way if it's SOC_3430.

This caused a regression on the AM3517 causing it to return two
errors:

 ti-sysc: probe of 48318000.target-module failed with error -16
 ti-sysc: probe of 49032000.target-module failed with error -16

Fix this by treating the creating SOC_AM35 and inserting it between
the SOC_3430 and SOC_3630.  If it is treaed the same way as the
SOC_3430 when checking the status of sysc_check_active_timer,
the error conditions will disappear.

Fixes: a12315d6d2 ("bus: ti-sysc: Make omap3 gpt12 quirk handling SoC specific")
Fixes: feaa8baee8 ("bus: ti-sysc: Implement SoC revision handling")
Signed-off-by: Adam Ford <aford173@gmail.com>
Message-ID: <20230906233442.270835-1-aford173@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-09-11 06:04:17 +03:00
Julien Panis
d929b2b746 bus: ti-sysc: Use fsleep() instead of usleep_range() in sysc_reset()
The am335x-evm started producing boot errors because of subtle timing
changes:

Unhandled fault: external abort on non-linefetch (0x1008) at 0xf03c1010
...
sysc_reset from sysc_probe+0xf60/0x1514
sysc_probe from platform_probe+0x5c/0xbc
...

The fix consists in using the appropriate sleep function in sysc reset.
For flexible sleeping, fsleep is recommended. Here, sysc delay parameter
can take any value in [0 - 255] us range. As a result, fsleep() should
be used, calling udelay() for a sysc delay lower than 10 us.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
Fixes: e709ed70d1 ("bus: ti-sysc: Fix missing reset delay handling")
Message-ID: <20230821-fix-ti-sysc-reset-v1-1-5a0a5d8fae55@baylibre.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-09-11 06:04:17 +03:00
Linus Torvalds
1c9f8dff62 Char/Misc driver changes for 6.6-rc1
Here is the big set of char/misc and other small driver subsystem
 changes for 6.6-rc1.
 
 Stuff all over the place here, lots of driver updates and changes and
 new additions.  Short summary is:
   - new IIO drivers and updates
   - Interconnect driver updates
   - fpga driver updates and additions
   - fsi driver updates
   - mei driver updates
   - coresight driver updates
   - nvmem driver updates
   - counter driver updates
   - lots of smaller misc and char driver updates and additions
 
 All of these have been in linux-next for a long time with no reported
 problems.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZPH64g8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ynr2QCfd3RKeR+WnGzyEOFhksl30UJJhiIAoNZtYT5+
 t9KG0iMDXRuTsOqeEQbd
 =tVnk
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver updates from Greg KH:
 "Here is the big set of char/misc and other small driver subsystem
  changes for 6.6-rc1.

  Stuff all over the place here, lots of driver updates and changes and
  new additions. Short summary is:

   - new IIO drivers and updates

   - Interconnect driver updates

   - fpga driver updates and additions

   - fsi driver updates

   - mei driver updates

   - coresight driver updates

   - nvmem driver updates

   - counter driver updates

   - lots of smaller misc and char driver updates and additions

  All of these have been in linux-next for a long time with no reported
  problems"

* tag 'char-misc-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (267 commits)
  nvmem: core: Notify when a new layout is registered
  nvmem: core: Do not open-code existing functions
  nvmem: core: Return NULL when no nvmem layout is found
  nvmem: core: Create all cells before adding the nvmem device
  nvmem: u-boot-env:: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
  nvmem: sec-qfprom: Add Qualcomm secure QFPROM support
  dt-bindings: nvmem: sec-qfprom: Add bindings for secure qfprom
  dt-bindings: nvmem: Add compatible for QCM2290
  nvmem: Kconfig: Fix typo "drive" -> "driver"
  nvmem: Explicitly include correct DT includes
  nvmem: add new NXP QorIQ eFuse driver
  dt-bindings: nvmem: Add t1023-sfp efuse support
  dt-bindings: nvmem: qfprom: Add compatible for MSM8226
  nvmem: uniphier: Use devm_platform_get_and_ioremap_resource()
  nvmem: qfprom: do some cleanup
  nvmem: stm32-romem: Use devm_platform_get_and_ioremap_resource()
  nvmem: rockchip-efuse: Use devm_platform_get_and_ioremap_resource()
  nvmem: meson-mx-efuse: Convert to devm_platform_ioremap_resource()
  nvmem: lpc18xx_otp: Convert to devm_platform_ioremap_resource()
  nvmem: brcm_nvram: Use devm_platform_get_and_ioremap_resource()
  ...
2023-09-01 09:53:54 -07:00
Linus Torvalds
a1c19328a1 ARM: SoC cleanups for 6.6
These are all minor cleanups for platform specific code in arch/arm/
 and some of the associated drivers. The majority of these are work
 done by Rob Herring to improve the way devicetreee header files
 are handled.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTuaDEACgkQYKtH/8kJ
 UicmKQ/6A506T45KbbCLsqMuJsGdjMdOKdBecssLWhFNhRoJhJB6YilQVjBUAK4D
 vDqc425IcxXwaW+4OVBFCgVpKKMlrLSpHVJHl6QaGsxAZt5xdhwcA4ttQcFvoQtK
 csuwOadO9g1K4Px29J8GFR/FvFNt8kHRxbRC3xcGfFsFvgXISAiLUv8w6Z5O8Z5W
 /sp+EsOkJWTTKu+vtcMXccGqM9eGNOfPK1bCUElJ1+HW3jZrbRw0zZrQ2QS72N2P
 wpO2f6JUTpiiMH8XhQd3REi3Kli+g0GxVlCStZc/0qf/uW70YanF4CPDdSOVJ5OL
 l05Qfx+/XsGyqt3el03UoIXfM1YzvWn5BeqNG/QGHkai7Lp/c8LvSk1NiwaS0dzi
 QcPCEK67wjoaBCdSAMKGYM/qlmffuLh9/NJM5dzdBE8zQ5rC1XorR2aHGyISQJt6
 tDlDXy14zyR3KRxOoqP6cWp+PFDcBksd44cxGbp/Lcc389UKxX8j4fM8yUNT+4Rh
 gZ5OtUMs5QhFJBhBbBxW6O3TMuhwjSdW7IEQafKiiHEOFucf6Zcxd9u9B2yzsdtU
 za6mpA/NEBIc3olv6IFIdT24+M3PLhqCbu6YL5YI4jBf0QNpXjRBr+EOtvt2mvC9
 JkoggyCf5LdDt833G/TBPpx0VYi8h0m7cQnMw4JjOIA8FvCwIdc=
 =c9NM
 -----END PGP SIGNATURE-----

Merge tag 'soc-arm-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull ARM SoC cleanups from Arnd Bergmann:
 "These are all minor cleanups for platform specific code in arch/arm/
  and some of the associated drivers. The majority of these are work
  done by Rob Herring to improve the way devicetreee header files are
  handled"

* tag 'soc-arm-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (49 commits)
  ARM: davinci: Drop unused includes
  ARM: s5pv210: Explicitly include correct DT includes
  ARM: dove: Drop unused includes
  ARM: mvebu: Explicitly include correct DT includes
  Documentation/process: maintainer-soc: document dtbs_check requirement for Samsung
  MAINTAINER: samsung: document dtbs_check requirement for Samsung
  Documentation/process: maintainer-soc: add clean platforms profile
  MAINTAINERS: soc: reference maintainer profile
  ARM: nspire: Remove unused header file mmio.h
  ARM: nspire: Use syscon-reboot to handle restart
  soc: fsl: Explicitly include correct DT includes
  soc: xilinx: Explicitly include correct DT includes
  soc: sunxi: Explicitly include correct DT includes
  soc: rockchip: Explicitly include correct DT includes
  soc: mediatek: Explicitly include correct DT includes
  soc: aspeed: Explicitly include correct DT includes
  firmware: Explicitly include correct DT includes
  bus: Explicitly include correct DT includes
  ARM: spear: Explicitly include correct DT includes
  ARM: mvebu: Explicitly include correct DT includes
  ...
2023-08-30 16:49:40 -07:00
Linus Torvalds
1544df9ab4 ARM: SoC drivers for 6.6
The main change this time is the introduction of the drivers/genpd
 subsystem that gets split out from drivers/soc to keep common
 functionality together. Ulf Hansson is taking over maintainership for
 these and is sending a separate pull request with the same commits,
 but they are in the soc drivers tree to avoid conflicts against other
 soc driver patches.
 
 The SCMI driver subsystem gets an update to version 3.2 of the
 specification. There are also updates to memory, reset and other firmware
 drivers.
 
 On the soc driver side, the updates are mostly cleanups across a number
 of Arm platforms. On driver for loongarch adds power management for DT
 based systems, another driver is for HiSilicon's Arm server chips with
 their HCCS system health interface.
 
 The remaining updates for the most part add support for additional
 hardware in existing drivers or contain minor cleanups. Most of these
 are for the Qualcomm Snapdragon platform.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTuWdMACgkQYKtH/8kJ
 UicprBAAsvZ5h636MOwYasgK1bKnsWgj9yrBSzIf7VzKbBS5/QCrDSDek9oDvTBp
 p6Rr+WC1RQl9i2DiRVSbEqkUS6X4hQF0kJdLudBwYuxBDf8ayzFzKAKk/ecsyoaC
 0Rkeh4fCu1zVnQ2DZSPFJVRl01/oCr1ZtJ1W0UrXCslOSQy2987VqpJ/EQbaDLgb
 3imxpvJNBscaKwcYRgxhcIMBLdGi3qXRE/TmAf1WMe8w6dfk5KmFiPPD7zxPTnFb
 0fssdxgocjOkXEn6L1VdBMoTt4UQaU+xbnFsOsDA/F0EjR9ZLlhtwZxANv4GicP6
 52FMFaxeXSUnpBelzuyRQpgnt9WW3ZbBGb9iaisTl1pwjC3PcN2noo8uFZk+kO6b
 8q0fh4KVmD0QIupC4cfTsF4SGAQvnhko2ls9bt4FTF+z0COV3Ifs2cAggH+hn3yD
 IziBrUUZrR4G8XhisJRQNZcRh1H/vVchcumqsxzCMhpXLWwdZ5vW85GCR/fAtQQT
 woYgqFHXZjEko66bu2dtayr1dgmPvfbO6rXpUkIdeskY6XuKfZXuB93LkhsZ17LY
 dfAaBLUebjMcpLrltCqyP1tUoqGyVOTJKxtB2MolHo/V/2JbKYmYHAMy+qX5I0Qm
 UUbQDpHnkaQMTK2L/qvdfE4lgwWfFWX7lCK/AGa4ZBFl+Zl6DgE=
 =xmHW
 -----END PGP SIGNATURE-----

Merge tag 'soc-drivers-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull ARM SoC driver updates from Arnd Bergmann:
 "The main change this time was the introduction of the drivers/genpd
  subsystem that gets split out from drivers/soc to keep common
  functionality together.

  The SCMI driver subsystem gets an update to version 3.2 of the
  specification. There are also updates to memory, reset and other
  firmware drivers.

  On the soc driver side, the updates are mostly cleanups across a
  number of Arm platforms. On driver for loongarch adds power management
  for DT based systems, another driver is for HiSilicon's Arm server
  chips with their HCCS system health interface.

  The remaining updates for the most part add support for additional
  hardware in existing drivers or contain minor cleanups. Most of these
  are for the Qualcomm Snapdragon platform"

* tag 'soc-drivers-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (136 commits)
  bus: fsl-mc: Use common ranges functions
  soc: kunpeng_hccs: fix some sparse warnings about incorrect type
  soc: loongson2_pm: add power management support
  soc: dt-bindings: add loongson-2 pm
  soc: rockchip: grf: Fix SDMMC not working on RK3588 with bus-width > 1
  genpd: rockchip: Add PD_VO entry for rv1126
  bus: ti-sysc: Fix cast to enum warning
  soc: kunpeng_hccs: add MAILBOX dependency
  MAINTAINERS: remove OXNAS entry
  dt-bindings: interrupt-controller: arm,versatile-fpga-irq: mark oxnas compatible as deprecated
  irqchip: irq-versatile-fpga: remove obsolete oxnas compatible
  soc: qcom: aoss: Tidy up qmp_send() callers
  soc: qcom: aoss: Format string in qmp_send()
  soc: qcom: aoss: Move length requirements from caller
  soc: kunpeng_hccs: fix size_t format string
  soc: ti: k3-socinfo.c: Add JTAG ID for AM62PX
  dt-bindings: firmware: qcom: scm: Updating VMID list
  firmware: imx: scu-irq: support identifying SCU wakeup source from sysfs
  firmware: imx: scu-irq: enlarge the IMX_SC_IRQ_NUM_GROUP
  firmware: imx: scu-irq: add imx_scu_irq_get_status
  ...
2023-08-30 16:42:21 -07:00
Rob Herring
09959520d2
bus: fsl-mc: Use common ranges functions
Since commit 3d5089c426 ("of/address: Add support for 3 address cell
bus"), the DT address functions can handle translating buses with 3
address cells. Replace the custom code with the for_each_of_range()
iterator.

The original code had fallbacks to get "#address-cells"/"#size-cells"
from the bus parent node if they are missing. This is non-standard
behavior, and AFAICT the upstream .dts files never relied on that.

Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Tested-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230823190958.2717267-1-robh@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-08-29 16:02:00 -04:00
Arnd Bergmann
6681618814 Driver changes for omaps for v6.6
Driver changes for ti-sysc interconnect target module driver and for
 l3 interconnect error handler. The ti-sysc driver changes just enable
 using it for 64-bit systems like TI am62 that have wake-up capability
 for the wkup domain devices. The l3 error handling improves the code
 to show the error source if an unrecoverable timeout error occurs.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEkgNvrZJU/QSQYIcQG9Q+yVyrpXMFAmTcS0cRHHRvbnlAYXRv
 bWlkZS5jb20ACgkQG9Q+yVyrpXOtdA/+KwjCGqOpG3FDvgrLuLtL3ELKAat/LO1O
 eIWUvpLWX4b067AaYaEk6KRngTYGdj+KM99k88cydBY2JvFXXD3ivg5QVZoJ3aKm
 jiQfuouVcy6ea4ymOOfW81N9ugpTafBcSdtZomEEPF8HSCRkPD2FnzmK60BKLN/j
 7s6UMGrwwwL3+2xqitsLUDlcD5dJ2a2tSf2NXy2PFrtQbx3DqR65HYwEGvncyFxR
 YvPKFKeT0yzt/wyZ7CGhuJPVqzAWeCWsjFnqcGscmjc7e4v6a14iR+vUo5qkaKo8
 TvHWcFRsBlmvERcLGjSH5wnZnhqm46uc+9AVucpSVIOIDcljQX5D2/vuwZ2P7Zay
 jnaeCfrrGpFOXi5JaeFRM99ihvv1VrvQKOamsz5/XZjNCEri/f9TM4M28AmkB3FB
 vFZaJBbQfgYIahrE8pmXN2A6LB0QyubHkBDoYD6BKQRN/sz0t+WEEl7BS/qakO5K
 lzj5m/sXDPdb6ORzo5S/hFoOyOBA+EuheXuMRI96XkRK2aF/3jPW5t7IRh1dc9pa
 uv0NVeBc7Jf3vtRA60pO8ecc8YKZmO8hEK9cmhUyXDsgFfG7awXIEJyGc31NDWRz
 er26bjGjR0ELbZRlpJMpD1mYdkwfWFhnxQ5jFDIzcCMv5P2p5iJdZpryFZfCbt8t
 jscs2HgPX6Y=
 =//Xy
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTkDGcACgkQYKtH/8kJ
 UifhxBAAzjHmDaL0JgVuAi0l9W9W8CYUnZre4S6qAu6349oEaRdpzChE6KWxCCvd
 xDginfnU93vXuxvsvTRauW9E63jLQ8vh6XyTpHV+yhbJj8x+NlkK6smp0cGCqClE
 cC0w/lg6HrJpkbxcK/PgSlAAFbyCmdsW5T/g+UC5Ip5Ts1pBn8xbdGBMAtzu7Clp
 oxqxC6RDDObeUJ5/kUI9ryIG0cH8CtSnrvz0eDLckCt1mhO6Ofw1URxzyTUc79jc
 rX69r9v1nPHU++5XuPXAPWc5nWXvwfKJAOXxyHIHO3kMUsEPum+Dd04vTRTD7SzS
 j1oiNVqEWocd7DLh8CTNx73hwJyxfjDLv9U2avg5lts6TG5eloAyf/CzCxEC29jo
 TSQn8W6yw4rueemzoNUypIKH5t1lkvpkbGZhIiEQf7iBCOx3b7pRJZAkWOniC/Xj
 Uw/w1aICfxPPXAfsxGpMC8hIZLhu8aS+He+4tUghWD1HFfxshnSYOcKpw2Cqp8P2
 aTgEVTLUzaEw086S/fSKM6+fsT9Fl5vMjH5KxMmRP9k7jhu96SuHX8UV0zKVvYom
 U0IvQ2E8rtgoB2zQ3MeaNh0bmyA6PZL3QDpNg4ymWVkvITh6RXFpjXB8XIQh4unA
 ivXP4YSJnPFOM4cXlSYykx5nysOKvHkgy3OjfBMSMcqdCMP2avI=
 =QAxs
 -----END PGP SIGNATURE-----

Merge tag 'omap-for-v6.6/ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into soc/drivers

Driver changes for omaps for v6.6

Driver changes for ti-sysc interconnect target module driver and for
l3 interconnect error handler. The ti-sysc driver changes just enable
using it for 64-bit systems like TI am62 that have wake-up capability
for the wkup domain devices. The l3 error handling improves the code
to show the error source if an unrecoverable timeout error occurs.

* tag 'omap-for-v6.6/ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  bus: ti-sysc: Fix cast to enum warning
  bus: ti-sysc: Fix a build warning with W=1 for sysconfig
  bus: ti-sysc: Configure uart quirks for k3 SoC
  bus: ti-sysc: Build driver for TI K3 SoCs
  bus: ti-sysc: Fix build warning for 64-bit build
  bus: omap_l3_smx: identify timeout cause before rebooting

Link: https://lore.kernel.org/r/pull-1692158857-597450@atomide.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-08-21 21:16:23 -04:00
Tony Lindgren
de44bf2f76 bus: ti-sysc: Fix cast to enum warning
Fix warning for "cast to smaller integer type 'enum sysc_soc' from 'const
void *'".

Cc: Nishanth Menon <nm@ti.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308150723.ziuGCdM3-lkp@intel.com/
Fixes: e1e1e9bb9d ("bus: ti-sysc: Fix build warning for 64-bit build")
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-08-15 08:52:01 +03:00
Arnd Bergmann
9fb9ae8061 i.MX drivers update for 6.6:
- A series from NXP i.MX developers (Peng Fan, etc.) to update imx-scu
   and imx-scu-irq firmware drivers.
 - Add dedicated lockdep class for nested genpd locks to fix a lockdep
   warning in imx93-blk-ctrl driver.
 - A change from Rob to explicitly include correct DT headers for i.MX
   SoC drivers.
 - Use devm_platform_ioremap_resource() in imx-weim bus driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmTYNCAUHHNoYXduZ3Vv
 QGtlcm5lbC5vcmcACgkQUFdYWoewfM7x+wgAsB65MMhY74a8pjuO0q1nJierjc46
 of2ayxR8I1jXQK/3IUijBZpg+8bnQkhXiVK1uyzvLmUc28iw1y6B2dWec/hXRld8
 mc516IWjGa0Re+dOeliKPFNWzj6TZRi3TmqKIfg5XIb0poBtxBiXm7tvjm1oYRQl
 ijkCqauOXJmK3yMMTQqxknGQG+B8wQDTPnbssk0A46ShD4RrYXmC3wjTEb27WoGk
 nw18XT5XpS+LomctRcqza3Bcdry6YPmI0hOt9Oy9db2sBtXbz+bf9tLGKztvfxGz
 44R0+Rz/XncJHwRXGgUNR71ps0+WP55qKsqoTw/zHhkS2BPl8gMxhBtQbQ==
 =T2Uo
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTaT8sACgkQYKtH/8kJ
 UieFHQ//YrvUhNJjVtQeUcZ4s43MKKJsq7HNnki02ZRlIOdcG+vM7JzWe6PsRDbK
 8jeV1tM3ZE67VBeIZU1+ELshebiU01VQY4ZobmGOPMajDFXZmu1Znzr8O6RASrmd
 u+aFhpTGleg4SQQ2avdaQIQ4gpw19ciellxCTx37Y/hae06nANXzFFTlnPO4qseW
 rzJzgh2h3Z1Gv/LdqtlfMAeI2aEQy/+hfKmZs4f20/Rs8wwH7lzrNLSUideY6cqt
 RM1nX3F97b+glRJ4siqRoUISVSW6naWkb5qZ+VZXN4e7xrczuV/1Sp2dqINWXxKp
 dR3WpOfb2V9sIGQOiAb8XSFBkxvDVG6ze6l2RkXA0szqpVBRMOTGshykMqt2I2tN
 8Eeek9+XXZHZxNR6omFX4cvTjRW7hvhB0W35UdoZr1qteC8jV/H1DBYV3v8ri1d8
 z17Y0JGBFrtQFBF/jq1yK0WND4RIb2aHYxrojDQ3/mtqsMailIuogwGpMQyhsCll
 nX2NeKpaKe3MwEtKPOSTkUD5k8TLBfDOn/fcoLRQ6Ys6fsBAcplJ+6Sp3Hv/mgWQ
 W9eWaeBAh0BllI66twAxeTKdy/1IsGpsLyNVDJliAExW3Z1ISPUMw6pI4M+H/QZY
 W+joqcvJYAAiOfIvRqQWvyt40I/2JYx6otsJKN4JB9Qlh3QRvxg=
 =2iHc
 -----END PGP SIGNATURE-----

Merge tag 'imx-drivers-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/drivers

i.MX drivers update for 6.6:

- A series from NXP i.MX developers (Peng Fan, etc.) to update imx-scu
  and imx-scu-irq firmware drivers.
- Add dedicated lockdep class for nested genpd locks to fix a lockdep
  warning in imx93-blk-ctrl driver.
- A change from Rob to explicitly include correct DT headers for i.MX
  SoC drivers.
- Use devm_platform_ioremap_resource() in imx-weim bus driver.

* tag 'imx-drivers-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  firmware: imx: scu-irq: support identifying SCU wakeup source from sysfs
  firmware: imx: scu-irq: enlarge the IMX_SC_IRQ_NUM_GROUP
  firmware: imx: scu-irq: add imx_scu_irq_get_status
  firmware: imx: scu-irq: fix RCU complaint after M4 partition reset
  firmware: imx: scu: use EOPNOTSUPP
  firmware: imx: scu: use soc name for soc_id
  firmware: imx: scu: increase RPC timeout
  firmware: imx: scu: change init level to subsys_initcall_sync
  soc: imx: Explicitly include correct DT includes
  bus: imx-weim: use devm_platform_ioremap_resource
  soc: imx: imx93-blk-ctrl: Add dedicated lockdep class for nested genpd locks

Link: https://lore.kernel.org/r/20230813133354.847010-1-shawnguo@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-08-14 18:01:15 +02:00
Arnd Bergmann
347cdfc86b - simplify code in sunxi-rsb
- fix includes in sunxi_sram
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQSPRixG1tysKC2PKM10Ba7+DO8kkwUCZM/fegAKCRB0Ba7+DO8k
 k0sUAP9AXs6bJxGl01XCSTocVIU0sGj5Jsi7ZuWtRk3gMtJOuwEAnHzAnLGUdPEs
 127hYOlrAtRqfS+Uq1pbfA1PeRgdWAs=
 =7pO9
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTXWf4ACgkQYKtH/8kJ
 UicyCBAAydXQSklz/awt58USpxv8QLzbS3oiJ1QSqbsvLQgzpVwMu2tVS8Bq8ZB5
 jdgJmMAZ8wU3WwvOqC3PajA4bkc9OkyVkPGmDB+ZOSE7YwWlaqLTMDSrl1adtPgP
 oxTKZ8ypLErrVEHYOwFABgkWZ4W2v9fgJLe0r+LNsEmpkJ6lGdVc80qbsE5W7NeB
 P1zcZt8uxlCoU0t1O0sbU7vcUykHalaxjfTJ5lvGV3fL0TO+Cyz4WnlgPW/yNrYW
 qC6J6FfB+OH4aEcA5+EakERmIStv2nWZOK0eJRXbA8ZngxCuUBm0o0NwzhnXcGPq
 j5GbMtfK8yn9nVy+oIlC2XBcWDBM9vwZHR5HviFHKMtiCtIX32yVfVm25xvsMpZv
 igyUl3YIY3Re9hO2NYh8xEVx0/ArZd2namla5IZDi8B1ft82k5gGkDLGiZKglF2m
 cIciCtjJMwf6+Ky1izvnGrRTIZkwrXWDX7QmUdp24CfyTJfD6ZK/9JIEuKDeRx8T
 RxyFm6xyXNHA3OHMooKMFwo4gaAWaxkTsJtm4PKWozn03R8i4M5c6oxvC5yBo0M+
 v1i+y/a1jY0KGR0vGWVcjSQ4Fz+q85O8h0XzIG/ZtDYwAR4HpIJl404iTA1wX/Cy
 tGwi9Uky8wKwk8siyKh1ees/fN+VJA5nIiu+kjTH78r8zI7G46Q=
 =2Q13
 -----END PGP SIGNATURE-----

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

- simplify code in sunxi-rsb
- fix includes in sunxi_sram

* tag 'sunxi-drivers-for-6.6-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  soc: sunxi: Explicitly include correct DT includes
  bus: sunxi-rsb: Convert to devm_platform_ioremap_resource()

Link: https://lore.kernel.org/r/20230806180650.GA127142@jernej-laptop
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-08-12 12:07:58 +02:00
Arnd Bergmann
0fd70327d6 Arm Vexpress updates for v6.6
Couple of minor updates: Code simplification in the vexpress config bus
 driver with the use of devm_platform_ioremap_resource() and simplification
 of Arm Vexpress platform and related drivers entries in MAINTAINERS file.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEunHlEgbzHrJD3ZPhAEG6vDF+4pgFAmTM1OQACgkQAEG6vDF+
 4pg8IBAAzLxEVqsNc+uR12rQSIHU19pO3bsWgPpSgZ0lph6ilnNkCra1LPotjWSP
 RNfW/AFJ8z8KRXeZzAq06lNoiGcZ/iusiScRNfIumjnNgcKM3bOV+TdBI6XT7BXA
 HWlL3cKkX2RVQ4TXB6DgSnhdfogPq1GkUI9mdU3wwWo6bvq8+zVeLYbhJzXeW7UR
 IByhE/53io8o22IodtkDGVc56nDVioFJxvdE8BW0pSiD6Qxcj02maBRHioGMWstM
 bs63kIcf4hmzNLGO1TuO0zCUZsXKc2dbyKZ2czrB0hhgSGx1Nh+Y4OBjrrfDZkcp
 Jb/ICpVzdFhhz0rmxj1sgoD3VTvb+iNZ2dA7tsZFtPXZc6fHyW9bJycfLQKDTN7C
 dd5zCJPco+qKvGEaSuxg/mFMc7ZyvWVAaPo75RSr3UafSscdV7re+4x6CQZAWwwo
 L2C3MMkGJ62LjXfc58Hs9TxS4cBTw8JM8DHlGzjxMMxDwVVpkcD/Oq42Bp6+QHp8
 xF68qCmO0WXPKYqWW7vlT81P74QOtSwlqfhuX14Z8RR4uN+FBFKyNqWFq7aRMsgj
 Rq5XJTDUUcf5q1w4g43WEYE3XH4FlzriuxMOz8uvnkjw9DnVukZa9ZVUeQ+oYPho
 H7nGJmimBJ0gildthj3c7vxZy+VmotgmNn9FfPyIW7X01oTyiKY=
 =gL1v
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTXWQIACgkQYKtH/8kJ
 Uiek4hAAxlBLJCXNkT2/q12wQ5RvebldfYrigD6JSX+jU6mgtCfBqh7jxwyyQFaH
 vyCCtAG/G4Q0tuCZdevy2qVtWrAu337g5LhX2PdI7sQnXa0NqhjYd4V4/ft2+YLe
 UFuZI9sW9hJ04LKSIcTlyLdOqWd8Y6aGMpZPCcbBkpC1AjPkN5eizuAQHVBo/FN9
 CQ0iC75Mm/WIirT54IJzni1M8rRrQV5zJpRVtjQMPA7phQYShEMQdKcALdb3wXMd
 RJspQWRUpJgr+Bh30sEZZF1MXme++WE2b7mkDSuQYVoXXP1padKAxEwwbA33CXYk
 bFbvcGauqX6nycccqEsBtmP9w4LNq6D9k+wxQyRvfpwz35Tb/NHL+jkrN2xp1vWn
 xetXI+T2yPagWZ40q+9g705x6y9GGOHfvANlkEL4sJZiWDVE/5aIF6sCps03LgvC
 kNfwRUzNxxRaNo7qpjpPNmIu/nn+pMowOjbkXRb4NnqqmZTGooSzpDjuDHZXDuji
 HphJWA3Tw5BrABqf3jPT0v9mfsukVkKhPtHmspoK24FssDkG+vJaUzr3/F131Cfo
 DblMbTjySV1TsskUBfMnJdyx3FMoIOewZn5ktTiPvp8c5oixv8tcwSLIxIm76VYT
 /1jM/m06Rxd4BHqQHnXYYedtlP2SetPXWVSTQSM2DPeqdBblDrc=
 =B1eB
 -----END PGP SIGNATURE-----

Merge tag 'vexpress-updates-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers

Arm Vexpress updates for v6.6

Couple of minor updates: Code simplification in the vexpress config bus
driver with the use of devm_platform_ioremap_resource() and simplification
of Arm Vexpress platform and related drivers entries in MAINTAINERS file.

* tag 'vexpress-updates-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
  MAINTAINERS: Simplify entries for Arm Vexpress platform and related drivers
  bus: vexpress-config: Convert to devm_platform_ioremap_resource()

Link: https://lore.kernel.org/r/20230804123214.3258032-1-sudeep.holla@arm.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-08-12 12:03:45 +02:00
Rob Herring
53c5ae638d
bus: Explicitly include correct DT includes
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/20230803-dt-header-cleanups-for-soc-v2-16-d8de2cc88bff@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-08-12 10:31:01 +02:00
Daniele Palmas
0724869ede bus: mhi: host: pci_generic: add support for Telit FE990 modem
Add support for Telit FE990 that has the same configuration as FN990:

$ lspci -vv
04:00.0 Unassigned class [ff00]: Qualcomm Device 0308
    Subsystem: Device 1c5d:2015

Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://lore.kernel.org/r/20230804094039.365102-1-dnlplm@gmail.com
[mani: minor update to commit subject and adjusted comment]
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2023-08-11 20:39:26 +05:30
Arnd Bergmann
b0f9f36079 bus: mhi: host: remove unused-but-set parameter
Clang warns about a parameter that is decremented but never evaluated here:

bus/mhi/host/main.c:803:13: error: parameter 'event_quota' set but not used [-Werror,-Wunused-but-set-parameter]
                             u32 event_quota)

Remove the access to the variable to avoid that warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Link: https://lore.kernel.org/r/20230811134547.3231160-1-arnd@kernel.org
[mani: minor spelling fix to commit message]
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2023-08-11 20:37:23 +05:30
Tony Lindgren
40a4f49cd3 bus: ti-sysc: Fix a build warning with W=1 for sysconfig
Dhruva reported a build warning with W=1 for "Function parameter or member
'sysconfig' not described in 'sysc'". Let's document sysconfig to fix this.

Reported-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-08-10 09:21:45 +03:00
Tony Lindgren
03a711d3cb bus: ti-sysc: Configure uart quirks for k3 SoC
Enable the uart quirks similar to the earlier SoCs. Let's assume we are
likely going to need a k3 specific quirk mask separate from the earlier
SoCs, so let's not start changing the revision register mask at this point.

Note that SYSC_QUIRK_LEGACY_IDLE will be needed until we can remove the
need for pm_runtime_irq_safe() from 8250_omap driver.

Reviewed-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-08-10 09:21:45 +03:00
Tony Lindgren
063dc06227 bus: ti-sysc: Build driver for TI K3 SoCs
Allow building ti-sysc also for K3 SoCs. This allows configuring the wkup
domain devices for SYSCONFIG register wake-up events in a generic way.

As this is an interconnect level driver, default to built-in on K3 SoCs
to probe the devices connected to the wkup domain like gpio, uart and
timers.

Reviewed-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-08-10 09:21:45 +03:00
Tony Lindgren
e1e1e9bb9d bus: ti-sysc: Fix build warning for 64-bit build
Fix "warning: cast from pointer to integer of different size" on 64-bit
builds.

Note that this is a cosmetic fix at this point as the driver is not yet
used for 64-bit systems.

Fixes: feaa8baee8 ("bus: ti-sysc: Implement SoC revision handling")
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-08-10 09:21:45 +03:00
Sicelo A. Mhlongo
99f13d7a16 bus: omap_l3_smx: identify timeout cause before rebooting
Identify and print the error source before rebooting the board due to an l3
timeout error. This is helpful when debugging, e.g. via serial.

Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Message-ID: <20230801192240.1063764-1-absicsz@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-08-09 12:28:50 +03:00
Duke Xin (辛安文)
7b672d703e bus: mhi: host: pci_generic: Add support for Quectel RM520N-GL Lenovo variant
Quectel's RM520N-GL Lenovo variant is same as that of the existing
RM520N-GL modem and uses the same config. But this one is designed for
Lenovo laptop usecase, hence Quectel got a new PID.

Signed-off-by: Duke Xin(辛安文) <duke_xinanwen@163.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Link: https://lore.kernel.org/r/20230807030454.37255-1-duke_xinanwen@163.com
[mani: tweaked subject and commit message a bit]
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2023-08-08 11:57:28 +05:30
Kalle Valo
efe47a18e4 bus: mhi: host: allow MHI client drivers to provide the firmware via a pointer
Currently MHI loads the firmware image from the path provided by client
devices. ath11k needs to support firmware image embedded along with meta
data (named as firmware-2.bin). So allow the client driver to request the
firmware file from user space on it's own and provide the firmware image
data and size to MHI via a pointer struct mhi_controller::fw_data.

This is an optional feature, if fw_data is NULL MHI load the firmware using
the name from struct mhi_controller::fw_image string as before.

Tested with ath11k and WCN6855 hw2.0.

Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Link: https://lore.kernel.org/r/20230727100430.3603551-2-kvalo@kernel.org
[mani: wrapped commit message to 75 columns]
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2023-08-04 12:09:56 +05:30
Tony Lindgren
27c146e3de Merge branch 'omap-for-v6.5/ti-sysc' into omap-for-v6.5/fixes
Merge in a missed change into fixes.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-08-02 10:49:57 +03:00
Yangtao Li
01b76ae654 bus: sunxi-rsb: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/20230706072042.31296-1-frank.li@vivo.com
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2023-07-31 00:49:38 +02:00
Yangtao Li
df823d2103 bus: tegra-gmi: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2023-07-21 17:27:33 +02:00
Martin Kaiser
0e40e5fe87 bus: imx-weim: use devm_platform_ioremap_resource
devm_platform_get_and_ioremap_resource maps a resource and returns its
physical address. If we don't need the physical address, we should call
devm_platform_ioremap_resource instead.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2023-07-19 10:14:11 +08:00
Yangtao Li
bc0e769647 bus: vexpress-config: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230706072042.31296-6-frank.li@vivo.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2023-07-13 14:38:44 +01:00
Julia Lawall
d0184830e6 bus: mhi: host: use vmalloc_array and vcalloc
Use vmalloc_array and vcalloc to protect against
multiplication overflows.

The changes were done using the following Coccinelle
semantic patch:

// <smpl>
@initialize:ocaml@
@@

let rename alloc =
  match alloc with
    "vmalloc" -> "vmalloc_array"
  | "vzalloc" -> "vcalloc"
  | _ -> failwith "unknown"

@@
    size_t e1,e2;
    constant C1, C2;
    expression E1, E2, COUNT, x1, x2, x3;
    typedef u8;
    typedef __u8;
    type t = {u8,__u8,char,unsigned char};
    identifier alloc = {vmalloc,vzalloc};
    fresh identifier realloc = script:ocaml(alloc) { rename alloc };
@@

(
      alloc(x1*x2*x3)
|
      alloc(C1 * C2)
|
      alloc((sizeof(t)) * (COUNT), ...)
|
-     alloc((e1) * (e2))
+     realloc(e1, e2)
|
-     alloc((e1) * (COUNT))
+     realloc(COUNT, e1)
|
-     alloc((E1) * (E2))
+     realloc(E1, E2)
)
// </smpl>

Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Link: https://lore.kernel.org/r/20230627144339.144478-11-Julia.Lawall@inria.fr
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2023-07-13 10:31:46 +05:30
Slark Xiao
104a8c5dd9 bus: mhi: host: pci_generic: Add support for Dell DW5932e
The DW5932e has 2 variants: eSIM(DW5932e-eSIM) and non-eSIM(DW5932e).
Both of them are designed based on Qualcomm SDX62 and it will
align with the Foxconn sdx65 settings.

Signed-off-by: Slark Xiao <slark_xiao@163.com>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://lore.kernel.org/r/20230712083741.7615-1-slark_xiao@163.com
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2023-07-12 17:55:50 +05:30
Duke Xin (辛安文)
1cad976a1b bus: mhi: host: pci_generic: Add support for Quectel RM520N-GL modem
Add MHI interface definition for RM520 product based on Qualcomm SDX6X chip

Signed-off-by: Duke Xin(辛安文) <duke_xinanwen@163.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://lore.kernel.org/r/20230630062318.12114-1-duke_xinanwen@163.com
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2023-07-12 17:51:43 +05:30
Duke Xin (辛安文)
110f113a48 bus: mhi: host: pci_generic: Add support for Quectel EM160R-GL modem
This modem is identical to the previous EM160R-GL modem with same product
name. But this one is designed for a specific laptop usecase, hence Quectel
got a new PID.

Signed-off-by: Duke Xin(辛安文) <duke_xinanwen@163.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://lore.kernel.org/r/20230608092927.2893-1-duke_xinanwen@163.com
[mani: modified the commit message and subject]
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2023-07-12 17:49:38 +05:30
Manivannan Sadhasivam
15f6705756 bus: mhi: host: pci_generic: Add support for IP_SW0 channels
IP_SW0 channels are used to transfer data over the networking interface
between MHI endpoint and the host. Define the channels in the MHI v1
channel config along with dedicated event rings.

Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Link: https://lore.kernel.org/r/20230519135803.13850-1-manivannan.sadhasivam@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2023-07-12 17:49:38 +05:30
Qiang Yu
cabce92dd8 bus: mhi: host: Skip MHI reset if device is in RDDM
In RDDM EE, device can not process MHI reset issued by host. In case of MHI
power off, host is issuing MHI reset and polls for it to get cleared until
it times out. Since this timeout can not be avoided in case of RDDM, skip
the MHI reset in this scenarios.

Cc: <stable@vger.kernel.org>
Fixes: a6e2e3522f ("bus: mhi: core: Add support for PM state transitions")
Signed-off-by: Qiang Yu <quic_qianyu@quicinc.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://lore.kernel.org/r/1684390959-17836-1-git-send-email-quic_qianyu@quicinc.com
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2023-07-12 17:49:38 +05:30
Linus Torvalds
9f57c13f7e SoC fixes for 6.5, part 1
There are three small fixes that came up sincie the past week:
 
  - an incorrect bit offset in ixp4xx bus driver
 
  - a riscv randconfig regression in the thead platform I merged
 
  - whitespace fixes for some dts files
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmSl1R4ACgkQYKtH/8kJ
 Uie0Sw//XWCdg4Baaz/sbgsqw7zREqKdwvj9T1xIlmp5VBfFrSqMA25oSA/G4r4u
 LqhLiOE79L8pk0UbBWio7ja0htVBQmWq0NFflYEkjSB+1bfYfHaB0zTP6lmMPwBH
 DNzDuJunmttaFuofiFTNsxwRB7hcehWYGqKYnwM+LlGXXcS4qq2ktvAz9gludbZX
 +zxEdwxWyJcw7vbRcYGaJM2QsQxnIweqqtHUidnfOw/qnuz4BMgOk96erD0LHQw2
 VcTKPU/mEGjaHNWvuQQwb+GzU9X5RWzOcRKUL6bNdWp4mjZQ6WmUIn4Wyz4Z640B
 zETkVmpEmxpRIbDeIal10MqQQNgRXERMGa9+8EJ3QDQ2zFyV0oRSOmn01IqFoX90
 xDfgSi/IMG6VRWt0soqSGPc4rtlP7sy/4hskKUAyOZDwmkFUYfUVumosBrRUxGqX
 f4UTjh6fWTqwiatVPxs2Df02AMDPLpn7umRa2K1JPuNNJ2CpKK9KBcaT5MmtGZV0
 ZyZhejIaENCWGwPk0E//y/KbnDCLrk8ngLeEvVweOQrpPWhpNp3TintFa0OYpB/m
 tS3ufUHGwz+7qg400FPkd47fn/j9VOeEEczOzUPFhLn/ZtUOsP1BczXcVZGHXjfF
 Im5o8fYnWmw8SKwogcX0OCO3AHQPqmTb+EeaCHjpU15DlT7QDX0=
 =cc9Z
 -----END PGP SIGNATURE-----

Merge tag 'soc-fixes-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull SoC fixes from Arnd Bergmann:
 "There are three small fixes that came up sincie the past week:

   - an incorrect bit offset in ixp4xx bus driver

   - a riscv randconfig regression in the thead platform I merged

   - whitespace fixes for some dts files"

* tag 'soc-fixes-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
  bus: ixp4xx: fix IXP4XX_EXP_T1_MASK
  ARM: dts: st: add missing space before {
  RISC-V: make ARCH_THEAD preclude XIP_KERNEL
2023-07-06 09:56:53 -07:00
Jonas Gorski
6722e46513
bus: ixp4xx: fix IXP4XX_EXP_T1_MASK
The IXP4XX_EXP_T1_MASK was shifted one bit to the right, overlapping
IXP4XX_EXP_T2_MASK and leaving bit 29 unused. The offset being wrong is
also confirmed at least by the datasheet of IXP45X/46X [1].

Fix this by aligning it to IXP4XX_EXP_T1_SHIFT.

[1] https://www.intel.com/content/dam/www/public/us/en/documents/manuals/ixp45x-ixp46x-developers-manual.pdf

Cc: stable@vger.kernel.org
Fixes: 1c953bda90 ("bus: ixp4xx: Add a driver for IXP4xx expansion bus")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Link: https://lore.kernel.org/r/20230624112958.27727-1-jonas.gorski@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230624122139.3229642-1-linus.walleij@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-07-05 22:22:55 +02:00
Linus Torvalds
44aeec836d Char/Misc and other driver subsystem updates for 6.5-rc1
Here is the big set of char/misc and other driver subsystem updates for
 6.5-rc1.
 
 Lots of different, tiny, stuff in here, from a range of smaller driver
 subsystems, including pulls from some substems directly:
   - IIO driver updates and additions
   - W1 driver updates and fixes (and a new maintainer!)
   - FPGA driver updates and fixes
   - Counter driver updates
   - Extcon driver updates
   - Interconnect driver updates
   - Coresight driver updates
   - mfd tree tag merge needed for other updates
 on top of that, lots of small driver updates as patches, including:
   - static const updates for class structures
   - nvmem driver updates
   - pcmcia driver fix
   - lots of other small driver updates and fixes
 
 All of these have been in linux-next for a while with no reported
 problems.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZKKNMw8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ylhlQCfZrtz8RIbau8zbzh/CKpKBOmvHp4An3V64hbz
 recBPLH0ZACKl0wPl4iZ
 =A83A
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull Char/Misc updates from Greg KH:
 "Here is the big set of char/misc and other driver subsystem updates
  for 6.5-rc1.

  Lots of different, tiny, stuff in here, from a range of smaller driver
  subsystems, including pulls from some substems directly:

   - IIO driver updates and additions

   - W1 driver updates and fixes (and a new maintainer!)

   - FPGA driver updates and fixes

   - Counter driver updates

   - Extcon driver updates

   - Interconnect driver updates

   - Coresight driver updates

   - mfd tree tag merge needed for other updates on top of that, lots of
     small driver updates as patches, including:

   - static const updates for class structures

   - nvmem driver updates

   - pcmcia driver fix

   - lots of other small driver updates and fixes

  All of these have been in linux-next for a while with no reported
  problems"

* tag 'char-misc-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (243 commits)
  bsr: fix build problem with bsr_class static cleanup
  comedi: make all 'class' structures const
  char: xillybus: make xillybus_class a static const structure
  xilinx_hwicap: make icap_class a static const structure
  virtio_console: make port class a static const structure
  ppdev: make ppdev_class a static const structure
  char: misc: make misc_class a static const structure
  /dev/mem: make mem_class a static const structure
  char: lp: make lp_class a static const structure
  dsp56k: make dsp56k_class a static const structure
  bsr: make bsr_class a static const structure
  oradax: make 'cl' a static const structure
  hwtracing: hisi_ptt: Fix potential sleep in atomic context
  hwtracing: hisi_ptt: Advertise PERF_PMU_CAP_NO_EXCLUDE for PTT PMU
  hwtracing: hisi_ptt: Export available filters through sysfs
  hwtracing: hisi_ptt: Add support for dynamically updating the filter list
  hwtracing: hisi_ptt: Factor out filter allocation and release operation
  samples: pfsm: add CC_CAN_LINK dependency
  misc: fastrpc: check return value of devm_kasprintf()
  coresight: dummy: Update type of mode parameter in dummy_{sink,source}_enable()
  ...
2023-07-03 12:46:47 -07:00
Arnd Bergmann
356fa49759 NXP/FSL SoC driver updates for v6.5
- fsl-mc: Make remove function return void
 - QE USB: fix build issue caused by missing dependency
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEhb3UXAyxp6UQ0v6khtxQDvusFVQFAmSTduQACgkQhtxQDvus
 FVRsWg/+KIGaiTwEOvmhysMXE0Papwo+sdy/dOonvlIuPgO5S4MeisC9XFy5JqV9
 qj9keqBVeB6dw9zqJIS6PI6OiOYZGrrkQIU5m/r36jqFBdUw0Ys8JAbZTFlFQa4X
 uwceN8jK1l0pdC+fmAf4SrVg9U1/3MvMZNsWKmvgfHKTSUNIalXvXI6uI2ohGBsr
 DV0/epPA/rvy6ffNQebXzudbXgPZL8p7V7LDUyCGxdsndIvZ25+JMZ63XQWbz/Qi
 B1Lkr9jiIn+GLDbemy846MK5tMDDJRLPss4Pk6rEbF+PDaWMhxMxfbRFHekPCbzV
 MrYrTRUrTNj4kz4J1QvkX0N6Kb2PbQsfNaN6w0lP/jdAgCRx+fbh1Q83PjMHp7ov
 ET3n0sX1JPmgAvMNRVNzbszX4vo5WlRvEC9nXyBUrTv/1jlt89oPtruiyCY2Ym0e
 nWv7UWUJuuiJIrSWVol3Egf9FHibfLGlLNwpYHZQnSAi53AXmqocIxiWEVvXUd6R
 3xmAGEItrwojpV+DHUNGRVGUzDqHaPguzItnTuDTqXJ9lwKPk/PdO7bSHnewxNRi
 9RQpP7AoU8qtRxf0i5aWCe5TjqQJeSEIN0t7jF6IZ8Is1rfaRfvIEDmML8WArSj6
 nUh5LaM5Qvg9l2RMZoDa0n5hGsvpnIigRcx2dN6k46jyVG4lqeg=
 =cBX5
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmSbTIoACgkQYKtH/8kJ
 UieZlA/+IOYfWVN7hTsZ22LUL5c0GWvUTsacD+wf2YlXC7ioJ0RSzL+yCdbYGbGw
 62di/ZsiUFaXhYszNyAW/w3qFgal578OiyR79lkadESizJGexScejATPph/5J+JI
 XT5JDCXMwAYN78uoOpEDoTjC8Upv1mOoMZBwMCx1j3K3dVkkPI+/Fe9PuGRn3Njs
 Uc5OBtvNBVf0nulHupS3d52s6jWEL7TX6FZCdPyWQ2A4rYunze46cOXtBBEi+x9A
 +jZ4pR382zKFII2e2rtIp7P0q896vnLbuVaetEZUIrPKKFWANXfhoFmzl0aUQCgP
 Lqyui78CYFabKddkVWWd/JqQy8ZRzPWkkHtW6bW31DPZWzlOXjZds8tykP45ekeh
 Q6wTvqpZulgLgl7J8dE029go9N5hc2y/fuGExXJh6uaMUhpexY3OwBZ9DuJBAbwu
 mDpKLaDBGFfF21r903usumRArQPC/Y0V6cJSmb7Np9LnUhnef1jT2f1+cwL1Q7M5
 5VhxsfJo4GhtCljZ8E3CZ4rrB3NWwggRDm71MNiY9UpLwqcZbYqdtEcvwdq37r0/
 K8av+uzLWE/RTeA+1PXcERMXmylWrKy0BmcGYwjOkALje+v5NNgJwdwxG2U1yWcc
 VEjf/5bynMkNwNt3zTEkstN1chcafJTw4uqOJoqrh+55NGZHNpw=
 =E30d
 -----END PGP SIGNATURE-----

Merge tag 'soc-fsl-next-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux into soc/drivers

NXP/FSL SoC driver updates for v6.5

- fsl-mc: Make remove function return void
- QE USB: fix build issue caused by missing dependency

* tag 'soc-fsl-next-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux:
  bus: fsl-mc: fsl-mc-allocator: Drop a write-only variable
  bus: fsl-mc: fsl-mc-allocator: Initialize mc_bus_dev before use
  soc/fsl/qe: fix usb.c build errors
  bus: fsl-mc: Make remove function return void
  soc: fsl: dpio: Suppress duplicated error reporting on device remove
  bus: fsl-mc: fsl-mc-allocator: Improve error reporting
  bus: fsl-mc: fsl-mc-allocator: Drop if block with always wrong condition
  bus: fsl-mc: dprc: Push down error message from fsl_mc_driver_remove()
  bus: fsl-mc: Only warn once about errors on device unbind

Link: https://lore.kernel.org/r/20230621222503.12402-1-leoyang.li@nxp.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-06-27 22:54:34 +02:00
Laurentiu Tudor
303c9c63ab bus: fsl-mc: don't assume child devices are all fsl-mc devices
Changes in VFIO caused a pseudo-device to be created as child of
fsl-mc devices causing a crash [1] when trying to bind a fsl-mc
device to VFIO. Fix this by checking the device type when enumerating
fsl-mc child devices.

[1]
Modules linked in:
Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
CPU: 6 PID: 1289 Comm: sh Not tainted 6.2.0-rc5-00047-g7c46948a6e9c #2
Hardware name: NXP Layerscape LX2160ARDB (DT)
pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : mc_send_command+0x24/0x1f0
lr : dprc_get_obj_region+0xfc/0x1c0
sp : ffff80000a88b900
x29: ffff80000a88b900 x28: ffff48a9429e1400 x27: 00000000000002b2
x26: ffff48a9429e1718 x25: 0000000000000000 x24: 0000000000000000
x23: ffffd59331ba3918 x22: ffffd59331ba3000 x21: 0000000000000000
x20: ffff80000a88b9b8 x19: 0000000000000000 x18: 0000000000000001
x17: 7270642f636d2d6c x16: 73662e3030303030 x15: ffffffffffffffff
x14: ffffd59330f1d668 x13: ffff48a8727dc389 x12: ffff48a8727dc386
x11: 0000000000000002 x10: 00008ceaf02f35d4 x9 : 0000000000000012
x8 : 0000000000000000 x7 : 0000000000000006 x6 : ffff80000a88bab0
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff80000a88b9e8
x2 : ffff80000a88b9e8 x1 : 0000000000000000 x0 : ffff48a945142b80
Call trace:
 mc_send_command+0x24/0x1f0
 dprc_get_obj_region+0xfc/0x1c0
 fsl_mc_device_add+0x340/0x590
 fsl_mc_obj_device_add+0xd0/0xf8
 dprc_scan_objects+0x1c4/0x340
 dprc_scan_container+0x38/0x60
 vfio_fsl_mc_probe+0x9c/0xf8
 fsl_mc_driver_probe+0x24/0x70
 really_probe+0xbc/0x2a8
 __driver_probe_device+0x78/0xe0
 device_driver_attach+0x30/0x68
 bind_store+0xa8/0x130
 drv_attr_store+0x24/0x38
 sysfs_kf_write+0x44/0x60
 kernfs_fop_write_iter+0x128/0x1b8
 vfs_write+0x334/0x448
 ksys_write+0x68/0xf0
 __arm64_sys_write+0x1c/0x28
 invoke_syscall+0x44/0x108
 el0_svc_common.constprop.1+0x94/0xf8
 do_el0_svc+0x38/0xb0
 el0_svc+0x20/0x50
 el0t_64_sync_handler+0x98/0xc0
 el0t_64_sync+0x174/0x178
Code: aa0103f4 a9025bf5 d5384100 b9400801 (79401260)
---[ end trace 0000000000000000 ]---

Fixes: 3c28a76124 ("vfio: Add struct device to vfio_device")
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Message-ID: <20230613160718.29500-1-laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:18 +02:00
Tony Lindgren
34539b442b bus: ti-sysc: Flush posted write on enable before reset
The am335x devices started producing boot errors for resetting musb module
in because of subtle timing changes:

Unhandled fault: external abort on non-linefetch (0x1008)
...
sysc_poll_reset_sysconfig from sysc_reset+0x109/0x12
sysc_reset from sysc_probe+0xa99/0xeb0
...

The fix is to flush posted write after enable before reset during
probe. Note that some devices also need to specify the delay after enable
with ti,sysc-delay-us, but this is not needed for musb on am335x based on
my tests.

Reported-by: kernelci.org bot <bot@kernelci.org>
Closes: https://storage.kernelci.org/next/master/next-20230614/arm/multi_v7_defconfig+CONFIG_THUMB2_KERNEL=y/gcc-10/lab-cip/baseline-beaglebone-black.html
Fixes: 596e795569 ("bus: ti-sysc: Add support for software reset")
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-06-14 11:03:06 +03:00
Uwe Kleine-König
fb9c384625 bus: fsl-mc: fsl-mc-allocator: Drop a write-only variable
Fixes a clang compiler warning:

   drivers/bus/fsl-mc/fsl-mc-allocator.c:565:6: warning: variable 'free_count' set but not used [-Wunused-but-set-variable]
           int free_count = 0;

Fixes: d8e026a449 ("staging: fsl-mc: remove some superfluous WARN_ONs")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
2023-06-08 17:56:26 -05:00
Uwe Kleine-König
e0d43ed638 bus: fsl-mc: fsl-mc-allocator: Initialize mc_bus_dev before use
Fixes a clang compiler warning:

>> drivers/bus/fsl-mc/fsl-mc-allocator.c:108:12: warning: variable 'mc_bus_dev' is uninitialized when used here [-Wuninitialized]
                   dev_err(&mc_bus_dev->dev, "resource mismatch\n");

Fixes: b3134039c5 ("bus: fsl-mc: fsl-mc-allocator: Improve error reporting")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202306021936.OktTcMAT-lkp@intel.com/
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
2023-06-08 17:56:26 -05:00
Uwe Kleine-König
59272ad8d9 bus: fsl-mc: Make remove function return void
The value returned by an fsl-mc driver's remove function is mostly
ignored.  (Only an error message is printed if the value is non-zero
and then device removal continues unconditionally.)

So change the prototype of the remove function to return no value. This
way driver authors are not tempted to assume that passing an error to
the upper layer is a good idea. All drivers are adapted accordingly.
There is no intended change of behaviour, all callbacks were prepared to
return 0 before.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com> # sanity checks
Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Tested-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
2023-05-30 18:58:43 -05:00
Uwe Kleine-König
b3134039c5 bus: fsl-mc: fsl-mc-allocator: Improve error reporting
Instead of silently returning an error in the remove callback (which yields
a generic and little informing error message), annotate each error path of
fsl_mc_resource_pool_remove_device() with an error message and return zero
in the remove callback to suppress the error message.

Note that changing the return value has no other effect than suppressing
the error message by the fsl_mc bus driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com> # sanity checks
Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Tested-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
2023-05-30 18:58:42 -05:00
Uwe Kleine-König
e0ac89361c bus: fsl-mc: fsl-mc-allocator: Drop if block with always wrong condition
If fsl_mc_is_allocatable(mc_dev) evaluates to false, the driver won't
have bound to that device and then fsl_mc_allocator_remove() is never
called for that device. fsl_mc_allocator_remove() is the only caller of
fsl_mc_resource_pool_remove_device(), so the same check can be removed
from there.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com> # sanity checks
Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Tested-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
2023-05-30 18:58:42 -05:00
Uwe Kleine-König
f8fce83183 bus: fsl-mc: dprc: Push down error message from fsl_mc_driver_remove()
The error message emitted in fsl_mc_driver_remove() is very generic.
Replace it by a message that mentions the reason for the failure.

Returning zero instead of a negative value has no side effect apart from
suppressing the generic error message.

The first if condition in dprc_remove() can never be true, as this would
prevent successful probing of the device and then .remove wasn't called.
So this can just be dropped.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com> # sanity checks
Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Tested-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
2023-05-30 18:58:42 -05:00
Uwe Kleine-König
b816b9444c bus: fsl-mc: Only warn once about errors on device unbind
If a platform driver's remove function returns an error code, this
results in a (generic and little helpful) error message. Otherwise the
value is ignored.

As fsl_mc_driver_remove() already emit an error message, return 0 also
in the error case. The only effect is to suppress the device core's
error message.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com> # sanity checks
Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Tested-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
2023-05-30 18:58:42 -05:00
Tony Lindgren
f620596fa3 bus: ti-sysc: Fix dispc quirk masking bool variables
Fix warning drivers/bus/ti-sysc.c:1806 sysc_quirk_dispc()
warn: masking a bool.

While at it let's add a comment for what were doing to make
the code a bit easier to follow.

Fixes: 7324a7a0d5 ("bus: ti-sysc: Implement display subsystem reset quirk")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-omap/a8ec8a68-9c2c-4076-bf47-09fccce7659f@kili.mountain/
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-05-17 10:17:01 +03:00
Linus Torvalds
b6a7828502 modules-6.4-rc1
The summary of the changes for this pull requests is:
 
  * Song Liu's new struct module_memory replacement
  * Nick Alcock's MODULE_LICENSE() removal for non-modules
  * My cleanups and enhancements to reduce the areas where we vmalloc
    module memory for duplicates, and the respective debug code which
    proves the remaining vmalloc pressure comes from userspace.
 
 Most of the changes have been in linux-next for quite some time except
 the minor fixes I made to check if a module was already loaded
 prior to allocating the final module memory with vmalloc and the
 respective debug code it introduces to help clarify the issue. Although
 the functional change is small it is rather safe as it can only *help*
 reduce vmalloc space for duplicates and is confirmed to fix a bootup
 issue with over 400 CPUs with KASAN enabled. I don't expect stable
 kernels to pick up that fix as the cleanups would have also had to have
 been picked up. Folks on larger CPU systems with modules will want to
 just upgrade if vmalloc space has been an issue on bootup.
 
 Given the size of this request, here's some more elaborate details
 on this pull request.
 
 The functional change change in this pull request is the very first
 patch from Song Liu which replaces the struct module_layout with a new
 struct module memory. The old data structure tried to put together all
 types of supported module memory types in one data structure, the new
 one abstracts the differences in memory types in a module to allow each
 one to provide their own set of details. This paves the way in the
 future so we can deal with them in a cleaner way. If you look at changes
 they also provide a nice cleanup of how we handle these different memory
 areas in a module. This change has been in linux-next since before the
 merge window opened for v6.3 so to provide more than a full kernel cycle
 of testing. It's a good thing as quite a bit of fixes have been found
 for it.
 
 Jason Baron then made dynamic debug a first class citizen module user by
 using module notifier callbacks to allocate / remove module specific
 dynamic debug information.
 
 Nick Alcock has done quite a bit of work cross-tree to remove module
 license tags from things which cannot possibly be module at my request
 so to:
 
   a) help him with his longer term tooling goals which require a
      deterministic evaluation if a piece a symbol code could ever be
      part of a module or not. But quite recently it is has been made
      clear that tooling is not the only one that would benefit.
      Disambiguating symbols also helps efforts such as live patching,
      kprobes and BPF, but for other reasons and R&D on this area
      is active with no clear solution in sight.
 
   b) help us inch closer to the now generally accepted long term goal
      of automating all the MODULE_LICENSE() tags from SPDX license tags
 
 In so far as a) is concerned, although module license tags are a no-op
 for non-modules, tools which would want create a mapping of possible
 modules can only rely on the module license tag after the commit
 8b41fc4454 ("kbuild: create modules.builtin without Makefile.modbuiltin
 or tristate.conf").  Nick has been working on this *for years* and
 AFAICT I was the only one to suggest two alternatives to this approach
 for tooling. The complexity in one of my suggested approaches lies in
 that we'd need a possible-obj-m and a could-be-module which would check
 if the object being built is part of any kconfig build which could ever
 lead to it being part of a module, and if so define a new define
 -DPOSSIBLE_MODULE [0]. A more obvious yet theoretical approach I've
 suggested would be to have a tristate in kconfig imply the same new
 -DPOSSIBLE_MODULE as well but that means getting kconfig symbol names
 mapping to modules always, and I don't think that's the case today. I am
 not aware of Nick or anyone exploring either of these options. Quite
 recently Josh Poimboeuf has pointed out that live patching, kprobes and
 BPF would benefit from resolving some part of the disambiguation as
 well but for other reasons. The function granularity KASLR (fgkaslr)
 patches were mentioned but Joe Lawrence has clarified this effort has
 been dropped with no clear solution in sight [1].
 
 In the meantime removing module license tags from code which could never
 be modules is welcomed for both objectives mentioned above. Some
 developers have also welcomed these changes as it has helped clarify
 when a module was never possible and they forgot to clean this up,
 and so you'll see quite a bit of Nick's patches in other pull
 requests for this merge window. I just picked up the stragglers after
 rc3. LWN has good coverage on the motivation behind this work [2] and
 the typical cross-tree issues he ran into along the way. The only
 concrete blocker issue he ran into was that we should not remove the
 MODULE_LICENSE() tags from files which have no SPDX tags yet, even if
 they can never be modules. Nick ended up giving up on his efforts due
 to having to do this vetting and backlash he ran into from folks who
 really did *not understand* the core of the issue nor were providing
 any alternative / guidance. I've gone through his changes and dropped
 the patches which dropped the module license tags where an SPDX
 license tag was missing, it only consisted of 11 drivers.  To see
 if a pull request deals with a file which lacks SPDX tags you
 can just use:
 
   ./scripts/spdxcheck.py -f \
 	$(git diff --name-only commid-id | xargs echo)
 
 You'll see a core module file in this pull request for the above,
 but that's not related to his changes. WE just need to add the SPDX
 license tag for the kernel/module/kmod.c file in the future but
 it demonstrates the effectiveness of the script.
 
 Most of Nick's changes were spread out through different trees,
 and I just picked up the slack after rc3 for the last kernel was out.
 Those changes have been in linux-next for over two weeks.
 
 The cleanups, debug code I added and final fix I added for modules
 were motivated by David Hildenbrand's report of boot failing on
 a systems with over 400 CPUs when KASAN was enabled due to running
 out of virtual memory space. Although the functional change only
 consists of 3 lines in the patch "module: avoid allocation if module is
 already present and ready", proving that this was the best we can
 do on the modules side took quite a bit of effort and new debug code.
 
 The initial cleanups I did on the modules side of things has been
 in linux-next since around rc3 of the last kernel, the actual final
 fix for and debug code however have only been in linux-next for about a
 week or so but I think it is worth getting that code in for this merge
 window as it does help fix / prove / evaluate the issues reported
 with larger number of CPUs. Userspace is not yet fixed as it is taking
 a bit of time for folks to understand the crux of the issue and find a
 proper resolution. Worst come to worst, I have a kludge-of-concept [3]
 of how to make kernel_read*() calls for modules unique / converge them,
 but I'm currently inclined to just see if userspace can fix this
 instead.
 
 [0] https://lore.kernel.org/all/Y/kXDqW+7d71C4wz@bombadil.infradead.org/
 [1] https://lkml.kernel.org/r/025f2151-ce7c-5630-9b90-98742c97ac65@redhat.com
 [2] https://lwn.net/Articles/927569/
 [3] https://lkml.kernel.org/r/20230414052840.1994456-3-mcgrof@kernel.org
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCgAwFiEENnNq2KuOejlQLZofziMdCjCSiKcFAmRG4m0SHG1jZ3JvZkBr
 ZXJuZWwub3JnAAoJEM4jHQowkoinQ2oP/0xlvKwJg6Ey8fHZF0qv8VOskE80zoLF
 hMazU3xfqLA+1TQvouW1YBxt3jwS3t1Ehs+NrV+nY9Yzcm0MzRX/n3fASJVe7nRr
 oqWWQU+voYl5Pw1xsfdp6C8IXpBQorpYby3Vp0MAMoZyl2W2YrNo36NV488wM9KC
 jD4HF5Z6xpnPSZTRR7AgW9mo7FdAtxPeKJ76Bch7lH8U6omT7n36WqTw+5B1eAYU
 YTOvrjRs294oqmWE+LeebyiOOXhH/yEYx4JNQgCwPdxwnRiGJWKsk5va0hRApqF/
 WW8dIqdEnjsa84lCuxnmWgbcPK8cgmlO0rT0DyneACCldNlldCW1LJ0HOwLk9pea
 p3JFAsBL7TKue4Tos6I7/4rx1ufyBGGIigqw9/VX5g0Iif+3BhWnqKRfz+p9wiMa
 Fl7cU6u7yC68CHu1HBSisK16cYMCPeOnTSd89upHj8JU/t74O6k/ARvjrQ9qmNUt
 c5U+OY+WpNJ1nXQydhY/yIDhFdYg8SSpNuIO90r4L8/8jRQYXNG80FDd1UtvVDuy
 eq0r2yZ8C0XHSlOT9QHaua/tWV/aaKtyC/c0hDRrigfUrq8UOlGujMXbUnrmrWJI
 tLJLAc7ePWAAoZXGSHrt0U27l029GzLwRdKqJ6kkDANVnTeOdV+mmBg9zGh3/Mp6
 agiwdHUMVN7X
 =56WK
 -----END PGP SIGNATURE-----

Merge tag 'modules-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux

Pull module updates from Luis Chamberlain:
 "The summary of the changes for this pull requests is:

   - Song Liu's new struct module_memory replacement

   - Nick Alcock's MODULE_LICENSE() removal for non-modules

   - My cleanups and enhancements to reduce the areas where we vmalloc
     module memory for duplicates, and the respective debug code which
     proves the remaining vmalloc pressure comes from userspace.

  Most of the changes have been in linux-next for quite some time except
  the minor fixes I made to check if a module was already loaded prior
  to allocating the final module memory with vmalloc and the respective
  debug code it introduces to help clarify the issue. Although the
  functional change is small it is rather safe as it can only *help*
  reduce vmalloc space for duplicates and is confirmed to fix a bootup
  issue with over 400 CPUs with KASAN enabled. I don't expect stable
  kernels to pick up that fix as the cleanups would have also had to
  have been picked up. Folks on larger CPU systems with modules will
  want to just upgrade if vmalloc space has been an issue on bootup.

  Given the size of this request, here's some more elaborate details:

  The functional change change in this pull request is the very first
  patch from Song Liu which replaces the 'struct module_layout' with a
  new 'struct module_memory'. The old data structure tried to put
  together all types of supported module memory types in one data
  structure, the new one abstracts the differences in memory types in a
  module to allow each one to provide their own set of details. This
  paves the way in the future so we can deal with them in a cleaner way.
  If you look at changes they also provide a nice cleanup of how we
  handle these different memory areas in a module. This change has been
  in linux-next since before the merge window opened for v6.3 so to
  provide more than a full kernel cycle of testing. It's a good thing as
  quite a bit of fixes have been found for it.

  Jason Baron then made dynamic debug a first class citizen module user
  by using module notifier callbacks to allocate / remove module
  specific dynamic debug information.

  Nick Alcock has done quite a bit of work cross-tree to remove module
  license tags from things which cannot possibly be module at my request
  so to:

   a) help him with his longer term tooling goals which require a
      deterministic evaluation if a piece a symbol code could ever be
      part of a module or not. But quite recently it is has been made
      clear that tooling is not the only one that would benefit.
      Disambiguating symbols also helps efforts such as live patching,
      kprobes and BPF, but for other reasons and R&D on this area is
      active with no clear solution in sight.

   b) help us inch closer to the now generally accepted long term goal
      of automating all the MODULE_LICENSE() tags from SPDX license tags

  In so far as a) is concerned, although module license tags are a no-op
  for non-modules, tools which would want create a mapping of possible
  modules can only rely on the module license tag after the commit
  8b41fc4454 ("kbuild: create modules.builtin without
  Makefile.modbuiltin or tristate.conf").

  Nick has been working on this *for years* and AFAICT I was the only
  one to suggest two alternatives to this approach for tooling. The
  complexity in one of my suggested approaches lies in that we'd need a
  possible-obj-m and a could-be-module which would check if the object
  being built is part of any kconfig build which could ever lead to it
  being part of a module, and if so define a new define
  -DPOSSIBLE_MODULE [0].

  A more obvious yet theoretical approach I've suggested would be to
  have a tristate in kconfig imply the same new -DPOSSIBLE_MODULE as
  well but that means getting kconfig symbol names mapping to modules
  always, and I don't think that's the case today. I am not aware of
  Nick or anyone exploring either of these options. Quite recently Josh
  Poimboeuf has pointed out that live patching, kprobes and BPF would
  benefit from resolving some part of the disambiguation as well but for
  other reasons. The function granularity KASLR (fgkaslr) patches were
  mentioned but Joe Lawrence has clarified this effort has been dropped
  with no clear solution in sight [1].

  In the meantime removing module license tags from code which could
  never be modules is welcomed for both objectives mentioned above. Some
  developers have also welcomed these changes as it has helped clarify
  when a module was never possible and they forgot to clean this up, and
  so you'll see quite a bit of Nick's patches in other pull requests for
  this merge window. I just picked up the stragglers after rc3. LWN has
  good coverage on the motivation behind this work [2] and the typical
  cross-tree issues he ran into along the way. The only concrete blocker
  issue he ran into was that we should not remove the MODULE_LICENSE()
  tags from files which have no SPDX tags yet, even if they can never be
  modules. Nick ended up giving up on his efforts due to having to do
  this vetting and backlash he ran into from folks who really did *not
  understand* the core of the issue nor were providing any alternative /
  guidance. I've gone through his changes and dropped the patches which
  dropped the module license tags where an SPDX license tag was missing,
  it only consisted of 11 drivers. To see if a pull request deals with a
  file which lacks SPDX tags you can just use:

    ./scripts/spdxcheck.py -f \
	$(git diff --name-only commid-id | xargs echo)

  You'll see a core module file in this pull request for the above, but
  that's not related to his changes. WE just need to add the SPDX
  license tag for the kernel/module/kmod.c file in the future but it
  demonstrates the effectiveness of the script.

  Most of Nick's changes were spread out through different trees, and I
  just picked up the slack after rc3 for the last kernel was out. Those
  changes have been in linux-next for over two weeks.

  The cleanups, debug code I added and final fix I added for modules
  were motivated by David Hildenbrand's report of boot failing on a
  systems with over 400 CPUs when KASAN was enabled due to running out
  of virtual memory space. Although the functional change only consists
  of 3 lines in the patch "module: avoid allocation if module is already
  present and ready", proving that this was the best we can do on the
  modules side took quite a bit of effort and new debug code.

  The initial cleanups I did on the modules side of things has been in
  linux-next since around rc3 of the last kernel, the actual final fix
  for and debug code however have only been in linux-next for about a
  week or so but I think it is worth getting that code in for this merge
  window as it does help fix / prove / evaluate the issues reported with
  larger number of CPUs. Userspace is not yet fixed as it is taking a
  bit of time for folks to understand the crux of the issue and find a
  proper resolution. Worst come to worst, I have a kludge-of-concept [3]
  of how to make kernel_read*() calls for modules unique / converge
  them, but I'm currently inclined to just see if userspace can fix this
  instead"

Link: https://lore.kernel.org/all/Y/kXDqW+7d71C4wz@bombadil.infradead.org/ [0]
Link: https://lkml.kernel.org/r/025f2151-ce7c-5630-9b90-98742c97ac65@redhat.com [1]
Link: https://lwn.net/Articles/927569/ [2]
Link: https://lkml.kernel.org/r/20230414052840.1994456-3-mcgrof@kernel.org [3]

* tag 'modules-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: (121 commits)
  module: add debugging auto-load duplicate module support
  module: stats: fix invalid_mod_bytes typo
  module: remove use of uninitialized variable len
  module: fix building stats for 32-bit targets
  module: stats: include uapi/linux/module.h
  module: avoid allocation if module is already present and ready
  module: add debug stats to help identify memory pressure
  module: extract patient module check into helper
  modules/kmod: replace implementation with a semaphore
  Change DEFINE_SEMAPHORE() to take a number argument
  module: fix kmemleak annotations for non init ELF sections
  module: Ignore L0 and rename is_arm_mapping_symbol()
  module: Move is_arm_mapping_symbol() to module_symbol.h
  module: Sync code of is_arm_mapping_symbol()
  scripts/gdb: use mem instead of core_layout to get the module address
  interconnect: remove module-related code
  interconnect: remove MODULE_LICENSE in non-modules
  zswap: remove MODULE_LICENSE in non-modules
  zpool: remove MODULE_LICENSE in non-modules
  x86/mm/dump_pagetables: remove MODULE_LICENSE in non-modules
  ...
2023-04-27 16:36:55 -07:00
Linus Torvalds
cec24b8b6b Char/Misc drivers for 6.4-rc1
Here is the "big" set of char/misc and other driver subsystems for
 6.4-rc1.
 
 It's pretty big, but due to the removal of pcmcia drivers, almost breaks
 even for number of lines added vs. removed, a nice change.
 
 Included in here are:
   - removal of unused PCMCIA drivers (finally!)
   - Interconnect driver updates and additions
   - Lots of IIO driver updates and additions
   - MHI driver updates
   - Coresight driver updates
   - NVMEM driver updates, which required some OF updates
   - W1 driver updates and a new maintainer to manage the subsystem
   - FPGA driver updates
   - New driver subsystem, CDX, for AMD systems
   - lots of other small driver updates and additions
 
 All of these have been in linux-next for a while with no reported
 issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZEp5Eg8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ynSXgCg0kSw3vUYwpsnhAsQkoPw1QVA23sAn2edRCMa
 GEkPWjrROueCom7xbLMu
 =eR+P
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc drivers updates from Greg KH:
 "Here is the "big" set of char/misc and other driver subsystems for
  6.4-rc1.

  It's pretty big, but due to the removal of pcmcia drivers, almost
  breaks even for number of lines added vs. removed, a nice change.

  Included in here are:

   - removal of unused PCMCIA drivers (finally!)

   - Interconnect driver updates and additions

   - Lots of IIO driver updates and additions

   - MHI driver updates

   - Coresight driver updates

   - NVMEM driver updates, which required some OF updates

   - W1 driver updates and a new maintainer to manage the subsystem

   - FPGA driver updates

   - New driver subsystem, CDX, for AMD systems

   - lots of other small driver updates and additions

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'char-misc-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (196 commits)
  mcb-lpc: Reallocate memory region to avoid memory overlapping
  mcb-pci: Reallocate memory region to avoid memory overlapping
  mcb: Return actual parsed size when reading chameleon table
  kernel/configs: Drop Android config fragments
  virt: acrn: Replace obsolete memalign() with posix_memalign()
  spmi: Add a check for remove callback when removing a SPMI driver
  spmi: fix W=1 kernel-doc warnings
  spmi: mtk-pmif: Drop of_match_ptr for ID table
  spmi: pmic-arb: Convert to platform remove callback returning void
  spmi: mtk-pmif: Convert to platform remove callback returning void
  spmi: hisi-spmi-controller: Convert to platform remove callback returning void
  w1: gpio: remove unnecessary ENOMEM messages
  w1: omap-hdq: remove unnecessary ENOMEM messages
  w1: omap-hdq: add SPDX tag
  w1: omap-hdq: allow compile testing
  w1: matrox: remove unnecessary ENOMEM messages
  w1: matrox: use inline over __inline__
  w1: matrox: switch from asm to linux header
  w1: ds2482: do not use assignment in if condition
  w1: ds2482: drop unnecessary header
  ...
2023-04-27 12:07:50 -07:00
Linus Torvalds
556eb8b791 Driver core changes for 6.4-rc1
Here is the large set of driver core changes for 6.4-rc1.
 
 Once again, a busy development cycle, with lots of changes happening in
 the driver core in the quest to be able to move "struct bus" and "struct
 class" into read-only memory, a task now complete with these changes.
 
 This will make the future rust interactions with the driver core more
 "provably correct" as well as providing more obvious lifetime rules for
 all busses and classes in the kernel.
 
 The changes required for this did touch many individual classes and
 busses as many callbacks were changed to take const * parameters
 instead.  All of these changes have been submitted to the various
 subsystem maintainers, giving them plenty of time to review, and most of
 them actually did so.
 
 Other than those changes, included in here are a small set of other
 things:
   - kobject logging improvements
   - cacheinfo improvements and updates
   - obligatory fw_devlink updates and fixes
   - documentation updates
   - device property cleanups and const * changes
   - firwmare loader dependency fixes.
 
 All of these have been in linux-next for a while with no reported
 problems.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZEp7Sw8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ykitQCfamUHpxGcKOAGuLXMotXNakTEsxgAoIquENm5
 LEGadNS38k5fs+73UaxV
 =7K4B
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core updates from Greg KH:
 "Here is the large set of driver core changes for 6.4-rc1.

  Once again, a busy development cycle, with lots of changes happening
  in the driver core in the quest to be able to move "struct bus" and
  "struct class" into read-only memory, a task now complete with these
  changes.

  This will make the future rust interactions with the driver core more
  "provably correct" as well as providing more obvious lifetime rules
  for all busses and classes in the kernel.

  The changes required for this did touch many individual classes and
  busses as many callbacks were changed to take const * parameters
  instead. All of these changes have been submitted to the various
  subsystem maintainers, giving them plenty of time to review, and most
  of them actually did so.

  Other than those changes, included in here are a small set of other
  things:

   - kobject logging improvements

   - cacheinfo improvements and updates

   - obligatory fw_devlink updates and fixes

   - documentation updates

   - device property cleanups and const * changes

   - firwmare loader dependency fixes.

  All of these have been in linux-next for a while with no reported
  problems"

* tag 'driver-core-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (120 commits)
  device property: make device_property functions take const device *
  driver core: update comments in device_rename()
  driver core: Don't require dynamic_debug for initcall_debug probe timing
  firmware_loader: rework crypto dependencies
  firmware_loader: Strip off \n from customized path
  zram: fix up permission for the hot_add sysfs file
  cacheinfo: Add use_arch[|_cache]_info field/function
  arch_topology: Remove early cacheinfo error message if -ENOENT
  cacheinfo: Check cache properties are present in DT
  cacheinfo: Check sib_leaf in cache_leaves_are_shared()
  cacheinfo: Allow early level detection when DT/ACPI info is missing/broken
  cacheinfo: Add arm64 early level initializer implementation
  cacheinfo: Add arch specific early level initializer
  tty: make tty_class a static const structure
  driver core: class: remove struct class_interface * from callbacks
  driver core: class: mark the struct class in struct class_interface constant
  driver core: class: make class_register() take a const *
  driver core: class: mark class_release() as taking a const *
  driver core: remove incorrect comment for device_create*
  MIPS: vpe-cmp: remove module owner pointer from struct class usage.
  ...
2023-04-27 11:53:57 -07:00