All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: linux-acpi@vger.kernel.org
Cc: rebort.moore@intel.com, astarikovskiy@suse.de
Subject: Bug: linux/acpi may execute notify handler that has been removed
Date: Thu, 27 Sep 2007 11:30:33 +0800	[thread overview]
Message-ID: <1190863833.26892.63.camel@acpi-hp.sh.intel.com> (raw)

Hi, all,

I found a bug that linux/acpi may execute notify handler that
has been removed.

When a system notify(0~0x7f) is received, linux/acpi will
first invoke the generic system notify handler (acpi_bus_notify)
and then invoke the per-device notify handler if present.

In my case, I add some code in acpi_bus_notify for battery
hotplug support, so that the generic system notify handler will
remove the battery device, including the per-device notify handler
acpi_battery_notify() when receiving notification
ACPI_NOTIFY_EJECT_REQUEST.
But linux/acpi invokes the per-device notify handler soon and
this breaks the system.

Further more, device hot-removal is not the only case to encounter
this bug. For example, linux/acpi receives a notification and adds it
in the workqueue, and then the driver(notify handler) is removed
before kacpid_notify invoke it...

Attachment is the patch for battery hotplug support.
Any ideas about this bug?

Thanks,
Rui

             reply	other threads:[~2007-09-27  3:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-27  3:30 Zhang Rui [this message]
2007-09-27  4:53 ` Bug: linux/acpi may execute notify handler that has been removed Alexey Starikovskiy
2007-09-27  5:03   ` Zhang Rui
2007-09-27  4:54 ` Shaohua Li
2007-09-27  6:24   ` Alexey Starikovskiy
2007-09-27  6:10     ` Shaohua Li
2007-09-27  6:33       ` Alexey Starikovskiy
2007-09-28  3:37         ` Zhang Rui

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=1190863833.26892.63.camel@acpi-hp.sh.intel.com \
    --to=rui.zhang@intel.com \
    --cc=astarikovskiy@suse.de \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rebort.moore@intel.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 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.