Re: HELP: Is writeq an atomic operation??

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Moore, Eric <Eric.Moore@...>
Cc: <linux-kernel@...>
Date: Friday, May 2, 2008 - 6:46 pm

> Is a 64bit write to MMIO registers an atomic operation when using the
 > writeq API?  
 > 
 > My concern is when I send 64bit data via writeq, will it be sent out as
 > two 32 bit writes?  If so, is it possible that another CPU be sending
 > the data at the same time.  Meaning can I write the 1st 32bit data from
 > CPU-A, meanwhile CPU-B is writing his 32bit data at the same time, and
 > CPU-A didn't complete the full 64bit in one shot.  If this could occur,
 > is there an API that I can use to make sure the entire data sent in one
 > atomic operation?

I don't have an authoritative answer, but I can say that I coded
drivers/infiniband/hw/mthca and .../mlx4 assuming that writeq() is
atomic in the sense that you say, and no one has reported any problems.

But I'm sure no one has stressed the drivers on 64-bit mips or anything
unusual like that.

 - R.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
HELP: Is writeq an atomic operation??, Moore, Eric, (Fri May 2, 6:40 pm)
Re: HELP: Is writeq an atomic operation??, H. Peter Anvin, (Fri May 2, 8:41 pm)
Re: HELP: Is writeq an atomic operation??, Jesse Barnes, (Fri May 2, 7:12 pm)
Re: HELP: Is writeq an atomic operation??, Roland Dreier, (Fri May 2, 7:04 pm)
RE: HELP: Is writeq an atomic operation??, Moore, Eric, (Fri May 2, 7:20 pm)
Re: HELP: Is writeq an atomic operation??, Roland Dreier, (Fri May 2, 8:10 pm)
Re: HELP: Is writeq an atomic operation??, Andi Kleen, (Fri May 2, 6:50 pm)
RE: HELP: Is writeq an atomic operation??, Moore, Eric, (Fri May 2, 7:03 pm)
Re: HELP: Is writeq an atomic operation??, Andi Kleen, (Fri May 2, 7:13 pm)
Re: HELP: Is writeq an atomic operation??, Roland Dreier, (Fri May 2, 6:46 pm)
Re: HELP: Is writeq an atomic operation??, Benjamin Herrenschmidt, (Sat May 3, 6:37 pm)
Re: HELP: Is writeq an atomic operation??, Roland Dreier, (Sun May 4, 1:01 pm)
Re: HELP: Is writeq an atomic operation??, H. Peter Anvin, (Fri May 2, 8:42 pm)
Re: HELP: Is writeq an atomic operation??, Alan Cox, (Sat May 3, 10:35 am)
Re: HELP: Is writeq an atomic operation??, H. Peter Anvin, (Sat May 3, 1:40 pm)