PCI hotplug changes for 2.5.36
PATCH 1/1 PCI hotplug changes for 2.5.36
Here are some PCI hotplug changes for 2.5.36.
Please pull from: bk://linuxusb.bkbits.net/pci_hp-2.5
thanks,
greg k-h
drivers/hotplug/cpqphp.h | 9 - drivers/hotplug/cpqphp_core.c | 66 ++++++-- drivers/hotplug/cpqphp_ctrl.c | 4 drivers/hotplug/ibmphp_core.c | 32 ++-- drivers/hotplug/pci_hotplug.h | 28 +++ drivers/hotplug/pci_hotplug_core.c | 290 +++++++++++++++++++++++++++++++------ drivers/pci/proc.c | 3 kernel/ksyms.c | 2 8 files changed, 353 insertions(+), 81 deletions(-)
-----
[email protected], 2002-09-19 17:47:49-07:00, [email protected]
PCI Hotplug: created /proc/bus/pci/slots for pcihpfs to be mounted on.
proc_bus_pci_dir had to be exported for this to work properly.
drivers/hotplug/pci_hotplug_core.c | 17 +++++++++++++++++ drivers/pci/proc.c | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-)
------
[email protected], 2002-09-19 17:45:19-07:00, [email protected]
PCI Hotplug Core: Add allocation sanity checks. Patch from Silvio Cesare
drivers/hotplug/pci_hotplug_core.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
------
[email protected], 2002-09-19 17:43:34-07:00, [email protected]
PCI Hotplug: added speed status to the IBM driver.
drivers/hotplug/ibmphp_core.c | 32 +++++++++++++++++--------------- 1 files changed, 17 insertions(+), 15 deletions(-)
------
[email protected], 2002-09-19 17:43:07-07:00, [email protected]
PCI Hotplug: added speed status to the Compaq driver.
drivers/hotplug/cpqphp.h | 9 +---- drivers/hotplug/cpqphp_core.c | 66 ++++++++++++++++++++++++++++++++++-------- drivers/hotplug/cpqphp_ctrl.c | 4 +- 3 files changed, 59 insertions(+), 20 deletions(-)
------
[email protected], 2002-09-19 17:40:04-07:00, [email protected]
PCI Hotplug: added max bus speed and current bus speed files to the pci hotplug core.
Patch based on work done by Irene Zubarev <[email protected]>
drivers/hotplug/pci_hotplug.h | 28 ++++ drivers/hotplug/pci_hotplug_core.c | 249 +++++++++++++++++++++++++++++++------ 2 files changed, 242 insertions(+), 35 deletions(-)
------
[email protected], 2002-09-19 17:37:13-07:00, [email protected]
export __inode_dir_notify so that dnotify can be called from filesystems in modules.
kernel/ksyms.c | 2 ++ 1 files changed, 2 insertions(+)
------
[email protected], 2002-09-19 17:29:16-07:00, [email protected]
[PATCH] Small pcihpfs dnotify fix
I've been working on a userspace daemon to go with my CompactPCI driver, and yesterday I discovered an oversight in pci_hp_change_slot_info - it doesn't call dnotify_parent, so dnotify based clients basically don't work against pcihpfs. The following patch (against 2.5 BK) reworks things to just update the mtime (since we're modifying the file after all), and then call dnotify_parent.
drivers/hotplug/pci_hotplug_core.c | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-)
------
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.557 -> 1.558
# drivers/hotplug/pci_hotplug_core.c 1.20 -> 1.21
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/19 [email protected] 1.558
# [PATCH] Small pcihpfs dnotify fix
#
# I've been working on a userspace daemon to go with my CompactPCI driver,
# and yesterday I discovered an oversight in pci_hp_change_slot_info - it # doesn't call dnotify_parent, so dnotify based clients basically don't # work against pcihpfs. The following patch (against 2.5 BK) reworks # things to just update the mtime (since we're modifying the file after # all), and then call dnotify_parent. # -------------------------------------------- # diff -Nru a/drivers/hotplug/pci_hotplug_core.c b/drivers/hotplug/pci_hotplug_core.c --- a/drivers/hotplug/pci_hotplug_core.c Thu Sep 19 17:50:53 2002 +++ b/drivers/hotplug/pci_hotplug_core.c Thu Sep 19 17:50:53 2002 @@ -38,6 +38,7 @@ #include <linux/init.h> #include <linux/namei.h> #include <linux/pci.h> +#include <linux/dnotify.h> #include <asm/uaccess.h> #include "pci_hotplug.h"
@@ -1012,10 +1013,13 @@
return 0;
}
-static inline void update_inode_time (struct inode *inode) +static inline void update_dentry_inode_time (struct dentry *dentry)
{
- if (inode)
- inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+ struct inode *inode = dentry->d_inode;
+ if (inode) {
+ inode->i_mtime = CURRENT_TIME;
+ dnotify_parent(dentry, DN_MODIFY);
+ }
}
/**
@@ -1050,16 +1054,16 @@
core = temp->core_priv;
if ((core->power_dentry) &&
(temp->info->power_status != info->power_status))
- update_inode_time (core->power_dentry->d_inode);
+ update_dentry_inode_time (core->power_dentry);
if ((core->attention_dentry) &&
(temp->info->attention_status != info->attention_status))
- update_inode_time (core->attention_dentry->d_inode);
+ update_dentry_inode_time (core->attention_dentry);
if ((core->latch_dentry) &&
(temp->info->latch_status != info->latch_status))
- update_inode_time (core->latch_dentry->d_inode);
+ update_dentry_inode_time (core->latch_dentry);
if ((core->adapter_dentry) &&
(temp->info->adapter_status != info->adapter_status))
- update_inode_time (core->adapter_dentry->d_inode);
+ update_dentry_inode_time (core->adapter_dentry);
memcpy (temp->info, info, sizeof (struct hotplug_slot_info)); spin_unlock (&list_lock);
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.558 -> 1.559
# kernel/ksyms.c 1.130 -> 1.131
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/19 [email protected] 1.559
# export __inode_dir_notify so that dnotify can be called from filesystems in modules. # -------------------------------------------- # diff -Nru a/kernel/ksyms.c b/kernel/ksyms.c --- a/kernel/ksyms.c Thu Sep 19 17:50:50 2002 +++ b/kernel/ksyms.c Thu Sep 19 17:50:50 2002 @@ -53,6 +53,7 @@ #include <linux/root_dev.h> #include <linux/percpu.h> #include <linux/smp_lock.h> +#include <linux/dnotify.h> #include <asm/checksum.h>
#if defined(CONFIG_PROC_FS)
@@ -560,6 +561,7 @@
EXPORT_SYMBOL(make_bad_inode);
EXPORT_SYMBOL(is_bad_inode);
EXPORT_SYMBOL(event);
+EXPORT_SYMBOL(__inode_dir_notify);
#ifdef CONFIG_UID16
EXPORT_SYMBOL(overflowuid);
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.559 -> 1.560
# drivers/hotplug/pci_hotplug_core.c 1.21 -> 1.22
# drivers/hotplug/pci_hotplug.h 1.2 -> 1.3
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/19 [email protected] 1.560
# PCI Hotplug: added max bus speed and current bus speed files to the pci hotplug core. #
# Patch based on work done by Irene Zubarev <[email protected]>
# --------------------------------------------
#
drivers/hotplug/pci_hotplug.h +27 -1
@@ -29,6 +29,22 @@#define _PCI_HOTPLUG_H +/* These values come from the PCI Hotplug Spec */ +enum pci_bus_speed { + PCI_SPEED_33MHz =0x00 , + PCI_SPEED_66MHz =0x01 , + PCI_SPEED_66MHz_PCIX =0x02 , + PCI_SPEED_100MHz_PCIX =0x03 , + PCI_SPEED_133MHz_PCIX =0x04 , + PCI_SPEED_66MHz_PCIX_266 =0x09 , + PCI_SPEED_100MHz_PCIX_266 =0x0a , + PCI_SPEED_133MHz_PCIX_266 =0x0b , + PCI_SPEED_66MHz_PCIX_533 =0x11 , + PCI_SPEED_100MHz_PCIX_533 =0X12 , + PCI_SPEED_133MHz_PCIX_533 =0x13 , +PCI_SPEED_UNKNOWN =0xff , +}; +struct hotplug_slot ;struct hotplug_slot_core ;
@@ -50,7 +66,13 @@* @get_latch_status: Called to get the current latch status of a slot. * If this field is NULL, the value passed in the struct hotplug_slot_info * will be used when this value is requested by a user. -* @get_adapter_present: Called to get see if an adapter is present in the slot or not. +* @get_adapter_status: Called to get see if an adapter is present in the slot or not. +* If this field is NULL, the value passed in the struct hotplug_slot_info +* will be used when this value is requested by a user. +* @get_max_bus_speed: Called to get the max bus speed for a slot. +* If this field is NULL, the value passed in the struct hotplug_slot_info +* will be used when this value is requested by a user. +* @get_cur_bus_speed: Called to get the current bus speed for a slot. * If this field is NULL, the value passed in the struct hotplug_slot_info * will be used when this value is requested by a user. *
@@ -69,6 +91,8 @@int (*get_attention_status) (struct hotplug_slot *slot,u8 *value);int (*get_latch_status) (struct hotplug_slot *slot,u8 *value);int (*get_adapter_status) (struct hotplug_slot *slot,u8 *value); +int (*get_max_bus_speed) (struct hotplug_slot *slot,enum pci_bus_speed *value); +int (*get_cur_bus_speed) (struct hotplug_slot *slot,enum pci_bus_speed *value); };/**
@@ -85,6 +109,8 @@u8 attention_status;u8 latch_status;u8 adapter_status; +enum pci_bus_speed max_bus_speed; +enum pci_bus_speed cur_bus_speed; };/**
drivers/hotplug/pci_hotplug_core.c +215 -34
320 lines not on this page · raw message
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.560 -> 1.561
# drivers/hotplug/cpqphp_core.c 1.8 -> 1.9
# drivers/hotplug/cpqphp.h 1.3 -> 1.4
# drivers/hotplug/cpqphp_ctrl.c 1.4 -> 1.5
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/19 [email protected] 1.561
# PCI Hotplug: added speed status to the Compaq driver.
# --------------------------------------------
#
drivers/hotplug/cpqphp.h +3 -6
@@ -305,8 +305,8 @@u8 first_slot;u8 add_support;u8 push_flag; -u8 speed;/* 0 = 33MHz, 1 = 66MHz */ -u8 speed_capability;/* 0 = 33MHz, 1 = 66MHz */ +enum pci_bus_speed speed; +enum pci_bus_speed speed_capability;u8 push_button;/* 0 = no pushbutton, 1 = pushbutton present */ u8 slot_switch_type;/* 0 = no switch, 1 = switch present */ u8 defeature_PHP;/* 0 = PHP not supported, 1 = PHP supported */
@@ -321,9 +321,6 @@wait_queue_head_t queue;/* sleep & wake process */ }; -#define CTRL_SPEED_33MHz 0 -#define CTRL_SPEED_66MHz 1 -struct irq_mapping {u8 barber_pole;u8 valid_INT;
@@ -635,7 +632,7 @@u16 misc; misc =readw (ctrl->hpc_reg +MISC ); -return (misc &0x0800 ) ?1 :0 ; +return (misc &0x0800 ) ? PCI_SPEED_66MHz : PCI_SPEED_33MHz; }
drivers/hotplug/cpqphp_core.c +54 -12
130 lines not on this page · raw message
drivers/hotplug/cpqphp_ctrl.c +2 -2
@@ -1187,7 +1187,7 @@//********************************* rc =CARD_FUNCTIONING ; }else { -if (ctrl->speed ==1 ) { +if (ctrl->speed == PCI_SPEED_66MHz) {// Wait for exclusive access to hardware down (&ctrl->crit_sect);
@@ -1385,7 +1385,7 @@dbg ("%s: func->device, slot_offset, hp_slot = %d, %d ,%d\n" , __FUNCTION__, func->device, ctrl->slot_device_offset, hp_slot); -if (ctrl->speed ==1 ) { +if (ctrl->speed == PCI_SPEED_66MHz) {// Wait for exclusive access to hardware down (&ctrl->crit_sect);
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.561 -> 1.562
# drivers/hotplug/ibmphp_core.c 1.11 -> 1.12
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/19 [email protected] 1.562
# PCI Hotplug: added speed status to the IBM driver.
# --------------------------------------------
#
drivers/hotplug/ibmphp_core.c +17 -15
@@ -384,14 +384,15 @@debug ("get_adapter_present - Exit rc[%d] hpcrc[%x] value[%x]\n" , rc, hpcrc, *value);return rc; } -/* -static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, u8 * value) + +static int get_max_bus_speed (struct hotplug_slot *hotplug_slot,enum pci_bus_speed *value) {int rc = -ENODEV ;struct slot *pslot;u8 mode =0 ; -debug ("get_max_bus_speed - Entry hotplug_slot[%lx] pvalue[%lx]\n", (ulong)hotplug_slot, (ulong) value); +debug ("%s - Entry hotplug_slot[%p] pvalue[%p]\n" , __FUNCTION__, + hotplug_slot, value);ibmphp_lock_operations ();
@@ -413,25 +414,26 @@ *value = pslot->supported_speed +0x01 ;break ;default : -*/ /* Note (will need to change): there would be soon 256, 512 also */ -/* rc = -ENODEV; +/* Note (will need to change): there would be soon 256, 512 also */ + rc = -ENODEV ; } } }else rc = -ENODEV ;ibmphp_unlock_operations (); -debug ("get_max_bus_speed - Exit rc[%d] value[%x]\n", rc, *value); +debug ("%s - Exit rc[%d] value[%x]\n" , __FUNCTION__, rc, *value);return rc; } -static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, u8 * value) +static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot,enum pci_bus_speed *value) {int rc = -ENODEV ;struct slot *pslot;u8 mode =0 ; -debug ("get_cur_bus_speed - Entry hotplug_slot[%lx] pvalue[%lx]\n", (ulong)hotplug_slot, (ulong) value); +debug ("%s - Entry hotplug_slot[%p] pvalue[%p]\n" , __FUNCTION__, + hotplug_slot, value);ibmphp_lock_operations ();
@@ -458,8 +460,8 @@ *value +=0x01 ;break ;default : -*/ /* Note of change: there would also be 256, 512 soon */ -/* rc = -ENODEV; +/* Note of change: there would also be 256, 512 soon */ + rc = -ENODEV ; } } }
@@ -467,10 +469,10 @@ rc = -ENODEV ;ibmphp_unlock_operations (); -debug ("get_cur_bus_speed - Exit rc[%d] value[%x]\n" , rc, *value); +debug ("%s - Exit rc[%d] value[%x]\n" , __FUNCTION__, rc, *value);return rc; } - +/* static int get_max_adapter_speed_1 (struct hotplug_slot *hotplug_slot, u8 * value, u8 flag) { int rc = -ENODEV;
@@ -1584,9 +1586,9 @@ .get_attention_status = get_attention_status, .get_latch_status = get_latch_status, .get_adapter_status = get_adapter_present, -/* .get_max_bus_speed_status = get_max_bus_speed, -.get_max_adapter_speed_status = get_max_adapter_speed, -.get_cur_bus_speed_status = get_cur_bus_speed, + .get_max_bus_speed = get_max_bus_speed, + .get_cur_bus_speed = get_cur_bus_speed, +/* .get_max_adapter_speed = get_max_adapter_speed, .get_bus_name_status = get_bus_name, */ };
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.562 -> 1.563
# drivers/hotplug/pci_hotplug_core.c 1.22 -> 1.23
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/19 [email protected] 1.563
# PCI Hotplug Core: Add allocation sanity checks. Patch from Silvio Cesare # --------------------------------------------
#
drivers/hotplug/pci_hotplug_core.c +3 -3
@@ -621,7 +621,7 @@if (*offset <0 )return -EINVAL ; -if (count <=0 ) +if (count ==0 || count >16384 )return 0 ;if (*offset !=0 )return 0 ;
@@ -732,7 +732,7 @@if (*offset <0 )return -EINVAL ; -if (count <=0 ) +if (count ==0 || count >16384 )return 0 ;if (*offset !=0 )return 0 ;
@@ -970,7 +970,7 @@if (*offset <0 )return -EINVAL ; -if (count <=0 ) +if (count ==0 || count >16384 )return 0 ;if (*offset !=0 )return 0 ;
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.563 -> 1.564
# drivers/hotplug/pci_hotplug_core.c 1.23 -> 1.24
# drivers/pci/proc.c 1.18 -> 1.19
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/19 [email protected] 1.564
# PCI Hotplug: created /proc/bus/pci/slots for pcihpfs to be mounted on. #
# proc_bus_pci_dir had to be exported for this to work properly. # -------------------------------------------- # diff -Nru a/drivers/hotplug/pci_hotplug_core.c b/drivers/hotplug/pci_hotplug_core.c --- a/drivers/hotplug/pci_hotplug_core.c Thu Sep 19 17:50:33 2002 +++ b/drivers/hotplug/pci_hotplug_core.c Thu Sep 19 17:50:33 2002 @@ -39,6 +39,7 @@ #include <linux/namei.h> #include <linux/pci.h> #include <linux/dnotify.h> +#include <linux/proc_fs.h> #include <asm/uaccess.h> #include "pci_hotplug.h"
@@ -113,6 +114,12 @@
"133 MHz PCIX 533", /* 0x13 */
};
+#ifdef CONFIG_PROC_FS
+extern struct proc_dir_entry *proc_bus_pci_dir;
+static struct proc_dir_entry *slotdir = NULL;
+static const char *slotdir_name = "slots";
+#endif
+
static struct inode *pcihpfs_get_inode (struct super_block *sb, int mode, int dev) {
struct inode *inode = new_inode(sb);
@@ -1265,6 +1272,11 @@
goto exit;
}
+#ifdef CONFIG_PROC_FS
+ /* create mount point for pcihpfs */
+ slotdir = proc_mkdir(slotdir_name, proc_bus_pci_dir);
+#endif
+
info (DRIVER_DESC " version: " DRIVER_VERSION "\n");
exit:
@@ -1274,6 +1286,11 @@
static void __exit pci_hotplug_exit (void)
{
unregister_filesystem(&pcihpfs_type);
+
+#ifdef CONFIG_PROC_FS
+ if (slotdir)
+ remove_proc_entry(slotdir_name, proc_bus_pci_dir);
+#endif
}
module_init(pci_hotplug_init);
drivers/pci/proc.c +2 -1
@@ -371,7 +371,7 @@ show: show_device }; -static struct proc_dir_entry *proc_bus_pci_dir; +struct proc_dir_entry *proc_bus_pci_dir;/* driverfs files */ static ssize_t pci_show_irq (struct device * dev,char * buf,size_t count,loff_t off)
@@ -621,5 +621,6 @@EXPORT_SYMBOL (pci_proc_detach_device);EXPORT_SYMBOL (pci_proc_attach_bus);EXPORT_SYMBOL (pci_proc_detach_bus); +EXPORT_SYMBOL (proc_bus_pci_dir);#endif