All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Bryant <nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org>
To: Len Brown <len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: "ACPI Developers"
	<acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	"Linux Kernel list"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"Shaohua Li" <shaohua.li-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"Stefan Dösinger" <stefandoesinger-RbZlAiThDcE@public.gmane.org>
Subject: Re: [PATCH][RFC] fix ACPI IRQ routing after S3 suspend
Date: Wed, 04 Aug 2004 11:57:57 -0400	[thread overview]
Message-ID: <41110785.4040000@optonline.net> (raw)
In-Reply-To: <1091588367.2297.49.camel@dhcppc4>

[-- Attachment #1: Type: text/plain, Size: 862 bytes --]


Len-

Attached is a respin based on your comments.

Len Brown wrote:

>> static int
>>+acpi_pci_link_resume (
>>+	struct acpi_pci_link	*link)
>>+{
>>+	ACPI_FUNCTION_TRACE("acpi_pci_link_resume");
>>+	
>>+	if (link->irq.active && link->irq.setonboot)
>>    
>>
>
>I think that before this change, irq.setonboot was a NOP
>and a candidate for being deleted.  However, it does seem
>to have a use here, where we want to re-program only those
>links that were programmed.  ("setonboot" would probably
>be better called "initialized" or "programmed").
>  
>
Agree, changed to "initialized"

>> static int __init acpi_pci_link_init (void)
>> {
>> 	ACPI_FUNCTION_TRACE("acpi_pci_link_init");
>> 
>>-	if (acpi_pci_disabled)
>>+	if (acpi_disabled || acpi_noirq)
>>    
>>
>
>I think that testing acpi_noirq is sufficient here.
>  
>
I'll take your word for it. changed.

[-- Attachment #2: acpi-fixes.patch2 --]
[-- Type: text/plain, Size: 5742 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/08/04 11:32:42-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org 
#   [ACPI] drivers/acpi/pci_link.c: misc cleanups per suggestions
# 
# drivers/acpi/pci_link.c
#   2004/08/04 11:32:33-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org +6 -8
#   [ACPI] drivers/acpi/pci_link.c: misc cleanups per suggestions
# 
# ChangeSet
#   2004/08/04 10:53:42-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org 
#   Merge optonline.net:/home/nathan/linux-acpi-test-2.6.8
#   into optonline.net:/home/nathan/acpi-fixes
# 
# BitKeeper/etc/ignore
#   2004/08/04 10:53:30-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org +1 -2
#   auto-union
# 
# ChangeSet
#   2004/08/03 19:37:56-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org 
#   drivers/acpi/pci_link.c: use device_initcall(irqrouter_init_sysfs);
# 
# drivers/acpi/pci_link.c
#   2004/08/03 19:37:47-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org +13 -3
#   use device_initcall(irqrouter_init_sysfs);
# 
# ChangeSet
#   2004/08/03 18:09:20-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org 
#   fix ACPI_FUNCTION_TRACE("irqrouter_resume");
# 
# drivers/acpi/pci_link.c
#   2004/08/03 18:09:12-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org +1 -1
#   fix ACPI_FUNCTION_TRACE("irqrouter_resume");
# 
# ChangeSet
#   2004/08/03 18:03:39-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org 
#   drivers/acpi/pci_link.c: register us as a sys_device so that we can get
#   resume callbacks and restore interrupt state. Fixes interrupt problems
#   reported on the mailing lists:
#   
#   http://marc.theaimsgroup.com/?l=acpi4linux&m=109142999328643&w=2
# 
# drivers/acpi/pci_link.c
#   2004/08/03 18:03:31-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org +51 -14
#   drivers/acpi/pci_link.c: register us as a sys_device so that we can get
#   resume callbacks and restore interrupt state. Fixes interrupt problems
#   reported on the mailing lists:
#   
#   http://marc.theaimsgroup.com/?l=acpi4linux&m=109142999328643&w=2
# 
# ChangeSet
#   2004/08/02 20:41:54-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org 
#   [ACPI] drivers/acpi/pci_link.c: add acpi_pci_link_resume(), which will be
#   called when resuming from a suspend state that needs IRQ routing to be
#   restored. This fixes issues reported on the mailing lists, e.g.:
#   
#   http://marc.theaimsgroup.com/?l=acpi4linux&m=109142999328643&w=2
# 
# drivers/acpi/pci_link.c
#   2004/08/02 20:41:45-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org +23 -0
#   [ACPI] drivers/acpi/pci_link.c: add acpi_pci_link_resume(), which will be
#   called when resuming from a suspend state that needs IRQ routing to be
#   restored. This fixes issues reported on the mailing lists, e.g.:
#   
#   http://marc.theaimsgroup.com/?l=acpi4linux&m=109142999328643&w=2
# 
# BitKeeper/etc/ignore
#   2004/08/02 20:41:45-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org +2 -0
#   Added Module.symvers drivers/acpi/pci_link.c~ to the ignore list
# 
diff -Nru a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
--- a/drivers/acpi/pci_link.c	2004-08-04 11:33:50 -04:00
+++ b/drivers/acpi/pci_link.c	2004-08-04 11:33:50 -04:00
@@ -29,6 +29,7 @@
  *	   for IRQ management (e.g. start()->_SRS).
  */
 
+#include <linux/sysdev.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -71,7 +72,7 @@
 	u8			active;			/* Current IRQ */
 	u8			edge_level;		/* All IRQs */
 	u8			active_high_low;	/* All IRQs */
-	u8			setonboot;
+	u8			initialized;
 	u8			resource_type;
 	u8			possible_count;
 	u8			possible[ACPI_PCI_LINK_MAX_POSSIBLE];
@@ -517,7 +518,7 @@
 
 	ACPI_FUNCTION_TRACE("acpi_pci_link_allocate");
 
-	if (link->irq.setonboot)
+	if (link->irq.initialized)
 		return_VALUE(0);
 
 	/*
@@ -571,7 +572,7 @@
 			acpi_device_bid(link->device), link->irq.active);
 	}
 
-	link->irq.setonboot = 1;
+	link->irq.initialized = 1;
 
 	return_VALUE(0);
 }
@@ -695,6 +696,42 @@
 
 
 static int
+acpi_pci_link_resume (
+	struct acpi_pci_link	*link)
+{
+	ACPI_FUNCTION_TRACE("acpi_pci_link_resume");
+	
+	if (link->irq.active && link->irq.initialized)
+		return_VALUE(acpi_pci_link_set(link, link->irq.active));
+	else
+		return_VALUE(0);
+}
+
+
+static int
+irqrouter_resume(
+	struct sys_device *dev)
+{
+	struct list_head        *node = NULL;
+	struct acpi_pci_link    *link = NULL;
+
+	ACPI_FUNCTION_TRACE("irqrouter_resume");
+
+	list_for_each(node, &acpi_link.entries) {
+
+		link = list_entry(node, struct acpi_pci_link, node);
+		if (!link) {
+			ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n"));
+			continue;
+		}
+
+		acpi_pci_link_resume(link);
+	}
+	return_VALUE(0);
+}
+
+
+static int
 acpi_pci_link_remove (
 	struct acpi_device	*device,
 	int			type)
@@ -786,11 +823,42 @@
 __setup("acpi_irq_balance", acpi_irq_balance_set);
 
 
+static struct sysdev_class irqrouter_sysdev_class = {
+        set_kset_name("irqrouter"),
+        .resume = irqrouter_resume,
+};
+
+
+static struct sys_device device_irqrouter = {
+	.id     = 0,
+	.cls    = &irqrouter_sysdev_class,
+};
+
+
+static int __init irqrouter_init_sysfs(void)
+{
+	int error;
+
+	ACPI_FUNCTION_TRACE("irqrouter_init_sysfs");
+
+	if (acpi_disabled || acpi_noirq)
+		return_VALUE(0);
+
+        error = sysdev_class_register(&irqrouter_sysdev_class);
+        if (!error)
+        	error = sysdev_register(&device_irqrouter);
+
+        return_VALUE(error);
+}                                        
+
+device_initcall(irqrouter_init_sysfs);
+
+
 static int __init acpi_pci_link_init (void)
 {
 	ACPI_FUNCTION_TRACE("acpi_pci_link_init");
 
-	if (acpi_pci_disabled)
+	if (acpi_noirq)
 		return_VALUE(0);
 
 	acpi_link.count = 0;

WARNING: multiple messages have this Message-ID (diff)
From: Nathan Bryant <nbryant@optonline.net>
To: Len Brown <len.brown@intel.com>
Cc: "ACPI Developers" <acpi-devel@lists.sourceforge.net>,
	"Linux Kernel list" <linux-kernel@vger.kernel.org>,
	"Shaohua Li" <shaohua.li@intel.com>,
	"Stefan Dösinger" <stefandoesinger@gmx.at>
Subject: Re: [PATCH][RFC] fix ACPI IRQ routing after S3 suspend
Date: Wed, 04 Aug 2004 11:57:57 -0400	[thread overview]
Message-ID: <41110785.4040000@optonline.net> (raw)
In-Reply-To: <1091588367.2297.49.camel@dhcppc4>

[-- Attachment #1: Type: text/plain, Size: 862 bytes --]


Len-

Attached is a respin based on your comments.

Len Brown wrote:

>> static int
>>+acpi_pci_link_resume (
>>+	struct acpi_pci_link	*link)
>>+{
>>+	ACPI_FUNCTION_TRACE("acpi_pci_link_resume");
>>+	
>>+	if (link->irq.active && link->irq.setonboot)
>>    
>>
>
>I think that before this change, irq.setonboot was a NOP
>and a candidate for being deleted.  However, it does seem
>to have a use here, where we want to re-program only those
>links that were programmed.  ("setonboot" would probably
>be better called "initialized" or "programmed").
>  
>
Agree, changed to "initialized"

>> static int __init acpi_pci_link_init (void)
>> {
>> 	ACPI_FUNCTION_TRACE("acpi_pci_link_init");
>> 
>>-	if (acpi_pci_disabled)
>>+	if (acpi_disabled || acpi_noirq)
>>    
>>
>
>I think that testing acpi_noirq is sufficient here.
>  
>
I'll take your word for it. changed.

[-- Attachment #2: acpi-fixes.patch2 --]
[-- Type: text/plain, Size: 5404 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/08/04 11:32:42-04:00 nbryant@optonline.net 
#   [ACPI] drivers/acpi/pci_link.c: misc cleanups per suggestions
# 
# drivers/acpi/pci_link.c
#   2004/08/04 11:32:33-04:00 nbryant@optonline.net +6 -8
#   [ACPI] drivers/acpi/pci_link.c: misc cleanups per suggestions
# 
# ChangeSet
#   2004/08/04 10:53:42-04:00 nbryant@optonline.net 
#   Merge optonline.net:/home/nathan/linux-acpi-test-2.6.8
#   into optonline.net:/home/nathan/acpi-fixes
# 
# BitKeeper/etc/ignore
#   2004/08/04 10:53:30-04:00 nbryant@optonline.net +1 -2
#   auto-union
# 
# ChangeSet
#   2004/08/03 19:37:56-04:00 nbryant@optonline.net 
#   drivers/acpi/pci_link.c: use device_initcall(irqrouter_init_sysfs);
# 
# drivers/acpi/pci_link.c
#   2004/08/03 19:37:47-04:00 nbryant@optonline.net +13 -3
#   use device_initcall(irqrouter_init_sysfs);
# 
# ChangeSet
#   2004/08/03 18:09:20-04:00 nbryant@optonline.net 
#   fix ACPI_FUNCTION_TRACE("irqrouter_resume");
# 
# drivers/acpi/pci_link.c
#   2004/08/03 18:09:12-04:00 nbryant@optonline.net +1 -1
#   fix ACPI_FUNCTION_TRACE("irqrouter_resume");
# 
# ChangeSet
#   2004/08/03 18:03:39-04:00 nbryant@optonline.net 
#   drivers/acpi/pci_link.c: register us as a sys_device so that we can get
#   resume callbacks and restore interrupt state. Fixes interrupt problems
#   reported on the mailing lists:
#   
#   http://marc.theaimsgroup.com/?l=acpi4linux&m=109142999328643&w=2
# 
# drivers/acpi/pci_link.c
#   2004/08/03 18:03:31-04:00 nbryant@optonline.net +51 -14
#   drivers/acpi/pci_link.c: register us as a sys_device so that we can get
#   resume callbacks and restore interrupt state. Fixes interrupt problems
#   reported on the mailing lists:
#   
#   http://marc.theaimsgroup.com/?l=acpi4linux&m=109142999328643&w=2
# 
# ChangeSet
#   2004/08/02 20:41:54-04:00 nbryant@optonline.net 
#   [ACPI] drivers/acpi/pci_link.c: add acpi_pci_link_resume(), which will be
#   called when resuming from a suspend state that needs IRQ routing to be
#   restored. This fixes issues reported on the mailing lists, e.g.:
#   
#   http://marc.theaimsgroup.com/?l=acpi4linux&m=109142999328643&w=2
# 
# drivers/acpi/pci_link.c
#   2004/08/02 20:41:45-04:00 nbryant@optonline.net +23 -0
#   [ACPI] drivers/acpi/pci_link.c: add acpi_pci_link_resume(), which will be
#   called when resuming from a suspend state that needs IRQ routing to be
#   restored. This fixes issues reported on the mailing lists, e.g.:
#   
#   http://marc.theaimsgroup.com/?l=acpi4linux&m=109142999328643&w=2
# 
# BitKeeper/etc/ignore
#   2004/08/02 20:41:45-04:00 nbryant@optonline.net +2 -0
#   Added Module.symvers drivers/acpi/pci_link.c~ to the ignore list
# 
diff -Nru a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
--- a/drivers/acpi/pci_link.c	2004-08-04 11:33:50 -04:00
+++ b/drivers/acpi/pci_link.c	2004-08-04 11:33:50 -04:00
@@ -29,6 +29,7 @@
  *	   for IRQ management (e.g. start()->_SRS).
  */
 
+#include <linux/sysdev.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -71,7 +72,7 @@
 	u8			active;			/* Current IRQ */
 	u8			edge_level;		/* All IRQs */
 	u8			active_high_low;	/* All IRQs */
-	u8			setonboot;
+	u8			initialized;
 	u8			resource_type;
 	u8			possible_count;
 	u8			possible[ACPI_PCI_LINK_MAX_POSSIBLE];
@@ -517,7 +518,7 @@
 
 	ACPI_FUNCTION_TRACE("acpi_pci_link_allocate");
 
-	if (link->irq.setonboot)
+	if (link->irq.initialized)
 		return_VALUE(0);
 
 	/*
@@ -571,7 +572,7 @@
 			acpi_device_bid(link->device), link->irq.active);
 	}
 
-	link->irq.setonboot = 1;
+	link->irq.initialized = 1;
 
 	return_VALUE(0);
 }
@@ -695,6 +696,42 @@
 
 
 static int
+acpi_pci_link_resume (
+	struct acpi_pci_link	*link)
+{
+	ACPI_FUNCTION_TRACE("acpi_pci_link_resume");
+	
+	if (link->irq.active && link->irq.initialized)
+		return_VALUE(acpi_pci_link_set(link, link->irq.active));
+	else
+		return_VALUE(0);
+}
+
+
+static int
+irqrouter_resume(
+	struct sys_device *dev)
+{
+	struct list_head        *node = NULL;
+	struct acpi_pci_link    *link = NULL;
+
+	ACPI_FUNCTION_TRACE("irqrouter_resume");
+
+	list_for_each(node, &acpi_link.entries) {
+
+		link = list_entry(node, struct acpi_pci_link, node);
+		if (!link) {
+			ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n"));
+			continue;
+		}
+
+		acpi_pci_link_resume(link);
+	}
+	return_VALUE(0);
+}
+
+
+static int
 acpi_pci_link_remove (
 	struct acpi_device	*device,
 	int			type)
@@ -786,11 +823,42 @@
 __setup("acpi_irq_balance", acpi_irq_balance_set);
 
 
+static struct sysdev_class irqrouter_sysdev_class = {
+        set_kset_name("irqrouter"),
+        .resume = irqrouter_resume,
+};
+
+
+static struct sys_device device_irqrouter = {
+	.id     = 0,
+	.cls    = &irqrouter_sysdev_class,
+};
+
+
+static int __init irqrouter_init_sysfs(void)
+{
+	int error;
+
+	ACPI_FUNCTION_TRACE("irqrouter_init_sysfs");
+
+	if (acpi_disabled || acpi_noirq)
+		return_VALUE(0);
+
+        error = sysdev_class_register(&irqrouter_sysdev_class);
+        if (!error)
+        	error = sysdev_register(&device_irqrouter);
+
+        return_VALUE(error);
+}                                        
+
+device_initcall(irqrouter_init_sysfs);
+
+
 static int __init acpi_pci_link_init (void)
 {
 	ACPI_FUNCTION_TRACE("acpi_pci_link_init");
 
-	if (acpi_pci_disabled)
+	if (acpi_noirq)
 		return_VALUE(0);
 
 	acpi_link.count = 0;

  reply	other threads:[~2004-08-04 15:57 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-04  1:42 [PATCH][RFC] fix ACPI IRQ routing after S3 suspend Nathan Bryant
2004-08-04  1:42 ` Nathan Bryant
     [not found] ` <41103F22.4090303-p32f3XyCuykqcZcGjlUOXw@public.gmane.org>
2004-08-04  2:59   ` Len Brown
2004-08-04  2:59     ` Len Brown
2004-08-04 15:57     ` Nathan Bryant [this message]
2004-08-04 15:57       ` Nathan Bryant
     [not found]       ` <41110785.4040000-p32f3XyCuykqcZcGjlUOXw@public.gmane.org>
2004-08-04 16:10         ` Nathan Bryant
2004-08-04 16:10           ` [ACPI] " Nathan Bryant
2004-08-19 20:24 ` [ACPI] " Stefan Dösinger
     [not found]   ` <200408192224.08271.stefandoesinger-RbZlAiThDcE@public.gmane.org>
2004-08-19 20:54     ` Nathan Bryant
2004-08-19 20:54       ` [ACPI] " Nathan Bryant
2004-08-20 10:50       ` Stefan Dösinger
2004-08-20 12:18         ` Nathan Bryant
2004-08-20 16:36           ` Stefan Dösinger
  -- strict thread matches above, loose matches on Subject: below --
2004-08-04  2:36 Li, Shaohua
2004-08-04  2:36 ` Li, Shaohua
     [not found] ` <B44D37711ED29844BEA67908EAF36F037BB9C6-4yWAQGcml65pB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-08-04  2:55   ` Len Brown
2004-08-04  2:55     ` Len Brown
2004-08-20 19:00 Pallipadi, Venkatesh
2004-08-20 19:42 ` [ACPI] " Nathan Bryant
     [not found]   ` <41265443.9050800-p32f3XyCuykqcZcGjlUOXw@public.gmane.org>
2004-08-20 20:01     ` Stefan Dösinger
     [not found]       ` <200408202201.54083.stefandoesinger-RbZlAiThDcE@public.gmane.org>
2004-08-20 20:42         ` Nathan Bryant
     [not found]           ` <4126621B.3090701-p32f3XyCuykqcZcGjlUOXw@public.gmane.org>
2004-08-20 20:43             ` Nathan Bryant
2004-08-20 20:17     ` Stefan Dösinger
     [not found] <412B2E16.1040904@optonline.net>
     [not found] ` <20040824123913.GD25947@gamma.logic.tuwien.ac.at>
     [not found]   ` <20040824123913.GD25947-DqSSrKF0TaySnEC3TeqHn5dqbFPxfnh/@public.gmane.org>
2004-08-24 13:23     ` Nathan Bryant
     [not found] ` <20040824142219.GA13607@gamma.logic.tuwien.ac.at>
     [not found]   ` <20040824142219.GA13607-DqSSrKF0TaySnEC3TeqHn5dqbFPxfnh/@public.gmane.org>
2004-08-24 14:32     ` Nathan Bryant
     [not found]       ` <412B516B.8030704-p32f3XyCuykqcZcGjlUOXw@public.gmane.org>
2004-08-25 11:19         ` Norbert Preining

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=41110785.4040000@optonline.net \
    --to=nbryant-p32f3xycuykqczcgjluoxw@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=shaohua.li-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=stefandoesinger-RbZlAiThDcE@public.gmane.org \
    /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.