qed: Reserve doorbell BAR space for present CPUs
authorRam Amrani <Ram.Amrani@cavium.com>
Mon, 20 Feb 2017 20:43:33 +0000 (22:43 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Feb 2017 22:11:54 +0000 (17:11 -0500)
Reserving doorbell BAR space according to the currently active CPUs
may result in a bug if disabled CPUs are later enabled but no
doorbell space was reserved for them.

Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_dev.c

index 5ee7f040c50aa88293d6362fb9d7f4689e4f79a8..d6c5a8165b5f42a9ec82a7a9f12f4aacf3f56bbd 100644 (file)
@@ -913,7 +913,7 @@ qed_hw_init_pf_doorbell_bar(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
                /* Either EDPM is mandatory, or we are attempting to allocate a
                 * WID per CPU.
                 */
-               n_cpus = num_active_cpus();
+               n_cpus = num_present_cpus();
                rc = qed_hw_init_dpi_size(p_hwfn, p_ptt, pwm_regsize, n_cpus);
        }