* [PATCH] net: systemport: Fix ordering in intrl2_*_mask_clear macro
@ 2016-08-24 21:21 Florian Fainelli
2016-08-25 23:53 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2016-08-24 21:21 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
Since we keep shadow copies of which interrupt sources are enabled
through the intrl2_*_mask_{set,clear} macros, make sure that the
ordering in which we do these two operations: update the copy, then
unmask the register is correct.
This is not currently a problem because we actually do not use them, but
we will in a subsequent patch optimizing register accesses, so better be
safe here.
Fixes: 80105befdb4b ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
David,
This is intentionally targetting the "net-next" tree since it is
not yet a problem, yet this is still technically a bugfix. No need
to backport this to -stable or anything.
Thanks!
drivers/net/ethernet/broadcom/bcmsysport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index b2d30863caeb..2059911014db 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -58,8 +58,8 @@ BCM_SYSPORT_IO_MACRO(topctrl, SYS_PORT_TOPCTRL_OFFSET);
static inline void intrl2_##which##_mask_clear(struct bcm_sysport_priv *priv, \
u32 mask) \
{ \
- intrl2_##which##_writel(priv, mask, INTRL2_CPU_MASK_CLEAR); \
priv->irq##which##_mask &= ~(mask); \
+ intrl2_##which##_writel(priv, mask, INTRL2_CPU_MASK_CLEAR); \
} \
static inline void intrl2_##which##_mask_set(struct bcm_sysport_priv *priv, \
u32 mask) \
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: systemport: Fix ordering in intrl2_*_mask_clear macro
2016-08-24 21:21 [PATCH] net: systemport: Fix ordering in intrl2_*_mask_clear macro Florian Fainelli
@ 2016-08-25 23:53 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-08-25 23:53 UTC (permalink / raw)
To: f.fainelli; +Cc: netdev
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Wed, 24 Aug 2016 14:21:41 -0700
> Since we keep shadow copies of which interrupt sources are enabled
> through the intrl2_*_mask_{set,clear} macros, make sure that the
> ordering in which we do these two operations: update the copy, then
> unmask the register is correct.
>
> This is not currently a problem because we actually do not use them, but
> we will in a subsequent patch optimizing register accesses, so better be
> safe here.
>
> Fixes: 80105befdb4b ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> David,
>
> This is intentionally targetting the "net-next" tree since it is
> not yet a problem, yet this is still technically a bugfix. No need
> to backport this to -stable or anything.
Fair enough, applied to net-next.
Thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-25 23:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-24 21:21 [PATCH] net: systemport: Fix ordering in intrl2_*_mask_clear macro Florian Fainelli
2016-08-25 23:53 ` David Miller
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).