• Matt Carlson's avatar
    tg3: Fix firmware event timeouts · 4ba526ce
    Matt Carlson authored
    The git commit 7c5026aa ("tg3: Add
    link state reporting to UMP firmware") introduced code that waits for
    previous firmware events to be serviced before attempting to submit a
    new event.  Unfortunately that patch contained a bug that cause the
    driver to wait 2.5 seconds, rather than 2.5 milliseconds as intended.
    This patch fixes that bug.
    
    This bug revealed that not all firmware versions service driver events
    though.  Since we do not know which versions of the firmware do and don't
    service these events, the driver needs some way to minimize the effects
    of the delay.  This patch solves the problem by recording a jiffies
    timestamp when it submits an event to the hardware.  If the jiffies
    counter shows that 2.5 milliseconds have already passed, a wait is not
    needed and the driver can proceed to submit a new event.
    Signed-off-by: default avatarMatt Carlson <mcarlson@broadcom.com>
    Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    4ba526ce
tg3.c 391 KB