[PATCH] powerpc/eeh: Refactor EEH PE reset functions
Michael Ellerman
mpe at ellerman.id.au
Fri Nov 18 23:14:43 AEDT 2016
Russell Currey <ruscur at russell.cc> writes:
> eeh_pe_reset and eeh_reset_pe are two different functions in the same
> file which do mostly the same thing. Not only is this confusing, but
> potentially causes disrepancies in functionality, notably eeh_reset_pe
> as it does not check return values for failure.
>
> Refactor this into the following:
>
> - eeh_pe_reset(): stays as is, performs a single operation, exported
> - eeh_pe_reset_full(): new, full reset process that calls eeh_pe_reset()
> - eeh_reset_pe(): removed and replaced by eeh_pe_reset_full()
> - eeh_reset_pe_once(): removed
This seems reasonable.
Though the diff is pretty unreadable.
> diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
> index f257316..ad743d3 100644
> --- a/arch/powerpc/kernel/eeh.c
> +++ b/arch/powerpc/kernel/eeh.c
> @@ -808,76 +808,67 @@ static void *eeh_set_dev_freset(void *data, void *flag)
...
> + /* Wait until the PE is in a functioning state */
> state = eeh_ops->wait_state(pe, PCI_BUS_RESET_WAIT_MSEC);
> - if ((state & flags) == flags) {
> - ret = 0;
> - goto out;
> - }
> + if ((state & active_flags) == active_flags)
> + break;
>
> if (state < 0) {
> - pr_warn("%s: Unrecoverable slot failure on PHB#%d-PE#%x",
> + pr_warn("%s: Unrecoverable slot failure on PHB#%x-PE#%d",
> __func__, pe->phb->global_number, pe->addr);
That looks like unrelated %d -> %x stuff.
I dropped it and another below.
cheers
More information about the Linuxppc-dev
mailing list