linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: mvebu: Remove unnecessary use of 'conf_lock' spinlock
@ 2014-02-20 21:32 Andrew Murray
  2014-02-21  0:06 ` Jason Cooper
  2014-04-03 22:34 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Murray @ 2014-02-20 21:32 UTC (permalink / raw)
  To: linux-pci; +Cc: thomas.petazzoni, jason, Andrew Murray

Serialization of configuration accesses is provided by 'pci_lock' in
drivers/pci/access.c thus making the driver's 'conf_lock' superfluous.

Signed-off-by: Andrew Murray <amurray@embedded-bits.co.uk>
---
 drivers/pci/host/pci-mvebu.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index 13478ec..1d61182 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -119,7 +119,6 @@ struct mvebu_pcie {
 struct mvebu_pcie_port {
 	char *name;
 	void __iomem *base;
-	spinlock_t conf_lock;
 	u32 port;
 	u32 lane;
 	int devfn;
@@ -590,7 +589,6 @@ static int mvebu_pcie_wr_conf(struct pci_bus *bus, u32 devfn,
 {
 	struct mvebu_pcie *pcie = sys_to_pcie(bus->sysdata);
 	struct mvebu_pcie_port *port;
-	unsigned long flags;
 	int ret;
 
 	port = mvebu_pcie_find_port(pcie, bus, devfn);
@@ -616,10 +614,8 @@ static int mvebu_pcie_wr_conf(struct pci_bus *bus, u32 devfn,
 		return PCIBIOS_DEVICE_NOT_FOUND;
 
 	/* Access the real PCIe interface */
-	spin_lock_irqsave(&port->conf_lock, flags);
 	ret = mvebu_pcie_hw_wr_conf(port, bus, devfn,
 				    where, size, val);
-	spin_unlock_irqrestore(&port->conf_lock, flags);
 
 	return ret;
 }
@@ -630,7 +626,6 @@ static int mvebu_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where,
 {
 	struct mvebu_pcie *pcie = sys_to_pcie(bus->sysdata);
 	struct mvebu_pcie_port *port;
-	unsigned long flags;
 	int ret;
 
 	port = mvebu_pcie_find_port(pcie, bus, devfn);
@@ -662,10 +657,8 @@ static int mvebu_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where,
 	}
 
 	/* Access the real PCIe interface */
-	spin_lock_irqsave(&port->conf_lock, flags);
 	ret = mvebu_pcie_hw_rd_conf(port, bus, devfn,
 				    where, size, val);
-	spin_unlock_irqrestore(&port->conf_lock, flags);
 
 	return ret;
 }
@@ -985,7 +978,6 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
 		mvebu_pcie_set_local_dev_nr(port, 1);
 
 		port->dn = child;
-		spin_lock_init(&port->conf_lock);
 		mvebu_sw_pci_bridge_init(port);
 		i++;
 	}
-- 
1.8.3.2


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

* Re: [PATCH] PCI: mvebu: Remove unnecessary use of 'conf_lock' spinlock
  2014-02-20 21:32 [PATCH] PCI: mvebu: Remove unnecessary use of 'conf_lock' spinlock Andrew Murray
@ 2014-02-21  0:06 ` Jason Cooper
  2014-04-03 22:34 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Cooper @ 2014-02-21  0:06 UTC (permalink / raw)
  To: Andrew Murray; +Cc: linux-pci, thomas.petazzoni

On Thu, Feb 20, 2014 at 09:32:15PM +0000, Andrew Murray wrote:
> Serialization of configuration accesses is provided by 'pci_lock' in
> drivers/pci/access.c thus making the driver's 'conf_lock' superfluous.
> 
> Signed-off-by: Andrew Murray <amurray@embedded-bits.co.uk>

Acked-by: Jason Cooper <jason@lakedaemon.net>

thx,

Jason.

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

* Re: [PATCH] PCI: mvebu: Remove unnecessary use of 'conf_lock' spinlock
  2014-02-20 21:32 [PATCH] PCI: mvebu: Remove unnecessary use of 'conf_lock' spinlock Andrew Murray
  2014-02-21  0:06 ` Jason Cooper
@ 2014-04-03 22:34 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2014-04-03 22:34 UTC (permalink / raw)
  To: Andrew Murray; +Cc: linux-pci, thomas.petazzoni, jason

On Thu, Feb 20, 2014 at 09:32:15PM +0000, Andrew Murray wrote:
> Serialization of configuration accesses is provided by 'pci_lock' in
> drivers/pci/access.c thus making the driver's 'conf_lock' superfluous.
> 
> Signed-off-by: Andrew Murray <amurray@embedded-bits.co.uk>

Applied with Jason's ack to my pci/pending branch for v3.16.  After
v3.15-rc1, I'll sort it into pci/host-mvebu as usual.  Thanks!

> ---
>  drivers/pci/host/pci-mvebu.c | 8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
> index 13478ec..1d61182 100644
> --- a/drivers/pci/host/pci-mvebu.c
> +++ b/drivers/pci/host/pci-mvebu.c
> @@ -119,7 +119,6 @@ struct mvebu_pcie {
>  struct mvebu_pcie_port {
>  	char *name;
>  	void __iomem *base;
> -	spinlock_t conf_lock;
>  	u32 port;
>  	u32 lane;
>  	int devfn;
> @@ -590,7 +589,6 @@ static int mvebu_pcie_wr_conf(struct pci_bus *bus, u32 devfn,
>  {
>  	struct mvebu_pcie *pcie = sys_to_pcie(bus->sysdata);
>  	struct mvebu_pcie_port *port;
> -	unsigned long flags;
>  	int ret;
>  
>  	port = mvebu_pcie_find_port(pcie, bus, devfn);
> @@ -616,10 +614,8 @@ static int mvebu_pcie_wr_conf(struct pci_bus *bus, u32 devfn,
>  		return PCIBIOS_DEVICE_NOT_FOUND;
>  
>  	/* Access the real PCIe interface */
> -	spin_lock_irqsave(&port->conf_lock, flags);
>  	ret = mvebu_pcie_hw_wr_conf(port, bus, devfn,
>  				    where, size, val);
> -	spin_unlock_irqrestore(&port->conf_lock, flags);
>  
>  	return ret;
>  }
> @@ -630,7 +626,6 @@ static int mvebu_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where,
>  {
>  	struct mvebu_pcie *pcie = sys_to_pcie(bus->sysdata);
>  	struct mvebu_pcie_port *port;
> -	unsigned long flags;
>  	int ret;
>  
>  	port = mvebu_pcie_find_port(pcie, bus, devfn);
> @@ -662,10 +657,8 @@ static int mvebu_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where,
>  	}
>  
>  	/* Access the real PCIe interface */
> -	spin_lock_irqsave(&port->conf_lock, flags);
>  	ret = mvebu_pcie_hw_rd_conf(port, bus, devfn,
>  				    where, size, val);
> -	spin_unlock_irqrestore(&port->conf_lock, flags);
>  
>  	return ret;
>  }
> @@ -985,7 +978,6 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
>  		mvebu_pcie_set_local_dev_nr(port, 1);
>  
>  		port->dn = child;
> -		spin_lock_init(&port->conf_lock);
>  		mvebu_sw_pci_bridge_init(port);
>  		i++;
>  	}
> -- 
> 1.8.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2014-04-03 22:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-20 21:32 [PATCH] PCI: mvebu: Remove unnecessary use of 'conf_lock' spinlock Andrew Murray
2014-02-21  0:06 ` Jason Cooper
2014-04-03 22:34 ` Bjorn Helgaas

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).