diff options
author | Tony Lindgren <tony@atomide.com> | 2010-12-10 09:44:39 -0800 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-12-10 09:44:39 -0800 |
commit | 67b738ef32df7ec429004866d2a739a3775894d2 (patch) | |
tree | 5c67fa0cea6cc7298321480eda2df04bef795305 /drivers/net/mlx4/fw.c | |
parent | c451278c2864e253a4bb303b596a29edc3bb527c (diff) | |
parent | 5d190c40100793a6dfc37bf325677c10f3c80edf (diff) | |
download | linux-67b738ef32df7ec429004866d2a739a3775894d2.tar.bz2 |
Merge branch 'devel-omap-irq' into omap-for-linus
Diffstat (limited to 'drivers/net/mlx4/fw.c')
-rw-r--r-- | drivers/net/mlx4/fw.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/mlx4/fw.c b/drivers/net/mlx4/fw.c index b68eee2414c2..7a7e18ba278a 100644 --- a/drivers/net/mlx4/fw.c +++ b/drivers/net/mlx4/fw.c @@ -289,6 +289,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, "firmware bug: log2 # of blue flame regs 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); |