linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: Zhao Yakui <yakui.zhao@intel.com>
Cc: linux-acpi@vger.kernel.org
Subject: Re: Subject:ACPI: Send the reserved AC notification event to user space
Date: Wed, 14 May 2008 19:04:18 -0400	[thread overview]
Message-ID: <200805141904.18579.lenb@kernel.org> (raw)
In-Reply-To: <1210733239.7932.10.camel@yakui_zhao.sh.intel.com>

On Tuesday 13 May 2008, Zhao Yakui wrote:
> On Tue, 2008-05-13 at 20:55 -0400, Len Brown wrote:
> > On Friday 09 May 2008, Zhao Yakui wrote:
> > > Subject:ACPI: Send the reserved AC notification event to user space 
> > > >From : Zhao Yakui <yakui.zhao@intel.com>
> > > 
> > > On some laptops the bogus bios sends the reserved AC notification event(0x81)
> > > when the AC adapter is plugged/unplugged .It can't be sent to 
> > > user space, which causes that user space application can't 
> > > receive the AC adapter event. 
> > > So the reserved AC adapter event(0x81) is still sent to the user space 
> > > so that user space can receive the notification event.
> > > 
> > > Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
> > > ---
> > >  drivers/acpi/ac.c |    4 ++++
> > >  1 file changed, 4 insertions(+)
> > > 
> > > Index: linux-2.6/drivers/acpi/ac.c
> > > ===================================================================
> > > --- linux-2.6.orig/drivers/acpi/ac.c
> > > +++ linux-2.6/drivers/acpi/ac.c
> > > @@ -42,6 +42,7 @@
> > >  #define ACPI_AC_DEVICE_NAME		"AC Adapter"
> > >  #define ACPI_AC_FILE_STATE		"state"
> > >  #define ACPI_AC_NOTIFY_STATUS		0x80
> > > +#define ACPI_AC_NOTIFY_RESERVED		0x81
> > >  #define ACPI_AC_STATUS_OFFLINE		0x00
> > >  #define ACPI_AC_STATUS_ONLINE		0x01
> > >  #define ACPI_AC_STATUS_UNKNOWN		0xFF
> > > @@ -233,6 +234,9 @@ static void acpi_ac_notify(acpi_handle h
> > >  
> > >  	device = ac->device;
> > >  	switch (event) {
> > > +	case ACPI_AC_NOTIFY_RESERVED:
> > 
> > shouldn't this line above be "default:"
> If the follwing debug info is not needed, it will be OK to put it above
> the "default" branch.
>   > "Unsupported event [0x%x]\n", event. 
> When this line is put above the "AC_NOTIFY_STATUS" branch, it can send
> the notification event to user space while printing the debug info. 
> > and the default: below this patch be removed?
> Had better not remove the default branch. If other type of notification
> event is sent to AC device, the debug info can be printed. It will be
> helpful to find the root cause.
> > -Len
> > 
> > > +		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
> > > +				  "Unsupported event [0x%x]\n", event));
> > >  	case ACPI_AC_NOTIFY_STATUS:
> > >  	case ACPI_NOTIFY_BUS_CHECK:
> > >  	case ACPI_NOTIFY_DEVICE_CHECK:
> > > 
> > > 

Maybe I'm too tired to parse what you're saying.
What is the matter with doing it this way:
(this is now bugzilla 10695, btw.


diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 5b73f6a..831883b 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -233,6 +233,9 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
 
 	device = ac->device;
 	switch (event) {
+	default:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+				  "Unsupported event [0x%x]\n", event));
 	case ACPI_AC_NOTIFY_STATUS:
 	case ACPI_NOTIFY_BUS_CHECK:
 	case ACPI_NOTIFY_DEVICE_CHECK:
@@ -244,11 +247,6 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
 #ifdef CONFIG_ACPI_SYSFS_POWER
 		kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE);
 #endif
-		break;
-	default:
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-				  "Unsupported event [0x%x]\n", event));
-		break;
 	}
 
 	return;


  reply	other threads:[~2008-05-14 23:04 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-08  3:35 [PATCH] ACPI:avoid printing the error message that processor device is not present Zhao Yakui
2007-10-10  3:43 ` Len Brown
2007-10-15  1:19   ` Zhao Yakui
2007-11-07 12:34   ` [PATCH_1/4] :Add the _TPC throttling limit for TSS Zhao Yakui
2007-11-07 12:34   ` [PATCH_2/4] : Modify the ACPI I/O Access width Zhao Yakui
2007-11-07 12:35   ` [Patch_3/4]:Throttling control uses T-states returned by _TSS when _TSS exists Zhao Yakui
2007-11-07 12:35   ` [Patch_4/4] :Add MSR support for T-States Zhao Yakui
2007-11-08  0:56   ` [PATCH_1/4] :Add the _TPC throttling limit for TSS Zhao Yakui
2007-11-15  2:52     ` Len Brown
2007-11-08  0:56   ` [PATCH_2/4] : Modify the ACPI I/O Access width Zhao Yakui
2007-11-08  0:57   ` [Patch_3/4]:Throttling control uses T-states returned by _TSS when _TSS exists Zhao Yakui
2007-11-08  0:57   ` [Patch_4/4] :Add MSR support for T-States Zhao Yakui
2007-11-15  3:22     ` Len Brown
2007-11-08  1:25   ` [PATCH] [ACPI ]: Init PDC before getting throttling info Zhao Yakui
2007-11-15  8:41   ` [PATCH_2/7] : Modify the ACPI I/O Access width Zhao Yakui
2007-11-15  8:41   ` [Patch_3/7] ACPI: Not use calculated T-states from FADT.duty_width when _TSS exists Zhao Yakui
2007-11-15  8:41   ` [Patch_4/7] :Change the function interface for throttling control via PTC Zhao Yakui
2007-11-15  8:42   ` [Patch_5/7 ] :Throttling control uses T-states returned by _TSS when _TSS exists Zhao Yakui
2007-11-15  8:59   ` [PATCH_1/7] ACPI: Add the _TPC throttling limit for TSS Zhao Yakui
2007-11-15  9:01   ` [PATCH_2/7] ACPI: Modify the ACPI I/O Access width Zhao Yakui
2007-11-15  9:02   ` [PATCH_3/7] ACPI: Not use calculated T-states from FADT.duty_width when _TSS exists Zhao Yakui
2007-11-15  9:03   ` [PATCH_4/7] ACPI: Change the function interface for throttling control via PTC Zhao Yakui
2007-11-15  9:05   ` [PATCH_5/7] ACPI: Throttling control uses T-states returned by _TSS when _TSS exists Zhao Yakui
2007-11-15  9:05   ` [PATCH_6/7] ACPI: Init PDC before getting throttling info Zhao Yakui
2007-11-15  9:06   ` [PATCH_7/7] ACPI: Add MSR support for T-States Zhao Yakui
2007-11-15  9:18   ` [PATCH] ACPI: Disable all GPEs before re-enable interrupts Zhao Yakui
2008-05-09  9:22   ` Subject:ACPI: Send the reserved AC notification event to user space Zhao Yakui
2008-05-14  0:55     ` Len Brown
2008-05-14  2:47       ` Zhao Yakui
2008-05-14 23:04         ` Len Brown [this message]
2008-05-15 13:55           ` Zhao Yakui
2008-05-14  3:32   ` [PATCH]: ACPI: Disable Fixed_RTC event when installing RTC handler Zhao Yakui
2008-05-14  4:33     ` Len Brown

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=200805141904.18579.lenb@kernel.org \
    --to=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=yakui.zhao@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).