Lines Matching full:slot

72 static int __rpaphp_get_sensor_state(struct slot *slot, int *state)  in __rpaphp_get_sensor_state()  argument
78 struct pci_controller *phb = PCI_DN(slot->dn)->phb; in __rpaphp_get_sensor_state()
84 * Fallback to existing method for empty slot or PE isn't in EEH in __rpaphp_get_sensor_state()
95 slot->index); in __rpaphp_get_sensor_state()
99 return rtas_get_sensor(DR_ENTITY_SENSE, slot->index, state); in __rpaphp_get_sensor_state()
102 int rpaphp_get_sensor_state(struct slot *slot, int *state) in rpaphp_get_sensor_state() argument
107 rc = __rpaphp_get_sensor_state(slot, state); in rpaphp_get_sensor_state()
111 dbg("%s: slot must be power up to get sensor-state\n", in rpaphp_get_sensor_state()
117 rc = rtas_set_power_level(slot->power_domain, POWER_ON, in rpaphp_get_sensor_state()
120 dbg("%s: power on slot[%s] failed rc=%d.\n", in rpaphp_get_sensor_state()
121 __func__, slot->name, rc); in rpaphp_get_sensor_state()
123 rc = __rpaphp_get_sensor_state(slot, state); in rpaphp_get_sensor_state()
126 info("%s: slot is unusable\n", __func__); in rpaphp_get_sensor_state()
134 * rpaphp_enable_slot - record slot state, config pci device
135 * @slot: target &slot
137 * Initialize values in the slot structure to indicate if there is a pci card
138 * plugged into the slot. If the slot is not empty, run the pcibios routine
141 int rpaphp_enable_slot(struct slot *slot) in rpaphp_enable_slot() argument
146 slot->state = EMPTY; in rpaphp_enable_slot()
148 /* Find out if the power is turned on for the slot */ in rpaphp_enable_slot()
149 rc = rtas_get_power_level(slot->power_domain, &level); in rpaphp_enable_slot()
153 /* Figure out if there is an adapter in the slot */ in rpaphp_enable_slot()
154 rc = rpaphp_get_sensor_state(slot, &state); in rpaphp_enable_slot()
158 bus = pci_find_bus_by_node(slot->dn); in rpaphp_enable_slot()
160 err("%s: no pci_bus for dn %pOF\n", __func__, slot->dn); in rpaphp_enable_slot()
164 slot->bus = bus; in rpaphp_enable_slot()
165 slot->pci_devs = &bus->devices; in rpaphp_enable_slot()
167 /* if there's an adapter in the slot, go add the pci devices */ in rpaphp_enable_slot()
169 slot->state = NOT_CONFIGURED; in rpaphp_enable_slot()
171 /* non-empty slot has to have child */ in rpaphp_enable_slot()
172 if (!slot->dn->child) { in rpaphp_enable_slot()
173 err("%s: slot[%s]'s device_node doesn't have child for adapter\n", in rpaphp_enable_slot()
174 __func__, slot->name); in rpaphp_enable_slot()
179 pseries_eeh_init_edev_recursive(PCI_DN(slot->dn)); in rpaphp_enable_slot()
184 slot->state = CONFIGURED; in rpaphp_enable_slot()
189 dbg("%s: pci_devs of slot[%pOF]\n", __func__, slot->dn); in rpaphp_enable_slot()