static void apc_agent_timeout(unsigned long data) { u32 index; struct sci_timer *tmr = (struct sci_timer *)data; struct sci_port_configuration_agent *port_agent; struct isci_host *ihost; unsigned long flags; u16 configure_phy_mask; port_agent = container_of(tmr, typeof(*port_agent), timer); ihost = container_of(port_agent, typeof(*ihost), port_agent); spin_lock_irqsave(&ihost->scic_lock, flags); if (tmr->cancel) goto done; port_agent->timer_pending = false; configure_phy_mask = ~port_agent->phy_configured_mask & port_agent->phy_ready_mask; if (!configure_phy_mask) goto done; for (index = 0; index < SCI_MAX_PHYS; index++) { if ((configure_phy_mask & (1 << index)) == 0) continue; sci_apc_agent_configure_ports(ihost, port_agent, &ihost->phys[index], false); } done: spin_unlock_irqrestore(&ihost->scic_lock, flags); }
/* configure the phys into ports when the timer fires */ static void apc_agent_timeout(struct timer_list *t) { u32 index; struct sci_timer *tmr = from_timer(tmr, t, timer); struct sci_port_configuration_agent *port_agent; struct isci_host *ihost; unsigned long flags; u16 configure_phy_mask; port_agent = container_of(tmr, typeof(*port_agent), timer); ihost = container_of(port_agent, typeof(*ihost), port_agent); spin_lock_irqsave(&ihost->scic_lock, flags); if (tmr->cancel) goto done; port_agent->timer_pending = false; configure_phy_mask = ~port_agent->phy_configured_mask & port_agent->phy_ready_mask; if (!configure_phy_mask) goto done; for (index = 0; index < SCI_MAX_PHYS; index++) { if ((configure_phy_mask & (1 << index)) == 0) continue; sci_apc_agent_configure_ports(ihost, port_agent, &ihost->phys[index], false); } if (is_controller_start_complete(ihost)) sci_controller_transition_to_ready(ihost, SCI_SUCCESS); done: spin_unlock_irqrestore(&ihost->scic_lock, flags); }