Commit 42bb8d56953a06de50941d6d3df89dc3023bb92d

Authored by Michael Chan
Committed by David S. Miller
1 parent 57045c996f

cnic: Do not call bnx2i when bnx2i is calling cnic_unregister_driver()

We should call bnx2i to send the iSCSI netlink message earlier in
cnic_unregister_device().  By the time cnic_unregister_driver() is
called, bnx2i may have freed data structures used by the upcalls.

Update version to 2.2.12.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 2 changed files with 6 additions and 19 deletions Side-by-side Diff

... ... @@ -426,19 +426,6 @@
426 426 return 0;
427 427 }
428 428  
429   -static void cnic_uio_stop(void)
430   -{
431   - struct cnic_dev *dev;
432   -
433   - read_lock(&cnic_dev_lock);
434   - list_for_each_entry(dev, &cnic_dev_list, list) {
435   - struct cnic_local *cp = dev->cnic_priv;
436   -
437   - cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
438   - }
439   - read_unlock(&cnic_dev_lock);
440   -}
441   -
442 429 int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops)
443 430 {
444 431 struct cnic_dev *dev;
... ... @@ -510,9 +497,6 @@
510 497 }
511 498 read_unlock(&cnic_dev_lock);
512 499  
513   - if (ulp_type == CNIC_ULP_ISCSI)
514   - cnic_uio_stop();
515   -
516 500 rcu_assign_pointer(cnic_ulp_tbl[ulp_type], NULL);
517 501  
518 502 mutex_unlock(&cnic_lock);
... ... @@ -595,6 +579,9 @@
595 579 return -EINVAL;
596 580 }
597 581 mutex_unlock(&cnic_lock);
  582 +
  583 + if (ulp_type == CNIC_ULP_ISCSI)
  584 + cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
598 585  
599 586 synchronize_rcu();
600 587  
drivers/net/cnic_if.h
1 1 /* cnic_if.h: Broadcom CNIC core network driver.
2 2 *
3   - * Copyright (c) 2006-2010 Broadcom Corporation
  3 + * Copyright (c) 2006-2011 Broadcom Corporation
4 4 *
5 5 * This program is free software; you can redistribute it and/or modify
6 6 * it under the terms of the GNU General Public License as published by
... ... @@ -12,8 +12,8 @@
12 12 #ifndef CNIC_IF_H
13 13 #define CNIC_IF_H
14 14  
15   -#define CNIC_MODULE_VERSION "2.2.11"
16   -#define CNIC_MODULE_RELDATE "Dec 22, 2010"
  15 +#define CNIC_MODULE_VERSION "2.2.12"
  16 +#define CNIC_MODULE_RELDATE "Jan 03, 2011"
17 17  
18 18 #define CNIC_ULP_RDMA 0
19 19 #define CNIC_ULP_ISCSI 1