public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
To: robert.richter@amd.com
Cc: mingo@elte.hu, oprofile-list@lists.sf.net,
	linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Subject: v2 [patch 1/1] Do not unregister_cpu_notifier in case of wrong state
Date: Wed, 30 Mar 2011 10:06:38 +0200	[thread overview]
Message-ID: <20110330080923.413595315@linux.vnet.ibm.com> (raw)
In-Reply-To: 20110330080637.110679740@linux.vnet.ibm.com

[-- Attachment #1: hwsampler-shutdown.patch --]
[-- Type: text/plain, Size: 848 bytes --]

From: Heinz Graalfs <graalfs@linux.vnet.ibm.com>

This patch avoids calling unregister_cpu_notifier() in case
hwsampler_shutdown() is invoked in wrong state. 
---
 arch/s390/oprofile/hwsampler.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Index: 2.6.39/arch/s390/oprofile/hwsampler.c
===================================================================
--- 2.6.39.orig/arch/s390/oprofile/hwsampler.c
+++ 2.6.39/arch/s390/oprofile/hwsampler.c
@@ -1142,12 +1142,15 @@ int hwsampler_shutdown()
 		}
 
 		unregister_external_interrupt(0x1407, hws_ext_handler);
-		hws_state = HWS_INIT;
+		hws_state = 0;
+
+		mutex_unlock(&hws_sem);
+		unregister_cpu_notifier(&hws_cpu_notifier);
+
 		rc = 0;
+	} else {
+		mutex_unlock(&hws_sem);
 	}
-	mutex_unlock(&hws_sem);
-
-	unregister_cpu_notifier(&hws_cpu_notifier);
 
 	return rc;
 }


      reply	other threads:[~2011-03-30  8:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30  8:06 v2 [patch 0/1] hwsampler_shutdown Heinz Graalfs
2011-03-30  8:06 ` Heinz Graalfs [this message]

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=20110330080923.413595315@linux.vnet.ibm.com \
    --to=graalfs@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oprofile-list@lists.sf.net \
    --cc=robert.richter@amd.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox