Re: mutual exclusion locks over PCI memory

2009-02-23 Thread Grant Grundler
On Mon, Feb 23, 2009 at 01:01:05PM +0530, arun c wrote: > Hi, ... > > I suspect you need/want at least one wmb() between those three steps > > depending on what the remote host is polling. > > The "VALID" field sounds redundant to me and I would drop it. > > Updating the write_index should be enoug

Re: mutual exclusion locks over PCI memory

2009-02-23 Thread arun c
Hi, On Mon, Feb 23, 2009 at 1:01 PM, arun c wrote: > Hi, > > On Mon, Feb 23, 2009 at 12:43 PM, Grant Grundler > wrote: >> On Mon, Feb 23, 2009 at 11:47:19AM +0530, arun c wrote: >> ... >>> Yes I don't need any lock to protect my data >>> here, as host is write only and target is read only. >>> >

Re: mutual exclusion locks over PCI memory

2009-02-22 Thread arun c
Hi, On Mon, Feb 23, 2009 at 12:43 PM, Grant Grundler wrote: > On Mon, Feb 23, 2009 at 11:47:19AM +0530, arun c wrote: > ... >> Yes I don't need any lock to protect my data >> here, as host is write only and target is read only. >> >> Here is what I did. >> >> typedef command_pkt { >> u32 valid; >

Re: mutual exclusion locks over PCI memory

2009-02-22 Thread Grant Grundler
On Mon, Feb 23, 2009 at 11:47:19AM +0530, arun c wrote: ... > Yes I don't need any lock to protect my data > here, as host is write only and target is read only. > > Here is what I did. > > typedef command_pkt { > u32 valid; > .. > .. > .. > u32 data[]; > } > > typedef struct my_circ

Re: mutual exclusion locks over PCI memory

2009-02-22 Thread arun c
Hi, On Sun, Feb 22, 2009 at 8:25 AM, Grant Grundler wrote: > On Fri, Feb 20, 2009 at 07:10:24AM -0700, Matthew Wilcox wrote: >> On Fri, Feb 20, 2009 at 07:09:51PM +0530, arun c wrote: >> > PCI host machine (PPC cpu) writes commands to >> > the PCI memory space of the (Coldfire CPU) >> > target de

Re: mutual exclusion locks over PCI memory

2009-02-21 Thread Grant Grundler
On Fri, Feb 20, 2009 at 07:10:24AM -0700, Matthew Wilcox wrote: > On Fri, Feb 20, 2009 at 07:09:51PM +0530, arun c wrote: > > PCI host machine (PPC cpu) writes commands to > > the PCI memory space of the (Coldfire CPU) > > target device. Target device takes the command > > and executes it. > > > >

Re: mutual exclusion locks over PCI memory

2009-02-20 Thread Matthew Wilcox
On Fri, Feb 20, 2009 at 07:09:51PM +0530, arun c wrote: > PCI host machine (PPC cpu) writes commands to > the PCI memory space of the (Coldfire CPU) > target device. Target device takes the command > and executes it. > > Target devices SDRAM is exposed over PCI to host. > A circular buffer residin

Re: mutual exclusion locks over PCI memory

2009-02-20 Thread Yu Zhao
On Fri, Feb 20, 2009 at 09:39:51PM +0800, arun c wrote: > Hi all, > > I am writing a software to implement communication > over PCI. > > PCI host machine (PPC cpu) writes commands to > the PCI memory space of the (Coldfire CPU) > target device. Target device takes the command > and executes it. >

mutual exclusion locks over PCI memory

2009-02-20 Thread arun c
Hi all, I am writing a software to implement communication over PCI. PCI host machine (PPC cpu) writes commands to the PCI memory space of the (Coldfire CPU) target device. Target device takes the command and executes it. Target devices SDRAM is exposed over PCI to host. A circular buffer residi