aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2009-09-15 04:29:49 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-09-17 13:06:18 -0400
commit6aaa6d06f57f3689afe27c1fad256c5d6aa9b271 (patch)
tree37046e6aa57d03d9b5a890dc9bde34afe1b2f48e /drivers/pci/hotplug
parent5f9cab7af6f7ef1e3cbb25217617eb5bd082aa7b (diff)
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: Alex Chiang <achiang@hp.com> Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r--drivers/pci/hotplug/pciehp.h1
-rw-r--r--drivers/pci/hotplug/pciehp_ctrl.c14
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c1
3 files changed, 0 insertions, 16 deletions
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h
index 2509984d9611..720844e0389d 100644
--- a/drivers/pci/hotplug/pciehp.h
+++ b/drivers/pci/hotplug/pciehp.h
@@ -88,7 +88,6 @@ struct event_info {
88}; 88};
89 89
90struct controller { 90struct controller {
91 struct mutex crit_sect; /* critical section mutex */
92 struct mutex ctrl_lock; /* controller lock */ 91 struct mutex ctrl_lock; /* controller lock */
93 struct pci_dev *pci_dev; 92 struct pci_dev *pci_dev;
94 struct pcie_device *pcie; /* PCI Express port service */ 93 struct pcie_device *pcie; /* PCI Express port service */
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
index beb081703fd8..b3c9ae580d91 100644
--- a/drivers/pci/hotplug/pciehp_ctrl.c
+++ b/drivers/pci/hotplug/pciehp_ctrl.c
@@ -519,13 +519,9 @@ int pciehp_enable_slot(struct slot *p_slot)
519 int rc; 519 int rc;
520 struct controller *ctrl = p_slot->ctrl; 520 struct controller *ctrl = p_slot->ctrl;
521 521
522 /* Check to see if (latch closed, card present, power off) */
523 mutex_lock(&p_slot->ctrl->crit_sect);
524
525 rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); 522 rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
526 if (rc || !getstatus) { 523 if (rc || !getstatus) {
527 ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot)); 524 ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot));
528 mutex_unlock(&p_slot->ctrl->crit_sect);
529 return -ENODEV; 525 return -ENODEV;
530 } 526 }
531 if (MRL_SENS(p_slot->ctrl)) { 527 if (MRL_SENS(p_slot->ctrl)) {
@@ -533,7 +529,6 @@ int pciehp_enable_slot(struct slot *p_slot)
533 if (rc || getstatus) { 529 if (rc || getstatus) {
534 ctrl_info(ctrl, "Latch open on slot(%s)\n", 530 ctrl_info(ctrl, "Latch open on slot(%s)\n",
535 slot_name(p_slot)); 531 slot_name(p_slot));
536 mutex_unlock(&p_slot->ctrl->crit_sect);
537 return -ENODEV; 532 return -ENODEV;
538 } 533 }
539 } 534 }
@@ -543,7 +538,6 @@ int pciehp_enable_slot(struct slot *p_slot)
543 if (rc || getstatus) { 538 if (rc || getstatus) {
544 ctrl_info(ctrl, "Already enabled on slot(%s)\n", 539 ctrl_info(ctrl, "Already enabled on slot(%s)\n",
545 slot_name(p_slot)); 540 slot_name(p_slot));
546 mutex_unlock(&p_slot->ctrl->crit_sect);
547 return -EINVAL; 541 return -EINVAL;
548 } 542 }
549 } 543 }
@@ -557,7 +551,6 @@ int pciehp_enable_slot(struct slot *p_slot)
557 551
558 update_slot_info(p_slot); 552 update_slot_info(p_slot);
559 553
560 mutex_unlock(&p_slot->ctrl->crit_sect);
561 return rc; 554 return rc;
562} 555}
563 556
@@ -571,15 +564,11 @@ int pciehp_disable_slot(struct slot *p_slot)
571 if (!p_slot->ctrl) 564 if (!p_slot->ctrl)
572 return 1; 565 return 1;
573 566
574 /* Check to see if (latch closed, card present, power on) */
575 mutex_lock(&p_slot->ctrl->crit_sect);
576
577 if (!HP_SUPR_RM(p_slot->ctrl)) { 567 if (!HP_SUPR_RM(p_slot->ctrl)) {
578 ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); 568 ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
579 if (ret || !getstatus) { 569 if (ret || !getstatus) {
580 ctrl_info(ctrl, "No adapter on slot(%s)\n", 570 ctrl_info(ctrl, "No adapter on slot(%s)\n",
581 slot_name(p_slot)); 571 slot_name(p_slot));
582 mutex_unlock(&p_slot->ctrl->crit_sect);
583 return -ENODEV; 572 return -ENODEV;
584 } 573 }
585 } 574 }
@@ -589,7 +578,6 @@ int pciehp_disable_slot(struct slot *p_slot)
589 if (ret || getstatus) { 578 if (ret || getstatus) {
590 ctrl_info(ctrl, "Latch open on slot(%s)\n", 579 ctrl_info(ctrl, "Latch open on slot(%s)\n",
591 slot_name(p_slot)); 580 slot_name(p_slot));
592 mutex_unlock(&p_slot->ctrl->crit_sect);
593 return -ENODEV; 581 return -ENODEV;
594 } 582 }
595 } 583 }
@@ -599,7 +587,6 @@ int pciehp_disable_slot(struct slot *p_slot)
599 if (ret || !getstatus) { 587 if (ret || !getstatus) {
600 ctrl_info(ctrl, "Already disabled on slot(%s)\n", 588 ctrl_info(ctrl, "Already disabled on slot(%s)\n",
601 slot_name(p_slot)); 589 slot_name(p_slot));
602 mutex_unlock(&p_slot->ctrl->crit_sect);
603 return -EINVAL; 590 return -EINVAL;
604 } 591 }
605 } 592 }
@@ -607,7 +594,6 @@ int pciehp_disable_slot(struct slot *p_slot)
607 ret = remove_board(p_slot); 594 ret = remove_board(p_slot);
608 update_slot_info(p_slot); 595 update_slot_info(p_slot);
609 596
610 mutex_unlock(&p_slot->ctrl->crit_sect);
611 return ret; 597 return ret;
612} 598}
613 599
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 7374029316ec..b1dcf9aa80bc 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -1017,7 +1017,6 @@ struct controller *pcie_init(struct pcie_device *dev)
1017 1017
1018 ctrl->slot_cap = slot_cap; 1018 ctrl->slot_cap = slot_cap;
1019 ctrl->hpc_ops = &pciehp_hpc_ops; 1019 ctrl->hpc_ops = &pciehp_hpc_ops;
1020 mutex_init(&ctrl->crit_sect);
1021 mutex_init(&ctrl->ctrl_lock); 1020 mutex_init(&ctrl->ctrl_lock);
1022 init_waitqueue_head(&ctrl->queue); 1021 init_waitqueue_head(&ctrl->queue);
1023 dbg_ctrl(ctrl); 1022 dbg_ctrl(ctrl);