[PATCH 11/13] powerpc/eeh: Introduce eeh_set_irq_state()
Michael Ellerman
mpe at ellerman.id.au
Fri May 4 13:02:32 AEST 2018
Sam Bobroff <sbobroff at linux.ibm.com> writes:
> diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
> index f63a01d336ee..b3edd0df04b8 100644
> --- a/arch/powerpc/kernel/eeh_driver.c
> +++ b/arch/powerpc/kernel/eeh_driver.c
> @@ -210,6 +206,23 @@ static void eeh_set_channel_state(struct eeh_pe *root, enum pci_channel_state s)
> edev->pdev->error_state = s;
> }
>
> +static void eeh_set_irq_state(struct eeh_pe *root, bool enable)
> +{
> + struct eeh_pe *pe;
> + struct eeh_dev *edev, *tmp;
> +
> + eeh_for_each_pe(root, pe)
> + eeh_pe_for_each_dev(pe, edev, tmp)
> + if (eeh_edev_actionable(edev))
> + if (eeh_pcid_get(edev->pdev)) {
> + if (enable)
> + eeh_enable_irq(edev);
> + else
> + eeh_disable_irq(edev);
> + eeh_pcid_put(edev->pdev);
> + }
Yikes.
What about?
eeh_for_each_pe(root, pe) {
eeh_pe_for_each_dev(pe, edev, tmp) {
if (!eeh_edev_actionable(edev))
continue;
if (!eeh_pcid_get(edev->pdev))
continue;
if (enable)
eeh_enable_irq(edev);
else
eeh_disable_irq(edev);
eeh_pcid_put(edev->pdev);
}
}
cheers
More information about the Linuxppc-dev
mailing list