Qualcomm driver updates for v6.15

Improve the client interface for the Qualcomm ICE driver to avoid
 leaking references, including fixing the client drivers to call the new
 function.
 
 Adopt str_on_off() helper in AOSS driver and mark non-global servreg QMI
 element info array in the PDR driver static.
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCAAzFiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmfYelQVHGFuZGVyc3Nv
 bkBrZXJuZWwub3JnAAoJEAsfOT8Nma3Fy/0P/At3A+2YQTZB80ys0HlvGQnrihLo
 xKWW4RPApeia/IQKtMzZldyBSDSDSbx2D6WsWP+VE3/ICXsv5t00q9YtVINCPCYM
 cx0hv7RdNTSTyhwH5knO24zrdCn6KLAzrHdGeBMUByzGMh64GKoJBo8bFhkFOeYh
 Htk3Yj0gqwcUdmjLRqRIPem9NWha1zvUenhMa1FlcFxUgogcKFsCujQpP95NYf5x
 A36j6o0d0pg7SIQrANOH4xGhxUKdiADml8znVHBgxDdQ5cgVVg2I6jDjzBkt+5ik
 Xkb59KYT43kRoFGaUURURGl227oOUx/HDyO6II3SEaoRDkvTemqBMfFHeOTJCUgl
 wvUmrzy4Q93dASTz9Zq4jS9KPt5rgL8+fDz5/71Ye6w8d47I8dkqOmHxKKhcZN6L
 XNBBW9qUjqvL0w96+GyrE70adzThKGsEoEXmkhneo3oPEGOlMRmEvVJtb5RxM2BQ
 7ndP01utr0eksdB0ZY6MwvJA3u9085aqifEmHtckJVXv60H1JWVV23UzCeesoIHf
 GoItEtJ+aWccCQop8CjWwBcuIy2fsMHiO7nN9HFtHyNu3rVy3DHspCgWeVSbBaRl
 BH/UTgHmeYDzaJ7MzJCr+uElN0Gc2s+oOnei0QDKSEF6vdFzv1tbmcgBd4vJUMov
 2NEhnYk6YD4kO/lW
 =mBJ1
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmfbPTUACgkQYKtH/8kJ
 UieJFA/9F7FkIabs/b2H6zF6ZMWRAW5+0+cCFUmYW0CNG0oTX9bUuadYevQTo8QG
 FPgTZT0levM7pB7reiXxYkkIroUGNZ6lAvaDiGHzOAL21uFKNbh3qaZiDCWkkk8p
 376U4IV9BeS5WCW/meSxYiRpKtL9Vq0/0FxUk7xkUHJKMYsX3XFnRPTMt2Hk1IVP
 lLo0E9NgOIOSwJDBbD/8EJccZK8TCqdkw0zDzYmWEz+kmL6d2vByX2pJeJdLntnR
 /9W28U+y0pkyzs3KbwvPH9E6I9mGIhnMSpIed6BzHz/aW8hCDZL3PiHUrYXdDAUR
 zkRDS+AuOviCgQ1UczzWV9EJXaFKsEpoIpZ/vY5yO534r/ask3z8wKM6Yl/K/Wjx
 OqQUiNLZPzOn38SCeJ27C8BMqDVLBWRdDzsLIIQecaUl0V3NsfTixdTjs3tN53W3
 S3WGVVOsXqJy3L0NuA1LlEeFGWfGlokEqcoX6v3Y4BRrS5drjzJ+E4YKOfHeREZX
 wpt2822LuXsByQZiHE/XV7mwjxXh6RYcCvBKqE42rCeIJ9hVdWGgtuBtkrnAgzR3
 Rsp6ZR8f5cI1jcjoCxenAGWpzIb2GJaIhRdvp+4AI1pNbZD/pX+l9RknoF2RgHHD
 jrgSs4eJVJt0FgmDWsUxlOYvATYyrl99+kRg6HLCbWLT/gfbYVE=
 =WlxM
 -----END PGP SIGNATURE-----

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

Qualcomm driver updates for v6.15

Improve the client interface for the Qualcomm ICE driver to avoid
leaking references, including fixing the client drivers to call the new
function.

Adopt str_on_off() helper in AOSS driver and mark non-global servreg QMI
element info array in the PDR driver static.

* tag 'qcom-drivers-for-6.15' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
  soc: qcom: Do not expose internal servreg_location_entry_ei array
  soc: qcom: ice: make of_qcom_ice_get() static
  scsi: ufs: qcom: fix dev reference leaked through of_qcom_ice_get
  mmc: sdhci-msm: fix dev reference leaked through of_qcom_ice_get
  soc: qcom: ice: introduce devm_of_qcom_ice_get
  dt-bindings: soc: qcom: qcom,pmic-glink: Document SM8750 compatible
  soc: qcom: Use str_enable_disable-like helpers

Link: https://lore.kernel.org/r/20250317210158.2025380-1-andersson@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Arnd Bergmann 2025-03-19 22:55:01 +01:00
commit 64e70a729b
8 changed files with 57 additions and 9 deletions

View File

@ -38,6 +38,7 @@ properties:
- items:
- enum:
- qcom,sm8650-pmic-glink
- qcom,sm8750-pmic-glink
- qcom,x1e80100-pmic-glink
- const: qcom,sm8550-pmic-glink
- const: qcom,pmic-glink

View File

@ -1873,7 +1873,7 @@ static int sdhci_msm_ice_init(struct sdhci_msm_host *msm_host,
if (!(cqhci_readl(cq_host, CQHCI_CAP) & CQHCI_CAP_CS))
return 0;
ice = of_qcom_ice_get(dev);
ice = devm_of_qcom_ice_get(dev);
if (ice == ERR_PTR(-EOPNOTSUPP)) {
dev_warn(dev, "Disabling inline encryption support\n");
ice = NULL;

View File

@ -11,6 +11,7 @@
#include <linux/cleanup.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/iopoll.h>
#include <linux/of.h>
#include <linux/of_platform.h>
@ -261,7 +262,7 @@ static struct qcom_ice *qcom_ice_create(struct device *dev,
* Return: ICE pointer on success, NULL if there is no ICE data provided by the
* consumer or ERR_PTR() on error.
*/
struct qcom_ice *of_qcom_ice_get(struct device *dev)
static struct qcom_ice *of_qcom_ice_get(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct qcom_ice *ice;
@ -322,7 +323,53 @@ struct qcom_ice *of_qcom_ice_get(struct device *dev)
return ice;
}
EXPORT_SYMBOL_GPL(of_qcom_ice_get);
static void qcom_ice_put(const struct qcom_ice *ice)
{
struct platform_device *pdev = to_platform_device(ice->dev);
if (!platform_get_resource_byname(pdev, IORESOURCE_MEM, "ice"))
platform_device_put(pdev);
}
static void devm_of_qcom_ice_put(struct device *dev, void *res)
{
qcom_ice_put(*(struct qcom_ice **)res);
}
/**
* devm_of_qcom_ice_get() - Devres managed helper to get an ICE instance from
* a DT node.
* @dev: device pointer for the consumer device.
*
* This function will provide an ICE instance either by creating one for the
* consumer device if its DT node provides the 'ice' reg range and the 'ice'
* clock (for legacy DT style). On the other hand, if consumer provides a
* phandle via 'qcom,ice' property to an ICE DT, the ICE instance will already
* be created and so this function will return that instead.
*
* Return: ICE pointer on success, NULL if there is no ICE data provided by the
* consumer or ERR_PTR() on error.
*/
struct qcom_ice *devm_of_qcom_ice_get(struct device *dev)
{
struct qcom_ice *ice, **dr;
dr = devres_alloc(devm_of_qcom_ice_put, sizeof(*dr), GFP_KERNEL);
if (!dr)
return ERR_PTR(-ENOMEM);
ice = of_qcom_ice_get(dev);
if (!IS_ERR_OR_NULL(ice)) {
*dr = ice;
devres_add(dev, dr);
} else {
devres_free(dr);
}
return ice;
}
EXPORT_SYMBOL_GPL(devm_of_qcom_ice_get);
static int qcom_ice_probe(struct platform_device *pdev)
{

View File

@ -91,7 +91,6 @@ struct servreg_loc_pfr_resp {
struct qmi_response_type_v01 rsp;
};
extern const struct qmi_elem_info servreg_location_entry_ei[];
extern const struct qmi_elem_info servreg_get_domain_list_req_ei[];
extern const struct qmi_elem_info servreg_get_domain_list_resp_ei[];
extern const struct qmi_elem_info servreg_register_listener_req_ei[];

View File

@ -12,6 +12,7 @@
#include <linux/platform_device.h>
#include <linux/thermal.h>
#include <linux/slab.h>
#include <linux/string_choices.h>
#include <linux/soc/qcom/qcom_aoss.h>
#define CREATE_TRACE_POINTS
@ -358,7 +359,7 @@ static int qmp_cdev_set_cur_state(struct thermal_cooling_device *cdev,
return 0;
ret = qmp_send(qmp_cdev->qmp, "{class: volt_flr, event:zero_temp, res:%s, value:%s}",
qmp_cdev->name, cdev_state ? "on" : "off");
qmp_cdev->name, str_on_off(cdev_state));
if (!ret)
qmp_cdev->state = cdev_state;

View File

@ -8,7 +8,7 @@
#include "pdr_internal.h"
const struct qmi_elem_info servreg_location_entry_ei[] = {
static const struct qmi_elem_info servreg_location_entry_ei[] = {
{
.data_type = QMI_STRING,
.elem_len = SERVREG_NAME_LENGTH + 1,
@ -47,7 +47,6 @@ const struct qmi_elem_info servreg_location_entry_ei[] = {
},
{}
};
EXPORT_SYMBOL_GPL(servreg_location_entry_ei);
const struct qmi_elem_info servreg_get_domain_list_req_ei[] = {
{

View File

@ -125,7 +125,7 @@ static int ufs_qcom_ice_init(struct ufs_qcom_host *host)
int err;
int i;
ice = of_qcom_ice_get(dev);
ice = devm_of_qcom_ice_get(dev);
if (ice == ERR_PTR(-EOPNOTSUPP)) {
dev_warn(dev, "Disabling inline encryption support\n");
ice = NULL;

View File

@ -33,5 +33,6 @@ int qcom_ice_program_key(struct qcom_ice *ice,
const u8 crypto_key[], u8 data_unit_size,
int slot);
int qcom_ice_evict_key(struct qcom_ice *ice, int slot);
struct qcom_ice *of_qcom_ice_get(struct device *dev);
struct qcom_ice *devm_of_qcom_ice_get(struct device *dev);
#endif /* __QCOM_ICE_H__ */