mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: ACPI mailing list <acpi-devel@lists.sourceforge.net>,
	kernel list <linux-kernel@vger.kernel.org>,
	Len Brown <len.brown@intel.com>
Cc: seife@suse.de
Subject: Big problems in acpi/event.c (needs seq_printf?)
Date: Mon, 19 Apr 2004 18:51:03 +0200	[thread overview]
Message-ID: <20040419165103.GA27589@elf.ucw.cz> (raw)

Hi!

acpi/event.c needs some heavy facelifting.

This one is needed so that return value (ERESTARTSYS) is propagated
from bus_receive_event(). If this is not done, suspend/resume causes
cat /proc/acpi/event to fail with -EIO. Please apply.

However, there are more problems with event.c:

* it uses spinlock_irq to protect event_is_open(). That's huge
overkill, atomic_t should be enough here, and it is never accessed
from interrupt anyway.

* its racy w.r.t. concurent readers (and yes, you *can* have concurent
readers, think threads). acpi_system_read_event() uses static
variables, without any locking. Probably seq_printf() converstion is
needed.
								Pavel

--- clean/drivers/acpi/event.c	2003-02-15 18:51:16.000000000 +0100
+++ linux/drivers/acpi/event.c	2004-04-19 18:43:58.000000000 +0200
@@ -63,9 +58,8 @@
 			return_VALUE(-EAGAIN);
 
 		result = acpi_bus_receive_event(&event);
-		if (result) {
-			return_VALUE(-EIO);
-		}
+		if (result)
+			return_VALUE(result);
 
 		chars_remaining = sprintf(str, "%s %s %08x %08x\n", 
 			event.device_class?event.device_class:"<unknown>",

-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

                 reply	other threads:[~2004-04-19 16:51 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=20040419165103.GA27589@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=acpi-devel@lists.sourceforge.net \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seife@suse.de \
    /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

all inboxes | Powered by JetHome®