• Marek Vasut's avatar
    can: ifi: Repair the error handling · a452b356
    Marek Vasut authored
    commit 880dd464 upstream.
    
    The new version of the IFI CANFD core has significantly less complex
    error state indication logic. In particular, the warning/error state
    bits are no longer all over the place, but are all present in the
    STATUS register. Moreover, there is a new IRQ register bit indicating
    transition between error states (active/warning/passive/busoff).
    
    This patch makes use of this bit to weed out the obscure selective
    INTERRUPT register clearing, which was used to carry over the error
    state indication into the poll function. While at it, this patch
    fixes the handling of the ACTIVE state, since the hardware provides
    indication of the core being in ACTIVE state and that in turn fixes
    the state transition indication toward userspace. Finally, register
    reads in the poll function are moved to the matching subfunctions
    since those are also no longer needed in the poll function.
    Signed-off-by: default avatarMarek Vasut <marex@denx.de>
    Cc: Heiko Schocher <hs@denx.de>
    Cc: Markus Marb <markus@marb.org>
    Cc: Marc Kleine-Budde <mkl@pengutronix.de>
    Cc: linux-stable <stable@vger.kernel.org>
    Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    a452b356
ifi_canfd.c 29 KB