mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-27 22:53:55 +08:00
staging: slicoss: fix occasionally writing out only half of a dma address
curaddrupper caches the last written upper 32-bits of a dma address (the device has one register for the upper 32-bits of all dma address registers). The problem is, not every dma address write checks and sets curaddrupper. This causes the driver to occasionally not write the upper 32-bits of a dma address to the device when it really should. I've seen this manifest particularly when the driver is trying to read config data from the device (RCONFIG) in order to checksum the device's eeprom. Since the device writes its config data to the wrong DMA address the driver reads 0 as the eeprom size and the eeprom checksum fails. This patch fixes the issue by removing curaddrupper and always writing the upper 32-bits of dma addresses. Signed-off-by: David Matlack <dmatlack@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
eafe600205
commit
36bf51acc8
@ -414,7 +414,6 @@ struct adapter {
|
|||||||
u32 intrregistered;
|
u32 intrregistered;
|
||||||
uint isp_initialized;
|
uint isp_initialized;
|
||||||
uint gennumber;
|
uint gennumber;
|
||||||
u32 curaddrupper;
|
|
||||||
struct slic_shmem *pshmem;
|
struct slic_shmem *pshmem;
|
||||||
dma_addr_t phys_shmem;
|
dma_addr_t phys_shmem;
|
||||||
u32 isrcopy;
|
u32 isrcopy;
|
||||||
|
@ -147,10 +147,7 @@ static inline void slic_reg64_write(struct adapter *adapter, void __iomem *reg,
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
spin_lock_irqsave(&adapter->bit64reglock, flags);
|
spin_lock_irqsave(&adapter->bit64reglock, flags);
|
||||||
if (paddrh != adapter->curaddrupper) {
|
|
||||||
adapter->curaddrupper = paddrh;
|
|
||||||
writel(paddrh, regh);
|
writel(paddrh, regh);
|
||||||
}
|
|
||||||
writel(value, reg);
|
writel(value, reg);
|
||||||
if (flush)
|
if (flush)
|
||||||
mb();
|
mb();
|
||||||
|
Loading…
Reference in New Issue
Block a user