svn commit: r290686 - in head/sys/dev/ntb: if_ntb ntb_hw
Conrad E. Meyer
cem at FreeBSD.org
Wed Nov 11 18:56:04 UTC 2015
Author: cem
Date: Wed Nov 11 18:56:02 2015
New Revision: 290686
URL: https://svnweb.freebsd.org/changeset/base/290686
Log:
ntb: volatile some members set by interrupt routines
Sponsored by: EMC / Isilon Storage Division
Modified:
head/sys/dev/ntb/if_ntb/if_ntb.c
head/sys/dev/ntb/ntb_hw/ntb_hw.c
Modified: head/sys/dev/ntb/if_ntb/if_ntb.c
==============================================================================
--- head/sys/dev/ntb/if_ntb/if_ntb.c Wed Nov 11 18:55:53 2015 (r290685)
+++ head/sys/dev/ntb/if_ntb/if_ntb.c Wed Nov 11 18:56:02 2015 (r290686)
@@ -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;
Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c
==============================================================================
--- head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:55:53 2015 (r290685)
+++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:56:02 2015 (r290686)
@@ -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,
More information about the svn-src-all
mailing list