net: qrtr: Fix FIXME related to qrtr_ns_init()
authorBjorn Andersson <bjorn.andersson@linaro.org>
Mon, 2 Mar 2020 07:03:05 +0000 (23:03 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Mar 2020 01:52:21 +0000 (17:52 -0800)
The 2 second delay before calling qrtr_ns_init() meant that the remote
processors would register as endpoints in qrtr and the say_hello() call
would therefor broadcast the outgoing HELLO to them. With the HELLO
handshake corrected this delay is no longer needed.

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Tested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/qrtr/ns.c
net/qrtr/qrtr.c
net/qrtr/qrtr.h

index 61a58a35cc9118dc8ec4482350f3947e8f44e64e..e7d0fe3f43304433d315dddfafb9bf88e4396997 100644 (file)
@@ -693,7 +693,7 @@ static void qrtr_ns_data_ready(struct sock *sk)
        queue_work(qrtr_ns.workqueue, &qrtr_ns.work);
 }
 
-void qrtr_ns_init(struct work_struct *work)
+void qrtr_ns_init(void)
 {
        struct sockaddr_qrtr sq;
        int ret;
index 423310896285f7ef066c815d1a77f0b4b7a60ed8..e22092e4a783861a57179a61bc055d0b5e53f1ca 100644 (file)
@@ -9,7 +9,6 @@
 #include <linux/termios.h>     /* For TIOCINQ/OUTQ */
 #include <linux/spinlock.h>
 #include <linux/wait.h>
-#include <linux/workqueue.h>
 
 #include <net/sock.h>
 
@@ -110,8 +109,6 @@ static DEFINE_MUTEX(qrtr_node_lock);
 static DEFINE_IDR(qrtr_ports);
 static DEFINE_MUTEX(qrtr_port_lock);
 
-static struct delayed_work qrtr_ns_work;
-
 /**
  * struct qrtr_node - endpoint node
  * @ep_lock: lock for endpoint management and callbacks
@@ -1263,11 +1260,7 @@ static int __init qrtr_proto_init(void)
                return rc;
        }
 
-       /* FIXME: Currently, this 2s delay is required to catch the NEW_SERVER
-        * messages from routers. But the fix could be somewhere else.
-        */
-       INIT_DELAYED_WORK(&qrtr_ns_work, qrtr_ns_init);
-       schedule_delayed_work(&qrtr_ns_work, msecs_to_jiffies(2000));
+       qrtr_ns_init();
 
        return rc;
 }
@@ -1275,7 +1268,6 @@ postcore_initcall(qrtr_proto_init);
 
 static void __exit qrtr_proto_fini(void)
 {
-       cancel_delayed_work_sync(&qrtr_ns_work);
        qrtr_ns_remove();
        sock_unregister(qrtr_family.family);
        proto_unregister(&qrtr_proto);
index 53a237a289716e1e49a22aee19e5a0bdb10bc715..dc2b67f17927161e8928c0a5e6a2ad0a44378fdc 100644 (file)
@@ -29,7 +29,7 @@ void qrtr_endpoint_unregister(struct qrtr_endpoint *ep);
 
 int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len);
 
-void qrtr_ns_init(struct work_struct *work);
+void qrtr_ns_init(void);
 
 void qrtr_ns_remove(void);