From b56203ac039ae95939c38e95ed4bea70c4b78dd0 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Sat, 9 Jul 2016 09:34:24 +0000 Subject: [PATCH] Fix NTB_SDOORBELL_LOCKUP workaround. Since SBARxSZ register can be write-once, it can be unusable for disabling the SBAR. For such case also set SBARxBASE to zero to not intersect with config BAR. --- sys/dev/ntb/ntb_hw/ntb_hw.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/ntb/ntb_hw/ntb_hw.c b/sys/dev/ntb/ntb_hw/ntb_hw.c index c1381f03bef..bfa35594dae 100644 --- a/sys/dev/ntb/ntb_hw/ntb_hw.c +++ b/sys/dev/ntb/ntb_hw/ntb_hw.c @@ -1673,8 +1673,12 @@ xeon_set_sbar_base_and_limit(struct ntb_softc *ntb, uint64_t bar_addr, uint32_t base_reg, lmt_reg; bar_get_xlat_params(ntb, idx, &base_reg, NULL, &lmt_reg); - if (idx == regbar) - bar_addr += ntb->b2b_off; + if (idx == regbar) { + if (ntb->b2b_off) + bar_addr += ntb->b2b_off; + else + bar_addr = 0; + } /* * Set limit registers first to avoid an errata where setting the base -- 2.45.2