From: Chandra Seetharaman <sekharan@us.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: lse-tech@lists.sourceforge.net, stern@rowland.harvard.edu,
Douglas_Warzecha@dell.com, Abhay_Salunke@dell.com
Subject: [RFC][PATCH 6/7]: Do not register from callout
Date: Fri, 18 Nov 2005 18:20:54 -0800 [thread overview]
Message-ID: <1132366854.9617.19.camel@linuxchandra> (raw)
dcdbas re-registers itself from within the callout. This is incorrect in
two respects:
1. Callout should not register/unregister.
2. It re-registers while the block is still in the list, which
would corrupt the list.
This patch fixes the problem by registering the callout to be the last one
to be called when the event happens.
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-----
drivers/firmware/dcdbas.c | 19 ++++---------------
1 files changed, 4 insertions(+), 15 deletions(-)
Index: l2615-rc1-notifiers/drivers/firmware/dcdbas.c
===================================================================
--- l2615-rc1-notifiers.orig/drivers/firmware/dcdbas.c
+++ l2615-rc1-notifiers/drivers/firmware/dcdbas.c
@@ -483,26 +483,15 @@ static void dcdbas_host_control(void)
static int dcdbas_reboot_notify(struct notifier_block *nb, unsigned long code,
void *unused)
{
- static unsigned int notify_cnt = 0;
-
switch (code) {
case SYS_DOWN:
case SYS_HALT:
case SYS_POWER_OFF:
if (host_control_on_shutdown) {
/* firmware is going to perform host control action */
- if (++notify_cnt == 2) {
- printk(KERN_WARNING
- "Please wait for shutdown "
- "action to complete...\n");
- dcdbas_host_control();
- }
- /*
- * register again and initiate the host control
- * action on the second notification to allow
- * everyone that registered to be notified
- */
- register_reboot_notifier(nb);
+ printk(KERN_WARNING "Please wait for shutdown "
+ "action to complete...\n");
+ dcdbas_host_control();
}
break;
}
@@ -513,7 +502,7 @@ static int dcdbas_reboot_notify(struct n
static struct notifier_block dcdbas_reboot_nb = {
.notifier_call = dcdbas_reboot_notify,
.next = NULL,
- .priority = 0
+ .priority = INT_MIN
};
static DCDBAS_BIN_ATTR_RW(smi_data);
--
----------------------------------------------------------------------
Chandra Seetharaman | Be careful what you choose....
- sekharan@us.ibm.com | .......you may get it.
----------------------------------------------------------------------
reply other threads:[~2005-11-19 2:21 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=1132366854.9617.19.camel@linuxchandra \
--to=sekharan@us.ibm.com \
--cc=Abhay_Salunke@dell.com \
--cc=Douglas_Warzecha@dell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lse-tech@lists.sourceforge.net \
--cc=stern@rowland.harvard.edu \
/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