You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/10/12 18:05:32 UTC

(nuttx) branch master updated (3f1fd42f73 -> be17bf2f86)

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

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


    from 3f1fd42f73 drivers/input: fix complie err about undefined
     new 78b64cc220 igmp_leave:add check of dev status in igmp_leavegroup Signed-off-by: wangchen <wa...@xiaomi.com>
     new b791e27a8d igmp_group.c:add work_cancel_sync in igmp_grpfree Signed-off-by: wangchen <wa...@xiaomi.com>
     new be17bf2f86 net:when work_cancel_sync is excuted,it releases net_lock

The 3 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:
 net/igmp/igmp_group.c | 13 +++++++++++++
 net/igmp/igmp_leave.c |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)


(nuttx) 01/03: igmp_leave:add check of dev status in igmp_leavegroup Signed-off-by: wangchen

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

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

commit 78b64cc220285250c77f7d2038b0b46d16ba7791
Author: wangchen <wa...@xiaomi.com>
AuthorDate: Tue Sep 3 21:21:00 2024 +0800

    igmp_leave:add check of dev status in igmp_leavegroup
    Signed-off-by: wangchen <wa...@xiaomi.com>
---
 net/igmp/igmp_leave.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/igmp/igmp_leave.c b/net/igmp/igmp_leave.c
index 03318a04da..75559ecf6f 100644
--- a/net/igmp/igmp_leave.c
+++ b/net/igmp/igmp_leave.c
@@ -166,7 +166,7 @@ int igmp_leavegroup(struct net_driver_s *dev,
 
       /* Send a leave if the flag is set according to the state diagram */
 
-      if (IS_LASTREPORT(group->flags))
+      if (IFF_IS_UP(dev->d_flags) && IS_LASTREPORT(group->flags))
         {
           ninfo("Schedule Leave Group message\n");
           IGMP_STATINCR(g_netstats.igmp.leave_sched);


(nuttx) 02/03: igmp_group.c:add work_cancel_sync in igmp_grpfree Signed-off-by: wangchen

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

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

commit b791e27a8d7ce2d1d0b430d2f7285c067a62cb16
Author: wangchen <wa...@xiaomi.com>
AuthorDate: Fri Aug 30 16:07:57 2024 +0800

    igmp_group.c:add work_cancel_sync in igmp_grpfree
    Signed-off-by: wangchen <wa...@xiaomi.com>
---
 net/igmp/igmp_group.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/igmp/igmp_group.c b/net/igmp/igmp_group.c
index 1050a99e33..b84c085b8a 100644
--- a/net/igmp/igmp_group.c
+++ b/net/igmp/igmp_group.c
@@ -218,6 +218,10 @@ void igmp_grpfree(FAR struct net_driver_s *dev,
 
   wd_cancel(&group->wdog);
 
+  /* Cancel the workqueue */
+
+  work_cancel_sync(LPWORK, &group->work);
+
   /* Remove the group structure from the group list in the device structure */
 
   sq_rem((FAR sq_entry_t *)group, &dev->d_igmp_grplist);


(nuttx) 03/03: net:when work_cancel_sync is excuted,it releases net_lock

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

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

commit be17bf2f86aedecc0c33ceb78926f244025b0685
Author: wangchen <wa...@xiaomi.com>
AuthorDate: Thu Sep 26 15:05:17 2024 +0800

    net:when work_cancel_sync is excuted,it releases net_lock
    
    the modification is to solve the deadlock caused by work cancel not releasing netlock
    
    Signed-off-by: wangchen <wa...@xiaomi.com>
---
 net/igmp/igmp_group.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/net/igmp/igmp_group.c b/net/igmp/igmp_group.c
index b84c085b8a..9266c6700b 100644
--- a/net/igmp/igmp_group.c
+++ b/net/igmp/igmp_group.c
@@ -67,6 +67,7 @@
 
 #include "devif/devif.h"
 #include "igmp/igmp.h"
+#include "utils/utils.h"
 
 #ifdef CONFIG_NET_IGMP
 
@@ -212,6 +213,9 @@ FAR struct igmp_group_s *igmp_grpallocfind(FAR struct net_driver_s *dev,
 void igmp_grpfree(FAR struct net_driver_s *dev,
                   FAR struct igmp_group_s *group)
 {
+  unsigned int count;
+  int blresult;
+
   grpinfo("Free: %p flags: %02x\n", group, group->flags);
 
   /* Cancel the wdog */
@@ -220,7 +224,12 @@ void igmp_grpfree(FAR struct net_driver_s *dev,
 
   /* Cancel the workqueue */
 
+  blresult = net_breaklock(&count);
   work_cancel_sync(LPWORK, &group->work);
+  if (blresult >= 0)
+    {
+      net_restorelock(count);
+    }
 
   /* Remove the group structure from the group list in the device structure */