]> git.ipfire.org Git - thirdparty/linux.git/log
thirdparty/linux.git
3 months agoMerge tag 'memory-controller-drv-6.9-2' of https://git.kernel.org/pub/scm/linux/kerne...
Arnd Bergmann [Mon, 4 Mar 2024 15:59:48 +0000 (16:59 +0100)] 
Merge tag 'memory-controller-drv-6.9-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into soc/drivers

Memory controller drivers for v6.9, part two

1. Renesas RPC-IF: add bindings for R-Car V4M.
2. Tegra MC: correct and extend support for Tegra234 memory controller.
3. STM32: add support for Flexible Memory Controller on MP25 SoC.
4. NXP WEIM bindings: convert to DT schema.

* tag 'memory-controller-drv-6.9-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl:
  memory: stm32-fmc2-ebi: keep power domain on
  memory: stm32-fmc2-ebi: add MP25 RIF support
  memory: stm32-fmc2-ebi: add MP25 support
  memory: stm32-fmc2-ebi: check regmap_read return value
  dt-bindings: memory-controller: st,stm32: add MP25 support
  dt-bindings: bus: imx-weim: convert to YAML
  memory: tegra: Fix indentation
  memory: tegra: Add BPMP and ICC info for DLA clients
  memory: tegra: Correct DLA client names
  dt-bindings: memory: renesas,rpc-if: Document R-Car V4M support

Link: https://lore.kernel.org/r/20240229124600.405016-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 months agoMerge tag 'omap-for-v6.9/ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Mon, 4 Mar 2024 15:57:39 +0000 (16:57 +0100)] 
Merge tag 'omap-for-v6.9/ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into soc/drivers

Driver change for ti-sysc

Just one change to constify struct device_type.

* tag 'omap-for-v6.9/ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  bus: ti-sysc: constify the struct device_type usage

Link: https://lore.kernel.org/r/pull-1709194472-263643@atomide.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 months agoMerge tag 'samsung-drivers-6.9-2' of https://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Mon, 4 Mar 2024 15:54:27 +0000 (16:54 +0100)] 
Merge tag 'samsung-drivers-6.9-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into soc/drivers

Samsung SoC driver changes for v6.9, part two

1. Extend Exynos PMU (Power Management Unit) driver being also the
   syscon to main system controller registers block, to support Google
   GS101.  The Google GS101 has PMU registers protected and writing is
   available only via SMC.  The Exynos PMU will register its own custom
   regmap for such case of mixed MMIO+SMC.

2. Rework Samsung watchdog driver to get the regmap to PMU block not
   via syscon API, but from the Exynos PMU driver.  This is necessary
   for the watchdog driver to work on Google GS101.

* tag 'samsung-drivers-6.9-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
  watchdog: s3c2410_wdt: use exynos_get_pmu_regmap_by_phandle() for PMU regs
  soc: samsung: exynos-pmu: Add regmap support for SoCs that protect PMU regs
  MAINTAINERS: samsung: gs101: match patches touching Google Tensor SoC

Link: https://lore.kernel.org/r/20240227080755.34170-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 months agoMerge tag 'qcom-drivers-for-6.9' of https://git.kernel.org/pub/scm/linux/kernel/git...
Arnd Bergmann [Mon, 4 Mar 2024 15:52:36 +0000 (16:52 +0100)] 
Merge tag 'qcom-drivers-for-6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/drivers

Qualcomm driver updates for v6.9

This introduces the Qualcomm Programmable Boot Sequencer (PBS) driver.

The Qualcomm SMEM no longer acquires the hwspinlock during the "get"
operation, to improve the system behavior during the recovery of a
remoteproc that crashed with the hwspinlock held.

The Qualcomm Always On Subsystem (AOSS) message protocol driver gains
tracepoints, printf annotation, and a debugfs interface is introduced
for tweaking system properties during development and debugging.

The Qualcomm socinfo driver gains data for SM8475, QCM8550 and
QCS8550 platforms, and the PM2250 is renamed to PM4125.

Support for controlling the voltage regulator in SPM/SAW2 is introduced.

The gfx.lvl power-domain is dropped for SA8540P, as this resource was
incorrectly inherited from SC8280XP.

Additionally some code cleanup improvements is introduced across APR,
LLCC, SMP2P and SPM.

* tag 'qcom-drivers-for-6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (23 commits)
  dt-bindings: soc: qcom: qcom,saw2: add msm8226 l2 compatible
  soc: qcom: spm: add support for voltage regulator
  soc: qcom: spm: remove driver-internal structures from the driver API
  dt-bindings: soc: qcom: qcom,saw2: define optional regulator node
  dt-bindings: soc: qcom: qcom,saw2: add missing compatible strings
  dt-bindings: soc: qcom: merge qcom,saw2.txt into qcom,spm.yaml
  soc: qcom: llcc: Check return value on Broadcast_OR reg read
  soc: qcom: socinfo: Add Soc IDs for SM8475 family
  dt-bindings: arm: qcom,ids: Add IDs for SM8475 family
  soc: qcom: apr: make aprbus const
  dt-bindings: soc: qcom: qcom,pmic-glink: document X1E80100 compatible
  soc: qcom: add QCOM PBS driver
  dt-bindings: soc: qcom: Add qcom,pbs bindings
  pmdomain: qcom: rpmhpd: Drop SA8540P gfx.lvl
  soc: qcom: socinfo: rename PM2250 to PM4125
  soc: qcom: aoss: Add tracepoints in qmp_send()
  soc: qcom: socinfo: add SoC Info support for QCM8550 and QCS8550 platform
  dt-bindings: arm: qcom,ids: add SoC ID for QCM8550 and QCS8550
  soc: qcom: aoss: Add debugfs interface for sending messages
  soc: qcom: smem: remove hwspinlock from item get routine
  ...

Link: https://lore.kernel.org/r/20240225030612.480241-1-andersson@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 months agoMerge tag 'sunxi-drivers-for-6.9-1' of https://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Mon, 4 Mar 2024 15:51:58 +0000 (16:51 +0100)] 
Merge tag 'sunxi-drivers-for-6.9-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into soc/drivers

- make sunxi_rsb_bus constant

* tag 'sunxi-drivers-for-6.9-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  bus: sunxi-rsb: make sunxi_rsb_bus const

Link: https://lore.kernel.org/r/20240223205734.GA9027@jernej-laptop
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 months agoMerge tag 'tegra-for-6.9-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git...
Arnd Bergmann [Mon, 4 Mar 2024 15:51:03 +0000 (16:51 +0100)] 
Merge tag 'tegra-for-6.9-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers

firmware: tegra: Changes for v6.9-rc1

Contains a fix that makes sure we don't unnecessarily call kfree().

* tag 'tegra-for-6.9-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  firmware: tegra: bpmp: Return directly after a failed kzalloc() in get_filename()

Link: https://lore.kernel.org/r/20240223174849.1509465-2-thierry.reding@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 months agoMerge tag 'tegra-for-6.9-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra...
Arnd Bergmann [Mon, 4 Mar 2024 15:48:15 +0000 (16:48 +0100)] 
Merge tag 'tegra-for-6.9-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers

soc/tegra: Changes for v6.9-rc1

This set of changes adds ACPI support for the APBMISC driver and cleans
up a few things like dependencies and unused code.

* tag 'tegra-for-6.9-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  soc/tegra: pmc: Add SD wake event for Tegra234
  soc/tegra: pmc: Update scratch as an optional aperture
  soc/tegra: pmc: Update address mapping sequence for PMC apertures
  bus: tegra-aconnect: Update dependency to ARCH_TEGRA
  soc/tegra: Fix build failure on Tegra241
  soc/tegra: fuse: Fix crash in tegra_fuse_readl()
  soc/tegra: fuse: Define tegra194_soc_attr_group for Tegra241
  soc/tegra: fuse: Add support for Tegra241
  soc/tegra: fuse: Add ACPI support for Tegra194 and Tegra234
  soc/tegra: fuse: Add function to print SKU info
  soc/tegra: fuse: Add function to add lookups
  soc/tegra: fuse: Add tegra_acpi_init_apbmisc()
  soc/tegra: fuse: Refactor resource mapping
  soc/tegra: fuse: Use dev_err_probe for probe failures
  mm/util: Introduce kmemdup_array()
  soc/tegra: pmc: Remove some old and deprecated functions and constants

Link: https://lore.kernel.org/r/20240223174849.1509465-1-thierry.reding@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 months agoMerge tag 'scmi-updates-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep...
Arnd Bergmann [Mon, 4 Mar 2024 14:49:52 +0000 (15:49 +0100)] 
Merge tag 'scmi-updates-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers

Arm SCMI updates for v6.9

Quite a few changes to extend support to SCMI v3.2 specification,
to enhance notification handling and other miscellaneous updates.

1. Enhancements to notification handling

   Until now, trying to register a notifier for an unsuppported
   notification returned an error genrating unneeded message exchanges
   with the SCMI platform. This can be avoided by looking up in advance
   the specific protocol and resources available.

   With these changes SCMI driver user will fail to register a notifier
   if the related command or resource is not supported (like before)
   without the need of exchanging any message.

   Perf notifications are also extended to provide the pre-calculated
   frequencies corresponding to the level or index carried by the

2. More SCMI v3.2 related updates

   One of the main addition includes a centralized support to the SCMI
   core to handle v3.2 optional protocol version negotiation, so that
   at protocol initialization time, if the platform advertised version
   is newer than supported by the kernel and protocol version negotiation
   is supported, the SCMI core will attempt to negotiate an older protocol
   version.

   It also includes the clock get permissions which indicates if any of
   the clock operations are forbidden by the platform for the OSPM agent.
   It can be used in the clock driver to avoid unnecessary message
   exchanges between the kernel and the platform which will always end
   up with the failure. It also includes other missing bits of clock
   v3.2 protocol so that the supported protocol version can be bumped
   to 0x30000 (v3.2).

3. Miscellaneous updates

   This includes addition of warning if the domain frequency multiplier
   is 0 or rounded off to indicate the actual frequencies are either
   wrong ot rounded off, hardening of clock domain info lookups, addition
   of multiple protocols registration support within a SCMI driver,
   update to SCMI entry in MAINTAINERS to include HWMON driver and
   constifying the scmi_bus_type structure.

   This also includes couple for fixes to minor issues: double free in
   SMC transport cleanup path and struct kernel-doc warnings in optee
   transport.

* tag 'scmi-updates-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: (29 commits)
  MAINTAINERS: Update SCMI entry with HWMON driver
  firmware: arm_scmi: Update the supported clock protocol version
  firmware: arm_scmi: Add standard clock OEM definitions
  firmware: arm_scmi: Add clock check for extended config support
  firmware: arm_scmi: Add support for v3.2 NEGOTIATE_PROTOCOL_VERSION
  firmware: arm_scmi: Fix struct kernel-doc warnings in optee transport
  firmware: arm_scmi: Report frequencies in the perf notifications
  firmware: arm_scmi: Use opps_by_lvl to store opps
  firmware: arm_scmi: Implement is_notify_supported callback in powercap protocol
  firmware: arm_scmi: Implement is_notify_supported callback in reset protocol
  firmware: arm_scmi: Implement is_notify_supported callback in sensor protocol
  firmware: arm_scmi: Implement is_notify_supported callback in clock protocol
  firmware: arm_scmi: Implement is_notify_supported callback in system power protocol
  firmware: arm_scmi: Implement is_notify_supported callback in power protocol
  firmware: arm_scmi: Implement is_notify_supported callback in perf protocol
  firmware: arm_scmi: Add a common helper to check if a message is supported
  firmware: arm_scmi: Check for notification support
  firmware: arm_scmi: Make scmi_bus_type const
  firmware: arm_scmi: Fix double free in SMC transport cleanup path
  firmware: arm_scmi: Implement clock get permissions
  ...

Link: https://lore.kernel.org/r/20240223033435.118028-1-sudeep.holla@arm.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 months agoMerge tag 'ffa-update-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep...
Arnd Bergmann [Mon, 4 Mar 2024 14:48:38 +0000 (15:48 +0100)] 
Merge tag 'ffa-update-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers

Arm FF-A update for v6.9

Another single and simple update to just constify the ffa_bus_type
structure similar to other changes done treewide following the driver
core changes to accomodate the same.

* tag 'ffa-update-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
  firmware: arm_ffa: Make ffa_bus_type const

Link: https://lore.kernel.org/r/20240223033250.117878-1-sudeep.holla@arm.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 months agobus: ti-sysc: constify the struct device_type usage
Ricardo B. Marliere [Mon, 19 Feb 2024 12:10:00 +0000 (09:10 -0300)] 
bus: ti-sysc: constify the struct device_type usage

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the
sysc_device_type variable to be a constant structure as well, placing it
into read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Message-ID: <20240219-device_cleanup-ti-sysc-v1-1-13b53177d0a5@marliere.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
3 months agomemory: stm32-fmc2-ebi: keep power domain on
Christophe Kerello [Mon, 26 Feb 2024 10:14:28 +0000 (11:14 +0100)] 
memory: stm32-fmc2-ebi: keep power domain on

MP25 FMC2 domain has to be kept on. To handle it throw PSCI OS-initiated,
basic PM for keeping domain on is introduced.

Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
Link: https://lore.kernel.org/r/20240226101428.37791-6-christophe.kerello@foss.st.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 months agomemory: stm32-fmc2-ebi: add MP25 RIF support
Christophe Kerello [Mon, 26 Feb 2024 10:14:27 +0000 (11:14 +0100)] 
memory: stm32-fmc2-ebi: add MP25 RIF support

The FMC2 revision 2 supports security and isolation compliant with
the Resource Isolation Framework (RIF). From RIF point of view,
the FMC2 is composed of several independent resources, listed below,
which can be assigned to different security and compartment domains:
 - 0: Common FMC_CFGR register.
 - 1: EBI controller for Chip Select 1.
 - 2: EBI controller for Chip Select 2.
 - 3: EBI controller for Chip Select 3.
 - 4: EBI controller for Chip Select 4.
 - 5: NAND controller.

Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
Link: https://lore.kernel.org/r/20240226101428.37791-5-christophe.kerello@foss.st.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 months agomemory: stm32-fmc2-ebi: add MP25 support
Christophe Kerello [Mon, 26 Feb 2024 10:14:26 +0000 (11:14 +0100)] 
memory: stm32-fmc2-ebi: add MP25 support

Add the support of the revision 2 of FMC2 IP.
     - PCSCNTR register has been removed,
     - CFGR register has been added,
     - the bit used to enable the IP has moved from BCR1 to CFGR,
     - the timeout for CEx deassertion has moved from PCSCNTR to BCRx,
     - the continuous clock enable has moved from BCR1 to CFGR,
     - the clk divide ratio has moved from BCR1 to CFGR.

The MP1 SoCs have only one signal to manage all the controllers (NWAIT).
The MP25 SOC has one RNB signal for the NAND controller and one NWAIT
signal for the memory controller.

Let's use a platform data structure for parameters that will differ
between MP1 and MP25.

Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
Link: https://lore.kernel.org/r/20240226101428.37791-4-christophe.kerello@foss.st.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 months agomemory: stm32-fmc2-ebi: check regmap_read return value
Christophe Kerello [Mon, 26 Feb 2024 10:14:25 +0000 (11:14 +0100)] 
memory: stm32-fmc2-ebi: check regmap_read return value

Check regmap_read return value to avoid to use uninitialized local
variables.

Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
Link: https://lore.kernel.org/r/20240226101428.37791-3-christophe.kerello@foss.st.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 months agodt-bindings: memory-controller: st,stm32: add MP25 support
Christophe Kerello [Mon, 26 Feb 2024 10:14:24 +0000 (11:14 +0100)] 
dt-bindings: memory-controller: st,stm32: add MP25 support

Add a new compatible string to support MP25 SoC.

On MP1 SoC, RNB signal (NAND controller signal) and NWAIT signal (PSRAM
controller signal) have been integrated together in the SoC. That means
that the NAND controller and the PSRAM controller (if the signal is
used) can not be used at the same time. On MP25 SoC, the 2 signals can
be used outside the SoC, so there is no more restrictions.

MP1 SoC also embeds revision 1.1 of the FMC2 IP when MP25 SoC embeds
revision 2.0 of the FMC2 IP.

MP25 SoC is also using PSCI OS-initiated mode, so allow a single
'power-domains' entry for STM32 FMC2. As MP1 will move on PSCI
OS-initiated mode, add this property as optional for all FMC2 variants.

Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
Link: https://lore.kernel.org/r/20240226101428.37791-2-christophe.kerello@foss.st.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 months agodt-bindings: bus: imx-weim: convert to YAML
Sebastian Reichel [Sat, 24 Feb 2024 21:29:34 +0000 (22:29 +0100)] 
dt-bindings: bus: imx-weim: convert to YAML

Convert the i.MX  Wireless External Interface Module binding to YAML.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Link: https://lore.kernel.org/r/20240224213240.1854709-3-sre@kernel.org
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 months agowatchdog: s3c2410_wdt: use exynos_get_pmu_regmap_by_phandle() for PMU regs
Peter Griffin [Tue, 20 Feb 2024 22:06:13 +0000 (22:06 +0000)] 
watchdog: s3c2410_wdt: use exynos_get_pmu_regmap_by_phandle() for PMU regs

Obtain the PMU regmap using the new API added to exynos-pmu driver rather
than syscon_regmap_lookup_by_phandle(). As this driver no longer depends
on mfd syscon remove that header and Kconfig dependency.

Tested-by: Alexey Klimov <alexey.klimov@linaro.org>
Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Link: https://lore.kernel.org/r/20240220220613.797068-3-peter.griffin@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 months agosoc: samsung: exynos-pmu: Add regmap support for SoCs that protect PMU regs
Peter Griffin [Tue, 20 Feb 2024 22:06:12 +0000 (22:06 +0000)] 
soc: samsung: exynos-pmu: Add regmap support for SoCs that protect PMU regs

Some Exynos based SoCs like Tensor gs101 protect the PMU registers for
security hardening reasons so that they are only write accessible in el3
via an SMC call.

As most Exynos drivers that need to write PMU registers currently obtain a
regmap via syscon (phys, pinctrl, watchdog). Support for the above usecase
is implemented in this driver using a custom regmap similar to syscon to
handle the SMC call. Platforms that don't secure PMU registers, get a mmio
regmap like before. As regmaps abstract out the underlying register access
changes to the leaf drivers are minimal.

A new API exynos_get_pmu_regmap_by_phandle() is provided for leaf drivers
that currently use syscon_regmap_lookup_by_phandle(). This also handles
deferred probing.

Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
Tested-by: Alexey Klimov <alexey.klimov@linaro.org>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Link: https://lore.kernel.org/r/20240220220613.797068-2-peter.griffin@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 months agoMAINTAINERS: Update SCMI entry with HWMON driver
Florian Fainelli [Thu, 22 Feb 2024 19:30:27 +0000 (11:30 -0800)] 
MAINTAINERS: Update SCMI entry with HWMON driver

scmi-hwmon.c is tightly coupled with the SCMI subsystem, fold it under
the SCMI subsystem MAINTAINERS umbrella.

Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/r/20240222193027.920006-1-florian.fainelli@broadcom.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agoMAINTAINERS: samsung: gs101: match patches touching Google Tensor SoC
Krzysztof Kozlowski [Mon, 19 Feb 2024 12:54:53 +0000 (13:54 +0100)] 
MAINTAINERS: samsung: gs101: match patches touching Google Tensor SoC

Maintainers of Google Tensor SoC should be aware of all driver patches
having that name.

Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Link: https://lore.kernel.org/r/20240219125453.103692-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 months agomemory: tegra: Fix indentation
Jon Hunter [Tue, 20 Feb 2024 12:44:30 +0000 (12:44 +0000)] 
memory: tegra: Fix indentation

Fix the indentation of the '.regs' member for the Tegra234 NVJPG memory
client.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20240220124430.19072-3-jonathanh@nvidia.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 months agomemory: tegra: Add BPMP and ICC info for DLA clients
Jon Hunter [Tue, 20 Feb 2024 12:44:29 +0000 (12:44 +0000)] 
memory: tegra: Add BPMP and ICC info for DLA clients

Add the BPMP IDs and ICC type information for the Tegra234 DLA memory
clients.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20240220124430.19072-2-jonathanh@nvidia.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 months agomemory: tegra: Correct DLA client names
Jon Hunter [Tue, 20 Feb 2024 12:44:28 +0000 (12:44 +0000)] 
memory: tegra: Correct DLA client names

Some of the names for the Tegra234 DLA clients are not unique and do not
align with the name of the client ID definitions. Therefore, it is not
possible to determine the exact DLA client from messages that print the
client name. Fix this by correcting the DLA memory client names for
Tegra234 to align with the name of the corresponding memory client ID.

Note that although the client names are also used by the interconnect
framework, interconnect support for the DLA clients has not been added
and so this issue does not impact the interconnect support.

Fixes: 5cd24ca0985f ("memory: tegra: Add DLA clients for Tegra234")
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20240220124430.19072-1-jonathanh@nvidia.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 months agodt-bindings: memory: renesas,rpc-if: Document R-Car V4M support
Geert Uytterhoeven [Mon, 19 Feb 2024 14:52:19 +0000 (15:52 +0100)] 
dt-bindings: memory: renesas,rpc-if: Document R-Car V4M support

Document support for the SPI Multi I/O Bus Controller (RPC-IF) in the
Renesas R-Car V4M (R8A779H0) SoC.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/263d6626fd4fa51b175b5c7a53e6a363e2c91519.1708354280.git.geert+renesas@glider.be
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 months agofirmware: arm_scmi: Update the supported clock protocol version
Cristian Marussi [Wed, 14 Feb 2024 18:30:04 +0000 (18:30 +0000)] 
firmware: arm_scmi: Update the supported clock protocol version

And finally update the supported clock protocol version to v3.2(0x30000).

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240214183006.3403207-6-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Add standard clock OEM definitions
Cristian Marussi [Wed, 14 Feb 2024 18:30:03 +0000 (18:30 +0000)] 
firmware: arm_scmi: Add standard clock OEM definitions

Add a common enum to define the standard clock OEM types defined by the
SCMI specification, so as to enable the configuration of such extended
configuration properties with the existent clock protocol operations.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240214183006.3403207-5-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Add clock check for extended config support
Cristian Marussi [Wed, 14 Feb 2024 18:30:02 +0000 (18:30 +0000)] 
firmware: arm_scmi: Add clock check for extended config support

SCMI v3.2 added support to set/get clock custom OEM types; such support is
conditionally present, though, depending on an extended config attribute
bit possibly advertised by the platform server on a per-domain base.

Add a check to verify if OEM types are supported before allowing any kind
of OEM-specific get/set operation. Also add a check around all the new
v3.2 clock features.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240214183006.3403207-4-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Add support for v3.2 NEGOTIATE_PROTOCOL_VERSION
Cristian Marussi [Wed, 14 Feb 2024 18:30:01 +0000 (18:30 +0000)] 
firmware: arm_scmi: Add support for v3.2 NEGOTIATE_PROTOCOL_VERSION

Freshly introduced NEGOTIATE_PROTOCOL_VERSION allows the agent to ascertain
upfront if a specific protocol(usually older) version is supported by the
platform.

It is used by the agent in case the platform has advertised the support of
a newer protocol version than the latest version supported by the agent,
since backward compatibility cannot be automatically assumed.

Emit a warning about possible incompatibility when negotiation was not
possible or just print the successfully negotiated protocol.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240214183006.3403207-3-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Fix struct kernel-doc warnings in optee transport
Randy Dunlap [Wed, 21 Feb 2024 06:21:57 +0000 (22:21 -0800)] 
firmware: arm_scmi: Fix struct kernel-doc warnings in optee transport

Fix the kernel-doc notation for the nested union in struct
scmi_optee_channel to eliminate kernel-doc warnings:

  |  optee.c:130: warning: Excess struct member 'shmem' description
  |    in 'scmi_optee_channel'
  |  optee.c:131: warning: Function parameter or struct member 'req'
  |    not described in 'scmi_optee_channel'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Cristian Marussi <cristian.marussi@arm.com>
Cc: <linux-arm-kernel@lists.infradead.org>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240221062157.8694-1-rdunlap@infradead.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: tegra: bpmp: Return directly after a failed kzalloc() in get_filename()
Markus Elfring [Mon, 25 Dec 2023 19:03:56 +0000 (20:03 +0100)] 
firmware: tegra: bpmp: Return directly after a failed kzalloc() in get_filename()

The kfree() function was called in one case by
the get_filename() function during error handling
even if the passed variable contained a null pointer.
This issue was detected by using the Coccinelle software.

Thus return directly after a call of the function “kzalloc” failed
at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Thierry Reding <treding@nvidia.com>
3 months agoMerge tag 'memory-controller-drv-6.9' of https://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Tue, 20 Feb 2024 21:04:03 +0000 (22:04 +0100)] 
Merge tag 'memory-controller-drv-6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into soc/drivers

Memory controller drivers for v6.9

1. TI EMIF: Simplify handling CONFIG_DEBUG_FS, CONFIG_OF and
   platform_driver_probe().
2. Narrow regex in Nvidia Tegra20 EMC binding.

* tag 'memory-controller-drv-6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl:
  dt-bindings: memory-controllers: narrow regex for unit address to hex numbers
  memory: emif: Drop usage of platform_driver_probe()
  memory: emif: Simplify code handling CONFIG_OF
  memory: emif: Simplify code handling CONFIG_DEBUG_FS

Link: https://lore.kernel.org/r/20240218183046.32721-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 months agoMerge tag 'samsung-drivers-6.9' of https://git.kernel.org/pub/scm/linux/kernel/git...
Arnd Bergmann [Tue, 20 Feb 2024 21:02:40 +0000 (22:02 +0100)] 
Merge tag 'samsung-drivers-6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into soc/drivers

Samsung SoC driver changes for v6.9

1. Add bindings for Google GS101 I2C controller and SYSREG sycon block.
2. Remove Tomasz Figa from Samsung clock and pinctrl maintainer entries.

* tag 'samsung-drivers-6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
  MAINTAINERS: Remove Tomasz from Samsung clock and pinctrl entries
  dt-bindings: samsung: exynos-sysreg: gs101-peric0/1 require a clock
  dt-bindings: i2c: exynos5: add google,gs101-hsi2c compatible

Link: https://lore.kernel.org/r/20240218182141.31213-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 months agoMerge tag 'renesas-drivers-for-v6.9-tag1' of git://git.kernel.org/pub/scm/linux/kerne...
Arnd Bergmann [Tue, 20 Feb 2024 21:00:01 +0000 (22:00 +0100)] 
Merge tag 'renesas-drivers-for-v6.9-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/drivers

Renesas driver updates for v6.9

  - Initial support for the Renesas R-Car V4M (R8A779H0) SoC.

* tag 'renesas-drivers-for-v6.9-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel:
  soc: renesas: rcar-rst: Add support for R-Car V4M
  soc: renesas: Identify R-Car V4M
  soc: renesas: Introduce ARCH_RCAR_GEN4

Link: https://lore.kernel.org/r/cover.1707487830.git.geert+renesas@glider.be
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 months agoMerge tag 'mtk-soc-for-v6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/media...
Arnd Bergmann [Tue, 20 Feb 2024 20:49:18 +0000 (21:49 +0100)] 
Merge tag 'mtk-soc-for-v6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux into soc/drivers

MediaTek soc driver updates for v6.9

The only addition here is the MediaTek SoC Information driver,
registering socinfo for various MediaTek SoCs.

* tag 'mtk-soc-for-v6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux:
  soc: mediatek: mtk-socinfo: Add extra entry for MT8183
  soc: mediatek: mtk-socinfo: Clean up NVMEM cell read
  soc: mediatek: mtk-socinfo: Add driver for getting chip information

Link: https://lore.kernel.org/r/20240219131230.157792-2-angelogioacchino.delregno@collabora.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 months agofirmware: arm_scmi: Report frequencies in the perf notifications
Cristian Marussi [Mon, 12 Feb 2024 12:32:33 +0000 (12:32 +0000)] 
firmware: arm_scmi: Report frequencies in the perf notifications

Extend the perf notification report to include pre-calculated frequencies
corresponding to the reported limits/levels event; such frequencies are
properly computed based on the stored known OPPs information taking into
consideration if the current operating mode is level indexed or not.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-12-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Use opps_by_lvl to store opps
Cristian Marussi [Mon, 12 Feb 2024 12:32:32 +0000 (12:32 +0000)] 
firmware: arm_scmi: Use opps_by_lvl to store opps

Store all the discovered OPPs into the XArray opps_by_lvl even when
level_indexing mode is not used, since it comes handy to easily retrieve
OPPs by level.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-11-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Implement is_notify_supported callback in powercap protocol
Cristian Marussi [Mon, 12 Feb 2024 12:32:31 +0000 (12:32 +0000)] 
firmware: arm_scmi: Implement is_notify_supported callback in powercap protocol

Add a preliminary check to verify if the powercap protocol related notify
enable commands are supported at all by the SCMI platform, and then
provide the callback needed to allow the core SCMI notification
subsytem to do a fine-grain check if a specific resource domain
supports notifications.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-10-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Implement is_notify_supported callback in reset protocol
Cristian Marussi [Mon, 12 Feb 2024 12:32:30 +0000 (12:32 +0000)] 
firmware: arm_scmi: Implement is_notify_supported callback in reset protocol

Add a preliminary check to verify if the reset protocol related notify
enable commands are supported at all by the SCMI platform, and then
provide the callback needed to allow the core SCMI notification
subsytem to do a fine-grain check if a specific resource domain
supports notifications.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-9-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Implement is_notify_supported callback in sensor protocol
Cristian Marussi [Mon, 12 Feb 2024 12:32:29 +0000 (12:32 +0000)] 
firmware: arm_scmi: Implement is_notify_supported callback in sensor protocol

Add a preliminary check to verify if the sensor protocol related notify
enable commands are supported at all by the SCMI platform, and then
provide the callback needed to allow the core SCMI notification
subsytem to do a fine-grain check if a specific resource domain
supports notifications.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-8-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Implement is_notify_supported callback in clock protocol
Cristian Marussi [Mon, 12 Feb 2024 12:32:28 +0000 (12:32 +0000)] 
firmware: arm_scmi: Implement is_notify_supported callback in clock protocol

Add a preliminary check to verify if the clock protocol related notify
enable commands are supported at all by the SCMI platform, and then
provide the callback needed to allow the core SCMI notification
subsytem to do a fine-grain check if a specific resource domain
supports notifications.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-7-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_ffa: Make ffa_bus_type const
Ricardo B. Marliere [Sun, 11 Feb 2024 15:51:29 +0000 (12:51 -0300)] 
firmware: arm_ffa: Make ffa_bus_type const

Now that the driver core can properly handle constant struct bus_type,
move the ffa_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240211-bus_cleanup-firmware2-v1-1-1851c92c7be7@marliere.net
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Implement is_notify_supported callback in system power protocol
Cristian Marussi [Mon, 12 Feb 2024 12:32:27 +0000 (12:32 +0000)] 
firmware: arm_scmi: Implement is_notify_supported callback in system power protocol

Add a preliminary check to verify if the system power protocol related
notify enable commands are supported at all by the SCMI platform, and
then provide the callback needed to allow the core SCMI notification
subsytem to do a fine-grain check if a specific resource domain supports
notifications.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-6-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Implement is_notify_supported callback in power protocol
Cristian Marussi [Mon, 12 Feb 2024 12:32:26 +0000 (12:32 +0000)] 
firmware: arm_scmi: Implement is_notify_supported callback in power protocol

Add a preliminary check to verify if the power related notify enable
commands are supported at all by the SCMI platform, and then provide
the callback needed to allow the core SCMI notification subsytem to do
a fine-grain check if a specific resource domain supports notifications.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-5-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Implement is_notify_supported callback in perf protocol
Cristian Marussi [Mon, 12 Feb 2024 12:32:25 +0000 (12:32 +0000)] 
firmware: arm_scmi: Implement is_notify_supported callback in perf protocol

Add a preliminary check to verify if the performance related notify
enable commands are supported at all by the SCMI platform, and then
provide the callback needed to allow the core SCMI notification
subsytem to do a fine-grain check if a specific resource domain
supports notifications.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-4-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Add a common helper to check if a message is supported
Cristian Marussi [Mon, 12 Feb 2024 12:32:24 +0000 (12:32 +0000)] 
firmware: arm_scmi: Add a common helper to check if a message is supported

A common helper is provided to check if a specific protocol message is
supported or not.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-3-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Check for notification support
Cristian Marussi [Mon, 12 Feb 2024 12:32:23 +0000 (12:32 +0000)] 
firmware: arm_scmi: Check for notification support

When registering protocol events, use the optional .is_notify_supported
callback provided by the protocol to check if that specific notification
type is available for that particular resource on the running system,
marking it as unsupported otherwise.

Then, when a notification enable request is received, return an error if
it was previously marked as unsuppported, so avoiding to send a needless
notification enable command and check the returned value for failure.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-2-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Make scmi_bus_type const
Ricardo B. Marliere [Sun, 11 Feb 2024 15:51:30 +0000 (12:51 -0300)] 
firmware: arm_scmi: Make scmi_bus_type const

Now that the driver core can properly handle constant struct bus_type,
move the scmi_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240211-bus_cleanup-firmware2-v1-2-1851c92c7be7@marliere.net
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Fix double free in SMC transport cleanup path
Andre Przywara [Fri, 26 Jan 2024 12:23:25 +0000 (12:23 +0000)] 
firmware: arm_scmi: Fix double free in SMC transport cleanup path

When the generic SCMI code tears down a channel, it calls the chan_free
callback function, defined by each transport. Since multiple protocols
might share the same transport_info member, chan_free() might want to
clean up the same member multiple times within the given SCMI transport
implementation. In this case, it is SMC transport. This will lead to a NULL
pointer dereference at the second time:

    | scmi_protocol scmi_dev.1: Enabled polling mode TX channel - prot_id:16
    | arm-scmi firmware:scmi: SCMI Notifications - Core Enabled.
    | arm-scmi firmware:scmi: unable to communicate with SCMI
    | Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
    | Mem abort info:
    |   ESR = 0x0000000096000004
    |   EC = 0x25: DABT (current EL), IL = 32 bits
    |   SET = 0, FnV = 0
    |   EA = 0, S1PTW = 0
    |   FSC = 0x04: level 0 translation fault
    | Data abort info:
    |   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
    |   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
    |   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
    | user pgtable: 4k pages, 48-bit VAs, pgdp=0000000881ef8000
    | [0000000000000000] pgd=0000000000000000, p4d=0000000000000000
    | Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
    | Modules linked in:
    | CPU: 4 PID: 1 Comm: swapper/0 Not tainted 6.7.0-rc2-00124-g455ef3d016c9-dirty #793
    | Hardware name: FVP Base RevC (DT)
    | pstate: 61400009 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
    | pc : smc_chan_free+0x3c/0x6c
    | lr : smc_chan_free+0x3c/0x6c
    | Call trace:
    |  smc_chan_free+0x3c/0x6c
    |  idr_for_each+0x68/0xf8
    |  scmi_cleanup_channels.isra.0+0x2c/0x58
    |  scmi_probe+0x434/0x734
    |  platform_probe+0x68/0xd8
    |  really_probe+0x110/0x27c
    |  __driver_probe_device+0x78/0x12c
    |  driver_probe_device+0x3c/0x118
    |  __driver_attach+0x74/0x128
    |  bus_for_each_dev+0x78/0xe0
    |  driver_attach+0x24/0x30
    |  bus_add_driver+0xe4/0x1e8
    |  driver_register+0x60/0x128
    |  __platform_driver_register+0x28/0x34
    |  scmi_driver_init+0x84/0xc0
    |  do_one_initcall+0x78/0x33c
    |  kernel_init_freeable+0x2b8/0x51c
    |  kernel_init+0x24/0x130
    |  ret_from_fork+0x10/0x20
    | Code: f0004701 910a0021 aa1403e5 97b91c70 (b9400280)
    | ---[ end trace 0000000000000000 ]---

Simply check for the struct pointer being NULL before trying to access
its members, to avoid this situation.

This was found when a transport doesn't really work (for instance no SMC
service), the probe routines then tries to clean up, and triggers a crash.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Fixes: 1dc6558062da ("firmware: arm_scmi: Add smc/hvc transport")
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240126122325.2039669-1-andre.przywara@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Implement clock get permissions
Peng Fan [Sun, 21 Jan 2024 11:09:00 +0000 (19:09 +0800)] 
firmware: arm_scmi: Implement clock get permissions

ARM SCMI v3.2 introduces clock get permission command. To implement the
same let us stash the values of those permissions in the scmi_clock_info.
They indicate if the operation is forbidden or not.

If the CLOCK_GET_PERMISSIONS command is not supported, the default
permissions are set to allow the operations, otherwise they will be set
according to the response of CLOCK_GET_PERMISSIONS from the SCMI
platform firmware.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/20240121110901.1414856-1-peng.fan@oss.nxp.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Add multiple protocols registration support
Cristian Marussi [Thu, 21 Dec 2023 15:11:29 +0000 (15:11 +0000)] 
firmware: arm_scmi: Add multiple protocols registration support

Add the capability for a SCMI driver to register to the core SCMI stack
with multiple SCMI protocols. In such a case the SCMI driver probe
function will end up being called once for each registered protocol
which have been also found as implemented on the platform.

This is especially useful in testing scenarios.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20231221151129.325749-1-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Rework clock domain info lookups
Cristian Marussi [Wed, 10 Jan 2024 12:09:16 +0000 (12:09 +0000)] 
firmware: arm_scmi: Rework clock domain info lookups

Accessing clock domains descriptors by the index from the SCMI drivers
can potentially lead to out-of-bound violations if the SCMI drivers
misbehaves.

Use a common helper to check the consistency of such accesses.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240110120916.2482603-1-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agofirmware: arm_scmi: Warn if domain frequency multiplier is 0 or rounded off
Sudeep Holla [Fri, 19 Jan 2024 15:23:37 +0000 (15:23 +0000)] 
firmware: arm_scmi: Warn if domain frequency multiplier is 0 or rounded off

When (sustained_freq_khz * 1000) is less than sustained_perf_level, the
multiplier will be less than 1 and hence rounded down as 0. Similarly if
it is not multiple of sustained_perf_level the dom_info->mult_factor will
contain rounded down value and will end up impacting all the frequency
calculations done using it.

Add warning if and when the domain frequency multiplier is 0 or rounded
down so that it gives a clue to get the firmware tables fixed.

Suggested-by: Pierre Gondois <Pierre.Gondois@arm.com>
Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240119152338.3047620-1-sudeep.holla@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 months agodt-bindings: soc: qcom: qcom,saw2: add msm8226 l2 compatible
Luca Weiss [Sat, 10 Feb 2024 16:28:52 +0000 (17:28 +0100)] 
dt-bindings: soc: qcom: qcom,saw2: add msm8226 l2 compatible

Add the compatible for the SAW2 for L2 cache found on MSM8226.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240210-msm8226-cpu-v2-1-5d9cb4c35204@z3ntu.xyz
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
3 months agosoc: qcom: spm: add support for voltage regulator
Dmitry Baryshkov [Tue, 2 Jan 2024 05:17:25 +0000 (07:17 +0200)] 
soc: qcom: spm: add support for voltage regulator

The SPM / SAW2 device also provides a voltage regulator functionality
with optional AVS (Adaptive Voltage Scaling) support. The exact register
sequence and voltage ranges differs from device to device.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20240102-saw2-spm-regulator-v7-5-0472ec237f49@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
3 months agosoc: qcom: spm: remove driver-internal structures from the driver API
Dmitry Baryshkov [Tue, 2 Jan 2024 05:17:24 +0000 (07:17 +0200)] 
soc: qcom: spm: remove driver-internal structures from the driver API

Move internal SPM driver structures to the driver itself, removing them
from the public API. The CPUidle driver doesn't use them at all.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20240102-saw2-spm-regulator-v7-4-0472ec237f49@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
3 months agodt-bindings: soc: qcom: qcom,saw2: define optional regulator node
Dmitry Baryshkov [Tue, 2 Jan 2024 05:17:23 +0000 (07:17 +0200)] 
dt-bindings: soc: qcom: qcom,saw2: define optional regulator node

The SAW2 device can optionally provide a voltage regulator supplying the
CPU core, cluster or L2 cache. Change the boolean 'regulator' property
into a proper regulator description. This breaks schema compatibility
for the sake of properly describing the regulator.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20240102-saw2-spm-regulator-v7-3-0472ec237f49@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
3 months agodt-bindings: soc: qcom: qcom,saw2: add missing compatible strings
Dmitry Baryshkov [Tue, 2 Jan 2024 05:17:22 +0000 (07:17 +0200)] 
dt-bindings: soc: qcom: qcom,saw2: add missing compatible strings

Define compatible strings for SAW2 units present on MSM8960, IPQ4019
and IPQ8064.  There is no need to include SAW version into the compat
string, so just use the SoC and SAW2 kind.

Also add missing L2 SAW2 compatibles for MSM8974 and APQ8084, they
follow the existing CPU SAW2 strings.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240102-saw2-spm-regulator-v7-2-0472ec237f49@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
3 months agodt-bindings: soc: qcom: merge qcom,saw2.txt into qcom,spm.yaml
Dmitry Baryshkov [Tue, 2 Jan 2024 05:17:21 +0000 (07:17 +0200)] 
dt-bindings: soc: qcom: merge qcom,saw2.txt into qcom,spm.yaml

The Qualcomm SPM / SAW2 device is described in two bindigns files:
arm/msm/qcom,saw2.txt and soc/qcom/qcom,spm.yaml. Merge the former into
the latter, adding detailed device node description. While we are at it,
also rename qcom,spm.yaml to qcom,saw2.yaml to follow the actual
compatible used for these devices.

The regulator property is retained as is. It will be changed in the
later patches.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20240102-saw2-spm-regulator-v7-1-0472ec237f49@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
3 months agosoc/tegra: pmc: Add SD wake event for Tegra234
Prathamesh Shete [Fri, 16 Feb 2024 08:04:50 +0000 (08:04 +0000)] 
soc/tegra: pmc: Add SD wake event for Tegra234

Add SD wake event for Tegra234 so that system can be woken up from
suspend when SD card hot-plug/unplug event is detected.

Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
3 months agosoc/tegra: pmc: Update scratch as an optional aperture
Petlozu Pravareshwar [Sun, 11 Feb 2024 17:17:27 +0000 (17:17 +0000)] 
soc/tegra: pmc: Update scratch as an optional aperture

Scratch address space register is used to store reboot reason. For
some Tegra234 systems, the scratch space is not available to store
the reboot reason. This is because scratch region on these systems
is not accessible by the kernel as restricted by the Hypervisor.
Such systems would delist scratch aperture from PMC DT node.

Hence this change makes scratch as optional aperture and also avoids
registering reboot notifier if scratch address space isn't mapped.

Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
3 months agosoc/tegra: pmc: Update address mapping sequence for PMC apertures
Petlozu Pravareshwar [Sun, 11 Feb 2024 17:17:25 +0000 (17:17 +0000)] 
soc/tegra: pmc: Update address mapping sequence for PMC apertures

On Tegra SoCs prior to Tegra186, PMC has single address range only.
Starting from and after Tegra186, PMC has additional address ranges
apart from base address range. Currently in PMC driver, we try to
map these additional address ranges on all SoCs and if we fail then
we assume that the range is not valid for an SoC. This change makes
it more explicit on which address ranges are expected to be present
on which SoCs and maps the additional address ranges only on SoCs
from and after Tegra186.

Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
3 months agobus: tegra-aconnect: Update dependency to ARCH_TEGRA
Peter Robinson [Fri, 16 Feb 2024 10:02:37 +0000 (10:02 +0000)] 
bus: tegra-aconnect: Update dependency to ARCH_TEGRA

Update the architecture dependency to be the generic Tegra
because the driver works on the four latest Tegra generations
not just Tegra210, if you build a kernel with a specific
ARCH_TEGRA_xxx_SOC option that excludes Tegra210 you don't get
this driver.

Fixes: 46a88534afb59 ("bus: Add support for Tegra ACONNECT")
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Jon Hunter <jonathanh@nvidia.com>
Cc: Thierry Reding <treding@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
3 months agosoc: qcom: llcc: Check return value on Broadcast_OR reg read
Unnathi Chalicheemala [Mon, 12 Feb 2024 18:35:15 +0000 (10:35 -0800)] 
soc: qcom: llcc: Check return value on Broadcast_OR reg read

Commit c72ca343f911 ("soc: qcom: llcc: Add v4.1 HW version support")
introduced a new 4.1 if statement in llcc_update_act_ctrl() without
considering that ret might be overwritten. So, add return value check
after Broadcast_OR register read in llcc_update_act_ctrl().

Fixes: c72ca343f911 ("soc: qcom: llcc: Add v4.1 HW version support")
Signed-off-by: Unnathi Chalicheemala <quic_uchalich@quicinc.com>
Reviewed-by: Elliot Berman <quic_eberman@quicinc.com>
Reviewed-by: Mukesh Ojha <quic_mojha@quicinc.com>
Link: https://lore.kernel.org/r/20240212183515.433873-1-quic_uchalich@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
3 months agosoc: qcom: socinfo: Add Soc IDs for SM8475 family
Danila Tikhonov [Mon, 12 Feb 2024 20:14:28 +0000 (23:14 +0300)] 
soc: qcom: socinfo: Add Soc IDs for SM8475 family

Add Soc ID table entries for Qualcomm SM8475 family.

Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240212201428.87151-3-danila@jiaxyga.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
3 months agodt-bindings: arm: qcom,ids: Add IDs for SM8475 family
Danila Tikhonov [Mon, 12 Feb 2024 20:14:27 +0000 (23:14 +0300)] 
dt-bindings: arm: qcom,ids: Add IDs for SM8475 family

Add Qualcomm SM8475/SM8475P/SM8475_2 (cape) SoC IDs.

Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240212201428.87151-2-danila@jiaxyga.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
3 months agosoc: qcom: apr: make aprbus const
Ricardo B. Marliere [Tue, 13 Feb 2024 14:44:01 +0000 (11:44 -0300)] 
soc: qcom: apr: make aprbus const

Since commit d492cc2573a0 ("driver core: device.h: make struct
bus_type a const *"), the driver core can properly handle constant
struct bus_type, move the aprbus variable to be a constant
structure as well, placing it into read-only memory which can not be
modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240213-bus_cleanup-apr-v1-1-50c824eec06d@marliere.net
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
3 months agobus: sunxi-rsb: make sunxi_rsb_bus const
Ricardo B. Marliere [Sun, 4 Feb 2024 15:56:44 +0000 (12:56 -0300)] 
bus: sunxi-rsb: make sunxi_rsb_bus const

Now that the driver core can properly handle constant struct bus_type,
move the sunxi_rsb_bus variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240204-bus_cleanup-bus-v1-1-bda309c4b829@marliere.net
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
3 months agoMAINTAINERS: Remove Tomasz from Samsung clock and pinctrl entries
Tomasz Figa [Thu, 1 Feb 2024 14:01:34 +0000 (23:01 +0900)] 
MAINTAINERS: Remove Tomasz from Samsung clock and pinctrl entries

I have been no longer at Samsung for a long time, the platforms
that I am knowledgable about (S3C24xx, S3C64xx, Exynos 4) are no longer
relevant and we have people with better capabilities as maintainers
already, so let me remove myself. Thanks for the nice collaboration
everyone!

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Link: https://lore.kernel.org/r/20240201140134.4345-1-tomasz.figa@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 months agodt-bindings: samsung: exynos-sysreg: gs101-peric0/1 require a clock
André Draszik [Fri, 26 Jan 2024 11:55:16 +0000 (11:55 +0000)] 
dt-bindings: samsung: exynos-sysreg: gs101-peric0/1 require a clock

... otherwise it won't be accessible.

Update the schema to make this obvious.

Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://lore.kernel.org/r/20240126115517.1751971-1-andre.draszik@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
4 months agodt-bindings: soc: qcom: qcom,pmic-glink: document X1E80100 compatible
Abel Vesa [Mon, 29 Jan 2024 13:28:29 +0000 (15:28 +0200)] 
dt-bindings: soc: qcom: qcom,pmic-glink: document X1E80100 compatible

Document the X1E80100 compatible used to describe the pmic glink
on this platform.

Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240129-x1e80100-pmic-glink-v1-1-e45cf194b964@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
4 months agoMerge branch '20240201204421.16992-2-quic_amelende@quicinc.com' into drivers-for-6.9
Bjorn Andersson [Thu, 1 Feb 2024 22:24:07 +0000 (16:24 -0600)] 
Merge branch '20240201204421.16992-2-quic_amelende@quicinc.com' into drivers-for-6.9

Merge PBS driver through topic branch, to also allow it be merged
through the LED subsystem.

4 months agosoc: qcom: add QCOM PBS driver
Anjelique Melendez [Thu, 1 Feb 2024 20:44:24 +0000 (12:44 -0800)] 
soc: qcom: add QCOM PBS driver

Add the Qualcomm PBS (Programmable Boot Sequencer) driver. The QCOM PBS
driver supports configuring software PBS trigger events through PBS RAM
on Qualcomm Technologies, Inc (QTI) PMICs.

Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
Link: https://lore.kernel.org/r/20240201204421.16992-6-quic_amelende@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
4 months agodt-bindings: soc: qcom: Add qcom,pbs bindings
Anjelique Melendez [Thu, 1 Feb 2024 20:44:22 +0000 (12:44 -0800)] 
dt-bindings: soc: qcom: Add qcom,pbs bindings

Add binding for the Qualcomm Programmable Boot Sequencer device.

Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240201204421.16992-4-quic_amelende@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
4 months agosoc/tegra: Fix build failure on Tegra241
Arnd Bergmann [Wed, 3 Jan 2024 10:26:49 +0000 (11:26 +0100)] 
soc/tegra: Fix build failure on Tegra241

If all the other SoCs are disabled, the driver fails to build:

drivers/soc/tegra/fuse/fuse-tegra30.c:684:17: error: 'tegra30_fuse_read' undeclared here (not in a function); did you mean 'tegra_fuse_readl'?
  684 |         .read = tegra30_fuse_read,
      |                 ^~~~~~~~~~~~~~~~~
      |                 tegra_fuse_readl
drivers/soc/tegra/fuse/fuse-tegra30.c:694:17: error: 'tegra30_fuse_init' undeclared here (not in a function); did you mean 'tegra_fuse_info'?
  694 |         .init = tegra30_fuse_init,
      |                 ^~~~~~~~~~~~~~~~~

Fix the list of SoCs using this function to include the newly added one.

Fixes: dee509eb9cd5 ("soc/tegra: fuse: Add support for Tegra241")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Kartik <kkartik@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
4 months agosoc/tegra: fuse: Fix crash in tegra_fuse_readl()
Jon Hunter [Mon, 29 Jan 2024 13:46:59 +0000 (13:46 +0000)] 
soc/tegra: fuse: Fix crash in tegra_fuse_readl()

Commit c5b2d43e67bb ("soc/tegra: fuse: Add ACPI support for Tegra194 and
Tegra234") updated the Tegra fuse driver to add ACPI support and added a
test to the tegra_fuse_readl() function to check if the device is
booting with device-tree. This test passes 'fuse->dev' variable to
dev_fwnode() but does not check first is 'fuse->dev' is valid. This is
causing a crash to occur in Tegra XUSB PHY driver that calls the
tegra_fuse_readl() function before 'fuse->dev' variable has been
initialised ...

 Unable to handle kernel NULL pointer dereference at virtual address 0000000000000290
 Mem abort info:
   ESR = 0x0000000096000004
   EC = 0x25: DABT (current EL), IL = 32 bits
   SET = 0, FnV = 0
   EA = 0, S1PTW = 0
   FSC = 0x04: level 0 translation fault
 Data abort info:
   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
 [0000000000000290] user address but active_mm is swapper
 Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
 Modules linked in:
 CPU: 7 PID: 70 Comm: kworker/u16:4 Not tainted 6.8.0-rc1-next-20240129-02825-g596764183be8 #1
 Hardware name: NVIDIA Jetson AGX Xavier Developer Kit (DT)
 Workqueue: events_unbound deferred_probe_work_func
 pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
 pc : __dev_fwnode+0x0/0x18
 lr : tegra_fuse_readl+0x24/0x98
 sp : ffff80008393ba10
 x29: ffff80008393ba10 x28: 0000000000000000 x27: ffff800081233c10
 x26: 00000000000001c8 x25: ffff000080b7bc10 x24: ffff000082df3b00
 x23: fffffffffffffff4 x22: 0000000000000004 x21: ffff80008393ba84
 x20: 00000000000000f0 x19: ffff800082f1e000 x18: ffff800081d72000
 x17: 0000000000000001 x16: 0000000000000001 x15: ffff800082fcdfff
 x14: 0000000000000000 x13: 0000000003541000 x12: 0000000000000020
 x11: 0140000000000000 x10: ffff800080000000 x9 : 0000000000000000
 x8 : ffff000082df3b40 x7 : 0000000000000000 x6 : 000000000000003f
 x5 : 00000000ffffffff x4 : 0000000000000dc0 x3 : 00000000000000c0
 x2 : 0000000000000001 x1 : ffff80008393ba84 x0 : 0000000000000000
 Call trace:
  __dev_fwnode+0x0/0x18
  tegra186_xusb_padctl_probe+0xb0/0x1a8
  tegra_xusb_padctl_probe+0x7c/0xebc
  platform_probe+0x90/0xd8
  really_probe+0x13c/0x29c
  __driver_probe_device+0x7c/0x124
  driver_probe_device+0x38/0x11c
  __device_attach_driver+0x90/0xdc
  bus_for_each_drv+0x78/0xdc
  __device_attach+0xfc/0x188
  device_initial_probe+0x10/0x18
  bus_probe_device+0xa4/0xa8
  deferred_probe_work_func+0x80/0xb4
  process_scheduled_works+0x178/0x3e0
  worker_thread+0x164/0x2e8
  kthread+0xfc/0x11c
  ret_from_fork+0x10/0x20
 Code: a8c27bfd d65f03c0 128002a0 d65f03c0 (f9414801)
 ---[ end trace 0000000000000000 ]---

Fix this by verifying that 'fuse->dev' is valid before passing to
dev_fwnode().

Fixes: c5b2d43e67bb ("soc/tegra: fuse: Add ACPI support for Tegra194 and Tegra234")
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Kartik <kkartik@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
4 months agosoc/tegra: fuse: Define tegra194_soc_attr_group for Tegra241
Kartik [Wed, 20 Dec 2023 06:10:13 +0000 (11:40 +0530)] 
soc/tegra: fuse: Define tegra194_soc_attr_group for Tegra241

Tegra241 SoC data uses tegra194_soc_attr_group, which is only defined
if config CONFIG_ARCH_TEGRA_194_SOC or CONFIG_ARCH_TEGRA_234_SOC or
both are enabled. This causes a build failure if both of these configs
are disabled and CONFIG_ARCH_TEGRA_241_SOC is enabled.

Define tegra194_soc_attr_group if CONFIG_ARCH_TEGRA_241_SOC is enabled.

Signed-off-by: Kartik <kkartik@nvidia.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Signed-off-by: Thierry Reding <treding@nvidia.com>
4 months agosoc/tegra: fuse: Add support for Tegra241
Kartik [Tue, 17 Oct 2023 05:23:22 +0000 (10:53 +0530)] 
soc/tegra: fuse: Add support for Tegra241

Add support for Tegra241 which use ACPI boot.

Signed-off-by: Kartik <kkartik@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
4 months agosoc/tegra: fuse: Add ACPI support for Tegra194 and Tegra234
Kartik [Tue, 17 Oct 2023 05:23:21 +0000 (10:53 +0530)] 
soc/tegra: fuse: Add ACPI support for Tegra194 and Tegra234

Add ACPI support for Tegra194 & Tegra243 SoC's. This requires
following modifications to the probe when ACPI boot is used:
 - Initialize soc data.
 - Add nvmem lookups.
 - Register soc device.
 - use devm_clk_get_optional() instead of devm_clk_get() to get
   fuse->clk, as fuse clocks are not required when using ACPI boot.

Also, drop '__init' keyword for tegra_soc_device_register() as this is also
used by tegra_fuse_probe() and use dev_err_probe() wherever applicable.

Signed-off-by: Kartik <kkartik@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
4 months agosoc/tegra: fuse: Add function to print SKU info
Kartik [Tue, 17 Oct 2023 05:23:20 +0000 (10:53 +0530)] 
soc/tegra: fuse: Add function to print SKU info

Add helper function tegra_fuse_print_sku_info() to print Tegra SKU
information. So, it can be shared between tegra_fuse_init() and
ACPI probe which is to be introduced later.

Signed-off-by: Kartik <kkartik@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
4 months agosoc/tegra: fuse: Add function to add lookups
Kartik [Tue, 17 Oct 2023 05:23:19 +0000 (10:53 +0530)] 
soc/tegra: fuse: Add function to add lookups

Add helper function tegra_fuse_add_lookups() to register Tegra fuse
nvmem lookups. So, this can be shared between tegra_fuse_init() and
ACPI probe, which is to be introduced later.

Use kmemdup_array to duplicate fuse->soc->lookups.

Signed-off-by: Kartik <kkartik@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
4 months agosoc/tegra: fuse: Add tegra_acpi_init_apbmisc()
Kartik [Tue, 17 Oct 2023 05:23:18 +0000 (10:53 +0530)] 
soc/tegra: fuse: Add tegra_acpi_init_apbmisc()

In preparation to ACPI support in Tegra fuse driver add function
tegra_acpi_init_apbmisc() to initialize tegra-apbmisc driver.
Also, document the reason of calling tegra_init_apbmisc() at early init.

Note that function tegra_acpi_init_apbmisc() is not placed in the __init
section, because it will be called during probe.

Signed-off-by: Kartik <kkartik@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
4 months agosoc/tegra: fuse: Refactor resource mapping
Kartik [Tue, 17 Oct 2023 05:23:17 +0000 (10:53 +0530)] 
soc/tegra: fuse: Refactor resource mapping

To prepare for adding ACPI support to the tegra-apbmisc driver,
relocate the code responsible for mapping memory resources from
the function ‘tegra_init_apbmisc’ to the function
‘tegra_init_apbmisc_resources.’ This adjustment will allow the
code to be shared between ‘tegra_init_apbmisc’ and the upcoming
‘tegra_acpi_init_apbmisc’ function.

Signed-off-by: Kartik <kkartik@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
4 months agosoc/tegra: fuse: Use dev_err_probe for probe failures
Kartik [Tue, 17 Oct 2023 05:23:16 +0000 (10:53 +0530)] 
soc/tegra: fuse: Use dev_err_probe for probe failures

Currently, in tegra_fuse_probe() if clock/reset get fails, then the
driver prints an error if the error is not caused by -EPROBE_DEFER.
This can be improved by using dev_err_probe() instead.

So, return dev_err_probe() if clock/reset get fails.

Signed-off-by: Kartik <kkartik@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
4 months agomm/util: Introduce kmemdup_array()
Kartik [Tue, 17 Oct 2023 05:23:15 +0000 (10:53 +0530)] 
mm/util: Introduce kmemdup_array()

Introduce kmemdup_array() API to duplicate `n` number of elements
from a given array. This internally uses kmemdup to allocate and duplicate
the `src` array.

Signed-off-by: Kartik <kkartik@nvidia.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
4 months agosoc/tegra: pmc: Remove some old and deprecated functions and constants
Christophe JAILLET [Sun, 12 Nov 2023 07:04:14 +0000 (08:04 +0100)] 
soc/tegra: pmc: Remove some old and deprecated functions and constants

These TEGRA_IO_RAIL_... functions and constants have been deprecated in
commit 21b499105178 ("soc/tegra: pmc: Add I/O pad voltage support") in
2016-11.

There seems to be no users since kernel 4.16.

Remove them now.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Thierry Reding <treding@nvidia.com>
4 months agosoc: renesas: rcar-rst: Add support for R-Car V4M
Duy Nguyen [Thu, 25 Jan 2024 15:34:40 +0000 (16:34 +0100)] 
soc: renesas: rcar-rst: Add support for R-Car V4M

Add support for the R-Car V4M (R8A779H0) SoC to the R-Car RST driver.

Signed-off-by: Duy Nguyen <duy.nguyen.rh@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/13dc9f014e27db5092b3cc23edddf4b5e01a6645.1706194617.git.geert+renesas@glider.be
4 months agosoc: renesas: Identify R-Car V4M
Duy Nguyen [Thu, 25 Jan 2024 15:34:39 +0000 (16:34 +0100)] 
soc: renesas: Identify R-Car V4M

Add support for identifying the R-Car V4M (R8A779H0) SoC.

Signed-off-by: Duy Nguyen <duy.nguyen.rh@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/31e06d055aec1bc70c3e9a02f9268bcfc72b2204.1706194617.git.geert+renesas@glider.be
4 months agosoc: renesas: Introduce ARCH_RCAR_GEN4
Geert Uytterhoeven [Thu, 25 Jan 2024 15:34:38 +0000 (16:34 +0100)] 
soc: renesas: Introduce ARCH_RCAR_GEN4

Currently, all Kconfig symbols for R-Car Gen4 SoCs select the
ARCH_RCAR_GEN3 SoC family symbol, which might confuse the casual reader.

Fix this by introducing a new SoC family symbol for R-Car Gen4 SoCs.
For now this just selects ARCH_RCAR_GEN3, to avoid duplication, and to
relax dependencies.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/a283913ba7a39ec2dae0ebf9fc2b06096f009511.1706194617.git.geert+renesas@glider.be
4 months agosoc: mediatek: mtk-socinfo: Add extra entry for MT8183
Chen-Yu Tsai [Tue, 30 Jan 2024 09:56:52 +0000 (17:56 +0800)] 
soc: mediatek: mtk-socinfo: Add extra entry for MT8183

The MT8183 has another socinfo match, with the second cell only
differing by one bit. Add it to the driver.

Fixes: 423a54da3c7e ("soc: mediatek: mtk-socinfo: Add driver for getting chip information")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Acked-by: William-tw Lin <william-tw.lin@mediatek.com>
Link: https://lore.kernel.org/r/20240130095656.3712469-3-wenst@chromium.org
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
4 months agosoc: mediatek: mtk-socinfo: Clean up NVMEM cell read
Chen-Yu Tsai [Tue, 30 Jan 2024 09:56:51 +0000 (17:56 +0800)] 
soc: mediatek: mtk-socinfo: Clean up NVMEM cell read

The mtk-socinfo grabs the NVMEM device devm_nvmem_device_get(), but then
proceeds to put the device directly with nvmem_device_put() if the read
is successful. If the device fails to probe and goes through the devres
release path, the device would be put a second time, triggering a
use-after-free error from KASAN.

Fix this by dropping the devres part. Since the NVMEM cell data is read
only once, there is no need to keep the reference around.

While at it, clean up the function to directly reference the NVMEM
device node and use that to find the NVMEM device, instead of finding it
by name, which is more fragile. The cell node is always a direct child
of the NVMEM device node, courtesy of the legacy NVMEM cell layout. Thus
of_get_child_by_name() is a better way of finding the cell. Last,
correctly put the device node once its use is over.

Fixes: 423a54da3c7e ("soc: mediatek: mtk-socinfo: Add driver for getting chip information")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20240130095656.3712469-2-wenst@chromium.org
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
4 months agopmdomain: qcom: rpmhpd: Drop SA8540P gfx.lvl
Bjorn Andersson [Thu, 25 Jan 2024 21:05:10 +0000 (13:05 -0800)] 
pmdomain: qcom: rpmhpd: Drop SA8540P gfx.lvl

On SA8295P and SA8540P gfx.lvl is not provdied by rpmh, but rather is
handled by an external regulator (max20411). Drop gfx.lvl from the list
of power-domains exposed on this platform.

Fixes: f68f1cb3437d ("soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20240125-sa8295p-gpu-v4-4-7011c2a63037@quicinc.com
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
4 months agosoc: mediatek: mtk-socinfo: Add driver for getting chip information
William-tw Lin [Fri, 22 Dec 2023 08:07:38 +0000 (16:07 +0800)] 
soc: mediatek: mtk-socinfo: Add driver for getting chip information

Add driver for socinfo retrieval. This patch includes the following:
1. mtk-socinfo driver for chip info retrieval
2. Related changes to Makefile and Kconfig

Signed-off-by: William-tw Lin <william-tw.lin@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20231222080739.21706-3-william-tw.lin@mediatek.com
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
4 months agosoc: qcom: socinfo: rename PM2250 to PM4125
Dmitry Baryshkov [Sun, 28 Jan 2024 01:32:44 +0000 (03:32 +0200)] 
soc: qcom: socinfo: rename PM2250 to PM4125

It seems, the only actual mentions of PM2250 can be found are related to
the Qualcomm RB1 platform. However even RB1 schematics use PM4125 as a
PMIC name. Rename PM2250 to PM4125 to follow the documentation.

Fixes: 082f9bc60f33 ("soc: qcom: spmi-pmic: add more PMIC SUBTYPE IDs")
Fixes: 112d96fd2927 ("soc: qcom: socinfo: Add some PMICs")
Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20240128-pm2250-pm4125-rename-v2-1-d51987e9f83a@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
4 months agosoc: qcom: aoss: Add tracepoints in qmp_send()
Bjorn Andersson [Wed, 24 Jan 2024 03:40:33 +0000 (19:40 -0800)] 
soc: qcom: aoss: Add tracepoints in qmp_send()

Add tracepoint for tracing the messages being sent and the success
thereof. This is useful as the system has a variety of clients sending
requests to the always-on subsystem.

Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Reviewed-by: Chris Lew <quic_clew@quicinc.com>
Link: https://lore.kernel.org/r/20240123-qcom-aoss-tracepoints-v2-1-bd73baa31977@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
4 months agosoc: qcom: socinfo: add SoC Info support for QCM8550 and QCS8550 platform
Tengfei Fan [Fri, 19 Jan 2024 10:06:18 +0000 (18:06 +0800)] 
soc: qcom: socinfo: add SoC Info support for QCM8550 and QCS8550 platform

Add SoC Info support for QCM8550 and QCS8550 platform.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Tengfei Fan <quic_tengfan@quicinc.com>
Link: https://lore.kernel.org/r/20240119100621.11788-4-quic_tengfan@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
4 months agodt-bindings: arm: qcom,ids: add SoC ID for QCM8550 and QCS8550
Tengfei Fan [Fri, 19 Jan 2024 10:06:17 +0000 (18:06 +0800)] 
dt-bindings: arm: qcom,ids: add SoC ID for QCM8550 and QCS8550

Add the ID for the Qualcomm QCM8550 and QCS8550 SoC, QCS8550 is a QCS
version of QCM8550.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Tengfei Fan <quic_tengfan@quicinc.com>
Link: https://lore.kernel.org/r/20240119100621.11788-3-quic_tengfan@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
4 months agosoc: qcom: aoss: Add debugfs interface for sending messages
Bjorn Andersson [Thu, 18 Jan 2024 02:31:52 +0000 (18:31 -0800)] 
soc: qcom: aoss: Add debugfs interface for sending messages

In addition to the normal runtime commands, the Always On Processor
(AOP) provides a number of debug commands which can be used during
system debugging for things such as preventing power collapse or placing
floor votes for certain resources. Some of these are documented in the
Robotics RB5 "Debug AOP ADB" linked below.

Provide a debugfs interface for the developer/tester to send some of
these commands to the AOP, which allow the user to override the DDR
frequency, preventing power collapse of cx and ddr, and prevent AOSS
from going to sleep.

Link: https://docs.qualcomm.com/bundle/publicresource/topics/80-88500-3/85_Debugging_AOP_ADB.html
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Reviewed-by: Chris Lew <quic_clew@quicinc.com>
Link: https://lore.kernel.org/r/20240117-qcom-aoss-debugfs-v2-v3-1-1aa779124822@quicinc.com
[bjorn: Dropped S_IWGRP from the debugfs files]
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
4 months agosoc: qcom: smem: remove hwspinlock from item get routine
Tao Zhang [Tue, 2 Jan 2024 02:25:12 +0000 (07:55 +0530)] 
soc: qcom: smem: remove hwspinlock from item get routine

During an SSR(Sub-System Restart) process, the remoteproc driver will
try to read the crash reason from SMEM. The qcom_smem_get() backing such
operations does however take the hwspinlock (tcsr mutex), which might be
held by the dying remoteproc.

The associated timeout on the hwspin_lock_timeout_irqsave() would take
care of the system not hanging forever, but the get operation will fail,
unnecessarily delaying the process for the 'HWSPINLOCK_TIMEOUT' duration
(currently is '1s'), and finally resulting in failure to get crash
information from SMEM.

This timeout can be avoided by removing the hwspinlock in the
qcom_smem_get routine. SMEM ensures that the allocated item will only be
visible after the new item is safe to use by following a specific order
of updates.

In the private partition case, qcom_smem_get_private() will use
'offset_free_uncached' as a loop boundary when looking for existing
allocated items. The corresponding allocation will only update
offset_free_uncached once the item is fully initialized.

    hdr->canary = SMEM_PRIVATE_CANARY;
    hdr->item = cpu_to_le16(item);
    hdr->size = cpu_to_le32(ALIGN(size, 8));
    hdr->padding_data = cpu_to_le16(le32_to_cpu(hdr->size) - size);
    hdr->padding_hdr = 0;

    wmb();
    le32_add_cpu(&phdr->offset_free_uncached, alloc_size);

The global partition is similar but uses the "entry->allocated" variable
to ensure the item is not visible to qcom_smem_get_global().

Signed-off-by: Tao Zhang <quic_taozhan@quicinc.com>
Reviewed-by: Chris Lew <quic_clew@quicinc.com>
Link: https://lore.kernel.org/r/20240102022512.999635-1-quic_taozhan@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
4 months agodt-bindings: soc/qcom: Add size constraints on "qcom,rpm-msg-ram"
Rob Herring [Wed, 24 Jan 2024 19:07:44 +0000 (13:07 -0600)] 
dt-bindings: soc/qcom: Add size constraints on "qcom,rpm-msg-ram"

The 'phandle-array' type is a bit ambiguous. It can be either just an
array of phandles or an array of phandles plus args. "qcom,rpm-msg-ram" is
the former and needs to constrain each entry to a single phandle value.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240124190744.1554625-1-robh@kernel.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
4 months agodt-bindings: memory-controllers: narrow regex for unit address to hex numbers
Krzysztof Kozlowski [Tue, 23 Jan 2024 08:35:17 +0000 (09:35 +0100)] 
dt-bindings: memory-controllers: narrow regex for unit address to hex numbers

Regular expression used to match the unit address part should not allow
non-hex numbers.

Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20240123083517.21091-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>