Lines Matching +full:ctrl +full:- +full:ids

1 // SPDX-License-Identifier: GPL-2.0+
6 * Copyright (C) 2001 Greg Kroah-Hartman <greg@kroah.com>
13 * Jan 12, 2003 - Added 66/100/133MHz PCI-X support,
51 #define DRIVER_AUTHOR "Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>"
68 return (readb(slot->p_sm_slot + SMBIOS_SLOT_WIDTH) == 0x06) ? 1 : 0; in is_slot64bit()
73 return (readb(slot->p_sm_slot + SMBIOS_SLOT_TYPE) == 0x0E) ? 1 : 0; in is_slot66mhz()
77 * detect_SMBIOS_pointer - find the System Management BIOS Table in mem region.
90 endp = (end - sizeof(u32) + 1); in detect_SMBIOS_pointer()
115 * init_SERR - Initializes the per slot SERR generation.
116 * @ctrl: controller to use
120 static int init_SERR(struct controller *ctrl) in init_SERR() argument
125 if (!ctrl) in init_SERR()
128 tempdword = ctrl->first_slot; in init_SERR()
130 number_of_slots = readb(ctrl->hpc_reg + SLOT_MASK) & 0x0F; in init_SERR()
133 writeb(0, ctrl->hpc_reg + SLOT_SERR); in init_SERR()
135 number_of_slots--; in init_SERR()
147 return -ENOMEM; in init_cpqhp_routing_table()
153 return -1; in init_cpqhp_routing_table()
170 tbus = cpqhp_routing_table->slots[loop].bus; in pci_print_IRQ_route()
171 tdevice = cpqhp_routing_table->slots[loop].devfn; in pci_print_IRQ_route()
172 tslot = cpqhp_routing_table->slots[loop].slot; in pci_print_IRQ_route()
229 * get_SMBIOS_entry - return the requested SMBIOS entry or %NULL
266 static int ctrl_slot_cleanup(struct controller *ctrl) in ctrl_slot_cleanup() argument
270 old_slot = ctrl->slot; in ctrl_slot_cleanup()
271 ctrl->slot = NULL; in ctrl_slot_cleanup()
274 next_slot = old_slot->next; in ctrl_slot_cleanup()
275 pci_hp_deregister(&old_slot->hotplug_slot); in ctrl_slot_cleanup()
280 cpqhp_remove_debugfs_files(ctrl); in ctrl_slot_cleanup()
283 free_irq(ctrl->interrupt, ctrl); in ctrl_slot_cleanup()
285 iounmap(ctrl->hpc_reg); in ctrl_slot_cleanup()
287 release_mem_region(pci_resource_start(ctrl->pci_dev, 0), in ctrl_slot_cleanup()
288 pci_resource_len(ctrl->pci_dev, 0)); in ctrl_slot_cleanup()
295 * get_slot_mapping - determine logical slot mapping for PCI device
297 * Won't work for more than one PCI-PCI bridge in a slot.
321 tbus = cpqhp_routing_table->slots[loop].bus; in get_slot_mapping()
322 tdevice = cpqhp_routing_table->slots[loop].devfn >> 3; in get_slot_mapping()
323 tslot = cpqhp_routing_table->slots[loop].slot; in get_slot_mapping()
330 * if the current IRQ table entry is a PCI-to-PCI in get_slot_mapping()
338 bus->number = tbus; in get_slot_mapping()
356 * is on the other side of a PCI-to-PCI bridge, return the slot number in get_slot_mapping()
364 return -1; in get_slot_mapping()
369 * cpqhp_set_attention_status - Turns the Amber LED for a slot on or off
370 * @ctrl: struct controller to use
375 cpqhp_set_attention_status(struct controller *ctrl, struct pci_func *func, in cpqhp_set_attention_status() argument
383 hp_slot = func->device - ctrl->slot_device_offset; in cpqhp_set_attention_status()
386 mutex_lock(&ctrl->crit_sect); in cpqhp_set_attention_status()
389 amber_LED_on(ctrl, hp_slot); in cpqhp_set_attention_status()
391 amber_LED_off(ctrl, hp_slot); in cpqhp_set_attention_status()
394 mutex_unlock(&ctrl->crit_sect); in cpqhp_set_attention_status()
398 set_SOGO(ctrl); in cpqhp_set_attention_status()
401 wait_for_ctrl_irq(ctrl); in cpqhp_set_attention_status()
404 mutex_unlock(&ctrl->crit_sect); in cpqhp_set_attention_status()
411 * set_attention_status - Turns the Amber LED for a slot on or off
419 struct controller *ctrl = slot->ctrl; in set_attention_status() local
425 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); in set_attention_status()
427 if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1) in set_attention_status()
428 return -ENODEV; in set_attention_status()
436 return -ENODEV; in set_attention_status()
438 return cpqhp_set_attention_status(ctrl, slot_func, status); in set_attention_status()
446 struct controller *ctrl = slot->ctrl; in process_SI() local
452 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); in process_SI()
454 if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1) in process_SI()
455 return -ENODEV; in process_SI()
463 return -ENODEV; in process_SI()
465 slot_func->bus = bus; in process_SI()
466 slot_func->device = device; in process_SI()
467 slot_func->function = function; in process_SI()
468 slot_func->configured = 0; in process_SI()
469 dbg("board_added(%p, %p)\n", slot_func, ctrl); in process_SI()
470 return cpqhp_process_SI(ctrl, slot_func); in process_SI()
478 struct controller *ctrl = slot->ctrl; in process_SS() local
484 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); in process_SS()
486 if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1) in process_SS()
487 return -ENODEV; in process_SS()
495 return -ENODEV; in process_SS()
497 dbg("In %s, slot_func = %p, ctrl = %p\n", __func__, slot_func, ctrl); in process_SS()
498 return cpqhp_process_SS(ctrl, slot_func); in process_SS()
505 struct controller *ctrl = slot->ctrl; in hardware_test() local
507 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); in hardware_test()
509 return cpqhp_hardware_test(ctrl, value); in hardware_test()
516 struct controller *ctrl = slot->ctrl; in get_power_status() local
518 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); in get_power_status()
520 *value = get_slot_enabled(ctrl, slot); in get_power_status()
527 struct controller *ctrl = slot->ctrl; in get_attention_status() local
529 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); in get_attention_status()
531 *value = cpq_get_attention_status(ctrl, slot); in get_attention_status()
538 struct controller *ctrl = slot->ctrl; in get_latch_status() local
540 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); in get_latch_status()
542 *value = cpq_get_latch_status(ctrl, slot); in get_latch_status()
550 struct controller *ctrl = slot->ctrl; in get_adapter_status() local
552 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); in get_adapter_status()
554 *value = get_presence_status(ctrl, slot); in get_adapter_status()
572 static int ctrl_slot_setup(struct controller *ctrl, in ctrl_slot_setup() argument
577 struct pci_bus *bus = ctrl->pci_bus; in ctrl_slot_setup()
589 tempdword = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); in ctrl_slot_setup()
591 number_of_slots = readb(ctrl->hpc_reg + SLOT_MASK) & 0x0F; in ctrl_slot_setup()
592 slot_device = readb(ctrl->hpc_reg + SLOT_MASK) >> 4; in ctrl_slot_setup()
593 slot_number = ctrl->first_slot; in ctrl_slot_setup()
598 result = -ENOMEM; in ctrl_slot_setup()
602 slot->ctrl = ctrl; in ctrl_slot_setup()
603 slot->bus = ctrl->bus; in ctrl_slot_setup()
604 slot->device = slot_device; in ctrl_slot_setup()
605 slot->number = slot_number; in ctrl_slot_setup()
606 dbg("slot->number = %u\n", slot->number); in ctrl_slot_setup()
612 slot->number)) { in ctrl_slot_setup()
617 slot->p_sm_slot = slot_entry; in ctrl_slot_setup()
619 timer_setup(&slot->task_event, cpqhp_pushbutton_thread, 0); in ctrl_slot_setup()
620 slot->task_event.expires = jiffies + 5 * HZ; in ctrl_slot_setup()
625 slot->capabilities |= PCISLOT_REPLACE_SUPPORTED; in ctrl_slot_setup()
626 slot->capabilities |= PCISLOT_INTERLOCK_SUPPORTED; in ctrl_slot_setup()
629 slot->capabilities |= PCISLOT_64_BIT_SUPPORTED; in ctrl_slot_setup()
631 slot->capabilities |= PCISLOT_66_MHZ_SUPPORTED; in ctrl_slot_setup()
632 if (bus->cur_bus_speed == PCI_SPEED_66MHz) in ctrl_slot_setup()
633 slot->capabilities |= PCISLOT_66_MHZ_OPERATION; in ctrl_slot_setup()
636 slot_device - (readb(ctrl->hpc_reg + SLOT_MASK) >> 4); in ctrl_slot_setup()
639 slot->capabilities |= in ctrl_slot_setup()
643 slot->capabilities |= in ctrl_slot_setup()
646 slot->capabilities |= in ctrl_slot_setup()
647 ((read_slot_enable(ctrl) << 2) >> ctrl_slot) & 0x04; in ctrl_slot_setup()
650 snprintf(name, SLOT_NAME_SIZE, "%u", slot->number); in ctrl_slot_setup()
651 slot->hotplug_slot.ops = &cpqphp_hotplug_slot_ops; in ctrl_slot_setup()
653 dbg("registering bus %d, dev %d, number %d, ctrl->slot_device_offset %d, slot %d\n", in ctrl_slot_setup()
654 slot->bus, slot->device, in ctrl_slot_setup()
655 slot->number, ctrl->slot_device_offset, in ctrl_slot_setup()
657 result = pci_hp_register(&slot->hotplug_slot, in ctrl_slot_setup()
658 ctrl->pci_dev->bus, in ctrl_slot_setup()
659 slot->device, in ctrl_slot_setup()
666 slot->next = ctrl->slot; in ctrl_slot_setup()
667 ctrl->slot = slot; in ctrl_slot_setup()
669 number_of_slots--; in ctrl_slot_setup()
716 retval = -EIO; in one_time_init()
730 retval = -EIO; in one_time_init()
738 retval = -EIO; in one_time_init()
765 struct controller *ctrl; in cpqhpc_probe() local
777 bus = pdev->subordinate; in cpqhpc_probe()
780 rc = -ENODEV; in cpqhpc_probe()
787 vendor_id = pdev->vendor; in cpqhpc_probe()
791 rc = -ENODEV; in cpqhpc_probe()
796 dbg("revision: %d\n", pdev->revision); in cpqhpc_probe()
797 if ((vendor_id == PCI_VENDOR_ID_COMPAQ) && (!pdev->revision)) { in cpqhpc_probe()
799 rc = -ENODEV; in cpqhpc_probe()
803 /* Check for the proper subsystem IDs in cpqhpc_probe()
808 if ((pdev->revision <= 2) && (vendor_id != PCI_VENDOR_ID_INTEL)) { in cpqhpc_probe()
810 rc = -ENODEV; in cpqhpc_probe()
814 /* TODO: This code can be made to support non-Compaq or Intel in cpqhpc_probe()
815 * subsystem IDs in cpqhpc_probe()
817 subsystem_vid = pdev->subsystem_vendor; in cpqhpc_probe()
821 rc = -ENODEV; in cpqhpc_probe()
825 ctrl = kzalloc(sizeof(struct controller), GFP_KERNEL); in cpqhpc_probe()
826 if (!ctrl) { in cpqhpc_probe()
827 rc = -ENOMEM; in cpqhpc_probe()
831 subsystem_deviceid = pdev->subsystem_device; in cpqhpc_probe()
838 ctrl->vendor_id = vendor_id; in cpqhpc_probe()
842 if (pdev->revision >= 0x13) { /* CIOBX */ in cpqhpc_probe()
843 ctrl->push_flag = 1; in cpqhpc_probe()
844 ctrl->slot_switch_type = 1; in cpqhpc_probe()
845 ctrl->push_button = 1; in cpqhpc_probe()
846 ctrl->pci_config_space = 1; in cpqhpc_probe()
847 ctrl->defeature_PHP = 1; in cpqhpc_probe()
848 ctrl->pcix_support = 1; in cpqhpc_probe()
849 ctrl->pcix_speed_capability = 1; in cpqhpc_probe()
852 dbg("bus max supports 133MHz PCI-X\n"); in cpqhpc_probe()
853 bus->max_bus_speed = PCI_SPEED_133MHz_PCIX; in cpqhpc_probe()
857 dbg("bus max supports 100MHz PCI-X\n"); in cpqhpc_probe()
858 bus->max_bus_speed = PCI_SPEED_100MHz_PCIX; in cpqhpc_probe()
862 dbg("bus max supports 66MHz PCI-X\n"); in cpqhpc_probe()
863 bus->max_bus_speed = PCI_SPEED_66MHz_PCIX; in cpqhpc_probe()
868 bus->max_bus_speed = PCI_SPEED_66MHz; in cpqhpc_probe()
878 ctrl->slot_switch_type = 1; in cpqhpc_probe()
879 bus->max_bus_speed = PCI_SPEED_33MHz; in cpqhpc_probe()
880 ctrl->push_button = 0; in cpqhpc_probe()
881 ctrl->pci_config_space = 1; in cpqhpc_probe()
882 ctrl->defeature_PHP = 1; in cpqhpc_probe()
883 ctrl->pcix_support = 0; in cpqhpc_probe()
884 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
888 ctrl->push_flag = 1; in cpqhpc_probe()
889 ctrl->slot_switch_type = 1; in cpqhpc_probe()
890 bus->max_bus_speed = PCI_SPEED_33MHz; in cpqhpc_probe()
891 ctrl->push_button = 1; in cpqhpc_probe()
892 ctrl->pci_config_space = 1; in cpqhpc_probe()
893 ctrl->defeature_PHP = 1; in cpqhpc_probe()
894 ctrl->pcix_support = 0; in cpqhpc_probe()
895 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
899 ctrl->slot_switch_type = 1; in cpqhpc_probe()
900 bus->max_bus_speed = PCI_SPEED_33MHz; in cpqhpc_probe()
901 ctrl->push_button = 0; in cpqhpc_probe()
902 ctrl->pci_config_space = 1; in cpqhpc_probe()
903 ctrl->defeature_PHP = 1; in cpqhpc_probe()
904 ctrl->pcix_support = 0; in cpqhpc_probe()
905 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
909 ctrl->push_flag = 1; in cpqhpc_probe()
910 ctrl->slot_switch_type = 1; in cpqhpc_probe()
911 bus->max_bus_speed = PCI_SPEED_66MHz; in cpqhpc_probe()
912 ctrl->push_button = 1; in cpqhpc_probe()
913 ctrl->pci_config_space = 1; in cpqhpc_probe()
914 ctrl->defeature_PHP = 1; in cpqhpc_probe()
915 ctrl->pcix_support = 0; in cpqhpc_probe()
916 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
919 /* First PCI-X implementation, 100MHz */ in cpqhpc_probe()
920 ctrl->push_flag = 1; in cpqhpc_probe()
921 ctrl->slot_switch_type = 1; in cpqhpc_probe()
922 bus->max_bus_speed = PCI_SPEED_100MHz_PCIX; in cpqhpc_probe()
923 ctrl->push_button = 1; in cpqhpc_probe()
924 ctrl->pci_config_space = 1; in cpqhpc_probe()
925 ctrl->defeature_PHP = 1; in cpqhpc_probe()
926 ctrl->pcix_support = 1; in cpqhpc_probe()
927 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
931 rc = -ENODEV; in cpqhpc_probe()
939 bus->max_bus_speed = PCI_SPEED_66MHz; in cpqhpc_probe()
941 bus->max_bus_speed = PCI_SPEED_33MHz; in cpqhpc_probe()
945 ctrl->push_button = 0; in cpqhpc_probe()
947 ctrl->push_button = 1; in cpqhpc_probe()
951 ctrl->slot_switch_type = 0; in cpqhpc_probe()
953 ctrl->slot_switch_type = 1; in cpqhpc_probe()
955 /* PHP Status (0=De-feature PHP, 1=Normal operation) */ in cpqhpc_probe()
957 ctrl->defeature_PHP = 1; /* PHP supported */ in cpqhpc_probe()
959 ctrl->defeature_PHP = 0; /* PHP not supported */ in cpqhpc_probe()
965 ctrl->alternate_base_address = 1; in cpqhpc_probe()
967 ctrl->alternate_base_address = 0; in cpqhpc_probe()
971 ctrl->pci_config_space = 1; in cpqhpc_probe()
973 ctrl->pci_config_space = 0; in cpqhpc_probe()
975 /* PCI-X support */ in cpqhpc_probe()
977 ctrl->pcix_support = 1; in cpqhpc_probe()
979 /* 133MHz PCI-X if bit 7 is 1 */ in cpqhpc_probe()
980 ctrl->pcix_speed_capability = 1; in cpqhpc_probe()
982 /* 100MHz PCI-X if bit 7 is 1 and bit 0 is 0, */ in cpqhpc_probe()
983 /* 66MHz PCI-X if bit 7 is 1 and bit 0 is 1 */ in cpqhpc_probe()
984 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
987 ctrl->pcix_support = 0; in cpqhpc_probe()
988 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
994 rc = -ENODEV; in cpqhpc_probe()
1000 pdev->bus->number); in cpqhpc_probe()
1003 dbg(" speed_capability %d\n", bus->max_bus_speed); in cpqhpc_probe()
1004 dbg(" slot_switch_type %s\n", ctrl->slot_switch_type ? in cpqhpc_probe()
1006 dbg(" defeature_PHP %s\n", ctrl->defeature_PHP ? in cpqhpc_probe()
1008 dbg(" alternate_base_address %s\n", ctrl->alternate_base_address ? in cpqhpc_probe()
1010 dbg(" pci_config_space %s\n", ctrl->pci_config_space ? in cpqhpc_probe()
1012 dbg(" pcix_speed_capability %s\n", ctrl->pcix_speed_capability ? in cpqhpc_probe()
1014 dbg(" pcix_support %s\n", ctrl->pcix_support ? in cpqhpc_probe()
1017 ctrl->pci_dev = pdev; in cpqhpc_probe()
1018 pci_set_drvdata(pdev, ctrl); in cpqhpc_probe()
1022 ctrl->pci_bus = kmemdup(pdev->bus, sizeof(*ctrl->pci_bus), GFP_KERNEL); in cpqhpc_probe()
1023 if (!ctrl->pci_bus) { in cpqhpc_probe()
1025 rc = -ENOMEM; in cpqhpc_probe()
1029 ctrl->bus = pdev->bus->number; in cpqhpc_probe()
1030 ctrl->rev = pdev->revision; in cpqhpc_probe()
1031 dbg("bus device function rev: %d %d %d %d\n", ctrl->bus, in cpqhpc_probe()
1032 PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), ctrl->rev); in cpqhpc_probe()
1034 mutex_init(&ctrl->crit_sect); in cpqhpc_probe()
1035 init_waitqueue_head(&ctrl->queue); in cpqhpc_probe()
1049 rc = -ENOMEM; in cpqhpc_probe()
1053 ctrl->hpc_reg = ioremap(pci_resource_start(pdev, 0), in cpqhpc_probe()
1055 if (!ctrl->hpc_reg) { in cpqhpc_probe()
1059 rc = -ENODEV; in cpqhpc_probe()
1064 bus->cur_bus_speed = get_controller_speed(ctrl); in cpqhpc_probe()
1080 * (pci-pc.c: get_irq_routing_table) */ in cpqhpc_probe()
1081 rc = get_slot_mapping(ctrl->pci_bus, pdev->bus->number, in cpqhpc_probe()
1082 (readb(ctrl->hpc_reg + SLOT_MASK) >> 4), in cpqhpc_probe()
1083 &(ctrl->first_slot)); in cpqhpc_probe()
1085 ctrl->first_slot, rc); in cpqhpc_probe()
1092 rc = cpqhp_save_config(ctrl, ctrl->bus, readb(ctrl->hpc_reg + SLOT_MASK)); in cpqhpc_probe()
1103 ctrl->interrupt = pdev->irq; in cpqhpc_probe()
1104 if (ctrl->interrupt < 0x10) { in cpqhpc_probe()
1109 ctrl->cfgspc_irq = 0; in cpqhpc_probe()
1110 pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, &ctrl->cfgspc_irq); in cpqhpc_probe()
1112 rc = cpqhp_find_available_resources(ctrl, cpqhp_rom_start); in cpqhpc_probe()
1113 ctrl->add_support = !rc; in cpqhpc_probe()
1121 * Finish setting up the hot plug ctrl device in cpqhpc_probe()
1123 ctrl->slot_device_offset = readb(ctrl->hpc_reg + SLOT_MASK) >> 4; in cpqhpc_probe()
1124 dbg("NumSlots %d\n", ctrl->slot_device_offset); in cpqhpc_probe()
1126 ctrl->next_event = 0; in cpqhpc_probe()
1129 rc = ctrl_slot_setup(ctrl, smbios_start, smbios_table); in cpqhpc_probe()
1138 writel(0xFFFFFFFFL, ctrl->hpc_reg + INT_MASK); in cpqhpc_probe()
1141 dbg("HPC interrupt = %d\n", ctrl->interrupt); in cpqhpc_probe()
1142 if (request_irq(ctrl->interrupt, cpqhp_ctrl_intr, in cpqhpc_probe()
1143 IRQF_SHARED, MY_NAME, ctrl)) { in cpqhpc_probe()
1145 ctrl->interrupt); in cpqhpc_probe()
1146 rc = -ENODEV; in cpqhpc_probe()
1153 temp_word = readw(ctrl->hpc_reg + MISC); in cpqhpc_probe()
1155 writew(temp_word, ctrl->hpc_reg + MISC); in cpqhpc_probe()
1158 writel(0xFFFFFFFFL, ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhpc_probe()
1160 ctrl->ctrl_int_comp = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhpc_probe()
1162 writel(0x0L, ctrl->hpc_reg + INT_MASK); in cpqhpc_probe()
1165 cpqhp_ctrl_list = ctrl; in cpqhpc_probe()
1166 ctrl->next = NULL; in cpqhpc_probe()
1168 ctrl->next = cpqhp_ctrl_list; in cpqhpc_probe()
1169 cpqhp_ctrl_list = ctrl; in cpqhpc_probe()
1175 mutex_lock(&ctrl->crit_sect); in cpqhpc_probe()
1177 num_of_slots = readb(ctrl->hpc_reg + SLOT_MASK) & 0x0F; in cpqhpc_probe()
1179 /* find first device number for the ctrl */ in cpqhpc_probe()
1180 device = readb(ctrl->hpc_reg + SLOT_MASK) >> 4; in cpqhpc_probe()
1184 func = cpqhp_slot_find(ctrl->bus, device, 0); in cpqhpc_probe()
1188 hp_slot = func->device - ctrl->slot_device_offset; in cpqhpc_probe()
1192 temp_word = ctrl->ctrl_int_comp >> 16; in cpqhpc_probe()
1193 func->presence_save = (temp_word >> hp_slot) & 0x01; in cpqhpc_probe()
1194 func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02; in cpqhpc_probe()
1196 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) in cpqhpc_probe()
1197 func->switch_save = 0; in cpqhpc_probe()
1199 func->switch_save = 0x10; in cpqhpc_probe()
1202 if (!func->is_a_board) { in cpqhpc_probe()
1203 green_LED_off(ctrl, hp_slot); in cpqhpc_probe()
1204 slot_disable(ctrl, hp_slot); in cpqhpc_probe()
1208 num_of_slots--; in cpqhpc_probe()
1212 set_SOGO(ctrl); in cpqhpc_probe()
1214 wait_for_ctrl_irq(ctrl); in cpqhpc_probe()
1217 rc = init_SERR(ctrl); in cpqhpc_probe()
1220 mutex_unlock(&ctrl->crit_sect); in cpqhpc_probe()
1225 mutex_unlock(&ctrl->crit_sect); in cpqhpc_probe()
1227 cpqhp_create_debugfs_files(ctrl); in cpqhpc_probe()
1232 free_irq(ctrl->interrupt, ctrl); in cpqhpc_probe()
1234 iounmap(ctrl->hpc_reg); in cpqhpc_probe()
1238 kfree(ctrl->pci_bus); in cpqhpc_probe()
1240 kfree(ctrl); in cpqhpc_probe()
1252 struct controller *ctrl; in unload_cpqphpd() local
1259 ctrl = cpqhp_ctrl_list; in unload_cpqphpd()
1261 while (ctrl) { in unload_cpqphpd()
1262 if (ctrl->hpc_reg) { in unload_cpqphpd()
1264 rc = read_slot_enable(ctrl); in unload_cpqphpd()
1266 writeb(0, ctrl->hpc_reg + SLOT_SERR); in unload_cpqphpd()
1267 writel(0xFFFFFFC0L | ~rc, ctrl->hpc_reg + INT_MASK); in unload_cpqphpd()
1269 misc = readw(ctrl->hpc_reg + MISC); in unload_cpqphpd()
1271 writew(misc, ctrl->hpc_reg + MISC); in unload_cpqphpd()
1274 ctrl_slot_cleanup(ctrl); in unload_cpqphpd()
1276 res = ctrl->io_head; in unload_cpqphpd()
1279 res = res->next; in unload_cpqphpd()
1283 res = ctrl->mem_head; in unload_cpqphpd()
1286 res = res->next; in unload_cpqphpd()
1290 res = ctrl->p_mem_head; in unload_cpqphpd()
1293 res = res->next; in unload_cpqphpd()
1297 res = ctrl->bus_head; in unload_cpqphpd()
1300 res = res->next; in unload_cpqphpd()
1304 kfree(ctrl->pci_bus); in unload_cpqphpd()
1306 tctrl = ctrl; in unload_cpqphpd()
1307 ctrl = ctrl->next; in unload_cpqphpd()
1314 res = next->io_head; in unload_cpqphpd()
1317 res = res->next; in unload_cpqphpd()
1321 res = next->mem_head; in unload_cpqphpd()
1324 res = res->next; in unload_cpqphpd()
1328 res = next->p_mem_head; in unload_cpqphpd()
1331 res = res->next; in unload_cpqphpd()
1335 res = next->bus_head; in unload_cpqphpd()
1338 res = res->next; in unload_cpqphpd()
1343 next = next->next; in unload_cpqphpd()