Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <20250516084842.26c80cb5@kernel.org>

diff --git a/a/1.txt b/N1/1.txt
index 52406ff..e20c30b 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -1,9 +1,37 @@
-On Fri, 16 May 2025 15:30:38 +0800 Jinjian Song wrote:
-> It seems that a judgment is made every time ccmni_inst[x] is used in the driver,
-> and the synchronization on the 2 way might have been done when NAPI triggers
-> polling by napi_schedule and when WWAN trigger dellink. 
-
-Synchronization is about ensuring that the condition validating
-by the if() remains true for as long as necessary.
-You need to wrap the read with READ_ONCE() and write with WRITE_ONCE().
-The rest if fine because netdev unregister sync against NAPIs in flight.
+>On Fri, 16 May 2025 15:30:38 +0800 Jinjian Song wrote:
+>> It seems that a judgment is made every time ccmni_inst[x] is used in the driver,
+>> and the synchronization on the 2 way might have been done when NAPI triggers
+>> polling by napi_schedule and when WWAN trigger dellink. 
+>
+>Synchronization is about ensuring that the condition validating
+>by the if() remains true for as long as necessary.
+>You need to wrap the read with READ_ONCE() and write with WRITE_ONCE().
+>The rest if fine because netdev unregister sync against NAPIs in flight.
+>
+
+Hi Jakub,
+  I think I got your point.
+  I can use the atomic_t usage in struct t7xx_ccmni to synchronization.
+  
+  static void t7xx_ccmni_wwan_dellink(...) {
+
+  [...]
+
+  if (WARN_ON(ctlb->ccmni_inst[if_id] != ccmni))
+    return;
+
+  unregister_netdevice(dev);
+
+  //Add here use this variable(ccmnii->usage) to synchronization
+
+  if (atomic_read(&ccmni->usage) == 0)
+     ccmni == NULL;
+
+  }
+
+  How about this modify?
+
+Thanks.
+
+Jinjian,
+Best Regards.
diff --git a/a/content_digest b/N1/content_digest
index 9c0e1fd..70d729f 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -1,9 +1,9 @@
  "ref\020250515031743.246178-1-jinjian.song@fibocom.com\0"
  "ref\020250515175251.58b5123f@kernel.org\0"
- "From\0Jakub Kicinski <kuba@kernel.org>\0"
+ "From\0Jinjian Song <jinjian.song@fibocom.com>\0"
  "Subject\0Re: [net v1] net: wwan: t7xx: Fix napi rx poll issue\0"
- "Date\0Fri, 16 May 2025 08:48:42 -0700\0"
- "To\0Jinjian Song <jinjian.song@fibocom.com>\0"
+ "Date\0Tue, 20 May 2025 15:05:34 +0800\0"
+ "To\0kuba@kernel.org\0"
  "Cc\0andrew+netdev@lunn.ch"
   angelogioacchino.delregno@collabora.com
   chandrashekar.devegowda@intel.com
@@ -15,6 +15,7 @@
   haijun.liu@mediatek.com
   helgaas@kernel.org
   horms@kernel.org
+  jinjian.song@fibocom.com
   johannes@sipsolutions.net
   linux-arm-kernel@lists.infradead.org
   linux-doc@vger.kernel.org
@@ -26,17 +27,46 @@
   netdev@vger.kernel.org
   pabeni@redhat.com
   ricardo.martinez@linux.intel.com
- " ryazanov.s.a@gmail.com\0"
+  ryazanov.s.a@gmail.com
+ " liuqf@fibocom.com\0"
  "\00:1\0"
  "b\0"
- "On Fri, 16 May 2025 15:30:38 +0800 Jinjian Song wrote:\n"
- "> It seems that a judgment is made every time ccmni_inst[x] is used in the driver,\n"
- "> and the synchronization on the 2 way might have been done when NAPI triggers\n"
- "> polling by napi_schedule and when WWAN trigger dellink. \n"
- "\n"
- "Synchronization is about ensuring that the condition validating\n"
- "by the if() remains true for as long as necessary.\n"
- "You need to wrap the read with READ_ONCE() and write with WRITE_ONCE().\n"
- The rest if fine because netdev unregister sync against NAPIs in flight.
+ ">On Fri, 16 May 2025 15:30:38 +0800 Jinjian Song wrote:\n"
+ ">> It seems that a judgment is made every time ccmni_inst[x] is used in the driver,\n"
+ ">> and the synchronization on the 2 way might have been done when NAPI triggers\n"
+ ">> polling by napi_schedule and when WWAN trigger dellink. \n"
+ ">\n"
+ ">Synchronization is about ensuring that the condition validating\n"
+ ">by the if() remains true for as long as necessary.\n"
+ ">You need to wrap the read with READ_ONCE() and write with WRITE_ONCE().\n"
+ ">The rest if fine because netdev unregister sync against NAPIs in flight.\n"
+ ">\n"
+ "\n"
+ "Hi Jakub,\n"
+ "  I think I got your point.\n"
+ "  I can use the atomic_t usage in struct t7xx_ccmni to synchronization.\n"
+ "  \n"
+ "  static void t7xx_ccmni_wwan_dellink(...) {\n"
+ "\n"
+ "  [...]\n"
+ "\n"
+ "  if (WARN_ON(ctlb->ccmni_inst[if_id] != ccmni))\n"
+ "    return;\n"
+ "\n"
+ "  unregister_netdevice(dev);\n"
+ "\n"
+ "  //Add here use this variable(ccmnii->usage) to synchronization\n"
+ "\n"
+ "  if (atomic_read(&ccmni->usage) == 0)\n"
+ "     ccmni == NULL;\n"
+ "\n"
+ "  }\n"
+ "\n"
+ "  How about this modify?\n"
+ "\n"
+ "Thanks.\n"
+ "\n"
+ "Jinjian,\n"
+ Best Regards.
 
-3f85cc9bdac3159d65b03882acd1e061dba62862ecf02d7110505e4029433d74
+d68500d1b57eb58409701aa8dba205213451d0052a6b7462d9334f042865cd51

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox