Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
Link: https://lore.kernel.org/r/20191106230511.1290-1-jeffrey.l.hugo@gmail.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

authored by

Jeffrey Hugo and committed by
Bjorn Andersson
52af26e3 e42617b8

+6 -2
+6 -2
drivers/soc/qcom/qmi_interface.c
··· 655 655 656 656 qmi->sock = qmi_sock_create(qmi, &qmi->sq); 657 657 if (IS_ERR(qmi->sock)) { 658 - pr_err("failed to create QMI socket\n"); 659 - ret = PTR_ERR(qmi->sock); 658 + if (PTR_ERR(qmi->sock) == -EAFNOSUPPORT) { 659 + ret = -EPROBE_DEFER; 660 + } else { 661 + pr_err("failed to create QMI socket\n"); 662 + ret = PTR_ERR(qmi->sock); 663 + } 660 664 goto err_destroy_wq; 661 665 } 662 666