* RE: [Patch]fix EC GPE context error
@ 2003-11-04 6:50 Brown, Len
0 siblings, 0 replies; 6+ messages in thread
From: Brown, Len @ 2003-11-04 6:50 UTC (permalink / raw)
To: Ducrot Bruno, Sérgio Monteiro Basto; +Cc: Li, Shaohua, ACPI Developers
Looks like shaohua has attached a 2.4 version of the patch to the bug report:
http://bugzilla.kernel.org/show_bug.cgi?id=1171
> -----Original Message-----
> From: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> [mailto:acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of
> Ducrot Bruno
> Sent: Sunday, November 02, 2003 2:22 PM
> To: Sérgio Monteiro Basto
> Cc: Li, Shaohua; ACPI Developers
> Subject: Re: [ACPI] [Patch]fix EC GPE context error
>
>
> On Sun, Nov 02, 2003 at 07:29:38PM +0000, Sérgio Monteiro Basto wrote:
> > Hi
> > I can't apply this patch to 2.23-pre9 neither pre8 or pre7 .
> > I got one big rejected file (on osl.c I think)
> >
>
> That patch have been written for 2.6 series.
> For 2.4, since that touch a part a little bit too dependant of
> the OS (workqueues are onyl in 2.6 for example, and supersed task
> queues).
>
> I guess that you have to wait that someone kindly backport it.
>
> --
> Ducrot Bruno
>
> -- Which is worse: ignorance or apathy?
> -- Don't know. Don't care.
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive? Does it
> help you create better code? SHARE THE LOVE, and help us help
> YOU! Click Here: http://sourceforge.net/donate/
> _______________________________________________
> Acpi-devel mailing list
> Acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/acpi-devel
>
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [Patch]fix EC GPE context error
[not found] ` <571ACEFD467F7749BC50E0A98C17CDD8E84DC4-4yWAQGcml64gGBtAFL8yw7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2003-11-07 4:31 ` Sérgio Monteiro Basto
0 siblings, 0 replies; 6+ messages in thread
From: Sérgio Monteiro Basto @ 2003-11-07 4:31 UTC (permalink / raw)
To: Li, Shaohua; +Cc: acpi-devel
Hi
Sorry to say this, but laptop hangs again with this patch in pre-9.
when usb CDCEthernet, was gone down.
The facts are:
With 22-ac4 never hangs, I use this kernel, for my normally work, since
this release (2003-09-21) and I never had this kind of problems.
I just began use usb CDCEthernet with kernel 4.22, so I don't know if it
hangs or not before.
so I know the problem is began in 23-preX, (I think after pre7) or is
not been corrected like it does in ac4.
If the first choice, what I can test more?
If the second choice, could be one Andrew de Quincey patch's, that is
not applied.
Well I just don't resend the patch because I don't want make more
confusions , and I don't understand if you try (force) to not use the
patch. If Alan had applied it , I think that can be trustable. Not more
than that.
thanks
On Thu, 2003-11-06 at 02:40, Li, Shaohua wrote:
>
> Many thanks you let me know the result.
>
> Thanks,
> Shaohua
>
>
> > -----Original Message-----
> > From: Sérgio Monteiro Basto [mailto:sergiomb-hHo3WeeoaswVhHzd4jOs4w@public.gmane.org]
> > Sent: 2003年11月6日 11:20
> > To: Li, Shaohua
> > Cc: acpi-devel
> > Subject: RE: [ACPI] [Patch]fix EC GPE context error
> >
> > Hi,
> > The first tests seems ok, in 2.4.23-pre9, I had problems without this
> > patch, my laptop had hang again, when my usb cable modem has gone down
> > and I turn it off.
> > Now, with this patch, don't had hang anymore.
> > I will test it more time, if I have a problems, I will tell you.
> >
> > thanks
> >
> > On Mon, 2003-11-03 at 13:29, Li, Shaohua wrote:
> > >
> > > Hi,
> > > I have attached a patch against 2.4 in bugzilla 1171, please help
> > test. Many thanks.
> > >
> > > Thanks,
> > > Shaohua
> > >
> > >
> > > > -----Original Message-----
> > > > From: Sérgio Monteiro Basto [mailto:sergiomb-hHo3WeeoaswVhHzd4jOs4w@public.gmane.org]
> > > > Sent: 2003年11月3日 3:30
> > > > To: Li, Shaohua
> > > > Cc: ACPI Developers
> > > > Subject: Re: [ACPI] [Patch]fix EC GPE context error
> > > >
> > > > Hi
> > > > I can't apply this patch to 2.23-pre9 neither pre8 or pre7 .
> > > > I got one big rejected file (on osl.c I think)
> > > >
> > > > thanks
> > > >
> > > > On Fri, 2003-10-31 at 08:42, Li, Shaohua wrote:
> > > > > Hi,
> > > > >
> > > > > 2.6-test9 has a regression. Specifically, the EC GPE context
> > fix
> > > > > has error. This new patch is to replace the old one. The patch is
> > > > > against 2.6-test7, and has passed under T40 and ASUS M2400. You can
> > find
> > > > > detail info in osdl bugzilla 1171. Please help test.
> > > > >
> > > > >
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Shaohua
> > > > >
> > > > >
> > > > >
> > > > --
> > > > SérgioMB
> > > > email: sergiomb-hHo3WeeoaswVhHzd4jOs4w@public.gmane.org
> > > >
> > > > Who gives me one shell, give me everything.
> > >
> > --
> > SérgioMB
> > email: sergiomb-hHo3WeeoaswVhHzd4jOs4w@public.gmane.org
> >
> > Who gives me one shell, give me everything.
>
--
SérgioMB
email: sergiomb-hHo3WeeoaswVhHzd4jOs4w@public.gmane.org
Who gives me one shell, give me everything.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [Patch]fix EC GPE context error
[not found] ` <571ACEFD467F7749BC50E0A98C17CDD8E84DBF-4yWAQGcml64gGBtAFL8yw7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2003-11-06 3:19 ` Sérgio Monteiro Basto
0 siblings, 0 replies; 6+ messages in thread
From: Sérgio Monteiro Basto @ 2003-11-06 3:19 UTC (permalink / raw)
To: Li, Shaohua; +Cc: acpi-devel
Hi,
The first tests seems ok, in 2.4.23-pre9, I had problems without this
patch, my laptop had hang again, when my usb cable modem has gone down
and I turn it off.
Now, with this patch, don't had hang anymore.
I will test it more time, if I have a problems, I will tell you.
thanks
On Mon, 2003-11-03 at 13:29, Li, Shaohua wrote:
>
> Hi,
> I have attached a patch against 2.4 in bugzilla 1171, please help test. Many thanks.
>
> Thanks,
> Shaohua
>
>
> > -----Original Message-----
> > From: Sérgio Monteiro Basto [mailto:sergiomb-hHo3WeeoaswVhHzd4jOs4w@public.gmane.org]
> > Sent: 2003年11月3日 3:30
> > To: Li, Shaohua
> > Cc: ACPI Developers
> > Subject: Re: [ACPI] [Patch]fix EC GPE context error
> >
> > Hi
> > I can't apply this patch to 2.23-pre9 neither pre8 or pre7 .
> > I got one big rejected file (on osl.c I think)
> >
> > thanks
> >
> > On Fri, 2003-10-31 at 08:42, Li, Shaohua wrote:
> > > Hi,
> > >
> > > 2.6-test9 has a regression. Specifically, the EC GPE context fix
> > > has error. This new patch is to replace the old one. The patch is
> > > against 2.6-test7, and has passed under T40 and ASUS M2400. You can find
> > > detail info in osdl bugzilla 1171. Please help test.
> > >
> > >
> > >
> > > Thanks,
> > >
> > > Shaohua
> > >
> > >
> > >
> > --
> > SérgioMB
> > email: sergiomb-hHo3WeeoaswVhHzd4jOs4w@public.gmane.org
> >
> > Who gives me one shell, give me everything.
>
--
SérgioMB
email: sergiomb-hHo3WeeoaswVhHzd4jOs4w@public.gmane.org
Who gives me one shell, give me everything.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Patch]fix EC GPE context error
[not found] ` <571ACEFD467F7749BC50E0A98C17CDD8D5FDD0-4yWAQGcml64gGBtAFL8yw7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2003-11-02 19:29 ` Sérgio Monteiro Basto
[not found] ` <1067801379.1593.5.camel-4/PLUo9XfK/yXfm4dIG/yWZHpeb/A1Y/@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Sérgio Monteiro Basto @ 2003-11-02 19:29 UTC (permalink / raw)
To: Li, Shaohua; +Cc: ACPI Developers
Hi
I can't apply this patch to 2.23-pre9 neither pre8 or pre7 .
I got one big rejected file (on osl.c I think)
thanks
On Fri, 2003-10-31 at 08:42, Li, Shaohua wrote:
> Hi,
>
> 2.6-test9 has a regression. Specifically, the EC GPE context fix
> has error. This new patch is to replace the old one. The patch is
> against 2.6-test7, and has passed under T40 and ASUS M2400. You can find
> detail info in osdl bugzilla 1171. Please help test.
>
>
>
> Thanks,
>
> Shaohua
>
>
>
--
SérgioMB
email: sergiomb-hHo3WeeoaswVhHzd4jOs4w@public.gmane.org
Who gives me one shell, give me everything.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Patch]fix EC GPE context error
[not found] ` <1067801379.1593.5.camel-4/PLUo9XfK/yXfm4dIG/yWZHpeb/A1Y/@public.gmane.org>
@ 2003-11-02 19:22 ` Ducrot Bruno
0 siblings, 0 replies; 6+ messages in thread
From: Ducrot Bruno @ 2003-11-02 19:22 UTC (permalink / raw)
To: Sérgio Monteiro Basto; +Cc: Li, Shaohua, ACPI Developers
On Sun, Nov 02, 2003 at 07:29:38PM +0000, Sérgio Monteiro Basto wrote:
> Hi
> I can't apply this patch to 2.23-pre9 neither pre8 or pre7 .
> I got one big rejected file (on osl.c I think)
>
That patch have been written for 2.6 series.
For 2.4, since that touch a part a little bit too dependant of
the OS (workqueues are onyl in 2.6 for example, and supersed task
queues).
I guess that you have to wait that someone kindly backport it.
--
Ducrot Bruno
-- Which is worse: ignorance or apathy?
-- Don't know. Don't care.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Patch]fix EC GPE context error
@ 2003-10-31 8:42 Li, Shaohua
[not found] ` <571ACEFD467F7749BC50E0A98C17CDD8D5FDD0-4yWAQGcml64gGBtAFL8yw7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Li, Shaohua @ 2003-10-31 8:42 UTC (permalink / raw)
To: ACPI Developers
[-- Attachment #1.1: Type: text/plain, Size: 310 bytes --]
Hi,
2.6-test9 has a regression. Specifically, the EC GPE context fix
has error. This new patch is to replace the old one. The patch is
against 2.6-test7, and has passed under T40 and ASUS M2400. You can find
detail info in osdl bugzilla 1171. Please help test.
Thanks,
Shaohua
[-- Attachment #1.2: Type: text/html, Size: 2038 bytes --]
[-- Attachment #2: ec-gpe1.patch --]
[-- Type: application/octet-stream, Size: 6569 bytes --]
diff -Nur linux-2.6.0-test7/drivers/acpi/acpi_ksyms.c linux-2.6.0-test7.new/drivers/acpi/acpi_ksyms.c
--- linux-2.6.0-test7/drivers/acpi/acpi_ksyms.c 2003-10-09 03:24:03.000000000 +0800
+++ linux-2.6.0-test7.new/drivers/acpi/acpi_ksyms.c 2003-10-31 08:25:23.000000000 +0800
@@ -106,7 +106,7 @@
EXPORT_SYMBOL(acpi_os_create_semaphore);
EXPORT_SYMBOL(acpi_os_delete_semaphore);
EXPORT_SYMBOL(acpi_os_wait_semaphore);
-
+EXPORT_SYMBOL(acpi_os_wait_events_complete);
EXPORT_SYMBOL(acpi_os_read_pci_configuration);
/* ACPI Utilities (acpi_utils.c) */
diff -Nur linux-2.6.0-test7/drivers/acpi/ec.c linux-2.6.0-test7.new/drivers/acpi/ec.c
--- linux-2.6.0-test7/drivers/acpi/ec.c 2003-10-09 03:24:07.000000000 +0800
+++ linux-2.6.0-test7.new/drivers/acpi/ec.c 2003-10-31 08:30:08.000000000 +0800
@@ -589,12 +589,15 @@
we now have the *real* EC info, so kill the makeshift one.*/
acpi_evaluate_integer(ec->handle, "_UID", NULL, &uid);
if (ec_ecdt && ec_ecdt->uid == uid) {
+ acpi_disable_gpe(NULL, ec_ecdt->gpe_bit, ACPI_NOT_ISR);
+ acpi_os_wait_events_complete(ec_ecdt);
acpi_remove_address_space_handler(ACPI_ROOT_OBJECT,
ACPI_ADR_SPACE_EC, &acpi_ec_space_handler);
acpi_remove_gpe_handler(NULL, ec_ecdt->gpe_bit, &acpi_ec_gpe_handler);
kfree(ec_ecdt);
+ ec_ecdt = NULL;
}
/* Get GPE bit assignment (EC events). */
@@ -751,6 +754,9 @@
ec = acpi_driver_data(device);
+ acpi_disable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR);
+ acpi_os_wait_events_complete(ec);
+
status = acpi_remove_address_space_handler(ec->handle,
ACPI_ADR_SPACE_EC, &acpi_ec_space_handler);
if (ACPI_FAILURE(status))
diff -Nur linux-2.6.0-test7/drivers/acpi/osl.c linux-2.6.0-test7.new/drivers/acpi/osl.c
--- linux-2.6.0-test7/drivers/acpi/osl.c 2003-10-09 03:24:27.000000000 +0800
+++ linux-2.6.0-test7.new/drivers/acpi/osl.c 2003-10-31 08:42:59.000000000 +0800
@@ -56,6 +56,7 @@
{
OSD_EXECUTION_CALLBACK function;
void *context;
+ struct list_head next;
};
@@ -604,25 +605,38 @@
#endif /*CONFIG_ACPI_PCI*/
-static void
-acpi_os_execute_deferred (
- void *context)
-{
- struct acpi_os_dpc *dpc = NULL;
+/*
+ * ACPI use keventd to handle SCI interrupt. Every SCI interrupt will add a new
+ * entry in the acpi events queue. And keventd will execute the queue. The
+ * purpose to implement the new queue is to provide a mechanism in which we can
+ * wait for completing SCI interrupt handling. In this way, before EC replaced
+ * ECDT, it can guarantee all SCI interrupts with ECDT as its context complete.
+ */
+static LIST_HEAD(acpi_events_list);
+static spinlock_t acpi_events_list_spinlock = SPIN_LOCK_UNLOCKED;
+static struct work_struct task;
+static int first_acpi_event = 1;
+
+static void
+acpi_do_task_queue()
+{
+ struct list_head *p;
+ struct acpi_os_dpc *dpc;
+ unsigned long flags = 0;
+
+ spin_lock_irqsave(&acpi_events_list_spinlock, flags);
+ while (!list_empty(&acpi_events_list)) {
+ p = acpi_events_list.next; /* get first item */
+ dpc = (struct acpi_os_dpc *)list_entry(p, struct acpi_os_dpc, next);
+ list_del(p);
+ spin_unlock_irqrestore(&acpi_events_list_spinlock, flags);
- ACPI_FUNCTION_TRACE ("os_execute_deferred");
+ dpc->function(dpc->context);
+ kfree(dpc);
- dpc = (struct acpi_os_dpc *) context;
- if (!dpc) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid (NULL) context.\n"));
- return_VOID;
+ spin_lock_irqsave(&acpi_events_list_spinlock, flags);
}
-
- dpc->function(dpc->context);
-
- kfree(dpc);
-
- return_VOID;
+ spin_unlock_irqrestore(&acpi_events_list_spinlock, flags);
}
acpi_status
@@ -633,45 +647,66 @@
{
acpi_status status = AE_OK;
struct acpi_os_dpc *dpc;
- struct work_struct *task;
- ACPI_FUNCTION_TRACE ("os_queue_for_execution");
+ ACPI_FUNCTION_TRACE ("acpi_os_queue_for_execution");
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Scheduling function [%p(%p)] for deferred execution.\n", function, context));
if (!function)
return_ACPI_STATUS (AE_BAD_PARAMETER);
- /*
- * Allocate/initialize DPC structure. Note that this memory will be
- * freed by the callee. The kernel handles the tq_struct list in a
- * way that allows us to also free its memory inside the callee.
- * Because we may want to schedule several tasks with different
- * parameters we can't use the approach some kernel code uses of
- * having a static tq_struct.
- * We can save time and code by allocating the DPC and tq_structs
- * from the same memory.
- */
-
- dpc = kmalloc(sizeof(struct acpi_os_dpc)+sizeof(struct work_struct), GFP_ATOMIC);
+ dpc = kmalloc(sizeof(struct acpi_os_dpc), GFP_ATOMIC);
if (!dpc)
return_ACPI_STATUS (AE_NO_MEMORY);
dpc->function = function;
dpc->context = context;
+ INIT_LIST_HEAD(&dpc->next);
+
+ spin_lock(&acpi_events_list_spinlock);
- task = (void *)(dpc+1);
- INIT_WORK(task, acpi_os_execute_deferred, (void*)dpc);
-
- if (!schedule_work(task)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Call to schedule_work() failed.\n"));
- kfree(dpc);
- status = AE_ERROR;
+ list_add_tail(&dpc->next, &acpi_events_list);
+ if (first_acpi_event || (!task.pending)) {
+ INIT_WORK(&task, acpi_do_task_queue, NULL);
+ if (!schedule_work(&task)) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Call to schedule_work() failed.\n"));
+ kfree(dpc);
+ status = AE_ERROR;
+ }
+ first_acpi_event = 0;
}
+ spin_unlock(&acpi_events_list_spinlock);
+
return_ACPI_STATUS (status);
}
+void
+acpi_os_wait_events_complete(
+ void * context)
+{
+ unsigned long flags;
+ int over = 0;
+ struct list_head * node, * next;
+
+ while (!over) {
+ over = 1;
+ spin_lock_irqsave(&acpi_events_list_spinlock, flags);
+ list_for_each_safe(node, next, &acpi_events_list) {
+ struct acpi_os_dpc *dpc = container_of(node, struct acpi_os_dpc, next);
+ if (dpc->context == context) {
+ over = 0;
+ break;
+ }
+ }
+
+ spin_unlock_irqrestore(&acpi_events_list_spinlock, flags);
+ if (over)
+ return;
+ acpi_do_task_queue();
+ }
+}
+
/*
* Allocate the memory for a spinlock and initialize it.
*/
diff -Nur linux-2.6.0-test7/include/acpi/acpiosxf.h linux-2.6.0-test7.new/include/acpi/acpiosxf.h
--- linux-2.6.0-test7/include/acpi/acpiosxf.h 2003-10-09 03:24:00.000000000 +0800
+++ linux-2.6.0-test7.new/include/acpi/acpiosxf.h 2003-10-31 08:22:27.000000000 +0800
@@ -213,6 +213,10 @@
void *context);
void
+acpi_os_wait_events_complete(
+ void * context);
+
+void
acpi_os_sleep (
u32 seconds,
u32 milliseconds);
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-11-07 4:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-04 6:50 [Patch]fix EC GPE context error Brown, Len
[not found] <571ACEFD467F7749BC50E0A98C17CDD8E84DC4@pdsmsx403.ccr.corp.intel.com>
[not found] ` <571ACEFD467F7749BC50E0A98C17CDD8E84DC4-4yWAQGcml64gGBtAFL8yw7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2003-11-07 4:31 ` Sérgio Monteiro Basto
[not found] <571ACEFD467F7749BC50E0A98C17CDD8E84DBF@pdsmsx403.ccr.corp.intel.com>
[not found] ` <571ACEFD467F7749BC50E0A98C17CDD8E84DBF-4yWAQGcml64gGBtAFL8yw7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2003-11-06 3:19 ` Sérgio Monteiro Basto
-- strict thread matches above, loose matches on Subject: below --
2003-10-31 8:42 Li, Shaohua
[not found] ` <571ACEFD467F7749BC50E0A98C17CDD8D5FDD0-4yWAQGcml64gGBtAFL8yw7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2003-11-02 19:29 ` Sérgio Monteiro Basto
[not found] ` <1067801379.1593.5.camel-4/PLUo9XfK/yXfm4dIG/yWZHpeb/A1Y/@public.gmane.org>
2003-11-02 19:22 ` Ducrot Bruno
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.