[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACKFLimJTiRx1L+FFOZfR3-yrR9u+TY_Fdy3OSgH49v9QLKGwg@mail.gmail.com>
Date: Mon, 27 Jul 2020 00:26:22 -0700
From: Michael Chan <michael.chan@...adcom.com>
To: David Christensen <drc@...ux.vnet.ibm.com>
Cc: Netdev <netdev@...r.kernel.org>,
Siva Reddy Kallam <siva.kallam@...adcom.com>,
Prashant Sreedharan <prashant@...adcom.com>,
Michael Chan <mchan@...adcom.com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] tg3: driver sleeps indefinitely when EEH errors exceed eeh_max_freezes
On Fri, Jul 24, 2020 at 5:19 PM David Christensen
<drc@...ux.vnet.ibm.com> wrote:
> In the working case, tg3_init_hw() returns successfully, resulting in
> every instance of napi_disable() being followed by an instance of
> napi_enable().
>
> In the failing case, tg3_hw_init() returns an error. (This is not
> surprising since the system is now preventing the adapter from accessing
> its MMIO registers. I'm curious why it doesn't always fail.) When
> tg3_hw_init() fails, tg3_netif_start() is not called, and we end up with
> two sequential calls to napi_disable(), resulting in multiple hung task
> messages.
>
If the driver fails to initialize the chip completely, the tg3_flags
should indicate we are in this failed state. We already have
TG3_FLAG_INIT_COMPLETE. Perhaps, we can expand the use of this flag
to cover the scenario that you described above. We can clear
TG3_FLAG_INIT_COMPLETE before calling tg3_halt() and only set it back
when tg3_hw_init() completes successfully. This is the rough idea,
but a more detailed analysis on how this flag is used needs to be done
first.
Assuming this works, the EEH handler can check TG3_FLAG_INIT_COMPLETE
to see if we should call tg3_netif_stop().
Another way to fix it is to call dev_close() if tg3_reset_task() fails
to re-initialize the device.
Powered by blists - more mailing lists