phy: lynx-10g: stop on lynx_pccr_read() in lynx_10g_backup_pccr_val()
commit f18c15e9a0f195bcebc479c7cee2ecc12745475d from https://github.com/nxp-imx/linux-imx lf-6.1.y lynx_pccr_read() may return -EOPNOTSUPP if the representation of the SoC integration that is hardcoded in the driver - priv->info->get_pccr() - does not expect there to exist a PCCR register for a given lane and SerDes protocol. In lynx_10g_backup_pccr_val(), we are ignoring that negative error code on good faith, which means that the way in which the hardware is configured at probe time will never take us by surprise. Given the fact that we issue no hardware reset to the SerDes on probe, it can happen that someone has messed with the lane configuration in an invalid way during a prior boot stage (e.g. PBL), forcing a protocol selection in LNaPSSR0_TYPE for which we have no actual protocol converter. What would happen in that case is that we would happily ignore the -EOPNOTSUPP from lynx_pccr_read() and proceed to save an uninitialized "u32 val" as lane->default_pccr, and continue on, thinking this lane is OK to be used. What we should probably do instead is to mark the lane as having an unknown protocol, because we don't expect it to be configured that way, and produce a warning. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
parent
b34f5340
Please register or sign in to comment