public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BK PATCH] PCI Hotplug fixes for 2.6.4-rc1
@ 2004-03-03  4:20 Greg KH
  2004-03-03  4:21 ` [PATCH] " Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2004-03-03  4:20 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: linux-kernel

Hi,

Here are some minor PCI hotplug fixes for 2.6.4-rc1.  They fix some
oopses, and make the build options a lot saner and allow the distros to
pick the proper options easier.

Please pull from:
	bk://kernel.bkbits.net/gregkh/linux/pci-2.6

thanks,

greg k-h

p.s. I'll send these as patches in response to this email to lkml for
those who want to see them.


 drivers/pci/hotplug/Kconfig            |   32 ++++---------------
 drivers/pci/hotplug/Makefile           |   54 +++++++++++++++------------------
 drivers/pci/hotplug/cpqphp.h           |    1 
 drivers/pci/hotplug/cpqphp_core.c      |    5 +++
 drivers/pci/hotplug/cpqphp_ctrl.c      |   47 ++++++++++++++--------------
 drivers/pci/hotplug/cpqphp_pci.c       |   36 +++++++++++-----------
 drivers/pci/hotplug/pci_hotplug_core.c |   23 ++++++++++----
 drivers/pci/hotplug/pciehprm_acpi.c    |    3 +
 drivers/pci/hotplug/shpchp.h           |    3 -
 drivers/pci/hotplug/shpchprm_acpi.c    |    3 +
 include/linux/pci.h                    |    1 
 11 files changed, 105 insertions(+), 103 deletions(-)
-----


Dely Sy:
  o PCI Hotplug: fixes for shpc and pcie hot-plug drivers

Greg Kroah-Hartman:
  o PCI Hotplug: clean up the Makefile a bit more
  o PCI Hotplug: fix up the permission settings on a few of the sysfs files
  o PCI Hotplug: fix stupid directory name of "pci_hotplug_slots" to be just "slots"

Torben Mathiasen:
  o PCI Hotplug: Patch to get cpqphp working with IOAPIC


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

* [PATCH] PCI Hotplug fixes for 2.6.4-rc1
  2004-03-03  4:20 [BK PATCH] PCI Hotplug fixes for 2.6.4-rc1 Greg KH
@ 2004-03-03  4:21 ` Greg KH
  2004-03-03  4:21   ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2004-03-03  4:21 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.1621, 2004/03/01 09:48:14-08:00, torben.mathiasen@hp.com

[PATCH] PCI Hotplug: Patch to get cpqphp working with IOAPIC

On Fri, Feb 13 2004, Sy, Dely L wrote:
> Since filling out the INTERRUPT_LINE is needed for systems running
> with legacy irqs and not needed for systems running with IO-APIC.  The

> possible
> solutions:
> 1) Best is there is a run-time check (a flag or an API call) that tells
>    whether the system is running on legacy mode or IO-APIC mode. Is there
>    such check that you know of?

Dan suggested that we look at what IRQ the hotplug controller has been
assigned in the MPS table. If its < 0x10 we're in legacy/mapped mode.
That would probaly work

> > >
> > > Do those servers work on 2.6.2 without my patch?
> > >
>
> > Yes
>
> They work but they get dev->irq = 9 or 11 in the APIC enabled mode.
> Correct?
>

Yes. All hot-added adapters get legacy IRQs like IRQ5 in the example
below where eth2 was added after bootup:


linux:~ # cat /proc/interrupts
           CPU0       CPU1       CPU2       CPU3
0:     831113          0          0          0    IO-APIC-edge  timer
1:        255          0          0          0    IO-APIC-edge  i8042
2:          0          0          0          0          XT-PIC  cascade
5:          0          0          0          0          XT-PIC  eth2
8:          2          0          0          0    IO-APIC-edge  rtc
12:         92          0          0          0   IO-APIC-edge  i8042
14:         29          0          0          0   IO-APIC-edge  ide0
20:          0          0          0          0   IO-APIC-level cciss0
21:          0          0          0          0   IO-APIC-level cciss1
29:        107          0          0          0   IO-APIC-level eth0
30:       7702          0          0          0   IO-APIC-level aic7xxx
31:         30          0          0          0   IO-APIC-level aic7xxx
34:        336          0          0          0   IO-APIC-level
cpqphp.o, cpqphp.o
NMI:          0          0          0          0
LOC:     830760     830893     830892     830891
ERR:          0
MIS:          0

I attached a patch that does the legacy mode check that Dan suggested
and IRQs for hot-added adapters seems to be given out in the APIC range.


 drivers/pci/hotplug/cpqphp.h      |    1 
 drivers/pci/hotplug/cpqphp_core.c |    5 ++++
 drivers/pci/hotplug/cpqphp_ctrl.c |   47 +++++++++++++++++++-------------------
 drivers/pci/hotplug/cpqphp_pci.c  |   36 ++++++++++++++---------------
 4 files changed, 48 insertions(+), 41 deletions(-)


diff -Nru a/drivers/pci/hotplug/cpqphp.h b/drivers/pci/hotplug/cpqphp.h
--- a/drivers/pci/hotplug/cpqphp.h	Tue Mar  2 19:43:03 2004
+++ b/drivers/pci/hotplug/cpqphp.h	Tue Mar  2 19:43:03 2004
@@ -444,6 +444,7 @@
 
 /* Global variables */
 extern int cpqhp_debug;
+extern int cpqhp_legacy_mode;
 extern struct controller *cpqhp_ctrl_list;
 extern struct pci_func *cpqhp_slot_list[256];
 
diff -Nru a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c
--- a/drivers/pci/hotplug/cpqphp_core.c	Tue Mar  2 19:43:03 2004
+++ b/drivers/pci/hotplug/cpqphp_core.c	Tue Mar  2 19:43:03 2004
@@ -49,6 +49,7 @@
 
 /* Global variables */
 int cpqhp_debug;
+int cpqhp_legacy_mode;
 struct controller *cpqhp_ctrl_list;	/* = NULL */
 struct pci_func *cpqhp_slot_list[256];
 
@@ -1169,6 +1170,10 @@
 	 */
 	// The next line is required for cpqhp_find_available_resources
 	ctrl->interrupt = pdev->irq;
+	if (ctrl->interrupt < 0x10) {
+		cpqhp_legacy_mode = 1;
+		dbg("System seems to be configured for Full Table Mapped MPS mode\n");
+	}
 
 	ctrl->cfgspc_irq = 0;
 	pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, &ctrl->cfgspc_irq);
diff -Nru a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c
--- a/drivers/pci/hotplug/cpqphp_ctrl.c	Tue Mar  2 19:43:03 2004
+++ b/drivers/pci/hotplug/cpqphp_ctrl.c	Tue Mar  2 19:43:03 2004
@@ -3020,33 +3020,34 @@
 				}
 			}
 		}		// End of base register loop
+		if (cpqhp_legacy_mode) {
+			// Figure out which interrupt pin this function uses
+			rc = pci_bus_read_config_byte (pci_bus, devfn, 
+				PCI_INTERRUPT_PIN, &temp_byte);
 
-#if !defined(CONFIG_X86_IO_APIC)
-		// Figure out which interrupt pin this function uses
-		rc = pci_bus_read_config_byte (pci_bus, devfn, PCI_INTERRUPT_PIN, &temp_byte);
-
-		// If this function needs an interrupt and we are behind a bridge
-		// and the pin is tied to something that's alread mapped,
-		// set this one the same
-		if (temp_byte && resources->irqs && 
-		    (resources->irqs->valid_INT & 
-		     (0x01 << ((temp_byte + resources->irqs->barber_pole - 1) & 0x03)))) {
-			// We have to share with something already set up
-			IRQ = resources->irqs->interrupt[(temp_byte + resources->irqs->barber_pole - 1) & 0x03];
-		} else {
-			// Program IRQ based on card type
-			rc = pci_bus_read_config_byte (pci_bus, devfn, 0x0B, &class_code);
-
-			if (class_code == PCI_BASE_CLASS_STORAGE) {
-				IRQ = cpqhp_disk_irq;
+			// If this function needs an interrupt and we are behind a bridge
+			// and the pin is tied to something that's alread mapped,
+			// set this one the same
+			if (temp_byte && resources->irqs && 
+			    (resources->irqs->valid_INT & 
+			     (0x01 << ((temp_byte + resources->irqs->barber_pole - 1) & 0x03)))) {
+				// We have to share with something already set up
+				IRQ = resources->irqs->interrupt[(temp_byte + 
+					resources->irqs->barber_pole - 1) & 0x03];
 			} else {
-				IRQ = cpqhp_nic_irq;
+				// Program IRQ based on card type
+				rc = pci_bus_read_config_byte (pci_bus, devfn, 0x0B, &class_code);
+
+				if (class_code == PCI_BASE_CLASS_STORAGE) {
+					IRQ = cpqhp_disk_irq;
+				} else {
+					IRQ = cpqhp_nic_irq;
+				}
 			}
-		}
 
-		// IRQ Line
-		rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_INTERRUPT_LINE, IRQ);
-#endif
+			// IRQ Line
+			rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_INTERRUPT_LINE, IRQ);
+		}
 
 		if (!behind_bridge) {
 			rc = cpqhp_set_irq(func->bus, func->device, temp_byte + 0x09, IRQ);
diff -Nru a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c
--- a/drivers/pci/hotplug/cpqphp_pci.c	Tue Mar  2 19:43:03 2004
+++ b/drivers/pci/hotplug/cpqphp_pci.c	Tue Mar  2 19:43:03 2004
@@ -151,32 +151,32 @@
  */
 int cpqhp_set_irq (u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num)
 {
-#if !defined(CONFIG_X86_IO_APIC)	
 	int rc;
 	u16 temp_word;
 	struct pci_dev fakedev;
 	struct pci_bus fakebus;
 
-	fakedev.devfn = dev_num << 3;
-	fakedev.bus = &fakebus;
-	fakebus.number = bus_num;
-	dbg("%s: dev %d, bus %d, pin %d, num %d\n",
-	    __FUNCTION__, dev_num, bus_num, int_pin, irq_num);
-	rc = pcibios_set_irq_routing(&fakedev, int_pin - 0x0a, irq_num);
-	dbg("%s: rc %d\n", __FUNCTION__, rc);
-	if (!rc)
-		return !rc;
+	if (cpqhp_legacy_mode) {
+		fakedev.devfn = dev_num << 3;
+		fakedev.bus = &fakebus;
+		fakebus.number = bus_num;
+		dbg("%s: dev %d, bus %d, pin %d, num %d\n",
+		    __FUNCTION__, dev_num, bus_num, int_pin, irq_num);
+		rc = pcibios_set_irq_routing(&fakedev, int_pin - 0x0a, irq_num);
+		dbg("%s: rc %d\n", __FUNCTION__, rc);
+		if (!rc)
+			return !rc;
 
-	// set the Edge Level Control Register (ELCR)
-	temp_word = inb(0x4d0);
-	temp_word |= inb(0x4d1) << 8;
+		// set the Edge Level Control Register (ELCR)
+		temp_word = inb(0x4d0);
+		temp_word |= inb(0x4d1) << 8;
 
-	temp_word |= 0x01 << irq_num;
+		temp_word |= 0x01 << irq_num;
 
-	// This should only be for x86 as it sets the Edge Level Control Register
-	outb((u8) (temp_word & 0xFF), 0x4d0);
-	outb((u8) ((temp_word & 0xFF00) >> 8), 0x4d1);
-#endif
+		// This should only be for x86 as it sets the Edge Level Control Register
+		outb((u8) (temp_word & 0xFF), 0x4d0);
+		outb((u8) ((temp_word & 0xFF00) >> 8), 0x4d1);
+	}
 
 	return 0;
 }


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

* Re: [PATCH] PCI Hotplug fixes for 2.6.4-rc1
  2004-03-03  4:21 ` [PATCH] " Greg KH
@ 2004-03-03  4:21   ` Greg KH
  2004-03-03  4:21     ` Greg KH
  2004-03-04  6:17     ` Ingo Oeser
  0 siblings, 2 replies; 8+ messages in thread
From: Greg KH @ 2004-03-03  4:21 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.1622, 2004/03/01 16:18:12-08:00, greg@kroah.com

PCI Hotplug: fix stupid directory name of "pci_hotplug_slots" to be just "slots"


 drivers/pci/hotplug/pci_hotplug_core.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)


diff -Nru a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
--- a/drivers/pci/hotplug/pci_hotplug_core.c	Tue Mar  2 19:42:42 2004
+++ b/drivers/pci/hotplug/pci_hotplug_core.c	Tue Mar  2 19:42:42 2004
@@ -104,8 +104,19 @@
 	.release = &hotplug_slot_release,
 };
 
-decl_subsys(pci_hotplug_slots, &hotplug_slot_ktype, NULL);
-
+/* 
+ * We create a struct subsystem on our own and not use decl_subsys so
+ * we can have a sane name "slots" in sysfs, yet still keep a good
+ * global variable name "pci_hotplug_slots_subsys.
+ * If the decl_subsys() #define ever changes, this declaration will
+ * need to be update to make sure everything is initialized properly.
+ */
+struct subsystem pci_hotplug_slots_subsys = {
+	.kset = {
+		.kobj = { .name = "slots" },
+		.ktype = &hotplug_slot_ktype,
+	}
+};
 
 /* these strings match up with the values in pci_bus_speed */
 static char *pci_bus_speed_strings[] = {


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

* Re: [PATCH] PCI Hotplug fixes for 2.6.4-rc1
  2004-03-03  4:21     ` Greg KH
@ 2004-03-03  4:21       ` Greg KH
  2004-03-03  4:21         ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2004-03-03  4:21 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.1624, 2004/03/02 19:10:44-08:00, dlsy@snoqualmie.dp.intel.com

[PATCH] PCI Hotplug: fixes for shpc and pcie hot-plug drivers

This patch contains the following:
1.  Fix up the pcie and shpc options to make it easier for distros
    to use as what we have discussed;
2.  Fix bug encountered when installing the drivers on non-hotplug
    systems;
3.  Put PCI_CAP_ID_SHPC in include/linux/pci.h


 drivers/pci/hotplug/Kconfig         |   30 ++++++------------------------
 drivers/pci/hotplug/Makefile        |   24 ++++++++++++++----------
 drivers/pci/hotplug/pciehprm_acpi.c |    3 +++
 drivers/pci/hotplug/shpchp.h        |    3 ---
 drivers/pci/hotplug/shpchprm_acpi.c |    3 +++
 include/linux/pci.h                 |    1 +
 6 files changed, 27 insertions(+), 37 deletions(-)


diff -Nru a/drivers/pci/hotplug/Kconfig b/drivers/pci/hotplug/Kconfig
--- a/drivers/pci/hotplug/Kconfig	Tue Mar  2 19:42:09 2004
+++ b/drivers/pci/hotplug/Kconfig	Tue Mar  2 19:42:09 2004
@@ -135,23 +135,14 @@
 	  When in doubt, say N.
 
 config HOTPLUG_PCI_PCIE_POLL_EVENT_MODE
-	bool "Use polling mechanism for hot-plug events."
+	bool "Use polling mechanism for hot-plug events (for testing purpose)"
 	depends on HOTPLUG_PCI_PCIE
 	help
 	  Say Y here if you want to use the polling mechanism for hot-plug 
-	  events.
+	  events for early platform testing.
 	   
 	  When in doubt, say N.
 
-config HOTPLUG_PCI_PCIE_PHPRM_NONACPI
-	bool "Non-ACPI: Use $HPRT for resource/configuration"
-	depends on HOTPLUG_PCI_PCIE
-	help
-	  Say Y here if Hotplug resource/configuration information is provided
-	  by platform BIOS $HPRT or bridge resource information, not by ACPI.
-
-	  When in doubt, say N.
-
 config HOTPLUG_PCI_SHPC
 	tristate "SHPC PCI Hotplug driver"
 	depends on HOTPLUG_PCI
@@ -165,29 +156,20 @@
 	  When in doubt, say N.
 
 config HOTPLUG_PCI_SHPC_POLL_EVENT_MODE
-	bool "Use polling mechanism for hot-plug events"
+	bool "Use polling mechanism for hot-plug events (for testing purpose)"
 	depends on HOTPLUG_PCI_SHPC
 	help
 	  Say Y here if you want to use the polling mechanism for hot-plug 
-	  events.
-
-	  When in doubt, say N.
-
-config HOTPLUG_PCI_SHPC_PHPRM_NONACPI
-	bool "Non-ACPI: Use $HPRT for resource/configuration"
-	depends on HOTPLUG_PCI_SHPC
-	help
-	  Say Y here if Hotplug resource/configuration information is provided
-	  by platform BIOS $HPRT or bridge resource information, not by ACPI.
+	  events for early platform testing.
 
 	  When in doubt, say N.
 
 config HOTPLUG_PCI_SHPC_PHPRM_LEGACY
 	bool "For AMD SHPC only: Use $HRT for resource/configuration"
-	depends on HOTPLUG_PCI_SHPC && HOTPLUG_PCI_SHPC_PHPRM_NONACPI
+	depends on HOTPLUG_PCI_SHPC && !ACPI_BUS 
 	help
 	  Say Y here for AMD SHPC. You have to select this option if you are 
-	  using this driver on AMD platform with SHPC.
+	  using this driver on platform with AMD SHPC.
 
 config HOTPLUG_PCI_RPA
 	tristate "RPA PCI Hotplug driver"
diff -Nru a/drivers/pci/hotplug/Makefile b/drivers/pci/hotplug/Makefile
--- a/drivers/pci/hotplug/Makefile	Tue Mar  2 19:42:09 2004
+++ b/drivers/pci/hotplug/Makefile	Tue Mar  2 19:42:09 2004
@@ -51,10 +51,12 @@
 				pciehp_sysfs.o	\
 				pciehp_hpc.o
 
-ifeq ($(CONFIG_HOTPLUG_PCI_PCIE_PHPRM_NONACPI),y)
-  pciehp-objs += pciehprm_nonacpi.o
-else
-  pciehp-objs += pciehprm_acpi.o
+ifdef CONFIG_HOTPLUG_PCI_PCIE
+  ifdef CONFIG_ACPI_BUS
+    pciehp-objs += pciehprm_acpi.o
+  else
+    pciehp-objs += pciehprm_nonacpi.o
+  endif
 endif
 
 shpchp-objs		:=	shpchp_core.o	\
@@ -63,12 +65,14 @@
 				shpchp_sysfs.o	\
 				shpchp_hpc.o
 
-ifeq ($(CONFIG_HOTPLUG_PCI_SHPC_PHPRM_LEGACY),y)
-  shpchp-objs += shpchprm_legacy.o
-else
-  ifeq ($(CONFIG_HOTPLUG_PCI_SHPC_PHPRM_NONACPI),y)
-    shpchp-objs += shpchprm_nonacpi.o
-  else
+ifdef CONFIG_HOTPLUG_PCI_SHPC
+  ifdef CONFIG_ACPI_BUS
     shpchp-objs += shpchprm_acpi.o
+  else
+    ifdef CONFIG_HOTPLUG_PCI_SHPC_PHPRM_LEGACY
+      shpchp-objs += shpchprm_legacy.o
+    else
+      shpchp-objs += shpchprm_nonacpi.o
+    endif
   endif
 endif
diff -Nru a/drivers/pci/hotplug/pciehprm_acpi.c b/drivers/pci/hotplug/pciehprm_acpi.c
--- a/drivers/pci/hotplug/pciehprm_acpi.c	Tue Mar  2 19:42:09 2004
+++ b/drivers/pci/hotplug/pciehprm_acpi.c	Tue Mar  2 19:42:09 2004
@@ -1188,6 +1188,9 @@
 
 static void pciehprm_free_bridges ( struct acpi_bridge	*ab)
 {
+	if (!ab)
+		return;
+
 	if (ab->child)
 		pciehprm_free_bridges (ab->child);
 
diff -Nru a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
--- a/drivers/pci/hotplug/shpchp.h	Tue Mar  2 19:42:09 2004
+++ b/drivers/pci/hotplug/shpchp.h	Tue Mar  2 19:42:09 2004
@@ -154,9 +154,6 @@
 /* Define AMD SHPC ID  */
 #define PCI_DEVICE_ID_AMD_GOLAM_7450	0x7450 
 
-/* Define SHPC CAP ID - not defined in kernel yet */
-#define PCI_CAP_ID_SHPC			0x0C 
-
 #define INT_BUTTON_IGNORE		0
 #define INT_PRESENCE_ON			1
 #define INT_PRESENCE_OFF		2
diff -Nru a/drivers/pci/hotplug/shpchprm_acpi.c b/drivers/pci/hotplug/shpchprm_acpi.c
--- a/drivers/pci/hotplug/shpchprm_acpi.c	Tue Mar  2 19:42:09 2004
+++ b/drivers/pci/hotplug/shpchprm_acpi.c	Tue Mar  2 19:42:09 2004
@@ -1187,6 +1187,9 @@
 
 static void shpchprm_free_bridges ( struct acpi_bridge	*ab)
 {
+	if (!ab)
+		return;
+
 	if (ab->child)
 		shpchprm_free_bridges (ab->child);
 
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h	Tue Mar  2 19:42:09 2004
+++ b/include/linux/pci.h	Tue Mar  2 19:42:09 2004
@@ -199,6 +199,7 @@
 #define  PCI_CAP_ID_MSI		0x05	/* Message Signalled Interrupts */
 #define  PCI_CAP_ID_CHSWP	0x06	/* CompactPCI HotSwap */
 #define  PCI_CAP_ID_PCIX	0x07	/* PCI-X */
+#define  PCI_CAP_ID_SHPC 	0x0C	/* PCI Standard Hot-Plug Controller */
 #define  PCI_CAP_ID_EXP 	0x10	/* PCI Express */
 #define  PCI_CAP_ID_MSIX	0x11	/* MSI-X */
 #define PCI_CAP_LIST_NEXT	1	/* Next capability in the list */


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

* Re: [PATCH] PCI Hotplug fixes for 2.6.4-rc1
  2004-03-03  4:21   ` Greg KH
@ 2004-03-03  4:21     ` Greg KH
  2004-03-03  4:21       ` Greg KH
  2004-03-04  6:17     ` Ingo Oeser
  1 sibling, 1 reply; 8+ messages in thread
From: Greg KH @ 2004-03-03  4:21 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.1623, 2004/03/02 13:11:26-08:00, greg@kroah.com

PCI Hotplug: fix up the permission settings on a few of the sysfs files.

Thanks to Linda Xie for pointing this out.


 drivers/pci/hotplug/pci_hotplug_core.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)


diff -Nru a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
--- a/drivers/pci/hotplug/pci_hotplug_core.c	Tue Mar  2 19:42:22 2004
+++ b/drivers/pci/hotplug/pci_hotplug_core.c	Tue Mar  2 19:42:22 2004
@@ -292,7 +292,7 @@
 }
 
 static struct hotplug_slot_attribute hotplug_slot_attr_latch = {
-	.attr = {.name = "latch", .mode = S_IFREG | S_IRUGO | S_IWUSR},
+	.attr = {.name = "latch", .mode = S_IFREG | S_IRUGO},
 	.show = latch_read_file,
 };
 
@@ -311,7 +311,7 @@
 }
 
 static struct hotplug_slot_attribute hotplug_slot_attr_presence = {
-	.attr = {.name = "adapter", .mode = S_IFREG | S_IRUGO | S_IWUSR},
+	.attr = {.name = "adapter", .mode = S_IFREG | S_IRUGO},
 	.show = presence_read_file,
 };
 
@@ -361,7 +361,7 @@
 }
 
 static struct hotplug_slot_attribute hotplug_slot_attr_max_bus_speed = {
-	.attr = {.name = "max_bus_speed", .mode = S_IFREG | S_IRUGO | S_IWUSR},
+	.attr = {.name = "max_bus_speed", .mode = S_IFREG | S_IRUGO},
 	.show = max_bus_speed_read_file,
 };
 
@@ -387,7 +387,7 @@
 }
 
 static struct hotplug_slot_attribute hotplug_slot_attr_cur_bus_speed = {
-	.attr = {.name = "cur_bus_speed", .mode = S_IFREG | S_IRUGO | S_IWUSR},
+	.attr = {.name = "cur_bus_speed", .mode = S_IFREG | S_IRUGO},
 	.show = cur_bus_speed_read_file,
 };
 


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

* Re: [PATCH] PCI Hotplug fixes for 2.6.4-rc1
  2004-03-03  4:21       ` Greg KH
@ 2004-03-03  4:21         ` Greg KH
  0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2004-03-03  4:21 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.1625, 2004/03/02 19:25:34-08:00, greg@kroah.com

PCI Hotplug: clean up the Makefile a bit more.


 drivers/pci/hotplug/Makefile |   30 ++++++++++++------------------
 1 files changed, 12 insertions(+), 18 deletions(-)


diff -Nru a/drivers/pci/hotplug/Makefile b/drivers/pci/hotplug/Makefile
--- a/drivers/pci/hotplug/Makefile	Tue Mar  2 19:42:02 2004
+++ b/drivers/pci/hotplug/Makefile	Tue Mar  2 19:42:02 2004
@@ -50,13 +50,10 @@
 				pciehp_pci.o	\
 				pciehp_sysfs.o	\
 				pciehp_hpc.o
-
-ifdef CONFIG_HOTPLUG_PCI_PCIE
-  ifdef CONFIG_ACPI_BUS
-    pciehp-objs += pciehprm_acpi.o
-  else
-    pciehp-objs += pciehprm_nonacpi.o
-  endif
+ifdef CONFIG_ACPI_BUS
+	pciehp-objs += pciehprm_acpi.o
+else
+	pciehp-objs += pciehprm_nonacpi.o
 endif
 
 shpchp-objs		:=	shpchp_core.o	\
@@ -64,15 +61,12 @@
 				shpchp_pci.o	\
 				shpchp_sysfs.o	\
 				shpchp_hpc.o
-
-ifdef CONFIG_HOTPLUG_PCI_SHPC
-  ifdef CONFIG_ACPI_BUS
-    shpchp-objs += shpchprm_acpi.o
-  else
-    ifdef CONFIG_HOTPLUG_PCI_SHPC_PHPRM_LEGACY
-      shpchp-objs += shpchprm_legacy.o
-    else
-      shpchp-objs += shpchprm_nonacpi.o
-    endif
-  endif
+ifdef CONFIG_ACPI_BUS
+	shpchp-objs += shpchprm_acpi.o
+else
+	ifdef CONFIG_HOTPLUG_PCI_SHPC_PHPRM_LEGACY
+		shpchp-objs += shpchprm_legacy.o
+	else
+		shpchp-objs += shpchprm_nonacpi.o
+	endif
 endif


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

* Re: [PATCH] PCI Hotplug fixes for 2.6.4-rc1
  2004-03-03  4:21   ` Greg KH
  2004-03-03  4:21     ` Greg KH
@ 2004-03-04  6:17     ` Ingo Oeser
  2004-03-04 18:27       ` Greg KH
  1 sibling, 1 reply; 8+ messages in thread
From: Ingo Oeser @ 2004-03-04  6:17 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Greg,

On Wednesday 03 March 2004 05:21, Greg KH wrote:
> -decl_subsys(pci_hotplug_slots, &hotplug_slot_ktype, NULL);
> -
> +/*
> + * We create a struct subsystem on our own and not use decl_subsys so
> + * we can have a sane name "slots" in sysfs, yet still keep a good
> + * global variable name "pci_hotplug_slots_subsys.
> + * If the decl_subsys() #define ever changes, this declaration will
> + * need to be update to make sure everything is initialized properly.
> + */
> +struct subsystem pci_hotplug_slots_subsys = {
> +	.kset = {
> +		.kobj = { .name = "slots" },
> +		.ktype = &hotplug_slot_ktype,
> +	}
> +};

How about creating a decl_subsys_name() for creating sane names,
like we have for the module parameters?

That whould solve all those problems, since this is used not only once.


Regards

Ingo Oeser

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFARsoBU56oYWuOrkARAk0NAKDWSddUZQSD25ywMKs5zrpcrAJefACgjdV8
1d6axZhMy8k5qCozsrExrBc=
=sQZY
-----END PGP SIGNATURE-----

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

* Re: [PATCH] PCI Hotplug fixes for 2.6.4-rc1
  2004-03-04  6:17     ` Ingo Oeser
@ 2004-03-04 18:27       ` Greg KH
  0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2004-03-04 18:27 UTC (permalink / raw)
  To: Ingo Oeser; +Cc: linux-kernel

On Thu, Mar 04, 2004 at 07:17:37AM +0100, Ingo Oeser wrote:
> Hi Greg,
> 
> On Wednesday 03 March 2004 05:21, Greg KH wrote:
> > -decl_subsys(pci_hotplug_slots, &hotplug_slot_ktype, NULL);
> > -
> > +/*
> > + * We create a struct subsystem on our own and not use decl_subsys so
> > + * we can have a sane name "slots" in sysfs, yet still keep a good
> > + * global variable name "pci_hotplug_slots_subsys.
> > + * If the decl_subsys() #define ever changes, this declaration will
> > + * need to be update to make sure everything is initialized properly.
> > + */
> > +struct subsystem pci_hotplug_slots_subsys = {
> > +	.kset = {
> > +		.kobj = { .name = "slots" },
> > +		.ktype = &hotplug_slot_ktype,
> > +	}
> > +};
> 
> How about creating a decl_subsys_name() for creating sane names,
> like we have for the module parameters?
> 
> That whould solve all those problems, since this is used not only once.

Good idea.  Care to make up such a patch?

thanks,

greg k-h

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

end of thread, other threads:[~2004-03-04 18:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-03  4:20 [BK PATCH] PCI Hotplug fixes for 2.6.4-rc1 Greg KH
2004-03-03  4:21 ` [PATCH] " Greg KH
2004-03-03  4:21   ` Greg KH
2004-03-03  4:21     ` Greg KH
2004-03-03  4:21       ` Greg KH
2004-03-03  4:21         ` Greg KH
2004-03-04  6:17     ` Ingo Oeser
2004-03-04 18:27       ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox