linux/drivers/net/ethernet/apm/xgene
Arnd Bergmann f9dc70744d net/xgene: fix error handling during reset
The newly added reset logic uses helper functions for the MMIO that
may fail. However, when the read operation fails, we end up writing
back uninitialized data to the register, as gcc warns:

drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c: In function 'xgene_enet_link_state':
drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c:213:2: error: 'data' may be used uninitialized in this function [-Werror=maybe-uninitialized]
drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c:209:6: note: 'data' was declared here
  u32 data;

We already print a warning to the console log if that happens,
the best alternative that I can see is skip the rest of the reset
sequence if the register value cannot be read: Most likely the
write would fail as well, and if it succeeded, worse things could
happen.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 3eb7cb9dc9 ("drivers: net: xgene: XFI PCS reset when link is down")
Cc: Fushen Chen <fchen@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-08-29 00:29:46 -04:00
..
Kconfig drivers: net: xgene: Poll link status via GPIO 2016-08-13 11:48:53 -07:00
Makefile drivers: net: xgene: Add support for Classifier engine 2016-02-17 22:08:34 -05:00
xgene_enet_cle.c drivers: net: xgene: Fix RSS indirection table fields 2016-08-13 11:48:52 -07:00
xgene_enet_cle.h drivers: net: xgene: Fix RSS indirection table fields 2016-08-13 11:48:52 -07:00
xgene_enet_ethtool.c drivers: net: xgene: ethtool: Use phy_ethtool_gset and sset 2016-07-25 21:51:43 -07:00
xgene_enet_hw.c drivers: net: xgene: Fix backward compatibility 2016-08-13 11:48:53 -07:00
xgene_enet_hw.h drivers: net: xgene: XFI PCS reset when link is down 2016-08-13 11:48:53 -07:00
xgene_enet_main.c drivers: net: xgene: Poll link status via GPIO 2016-08-13 11:48:53 -07:00
xgene_enet_main.h drivers: net: xgene: Poll link status via GPIO 2016-08-13 11:48:53 -07:00
xgene_enet_ring2.c drivers: net: xgene: Add support for multiple queues 2016-02-17 22:08:34 -05:00
xgene_enet_ring2.h drivers: net: xgene: Add ring manager v2 functions 2015-04-30 16:03:13 -04:00
xgene_enet_sgmac.c drivers: net: xgene: Add backward compatibility 2016-07-25 21:51:43 -07:00
xgene_enet_sgmac.h drivers: net: xgene: Fix module unload crash - clkrst sequence 2016-07-25 21:51:43 -07:00
xgene_enet_xgmac.c net/xgene: fix error handling during reset 2016-08-29 00:29:46 -04:00
xgene_enet_xgmac.h drivers: net: xgene: XFI PCS reset when link is down 2016-08-13 11:48:53 -07:00