linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI/IO-APIC: allow PCI_IOAPIC to be user configurable on x86
@ 2011-11-29  7:59 Jan Beulich
  2011-12-05 19:28 ` Jesse Barnes
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2011-11-29  7:59 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: Bjorn Helgaas, linux-pci

This adjusts PCI_IOAPIC to be user configurable (possibly as a module)
on x86, since the base architecture code for adding IO-APICs
dynamically isn't there yet (and hence having the code present
everywhere is pretty pointless).

To make this consistent, a MODULE_DEVICE_TABLE() declaration gets
added, the class specifications get corrected (by properly using
PCI_DEVICE_CLASS() intended for purposes like this), and the probe and
remove functions get their sections adjusted.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>

---
 drivers/pci/Kconfig  |    4 ++--
 drivers/pci/ioapic.c |   15 +++++++--------
 2 files changed, 9 insertions(+), 10 deletions(-)

--- 3.2-rc3/drivers/pci/Kconfig
+++ 3.2-rc3-pci-ioapic/drivers/pci/Kconfig
@@ -98,11 +98,11 @@ config PCI_PASID
 	  If unsure, say N.
 
 config PCI_IOAPIC
-	bool
+	tristate "PCI IO-APIC hotplug support" if X86
 	depends on PCI
 	depends on ACPI
 	depends on HOTPLUG
-	default y
+	default !X86
 
 config PCI_LABEL
 	def_bool y if (DMI || ACPI)
--- 3.2-rc3/drivers/pci/ioapic.c
+++ 3.2-rc3-pci-ioapic/drivers/pci/ioapic.c
@@ -17,7 +17,7 @@
  */
 
 #include <linux/pci.h>
-#include <linux/export.h>
+#include <linux/module.h>
 #include <linux/acpi.h>
 #include <linux/slab.h>
 #include <acpi/acpi_bus.h>
@@ -27,7 +27,7 @@ struct ioapic {
 	u32		gsi_base;
 };
 
-static int ioapic_probe(struct pci_dev *dev, const struct pci_device_id *ent)
+static int __devinit ioapic_probe(struct pci_dev *dev, const struct pci_device_id *ent)
 {
 	acpi_handle handle;
 	acpi_status status;
@@ -88,7 +88,7 @@ exit_free:
 	return -ENODEV;
 }
 
-static void ioapic_remove(struct pci_dev *dev)
+static void __devexit ioapic_remove(struct pci_dev *dev)
 {
 	struct ioapic *ioapic = pci_get_drvdata(dev);
 
@@ -99,13 +99,12 @@ static void ioapic_remove(struct pci_dev
 }
 
 
-static struct pci_device_id ioapic_devices[] = {
-	{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
-	  PCI_CLASS_SYSTEM_PIC_IOAPIC << 8, 0xffff00, },
-	{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
-	  PCI_CLASS_SYSTEM_PIC_IOXAPIC << 8, 0xffff00, },
+static DEFINE_PCI_DEVICE_TABLE(ioapic_devices) = {
+	{ PCI_DEVICE_CLASS(PCI_CLASS_SYSTEM_PIC_IOAPIC, ~0) },
+	{ PCI_DEVICE_CLASS(PCI_CLASS_SYSTEM_PIC_IOXAPIC, ~0) },
 	{ }
 };
+MODULE_DEVICE_TABLE(pci, ioapic_devices);
 
 static struct pci_driver ioapic_driver = {
 	.name		= "ioapic",




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI/IO-APIC: allow PCI_IOAPIC to be user configurable on x86
  2011-11-29  7:59 [PATCH] PCI/IO-APIC: allow PCI_IOAPIC to be user configurable on x86 Jan Beulich
@ 2011-12-05 19:28 ` Jesse Barnes
  0 siblings, 0 replies; 3+ messages in thread
From: Jesse Barnes @ 2011-12-05 19:28 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Bjorn Helgaas, linux-pci

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

On Tue, 29 Nov 2011 07:59:22 +0000
"Jan Beulich" <JBeulich@suse.com> wrote:

> This adjusts PCI_IOAPIC to be user configurable (possibly as a module)
> on x86, since the base architecture code for adding IO-APICs
> dynamically isn't there yet (and hence having the code present
> everywhere is pretty pointless).
> 
> To make this consistent, a MODULE_DEVICE_TABLE() declaration gets
> added, the class specifications get corrected (by properly using
> PCI_DEVICE_CLASS() intended for purposes like this), and the probe and
> remove functions get their sections adjusted.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
> 

Oooh, fancy.  Should go through the x86 tree though since the APIC code
is really x86 specific (and they're the experts in that anyway).

Thanks,
-- 
Jesse Barnes, Intel Open Source Technology Center

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] PCI/IO-APIC: allow PCI_IOAPIC to be user configurable on x86
@ 2011-12-06  7:49 Jan Beulich
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2011-12-06  7:49 UTC (permalink / raw)
  To: mingo, tglx, hpa; +Cc: bhelgaas, linux-pci, Jesse Barnes

Jesse asked for this to go through the x86 tree, so I'm re-sending it
this way. Also correcting Bjorn's email address.

******************************************************

This adjusts PCI_IOAPIC to be user configurable (possibly as a module)
on x86, since the base architecture code for adding IO-APICs
dynamically isn't there yet (and hence having the code present
everywhere is pretty pointless).

To make this consistent, a MODULE_DEVICE_TABLE() declaration gets
added, the class specifications get corrected (by properly using
PCI_DEVICE_CLASS() intended for purposes like this), and the probe and
remove functions get their sections adjusted.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>

---
 drivers/pci/Kconfig  |    4 ++--
 drivers/pci/ioapic.c |   15 +++++++--------
 2 files changed, 9 insertions(+), 10 deletions(-)

--- 3.2-rc3/drivers/pci/Kconfig
+++ 3.2-rc3-pci-ioapic/drivers/pci/Kconfig
@@ -98,11 +98,11 @@ config PCI_PASID
 	  If unsure, say N.
 
 config PCI_IOAPIC
-	bool
+	tristate "PCI IO-APIC hotplug support" if X86
 	depends on PCI
 	depends on ACPI
 	depends on HOTPLUG
-	default y
+	default !X86
 
 config PCI_LABEL
 	def_bool y if (DMI || ACPI)
--- 3.2-rc3/drivers/pci/ioapic.c
+++ 3.2-rc3-pci-ioapic/drivers/pci/ioapic.c
@@ -17,7 +17,7 @@
  */
 
 #include <linux/pci.h>
-#include <linux/export.h>
+#include <linux/module.h>
 #include <linux/acpi.h>
 #include <linux/slab.h>
 #include <acpi/acpi_bus.h>
@@ -27,7 +27,7 @@ struct ioapic {
 	u32		gsi_base;
 };
 
-static int ioapic_probe(struct pci_dev *dev, const struct pci_device_id *ent)
+static int __devinit ioapic_probe(struct pci_dev *dev, const struct pci_device_id *ent)
 {
 	acpi_handle handle;
 	acpi_status status;
@@ -88,7 +88,7 @@ exit_free:
 	return -ENODEV;
 }
 
-static void ioapic_remove(struct pci_dev *dev)
+static void __devexit ioapic_remove(struct pci_dev *dev)
 {
 	struct ioapic *ioapic = pci_get_drvdata(dev);
 
@@ -99,13 +99,12 @@ static void ioapic_remove(struct pci_dev
 }
 
 
-static struct pci_device_id ioapic_devices[] = {
-	{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
-	  PCI_CLASS_SYSTEM_PIC_IOAPIC << 8, 0xffff00, },
-	{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
-	  PCI_CLASS_SYSTEM_PIC_IOXAPIC << 8, 0xffff00, },
+static DEFINE_PCI_DEVICE_TABLE(ioapic_devices) = {
+	{ PCI_DEVICE_CLASS(PCI_CLASS_SYSTEM_PIC_IOAPIC, ~0) },
+	{ PCI_DEVICE_CLASS(PCI_CLASS_SYSTEM_PIC_IOXAPIC, ~0) },
 	{ }
 };
+MODULE_DEVICE_TABLE(pci, ioapic_devices);
 
 static struct pci_driver ioapic_driver = {
 	.name		= "ioapic",




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-06  7:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-29  7:59 [PATCH] PCI/IO-APIC: allow PCI_IOAPIC to be user configurable on x86 Jan Beulich
2011-12-05 19:28 ` Jesse Barnes
  -- strict thread matches above, loose matches on Subject: below --
2011-12-06  7:49 Jan Beulich

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).