Skip to content

Commit

Permalink
powerpc/eeh: Set attention indicator while recovering
Browse files Browse the repository at this point in the history
I am the RAS team. Hear me roar.

Roar.

On a more serious note, being able to locate failed devices can be helpful.
Set the attention indicator if the slot supports it once we've determined
the device is present and only clear it if the device is fully recovered.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190903101605.2890-12-oohall@gmail.com
  • Loading branch information
Oliver O'Halloran authored and Michael Ellerman committed Sep 5, 2019
1 parent 018c49e commit aeff27c
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions arch/powerpc/kernel/eeh_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,13 +803,39 @@ static bool eeh_slot_presence_check(struct pci_dev *pdev)
if (!ops || !ops->get_adapter_status)
return true;

/* set the attention indicator while we've got the slot ops */
if (ops->set_attention_status)
ops->set_attention_status(slot->hotplug, 1);

rc = ops->get_adapter_status(slot->hotplug, &state);
if (rc)
return true;

return !!state;
}

static void eeh_clear_slot_attention(struct pci_dev *pdev)
{
const struct hotplug_slot_ops *ops;
struct pci_slot *slot;

if (!pdev)
return;

if (pdev->error_state == pci_channel_io_perm_failure)
return;

slot = pdev->slot;
if (!slot || !slot->hotplug)
return;

ops = slot->hotplug->ops;
if (!ops || !ops->set_attention_status)
return;

ops->set_attention_status(slot->hotplug, 0);
}

/**
* eeh_handle_normal_event - Handle EEH events on a specific PE
* @pe: EEH PE - which should not be used after we return, as it may
Expand Down Expand Up @@ -1098,6 +1124,12 @@ void eeh_handle_normal_event(struct eeh_pe *pe)
* we don't want to modify the PE tree structure so we do it here.
*/
eeh_pe_cleanup(pe);

/* clear the slot attention LED for all recovered devices */
eeh_for_each_pe(pe, tmp_pe)
eeh_pe_for_each_dev(tmp_pe, edev, tmp)
eeh_clear_slot_attention(edev->pdev);

eeh_pe_state_clear(pe, EEH_PE_RECOVERING, true);
}

Expand Down

0 comments on commit aeff27c

Please sign in to comment.