You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/05/13 21:35:34 UTC

[incubator-nuttx] branch master updated (0178792a01 -> 9072eecc30)

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


    from 0178792a01 risc-v/mpfs: IHC: clarify semaphore usage
     new f208c4bbd4 Fix ENOENT errors when polling on Netlink socket
     new 9072eecc30 sched/wqueue: Change the return type of work_notifier_teardown to void

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 drivers/usbhost/usbhost_storage.c |  7 +++----
 include/nuttx/mm/iob.h            |  5 ++---
 include/nuttx/usb/usbhost.h       |  5 ++---
 include/nuttx/wqueue.h            |  5 ++---
 mm/iob/iob_notifier.c             |  7 +++----
 net/netdev/netdev.h               |  5 ++---
 net/netdev/netdown_notifier.c     |  7 +++----
 net/netlink/netlink.h             |  6 +-----
 net/netlink/netlink_notifier.c    | 11 ++---------
 net/netlink/netlink_sockif.c      |  2 +-
 net/tcp/tcp.h                     |  5 ++---
 net/tcp/tcp_notifier.c            |  7 +++----
 net/udp/udp.h                     |  5 ++---
 net/udp/udp_notifier.c            |  7 +++----
 sched/wqueue/kwork_notifier.c     | 15 +++------------
 15 files changed, 34 insertions(+), 65 deletions(-)


[incubator-nuttx] 01/02: Fix ENOENT errors when polling on Netlink socket

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit f208c4bbd43d483ceafe41a13c0f63e2d476532e
Author: Michael Jung <mi...@secore.ly>
AuthorDate: Fri May 13 12:24:38 2022 +0200

    Fix ENOENT errors when polling on Netlink socket
    
    When a Netlink response is issued, which a task is currently polling for
    on the corresponding AF_NETLINK socket, then the poll call will return
    with a ENOENT error.  This is due to the fact that the Netlink response
    notifier is automatically torn down after the notification.
    
    Fixed by making netlink_notifier_teardown a best-effort function that
    does not return a result code.
    
    Signed-off-by: Michael Jung <mi...@secore.ly>
---
 net/netlink/netlink.h          |  6 +-----
 net/netlink/netlink_notifier.c | 11 ++---------
 net/netlink/netlink_sockif.c   |  2 +-
 3 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/net/netlink/netlink.h b/net/netlink/netlink.h
index ccce4ab8d3..1d12abf70f 100644
--- a/net/netlink/netlink.h
+++ b/net/netlink/netlink.h
@@ -178,13 +178,9 @@ int netlink_notifier_setup(worker_t worker, FAR struct netlink_conn_s *conn,
  * Input Parameters:
  *   conn - Teardown the notification for this Netlink connection.
  *
- * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
- *
  ****************************************************************************/
 
-int netlink_notifier_teardown(FAR struct netlink_conn_s *conn);
+void netlink_notifier_teardown(FAR struct netlink_conn_s *conn);
 
 /****************************************************************************
  * Name: netlink_notifier_signal
diff --git a/net/netlink/netlink_notifier.c b/net/netlink/netlink_notifier.c
index b101e4fa7f..782a9a6f65 100644
--- a/net/netlink/netlink_notifier.c
+++ b/net/netlink/netlink_notifier.c
@@ -93,26 +93,19 @@ int netlink_notifier_setup(worker_t worker, FAR struct netlink_conn_s *conn,
  * Input Parameters:
  *   conn - Teardown the notification for this Netlink connection.
  *
- * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
- *
  ****************************************************************************/
 
-int netlink_notifier_teardown(FAR struct netlink_conn_s *conn)
+void netlink_notifier_teardown(FAR struct netlink_conn_s *conn)
 {
   DEBUGASSERT(conn != NULL);
-  int ret = OK;
 
   /* This is just a simple wrapper around work_notifier_teardown(). */
 
   if (conn->key > 0)
     {
-      ret = work_notifier_teardown(conn->key);
+      work_notifier_teardown(conn->key);
       conn->key = 0;
     }
-
-  return ret;
 }
 
 /****************************************************************************
diff --git a/net/netlink/netlink_sockif.c b/net/netlink/netlink_sockif.c
index e1351bf4bf..d0a6c4f2eb 100644
--- a/net/netlink/netlink_sockif.c
+++ b/net/netlink/netlink_sockif.c
@@ -638,7 +638,7 @@ static int netlink_poll(FAR struct socket *psock, FAR struct pollfd *fds,
     {
       /* Cancel any response notifications */
 
-      ret = netlink_notifier_teardown(conn);
+      netlink_notifier_teardown(conn);
       conn->pollsem   = NULL;
       conn->pollevent = NULL;
     }


[incubator-nuttx] 02/02: sched/wqueue: Change the return type of work_notifier_teardown to void

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 9072eecc30f8d118ad4ba80582deecb534e3fb02
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Fri May 13 18:26:42 2022 +0800

    sched/wqueue: Change the return type of work_notifier_teardown to void
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 drivers/usbhost/usbhost_storage.c |  7 +++----
 include/nuttx/mm/iob.h            |  5 ++---
 include/nuttx/usb/usbhost.h       |  5 ++---
 include/nuttx/wqueue.h            |  5 ++---
 mm/iob/iob_notifier.c             |  7 +++----
 net/netdev/netdev.h               |  5 ++---
 net/netdev/netdown_notifier.c     |  7 +++----
 net/tcp/tcp.h                     |  5 ++---
 net/tcp/tcp_notifier.c            |  7 +++----
 net/udp/udp.h                     |  5 ++---
 net/udp/udp_notifier.c            |  7 +++----
 sched/wqueue/kwork_notifier.c     | 15 +++------------
 12 files changed, 30 insertions(+), 50 deletions(-)

diff --git a/drivers/usbhost/usbhost_storage.c b/drivers/usbhost/usbhost_storage.c
index 4c09e77bdf..55048330de 100644
--- a/drivers/usbhost/usbhost_storage.c
+++ b/drivers/usbhost/usbhost_storage.c
@@ -2435,16 +2435,15 @@ int usbhost_msc_notifier_setup(worker_t worker, uint8_t event, char sdchar,
  *         usbhost_msc_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
-int usbhost_msc_notifier_teardown(int key)
+void usbhost_msc_notifier_teardown(int key)
 {
   /* This is just a simple wrapper around work_notifier_teardown(). */
 
-  return work_notifier_teardown(key);
+  work_notifier_teardown(key);
 }
 
 /****************************************************************************
diff --git a/include/nuttx/mm/iob.h b/include/nuttx/mm/iob.h
index e64130d748..68224a5221 100644
--- a/include/nuttx/mm/iob.h
+++ b/include/nuttx/mm/iob.h
@@ -349,13 +349,12 @@ int iob_notifier_setup(int qid, worker_t worker, FAR void *arg);
  *         iob_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
 #ifdef CONFIG_IOB_NOTIFIER
-int iob_notifier_teardown(int key);
+void iob_notifier_teardown(int key);
 #endif
 
 /****************************************************************************
diff --git a/include/nuttx/usb/usbhost.h b/include/nuttx/usb/usbhost.h
index 709e923b6c..7d220bf141 100644
--- a/include/nuttx/usb/usbhost.h
+++ b/include/nuttx/usb/usbhost.h
@@ -1093,12 +1093,11 @@ int usbhost_msc_notifier_setup(worker_t worker, uint8_t event, char sdchar,
  *         usbhost_msc_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
-int usbhost_msc_notifier_teardown(int key);
+void usbhost_msc_notifier_teardown(int key);
 
 /****************************************************************************
  * Name: usbhost_msc_notifier_signal
diff --git a/include/nuttx/wqueue.h b/include/nuttx/wqueue.h
index 7ab1e81e05..bd91068748 100644
--- a/include/nuttx/wqueue.h
+++ b/include/nuttx/wqueue.h
@@ -500,13 +500,12 @@ int work_notifier_setup(FAR struct work_notifier_s *info);
  *         work_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
 #ifdef CONFIG_WQUEUE_NOTIFIER
-int work_notifier_teardown(int key);
+void work_notifier_teardown(int key);
 #endif
 
 /****************************************************************************
diff --git a/mm/iob/iob_notifier.c b/mm/iob/iob_notifier.c
index 19bb383280..d645df8466 100644
--- a/mm/iob/iob_notifier.c
+++ b/mm/iob/iob_notifier.c
@@ -92,16 +92,15 @@ int iob_notifier_setup(int qid, worker_t worker, FAR void *arg)
  *         iob_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
-int iob_notifier_teardown(int key)
+void iob_notifier_teardown(int key)
 {
   /* This is just a simple wrapper around work_notifier_teardown(). */
 
-  return work_notifier_teardown(key);
+  work_notifier_teardown(key);
 }
 
 /****************************************************************************
diff --git a/net/netdev/netdev.h b/net/netdev/netdev.h
index bc47544091..a4a7659397 100644
--- a/net/netdev/netdev.h
+++ b/net/netdev/netdev.h
@@ -478,13 +478,12 @@ int netdown_notifier_setup(worker_t worker, FAR struct net_driver_s *dev,
  *         netdown_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
 #ifdef CONFIG_NETDOWN_NOTIFIER
-int netdown_notifier_teardown(int key);
+void netdown_notifier_teardown(int key);
 #endif
 
 /****************************************************************************
diff --git a/net/netdev/netdown_notifier.c b/net/netdev/netdown_notifier.c
index 4dfa714173..54d05fbbd1 100644
--- a/net/netdev/netdown_notifier.c
+++ b/net/netdev/netdown_notifier.c
@@ -105,16 +105,15 @@ int netdown_notifier_setup(worker_t worker, FAR struct net_driver_s *dev,
  *         netdown_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
-int netdown_notifier_teardown(int key)
+void netdown_notifier_teardown(int key)
 {
   /* This is just a simple wrapper around work_notifier_teardown(). */
 
-  return work_notifier_teardown(key);
+  work_notifier_teardown(key);
 }
 
 /****************************************************************************
diff --git a/net/tcp/tcp.h b/net/tcp/tcp.h
index 308885ddd3..3957c25cec 100644
--- a/net/tcp/tcp.h
+++ b/net/tcp/tcp.h
@@ -1830,13 +1830,12 @@ int tcp_disconnect_notifier_setup(worker_t worker,
  *         tcp_readahead_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
 #ifdef CONFIG_NET_TCP_NOTIFIER
-int tcp_notifier_teardown(int key);
+void tcp_notifier_teardown(int key);
 #endif
 
 /****************************************************************************
diff --git a/net/tcp/tcp_notifier.c b/net/tcp/tcp_notifier.c
index 00b10a4de1..9b9609303e 100644
--- a/net/tcp/tcp_notifier.c
+++ b/net/tcp/tcp_notifier.c
@@ -217,16 +217,15 @@ int tcp_disconnect_notifier_setup(worker_t worker,
  *         tcp_readahead_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
-int tcp_notifier_teardown(int key)
+void tcp_notifier_teardown(int key)
 {
   /* This is just a simple wrapper around work_notifier_teardown(). */
 
-  return work_notifier_teardown(key);
+  work_notifier_teardown(key);
 }
 
 /****************************************************************************
diff --git a/net/udp/udp.h b/net/udp/udp.h
index 03daa0ae25..966183f44f 100644
--- a/net/udp/udp.h
+++ b/net/udp/udp.h
@@ -832,13 +832,12 @@ int udp_writebuffer_notifier_setup(worker_t worker,
  *         udp_readahead_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
 #ifdef CONFIG_NET_UDP_NOTIFIER
-int udp_notifier_teardown(int key);
+void udp_notifier_teardown(int key);
 #endif
 
 /****************************************************************************
diff --git a/net/udp/udp_notifier.c b/net/udp/udp_notifier.c
index ff37e9afeb..21f16b0548 100644
--- a/net/udp/udp_notifier.c
+++ b/net/udp/udp_notifier.c
@@ -164,16 +164,15 @@ int udp_writebuffer_notifier_setup(worker_t worker,
  *         udp_readahead_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
-int udp_notifier_teardown(int key)
+void udp_notifier_teardown(int key)
 {
   /* This is just a simple wrapper around work_notifier_teardown(). */
 
-  return work_notifier_teardown(key);
+  work_notifier_teardown(key);
 }
 
 /****************************************************************************
diff --git a/sched/wqueue/kwork_notifier.c b/sched/wqueue/kwork_notifier.c
index 09cb1a683b..7aee208446 100644
--- a/sched/wqueue/kwork_notifier.c
+++ b/sched/wqueue/kwork_notifier.c
@@ -276,16 +276,14 @@ int work_notifier_setup(FAR struct work_notifier_s *info)
  *         work_notifier_setup().
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
+ *   None.
  *
  ****************************************************************************/
 
-int work_notifier_teardown(int key)
+void work_notifier_teardown(int key)
 {
   FAR struct work_notifier_entry_s *notifier;
   irqstate_t flags;
-  int ret = OK;
 
   /* Disable interrupts very briefly. */
 
@@ -296,13 +294,7 @@ int work_notifier_teardown(int key)
    */
 
   notifier = work_notifier_find(key);
-  if (notifier == NULL)
-    {
-      /* There is no notification with this key in the pending list */
-
-      ret = -ENOENT;
-    }
-  else
+  if (notifier != NULL)
     {
       /* Found it!  Remove the notification from the pending list */
 
@@ -314,7 +306,6 @@ int work_notifier_teardown(int key)
     }
 
   leave_critical_section(flags);
-  return ret;
 }
 
 /****************************************************************************