Commit 02c2c190 authored by Arnd Bergmann's avatar Arnd Bergmann

Merge tag 'qcom-drivers-for-6.10' of...

Merge tag 'qcom-drivers-for-6.10' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/drivers

Qualcomm driver updates for v6.10

The Qualcomm SCM driver initialization order is improved, to avoid any
potential for a client to find a half-initialized SCM instance.
The handling of download mode bits is updated to not attempt
QCOM_SCM_BOOT_SET_DLOAD_MODE if a io-address for the update is
specified, and that path is changed to perform a read-modify-write to
avoid updating unrelated bits.  Error handling is corrected in the
peripheral authentication service (PAS) functions, to release
interconnect bandwidth votes in the case of an error. An unwanted error
print on allocation error is also removed from this code path.

The QSEECOM allow list is marked __maybe_unused to avoid build warnings
when built with !OF. The error handling related to the interconnect API
is cleaned up to avoid handling the impossible IS_ERR() condition.

initcall level is bumped to "core" for cmd-db and rpmh-rsc, as dependent
drivers like regulators, interconnects and clocks are registered at this
level.

Another attempt is made to remove the strncpy() usage in cmd-db, this
time with strtomem_pad() which has the correct characteristics.

The bwmon regmap cache is changed to maple tree.

After an attempt to add missing MODULE_DEVICE_TABLEs to debug drivers,
the intention of not having them automatically load is documented.

Operations on the pmic_glink client list is put under mutual exclusion,
to avoid races when clients are being registered. pmic_glink client
registered after the firmware notification arrived was not informed that
the firmware was up, this is resolved.

More DSPs and the apss subsystem is added to the Qualcomm sleep stats driver.

Checks for in-flight regulator requests in the RPMh RSC driver is
improved to deal with the fact that these occupy multiple registers, so
it's insufficient to just to direct address comparison.

The socinfo drivers learns about X1 Elite and SMB2360 PMIC.

The maintainers entry is split between the linux-arm-msm list and
subset that is maintained in the qcom-soc tree, to avoid some confusion
about maintainership.

* tag 'qcom-drivers-for-6.10' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (21 commits)
  soc: qcom: cmd-db: replace deprecated strncpy with strtomem
  soc: qcom: rpmh-rsc: Enhance check for VRM in-flight request
  firmware: qcom: scm: Modify only the download bits in TCSR register
  firmware: qcom: scm: Fix __scm and waitq completion variable initialization
  firmware: qcom: scm: Rework dload mode availability check
  firmware: qcom: scm: Remove redundant scm argument from qcom_scm_waitq_wakeup()
  firmware: qcom: scm: Remove log reporting memory allocation failure
  soc: qcom: pmic_glink: notify clients about the current state
  soc: qcom: pmic_glink: don't traverse clients list without a lock
  soc: qcom: mention intentionally broken module autoloading
  firmware: qcom: qcm: fix unused qcom_scm_qseecom_allowlist
  MAINTAINERS: Split Qualcomm SoC and linux-arm-msm entries
  soc: qcom: qcom_stats: Add DSPs and apss subsystem stats
  dt-bindings: soc: qcom: qcom,pmic-glink: document QCM6490 compatible
  soc: qcom: socinfo: Add SMB2360 PMIC
  soc: qcom: socinfo: Add X1E80100 SoC ID table entry
  dt-bindings: arm: qcom,ids: Add SoC ID for X1E80100
  soc: qcom: Update init level to core_initcall() for cmd-db and rpmh-rsc
  soc: qcom: icc-bwmon: Convert to use maple tree register cache
  firmware: qcom_scm: remove IS_ERR() checks from qcom_scm_bw_{en,dis}able()
  ...

Link: https://lore.kernel.org/r/20240427160917.1431354-1-andersson@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents cc0739fe 166db010
...@@ -2586,12 +2586,8 @@ F: arch/arm64/boot/dts/qcom/sc7180* ...@@ -2586,12 +2586,8 @@ F: arch/arm64/boot/dts/qcom/sc7180*
F: arch/arm64/boot/dts/qcom/sc7280* F: arch/arm64/boot/dts/qcom/sc7280*
F: arch/arm64/boot/dts/qcom/sdm845-cheza* F: arch/arm64/boot/dts/qcom/sdm845-cheza*
ARM/QUALCOMM SUPPORT ARM/QUALCOMM MAILING LIST
M: Bjorn Andersson <andersson@kernel.org>
M: Konrad Dybcio <konrad.dybcio@linaro.org>
L: linux-arm-msm@vger.kernel.org L: linux-arm-msm@vger.kernel.org
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git
F: Documentation/devicetree/bindings/*/qcom* F: Documentation/devicetree/bindings/*/qcom*
F: Documentation/devicetree/bindings/soc/qcom/ F: Documentation/devicetree/bindings/soc/qcom/
F: arch/arm/boot/dts/qcom/ F: arch/arm/boot/dts/qcom/
...@@ -2628,6 +2624,33 @@ F: include/dt-bindings/*/qcom* ...@@ -2628,6 +2624,33 @@ F: include/dt-bindings/*/qcom*
F: include/linux/*/qcom* F: include/linux/*/qcom*
F: include/linux/soc/qcom/ F: include/linux/soc/qcom/
ARM/QUALCOMM SUPPORT
M: Bjorn Andersson <andersson@kernel.org>
M: Konrad Dybcio <konrad.dybcio@linaro.org>
L: linux-arm-msm@vger.kernel.org
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git
F: Documentation/devicetree/bindings/arm/qcom-soc.yaml
F: Documentation/devicetree/bindings/arm/qcom.yaml
F: Documentation/devicetree/bindings/bus/qcom*
F: Documentation/devicetree/bindings/cache/qcom,llcc.yaml
F: Documentation/devicetree/bindings/firmware/qcom,scm.yaml
F: Documentation/devicetree/bindings/reserved-memory/qcom
F: Documentation/devicetree/bindings/soc/qcom/
F: arch/arm/boot/dts/qcom/
F: arch/arm/configs/qcom_defconfig
F: arch/arm/mach-qcom/
F: arch/arm64/boot/dts/qcom/
F: drivers/bus/qcom*
F: drivers/firmware/qcom/
F: drivers/soc/qcom/
F: include/dt-bindings/arm/qcom,ids.h
F: include/dt-bindings/firmware/qcom,scm.h
F: include/dt-bindings/soc/qcom*
F: include/linux/firmware/qcom
F: include/linux/soc/qcom/
F: include/soc/qcom/
ARM/RDA MICRO ARCHITECTURE ARM/RDA MICRO ARCHITECTURE
M: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> M: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
*/ */
#include <linux/arm-smccc.h> #include <linux/arm-smccc.h>
#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/cpumask.h> #include <linux/cpumask.h>
...@@ -114,6 +116,10 @@ static const u8 qcom_scm_cpu_warm_bits[QCOM_SCM_BOOT_MAX_CPUS] = { ...@@ -114,6 +116,10 @@ static const u8 qcom_scm_cpu_warm_bits[QCOM_SCM_BOOT_MAX_CPUS] = {
#define QCOM_SMC_WAITQ_FLAG_WAKE_ONE BIT(0) #define QCOM_SMC_WAITQ_FLAG_WAKE_ONE BIT(0)
#define QCOM_SMC_WAITQ_FLAG_WAKE_ALL BIT(1) #define QCOM_SMC_WAITQ_FLAG_WAKE_ALL BIT(1)
#define QCOM_DLOAD_MASK GENMASK(5, 4)
#define QCOM_DLOAD_NODUMP 0
#define QCOM_DLOAD_FULLDUMP 1
static const char * const qcom_scm_convention_names[] = { static const char * const qcom_scm_convention_names[] = {
[SMC_CONVENTION_UNKNOWN] = "unknown", [SMC_CONVENTION_UNKNOWN] = "unknown",
[SMC_CONVENTION_ARM_32] = "smc arm 32", [SMC_CONVENTION_ARM_32] = "smc arm 32",
...@@ -163,9 +169,6 @@ static int qcom_scm_bw_enable(void) ...@@ -163,9 +169,6 @@ static int qcom_scm_bw_enable(void)
if (!__scm->path) if (!__scm->path)
return 0; return 0;
if (IS_ERR(__scm->path))
return -EINVAL;
mutex_lock(&__scm->scm_bw_lock); mutex_lock(&__scm->scm_bw_lock);
if (!__scm->scm_vote_count) { if (!__scm->scm_vote_count) {
ret = icc_set_bw(__scm->path, 0, UINT_MAX); ret = icc_set_bw(__scm->path, 0, UINT_MAX);
...@@ -183,7 +186,7 @@ static int qcom_scm_bw_enable(void) ...@@ -183,7 +186,7 @@ static int qcom_scm_bw_enable(void)
static void qcom_scm_bw_disable(void) static void qcom_scm_bw_disable(void)
{ {
if (IS_ERR_OR_NULL(__scm->path)) if (!__scm->path)
return; return;
mutex_lock(&__scm->scm_bw_lock); mutex_lock(&__scm->scm_bw_lock);
...@@ -496,19 +499,32 @@ static int __qcom_scm_set_dload_mode(struct device *dev, bool enable) ...@@ -496,19 +499,32 @@ static int __qcom_scm_set_dload_mode(struct device *dev, bool enable)
return qcom_scm_call_atomic(__scm->dev, &desc, NULL); return qcom_scm_call_atomic(__scm->dev, &desc, NULL);
} }
static int qcom_scm_io_rmw(phys_addr_t addr, unsigned int mask, unsigned int val)
{
unsigned int old;
unsigned int new;
int ret;
ret = qcom_scm_io_readl(addr, &old);
if (ret)
return ret;
new = (old & ~mask) | (val & mask);
return qcom_scm_io_writel(addr, new);
}
static void qcom_scm_set_download_mode(bool enable) static void qcom_scm_set_download_mode(bool enable)
{ {
bool avail; u32 val = enable ? QCOM_DLOAD_FULLDUMP : QCOM_DLOAD_NODUMP;
int ret = 0; int ret = 0;
avail = __qcom_scm_is_call_available(__scm->dev, if (__scm->dload_mode_addr) {
QCOM_SCM_SVC_BOOT, ret = qcom_scm_io_rmw(__scm->dload_mode_addr, QCOM_DLOAD_MASK,
QCOM_SCM_BOOT_SET_DLOAD_MODE); FIELD_PREP(QCOM_DLOAD_MASK, val));
if (avail) { } else if (__qcom_scm_is_call_available(__scm->dev, QCOM_SCM_SVC_BOOT,
QCOM_SCM_BOOT_SET_DLOAD_MODE)) {
ret = __qcom_scm_set_dload_mode(__scm->dev, enable); ret = __qcom_scm_set_dload_mode(__scm->dev, enable);
} else if (__scm->dload_mode_addr) {
ret = qcom_scm_io_writel(__scm->dload_mode_addr,
enable ? QCOM_SCM_BOOT_SET_DLOAD_MODE : 0);
} else { } else {
dev_err(__scm->dev, dev_err(__scm->dev,
"No available mechanism for setting download mode\n"); "No available mechanism for setting download mode\n");
...@@ -557,10 +573,9 @@ int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, size_t size, ...@@ -557,10 +573,9 @@ int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, size_t size,
*/ */
mdata_buf = dma_alloc_coherent(__scm->dev, size, &mdata_phys, mdata_buf = dma_alloc_coherent(__scm->dev, size, &mdata_phys,
GFP_KERNEL); GFP_KERNEL);
if (!mdata_buf) { if (!mdata_buf)
dev_err(__scm->dev, "Allocation of metadata buffer failed.\n");
return -ENOMEM; return -ENOMEM;
}
memcpy(mdata_buf, metadata, size); memcpy(mdata_buf, metadata, size);
ret = qcom_scm_clk_enable(); ret = qcom_scm_clk_enable();
...@@ -569,13 +584,14 @@ int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, size_t size, ...@@ -569,13 +584,14 @@ int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, size_t size,
ret = qcom_scm_bw_enable(); ret = qcom_scm_bw_enable();
if (ret) if (ret)
return ret; goto disable_clk;
desc.args[1] = mdata_phys; desc.args[1] = mdata_phys;
ret = qcom_scm_call(__scm->dev, &desc, &res); ret = qcom_scm_call(__scm->dev, &desc, &res);
qcom_scm_bw_disable(); qcom_scm_bw_disable();
disable_clk:
qcom_scm_clk_disable(); qcom_scm_clk_disable();
out: out:
...@@ -637,10 +653,12 @@ int qcom_scm_pas_mem_setup(u32 peripheral, phys_addr_t addr, phys_addr_t size) ...@@ -637,10 +653,12 @@ int qcom_scm_pas_mem_setup(u32 peripheral, phys_addr_t addr, phys_addr_t size)
ret = qcom_scm_bw_enable(); ret = qcom_scm_bw_enable();
if (ret) if (ret)
return ret; goto disable_clk;
ret = qcom_scm_call(__scm->dev, &desc, &res); ret = qcom_scm_call(__scm->dev, &desc, &res);
qcom_scm_bw_disable(); qcom_scm_bw_disable();
disable_clk:
qcom_scm_clk_disable(); qcom_scm_clk_disable();
return ret ? : res.result[0]; return ret ? : res.result[0];
...@@ -672,10 +690,12 @@ int qcom_scm_pas_auth_and_reset(u32 peripheral) ...@@ -672,10 +690,12 @@ int qcom_scm_pas_auth_and_reset(u32 peripheral)
ret = qcom_scm_bw_enable(); ret = qcom_scm_bw_enable();
if (ret) if (ret)
return ret; goto disable_clk;
ret = qcom_scm_call(__scm->dev, &desc, &res); ret = qcom_scm_call(__scm->dev, &desc, &res);
qcom_scm_bw_disable(); qcom_scm_bw_disable();
disable_clk:
qcom_scm_clk_disable(); qcom_scm_clk_disable();
return ret ? : res.result[0]; return ret ? : res.result[0];
...@@ -706,11 +726,12 @@ int qcom_scm_pas_shutdown(u32 peripheral) ...@@ -706,11 +726,12 @@ int qcom_scm_pas_shutdown(u32 peripheral)
ret = qcom_scm_bw_enable(); ret = qcom_scm_bw_enable();
if (ret) if (ret)
return ret; goto disable_clk;
ret = qcom_scm_call(__scm->dev, &desc, &res); ret = qcom_scm_call(__scm->dev, &desc, &res);
qcom_scm_bw_disable(); qcom_scm_bw_disable();
disable_clk:
qcom_scm_clk_disable(); qcom_scm_clk_disable();
return ret ? : res.result[0]; return ret ? : res.result[0];
...@@ -1649,7 +1670,7 @@ EXPORT_SYMBOL_GPL(qcom_scm_qseecom_app_send); ...@@ -1649,7 +1670,7 @@ EXPORT_SYMBOL_GPL(qcom_scm_qseecom_app_send);
* We do not yet support re-entrant calls via the qseecom interface. To prevent * We do not yet support re-entrant calls via the qseecom interface. To prevent
+ any potential issues with this, only allow validated machines for now. + any potential issues with this, only allow validated machines for now.
*/ */
static const struct of_device_id qcom_scm_qseecom_allowlist[] = { static const struct of_device_id qcom_scm_qseecom_allowlist[] __maybe_unused = {
{ .compatible = "lenovo,thinkpad-x13s", }, { .compatible = "lenovo,thinkpad-x13s", },
{ } { }
}; };
...@@ -1738,7 +1759,7 @@ static int qcom_scm_qseecom_init(struct qcom_scm *scm) ...@@ -1738,7 +1759,7 @@ static int qcom_scm_qseecom_init(struct qcom_scm *scm)
*/ */
bool qcom_scm_is_available(void) bool qcom_scm_is_available(void)
{ {
return !!__scm; return !!READ_ONCE(__scm);
} }
EXPORT_SYMBOL_GPL(qcom_scm_is_available); EXPORT_SYMBOL_GPL(qcom_scm_is_available);
...@@ -1769,7 +1790,7 @@ int qcom_scm_wait_for_wq_completion(u32 wq_ctx) ...@@ -1769,7 +1790,7 @@ int qcom_scm_wait_for_wq_completion(u32 wq_ctx)
return 0; return 0;
} }
static int qcom_scm_waitq_wakeup(struct qcom_scm *scm, unsigned int wq_ctx) static int qcom_scm_waitq_wakeup(unsigned int wq_ctx)
{ {
int ret; int ret;
...@@ -1801,7 +1822,7 @@ static irqreturn_t qcom_scm_irq_handler(int irq, void *data) ...@@ -1801,7 +1822,7 @@ static irqreturn_t qcom_scm_irq_handler(int irq, void *data)
goto out; goto out;
} }
ret = qcom_scm_waitq_wakeup(scm, wq_ctx); ret = qcom_scm_waitq_wakeup(wq_ctx);
if (ret) if (ret)
goto out; goto out;
} while (more_pending); } while (more_pending);
...@@ -1819,10 +1840,12 @@ static int qcom_scm_probe(struct platform_device *pdev) ...@@ -1819,10 +1840,12 @@ static int qcom_scm_probe(struct platform_device *pdev)
if (!scm) if (!scm)
return -ENOMEM; return -ENOMEM;
scm->dev = &pdev->dev;
ret = qcom_scm_find_dload_address(&pdev->dev, &scm->dload_mode_addr); ret = qcom_scm_find_dload_address(&pdev->dev, &scm->dload_mode_addr);
if (ret < 0) if (ret < 0)
return ret; return ret;
init_completion(&scm->waitq_comp);
mutex_init(&scm->scm_bw_lock); mutex_init(&scm->scm_bw_lock);
scm->path = devm_of_icc_get(&pdev->dev, NULL); scm->path = devm_of_icc_get(&pdev->dev, NULL);
...@@ -1854,10 +1877,8 @@ static int qcom_scm_probe(struct platform_device *pdev) ...@@ -1854,10 +1877,8 @@ static int qcom_scm_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
__scm = scm; /* Let all above stores be available after this */
__scm->dev = &pdev->dev; smp_store_release(&__scm, scm);
init_completion(&__scm->waitq_comp);
irq = platform_get_irq_optional(pdev, 0); irq = platform_get_irq_optional(pdev, 0);
if (irq < 0) { if (irq < 0) {
......
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2016-2018, 2020, The Linux Foundation. All rights reserved. */ /*
* Copyright (c) 2016-2018, 2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/bitfield.h>
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -17,6 +21,8 @@ ...@@ -17,6 +21,8 @@
#define MAX_SLV_ID 8 #define MAX_SLV_ID 8
#define SLAVE_ID_MASK 0x7 #define SLAVE_ID_MASK 0x7
#define SLAVE_ID_SHIFT 16 #define SLAVE_ID_SHIFT 16
#define SLAVE_ID(addr) FIELD_GET(GENMASK(19, 16), addr)
#define VRM_ADDR(addr) FIELD_GET(GENMASK(19, 4), addr)
/** /**
* struct entry_header: header for each entry in cmddb * struct entry_header: header for each entry in cmddb
...@@ -147,12 +153,7 @@ static int cmd_db_get_header(const char *id, const struct entry_header **eh, ...@@ -147,12 +153,7 @@ static int cmd_db_get_header(const char *id, const struct entry_header **eh,
if (ret) if (ret)
return ret; return ret;
/* strtomem_pad(query, id, 0);
* Pad out query string to same length as in DB. NOTE: the output
* query string is not necessarily '\0' terminated if it bumps up
* against the max size. That's OK and expected.
*/
strncpy(query, id, sizeof(query));
for (i = 0; i < MAX_SLV_ID; i++) { for (i = 0; i < MAX_SLV_ID; i++) {
rsc_hdr = &cmd_db_header->header[i]; rsc_hdr = &cmd_db_header->header[i];
...@@ -220,6 +221,30 @@ const void *cmd_db_read_aux_data(const char *id, size_t *len) ...@@ -220,6 +221,30 @@ const void *cmd_db_read_aux_data(const char *id, size_t *len)
} }
EXPORT_SYMBOL_GPL(cmd_db_read_aux_data); EXPORT_SYMBOL_GPL(cmd_db_read_aux_data);
/**
* cmd_db_match_resource_addr() - Compare if both Resource addresses are same
*
* @addr1: Resource address to compare
* @addr2: Resource address to compare
*
* Return: true if two addresses refer to the same resource, false otherwise
*/
bool cmd_db_match_resource_addr(u32 addr1, u32 addr2)
{
/*
* Each RPMh VRM accelerator resource has 3 or 4 contiguous 4-byte
* aligned addresses associated with it. Ignore the offset to check
* for VRM requests.
*/
if (addr1 == addr2)
return true;
else if (SLAVE_ID(addr1) == CMD_DB_HW_VRM && VRM_ADDR(addr1) == VRM_ADDR(addr2))
return true;
return false;
}
EXPORT_SYMBOL_GPL(cmd_db_match_resource_addr);
/** /**
* cmd_db_read_slave_id - Get the slave ID for a given resource address * cmd_db_read_slave_id - Get the slave ID for a given resource address
* *
...@@ -362,7 +387,7 @@ static int __init cmd_db_device_init(void) ...@@ -362,7 +387,7 @@ static int __init cmd_db_device_init(void)
{ {
return platform_driver_register(&cmd_db_dev_driver); return platform_driver_register(&cmd_db_dev_driver);
} }
arch_initcall(cmd_db_device_init); core_initcall(cmd_db_device_init);
MODULE_DESCRIPTION("Qualcomm Technologies, Inc. Command DB Driver"); MODULE_DESCRIPTION("Qualcomm Technologies, Inc. Command DB Driver");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
...@@ -282,7 +282,7 @@ static const struct regmap_config msm8998_bwmon_regmap_cfg = { ...@@ -282,7 +282,7 @@ static const struct regmap_config msm8998_bwmon_regmap_cfg = {
* Cache is necessary for using regmap fields with non-readable * Cache is necessary for using regmap fields with non-readable
* registers. * registers.
*/ */
.cache_type = REGCACHE_RBTREE, .cache_type = REGCACHE_MAPLE,
}; };
static const struct regmap_config msm8998_bwmon_global_regmap_cfg = { static const struct regmap_config msm8998_bwmon_global_regmap_cfg = {
...@@ -301,7 +301,7 @@ static const struct regmap_config msm8998_bwmon_global_regmap_cfg = { ...@@ -301,7 +301,7 @@ static const struct regmap_config msm8998_bwmon_global_regmap_cfg = {
* Cache is necessary for using regmap fields with non-readable * Cache is necessary for using regmap fields with non-readable
* registers. * registers.
*/ */
.cache_type = REGCACHE_RBTREE, .cache_type = REGCACHE_MAPLE,
}; };
static const struct reg_field sdm845_cpu_bwmon_reg_fields[] = { static const struct reg_field sdm845_cpu_bwmon_reg_fields[] = {
...@@ -369,7 +369,7 @@ static const struct regmap_config sdm845_cpu_bwmon_regmap_cfg = { ...@@ -369,7 +369,7 @@ static const struct regmap_config sdm845_cpu_bwmon_regmap_cfg = {
* Cache is necessary for using regmap fields with non-readable * Cache is necessary for using regmap fields with non-readable
* registers. * registers.
*/ */
.cache_type = REGCACHE_RBTREE, .cache_type = REGCACHE_MAPLE,
}; };
/* BWMON v5 */ /* BWMON v5 */
...@@ -446,7 +446,7 @@ static const struct regmap_config sdm845_llcc_bwmon_regmap_cfg = { ...@@ -446,7 +446,7 @@ static const struct regmap_config sdm845_llcc_bwmon_regmap_cfg = {
* Cache is necessary for using regmap fields with non-readable * Cache is necessary for using regmap fields with non-readable
* registers. * registers.
*/ */
.cache_type = REGCACHE_RBTREE, .cache_type = REGCACHE_MAPLE,
}; };
static void bwmon_clear_counters(struct icc_bwmon *bwmon, bool clear_all) static void bwmon_clear_counters(struct icc_bwmon *bwmon, bool clear_all)
......
...@@ -83,9 +83,14 @@ struct pmic_glink_client *devm_pmic_glink_register_client(struct device *dev, ...@@ -83,9 +83,14 @@ struct pmic_glink_client *devm_pmic_glink_register_client(struct device *dev,
client->pdr_notify = pdr; client->pdr_notify = pdr;
client->priv = priv; client->priv = priv;
mutex_lock(&pg->state_lock);
mutex_lock(&pg->client_lock); mutex_lock(&pg->client_lock);
list_add(&client->node, &pg->clients); list_add(&client->node, &pg->clients);
client->pdr_notify(client->priv, pg->client_state);
mutex_unlock(&pg->client_lock); mutex_unlock(&pg->client_lock);
mutex_unlock(&pg->state_lock);
devres_add(dev, client); devres_add(dev, client);
...@@ -115,10 +120,12 @@ static int pmic_glink_rpmsg_callback(struct rpmsg_device *rpdev, void *data, ...@@ -115,10 +120,12 @@ static int pmic_glink_rpmsg_callback(struct rpmsg_device *rpdev, void *data,
hdr = data; hdr = data;
mutex_lock(&pg->client_lock);
list_for_each_entry(client, &pg->clients, node) { list_for_each_entry(client, &pg->clients, node) {
if (client->id == le32_to_cpu(hdr->owner)) if (client->id == le32_to_cpu(hdr->owner))
client->cb(data, len, client->priv); client->cb(data, len, client->priv);
} }
mutex_unlock(&pg->client_lock);
return 0; return 0;
} }
...@@ -168,8 +175,10 @@ static void pmic_glink_state_notify_clients(struct pmic_glink *pg) ...@@ -168,8 +175,10 @@ static void pmic_glink_state_notify_clients(struct pmic_glink *pg)
} }
if (new_state != pg->client_state) { if (new_state != pg->client_state) {
mutex_lock(&pg->client_lock);
list_for_each_entry(client, &pg->clients, node) list_for_each_entry(client, &pg->clients, node)
client->pdr_notify(client->priv, new_state); client->pdr_notify(client->priv, new_state);
mutex_unlock(&pg->client_lock);
pg->client_state = new_state; pg->client_state = new_state;
} }
} }
......
...@@ -150,6 +150,10 @@ static const struct rpmsg_device_id pmic_pdcharger_ulog_rpmsg_id_match[] = { ...@@ -150,6 +150,10 @@ static const struct rpmsg_device_id pmic_pdcharger_ulog_rpmsg_id_match[] = {
{ "PMIC_LOGS_ADSP_APPS" }, { "PMIC_LOGS_ADSP_APPS" },
{} {}
}; };
/*
* No MODULE_DEVICE_TABLE intentionally: that's a debugging module, to be
* loaded manually only.
*/
static struct rpmsg_driver pmic_pdcharger_ulog_rpmsg_driver = { static struct rpmsg_driver pmic_pdcharger_ulog_rpmsg_driver = {
.probe = pmic_pdcharger_ulog_rpmsg_probe, .probe = pmic_pdcharger_ulog_rpmsg_probe,
......
...@@ -35,11 +35,15 @@ static const struct subsystem_data subsystems[] = { ...@@ -35,11 +35,15 @@ static const struct subsystem_data subsystems[] = {
{ "wpss", 605, 13 }, { "wpss", 605, 13 },
{ "adsp", 606, 2 }, { "adsp", 606, 2 },
{ "cdsp", 607, 5 }, { "cdsp", 607, 5 },
{ "cdsp1", 607, 12 },
{ "gpdsp0", 607, 17 },
{ "gpdsp1", 607, 18 },
{ "slpi", 608, 3 }, { "slpi", 608, 3 },
{ "gpu", 609, 0 }, { "gpu", 609, 0 },
{ "display", 610, 0 }, { "display", 610, 0 },
{ "adsp_island", 613, 2 }, { "adsp_island", 613, 2 },
{ "slpi_island", 613, 3 }, { "slpi_island", 613, 3 },
{ "apss", 631, QCOM_SMEM_HOST_ANY },
}; };
struct stats_config { struct stats_config {
......
...@@ -148,6 +148,10 @@ static const struct of_device_id rpm_master_table[] = { ...@@ -148,6 +148,10 @@ static const struct of_device_id rpm_master_table[] = {
{ .compatible = "qcom,rpm-master-stats" }, { .compatible = "qcom,rpm-master-stats" },
{ }, { },
}; };
/*
* No MODULE_DEVICE_TABLE intentionally: that's a debugging module, to be
* loaded manually only.
*/
static struct platform_driver master_stats_driver = { static struct platform_driver master_stats_driver = {
.probe = master_stats_probe, .probe = master_stats_probe,
......
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
/* /*
* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
* Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved.
*/ */
#define pr_fmt(fmt) "%s " fmt, KBUILD_MODNAME #define pr_fmt(fmt) "%s " fmt, KBUILD_MODNAME
...@@ -557,7 +558,7 @@ static int check_for_req_inflight(struct rsc_drv *drv, struct tcs_group *tcs, ...@@ -557,7 +558,7 @@ static int check_for_req_inflight(struct rsc_drv *drv, struct tcs_group *tcs,
for_each_set_bit(j, &curr_enabled, MAX_CMDS_PER_TCS) { for_each_set_bit(j, &curr_enabled, MAX_CMDS_PER_TCS) {
addr = read_tcs_cmd(drv, drv->regs[RSC_DRV_CMD_ADDR], i, j); addr = read_tcs_cmd(drv, drv->regs[RSC_DRV_CMD_ADDR], i, j);
for (k = 0; k < msg->num_cmds; k++) { for (k = 0; k < msg->num_cmds; k++) {
if (addr == msg->cmds[k].addr) if (cmd_db_match_resource_addr(msg->cmds[k].addr, addr))
return -EBUSY; return -EBUSY;
} }
} }
...@@ -1154,7 +1155,7 @@ static int __init rpmh_driver_init(void) ...@@ -1154,7 +1155,7 @@ static int __init rpmh_driver_init(void)
{ {
return platform_driver_register(&rpmh_driver); return platform_driver_register(&rpmh_driver);
} }
arch_initcall(rpmh_driver_init); core_initcall(rpmh_driver_init);
MODULE_DESCRIPTION("Qualcomm Technologies, Inc. RPMh Driver"); MODULE_DESCRIPTION("Qualcomm Technologies, Inc. RPMh Driver");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
...@@ -133,6 +133,7 @@ static const char *const pmic_models[] = { ...@@ -133,6 +133,7 @@ static const char *const pmic_models[] = {
[72] = "PMR735D", [72] = "PMR735D",
[73] = "PM8550", [73] = "PM8550",
[74] = "PMK8550", [74] = "PMK8550",
[82] = "SMB2360",
}; };
struct socinfo_params { struct socinfo_params {
...@@ -430,6 +431,7 @@ static const struct soc_id soc_id[] = { ...@@ -430,6 +431,7 @@ static const struct soc_id soc_id[] = {
{ qcom_board_id(QRU1000) }, { qcom_board_id(QRU1000) },
{ qcom_board_id(SM8475_2) }, { qcom_board_id(SM8475_2) },
{ qcom_board_id(QDU1000) }, { qcom_board_id(QDU1000) },
{ qcom_board_id(X1E80100) },
{ qcom_board_id(SM8650) }, { qcom_board_id(SM8650) },
{ qcom_board_id(SM4450) }, { qcom_board_id(SM4450) },
{ qcom_board_id(QDU1010) }, { qcom_board_id(QDU1010) },
......
...@@ -258,6 +258,7 @@ ...@@ -258,6 +258,7 @@
#define QCOM_ID_QRU1000 539 #define QCOM_ID_QRU1000 539
#define QCOM_ID_SM8475_2 540 #define QCOM_ID_SM8475_2 540
#define QCOM_ID_QDU1000 545 #define QCOM_ID_QDU1000 545
#define QCOM_ID_X1E80100 555
#define QCOM_ID_SM8650 557 #define QCOM_ID_SM8650 557
#define QCOM_ID_SM4450 568 #define QCOM_ID_SM4450 568
#define QCOM_ID_QDU1010 587 #define QCOM_ID_QDU1010 587
......
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. */ /*
* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
* Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef __QCOM_COMMAND_DB_H__ #ifndef __QCOM_COMMAND_DB_H__
#define __QCOM_COMMAND_DB_H__ #define __QCOM_COMMAND_DB_H__
...@@ -21,6 +24,8 @@ u32 cmd_db_read_addr(const char *resource_id); ...@@ -21,6 +24,8 @@ u32 cmd_db_read_addr(const char *resource_id);
const void *cmd_db_read_aux_data(const char *resource_id, size_t *len); const void *cmd_db_read_aux_data(const char *resource_id, size_t *len);
bool cmd_db_match_resource_addr(u32 addr1, u32 addr2);
enum cmd_db_hw_type cmd_db_read_slave_id(const char *resource_id); enum cmd_db_hw_type cmd_db_read_slave_id(const char *resource_id);
int cmd_db_ready(void); int cmd_db_ready(void);
...@@ -31,6 +36,9 @@ static inline u32 cmd_db_read_addr(const char *resource_id) ...@@ -31,6 +36,9 @@ static inline u32 cmd_db_read_addr(const char *resource_id)
static inline const void *cmd_db_read_aux_data(const char *resource_id, size_t *len) static inline const void *cmd_db_read_aux_data(const char *resource_id, size_t *len)
{ return ERR_PTR(-ENODEV); } { return ERR_PTR(-ENODEV); }
static inline bool cmd_db_match_resource_addr(u32 addr1, u32 addr2)
{ return false; }
static inline enum cmd_db_hw_type cmd_db_read_slave_id(const char *resource_id) static inline enum cmd_db_hw_type cmd_db_read_slave_id(const char *resource_id)
{ return -ENODEV; } { return -ENODEV; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment