RDMA/efa: Properly document the interrupt mask register
authorGal Pressman <galpress@amazon.com>
Tue, 25 Feb 2020 11:40:09 +0000 (13:40 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 28 Feb 2020 16:12:12 +0000 (12:12 -0400)
The fact that the LSB in the register is the enable bit should not be an
implicit assumption between the driver and the device, properly document
that in the register definition.

Link: https://lore.kernel.org/r/20200225114010.21790-3-galpress@amazon.com
Reviewed-by: Firas JahJah <firasj@amazon.com>
Reviewed-by: Yossi Leybovich <sleybo@amazon.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/efa/efa_com.c
drivers/infiniband/hw/efa/efa_regs_defs.h

index 9e6399bfcf6db0d8110693061b178fd381bef98c..7fce69f5568f30b8a5cf4283a8ea595ea564bc9c 100644 (file)
@@ -23,8 +23,6 @@
 #define EFA_DMA_ADDR_TO_UINT32_LOW(x)   ((u32)((u64)(x)))
 #define EFA_DMA_ADDR_TO_UINT32_HIGH(x)  ((u32)(((u64)(x)) >> 32))
 
-#define EFA_REGS_ADMIN_INTR_MASK 1
-
 enum efa_cmd_status {
        EFA_CMD_SUBMITTED,
        EFA_CMD_COMPLETED,
@@ -689,7 +687,7 @@ void efa_com_set_admin_polling_mode(struct efa_com_dev *edev, bool polling)
        u32 mask_value = 0;
 
        if (polling)
-               mask_value = EFA_REGS_ADMIN_INTR_MASK;
+               EFA_SET(&mask_value, EFA_REGS_INTR_MASK_EN, 1);
 
        writel(mask_value, edev->reg_bar + EFA_REGS_INTR_MASK_OFF);
        if (polling)
index 322a2c0d4ef951ae9e9ea0ca14035a509b1f07bd..4017982fe13b06cb6db56a3b68a610c6d9c1c2cc 100644 (file)
@@ -73,6 +73,9 @@ enum efa_regs_reset_reason_types {
 #define EFA_REGS_AENQ_CAPS_AENQ_ENTRY_SIZE_MASK             0xff0000
 #define EFA_REGS_AENQ_CAPS_AENQ_MSIX_VECTOR_MASK            0xff000000
 
+/* intr_mask register */
+#define EFA_REGS_INTR_MASK_EN_MASK                          0x1
+
 /* dev_ctl register */
 #define EFA_REGS_DEV_CTL_DEV_RESET_MASK                     0x1
 #define EFA_REGS_DEV_CTL_AQ_RESTART_MASK                    0x2