On Sat, Apr 22, 2017 at 12:52 AM, Jason Gunthorpe <jgunthorpe@xxxxxxxxxxxxxxxxxxxx> wrote: > On Fri, Apr 21, 2017 at 02:57:08PM -0400, Devesh Sharma wrote: > >> +static void bnxt_re_ring_db(struct bnxt_re_dpi *dpi, >> + struct bnxt_re_db_hdr *hdr) >> +{ >> + __le64 *dbval; >> + >> + pthread_spin_lock(&dpi->db_lock); >> + dbval = (__le64 *)&hdr->indx; >> + udma_to_device_barrier(); >> + iowrite64(dpi->dbpage, dbval); >> + pthread_spin_unlock(&dpi->db_lock); >> +} > > What are you expecting this db_lock to do? > > Is 'dbpage' UC or WC memory? Driver re-maps it as "UC-" where strong ordering is guaranteed. How system would handle 64-bit writes will it issue two 32-bit consecutive writes on the bus? > > If this is UC memory then writing 64 bit values concurrently from > multiple threads is OK and this lock does nothing. > > If this is WC memory then you need to use mmio_wc_spinlock / > mmio_wc_spinunlock instead, or the lock doesn't work right. > > Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html