@@ -666,7 +666,7 @@ static void dbc_pop_events(struct dbc *dbc)
BUILD_BUG_ON((1 << XHCI_TRB_SHIFT) != sizeof(struct xhci_trb));
- rmb();
+ smp_rmb();
while ( xhci_trb_cyc(event) == er->cyc )
{
@@ -710,7 +710,7 @@ static void dbc_pop_events(struct dbc *dbc)
}
erdp = er->dma + (er->deq << XHCI_TRB_SHIFT);
- wmb();
+ smp_wmb();
writeq(erdp, ®->erdp);
}
@@ -847,9 +847,9 @@ static void dbc_enable_dbc(struct dbc *dbc)
{
struct dbc_reg *reg = dbc->dbc_reg;
- wmb();
+ smp_wmb();
writel(readl(®->ctrl) | (1U << DBC_CTRL_DCE), ®->ctrl);
- wmb();
+ smp_wmb();
while ( (readl(®->ctrl) & (1U << DBC_CTRL_DCE)) == 0 )
cpu_relax();
@@ -858,9 +858,9 @@ static void dbc_enable_dbc(struct dbc *dbc)
if ( !dbc->open )
dbc_reset_debug_port(dbc);
- wmb();
+ smp_wmb();
writel(readl(®->portsc) | (1U << DBC_PSC_PED), ®->portsc);
- wmb();
+ smp_wmb();
while ( (readl(®->ctrl) & (1U << DBC_CTRL_DCR)) == 0 )
cpu_relax();
@@ -871,7 +871,7 @@ static void dbc_disable_dbc(struct dbc *dbc)
struct dbc_reg *reg = dbc->dbc_reg;
writel(readl(®->portsc) & ~(1U << DBC_PSC_PED), ®->portsc);
- wmb();
+ smp_wmb();
writel(readl(®->ctrl) & ~(1U << DBC_CTRL_DCE), ®->ctrl);
while ( readl(®->ctrl) & (1U << DBC_CTRL_DCE) )
@@ -1032,7 +1032,7 @@ static bool dbc_ensure_running(struct dbc *dbc)
{
writel(ctrl | (1U << DBC_CTRL_DRC), ®->ctrl);
writel(readl(®->portsc) | (1U << DBC_PSC_PED), ®->portsc);
- wmb();
+ smp_wmb();
dbc_ring_doorbell(dbc, dbc->dbc_iring.db);
dbc_ring_doorbell(dbc, dbc->dbc_oring.db);
}
@@ -1074,7 +1074,7 @@ static void dbc_flush(struct dbc *dbc, struct xhci_trb_ring *trb,
}
}
- wmb();
+ smp_wmb();
dbc_ring_doorbell(dbc, trb->db);
}
@@ -1101,7 +1101,7 @@ static void dbc_enqueue_in(struct dbc *dbc, struct xhci_trb_ring *trb,
dbc_push_trb(dbc, trb, wrk->dma + wrk->enq,
dbc_work_ring_space_to_end(wrk));
- wmb();
+ smp_wmb();
writel(db, ®->db);
}
All (interesting) data is in plain WB cached memory, and the few BAR register that are configured have a UC mapping, which orders properly WRT other writes on x86. Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> --- New in v6 --- xen/drivers/char/xhci-dbc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)