-
Notifications
You must be signed in to change notification settings - Fork 7.4k
drivers: rtc: mc146818: driver fails multiple tests from rtc_api testsuite #59448
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
Comments
Given that the mc146818 is an actual hardware device, I am uncertain how it would be possible to run the qemu_x86 emulator and get the driver to actually do anything. Is the qemu_x86 emulator emulating the hardware somehow? or am I completely lost here :) The author who introduced the driver was working with the x86/rpl_crb board, which are real hardware AFAIK, I would expect the driver works when run on those boards |
I believe the the issue stems from the ia32 board dtsi file having the RTC added to it by mistake, and the qemu board having an alias added for it, again by mistake. The qemu boards should be using the emulated rtc driver, not the mc146818. |
Maybe I am a bit lost, the old COUNTER_CMOS seems to have worked before, so maybe it is being emulated somehow?, gonna have to look a bit closer :) |
Yes, that's what Qemu does.
Copy-paste from the terminal showing the testsuite passing would be a good place to start. |
After spending some time with it, I can see the MC146818 is setting the interrupt flag, but no interrupt is seen, using qemu monitor, there is no interrupt 8 raised (checked using Looking into it gave a wild idea, how about we just use the emulated RTC driver created for Zephyr, instead of using a driver, which is interacting with a quite complex emulated device? Is there a good reason for the additional complexity brought by using the QEMU emulated RTC? |
Here is a PR with an actual fix for the device driver (and small adjustments to QEMU boards) #60321 :) |
Describe the bug
The
rtc_mc146818
driver is broken (and has actually always been broken). It's unclear to me how this driver was even merged (#56334) in the state that it was in (literally failing every test in the testsuite).Some notes:
int tm_year; /**< Year - 1900 */
gmtime_r()
in the testsuite, although that is perhaps accidentalCONFIG_RTC_ALARM=y
CONFIG_RTC_UPDATE=y
CONFIG_RTC_CALIBRATION=y
prj.conf
to reduce CI churntest_alarm
does not worktest_alarm_callback
does not worktest_update_callback
does not workif (IS_ENABLED(..)) { ... }
in several places instead of#ifdef
sPlease also mention any information which could help others to understand
the problem you're facing:
qemu_x86
,qemu_x86_64
To Reproduce
Steps to reproduce the behavior:
west build -p auto -b qemu_x86 -t run tests/drivers/rtc/rtc_api -- -DCONFIG_RTC_ALARM=y -DCONFIG_RTC_UPDATE=y -DCONFIG_RTC_CALIBRATION=y
Expected behavior
The testsuite should pass for all existing drivers within the tree.
Impact
Showstopper for now, because I would expect this RTC device to work on a tier0 platform. We were hoping to use this for additional POSIX improvements.
Logs and console output
Environment (please complete the following information):
Additional context
Originally discovered while working on #59402 but that PR was merged before additional changes could be made.
The text was updated successfully, but these errors were encountered: