Files
linux/drivers/net
Michael Chan cd6340199f bnx2: Close device if tx_timeout reset fails
Based on original patch and description from Flavio Leitner <fbl@redhat.com>

When bnx2_reset_task() is called, it will stop,
(re)initialize and start the interface to restore
the working condition.

The bnx2_init_nic() calls bnx2_reset_nic() which will
reset the chip and then calls bnx2_free_skbs() to free
all the skbs.

The problem happens when bnx2_init_chip() fails because
bnx2_reset_nic() will just return skipping the ring
initializations at bnx2_init_all_rings(). Later, the
reset task starts the interface again and the system
crashes due a NULL pointer access (no skb in the ring).

To fix it, we call dev_close() if bnx2_init_nic() fails.
One minor wrinkle to deal with is the cancel_work_sync()
call in bnx2_close() to cancel bnx2_reset_task().  The
call will wait forever because it is trying to cancel
itself and the workqueue will be stuck.

Since bnx2_reset_task() holds the rtnl_lock() and checks
for netif_running() before proceeding, there is no need
to cancel bnx2_reset_task() in bnx2_close() even if
bnx2_close() and bnx2_reset_task() are running concurrently.
The rtnl_lock() serializes the 2 calls.

We need to move the cancel_work_sync() call to
bnx2_remove_one() to make sure it is canceled before freeing
the netdev struct.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Cc: Flavio Leitner <fbl@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-07-16 10:13:19 -07:00
..
2011-06-21 15:48:29 -07:00
2011-07-12 22:10:01 -07:00
2011-07-07 00:26:31 -07:00
2011-06-21 01:14:33 -07:00
2011-06-21 15:48:29 -07:00
2011-06-09 20:35:20 -07:00
2011-06-29 06:02:05 -07:00
2011-03-31 11:26:23 -03:00
2011-06-30 22:13:37 -07:00
2011-03-31 11:26:23 -03:00
2011-05-31 19:28:32 -07:00
2011-03-31 11:26:23 -03:00
…
…
…
…
2010-12-21 02:16:08 -08:00
2011-05-31 19:28:32 -07:00
2010-11-09 09:17:56 -08:00
2011-03-31 11:26:23 -03:00
…
2011-03-31 11:26:23 -03:00
…
…
2011-07-15 08:08:26 -07:00
…
…
2010-11-09 09:17:56 -08:00
…
…
2011-03-31 11:26:23 -03:00
…
…
2010-08-24 12:24:07 -07:00
…
…
2011-03-31 11:26:23 -03:00
2010-07-14 13:40:36 -07:00
…
…
2010-09-26 18:34:29 -07:00
…
2010-09-26 18:34:29 -07:00
…
…
2011-06-21 15:48:29 -07:00
…
…
2011-06-13 17:26:15 -04:00
…
2010-12-21 02:16:08 -08:00
2011-03-31 11:26:23 -03:00
2011-06-21 15:48:29 -07:00
2011-03-31 11:26:23 -03:00
…
2011-06-21 15:48:29 -07:00
2011-03-31 11:26:23 -03:00
2011-07-07 04:30:29 -07:00
2011-06-21 15:48:29 -07:00
2011-07-07 04:30:29 -07:00
2011-04-17 17:47:36 -07:00
2011-06-21 15:48:29 -07:00
2011-03-31 11:26:23 -03:00
…
2011-05-31 19:28:32 -07:00
2011-03-31 11:26:23 -03:00
2011-06-21 15:55:09 -07:00
…
…
2010-11-09 09:17:56 -08:00
2011-06-24 17:31:37 -07:00
2010-11-09 09:17:56 -08:00
2011-03-31 11:26:23 -03:00
2011-06-20 13:56:54 -07:00
…
…
2011-06-21 15:48:29 -07:00
2011-07-07 04:41:24 -07:00
2011-06-20 12:51:22 -07:00
2010-09-26 18:34:29 -07:00
2011-03-31 11:26:23 -03:00
…
…
2011-05-31 19:28:32 -07:00
2010-07-05 20:08:05 -07:00
2010-12-21 02:16:08 -08:00
…
2010-12-21 02:16:08 -08:00
…
…
…
2011-04-06 14:35:23 -07:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2010-09-21 18:04:47 -07:00
2011-06-21 15:48:29 -07:00
2011-03-31 11:26:23 -03:00
2011-07-14 23:22:55 +02:00
…
2010-07-15 20:46:22 -07:00
…
2011-06-21 15:48:29 -07:00
…
2011-07-07 00:30:09 -07:00
2011-07-08 08:53:33 -07:00
2011-03-31 11:26:23 -03:00
…
…
…
…
…
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
…
2011-03-31 11:26:23 -03:00
2011-07-14 08:41:59 -07:00
2011-07-14 08:41:59 -07:00
2011-03-31 11:26:23 -03:00
2011-06-21 15:48:29 -07:00
…
2011-03-31 11:26:23 -03:00
2011-07-06 01:51:04 -07:00
2010-12-21 02:16:08 -08:00