-
Notifications
You must be signed in to change notification settings - Fork 7.4k
drivers: eth: phy_mii: Don't block system workqueue #87114
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
drivers: eth: phy_mii: Don't block system workqueue #87114
Conversation
Discussion of the problem in Discord: https://discord.com/channels/720317445772017664/733037635194585148/1350033656923689060 |
5649be2
to
209a063
Compare
drivers/ethernet/phy/phy_mii.c
Outdated
if (rc == -EINPROGRESS) { | ||
/* Check for autonegotiation completion */ | ||
k_work_reschedule(&data->autoneg_work, | ||
K_MSEC(100)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make the 100
here and in line 191 and 341 a define, so we know they belong together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added MII_AUTONEG_POLL_INTERVAL_MS
to make it clearer what the 100's are for.
209a063
to
6df23de
Compare
}; | ||
|
||
/* Offset to align capabilities bits of 1000BASE-T Control and Status regs */ | ||
#define MII_1KSTSR_OFFSET 2 | ||
|
||
#define MII_INVALID_PHY_ID UINT32_MAX | ||
|
||
/* How often to poll auto-negotiation status while waiting for it to complete */ | ||
#define MII_AUTONEG_POLL_INTERVAL_MS 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kconfig?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't configurable before, so making it configurable now seems like a separate issue from the one I'm trying to fix here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this file is refactored later, I would like to add, that the timeout could now be implemented using the timepoint_expired
-function.
Not needed for this PR though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't configurable before, so making it configurable now seems like a separate issue from the one I'm trying to fix here.
I thought you are adding this in this PR, I am suggesting it be added in a configurable way rather than hardcoded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't configurable before, so making it configurable now seems like a separate issue from the one I'm trying to fix here.
I thought you are adding this in this PR, I am suggesting it be added in a configurable way rather than hardcoded
No, the polling interval existed before and was not configurable.
@pdgendt @lmajewski This PR is waiting on a review from one of you. |
a5c893e
to
fd3af65
Compare
Please do not combine formatting with functional changes in a single commit. |
@pdgendt Sorry, I was doing too many things at once and trying to make the CI check complaints go away. I'll have to find the original commits... |
0fb74a1
to
7f27099
Compare
FYI formatting is not enforced in CI |
Looping while waiting for auto-negotiation to complete can block the system workqueue for several seconds. Signed-off-by: Kevin ORourke <[email protected]>
CI compliance checks demanded reformatting. Signed-off-by: Kevin ORourke <[email protected]>
7f27099
to
24c60b1
Compare
Looping while waiting for auto-negotiation to complete can block the system workqueue for several seconds.