Re: [PATCH] RDMA/vmw_pvrdma: Update device when link is doing down

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 30, 2018 at 05:01:29PM +0300, Yuval Shaia wrote:
> 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
> +++ 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
> +++ 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();

Don't add mb()'s without a huge comment exmapling what it is supposed
to be doing.. kinda looks wrong really.

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux