When Ethernet function goes up the driver updates the device. Add support to device quiesce operation as a result of netdev down event. Since this operation might not be supported by the device yet a warning is printed and not error. While there fix the error message in the netdev up event. Signed-off-by: Yuval Shaia <yuval.shaia@xxxxxxxxxx> --- drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h | 1 + drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h index 6fd5a8f4e2f6..fe966393991c 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h @@ -167,6 +167,7 @@ enum pvrdma_device_ctl { PVRDMA_DEVICE_CTL_ACTIVATE, /* Activate device. */ PVRDMA_DEVICE_CTL_UNQUIESCE, /* Unquiesce device. */ PVRDMA_DEVICE_CTL_RESET, /* Reset device. */ + PVRDMA_DEVICE_CTL_QUIESCE, /* Quiesce device. */ }; enum pvrdma_intr_vector { diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c index a5719899f49a..0183faa2f54d 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c @@ -701,6 +701,15 @@ static void pvrdma_netdevice_event_handle(struct pvrdma_dev *dev, switch (event) { case NETDEV_REBOOT: case NETDEV_DOWN: + pvrdma_write_reg(dev, PVRDMA_REG_CTL, + PVRDMA_DEVICE_CTL_QUIESCE); + + mb(); + + if (pvrdma_read_reg(dev, PVRDMA_REG_ERR)) + dev_warn(&dev->pdev->dev, + "failed to quiesce device during link down\n"); + pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ERR); break; case NETDEV_UP: @@ -711,7 +720,7 @@ static void pvrdma_netdevice_event_handle(struct pvrdma_dev *dev, if (pvrdma_read_reg(dev, PVRDMA_REG_ERR)) dev_err(&dev->pdev->dev, - "failed to activate device during link up\n"); + "failed to unquiesce device during link up\n"); else pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ACTIVE); break; -- 2.17.1