From: Florian Fainelli Date: Wed, 24 Aug 2016 21:21:41 +0000 (-0700) Subject: net: systemport: Fix ordering in intrl2_*_mask_clear macro X-Git-Tag: v3.16.40~284 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3b7ecf53c92feae9b8e2423cad5ce4fbc4f9e4b4;p=thirdparty%2Fkernel%2Fstable.git net: systemport: Fix ordering in intrl2_*_mask_clear macro commit 9a0a5c4cb1af98b625dcefd72e987ca4929db71d upstream. 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 Signed-off-by: David S. Miller Signed-off-by: Ben Hutchings --- diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index c583dd58268bc..3cca6047578bb 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) \