Skip to content

Commit

Permalink
cnic: Do not call bnx2i when bnx2i is calling cnic_unregister_driver()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Chan authored and David S. Miller committed Jan 4, 2011
1 parent 57045c9 commit 42bb8d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
19 changes: 3 additions & 16 deletions drivers/net/cnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,19 +426,6 @@ static int cnic_abort_prep(struct cnic_sock *csk)
return 0;
}

static void cnic_uio_stop(void)
{
struct cnic_dev *dev;

read_lock(&cnic_dev_lock);
list_for_each_entry(dev, &cnic_dev_list, list) {
struct cnic_local *cp = dev->cnic_priv;

cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
}
read_unlock(&cnic_dev_lock);
}

int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops)
{
struct cnic_dev *dev;
Expand Down Expand Up @@ -510,9 +497,6 @@ int cnic_unregister_driver(int ulp_type)
}
read_unlock(&cnic_dev_lock);

if (ulp_type == CNIC_ULP_ISCSI)
cnic_uio_stop();

rcu_assign_pointer(cnic_ulp_tbl[ulp_type], NULL);

mutex_unlock(&cnic_lock);
Expand Down Expand Up @@ -596,6 +580,9 @@ static int cnic_unregister_device(struct cnic_dev *dev, int ulp_type)
}
mutex_unlock(&cnic_lock);

if (ulp_type == CNIC_ULP_ISCSI)
cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);

synchronize_rcu();

while (test_bit(ULP_F_CALL_PENDING, &cp->ulp_flags[ulp_type]) &&
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/cnic_if.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* cnic_if.h: Broadcom CNIC core network driver.
*
* Copyright (c) 2006-2010 Broadcom Corporation
* Copyright (c) 2006-2011 Broadcom Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -12,8 +12,8 @@
#ifndef CNIC_IF_H
#define CNIC_IF_H

#define CNIC_MODULE_VERSION "2.2.11"
#define CNIC_MODULE_RELDATE "Dec 22, 2010"
#define CNIC_MODULE_VERSION "2.2.12"
#define CNIC_MODULE_RELDATE "Jan 03, 2011"

#define CNIC_ULP_RDMA 0
#define CNIC_ULP_ISCSI 1
Expand Down

0 comments on commit 42bb8d5

Please sign in to comment.