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
RFC - [intel] Wait until reset is completed #504
base: master
Are you sure you want to change the base?
Conversation
Refactor intel_reset function and make it wait until reset is completed by checking STATUS.PF_RST_DONE and EEC.Auto_RD bits are set to 1b. Signed-off-by: Daniel Gomez <[email protected]>
@@ -70,8 +70,9 @@ struct intel_descriptor { | |||
#define INTEL_RESET_DELAY_MS 20 | |||
|
|||
/** Device Status Register */ | |||
#define INTEL_STATUS 0x00008UL | |||
#define INTEL_STATUS_LU 0x00000002UL /**< Link up */ | |||
#define INTEL_STATUS 0x00008UL |
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.
Are these not lining up intentional?
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.
Sorry, I'll update the patch. I wanted to lining them up and then I did the opposite.
Hi ipxe team, We had problems with the ipxe on an i210 network card because of the reset mechanism being used. We've noticed there was some workaround in the code that didn't match with the datasheet, so we have replaced it based on the intel reference driver and manual. According to the reference driver, the reset mechanism should wait at least 3 ms (code waits 20 ms but we've kept that) and do a busy wait on CTRL.RST and EEC.Auto_RD bits. After that, the Software Reset is done and the link is up. If you think we should keep the 'original' code path and only do this for the i210 (or specific families) it's okay, we can revert/add that in the patch. But we haven't been able to see the current reset mechanism in the intel reference driver or linux kernel. Any feedback is very much appreciated. Thanks |
This patch appears to destroy the generic reset mechanism that works on a variety of Intel NICs (including workarounds for specific models), and replaces it with a mechanism that works only on the single piece of hardware that you are using. This is obviously not something that could be merged. Please submit a new PR that does not deliberately break support for existing hardware. |
@dagmcr I took a quick look around this issue. The Linux driver seems to ignore The The problem is that the One possible approach would be to add a per-PCI device ID flag (similar to A cleaner approach would be to find something else that could be done with the |
@mcb30, thanks for your comments. I'm sorry for the initial confusion here, as what I wanted was to open a discussion about the intel reset mechanism so, I should have renamed the patch as RFC. Apologies for that. We have an I210 network card that has some issues when booting from (uefi) ipxe. The reset appears to be broken and seems to be related to the comment/workaround in the code. The card is not able to link up at the speed of 1000 Mbps and when the dhcp client starts, it does not send any package out. So, what we tried to do was to 'restore' the mechanism we saw in the intel reference driver which btw you had it at some point the ipxe sources: 945e428. I know it's already +10y but I'm curious, why did you move to a unified driver? I guess it was to clean it up and to ease maintenance. According to the intel manual for the I210, 'Software Reset should wait at least 3ms before accessing any register and then verify Following intel's reference driver code, this busy-wait (at least for the The ipxe intel reset code seems to perform a Software Reset twice (except when skipping) and then, after the first one, it individually handles some bits ( We have 'simplified' this (wrongly perhaps) and perform only one Software Reset and wait for the After all this, I managed to test vanilla ipxe and vanilla ipxe + our patch in several boards:
When I did the tests, the
That might explained why I couldn't make it work (read properly) on the other NICs and the Software Reset was timeout.
That's okay, I guess we can make the busy wait only on the boards that apply.
Thanks for the tip here. I'll take a look.
I agree. If we can verify that dynamically we can make the code a bit cleaner. Thanks a lot for your feedback! |
The primary motivation was to reduce the number of lines of code for the Intel driver by 97%, both to reduce the maintenance burden and to shrink the binary size.
Thanks for taking a look, and good luck! |
Refactor intel_reset function and make it wait until reset is completed
by checking STATUS.PF_RST_DONE and EEC.Auto_RD bits are set to 1b.
Signed-off-by: Daniel Gomez [email protected]