Commit 25a54a6b authored by Maciej Sosnowski's avatar Maciej Sosnowski Committed by Roland Dreier

RDMA/nes: Don't generate async events for unregistered devices

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: default avatarMaciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 831d52bc
...@@ -2610,10 +2610,12 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number) ...@@ -2610,10 +2610,12 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number)
netif_carrier_on(nesvnic->netdev); netif_carrier_on(nesvnic->netdev);
spin_lock(&nesvnic->port_ibevent_lock); spin_lock(&nesvnic->port_ibevent_lock);
if (nesvnic->of_device_registered) {
if (nesdev->iw_status == 0) { if (nesdev->iw_status == 0) {
nesdev->iw_status = 1; nesdev->iw_status = 1;
nes_port_ibevent(nesvnic); nes_port_ibevent(nesvnic);
} }
}
spin_unlock(&nesvnic->port_ibevent_lock); spin_unlock(&nesvnic->port_ibevent_lock);
} }
} }
...@@ -2642,10 +2644,12 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number) ...@@ -2642,10 +2644,12 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number)
netif_carrier_off(nesvnic->netdev); netif_carrier_off(nesvnic->netdev);
spin_lock(&nesvnic->port_ibevent_lock); spin_lock(&nesvnic->port_ibevent_lock);
if (nesvnic->of_device_registered) {
if (nesdev->iw_status == 1) { if (nesdev->iw_status == 1) {
nesdev->iw_status = 0; nesdev->iw_status = 0;
nes_port_ibevent(nesvnic); nes_port_ibevent(nesvnic);
} }
}
spin_unlock(&nesvnic->port_ibevent_lock); spin_unlock(&nesvnic->port_ibevent_lock);
} }
} }
...@@ -2703,10 +2707,12 @@ void nes_recheck_link_status(struct work_struct *work) ...@@ -2703,10 +2707,12 @@ void nes_recheck_link_status(struct work_struct *work)
netif_carrier_on(nesvnic->netdev); netif_carrier_on(nesvnic->netdev);
spin_lock(&nesvnic->port_ibevent_lock); spin_lock(&nesvnic->port_ibevent_lock);
if (nesvnic->of_device_registered) {
if (nesdev->iw_status == 0) { if (nesdev->iw_status == 0) {
nesdev->iw_status = 1; nesdev->iw_status = 1;
nes_port_ibevent(nesvnic); nes_port_ibevent(nesvnic);
} }
}
spin_unlock(&nesvnic->port_ibevent_lock); spin_unlock(&nesvnic->port_ibevent_lock);
} }
} }
...@@ -2723,10 +2729,12 @@ void nes_recheck_link_status(struct work_struct *work) ...@@ -2723,10 +2729,12 @@ void nes_recheck_link_status(struct work_struct *work)
netif_carrier_off(nesvnic->netdev); netif_carrier_off(nesvnic->netdev);
spin_lock(&nesvnic->port_ibevent_lock); spin_lock(&nesvnic->port_ibevent_lock);
if (nesvnic->of_device_registered) {
if (nesdev->iw_status == 1) { if (nesdev->iw_status == 1) {
nesdev->iw_status = 0; nesdev->iw_status = 0;
nes_port_ibevent(nesvnic); nes_port_ibevent(nesvnic);
} }
}
spin_unlock(&nesvnic->port_ibevent_lock); spin_unlock(&nesvnic->port_ibevent_lock);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment