Skip to contentSkip to conversation

Group QMI service IDs into the QMI header

PATCH Applied Daniel Lezcano 5 participants 28 messages Mar 9 – Mar 19

Subsystems (11)
lore
Share & tools
lore
#0 lore raw

cover Group QMI service IDs into the QMI header

The different subsystems implementing the QMI service protocol are using their own definition of the service id. It is not a problem but it results on having those duplicated with different names but the same value and without consistency in their name.

It makes more sense to unify their names and move the definitions in the QMI header file providing a consistent way to represent the supported protocols. Consequently the different drivers will use them instead of their own definition of the service id.

Cc Alex Elder <[email protected]>
Cc Andrew Lunn <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Paolo Abeni <[email protected]>
Cc Jeff Johnson <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc Mathieu Poirier <[email protected]>
Cc Srinivas Kandagatla <[email protected]>
Cc Konrad Dybcio <[email protected]>
Cc Jaroslav Kysela <[email protected]>
Cc Takashi Iwai <[email protected]>
Cc Kees Cook <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Mark Brown <[email protected]>
Cc Wesley Cheng <[email protected]>

---
Daniel Lezcano (8):
soc: qcom: qmi: Enumerate the service IDs of QMI
net: ipa: Use the unified QMI service ID instead of defining it
locally
net: drivers: wireless: ath: Use the unified QMI service ID instead of
defining it locally
remoteproc: qcom: Use the unified QMI service ID instead of defining
it locally
slimbus: qcom-ngd-ctrl: Use the unified QMI service ID instead of
defining it locally
soc: qcom: pdr: Use the unified QMI service ID instead of defining it
locally
ALSA: usb-audio: qcom: Use the unified QMI service ID instead of
defining it locally
samples: qmi: Use the unified QMI service ID instead of defining it
locally

 drivers/net/ipa/ipa_qmi.c                      |  6 ++----
 drivers/net/wireless/ath/ath10k/qmi.c          |  2 +-
 drivers/net/wireless/ath/ath10k/qmi_wlfw_v01.h |  1 -
 drivers/net/wireless/ath/ath11k/qmi.c          |  2 +-
 drivers/net/wireless/ath/ath11k/qmi.h          |  1 -
 drivers/net/wireless/ath/ath12k/qmi.c          |  2 +-
 drivers/net/wireless/ath/ath12k/qmi.h          |  1 -
 drivers/remoteproc/qcom_sysmon.c               |  2 +-
 drivers/slimbus/qcom-ngd-ctrl.c                |  5 ++---
 drivers/soc/qcom/pdr_interface.c               |  4 ++--
 drivers/soc/qcom/pdr_internal.h                |  3 ---
 drivers/soc/qcom/qcom_pd_mapper.c              |  2 +-
 include/linux/soc/qcom/qmi.h                   | 12 ++++++++++++
 samples/qmi/qmi_sample_client.c                |  2 +-
 sound/usb/qcom/qc_audio_offload.c              |  2 +-
 sound/usb/qcom/usb_audio_qmi_v01.h             |  1 -
 16 files changed, 25 insertions(+), 23 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/8 soc: qcom: qmi: Enumerate the service IDs of QMI

The QMI framework proposes a set of services which are defined by an integer identifier. The different QMI client lookup for the services via this identifier. Moreover, the function qmi_add_lookup() and qmi_add_server() must match the service ID but the code in different places set the same value but with a different macro name. These macros are spreaded across the different subsystems implementing the protocols associated with a service. It would make more sense to define them in the QMI header for the sake of consistency and clarity.

This change use an unified naming for the services and enumerate the ones implemented in the Linux kernel. More services can come later and put the service ID in this same header.

---
 include/linux/soc/qcom/qmi.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
include/linux/soc/qcom/qmi.h +12 -0
index 291cdc7ef49c..b8d07f2c07e7 100644
@@ -92,6 +92,18 @@ struct qmi_elem_info {
 #define QMI_ERR_INCOMPATIBLE_STATE_V01		90
 #define QMI_ERR_NOT_SUPPORTED_V01		94
 
+/*
+ * Enumerate the IDs of the QMI services
+ */
+#define QMI_SERVICE_ID_TEST		0x0F	/*   15 */
+#define QMI_SERVICE_ID_SSCTL		0x2B	/*   43 */
+#define QMI_SERVICE_ID_IPA		0x31	/*   49 */
+#define QMI_SERVICE_ID_SERVREG_LOC	0x40	/*   64 */
+#define QMI_SERVICE_ID_SERVREG_NOTIF	0x42	/*   66 */
+#define QMI_SERVICE_ID_WLFW		0x45	/*   69 */
+#define QMI_SERVICE_ID_SLIMBUS		0x301	/*  769 */
+#define QMI_SERVICE_ID_USB_AUDIO_STREAM 0x41D	/* 1053 */
+
 /**
  * struct qmi_response_type_v01 - common response header (decoded)
  * @result:	result of the transaction
Signature · 1 line
2.43.0
Reviewed-by on v1 1/8
#2 lore raw

Re: [PATCH v1 1/8] soc: qcom: qmi: Enumerate the service IDs of QMI

Quoted 10 lines · Daniel Lezcano

The QMI framework proposes a set of services which are defined by an integer identifier. The different QMI client lookup for the services via this identifier. Moreover, the function qmi_add_lookup() and qmi_add_server() must match the service ID but the code in different places set the same value but with a different macro name. These macros are spreaded across the different subsystems implementing the protocols associated with a service. It would make more sense to define them in the QMI header for the sake of consistency and clarity.

This change use an unified naming for the services and enumerate the

Nit: see Documentation/process/submitting-patches.rst, "This patch"

Other than that,

Quoted 8 lines

ones implemented in the Linux kernel. More services can come later and put the service ID in this same header.

---
 include/linux/soc/qcom/qmi.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
Signature · 2 lines
With best wishes
Dmitry
#3 lore raw

Re: [PATCH v1 1/8] soc: qcom: qmi: Enumerate the service IDs of QMI

In reply to Daniel Lezcano
Quoted 23 lines · Daniel Lezcano

The QMI framework proposes a set of services which are defined by an integer identifier. The different QMI client lookup for the services via this identifier. Moreover, the function qmi_add_lookup() and qmi_add_server() must match the service ID but the code in different places set the same value but with a different macro name. These macros are spreaded across the different subsystems implementing the protocols associated with a service. It would make more sense to define them in the QMI header for the sake of consistency and clarity.

This change use an unified naming for the services and enumerate the ones implemented in the Linux kernel. More services can come later and put the service ID in this same header.

---
 include/linux/soc/qcom/qmi.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
include/linux/soc/qcom/qmi.h +0 -0
index 291cdc7ef49c..b8d07f2c07e7 100644

include/linux/soc/qcom/qmi.h struct qmi_elem_info { · line 96

Quoted 5 lines
include/linux/soc/qcom/qmi.h +2 -0
@@ -92,6 +92,18 @@ struct qmi_elem_info {
 #define QMI_ERR_INCOMPATIBLE_STATE_V01		90
 #define QMI_ERR_NOT_SUPPORTED_V01		94
 
+/*
+ * Enumerate the IDs of the QMI services

In case that's useful:

https://github.com/linux-msm/qrtr/blob/master/src/lookup.c#L23

Konrad

#4 lore raw

Re: [PATCH v1 1/8] soc: qcom: qmi: Enumerate the service IDs of QMI

Quoted 27 lines · Konrad Dybcio
Quoted 26 lines · Daniel Lezcano

The QMI framework proposes a set of services which are defined by an integer identifier. The different QMI client lookup for the services via this identifier. Moreover, the function qmi_add_lookup() and qmi_add_server() must match the service ID but the code in different places set the same value but with a different macro name. These macros are spreaded across the different subsystems implementing the protocols associated with a service. It would make more sense to define them in the QMI header for the sake of consistency and clarity.

This change use an unified naming for the services and enumerate the ones implemented in the Linux kernel. More services can come later and put the service ID in this same header.

---
  include/linux/soc/qcom/qmi.h | 12 ++++++++++++
  1 file changed, 12 insertions(+)
include/linux/soc/qcom/qmi.h +0 -0
index 291cdc7ef49c..b8d07f2c07e7 100644
@@ -92,6 +92,18 @@ struct qmi_elem_info {
  #define QMI_ERR_INCOMPATIBLE_STATE_V01		90
  #define QMI_ERR_NOT_SUPPORTED_V01		94
 
Quoted 6 lines

include/linux/soc/qcom/qmi.h struct qmi_elem_info { · line 96

Quoted 2 lines
include/linux/soc/qcom/qmi.h +2 -0
+/*
+ * Enumerate the IDs of the QMI services

In case that's useful:

https://github.com/linux-msm/qrtr/blob/master/src/lookup.c#L23

Thanks !

#5 lore raw

Re: [PATCH v1 1/8] soc: qcom: qmi: Enumerate the service IDs of QMI

In reply to Konrad Dybcio
Quoted 27 lines · Konrad Dybcio
Quoted 26 lines · Daniel Lezcano

The QMI framework proposes a set of services which are defined by an integer identifier. The different QMI client lookup for the services via this identifier. Moreover, the function qmi_add_lookup() and qmi_add_server() must match the service ID but the code in different places set the same value but with a different macro name. These macros are spreaded across the different subsystems implementing the protocols associated with a service. It would make more sense to define them in the QMI header for the sake of consistency and clarity.

This change use an unified naming for the services and enumerate the ones implemented in the Linux kernel. More services can come later and put the service ID in this same header.

---
  include/linux/soc/qcom/qmi.h | 12 ++++++++++++
  1 file changed, 12 insertions(+)
include/linux/soc/qcom/qmi.h +0 -0
index 291cdc7ef49c..b8d07f2c07e7 100644
@@ -92,6 +92,18 @@ struct qmi_elem_info {
  #define QMI_ERR_INCOMPATIBLE_STATE_V01		90
  #define QMI_ERR_NOT_SUPPORTED_V01		94
 
Quoted 2 lines

include/linux/soc/qcom/qmi.h struct qmi_elem_info { · line 96

Quoted 2 lines
include/linux/soc/qcom/qmi.h +2 -0
+/*
+ * Enumerate the IDs of the QMI services

I've the same number of patches fixing the copyright for each patch touched in this series. Shall I post the series separately and fold them with the corresponding patch ? (IMO the former is cleaner)

#6 lore raw

PATCH 2/8 net: ipa: Use the unified QMI service ID instead of defining it locally

In reply to Daniel Lezcano

Instead of defining a local macro with a custom name for the QMI service identifier, use the one provided in qmi.h and remove the locally defined macro.

---
 drivers/net/ipa/ipa_qmi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ipa/ipa_qmi.c +2 -4
index d771f3a71f94..37936ad132a2 100644
@@ -66,11 +66,9 @@
  *   determination of when things are "ready"
  */
 
-#define IPA_HOST_SERVICE_SVC_ID		0x31
 #define IPA_HOST_SVC_VERS		1
 #define IPA_HOST_SERVICE_INS_ID		1
 
-#define IPA_MODEM_SERVICE_SVC_ID	0x31
 #define IPA_MODEM_SERVICE_INS_ID	2
 #define IPA_MODEM_SVC_VERS		1
 
@@ -484,7 +482,7 @@ int ipa_qmi_setup(struct ipa *ipa)
 	if (ret)
 		return ret;
 
-	ret = qmi_add_server(&ipa_qmi->server_handle, IPA_HOST_SERVICE_SVC_ID,
+	ret = qmi_add_server(&ipa_qmi->server_handle, QMI_SERVICE_ID_IPA,
 			     IPA_HOST_SVC_VERS, IPA_HOST_SERVICE_INS_ID);
 	if (ret)
 		goto err_server_handle_release;
@@ -501,7 +499,7 @@ int ipa_qmi_setup(struct ipa *ipa)
 	/* We need this ready before the service lookup is added */
 	INIT_WORK(&ipa_qmi->init_driver_work, ipa_client_init_driver_work);
 
-	ret = qmi_add_lookup(&ipa_qmi->client_handle, IPA_MODEM_SERVICE_SVC_ID,
+	ret = qmi_add_lookup(&ipa_qmi->client_handle, QMI_SERVICE_ID_IPA,
 			     IPA_MODEM_SVC_VERS, IPA_MODEM_SERVICE_INS_ID);
 	if (ret)
 		goto err_client_handle_release;
Signature · 1 line
2.43.0
Reviewed-by on v1 2/8
#7 lore raw

Re: [PATCH v1 2/8] net: ipa: Use the unified QMI service ID instead of defining it locally

Quoted 9 lines · Daniel Lezcano

Instead of defining a local macro with a custom name for the QMI service identifier, use the one provided in qmi.h and remove the locally defined macro.

---
 drivers/net/ipa/ipa_qmi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
#8 lore raw

PATCH 3/8 net: drivers: wireless: ath: Use the unified QMI service ID instead of defining it locally

In reply to Daniel Lezcano

Instead of defining a local macro with a custom name for the QMI service identifier, use the one provided in qmi.h and remove the locally defined macro.

---
 drivers/net/wireless/ath/ath10k/qmi.c          | 2 +-
 drivers/net/wireless/ath/ath10k/qmi_wlfw_v01.h | 1 -
 drivers/net/wireless/ath/ath11k/qmi.c          | 2 +-
 drivers/net/wireless/ath/ath11k/qmi.h          | 1 -
 drivers/net/wireless/ath/ath12k/qmi.c          | 2 +-
 drivers/net/wireless/ath/ath12k/qmi.h          | 1 -
 6 files changed, 3 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath10k/qmi.c +1 -1
index eebd78e7ff6b..4fdd0af415d5 100644
@@ -1105,7 +1105,7 @@ int ath10k_qmi_init(struct ath10k *ar, u32 msa_size)
 	spin_lock_init(&qmi->event_lock);
 	INIT_WORK(&qmi->event_work, ath10k_qmi_driver_event_work);
 
-	ret = qmi_add_lookup(&qmi->qmi_hdl, WLFW_SERVICE_ID_V01,
+	ret = qmi_add_lookup(&qmi->qmi_hdl, QMI_SERVICE_ID_WLFW,
 			     WLFW_SERVICE_VERS_V01, 0);
 	if (ret)
 		goto err_qmi_lookup;
drivers/net/wireless/ath/ath10k/qmi_wlfw_v01.h +0 -1
index 9f311f3bc9e7..88d58f78989d 100644
@@ -7,7 +7,6 @@
 #ifndef WCN3990_QMI_SVC_V01_H
 #define WCN3990_QMI_SVC_V01_H
 
-#define WLFW_SERVICE_ID_V01 0x45
 #define WLFW_SERVICE_VERS_V01 0x01
 
 #define QMI_WLFW_BDF_DOWNLOAD_REQ_V01 0x0025
drivers/net/wireless/ath/ath11k/qmi.c +1 -1
index feebbc30f3df..1397756d6251 100644
@@ -3337,7 +3337,7 @@ int ath11k_qmi_init_service(struct ath11k_base *ab)
 	spin_lock_init(&ab->qmi.event_lock);
 	INIT_WORK(&ab->qmi.event_work, ath11k_qmi_driver_event_work);
 
-	ret = qmi_add_lookup(&ab->qmi.handle, ATH11K_QMI_WLFW_SERVICE_ID_V01,
+	ret = qmi_add_lookup(&ab->qmi.handle, QMI_SERVICE_ID_WLFW,
 			     ATH11K_QMI_WLFW_SERVICE_VERS_V01,
 			     ab->qmi.service_ins_id);
 	if (ret < 0) {
drivers/net/wireless/ath/ath11k/qmi.h +0 -1
index 7968ab122b65..eae416db8b52 100644
@@ -15,7 +15,6 @@
 #define ATH11K_QMI_MAX_BDF_FILE_NAME_SIZE	64
 #define ATH11K_QMI_CALDB_ADDRESS		0x4BA00000
 #define ATH11K_QMI_WLANFW_MAX_BUILD_ID_LEN_V01	128
-#define ATH11K_QMI_WLFW_SERVICE_ID_V01		0x45
 #define ATH11K_QMI_WLFW_SERVICE_VERS_V01	0x01
 #define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01	0x02
 #define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390	0x01
drivers/net/wireless/ath/ath12k/qmi.c +1 -1
index c11b84b56f8f..f31cba7af722 100644
@@ -4061,7 +4061,7 @@ int ath12k_qmi_init_service(struct ath12k_base *ab)
 	spin_lock_init(&ab->qmi.event_lock);
 	INIT_WORK(&ab->qmi.event_work, ath12k_qmi_driver_event_work);
 
-	ret = qmi_add_lookup(&ab->qmi.handle, ATH12K_QMI_WLFW_SERVICE_ID_V01,
+	ret = qmi_add_lookup(&ab->qmi.handle, QMI_SERVICE_ID_WLFW,
 			     ATH12K_QMI_WLFW_SERVICE_VERS_V01,
 			     ab->qmi.service_ins_id);
 	if (ret < 0) {
drivers/net/wireless/ath/ath12k/qmi.h +0 -1
index b5a4a01391cb..2a63e214eb42 100644
@@ -15,7 +15,6 @@
 #define ATH12K_QMI_MAX_BDF_FILE_NAME_SIZE	64
 #define ATH12K_QMI_CALDB_ADDRESS		0x4BA00000
 #define ATH12K_QMI_WLANFW_MAX_BUILD_ID_LEN_V01	128
-#define ATH12K_QMI_WLFW_SERVICE_ID_V01		0x45
 #define ATH12K_QMI_WLFW_SERVICE_VERS_V01	0x01
 #define ATH12K_QMI_WLFW_SERVICE_INS_ID_V01	0x02
 #define ATH12K_QMI_WLFW_SERVICE_INS_ID_V01_WCN7850 0x1
Signature · 1 line
2.43.0
Reviewed-by on v1 3/8
#9 lore raw

Re: [PATCH v1 3/8] net: drivers: wireless: ath: Use the unified QMI service ID instead of defining it locally

Quoted 5 lines · Daniel Lezcano

Instead of defining a local macro with a custom name for the QMI service identifier, use the one provided in qmi.h and remove the locally defined macro.

Quoted 9 lines
---
 drivers/net/wireless/ath/ath10k/qmi.c          | 2 +-
 drivers/net/wireless/ath/ath10k/qmi_wlfw_v01.h | 1 -
 drivers/net/wireless/ath/ath11k/qmi.c          | 2 +-
 drivers/net/wireless/ath/ath11k/qmi.h          | 1 -
 drivers/net/wireless/ath/ath12k/qmi.c          | 2 +-
 drivers/net/wireless/ath/ath12k/qmi.h          | 1 -
 6 files changed, 3 insertions(+), 6 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
#10 lore raw

PATCH 4/8 remoteproc: qcom: Use the unified QMI service ID instead of defining it locally

In reply to Daniel Lezcano

Instead of defining a local macro with a custom name for the QMI service identifier, use the one provided in qmi.h and remove the locally defined macro.

---
 drivers/remoteproc/qcom_sysmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/remoteproc/qcom_sysmon.c +1 -1
index cf10e8ecfb8f..5bd4147f1f37 100644
@@ -677,7 +677,7 @@ struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
 		return ERR_PTR(ret);
 	}
 
-	qmi_add_lookup(&sysmon->qmi, 43, 0, 0);
+	qmi_add_lookup(&sysmon->qmi, QMI_SERVICE_ID_SSCTL, 0, 0);
 
 	sysmon->subdev.prepare = sysmon_prepare;
 	sysmon->subdev.start = sysmon_start;
Signature · 1 line
2.43.0
Reviewed-by on v1 4/8
#11 lore raw

Re: [PATCH v1 4/8] remoteproc: qcom: Use the unified QMI service ID instead of defining it locally

Quoted 9 lines · Daniel Lezcano

Instead of defining a local macro with a custom name for the QMI service identifier, use the one provided in qmi.h and remove the locally defined macro.

---
 drivers/remoteproc/qcom_sysmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 2 lines
With best wishes
Dmitry
maintainer Applied
#12 lore raw

Re: (subset) [PATCH v1 4/8] remoteproc: qcom: Use the unified QMI service ID instead of defining it locally

In reply to Daniel Lezcano
Quoted 5 lines · Daniel Lezcano

Instead of defining a local macro with a custom name for the QMI service identifier, use the one provided in qmi.h and remove the locally defined macro.

Applied, thanks!

[4/8] remoteproc: qcom: Use the unified QMI service ID instead of defining it locally

      commit: 95b6c029e56e4d75e2957ce7ac795da29415865b

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>
#13 lore raw

Re: (subset) [PATCH v1 4/8] remoteproc: qcom: Use the unified QMI service ID instead of defining it locally

Hi,

Quoted 8 lines · Bjorn Andersson
Quoted 5 lines · Daniel Lezcano

Instead of defining a local macro with a custom name for the QMI service identifier, use the one provided in qmi.h and remove the locally defined macro.

Quoted 4 lines

Applied, thanks!

[4/8] remoteproc: qcom: Use the unified QMI service ID instead of defining it locally

       commit: 95b6c029e56e4d75e2957ce7ac795da29415865b

Just a head up I'm not seeing it in qcom/for-next

#14 lore raw

PATCH 5/8 slimbus: qcom-ngd-ctrl: Use the unified QMI service ID instead of defining it locally

In reply to Daniel Lezcano

Instead of defining a local macro with a custom name for the QMI service identifier, use the one provided in qmi.h and remove the locally defined macro.

---
 drivers/slimbus/qcom-ngd-ctrl.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/slimbus/qcom-ngd-ctrl.c +2 -3
index 9aa7218b4e8d..0b88b8577bdb 100644
@@ -48,7 +48,6 @@
 				NGD_INT_RX_MSG_RCVD)
 
 /* Slimbus QMI service */
-#define SLIMBUS_QMI_SVC_ID	0x0301
 #define SLIMBUS_QMI_SVC_V1	1
 #define SLIMBUS_QMI_INS_ID	0
 #define SLIMBUS_QMI_SELECT_INSTANCE_REQ_V01	0x0020
@@ -1408,8 +1407,8 @@ static int qcom_slim_ngd_qmi_svc_event_init(struct qcom_slim_ngd_ctrl *ctrl)
 		return ret;
 	}
 
-	ret = qmi_add_lookup(&qmi->svc_event_hdl, SLIMBUS_QMI_SVC_ID,
-			SLIMBUS_QMI_SVC_V1, SLIMBUS_QMI_INS_ID);
+	ret = qmi_add_lookup(&qmi->svc_event_hdl, QMI_SERVICE_ID_SLIMBUS,
+			     SLIMBUS_QMI_SVC_V1, SLIMBUS_QMI_INS_ID);
 	if (ret < 0) {
 		dev_err(ctrl->dev, "qmi_add_lookup failed: %d\n", ret);
 		qmi_handle_release(&qmi->svc_event_hdl);
Signature · 1 line
2.43.0
Reviewed-by on v1 5/8
#15 lore raw

Re: [PATCH v1 5/8] slimbus: qcom-ngd-ctrl: Use the unified QMI service ID instead of defining it locally

Quoted 9 lines · Daniel Lezcano

Instead of defining a local macro with a custom name for the QMI service identifier, use the one provided in qmi.h and remove the locally defined macro.

---
 drivers/slimbus/qcom-ngd-ctrl.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
#16 lore raw

PATCH 6/8 soc: qcom: pdr: Use the unified QMI service ID instead of defining it locally

In reply to Daniel Lezcano

Instead of defining a local macro with a custom name for the QMI service identifier, use the one provided in qmi.h and remove the locally defined macro.

---
 drivers/soc/qcom/pdr_interface.c  | 4 ++--
 drivers/soc/qcom/pdr_internal.h   | 3 ---
 drivers/soc/qcom/qcom_pd_mapper.c | 2 +-
 3 files changed, 3 insertions(+), 6 deletions(-)
drivers/soc/qcom/pdr_interface.c +2 -2
index 72259f489075..6d879e1540b0 100644
@@ -523,7 +523,7 @@ struct pdr_service *pdr_add_lookup(struct pdr_handle *pdr,
 	if (!pds)
 		return ERR_PTR(-ENOMEM);
 
-	pds->service = SERVREG_NOTIFIER_SERVICE;
+	pds->service = QMI_SERVICE_ID_SERVREG_NOTIF;
 	strscpy(pds->service_name, service_name, sizeof(pds->service_name));
 	strscpy(pds->service_path, service_path, sizeof(pds->service_path));
 	pds->need_locator_lookup = true;
@@ -678,7 +678,7 @@ struct pdr_handle *pdr_handle_alloc(void (*status)(int state,
 	if (ret < 0)
 		goto destroy_indack;
 
-	ret = qmi_add_lookup(&pdr->locator_hdl, SERVREG_LOCATOR_SERVICE, 1, 1);
+	ret = qmi_add_lookup(&pdr->locator_hdl, QMI_SERVICE_ID_SERVREG_LOC, 1, 1);
 	if (ret < 0)
 		goto release_qmi_handle;
 
drivers/soc/qcom/pdr_internal.h +0 -3
index 039508c1bbf7..6cd8cbe26822 100644
@@ -4,9 +4,6 @@
 
 #include <linux/soc/qcom/pdr.h>
 
-#define SERVREG_LOCATOR_SERVICE				0x40
-#define SERVREG_NOTIFIER_SERVICE			0x42
-
 #define SERVREG_REGISTER_LISTENER_REQ			0x20
 #define SERVREG_GET_DOMAIN_LIST_REQ			0x21
 #define SERVREG_STATE_UPDATED_IND_ID			0x22
drivers/soc/qcom/qcom_pd_mapper.c +1 -1
index dc10bc859ff4..bb60b5c40554 100644
@@ -656,7 +656,7 @@ static struct qcom_pdm_data *qcom_pdm_start(void)
 			goto err_stop;
 	}
 
-	ret = qmi_add_server(&data->handle, SERVREG_LOCATOR_SERVICE,
+	ret = qmi_add_server(&data->handle, QMI_SERVICE_ID_SERVREG_LOC,
 			     SERVREG_QMI_VERSION, SERVREG_QMI_INSTANCE);
 	if (ret) {
 		pr_err("PDM: error adding server %d\n", ret);
Signature · 1 line
2.43.0
Reviewed-by on v1 6/8
#17 lore raw

Re: [PATCH v1 6/8] soc: qcom: pdr: Use the unified QMI service ID instead of defining it locally

Quoted 11 lines · Daniel Lezcano

Instead of defining a local macro with a custom name for the QMI service identifier, use the one provided in qmi.h and remove the locally defined macro.

---
 drivers/soc/qcom/pdr_interface.c  | 4 ++--
 drivers/soc/qcom/pdr_internal.h   | 3 ---
 drivers/soc/qcom/qcom_pd_mapper.c | 2 +-
 3 files changed, 3 insertions(+), 6 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
#18 lore raw

PATCH 7/8 ALSA: usb-audio: qcom: Use the unified QMI service ID instead of defining it locally

In reply to Daniel Lezcano

Instead of defining a local macro with a custom name for the QMI service identifier, use the one provided in qmi.h and remove the locally defined macro.

---
 sound/usb/qcom/qc_audio_offload.c  | 2 +-
 sound/usb/qcom/usb_audio_qmi_v01.h | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
sound/usb/qcom/qc_audio_offload.c +1 -1
index 510b68cced33..bc4e1bdacaa8 100644
@@ -1927,7 +1927,7 @@ static int qc_usb_audio_probe(struct auxiliary_device *auxdev,
 			      QMI_UAUDIO_STREAM_REQ_MSG_V01_MAX_MSG_LEN,
 			      &uaudio_svc_ops_options,
 			      &uaudio_stream_req_handlers);
-	ret = qmi_add_server(svc->uaudio_svc_hdl, UAUDIO_STREAM_SERVICE_ID_V01,
+	ret = qmi_add_server(svc->uaudio_svc_hdl, QMI_SERVICE_ID_USB_AUDIO_STREAM,
 			     UAUDIO_STREAM_SERVICE_VERS_V01, 0);
 
 	uaudio_svc = svc;
sound/usb/qcom/usb_audio_qmi_v01.h +0 -1
index a1298d75d9f8..c7eee03225ec 100644
@@ -6,7 +6,6 @@
 #ifndef USB_QMI_V01_H
 #define USB_QMI_V01_H
 
-#define UAUDIO_STREAM_SERVICE_ID_V01 0x41D
 #define UAUDIO_STREAM_SERVICE_VERS_V01 0x01
 
 #define QMI_UAUDIO_STREAM_RESP_V01 0x0001
Signature · 1 line
2.43.0
Reviewed-by on v1 7/8
#19 lore raw

Re: [PATCH v1 7/8] ALSA: usb-audio: qcom: Use the unified QMI service ID instead of defining it locally

Quoted 10 lines · Daniel Lezcano

Instead of defining a local macro with a custom name for the QMI service identifier, use the one provided in qmi.h and remove the locally defined macro.

---
 sound/usb/qcom/qc_audio_offload.c  | 2 +-
 sound/usb/qcom/usb_audio_qmi_v01.h | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
#20 lore raw

PATCH 8/8 samples: qmi: Use the unified QMI service ID instead of defining it locally

In reply to Daniel Lezcano

Instead of defining a local macro with a custom name for the QMI service identifier, use the one provided in qmi.h and remove the locally defined macro.

---
 samples/qmi/qmi_sample_client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
samples/qmi/qmi_sample_client.c +1 -1
index d1814582319b..247ec5e54c4f 100644
@@ -592,7 +592,7 @@ static int qmi_sample_init(void)
 	if (ret < 0)
 		goto err_unregister_driver;
 
-	qmi_add_lookup(&lookup_client, 15, 0, 0);
+	qmi_add_lookup(&lookup_client, QMI_SERVICE_ID_TEST, 0, 0);
 
 	return 0;
 
Signature · 1 line
2.43.0
Reviewed-by on v1 8/8
#21 lore raw

Re: [PATCH v1 8/8] samples: qmi: Use the unified QMI service ID instead of defining it locally

Quoted 9 lines · Daniel Lezcano

Instead of defining a local macro with a custom name for the QMI service identifier, use the one provided in qmi.h and remove the locally defined macro.

---
 samples/qmi/qmi_sample_client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 2 lines
With best wishes
Dmitry
#22 lore raw
In reply to Daniel Lezcano
Quoted 37 lines · Daniel Lezcano

The different subsystems implementing the QMI service protocol are using their own definition of the service id. It is not a problem but it results on having those duplicated with different names but the same value and without consistency in their name.

It makes more sense to unify their names and move the definitions in the QMI header file providing a consistent way to represent the supported protocols. Consequently the different drivers will use them instead of their own definition of the service id.

Cc Alex Elder <[email protected]>
Cc Andrew Lunn <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Paolo Abeni <[email protected]>
Cc Jeff Johnson <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc Mathieu Poirier <[email protected]>
Cc Srinivas Kandagatla <[email protected]>
Cc Konrad Dybcio <[email protected]>
Cc Jaroslav Kysela <[email protected]>
Cc Takashi Iwai <[email protected]>
Cc Kees Cook <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Mark Brown <[email protected]>
Cc Wesley Cheng <[email protected]>
Quoted 7 lines

---
Daniel Lezcano (8):
soc: qcom: qmi: Enumerate the service IDs of QMI
net: ipa: Use the unified QMI service ID instead of defining it
locally
net: drivers: wireless: ath: Use the unified QMI service ID instead of
defining it locally

prefix for wireless drivers is simply wifi: <driver>:
so s/net: drivers: wireless:/wifi:/

Quoted 11 lines

remoteproc: qcom: Use the unified QMI service ID instead of defining
it locally
slimbus: qcom-ngd-ctrl: Use the unified QMI service ID instead of
defining it locally
soc: qcom: pdr: Use the unified QMI service ID instead of defining it
locally
ALSA: usb-audio: qcom: Use the unified QMI service ID instead of
defining it locally
samples: qmi: Use the unified QMI service ID instead of defining it
locally

Quoted 16 lines
 drivers/net/ipa/ipa_qmi.c                      |  6 ++----
 drivers/net/wireless/ath/ath10k/qmi.c          |  2 +-
 drivers/net/wireless/ath/ath10k/qmi_wlfw_v01.h |  1 -
 drivers/net/wireless/ath/ath11k/qmi.c          |  2 +-
 drivers/net/wireless/ath/ath11k/qmi.h          |  1 -
 drivers/net/wireless/ath/ath12k/qmi.c          |  2 +-
 drivers/net/wireless/ath/ath12k/qmi.h          |  1 -
 drivers/remoteproc/qcom_sysmon.c               |  2 +-
 drivers/slimbus/qcom-ngd-ctrl.c                |  5 ++---
 drivers/soc/qcom/pdr_interface.c               |  4 ++--
 drivers/soc/qcom/pdr_internal.h                |  3 ---
 drivers/soc/qcom/qcom_pd_mapper.c              |  2 +-
 include/linux/soc/qcom/qmi.h                   | 12 ++++++++++++
 samples/qmi/qmi_sample_client.c                |  2 +-
 sound/usb/qcom/qc_audio_offload.c              |  2 +-
 sound/usb/qcom/usb_audio_qmi_v01.h             |  1 -

You are touching a lot of subsystems with a single series. How do you plan on having these land?
Do you have a maintainer who will take all of these through their tree?

Quoted 2 lines
 16 files changed, 25 insertions(+), 23 deletions(-)
#23 lore raw
Quoted 7 lines · Jeff Johnson
Quoted 6 lines · Daniel Lezcano

The different subsystems implementing the QMI service protocol are using their own definition of the service id. It is not a problem but it results on having those duplicated with different names but the same value and without consistency in their name.

It makes more sense to unify their names and move the definitions in

[ ... ]

Quoted 2 lines

prefix for wireless drivers is simply wifi: <driver>:
so s/net: drivers: wireless:/wifi:/

Noted, thanks

Quoted 28 lines
Quoted 11 lines

remoteproc: qcom: Use the unified QMI service ID instead of defining
it locally
slimbus: qcom-ngd-ctrl: Use the unified QMI service ID instead of
defining it locally
soc: qcom: pdr: Use the unified QMI service ID instead of defining it
locally
ALSA: usb-audio: qcom: Use the unified QMI service ID instead of
defining it locally
samples: qmi: Use the unified QMI service ID instead of defining it
locally

Quoted 16 lines
  drivers/net/ipa/ipa_qmi.c                      |  6 ++----
  drivers/net/wireless/ath/ath10k/qmi.c          |  2 +-
  drivers/net/wireless/ath/ath10k/qmi_wlfw_v01.h |  1 -
  drivers/net/wireless/ath/ath11k/qmi.c          |  2 +-
  drivers/net/wireless/ath/ath11k/qmi.h          |  1 -
  drivers/net/wireless/ath/ath12k/qmi.c          |  2 +-
  drivers/net/wireless/ath/ath12k/qmi.h          |  1 -
  drivers/remoteproc/qcom_sysmon.c               |  2 +-
  drivers/slimbus/qcom-ngd-ctrl.c                |  5 ++---
  drivers/soc/qcom/pdr_interface.c               |  4 ++--
  drivers/soc/qcom/pdr_internal.h                |  3 ---
  drivers/soc/qcom/qcom_pd_mapper.c              |  2 +-
  include/linux/soc/qcom/qmi.h                   | 12 ++++++++++++
  samples/qmi/qmi_sample_client.c                |  2 +-
  sound/usb/qcom/qc_audio_offload.c              |  2 +-
  sound/usb/qcom/usb_audio_qmi_v01.h             |  1 -
Quoted 3 lines

You are touching a lot of subsystems with a single series. How do you plan on having these land?
Do you have a maintainer who will take all of these through their tree?

Yes I thought Bjorn or Konrad would take them with the acked-by from the different subsystems

maintainer
#24 lore raw
Quoted 44 lines · Daniel Lezcano
Quoted 7 lines · Jeff Johnson
Quoted 6 lines · Daniel Lezcano

The different subsystems implementing the QMI service protocol are using their own definition of the service id. It is not a problem but it results on having those duplicated with different names but the same value and without consistency in their name.

It makes more sense to unify their names and move the definitions in

[ ... ]

Quoted 2 lines

prefix for wireless drivers is simply wifi: <driver>:
so s/net: drivers: wireless:/wifi:/

Noted, thanks

Quoted 28 lines
Quoted 27 lines

remoteproc: qcom: Use the unified QMI service ID instead of defining
it locally
slimbus: qcom-ngd-ctrl: Use the unified QMI service ID instead of
defining it locally
soc: qcom: pdr: Use the unified QMI service ID instead of defining it
locally
ALSA: usb-audio: qcom: Use the unified QMI service ID instead of
defining it locally
samples: qmi: Use the unified QMI service ID instead of defining it
locally

  drivers/net/ipa/ipa_qmi.c                      |  6 ++----
  drivers/net/wireless/ath/ath10k/qmi.c          |  2 +-
  drivers/net/wireless/ath/ath10k/qmi_wlfw_v01.h |  1 -
  drivers/net/wireless/ath/ath11k/qmi.c          |  2 +-
  drivers/net/wireless/ath/ath11k/qmi.h          |  1 -
  drivers/net/wireless/ath/ath12k/qmi.c          |  2 +-
  drivers/net/wireless/ath/ath12k/qmi.h          |  1 -
  drivers/remoteproc/qcom_sysmon.c               |  2 +-
  drivers/slimbus/qcom-ngd-ctrl.c                |  5 ++---
  drivers/soc/qcom/pdr_interface.c               |  4 ++--
  drivers/soc/qcom/pdr_internal.h                |  3 ---
  drivers/soc/qcom/qcom_pd_mapper.c              |  2 +-
  include/linux/soc/qcom/qmi.h                   | 12 ++++++++++++
  samples/qmi/qmi_sample_client.c                |  2 +-
  sound/usb/qcom/qc_audio_offload.c              |  2 +-
  sound/usb/qcom/usb_audio_qmi_v01.h             |  1 -
Quoted 6 lines
Quoted 3 lines

You are touching a lot of subsystems with a single series. How do you plan on having these land?
Do you have a maintainer who will take all of these through their tree?

Yes I thought Bjorn or Konrad would take them with the acked-by from the different subsystems

As we haven't received any such acks, I pulled patch 1 into an immutable branch and pushed it here:

https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git [email protected]

Other maintainers can use this to pull respective changes, or you can repost the individual patches with this (or follow up once it's in -rc1).

Regards,
Bjorn

#25 lore raw
In reply to Daniel Lezcano
Quoted 9 lines · Daniel Lezcano

The different subsystems implementing the QMI service protocol are using their own definition of the service id. It is not a problem but it results on having those duplicated with different names but the same value and without consistency in their name.

It makes more sense to unify their names and move the definitions in the QMI header file providing a consistent way to represent the supported protocols. Consequently the different drivers will use them instead of their own definition of the service id.

Also this looks like a first step towards providing qrtr service debugfs in the kernel.

Quoted 1 line
Signature · 2 lines
With best wishes
Dmitry
maintainer Applied
#26 lore raw

Re: (subset) [PATCH v1 0/8] Group QMI service IDs into the QMI header

In reply to Daniel Lezcano
Quoted 11 lines · Daniel Lezcano

The different subsystems implementing the QMI service protocol are using their own definition of the service id. It is not a problem but it results on having those duplicated with different names but the same value and without consistency in their name.

It makes more sense to unify their names and move the definitions in the QMI header file providing a consistent way to represent the supported protocols. Consequently the different drivers will use them instead of their own definition of the service id.

[...]

Applied, thanks!

[6/8] soc: qcom: pdr: Use the unified QMI service ID instead of defining it locally

      commit: 24f80cbe0b8f4c6b27d03c7a7ad707d76c1c4885
[8/8] samples: qmi: Use the unified QMI service ID instead of defining it locally
      commit: 8baf6b3b7695849581a91bdaf66af2be68ef32ed

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>
maintainer Applied
#27 lore raw

Re: (subset) [PATCH v1 0/8] Group QMI service IDs into the QMI header

In reply to Daniel Lezcano
Quoted 11 lines · Daniel Lezcano

The different subsystems implementing the QMI service protocol are using their own definition of the service id. It is not a problem but it results on having those duplicated with different names but the same value and without consistency in their name.

It makes more sense to unify their names and move the definitions in the QMI header file providing a consistent way to represent the supported protocols. Consequently the different drivers will use them instead of their own definition of the service id.

[...]

Applied, thanks!

[8/8] samples: qmi: Use the unified QMI service ID instead of defining it locally

      commit: 8baf6b3b7695849581a91bdaf66af2be68ef32ed

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>