]> Git Repo - linux.git/commitdiff
Merge tag 'rproc-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc...
authorLinus Torvalds <[email protected]>
Tue, 23 Jul 2024 20:36:51 +0000 (13:36 -0700)
committerLinus Torvalds <[email protected]>
Tue, 23 Jul 2024 20:36:51 +0000 (13:36 -0700)
Pull remoteproc updates from Bjorn Andersson:

 - The maximum amount of DDR memory used by the Mediatek MT8188/MT8195
   SCP is increased to handle new use cases. Handling of optional L1TCM
   memory is made actually optional.

 - An optimization is introduced to only clear the unused portion of IPI
   shared buffers, rather than the entire buffer before writing the
   message.

 - Detection for IPC-only mode in the TI K3 DSP remoteproc driver is
   corrected. The loglevel of a debug print in the same is lowered from
   error.

 - Support for attaching to an running remote processor is added to the
   Xilinx R5F.

 - An in-kernel implementation of the Qualcomm "protected domain mapper"
   (aka service registry) service is introduced, to remove the
   dependency on a userspace implementation to detect when the battery
   monitor and USB Type-C port manager becomes available. This is then
   integrated with the Qualcomm remoteproc driver.

 - The Qualcomm PAS remoteproc driver gains support for attempting to
   bust hwspinlocks held by the remote processor when it
   crashed/stopped.

 - The TI OMAP remoteproc driver is transitioned to use devres helpers
   for various forms of allocations.

 - Parsing of memory-regions in the i.MX remoteproc driver is improved
   to avoid a NULL pointer dereference if the phandle reference is
   empty. of_node reference counting is corrected in the same.

* tag 'rproc-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux:
  remoteproc: mediatek: Increase MT8188/MT8195 SCP core0 DRAM size
  remoteproc: k3-dsp: Fix log levels where appropriate
  remoteproc: xlnx: Add attach detach support
  remoteproc: qcom: select AUXILIARY_BUS
  remoteproc: k3-r5: Fix IPC-only mode detection
  remoteproc: mediatek: Don't attempt to remap l1tcm memory if missing
  remoteproc: qcom: enable in-kernel PD mapper
  dt-bindings: remoteproc: imx_rproc: Add minItems for power-domain
  remoteproc: imx_rproc: Fix refcount mistake in imx_rproc_addr_init
  remoteproc: omap: Use devm_rproc_add() helper
  remoteproc: omap: Use devm action to release reserved memory
  remoteproc: omap: Use devm_rproc_alloc() helper
  remoteproc: imx_rproc: Skip over memory region when node value is NULL
  dt-bindings: remoteproc: k3-dsp: Correct optional sram properties for AM62A SoCs
  remoteproc: qcom_q6v5_pas: Add hwspinlock bust on stop
  soc: qcom: smem: Add qcom_smem_bust_hwspin_lock_by_host()
  remoteproc: mediatek: Zero out only remaining bytes of IPI buffer

1  2 
drivers/soc/qcom/smem.c
include/linux/soc/qcom/smem.h

diff --combined drivers/soc/qcom/smem.c
index e40aac281b06179a6232afcfb4994792b4e6a0d0,50039e983ebaaa08875644392c30487bbe737fd3..e4411771f482f8126a24a8775ccd34b4d8f92d32
@@@ -359,6 -359,32 +359,32 @@@ static struct qcom_smem *__smem
  /* Timeout (ms) for the trylock of remote spinlocks */
  #define HWSPINLOCK_TIMEOUT    1000
  
+ /* The qcom hwspinlock id is always plus one from the smem host id */
+ #define SMEM_HOST_ID_TO_HWSPINLOCK_ID(__x) ((__x) + 1)
+ /**
+  * qcom_smem_bust_hwspin_lock_by_host() - bust the smem hwspinlock for a host
+  * @host:     remote processor id
+  *
+  * Busts the hwspin_lock for the given smem host id. This helper is intended
+  * for remoteproc drivers that manage remoteprocs with an equivalent smem
+  * driver instance in the remote firmware. Drivers can force a release of the
+  * smem hwspin_lock if the rproc unexpectedly goes into a bad state.
+  *
+  * Context: Process context.
+  *
+  * Returns: 0 on success, otherwise negative errno.
+  */
+ int qcom_smem_bust_hwspin_lock_by_host(unsigned int host)
+ {
+       /* This function is for remote procs, so ignore SMEM_HOST_APPS */
+       if (host == SMEM_HOST_APPS || host >= SMEM_HOST_COUNT)
+               return -EINVAL;
+       return hwspin_lock_bust(__smem->hwlock, SMEM_HOST_ID_TO_HWSPINLOCK_ID(host));
+ }
+ EXPORT_SYMBOL_GPL(qcom_smem_bust_hwspin_lock_by_host);
  /**
   * qcom_smem_is_available() - Check if SMEM is available
   *
@@@ -795,39 -821,6 +821,39 @@@ int qcom_smem_get_soc_id(u32 *id
  }
  EXPORT_SYMBOL_GPL(qcom_smem_get_soc_id);
  
 +/**
 + * qcom_smem_get_feature_code() - return the feature code
 + * @code: On success, return the feature code here.
 + *
 + * Look up the feature code identifier from SMEM and return it.
 + *
 + * Return: 0 on success, negative errno on failure.
 + */
 +int qcom_smem_get_feature_code(u32 *code)
 +{
 +      struct socinfo *info;
 +      u32 raw_code;
 +
 +      info = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_HW_SW_BUILD_ID, NULL);
 +      if (IS_ERR(info))
 +              return PTR_ERR(info);
 +
 +      /* This only makes sense for socinfo >= 16 */
 +      if (__le32_to_cpu(info->fmt) < SOCINFO_VERSION(0, 16))
 +              return -EOPNOTSUPP;
 +
 +      raw_code = __le32_to_cpu(info->feature_code);
 +
 +      /* Ensure the value makes sense */
 +      if (raw_code > SOCINFO_FC_INT_MAX)
 +              raw_code = SOCINFO_FC_UNKNOWN;
 +
 +      *code = raw_code;
 +
 +      return 0;
 +}
 +EXPORT_SYMBOL_GPL(qcom_smem_get_feature_code);
 +
  static int qcom_smem_get_sbl_version(struct qcom_smem *smem)
  {
        struct smem_header *header;
index 0943bf419e115b73a04af846b9f411e4db3673f6,03187bc9585182a14b9938620703caa87e11f49d..f946e3beca215548ac56dbf779138d05479712f5
@@@ -13,6 -13,7 +13,8 @@@ int qcom_smem_get_free_space(unsigned h
  phys_addr_t qcom_smem_virt_to_phys(void *p);
  
  int qcom_smem_get_soc_id(u32 *id);
 +int qcom_smem_get_feature_code(u32 *code);
  
+ int qcom_smem_bust_hwspin_lock_by_host(unsigned int host);
  #endif
This page took 0.096607 seconds and 4 git commands to generate.