• Thomas Gleixner's avatar
    can: c_can: Fix hardware raminit function · 5bb9cbaa
    Thomas Gleixner authored
    The function is broken in several ways:
    
        - The function does not wait for the init to complete.
          That can take quite some microseconds.
    
        - No protection against being called for two chips at the same
          time. SMP is such a new thing, right?
    
    Clear the start and the init done bit unconditionally and wait for both bits to
    be clear.
    
    In the enable path set the init bit and wait for the init done bit.
    
    Add proper locking.
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
    5bb9cbaa
c_can_platform.c 9.08 KB