diff options
| author | Dave Jiang <dave.jiang@intel.com> | 2015-11-19 16:00:54 -0500 |
|---|---|---|
| committer | Jon Mason <jdmason@kudzu.us> | 2016-01-11 09:51:17 -0500 |
| commit | 703872c2c53b57ac14563e64c2df086ef57690f9 (patch) | |
| tree | 6d9e17a61c244d7bfb061fc14840e6622055d902 /drivers/ntb | |
| parent | 179f912a39ac192d2281ecb10a66918ee20f5d73 (diff) | |
NTB: Clear property bits in BAR value
The lower bits read from a BAR register will contain property bits
that we do not care about. Clear those so that we can use the BAR
values for limit and xlat registers.
Reported-by: Conrad Meyer <cem@freebsd.org>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Diffstat (limited to 'drivers/ntb')
| -rw-r--r-- | drivers/ntb/hw/intel/ntb_hw_intel.c | 4 | ||||
| -rw-r--r-- | drivers/ntb/hw/intel/ntb_hw_intel.h | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/ntb/hw/intel/ntb_hw_intel.c b/drivers/ntb/hw/intel/ntb_hw_intel.c index a198f8298258..40d04ef5da9e 100644 --- a/drivers/ntb/hw/intel/ntb_hw_intel.c +++ b/drivers/ntb/hw/intel/ntb_hw_intel.c | |||
| @@ -875,7 +875,7 @@ static int intel_ntb_mw_set_trans(struct ntb_dev *ntb, int idx, | |||
| 875 | limit_reg = bar2_off(ndev->xlat_reg->bar2_limit, bar); | 875 | limit_reg = bar2_off(ndev->xlat_reg->bar2_limit, bar); |
| 876 | 876 | ||
| 877 | if (bar < 4 || !ndev->bar4_split) { | 877 | if (bar < 4 || !ndev->bar4_split) { |
| 878 | base = ioread64(mmio + base_reg); | 878 | base = ioread64(mmio + base_reg) & NTB_BAR_MASK_64; |
| 879 | 879 | ||
| 880 | /* Set the limit if supported, if size is not mw_size */ | 880 | /* Set the limit if supported, if size is not mw_size */ |
| 881 | if (limit_reg && size != mw_size) | 881 | if (limit_reg && size != mw_size) |
| @@ -906,7 +906,7 @@ static int intel_ntb_mw_set_trans(struct ntb_dev *ntb, int idx, | |||
| 906 | if ((addr + size) & (~0ull << 32)) | 906 | if ((addr + size) & (~0ull << 32)) |
| 907 | return -EINVAL; | 907 | return -EINVAL; |
| 908 | 908 | ||
| 909 | base = ioread32(mmio + base_reg); | 909 | base = ioread32(mmio + base_reg) & NTB_BAR_MASK_32; |
| 910 | 910 | ||
| 911 | /* Set the limit if supported, if size is not mw_size */ | 911 | /* Set the limit if supported, if size is not mw_size */ |
| 912 | if (limit_reg && size != mw_size) | 912 | if (limit_reg && size != mw_size) |
diff --git a/drivers/ntb/hw/intel/ntb_hw_intel.h b/drivers/ntb/hw/intel/ntb_hw_intel.h index 2eb4addd10d0..4d60433e279e 100644 --- a/drivers/ntb/hw/intel/ntb_hw_intel.h +++ b/drivers/ntb/hw/intel/ntb_hw_intel.h | |||
| @@ -245,6 +245,9 @@ | |||
| 245 | #define NTB_UNSAFE_DB BIT_ULL(0) | 245 | #define NTB_UNSAFE_DB BIT_ULL(0) |
| 246 | #define NTB_UNSAFE_SPAD BIT_ULL(1) | 246 | #define NTB_UNSAFE_SPAD BIT_ULL(1) |
| 247 | 247 | ||
| 248 | #define NTB_BAR_MASK_64 ~(0xfull) | ||
| 249 | #define NTB_BAR_MASK_32 ~(0xfu) | ||
| 250 | |||
| 248 | struct intel_ntb_dev; | 251 | struct intel_ntb_dev; |
| 249 | 252 | ||
| 250 | struct intel_ntb_reg { | 253 | struct intel_ntb_reg { |
