Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eth: mcux: Do not set carrier ON if interface is not known #21294

Merged

Conversation

jukkar
Copy link
Member

@jukkar jukkar commented Dec 11, 2019

It is possible that the network interface is not yet resolved
when status of the PHY changes. In this case we must not call
net_eth_carrier_on() as that will cause a crash.
This was noticed with mimxrt1050_evk board.

Fixes: #21257

Signed-off-by: Jukka Rissanen jukka.rissanen@linux.intel.com

@pfalcon
Copy link
Contributor

pfalcon commented Dec 11, 2019

Can you please clarify what "network interface is not yet resolved" means?

@jukkar
Copy link
Member Author

jukkar commented Dec 11, 2019

Can you please clarify what "network interface is not yet resolved" means?

Basically it means that eth_iface_init() has not been called yet, as that will set/resolve the context->iface = iface; which is used by eth_mcux_phy_event(). So basically we get a PHY event while the driver is being setup and interface is still NULL. This is probably something to do with timing of the system. Also indicated in other PRs, the mimxrt1050_evk is faster than k64f and I have not seen this error when using k64f.

@pfalcon
Copy link
Contributor

pfalcon commented Dec 11, 2019

@jukkar: Thanks for explanation. My question was mostly a "first reading question", where a stumbled upon "network interface is not yet resolved" as unfamiliar wording which got me confusing. E.g. I've heard about "address not yet resolved", but don't remember hearing it in regard to interface. Your comment explains it, but I wonder if it would make sense to say "network interface is not yet initialized" or "network interface pointer [in context?] is not yet initialize". Or if you think that description captures the situation well, I'll just note it for the future.

@jukkar
Copy link
Member Author

jukkar commented Dec 11, 2019

if it would make sense to say "network interface is not yet initialized" or "network interface pointer [in context?] is not yet initialize". Or if you think that description captures the situation well, I'll just note it for the future.

Sure, you suggestion makes sense. I will rephrase the sentence.

It is possible that the network interface is not yet initialized
when status of the PHY changes. In this case we must not call
net_eth_carrier_on() as that will cause a crash.
This was noticed with mimxrt1050_evk board.

Fixes: zephyrproject-rtos#21257

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
@jukkar jukkar force-pushed the issue-21257-tests-net-pkt-fail branch from 6d8a09f to a4b4711 Compare December 11, 2019 11:53
@agansari
Copy link
Collaborator

@jukkar i'm not sure about the 1ms sleep, i added that as a delay between mii commands, i need to check what it's for

@jukkar
Copy link
Member Author

jukkar commented Dec 12, 2019

i'm not sure about the 1ms sleep, i added that as a delay between mii commands, i need to check what it's for

Please submit another PR if you find the sleep unnecessary.

@jukkar jukkar merged commit e124c1c into zephyrproject-rtos:master Dec 12, 2019
@jukkar jukkar deleted the issue-21257-tests-net-pkt-fail branch December 12, 2019 07:50
@MaureenHelm MaureenHelm added the Backport Backport PR and backport failure issues label Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Ethernet area: Networking Backport Backport PR and backport failure issues platform: NXP NXP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests/net/net_pkt failed on mimxrt1050_evk board.
6 participants