]> git.baikalelectronics.ru Git - kernel.git/commit
felix: Fix initialization of ioremap resources
authorClaudiu Manoil <claudiu.manoil@nxp.com>
Fri, 22 May 2020 08:54:34 +0000 (11:54 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 May 2020 21:24:46 +0000 (14:24 -0700)
commit2020344216674acec3f0227c9b1f7dfc4936a164
treec3141855fb97a4fece2d48ae6dcbcd1e6a39aeae
parent6eb74bf5a9d67ddbf7ed0b5b3e9664c20269b858
felix: Fix initialization of ioremap resources

The caller of devm_ioremap_resource(), either accidentally
or by wrong assumption, is writing back derived resource data
to global static resource initialization tables that should
have been constant.  Meaning that after it computes the final
physical start address it saves the address for no reason
in the static tables.  This doesn't affect the first driver
probing after reboot, but it breaks consecutive driver reloads
(i.e. driver unbind & bind) because the initialization tables
no longer have the correct initial values.  So the next probe()
will map the device registers to wrong physical addresses,
causing ARM SError async exceptions.
This patch fixes all of the above.

Fixes: 34efb4cbfb94 ("net: dsa: ocelot: add driver for Felix switch family")
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/ocelot/felix.c
drivers/net/dsa/ocelot/felix.h
drivers/net/dsa/ocelot/felix_vsc9959.c