mlx4_core: Workaround firmware bug in query dev cap
Subsystems (2)
PATCH 1/1 mlx4_core: Workaround firmware bug in query dev cap
CX firmware reports the number blue flame registers per page as log2 based number. However, due to a firmware bug, it reports the native number. This patch workaround this by checking if the number of calcualted fits within a page. If it does not, it set the value to 3 which means 8 registers per page.
Signed-off-by Eli Cohen <eli-VPRAkNaXOzVS1MOuV/[email protected]>
--- drivers/net/mlx4/fw.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/net/mlx4/fw.c +4 -0
@@ -299,6 +299,10 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)MLX4_GET (field, outbox,QUERY_DEV_CAP_LOG_BF_REG_SZ_OFFSET ); dev_cap->bf_reg_size =1 << (field &0x1f );MLX4_GET (field, outbox,QUERY_DEV_CAP_LOG_MAX_BF_REGS_PER_PAGE_OFFSET ); +if ((1 << (field &0x3f )) > (PAGE_SIZE / dev_cap->bf_reg_size)) { +mlx4_warn (dev,"log blue flame is invalid (%d), forcing 3\n" , field &0x1f ); + field =3 ; + } dev_cap->bf_regs_per_page =1 << (field &0x3f );mlx4_dbg (dev,"BlueFlame available (reg size %d, regs/page %d)\n" , dev_cap->bf_reg_size, dev_cap->bf_regs_per_page);
Signature · 6 lines
1.6.0.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
thanks, applied
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html