]> asedeno.scripts.mit.edu Git - linux.git/commit
PCI: aardvark: Don't rely on jiffies while holding spinlock
authorRemi Pommarel <repk@triplefau.lt>
Fri, 27 Sep 2019 08:55:02 +0000 (10:55 +0200)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tue, 15 Oct 2019 11:11:51 +0000 (12:11 +0100)
commit7fbcb5da811be7d47468417c7795405058abb3da
treeb57209b11e81717264104d752f9acf2c708613bd
parentc0f05a6ab52535c1bf5f43272eede3e11c5701a5
PCI: aardvark: Don't rely on jiffies while holding spinlock

advk_pcie_wait_pio() can be called while holding a spinlock (from
pci_bus_read_config_dword()), then depends on jiffies in order to
timeout while polling on PIO state registers. In the case the PIO
transaction failed, the timeout will never happen and will also cause
the cpu to stall.

This decrements a variable and wait instead of using jiffies.

Signed-off-by: Remi Pommarel <repk@triplefau.lt>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Andrew Murray <andrew.murray@arm.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
drivers/pci/controller/pci-aardvark.c