All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [PATCH 1/2] Don't remove_proc_entry under nklock
Date: Sun, 03 Jun 2007 11:23:59 +0200	[thread overview]
Message-ID: <466288AF.6080708@domain.hid> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 0 bytes --]



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: fix-iface-proc.patch --]
[-- Type: text/x-patch; name="fix-iface-proc.patch", Size: 2456 bytes --]

---
 ChangeLog             |    3 +++
 ksrc/nucleus/module.c |    5 ++---
 ksrc/nucleus/shadow.c |   14 +++++++++++---
 3 files changed, 16 insertions(+), 6 deletions(-)

Index: xenomai/ksrc/nucleus/shadow.c
===================================================================
--- xenomai.orig/ksrc/nucleus/shadow.c
+++ xenomai/ksrc/nucleus/shadow.c
@@ -115,7 +115,7 @@ static int nucleus_muxid = -1;
 
 void xnpod_declare_iface_proc(struct xnskentry *iface);
 
-void xnpod_discard_iface_proc(struct xnskentry *iface);
+void xnpod_discard_iface_proc(const char *iface);
 
 #ifdef CONFIG_XENO_OPT_PRIOCPL
 
@@ -2266,7 +2266,7 @@ int xnshadow_register_interface(const ch
 }
 
 /*
- * xnshadow_unregister_interface() -- Unregister a new skin/interface.
+ * xnshadow_unregister_interface() -- Unregister a skin/interface.
  * NOTE: an interface can be unregistered without its pod being
  * necessarily active.
  */
@@ -2287,7 +2287,15 @@ int xnshadow_unregister_interface(int mu
 		muxtable[muxid].magic = 0;
 		xnarch_atomic_set(&muxtable[muxid].refcnt, -1);
 #ifdef CONFIG_PROC_FS
-		xnpod_discard_iface_proc(muxtable + muxid);
+		{
+			const char *name = muxtable[muxid].name;
+			muxtable[muxid].proc = NULL;
+			xnlock_put_irqrestore(&nklock, s);
+
+			xnpod_discard_iface_proc(name);
+
+			return 0;
+		}
 #endif /* CONFIG_PROC_FS */
 	} else
 		err = -EBUSY;
Index: xenomai/ksrc/nucleus/module.c
===================================================================
--- xenomai.orig/ksrc/nucleus/module.c
+++ xenomai/ksrc/nucleus/module.c
@@ -939,10 +939,9 @@ void xnpod_declare_iface_proc(struct xns
 				    iface_proc_root);
 }
 
-void xnpod_discard_iface_proc(struct xnskentry *iface)
+void xnpod_discard_iface_proc(const char *iface_name)
 {
-	remove_proc_entry(iface->name, iface_proc_root);
-	iface->proc = NULL;
+	remove_proc_entry(iface_name, iface_proc_root);
 }
 
 #endif /* CONFIG_XENO_OPT_PERVASIVE */
Index: xenomai/ChangeLog
===================================================================
--- xenomai.orig/ChangeLog
+++ xenomai/ChangeLog
@@ -3,6 +3,9 @@
 	* ksrc/skins/rtdm/device.c (rtdm_dev_register): Unconditinally
 	check if mandatory close_nrt is provided.
 
+	* ksrc/nucleus/{module.c, shadow.c}: Move remove_proc_entry out of
+	nklock.
+
 2007-06-02  Philippe Gerum  <rpm@xenomai.org>
 
 	* ksrc/skins/psos+, src/skins/psos+, include/psos+/psos.h: Add

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

                 reply	other threads:[~2007-06-03  9:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=466288AF.6080708@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.