* an Attention Button press
* @lock: protects reads and writes of @state;
* protects scheduling, execution and cancellation of @work
- * @hotplug_lock: serializes calls to pciehp_enable_slot() and
- * pciehp_disable_slot()
*/
struct slot {
u8 state;
struct hotplug_slot *hotplug_slot;
struct delayed_work work;
struct mutex lock;
- struct mutex hotplug_lock;
};
/**
}
}
-/*
- * Note: This function must be called with slot->hotplug_lock held
- */
static int __pciehp_enable_slot(struct slot *p_slot)
{
u8 getstatus = 0;
struct controller *ctrl = slot->ctrl;
int ret;
- mutex_lock(&slot->hotplug_lock);
ret = __pciehp_enable_slot(slot);
- mutex_unlock(&slot->hotplug_lock);
-
if (ret && ATTN_BUTTN(ctrl))
pciehp_green_led_off(slot); /* may be blinking */
return ret;
}
-/*
- * Note: This function must be called with slot->hotplug_lock held
- */
static int __pciehp_disable_slot(struct slot *p_slot)
{
u8 getstatus = 0;
{
int ret;
- mutex_lock(&slot->hotplug_lock);
ret = __pciehp_disable_slot(slot);
- mutex_unlock(&slot->hotplug_lock);
mutex_lock(&slot->lock);
slot->state = OFF_STATE;