Skip to content
Commit c657b0b9 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Xiaolei Wang
Browse files

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: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarXiaolei Wang <xiaolei.wang@windriver.com>
parent b34f5340
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment