linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Serialization of configuration accesses for mvebu/designware
@ 2014-02-20 18:51 Andrew Murray
  2014-02-20 20:42 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Murray @ 2014-02-20 18:51 UTC (permalink / raw)
  To: linux-pci@vger.kernel.org
  Cc: Thomas Petazzoni, jg1.han, Jason Cooper, mohit.kumar

Hello,

I've noticed that the mvebu and designware both use spinlocks to
serialize access to the configuration space (pci_ops.[read|write]).
However the read/write ops are only ever used from the pci core
(access.c, pci.c) where they are already protected with the pci_lock.

As far as I can tell these extra spinlocks are superfluous, therefore...

Can they be removed?
Can future host bridge drivers assume that calls to the pci_ops are serialized?

I'm happy to provide a patch for the existing drivers if so.

Thanks,

Andrew Murray

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Serialization of configuration accesses for mvebu/designware
  2014-02-20 18:51 Serialization of configuration accesses for mvebu/designware Andrew Murray
@ 2014-02-20 20:42 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2014-02-20 20:42 UTC (permalink / raw)
  To: Andrew Murray
  Cc: linux-pci@vger.kernel.org, jg1.han, Jason Cooper, mohit.kumar

Dear Andrew Murray,

On Thu, 20 Feb 2014 18:51:32 +0000, Andrew Murray wrote:

> I've noticed that the mvebu and designware both use spinlocks to
> serialize access to the configuration space (pci_ops.[read|write]).
> However the read/write ops are only ever used from the pci core
> (access.c, pci.c) where they are already protected with the pci_lock.
> 
> As far as I can tell these extra spinlocks are superfluous, therefore...
> 
> Can they be removed?
> Can future host bridge drivers assume that calls to the pci_ops are serialized?

Just had a quick look, and indeed all the PCI configuration space
access functions in drivers/pci/access.c seem to be taking the
pci_lock, making the internal driver lock useless. Patches welcome! :-)

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-20 20:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-20 18:51 Serialization of configuration accesses for mvebu/designware Andrew Murray
2014-02-20 20:42 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).