aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/shpchp_core.c
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2006-02-21 15:45:48 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-23 14:35:13 -0800
commita246fa4e9f0f1b5096a1cad0659d22fb10fb3732 (patch)
tree21490f4d1d2794a9ccd64529431fbbd8f4e234e7 /drivers/pci/hotplug/shpchp_core.c
parentf7391f5325ea744f0632f7ef39a90085162743ac (diff)
downloadkernel_samsung_smdk4412-a246fa4e9f0f1b5096a1cad0659d22fb10fb3732.zip
kernel_samsung_smdk4412-a246fa4e9f0f1b5096a1cad0659d22fb10fb3732.tar.gz
kernel_samsung_smdk4412-a246fa4e9f0f1b5096a1cad0659d22fb10fb3732.tar.bz2
[PATCH] shpchp: Fix slot state handling
Current SHPCHP driver doesn't care about the confliction between hotplug operation via sysfs and hotplug operation via attention button. So if those ware conflicted, slot could be an unexpected state. This patch changes SHPCHP driver to handle slot state properly. With this patch, slot events are handled according to the current slot state as shown at the Table below. Table. Slot States and Event Handling ========================================================================= Slot State Event and Action ========================================================================= STATIC - Go to POWERON state if user initiates (Slot enabled, insertion request via sysfs Slot disabled) - Go to POWEROFF state if user initiates removal request via sysfs - Go to BLINKINGON state if user presses attention button when the slot is disabled - Go to BLINKINGOFF state if user presses attention button when the slot is enabled
Diffstat (limited to 'drivers/pci/hotplug/shpchp_core.c')
-rw-r--r--drivers/pci/hotplug/shpchp_core.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c
index 5de659d..fa60ae4 100644
--- a/drivers/pci/hotplug/shpchp_core.c
+++ b/drivers/pci/hotplug/shpchp_core.c
@@ -136,13 +136,14 @@ static int init_slots(struct controller *ctrl)
slot->bus = ctrl->slot_bus;
slot->device = ctrl->slot_device_offset + i;
slot->hpc_ops = ctrl->hpc_ops;
+ mutex_init(&slot->lock);
if (shpchprm_get_physical_slot_number(ctrl, &sun,
slot->bus, slot->device))
goto error_info;
slot->number = sun;
- INIT_WORK(&slot->work, shpchp_pushbutton_thread, slot);
+ INIT_WORK(&slot->work, queue_pushbutton_work, slot);
/* register this slot with the hotplug pci core */
hotplug_slot->private = slot;
@@ -188,6 +189,7 @@ void cleanup_slots(struct controller *ctrl)
slot = list_entry(tmp, struct slot, slot_list);
list_del(&slot->slot_list);
cancel_delayed_work(&slot->work);
+ flush_scheduled_work();
flush_workqueue(shpchp_wq);
pci_hp_deregister(slot->hotplug_slot);
}
@@ -244,7 +246,7 @@ static int enable_slot (struct hotplug_slot *hotplug_slot)
dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
- return shpchp_enable_slot(slot);
+ return shpchp_sysfs_enable_slot(slot);
}
static int disable_slot (struct hotplug_slot *hotplug_slot)
@@ -253,7 +255,7 @@ static int disable_slot (struct hotplug_slot *hotplug_slot)
dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
- return shpchp_disable_slot(slot);
+ return shpchp_sysfs_disable_slot(slot);
}
static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value)