lkml.org 
[lkml]   [2019]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.0 166/238] powerpc/smp: Fix NMI IPI timeout
    Date
    5.0-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Nicholas Piggin <npiggin@gmail.com>

    commit 1b5fc84aba170bdfe3533396ca9662ceea1609b7 upstream.

    The NMI IPI timeout logic is broken, if __smp_send_nmi_ipi() times out
    on the first condition, delay_us will be zero which will send it into
    the second spin loop with no timeout so it will spin forever.

    Fixes: 5b73151fff63 ("powerpc: NMI IPI make NMI IPIs fully sychronous")
    Cc: stable@vger.kernel.org # v4.19+
    Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    arch/powerpc/kernel/smp.c | 5 +++--
    1 file changed, 3 insertions(+), 2 deletions(-)

    --- a/arch/powerpc/kernel/smp.c
    +++ b/arch/powerpc/kernel/smp.c
    @@ -519,7 +519,7 @@ int __smp_send_nmi_ipi(int cpu, void (*f
    if (delay_us) {
    delay_us--;
    if (!delay_us)
    - break;
    + goto timeout;
    }
    }

    @@ -530,10 +530,11 @@ int __smp_send_nmi_ipi(int cpu, void (*f
    if (delay_us) {
    delay_us--;
    if (!delay_us)
    - break;
    + goto timeout;
    }
    }

    +timeout:
    if (!cpumask_empty(&nmi_ipi_pending_mask)) {
    /* Timeout waiting for CPUs to call smp_handle_nmi_ipi */
    ret = 0;

    \
     
     \ /
      Last update: 2019-03-22 13:29    [W:6.808 / U:0.624 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site