Commit 6aaa6d06 authored by Kenji Kaneshige's avatar Kenji Kaneshige Committed by Jesse Barnes

PCI: pciehp: remove crit_sect mutex

The crit_sect mutex defined in struct controller is to serialize
hot-plug operations against multiple slots under the same bus. But,
since PCIe doesnstream port has only one slot at most, it is
meaningless and we don't need it.
Acked-by: default avatarAlex Chiang <achiang@hp.com>
Signed-off-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 5f9cab7a
...@@ -88,7 +88,6 @@ struct event_info { ...@@ -88,7 +88,6 @@ struct event_info {
}; };
struct controller { struct controller {
struct mutex crit_sect; /* critical section mutex */
struct mutex ctrl_lock; /* controller lock */ struct mutex ctrl_lock; /* controller lock */
struct pci_dev *pci_dev; struct pci_dev *pci_dev;
struct pcie_device *pcie; /* PCI Express port service */ struct pcie_device *pcie; /* PCI Express port service */
......
...@@ -519,13 +519,9 @@ int pciehp_enable_slot(struct slot *p_slot) ...@@ -519,13 +519,9 @@ int pciehp_enable_slot(struct slot *p_slot)
int rc; int rc;
struct controller *ctrl = p_slot->ctrl; struct controller *ctrl = p_slot->ctrl;
/* Check to see if (latch closed, card present, power off) */
mutex_lock(&p_slot->ctrl->crit_sect);
rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
if (rc || !getstatus) { if (rc || !getstatus) {
ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot)); ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot));
mutex_unlock(&p_slot->ctrl->crit_sect);
return -ENODEV; return -ENODEV;
} }
if (MRL_SENS(p_slot->ctrl)) { if (MRL_SENS(p_slot->ctrl)) {
...@@ -533,7 +529,6 @@ int pciehp_enable_slot(struct slot *p_slot) ...@@ -533,7 +529,6 @@ int pciehp_enable_slot(struct slot *p_slot)
if (rc || getstatus) { if (rc || getstatus) {
ctrl_info(ctrl, "Latch open on slot(%s)\n", ctrl_info(ctrl, "Latch open on slot(%s)\n",
slot_name(p_slot)); slot_name(p_slot));
mutex_unlock(&p_slot->ctrl->crit_sect);
return -ENODEV; return -ENODEV;
} }
} }
...@@ -543,7 +538,6 @@ int pciehp_enable_slot(struct slot *p_slot) ...@@ -543,7 +538,6 @@ int pciehp_enable_slot(struct slot *p_slot)
if (rc || getstatus) { if (rc || getstatus) {
ctrl_info(ctrl, "Already enabled on slot(%s)\n", ctrl_info(ctrl, "Already enabled on slot(%s)\n",
slot_name(p_slot)); slot_name(p_slot));
mutex_unlock(&p_slot->ctrl->crit_sect);
return -EINVAL; return -EINVAL;
} }
} }
...@@ -557,7 +551,6 @@ int pciehp_enable_slot(struct slot *p_slot) ...@@ -557,7 +551,6 @@ int pciehp_enable_slot(struct slot *p_slot)
update_slot_info(p_slot); update_slot_info(p_slot);
mutex_unlock(&p_slot->ctrl->crit_sect);
return rc; return rc;
} }
...@@ -571,15 +564,11 @@ int pciehp_disable_slot(struct slot *p_slot) ...@@ -571,15 +564,11 @@ int pciehp_disable_slot(struct slot *p_slot)
if (!p_slot->ctrl) if (!p_slot->ctrl)
return 1; return 1;
/* Check to see if (latch closed, card present, power on) */
mutex_lock(&p_slot->ctrl->crit_sect);
if (!HP_SUPR_RM(p_slot->ctrl)) { if (!HP_SUPR_RM(p_slot->ctrl)) {
ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
if (ret || !getstatus) { if (ret || !getstatus) {
ctrl_info(ctrl, "No adapter on slot(%s)\n", ctrl_info(ctrl, "No adapter on slot(%s)\n",
slot_name(p_slot)); slot_name(p_slot));
mutex_unlock(&p_slot->ctrl->crit_sect);
return -ENODEV; return -ENODEV;
} }
} }
...@@ -589,7 +578,6 @@ int pciehp_disable_slot(struct slot *p_slot) ...@@ -589,7 +578,6 @@ int pciehp_disable_slot(struct slot *p_slot)
if (ret || getstatus) { if (ret || getstatus) {
ctrl_info(ctrl, "Latch open on slot(%s)\n", ctrl_info(ctrl, "Latch open on slot(%s)\n",
slot_name(p_slot)); slot_name(p_slot));
mutex_unlock(&p_slot->ctrl->crit_sect);
return -ENODEV; return -ENODEV;
} }
} }
...@@ -599,7 +587,6 @@ int pciehp_disable_slot(struct slot *p_slot) ...@@ -599,7 +587,6 @@ int pciehp_disable_slot(struct slot *p_slot)
if (ret || !getstatus) { if (ret || !getstatus) {
ctrl_info(ctrl, "Already disabled on slot(%s)\n", ctrl_info(ctrl, "Already disabled on slot(%s)\n",
slot_name(p_slot)); slot_name(p_slot));
mutex_unlock(&p_slot->ctrl->crit_sect);
return -EINVAL; return -EINVAL;
} }
} }
...@@ -607,7 +594,6 @@ int pciehp_disable_slot(struct slot *p_slot) ...@@ -607,7 +594,6 @@ int pciehp_disable_slot(struct slot *p_slot)
ret = remove_board(p_slot); ret = remove_board(p_slot);
update_slot_info(p_slot); update_slot_info(p_slot);
mutex_unlock(&p_slot->ctrl->crit_sect);
return ret; return ret;
} }
......
...@@ -1017,7 +1017,6 @@ struct controller *pcie_init(struct pcie_device *dev) ...@@ -1017,7 +1017,6 @@ struct controller *pcie_init(struct pcie_device *dev)
ctrl->slot_cap = slot_cap; ctrl->slot_cap = slot_cap;
ctrl->hpc_ops = &pciehp_hpc_ops; ctrl->hpc_ops = &pciehp_hpc_ops;
mutex_init(&ctrl->crit_sect);
mutex_init(&ctrl->ctrl_lock); mutex_init(&ctrl->ctrl_lock);
init_waitqueue_head(&ctrl->queue); init_waitqueue_head(&ctrl->queue);
dbg_ctrl(ctrl); dbg_ctrl(ctrl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment