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-06-06 22:55:11 -07:00
2011-06-30 22:13:38 -07:00
2011-06-24 02:40:08 -07:00
2011-06-24 02:40:08 -07:00
2011-06-21 15:48:29 -07:00
2011-07-12 22:10:01 -07:00
2011-07-15 08:08:26 -07:00
2011-07-14 16:02:29 -07:00
2011-06-23 02:12:55 -07:00
2011-07-07 00:26:31 -07:00
2011-07-15 08:08:26 -07:00
2011-05-22 21:41:57 -07:00
2011-07-05 23:23:37 -07:00
2011-06-05 14:33:40 -07:00
2011-07-12 12:28:58 -07:00
2011-06-21 01:14:33 -07:00
2011-07-12 22:07:56 -07:00
2011-06-21 15:48:29 -07:00
2011-06-30 20:43:38 -07:00
2011-06-20 22:29:08 -07:00
2011-07-05 23:23:37 -07:00
2011-07-11 18:43:00 -07:00
2011-06-09 20:35:20 -07:00
2011-06-21 20:32:53 -07:00
2011-05-22 21:41:57 -07:00
2011-07-11 18:43:20 -07:00
2011-06-21 01:18:12 -07:00
2011-06-06 22:55:11 -07:00
2011-06-27 21:40:44 -07:00
2011-06-29 06:02:05 -07:00
2011-06-21 15:48:29 -07:00
2011-06-11 16:00:18 -07:00
2011-05-22 21:41:57 -07:00
2011-05-24 13:28:35 -07:00
2011-06-20 22:29:08 -07:00
2011-07-14 08:49:44 -07:00
2011-07-05 23:23:37 -07:00
2011-07-14 08:43:32 -07:00
2011-06-21 19:17:20 -07:00
2011-05-25 15:35:32 -07:00
2011-06-21 15:48:29 -07:00
2011-07-04 20:27:28 -07:00
2011-07-14 07:56:40 -07:00
2011-07-14 07:56:40 -07:00
2011-07-04 20:27:30 -07:00
2011-06-30 22:13:37 -07:00
2011-07-15 10:05:24 -04:00
2011-06-30 11:19:09 -07:00
2011-05-31 19:28:32 -07:00
2011-06-20 22:29:08 -07:00
2011-05-31 19:28:32 -07:00
2011-07-08 09:03:20 -07:00
2011-07-15 08:08:26 -07:00
2011-07-05 23:23:37 -07:00
2011-06-06 22:55:11 -07:00
2011-07-08 09:03:20 -07:00
2011-06-06 22:55:11 -07:00
2011-05-20 13:43:21 -07:00
2011-06-06 22:55:11 -07:00
2011-06-06 22:55:11 -07:00
2011-06-11 14:58:17 -07:00
2011-06-24 17:31:36 -07:00
2011-05-19 18:19:10 +02:00
2011-07-05 22:34:52 -07:00
2011-06-11 16:00:18 -07:00
2011-06-17 00:19:09 -04:00
2011-07-08 09:03:20 -07:00
2011-07-16 10:13:19 -07:00
2011-07-14 08:46:08 -07:00
2011-06-06 22:55:11 -07:00
2011-06-15 10:56:37 -04:00
2011-07-14 08:46:07 -07:00
2011-07-14 08:46:07 -07:00
2011-06-21 16:06:11 -07:00
2011-06-11 16:00:18 -07:00
2011-06-21 15:48:29 -07:00
2011-06-24 02:40:08 -07:00
2011-07-08 09:03:20 -07:00
2011-07-04 20:27:29 -07:00
2011-06-21 15:48:29 -07:00
2011-06-11 15:54:52 -07:00
2011-06-13 17:26:15 -04:00
2011-05-05 10:57:45 -07:00
2011-06-06 22:55:11 -07:00
2011-06-06 22:55:11 -07:00
2011-04-29 14:03:01 -07:00
2011-04-29 14:03:01 -07:00
2011-06-21 15:48:29 -07:00
2011-06-06 22:55:11 -07:00
2011-06-21 19:17:20 -07:00
2011-07-08 09:03:20 -07:00
2011-06-21 15:48:29 -07:00
2011-06-21 19:17:20 -07:00
2011-07-08 09:03:20 -07:00
2011-05-22 21:41:57 -07:00
2011-06-11 15:50:31 -07:00
2011-06-11 15:50:31 -07:00
2011-04-29 12:41:59 -07:00
2011-07-07 04:30:29 -07:00
2011-05-23 13:10:14 -07:00
2011-06-21 15:48:29 -07:00
2011-07-07 04:30:29 -07:00
2011-07-05 23:23:37 -07:00
2011-06-21 15:48:29 -07:00
2011-07-08 09:03:20 -07:00
2011-06-06 22:55:11 -07:00
2011-06-06 22:55:11 -07:00
2011-06-13 18:32:36 -04:00
2011-05-12 16:59:57 -04:00
2011-05-31 19:28:32 -07:00
2011-06-06 22:55:11 -07:00
2011-06-21 15:55:09 -07:00
2011-07-08 09:03:20 -07:00
2011-06-06 22:55:11 -07:00
2011-07-04 20:27:29 -07:00
2011-06-30 22:13:16 -07:00
2011-06-30 22:13:16 -07:00
2011-07-08 08:53:33 -07:00
2011-07-08 09:03:20 -07:00
2011-06-06 22:55:11 -07:00
2011-07-08 09:03:20 -07:00
2011-06-06 22:55:11 -07:00
2011-07-08 09:03:20 -07:00
2011-05-19 09:55:43 +01:00
2011-06-24 17:31:37 -07:00
2011-06-29 02:55:59 -07:00
2011-06-06 22:55:11 -07:00
2011-05-08 15:59:12 -07:00
2011-06-20 13:56:54 -07:00
2011-06-06 22:55:11 -07:00
2011-06-21 15:48:29 -07:00
2011-06-06 16:43:43 -07:00
2011-07-07 04:41:24 -07:00
2011-06-20 12:51:22 -07:00
2011-04-29 14:03:01 -07:00
2011-05-05 14:59:02 -07:00
2011-06-11 16:00:18 -07:00
2011-06-21 16:01:11 -07:00
2011-07-10 07:07:40 -07:00
2011-05-31 19:28:32 -07:00
2011-05-12 16:59:57 -04:00
2011-05-22 21:01:19 -04:00
2011-06-06 22:55:11 -07:00
2011-06-27 21:40:45 -07:00
2011-06-06 22:55:11 -07:00
2011-05-22 21:41:57 -07:00
2011-07-08 09:03:20 -07:00
2011-07-13 02:29:59 -07:00
2011-06-20 22:29:08 -07:00
2011-06-29 05:48:41 -07:00
2011-06-06 22:55:11 -07:00
2011-06-24 02:40:08 -07:00
2011-07-14 16:03:29 -07:00
2011-07-14 16:03:29 -07:00
2011-06-21 15:48:29 -07:00
2011-06-21 15:48:29 -07:00
2011-06-19 16:35:30 -07:00
2011-07-14 23:22:55 +02:00
2011-07-05 23:23:37 -07:00
2011-06-21 20:33:34 -07:00
2011-05-22 21:41:57 -07:00
2011-06-06 22:55:11 -07:00
2011-06-21 19:17:20 -07:00
2011-07-14 07:56:40 -07:00
2011-06-06 22:55:11 -07:00
2011-06-21 15:48:29 -07:00
2011-07-07 00:30:09 -07:00
2011-06-06 22:55:11 -07:00
2011-07-08 08:53:33 -07:00
2011-07-08 08:53:33 -07:00
2011-06-05 14:33:40 -07:00
2011-07-14 07:56:40 -07:00
2011-07-08 09:03:20 -07:00
2011-07-08 09:03:20 -07:00
2011-07-08 09:03:20 -07:00
2011-06-06 22:55:11 -07:00
2011-06-06 22:55:11 -07:00
2011-06-20 13:56:54 -07:00
2011-06-19 16:35:31 -07:00
2011-04-29 14:03:01 -07:00
2011-06-06 22:55:11 -07:00
2011-06-06 22:55:11 -07:00
2011-07-08 09:03:20 -07:00
2011-07-08 09:03:20 -07:00
2011-06-02 22:06:42 -07:00
2011-07-08 09:03:20 -07:00
2011-07-08 09:03:20 -07:00
2011-07-08 09:03:20 -07:00
2011-05-22 21:41:57 -07:00
2011-04-29 14:03:01 -07:00
2011-07-14 08:41:59 -07:00
2011-07-14 08:41:59 -07:00
2011-06-06 22:55:11 -07:00
2011-06-06 22:55:11 -07:00
2011-06-20 22:29:08 -07:00
2011-06-21 15:48:29 -07:00
2011-05-23 09:12:26 -07:00
2011-06-30 22:32:49 -07:00
2011-07-06 01:51:04 -07:00
2011-06-05 14:33:40 -07:00
2011-05-25 17:55:32 -04:00
2011-06-30 20:43:38 -07:00
2011-06-21 15:57:05 -07:00
2011-06-21 15:48:29 -07:00
2011-06-21 15:48:29 -07:00
2011-06-05 14:33:40 -07:00
2011-06-24 17:31:37 -07:00