diff options
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_diag.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_diag.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_diag.c b/drivers/infiniband/hw/ipath/ipath_diag.c index cf25cdab02f..4137c7770f1 100644 --- a/drivers/infiniband/hw/ipath/ipath_diag.c +++ b/drivers/infiniband/hw/ipath/ipath_diag.c | |||
@@ -446,19 +446,21 @@ static ssize_t ipath_diagpkt_write(struct file *fp, | |||
446 | dd->ipath_unit, plen - 1, pbufn); | 446 | dd->ipath_unit, plen - 1, pbufn); |
447 | 447 | ||
448 | if (dp.pbc_wd == 0) | 448 | if (dp.pbc_wd == 0) |
449 | /* Legacy operation, use computed pbc_wd */ | ||
450 | dp.pbc_wd = plen; | 449 | dp.pbc_wd = plen; |
451 | |||
452 | /* we have to flush after the PBC for correctness on some cpus | ||
453 | * or WC buffer can be written out of order */ | ||
454 | writeq(dp.pbc_wd, piobuf); | 450 | writeq(dp.pbc_wd, piobuf); |
455 | ipath_flush_wc(); | 451 | /* |
456 | /* copy all by the trigger word, then flush, so it's written | 452 | * Copy all by the trigger word, then flush, so it's written |
457 | * to chip before trigger word, then write trigger word, then | 453 | * to chip before trigger word, then write trigger word, then |
458 | * flush again, so packet is sent. */ | 454 | * flush again, so packet is sent. |
459 | __iowrite32_copy(piobuf + 2, tmpbuf, clen - 1); | 455 | */ |
460 | ipath_flush_wc(); | 456 | if (dd->ipath_flags & IPATH_PIO_FLUSH_WC) { |
461 | __raw_writel(tmpbuf[clen - 1], piobuf + clen + 1); | 457 | ipath_flush_wc(); |
458 | __iowrite32_copy(piobuf + 2, tmpbuf, clen - 1); | ||
459 | ipath_flush_wc(); | ||
460 | __raw_writel(tmpbuf[clen - 1], piobuf + clen + 1); | ||
461 | } else | ||
462 | __iowrite32_copy(piobuf + 2, tmpbuf, clen); | ||
463 | |||
462 | ipath_flush_wc(); | 464 | ipath_flush_wc(); |
463 | 465 | ||
464 | ret = sizeof(dp); | 466 | ret = sizeof(dp); |