Skip to content

Commit

Permalink
RDMA/vmw_pvrdma: Activate device on ethernet link up
Browse files Browse the repository at this point in the history
Restore device state when ethernet link changes to active.

Acked-by: George Zhang <[email protected]>
Acked-by: Jorgen Hansen <[email protected]>
Acked-by: Bryan Tan <[email protected]>
Signed-off-by: Aditya Sarwade <[email protected]>
Signed-off-by: Adit Ranadive <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
  • Loading branch information
Aditya Sarwade authored and dledford committed Mar 25, 2017
1 parent e51c2fb commit b172679
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ enum pvrdma_pci_resource {

enum pvrdma_device_ctl {
PVRDMA_DEVICE_CTL_ACTIVATE, /* Activate device. */
PVRDMA_DEVICE_CTL_QUIESCE, /* Quiesce device. */
PVRDMA_DEVICE_CTL_UNQUIESCE, /* Unquiesce device. */
PVRDMA_DEVICE_CTL_RESET, /* Reset device. */
};

Expand Down
13 changes: 11 additions & 2 deletions drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#include "pvrdma.h"

#define DRV_NAME "vmw_pvrdma"
#define DRV_VERSION "1.0.0.0-k"
#define DRV_VERSION "1.0.1.0-k"

static DEFINE_MUTEX(pvrdma_device_list_lock);
static LIST_HEAD(pvrdma_device_list);
Expand Down Expand Up @@ -660,7 +660,16 @@ static void pvrdma_netdevice_event_handle(struct pvrdma_dev *dev,
pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ERR);
break;
case NETDEV_UP:
pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ACTIVE);
pvrdma_write_reg(dev, PVRDMA_REG_CTL,
PVRDMA_DEVICE_CTL_UNQUIESCE);

mb();

if (pvrdma_read_reg(dev, PVRDMA_REG_ERR))
dev_err(&dev->pdev->dev,
"failed to activate device during link up\n");
else
pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ACTIVE);
break;
default:
dev_dbg(&dev->pdev->dev, "ignore netdevice event %ld on %s\n",
Expand Down

0 comments on commit b172679

Please sign in to comment.