Commit 85451a95 authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller

sfc: Optimise falcon_writel_page_locked() for page > 0

The bug this function works around only applies to the first set of
page-mapped registers; other pages can be written without locking.
Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 28c46058
...@@ -238,17 +238,20 @@ static inline void falcon_writel_page(struct efx_nic *efx, efx_dword_t *value, ...@@ -238,17 +238,20 @@ static inline void falcon_writel_page(struct efx_nic *efx, efx_dword_t *value,
/* Write dword to Falcon page-mapped register with an extra lock. /* Write dword to Falcon page-mapped register with an extra lock.
* *
* As for falcon_writel_page(), but for a register that suffers from * As for falcon_writel_page(), but for a register that suffers from
* SFC bug 3181. Take out a lock so the BIU collector cannot be * SFC bug 3181. If writing to page 0, take out a lock so the BIU
* confused. */ * collector cannot be confused.
*/
static inline void falcon_writel_page_locked(struct efx_nic *efx, static inline void falcon_writel_page_locked(struct efx_nic *efx,
efx_dword_t *value, efx_dword_t *value,
unsigned int reg, unsigned int reg,
unsigned int page) unsigned int page)
{ {
unsigned long flags; unsigned long flags = 0;
if (page == 0)
spin_lock_irqsave(&efx->biu_lock, flags); spin_lock_irqsave(&efx->biu_lock, flags);
falcon_writel(efx, value, FALCON_PAGED_REG(page, reg)); falcon_writel(efx, value, FALCON_PAGED_REG(page, reg));
if (page == 0)
spin_unlock_irqrestore(&efx->biu_lock, flags); spin_unlock_irqrestore(&efx->biu_lock, flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment