Commit graph

1186700 commits

Author SHA1 Message Date
Ivan Orlov
eafd52e697 char: misc: make misc_class a static const structure
Now that the driver core allows for struct class to be in read-only
memory, move the misc_class structure to be declared at build time
placing it into read-only memory, instead of having to be dynamically
allocated at load time.

Cc: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Link: https://lore.kernel.org/r/20230620143751.578239-14-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-23 10:27:15 +02:00
Ivan Orlov
7671284b6c /dev/mem: make mem_class a static const structure
Now that the driver core allows for struct class to be in read-only
memory, move the mem_class structure to be declared at build time
placing it into read-only memory, instead of having to be dynamically
allocated at load time.

Cc: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Link: https://lore.kernel.org/r/20230620143751.578239-13-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-23 10:27:13 +02:00
Ivan Orlov
03bcd4d8e9 char: lp: make lp_class a static const structure
Now that the driver core allows for struct class to be in read-only
memory, move the lp_class structure to be declared at build time
placing it into read-only memory, instead of having to be dynamically
allocated at load time.

Cc: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Link: https://lore.kernel.org/r/20230620143751.578239-12-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-23 10:27:11 +02:00
Ivan Orlov
bd31ef8836 dsp56k: make dsp56k_class a static const structure
Now that the driver core allows for struct class to be in read-only
memory, move the dsp56k_class structure to be declared at build time
placing it into read-only memory, instead of having to be dynamically
allocated at boot time.

Cc: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Link: https://lore.kernel.org/r/20230620143751.578239-11-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-23 10:27:08 +02:00
Ivan Orlov
e55ce9fd3d bsr: make bsr_class a static const structure
Now that the driver core allows for struct class to be in read-only
memory, move the bsr_class structure to be declared at build time
placing it into read-only memory, instead of having to be dynamically
allocated at boot time.

Cc: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Link: https://lore.kernel.org/r/20230620143751.578239-10-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-23 10:27:05 +02:00
Ivan Orlov
02fa4bcf4d oradax: make 'cl' a static const structure
Now that the driver core allows for struct class to be in read-only
memory, move the 'cl' structure to be declared at build time
placing it into read-only memory, instead of having to be dynamically
allocated at load time.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: "Mike Rapoport (IBM)" <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Ivan Orlov <ivan.orlov0322@gmail.com>
Cc: sparclinux@vger.kernel.org
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://lore.kernel.org/r/20230620183446.684061-2-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-23 10:27:02 +02:00
Greg Kroah-Hartman
fa50d6b8a5 coresight: Updates for v6.5
CoreSight and hwtracing subsystem updates for v6.5 includes:
 
  - Fixes to the CTI module reference leaks. This involves,
    redesign of how the helper devices are tracked and CTI
    devices have been converted to helper devices.
  - Fix removal of the trctraceidr file from sysfs for ETMs.
  - Match all ETMv4 instances based on the ETMv4 architected
    registers and the CoreSight Component ID (CID), than having
    to add individual PIDs for CPUs.
  - Add support for Dummy CoreSight source and sink drivers.
  - Add James Clark as Reviewer for the CoreSight kernel drivers
  - Fixes to HiSilicon PCIe Tune and Trace Device driver
 
 Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEuFy0byloRoXZHaWBxcXRZPKyBqEFAmSS/goACgkQxcXRZPKy
 BqFShQ//Z25Qnf0y2VdOBgZ1xWYeOTjkeQ2AVYE2hepV78N5rnI8BgcwlBNrF5IA
 uTu2U+nSenkCurWk+wOrmXaQ2SXkEEp2Gsm866WzeL4OjWsqxpdoZ1l2u7/YqxMK
 4QIP2ELS71KcQMIIJ31eYDSMro/gA8xDPh2QGhZKihUQAsoVQOghX7Y1eoT+4a/V
 pvsngu71iM45jHR1eFkp9/rQCKhy9OA58Q8gtg21uotOja9jvHQpRZ4TGN7en0CP
 RDVmIaxRDh3sPWoVpIPYs3nL8DX2NeSX5BVC/xq2P0UAHN6C9rp+Kom1XN7VZqS6
 UdgyNw1iulwtGW0zF5jwZrj5ZGMY4CFQhS6R3/DF5ohzuSwtSOY32cYyLKrUjmpx
 W0Nj7Pu/UaHU/kTu5+qItgTp0FP6du9p2VnZZuhroGLkGRSi2u392gKmPnKbErx5
 8tLo2ucAw1Kasm7pef2rj9M9etcWJws+dD1qWg96fvuKvJQX9+milweyg0I4NTXy
 p8GHpITZ65chWUJjqlxgnbvhB2V1eKP6bpG3sjzhCC2h9yXyzn4grOoSu/XNVQdx
 W3ldxRMlsoIFBbUb42yJQROSVezaYVC+5sk+fufRVbNR3b5ZmJOGYiCUtM+MMvtj
 q/1M/liPOYIf6Ix94EzxujdU12Ki5XLb5rWZqS3Gvebc8OG+o9E=
 =XWfo
 -----END PGP SIGNATURE-----

Merge tag 'coresight-next-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux into char-misc-next

Suzuki writes:

coresight: Updates for v6.5

CoreSight and hwtracing subsystem updates for v6.5 includes:

 - Fixes to the CTI module reference leaks. This involves,
   redesign of how the helper devices are tracked and CTI
   devices have been converted to helper devices.
 - Fix removal of the trctraceidr file from sysfs for ETMs.
 - Match all ETMv4 instances based on the ETMv4 architected
   registers and the CoreSight Component ID (CID), than having
   to add individual PIDs for CPUs.
 - Add support for Dummy CoreSight source and sink drivers.
 - Add James Clark as Reviewer for the CoreSight kernel drivers
 - Fixes to HiSilicon PCIe Tune and Trace Device driver

Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>

* tag 'coresight-next-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux: (27 commits)
  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
  coresight: dummy: Update type of mode parameter in dummy_{sink,source}_enable()
  Documentation: trace: Add documentation for Coresight Dummy Trace
  dt-bindings: arm: Add support for Coresight dummy trace
  Coresight: Add coresight dummy driver
  MAINTAINERS: coresight: Add James Clark as Reviewer
  coresight: etm4x: Match all ETM4 instances based on DEVARCH and DEVTYPE
  coresight: etm4x: Make etm4_remove_dev() return void
  coresight: etm4x: Fix missing trctraceidr file in sysfs
  coresight: Fix CTI module refcount leak by making it a helper device
  coresight: Enable and disable helper devices adjacent to the path
  coresight: Refactor out buffer allocation function for ETR
  coresight: Make refcount a property of the connection
  coresight: Store in-connections as well as out-connections
  coresight: Simplify connection fixup mechanism
  coresight: Store pointers to connections rather than an array of them
  ...
2023-06-21 21:15:06 +02:00
Greg Kroah-Hartman
92852219a3 interconnect changes for 6.5
This pull request contains the interconnect changes for the 6.5-rc1 merge
 window which is a mix of core and driver changes with the following highlights:
 
 - Support for configuring QoS on the Qualcomm's RPM-based platforms, that
   required special handling of some interface (non-scaling) clocks.
 - Support for clock-based interconnect providers for cases when clock
   corresponds to bus bandwidth. This is used to enable CPU cluster bandwidth
   scaling on MSM8996 platforms. One patch is touching a file in the clock
   subsystem that has been acked by the maintainer.
 
 Core changes:
 	interconnect: add clk-based icc provider support
 	interconnect: icc-clk: fix modular build
 	interconnect: drop unused icc_get() interface
 
 Driver changes:
 	interconnect: qcom: rpm: Rename icc desc clocks to bus_blocks
 	interconnect: qcom: rpm: Rename icc provider num_clocks to num_bus_clocks
 	interconnect: qcom: rpm: Drop unused parameters
 	interconnect: qcom: rpm: Set QoS registers only once
 	interconnect: qcom: rpm: Handle interface clocks
 	interconnect: qcom: icc-rpm: Enforce 2 or 0 bus clocks
 	interconnect: qcom: rpm: Don't use clk_get_optional for bus clocks anymore
 	interconnect: qcom: msm8996: Promote to core_initcall
 	interconnect: qcom: rpm: allocate enough data in probe()
 	dt-bindings: interconnect/msm8996-cbf: add defines to be used by CBF
 	clk: qcom: cbf-msm8996: scale CBF clock according to the CPUfreq
 	dt-bindings: interconnect: fsl,imx8m-noc: drop unneeded quotes
 
 Signed-off-by: Georgi Djakov <djakov@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJkkyQsAAoJEIDQzArG2BZj7GQQAMLrW2sZcxJhq5Fe2wKV4W5M
 ItIE7xME1Vk9PvuulZIJ57tZIKfOTJpXwwbh6qWJOejYGePrmgtT89iS0fadO81f
 yCKv2O2hD+Xukv+gFzyuX3AYEfur7myaCTfmRx93xVDYUz0d95Kj4BlYA84xkjXU
 i+wte+nX/nw9W78s+Y9BHcs389a3HTre0WR1c0eOboPmt8D0U9cBOdiZMHkSUc+4
 /8RDUYRdsTBR0AblpPExm2JjoSRKUGEw7N8ZFZhOXaejCjmGoeVXeTdnHO+tjXaq
 HQ9290C9Pz0BZWdKXaFFfjc4Wqu3RYjdXJmHNo74a4sFHE+H/j33eRSgC24qMWg5
 5hRsH8+gv0ZhoyLv6Ucd2MRQQvvUYCLNNeTlQ2/RkOFuqewLKqpXCiihbuKUpOi0
 CLeWKTDjNlIM5murJURXX88+xjZ1UvpuBXe/U+i9jrhjSQ6IjnAppoDw7anrrxTE
 ldLGFPzJoWL8VO1H0povS08/kd25+fgkjL/3pZHagSMLjDWNOXA+xDLkRYGBCNi7
 rZpLT/4nBFTcrcYEsJ2EPAqHYK19kD76NVrz+Fj2gzF9Ych3q+2MSkLb132Qkyzf
 qLn3SqWJQoPAhy0kQbOt3XBnYon8QjVEpcZIWf9J3Qr2au4SdHi7hr3ki86a5Pfz
 ne03bJDC237hO6q4jY0b
 =Smk9
 -----END PGP SIGNATURE-----

Merge tag 'icc-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next

Georgi writes:

interconnect changes for 6.5

This pull request contains the interconnect changes for the 6.5-rc1 merge
window which is a mix of core and driver changes with the following highlights:

- Support for configuring QoS on the Qualcomm's RPM-based platforms, that
  required special handling of some interface (non-scaling) clocks.
- Support for clock-based interconnect providers for cases when clock
  corresponds to bus bandwidth. This is used to enable CPU cluster bandwidth
  scaling on MSM8996 platforms. One patch is touching a file in the clock
  subsystem that has been acked by the maintainer.

Core changes:
	interconnect: add clk-based icc provider support
	interconnect: icc-clk: fix modular build
	interconnect: drop unused icc_get() interface

Driver changes:
	interconnect: qcom: rpm: Rename icc desc clocks to bus_blocks
	interconnect: qcom: rpm: Rename icc provider num_clocks to num_bus_clocks
	interconnect: qcom: rpm: Drop unused parameters
	interconnect: qcom: rpm: Set QoS registers only once
	interconnect: qcom: rpm: Handle interface clocks
	interconnect: qcom: icc-rpm: Enforce 2 or 0 bus clocks
	interconnect: qcom: rpm: Don't use clk_get_optional for bus clocks anymore
	interconnect: qcom: msm8996: Promote to core_initcall
	interconnect: qcom: rpm: allocate enough data in probe()
	dt-bindings: interconnect/msm8996-cbf: add defines to be used by CBF
	clk: qcom: cbf-msm8996: scale CBF clock according to the CPUfreq
	dt-bindings: interconnect: fsl,imx8m-noc: drop unneeded quotes

Signed-off-by: Georgi Djakov <djakov@kernel.org>

* tag 'icc-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc:
  dt-bindings: interconnect: fsl,imx8m-noc: drop unneeded quotes
  interconnect: icc-clk: fix modular build
  clk: qcom: cbf-msm8996: scale CBF clock according to the CPUfreq
  interconnect: drop unused icc_get() interface
  interconnect: qcom: rpm: allocate enough data in probe()
  interconnect: qcom: msm8996: Promote to core_initcall
  interconnect: qcom: rpm: Don't use clk_get_optional for bus clocks anymore
  interconnect: qcom: icc-rpm: Enforce 2 or 0 bus clocks
  interconnect: qcom: rpm: Handle interface clocks
  interconnect: add clk-based icc provider support
  dt-bindings: interconnect/msm8996-cbf: add defines to be used by CBF
  interconnect: qcom: rpm: Set QoS registers only once
  interconnect: qcom: rpm: Drop unused parameters
  interconnect: qcom: rpm: Rename icc provider num_clocks to num_bus_clocks
  interconnect: qcom: rpm: Rename icc desc clocks to bus_blocks
2023-06-21 21:12:43 +02:00
Yicong Yang
6c50384ef8 hwtracing: hisi_ptt: Fix potential sleep in atomic context
We're using pci_irq_vector() to obtain the interrupt number and then
bind it to the CPU start perf under the protection of spinlock in
pmu::start(). pci_irq_vector() might sleep since [1] because it will
call msi_domain_get_virq() to get the MSI interrupt number and it
needs to acquire dev->msi.data->mutex. Getting a mutex will sleep on
contention. So use pci_irq_vector() in an atomic context is problematic.

This patch cached the interrupt number in the probe() and uses the
cached data instead to avoid potential sleep.

[1] commit 82ff8e6b78 ("PCI/MSI: Use msi_get_virq() in pci_get_vector()")

Fixes: ff0de066b4 ("hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device")
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20230621092804.15120-6-yangyicong@huawei.com
2023-06-21 11:52:39 +01:00
Yicong Yang
45c90292ad hwtracing: hisi_ptt: Advertise PERF_PMU_CAP_NO_EXCLUDE for PTT PMU
The PTT trace collects PCIe TLP headers from the PCIe link and don't
have the ability to exclude certain context. It doesn't support itrace
as well. So replace PERF_PMU_CAP_ITRACE with PERF_PMU_CAP_NO_EXCLUDE.
This will greatly save the storage of final data. Tested tracing idle
link for ~15s, without this patch we'll collect ~28.682MB data for
additional information and with this patch it reduced to ~0.226MB.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Tested-by: Junhao He <hejunhao3@huawei.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20230621092804.15120-5-yangyicong@huawei.com
2023-06-21 11:52:35 +01:00
Yicong Yang
6373c463ac hwtracing: hisi_ptt: Export available filters through sysfs
The PTT can only filter the traced TLP headers by the Root Ports or the
Requester ID of the Endpoint, which are located on the same PCIe core of
the PTT device. The filter value used is derived from the BDF number of
the supported Root Port or the Endpoint. It's not friendly enough for the
users since it requires the user to be familiar enough with the platform
and calculate the filter value manually.

This patch export the available filters through sysfs. Each available
filters is presented as an individual file with the name of the BDF
number of the related PCIe device. The files are created under
$(PTT PMU dir)/available_root_port_filters and
$(PTT PMU dir)/available_requester_filters respectively. The filter
value can be known by reading the related file.

Then the users can easily know the available filters for trace and get
the filter values without calculating.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20230621092804.15120-4-yangyicong@huawei.com
2023-06-21 11:52:09 +01:00
Yicong Yang
556ef09392 hwtracing: hisi_ptt: Add support for dynamically updating the filter list
The PCIe devices supported by the PTT trace can be removed/rescanned by
hotplug or through sysfs.  Add support for dynamically updating the
available filter list by registering a PCI bus notifier block. Then user
can always get latest information about available tracing filters and
driver can block the invalid filters of which related devices no longer
exist in the system.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20230621092804.15120-3-yangyicong@huawei.com
2023-06-21 11:52:08 +01:00
Yicong Yang
a3ecaba701 hwtracing: hisi_ptt: Factor out filter allocation and release operation
Factor out the allocation and release of filters. This will make it easier
to extend and manage the function of the filter.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20230621092804.15120-2-yangyicong@huawei.com
2023-06-21 11:52:05 +01:00
Arnd Bergmann
a5052c85b9 samples: pfsm: add CC_CAN_LINK dependency
When no libc for the target architecture is available, cross-compiling
the same cannot work:

samples/pfsm/pfsm-wakeup.c:12:10: fatal error: fcntl.h: No such file or directory

Fixes: 9e66fb5244 ("samples: Add userspace example for TI TPS6594 PFSM")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230616145013.3889906-1-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-19 17:13:24 +02:00
Claudiu Beznea
af2e19d82a misc: fastrpc: check return value of devm_kasprintf()
devm_kasprintf() returns a pointer to dynamically allocated memory.
Pointer could be NULL in case allocation fails. Check pointer validity.
Identified with coccinelle (kmerr.cocci script).

Fixes: 3abe3ab3cd ("misc: fastrpc: add secure domain support")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230615102546.581899-1-claudiu.beznea@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-19 17:13:24 +02:00
Greg Kroah-Hartman
afc5fddd39 Update extcon next for v6.5
Detailed description for this pull request:
 1. Clean-up extcon core without any behavior changes
 - Add extcon_alloc_cables/muex/groups to improve the readability
   of extcon_dev_register.
 
 - Fix kernel doc of property and property capability fields to aovid warnings
   and add missing description of struct extcon_dev.
 
 - Use DECLARE_BITMAP macro and sysfs_emit instead of sprintf
 
 - Use device_match_of_node helper instead of accessing the .of_node
 
 - Use ida_alloc/free to get the unique id for extcon device
 
 2. Update extcon-usbc-tusb320.c to support usb_role_switch and accessory detection
 - Add usb_role_switch support on extcon-usbsc-tusb320.
 
 - Add additional accessory detection for audio/debug accessory
   and then pass the deteced accessory information to typec subsystem
   on extcon-usbsc-tusb320.c.
 
 - Add the support of unregistration of typec port on both error handling
   and driver removal step on
 
 3. Update extcon provider drivers (apx288/qcom-spmi-misc/palmas)
 - Replace put_device with acpi_dev_put on extcon-axp288.c
 
 - Use platform_get_irq_byname_optional for getting irq of
   usb_id and usb_vbus on extcon-qcom-spmi-misc.c.
 
 - Remove unused of_gpio.h on extcon-palmas.c.
 
 4. Fix the devicetree binding document
 - Rename misc node name to 'usb-dect@900' on pm8941-misc.yam
 
 - Fix usb-id and usb_vbus defintion on pm8941-misc.yaml
 
 - Drop unneeded quotes from extcon-arizona.c devicetree documentation
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEsSpuqBtbWtRe4rLGnM3fLN7rz1MFAmSQYzMACgkQnM3fLN7r
 z1MEmQ/+PQYDL5XBYEAunp1jURWHFVC+ee9DMq0L9gx2OSZ32nNslCAXrtElGQYF
 FG/bh+frPVRUSrYklDUBT1aQ87acE3aGIElfwf+GTjUksvi/tTwY/JaA58Y5IthF
 ZF86WBd1vDhTtMs0MCzfTZimfGWpckuBUEYr9yj0HJNc9ECh6tIdrJfReUF9SOtV
 wZ6HGC/13jr31cGiMW11sH5kImz7y4AAe7Q1ZYlEGaut1mfmcDxLjeW9GqQLxqme
 bHFThcXP+NESuB+7kLEEGtoCp3Tyyt5Je15onmVine7Vznwr0blUVv+d1NtdWNPX
 85mtqCSASiRSqXaUccqabjs2fKXP7gOFE+3t0cMaBRMfn3+Zd6mscBEMVOFXskA3
 WbvhFSX5UiY1pgGRW6sDMujrpItgS9KioJuFxOf3uRgZNy7tyJYQRaEp+5Dh7bBN
 LksNfE5vXdMJKgMw/g/b7WalPj8REsiiYGCignCCEs1MB2gjUryrqT0WzLu/LKSC
 OpH+xd08D7H7xu4jqWiD0ZkQs7OTACpj5GT1Xg7CsLwOhlthzHSs+sypi9h8+wVw
 tToQXqSyfjrLgk0O6Ry+vKfzfgQoZqM4m4JjF8Pce1NctU3MWwhBU6hwRjeEj3lv
 f5BppEk2VYDr6ofy1+OucrF/njR6QrTDlWdU8G+1g8PStWNrl4U=
 =3D98
 -----END PGP SIGNATURE-----

Merge tag 'extcon-next-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next

Chanwoo writes:

Update extcon next for v6.5

Detailed description for this pull request:
1. Clean-up extcon core without any behavior changes
- Add extcon_alloc_cables/muex/groups to improve the readability
  of extcon_dev_register.

- Fix kernel doc of property and property capability fields to aovid warnings
  and add missing description of struct extcon_dev.

- Use DECLARE_BITMAP macro and sysfs_emit instead of sprintf

- Use device_match_of_node helper instead of accessing the .of_node

- Use ida_alloc/free to get the unique id for extcon device

2. Update extcon-usbc-tusb320.c to support usb_role_switch and accessory detection
- Add usb_role_switch support on extcon-usbsc-tusb320.

- Add additional accessory detection for audio/debug accessory
  and then pass the deteced accessory information to typec subsystem
  on extcon-usbsc-tusb320.c.

- Add the support of unregistration of typec port on both error handling
  and driver removal step on

3. Update extcon provider drivers (apx288/qcom-spmi-misc/palmas)
- Replace put_device with acpi_dev_put on extcon-axp288.c

- Use platform_get_irq_byname_optional for getting irq of
  usb_id and usb_vbus on extcon-qcom-spmi-misc.c.

- Remove unused of_gpio.h on extcon-palmas.c.

4. Fix the devicetree binding document
- Rename misc node name to 'usb-dect@900' on pm8941-misc.yam

- Fix usb-id and usb_vbus defintion on pm8941-misc.yaml

- Drop unneeded quotes from extcon-arizona.c devicetree documentation

* tag 'extcon-next-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon: (26 commits)
  dt-bindings: extcon: wlf,arizona: drop unneeded quotes
  extcon: Switch i2c drivers back to use .probe()
  extcon: Drop unneeded assignments
  extcon: Use sizeof(*pointer) instead of sizeof(type)
  extcon: Use unique number for the extcon device ID
  extcon: Remove dup device name in the message and unneeded error check
  extcon: Use dev_of_node(dev) instead of dev->of_node
  extcon: Use device_match_of_node() helper
  extcon: Amend kernel documentation of struct extcon_dev
  extcon: Use sysfs_emit() to instead of sprintf()
  extcon: Use DECLARE_BITMAP() to declare bit arrays
  extcon: Fix kernel doc of property capability fields to avoid warnings
  extcon: Fix kernel doc of property fields to avoid warnings
  extcon: usbc-tusb320: add USB_ROLE_SWITCH dependency
  extcon: usbc-tusb320: add usb_role_switch support
  extcon: usbc-tusb320: add accessory detection support
  extcon: Add extcon_alloc_groups to simplify extcon register function
  extcon: Add extcon_alloc_muex to simplify extcon register function
  extcon: Add extcon_alloc_cables to simplify extcon register function
  extcon: Remove redundant null checking for class
  ...
2023-06-19 17:08:18 +02:00
Nathan Chancellor
185891f03f coresight: dummy: Update type of mode parameter in dummy_{sink,source}_enable()
Clang's kernel Control Flow Integrity (kCFI) is a compiler-based
security mitigation that ensures the target of an indirect function call
matches the expected type of the call and trapping if they do not match
exactly. The warning -Wincompatible-function-pointer-types-strict aims
to catch these issues at compile time, which reveals:

  drivers/hwtracing/coresight/coresight-dummy.c:53:12: error: incompatible function pointer types initializing 'int (*)(struct coresight_device *, struct perf_event *, enum cs_mode)' with an expression of type 'int (struct coresight_device *, struct perf_event *, u32)' (aka 'int (struct coresight_device *, struct perf_event *, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict]
     53 |         .enable = dummy_source_enable,
        |                   ^~~~~~~~~~~~~~~~~~~
  drivers/hwtracing/coresight/coresight-dummy.c:62:12: error: incompatible function pointer types initializing 'int (*)(struct coresight_device *, enum cs_mode, void *)' with an expression of type 'int (struct coresight_device *, u32, void *)' (aka 'int (struct coresight_device *, unsigned int, void *)') [-Werror,-Wincompatible-function-pointer-types-strict]
     62 |         .enable = dummy_sink_enable,
        |                   ^~~~~~~~~~~~~~~~~
  2 errors generated.

Commit 9fa3682869 ("coresight: Use enum type for cs_mode wherever
possible") updated the type of the mode parameter in the prototype but
this driver was not introduced until commit 9d3ba0b6c0 ("Coresight:
Add coresight dummy driver") and 'int' is ABI compatible with 'enum
cs_mode', so there is no warning from regular
-Wincompatible-function-pointer-types.

Adjust the type of the mode parameter in the callback implementations in
the coresight dummy driver to match the prototype, clearing up the
warning and avoiding kCFI failures at runtime.

Fixes: 9d3ba0b6c0 ("Coresight: Add coresight dummy driver")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20230616-coresight-dummy-fix-kcfi-warnings-v1-1-c55c64f8f0f5@kernel.org
2023-06-19 10:27:00 +01:00
Uwe Kleine-König
74a81c4854 char: xilinx_hwicap: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Michal Simek <michal.simek@amd.com>
Message-ID: <20230605092047.50472-3-u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:43:21 +02:00
Uwe Kleine-König
3d82dca0f2 char: xilinx_hwicap: Drop if block with always false condition
hwicap_drv_remove() is only called for a device after hwicap_drv_probe()
returned 0. In that case dev_set_drvdata() was called (by hwicap_setup())
with a non-NULL value and so dev_get_drvdata() won't return NULL.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Michal Simek <michal.simek@amd.com>
Message-ID: <20230605092047.50472-2-u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:43:21 +02:00
Uwe Kleine-König
e8989a48ca char: xilinx_hwicap: Fold hwicap_remove() into only caller
hwicap_remove() is only called by hwicap_drv_remove(). Simplify by
unrolling the former into the latter function.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Michal Simek <michal.simek@amd.com>
Message-ID: <20230605092047.50472-1-u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:43:21 +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
Ekansh Gupta
0b4e32df3e misc: fastrpc: Create fastrpc scalar with correct buffer count
A process can spawn a PD on DSP with some attributes that can be
associated with the PD during spawn and run. The invocation
corresponding to the create request with attributes has total
4 buffers at the DSP side implementation. If this number is not
correct, the invocation is expected to fail on DSP. Added change
to use correct number of buffer count for creating fastrpc scalar.

Fixes: d73f71c7c6 ("misc: fastrpc: Add support for create remote init process")
Cc: stable <stable@kernel.org>
Tested-by: Ekansh Gupta <quic_ekangupt@quicinc.com>
Signed-off-by: Ekansh Gupta <quic_ekangupt@quicinc.com>
Message-ID: <1686743685-21715-1-git-send-email-quic_ekangupt@quicinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:18 +02:00
Christophe JAILLET
1995f15590 firmware: stratix10-svc: Fix a potential resource leak in svc_create_memory_pool()
svc_create_memory_pool() is only called from stratix10_svc_drv_probe().
Most of resources in the probe are managed, but not this memremap() call.

There is also no memunmap() call in the file.

So switch to devm_memremap() to avoid a resource leak.

Cc: stable@vger.kernel.org
Fixes: 7ca5ce8965 ("firmware: add Intel Stratix10 service layer driver")
Link: https://lore.kernel.org/all/783e9dfbba34e28505c9efa8bba41f97fd0fa1dc.1686109400.git.christophe.jaillet@wanadoo.fr/
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Message-ID: <20230613211521.16366-1-dinguyen@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:18 +02:00
Phil Elwell
09dd7b993e nvmem: rmem: Use NVMEM_DEVID_AUTO
It is reasonable to declare multiple nvmem blocks. Unless a unique 'id'
is passed in for each block there may be name clashes.

Avoid this by using the magic token NVMEM_DEVID_AUTO.

Fixes: 5a3fa75a4d ("nvmem: Add driver to expose reserved memory as nvmem")
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
Reviewed-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-6-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:18 +02:00
Mirsad Goran Todorovac
7dae593cd2 test_firmware: return ENOMEM instead of ENOSPC on failed memory allocation
In a couple of situations like

	name = kstrndup(buf, count, GFP_KERNEL);
	if (!name)
		return -ENOSPC;

the error is not actually "No space left on device", but "Out of memory".

It is semantically correct to return -ENOMEM in all failed kstrndup()
and kzalloc() cases in this driver, as it is not a problem with disk
space, but with kernel memory allocator failing allocation.

The semantically correct should be:

        name = kstrndup(buf, count, GFP_KERNEL);
        if (!name)
                return -ENOMEM;

Cc: Dan Carpenter <error27@gmail.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Kees Cook <keescook@chromium.org>
Cc: "Luis R. Rodriguez" <mcgrof@ruslug.rutgers.edu>
Cc: Scott Branden <sbranden@broadcom.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Brian Norris <briannorris@chromium.org>
Fixes: c92316bf8e ("test_firmware: add batched firmware tests")
Fixes: 0a8adf5847 ("test: add firmware_class loader test")
Fixes: 548193cba2 ("test_firmware: add support for firmware_request_platform")
Fixes: eb910947c8 ("test: firmware_class: add asynchronous request trigger")
Fixes: 061132d2b9 ("test_firmware: add test custom fallback trigger")
Fixes: 7feebfa487 ("test_firmware: add support for request_firmware_into_buf")
Signed-off-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Message-ID: <20230606070808.9300-1-mirsad.todorovac@alu.unizg.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:18 +02:00
Uwe Kleine-König
9f7b17c9cf mux: adg792a: Switch back to use i2c_driver's .probe()
After commit b8a1a4cd5a ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
commit 03c835f498 ("i2c: Switch .probe() to not take an id parameter")
convert back to (the new) .probe() to be able to eventually drop
.probe_new() from struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Peter Rosin <peda@axentia.se>
Message-ID: <20230611204737.828617-1-u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:18 +02:00
Armin Wolf
c85fd9422f pcmcia: rsrc_nonstatic: Fix memory leak in nonstatic_release_resource_db()
When nonstatic_release_resource_db() frees all resources associated
with an PCMCIA socket, it forgets to free socket_data too, causing
a memory leak observable with kmemleak:

unreferenced object 0xc28d1000 (size 64):
  comm "systemd-udevd", pid 297, jiffies 4294898478 (age 194.484s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 f0 85 0e c3 00 00 00 00  ................
    00 00 00 00 0c 10 8d c2 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<ffda4245>] __kmem_cache_alloc_node+0x2d7/0x4a0
    [<7e51f0c8>] kmalloc_trace+0x31/0xa4
    [<d52b4ca0>] nonstatic_init+0x24/0x1a4 [pcmcia_rsrc]
    [<a2f13e08>] pcmcia_register_socket+0x200/0x35c [pcmcia_core]
    [<a728be1b>] yenta_probe+0x4d8/0xa70 [yenta_socket]
    [<c48fac39>] pci_device_probe+0x99/0x194
    [<84b7c690>] really_probe+0x181/0x45c
    [<8060fe6e>] __driver_probe_device+0x75/0x1f4
    [<b9b76f43>] driver_probe_device+0x28/0xac
    [<648b766f>] __driver_attach+0xeb/0x1e4
    [<6e9659eb>] bus_for_each_dev+0x61/0xb4
    [<25a669f3>] driver_attach+0x1e/0x28
    [<d8671d6b>] bus_add_driver+0x102/0x20c
    [<df0d323c>] driver_register+0x5b/0x120
    [<942cd8a4>] __pci_register_driver+0x44/0x4c
    [<e536027e>] __UNIQUE_ID___addressable_cleanup_module188+0x1c/0xfffff000 [iTCO_vendor_support]

Fix this by freeing socket_data too.

Tested on a Acer Travelmate 4002WLMi by manually binding/unbinding
the yenta_cardbus driver (yenta_socket).

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Message-ID: <20230512184529.5094-1-W_Armin@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:18 +02:00
Krzysztof Kozlowski
8898faf5bc dt-bindings: nvmem: imx-ocotp: drop unneeded address/size-cells and children
Referenced nvmem.yaml schema already defines address/size-cells and its
children, so remove redundant entries.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-27-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:18 +02:00
Rafał Miłecki
27f699e578 nvmem: core: add support for fixed cells *layout*
This adds support for the "fixed-layout" NVMEM layout binding. It allows
defining NVMEM cells in a layout DT node named "nvmem-layout".

While NVMEM subsystem supports layout drivers it has been discussed that
"fixed-layout" may actually be supperted internally. It's because:
1. It's a very basic layout
2. It allows sharing code with legacy syntax parsing
3. It's safer for soc_device_match() due to -EPROBE_DEFER
4. This will make the syntax transition easier

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Michael Walle <michael@walle.cc>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-26-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:18 +02:00
Rafał Miłecki
fa7fbe53ec dt-bindings: nvmem: convert base example to use NVMEM fixed cells layout
With support for the "fixed-layout" binding it's possible and preferred
now to define fixed NVMEM cells in the layout node. Do that for the
example binding.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-25-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:18 +02:00
Rafał Miłecki
bd912c991d dt-bindings: nvmem: layouts: add fixed-layout
With the introduction of NVMEM layouts, new NVMEM content structures
should be defined as such. We should also try to convert / migrate
existing NVMEM content bindings to layouts.

This commit handles fixed NVMEM cells. So far they had to be defined
directly - as device subnodes. With this change it's allowed to put them
in the DT node named "nvmem-layout".

Having NVMEM cells in separated node is preferred as it draws a nice
line between NVMEM device and its content. It results in cleaner
bindings.

FWIW a very similar situation has happened to MTD devices and their
partitions: see commit 5d96ea42eb ("dt-bindings: mtd: Clarify all
partition subnodes").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-24-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:17 +02:00
Frank Wunderlich
08ef7a48ef dt-bindings: nvmem: mediatek: efuse: add support for mt7986
Add compatible string for mt7986 SoC.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-23-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:17 +02:00
Peng Fan
22e9e6fcfb nvmem: imx: support i.MX93 OCOTP
Add i.MX93 OCOTP support. i.MX93 OCOTP has two parts: Fuse shadow
block(fsb) and fuse managed by ELE. The FSB part could be directly
accessed with MMIO, the ELE could only be accessed with ELE API.

Currently the ELE API is not ready, so NULL function callback is used,
but it was tested with downstream ELE API.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-22-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:17 +02:00
Peng Fan
805ba37606 dt-bindings: nvmem: imx-ocotp: support i.MX93
Add i.MX93 OCOTP support

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-21-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:17 +02:00
Michal Simek
9734408969 nvmem: zynqmp: Switch @xilinx.com emails to @amd.com
@xilinx.com is still working but better to switch to new amd.com after
AMD/Xilinx acquisition.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-20-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:17 +02:00
Krzysztof Kozlowski
931d7a2580 dt-bindings: nvmem: sunplus,sp7021-ocotp: drop unneeded address/size-cells
Referenced nvmem.yaml schema already defines address/size-cells, so
remove redundant entries.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-19-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:17 +02:00
Krzysztof Kozlowski
8cf4348741 dt-bindings: nvmem: socionext,uniphier-efuse: drop unneeded address/size-cells
Referenced nvmem.yaml schema already defines address/size-cells, so
remove redundant entries.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-18-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:17 +02:00
Krzysztof Kozlowski
5c007d6e9f dt-bindings: nvmem: qcom,spmi-sdam: drop unneeded address/size-cells
Referenced nvmem.yaml schema already defines address/size-cells, so
remove redundant entries.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-17-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:17 +02:00
Krzysztof Kozlowski
4bb5b2562b dt-bindings: nvmem: qcom,qfprom: drop unneeded address/size-cells
Referenced nvmem.yaml schema already defines address/size-cells, so
remove redundant entries.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-16-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:17 +02:00
Krzysztof Kozlowski
619b14219f dt-bindings: nvmem: mxs-ocotp: drop unneeded address/size-cells
Referenced nvmem.yaml schema already defines address/size-cells, so
remove redundant entries and use unevaluatedProperties: false.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-15-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:17 +02:00
Cristian Ciocaltea
8ab099fafb nvmem: rockchip-otp: Add support for RK3588
Add support for the OTP memory device found on the Rockchip RK3588 SoC.

While here, remove the unnecessary 'void *' casts in the OF device ID
table.

Co-developed-by: Finley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Tested-by: Vincent Legoll <vincent.legoll@gmail.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-14-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:17 +02:00
Cristian Ciocaltea
912517345b nvmem: rockchip-otp: Improve probe error handling
Enhance error handling in the probe function by making use of
dev_err_probe(), which ensures the error code is always printed, in
addition to the specified error message.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Tested-by: Vincent Legoll <vincent.legoll@gmail.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-13-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:17 +02:00
Cristian Ciocaltea
d325c9dd2b nvmem: rockchip-otp: Use devm_reset_control_array_get_exclusive()
In preparation to support new Rockchip OTP memory devices having
specific reset configurations, switch devm_reset_control_get() to
devm_reset_control_array_get_exclusive().

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Tested-by: Vincent Legoll <vincent.legoll@gmail.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-12-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:17 +02:00
Cristian Ciocaltea
30fd21cfb1 nvmem: rockchip-otp: Generalize rockchip_otp_wait_status()
In preparation to support additional Rockchip OTP memory devices with
different register layout, generalize rockchip_otp_wait_status() to
accept a new parameter for specifying the offset of the status register.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Tested-by: Vincent Legoll <vincent.legoll@gmail.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-11-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:17 +02:00
Cristian Ciocaltea
8dc6136416 nvmem: rockchip-otp: Add clks and reg_read to rockchip_data
In preparation to support new Rockchip OTP memory devices with different
clock configurations and register layout, extend rockchip_data struct
with the related members: clks, num_clks, reg_read.

Additionally, to avoid managing redundant driver data, drop num_clks
member from rockchip_otp struct and update all references to point to
the equivalent member in rockchip_data.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Tested-by: Vincent Legoll <vincent.legoll@gmail.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-10-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:17 +02:00
Cristian Ciocaltea
2d87a3b140 dt-bindings: nvmem: rockchip,otp: Add compatible for RK3588
Document the OTP memory found on Rockchip RK3588 SoC.

Since RK3588 uses different clocks & resets configurations than PX30 /
RK3308, provide the required changes in the binding to be able to handle
both variants.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-9-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:17 +02:00
Cristian Ciocaltea
2827a58c36 dt-bindings: nvmem: Convert rockchip-otp.txt to dt-schema
Convert the Rockchip OTP memory bindings to dt-schema.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-8-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:16 +02:00
Ivan T. Ivanov
c6ee6495d4 dt-bindings: nvmem: rmem: Add raspberrypi,bootloader-public-key
On RPi4 the bootloader[1] will copy the binary public key blob
(if present) into memory location specified by this node, for
use by the OS.

[1] https://www.raspberrypi.com/documentation/computers/configuration.html#nvmem-nodes

Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-7-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:16 +02:00
Rafał Miłecki
73bcd133c9 nvmem: brcm_nvram: add .read_post_process() for MACs
1. Parse ASCII MAC format into byte based
2. Calculate relative addresses based on index argument

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-5-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:16 +02:00
Rafał Miłecki
1d53afe387 dt-bindings: nvmem: brcm,nvram: add #nvmem-cell-cells for MACs
Broadcom's NVRAM contains MACs for Ethernet interfaces. Those MACs are
usually base addresses that are also used for calculating other MACs.

For example if a router vendor decided to use gmac0 it most likely
programmed NVRAM of each unit with a proper "et0macaddr" value. That is
a base.

Ethernet interface is usually connected to switch port. Switch usually
includes few LAN ports and a WAN port. MAC of WAN port gets calculated
as relative address to the interface one. Offset varies depending on
device model.

Wireless MACs may also need to be calculated using relevant offsets.

To support all those scenarios let MAC NVMEM cells be referenced with an
index specifying MAC offset. Disallow additionalProperties while at it.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-4-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:16 +02:00