Skip to contentSkip to conversation

soc: qcom: qmi: Return EPROBE_DEFER if no address family

PATCH New Jeffrey Hugo 1 participant 1 message Nov 6, 2019

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

PATCH 1/1 soc: qcom: qmi: Return EPROBE_DEFER if no address family

If a client comes up early in the boot process (perhaps was a built-in driver), qmi_handle_init() will likely fail with a EAFNOSUPPORT since the underlying ipc router hasn't init'd and registered the address family. This should not be a fatal error since chances are, the router will come up later, so recode the error to EPROBE_DEFER so that clients will retry later.

---
 drivers/soc/qcom/qmi_interface.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/soc/qcom/qmi_interface.c +6 -2
index f9e309f0acd3..1a03eaa38c46 100644
@@ -655,8 +655,12 @@ int qmi_handle_init(struct qmi_handle *qmi, size_t recv_buf_size,
 
 	qmi->sock = qmi_sock_create(qmi, &qmi->sq);
 	if (IS_ERR(qmi->sock)) {
-		pr_err("failed to create QMI socket\n");
-		ret = PTR_ERR(qmi->sock);
+		if (PTR_ERR(qmi->sock) == -EAFNOSUPPORT) {
+			ret = -EPROBE_DEFER;
+		} else {
+			pr_err("failed to create QMI socket\n");
+			ret = PTR_ERR(qmi->sock);
+		}
 		goto err_destroy_wq;
 	}
 
Signature · 1 line
2.17.1