summaryrefslogtreecommitdiffstats
path: root/sys/dev/ntb
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ntb')
-rw-r--r--sys/dev/ntb/if_ntb/if_ntb.c4
-rw-r--r--sys/dev/ntb/ntb_hw/ntb_hw.c10
2 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/ntb/if_ntb/if_ntb.c b/sys/dev/ntb/if_ntb/if_ntb.c
index a24d0b2..963f433 100644
--- a/sys/dev/ntb/if_ntb/if_ntb.c
+++ b/sys/dev/ntb/if_ntb/if_ntb.c
@@ -144,7 +144,7 @@ struct ntb_transport_qp {
void *cb_data;
bool client_ready;
- bool link_is_up;
+ volatile bool link_is_up;
uint8_t qp_num; /* Only 64 QPs are allowed. 0-63 */
struct ntb_rx_info *rx_info;
@@ -225,7 +225,7 @@ struct ntb_transport_ctx {
struct _qpset qp_bitmap_free;
unsigned mw_count;
unsigned qp_count;
- enum ntb_link_event link_is_up;
+ volatile bool link_is_up;
struct callout link_work;
struct task link_cleanup;
uint64_t bufsize;
diff --git a/sys/dev/ntb/ntb_hw/ntb_hw.c b/sys/dev/ntb/ntb_hw/ntb_hw.c
index 1980518..448d6bb 100644
--- a/sys/dev/ntb/ntb_hw/ntb_hw.c
+++ b/sys/dev/ntb/ntb_hw/ntb_hw.c
@@ -209,8 +209,8 @@ struct ntb_softc {
#define DB_MASK_ASSERT(sc,f) mtx_assert(&(sc)->db_mask_lock, (f))
struct mtx db_mask_lock;
- uint32_t ntb_ctl;
- uint32_t lnk_sta;
+ volatile uint32_t ntb_ctl;
+ volatile uint32_t lnk_sta;
uint64_t db_valid_mask;
uint64_t db_link_mask;
@@ -1976,9 +1976,11 @@ ntb_sysctl_init(struct ntb_softc *ntb)
"Features/errata of this NTB device");
SYSCTL_ADD_UINT(ctx, tree_par, OID_AUTO, "ntb_ctl", CTLFLAG_RD,
- &ntb->ntb_ctl, 0, "NTB CTL register (cached)");
+ __DEVOLATILE(uint32_t *, &ntb->ntb_ctl), 0,
+ "NTB CTL register (cached)");
SYSCTL_ADD_UINT(ctx, tree_par, OID_AUTO, "lnk_sta", CTLFLAG_RD,
- &ntb->lnk_sta, 0, "LNK STA register (cached)");
+ __DEVOLATILE(uint32_t *, &ntb->lnk_sta), 0,
+ "LNK STA register (cached)");
SYSCTL_ADD_PROC(ctx, tree_par, OID_AUTO, "link_status",
CTLFLAG_RD | CTLTYPE_STRING, ntb, 0, sysctl_handle_link_status,
OpenPOWER on IntegriCloud