Skip to content

Commit

Permalink
RDMA/nes: Don't generate async events for unregistered devices
Browse files Browse the repository at this point in the history
nes_port_ibevent() should not be called when the nes RDMA device is not
registered with the RDMA core.  Add missing checks of of_device_registered flag.

Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
  • Loading branch information
Maciej Sosnowski authored and Roland Dreier committed Feb 3, 2011
1 parent 831d52b commit 25a54a6
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions drivers/infiniband/hw/nes/nes_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2610,9 +2610,11 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number)
netif_carrier_on(nesvnic->netdev);

spin_lock(&nesvnic->port_ibevent_lock);
if (nesdev->iw_status == 0) {
nesdev->iw_status = 1;
nes_port_ibevent(nesvnic);
if (nesvnic->of_device_registered) {
if (nesdev->iw_status == 0) {
nesdev->iw_status = 1;
nes_port_ibevent(nesvnic);
}
}
spin_unlock(&nesvnic->port_ibevent_lock);
}
Expand Down Expand Up @@ -2642,9 +2644,11 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number)
netif_carrier_off(nesvnic->netdev);

spin_lock(&nesvnic->port_ibevent_lock);
if (nesdev->iw_status == 1) {
nesdev->iw_status = 0;
nes_port_ibevent(nesvnic);
if (nesvnic->of_device_registered) {
if (nesdev->iw_status == 1) {
nesdev->iw_status = 0;
nes_port_ibevent(nesvnic);
}
}
spin_unlock(&nesvnic->port_ibevent_lock);
}
Expand Down Expand Up @@ -2703,9 +2707,11 @@ void nes_recheck_link_status(struct work_struct *work)
netif_carrier_on(nesvnic->netdev);

spin_lock(&nesvnic->port_ibevent_lock);
if (nesdev->iw_status == 0) {
nesdev->iw_status = 1;
nes_port_ibevent(nesvnic);
if (nesvnic->of_device_registered) {
if (nesdev->iw_status == 0) {
nesdev->iw_status = 1;
nes_port_ibevent(nesvnic);
}
}
spin_unlock(&nesvnic->port_ibevent_lock);
}
Expand All @@ -2723,9 +2729,11 @@ void nes_recheck_link_status(struct work_struct *work)
netif_carrier_off(nesvnic->netdev);

spin_lock(&nesvnic->port_ibevent_lock);
if (nesdev->iw_status == 1) {
nesdev->iw_status = 0;
nes_port_ibevent(nesvnic);
if (nesvnic->of_device_registered) {
if (nesdev->iw_status == 1) {
nesdev->iw_status = 0;
nes_port_ibevent(nesvnic);
}
}
spin_unlock(&nesvnic->port_ibevent_lock);
}
Expand Down

0 comments on commit 25a54a6

Please sign in to comment.