Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 740299 - [RTC] - The ioctl RTC_IRPQ_READ doesn't return the correct value
[RTC] - The ioctl RTC_IRPQ_READ doesn't return the correct value
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
5.6
Unspecified Linux
unspecified Severity medium
: rc
: ---
Assigned To: Prarit Bhargava
Dong Zhu
:
Depends On:
Blocks: 758797
  Show dependency treegraph
 
Reported: 2011-09-21 11:07 EDT by Olivier BONHOMME
Modified: 2014-03-16 21:47 EDT (History)
4 users (show)

See Also:
Fixed In Version: kernel-2.6.18-300.el5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-02-20 22:56:47 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Fix RTC Freq Read with hpet emulate enabled (481 bytes, patch)
2011-09-21 11:07 EDT, Olivier BONHOMME
no flags Details | Diff
RHEL5 fix for this issue (1.27 KB, patch)
2011-11-30 10:49 EST, Prarit Bhargava
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0150 normal SHIPPED_LIVE Moderate: Red Hat Enterprise Linux 5.8 kernel update 2012-02-21 02:35:24 EST

  None (edit)
Description Olivier BONHOMME 2011-09-21 11:07:50 EDT
Created attachment 524222 [details]
Fix RTC Freq Read with hpet emulate enabled

Description of problem:

After setting the frequency value for the RTC clock using the ioctl RTC_IRQP_SET, the value is correctly applied to the rtc clock but when reading it using the RTC_IRQP_READ ioctl, the returned value is incorrect and stays set to 1024 even with root rights.

This behaviour applies only when the HPET timer is enabled and when the RTC clock is compiled in the kernel and not in module. In that case, the HPET_EMULATE_RTC option is enabled and ONLY in that case, the returned value is incorrect.

This bug is due to the fact, that in the rtc.c file driver, when HPET_EMULATE_RTC is defined the rtc_freq is not set.

This issue has already been corrected in the upstream kernel but not backported in the RHEL kernel as described here : http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=61ca9daa2ca3022dc9cb22bd98e69c1b61e412ad. [^]

As an attachement, I created a patch in order to build the RPM considering the current SPEC file and sources provided by the SRPM.
Version-Release number of selected component (if applicable):
2.6.18-238.19.1.el5

How reproducible:
Try to change the clock frequency using the RTC_IRQP_SET ioctl and try to read it with the RTC_IRQP_READ ioctl.


Steps to Reproduce:
1.Set the clock frequency with RTC_IRQP_SET
2.Check that the clock is correctly set
3.Read the clock frequency with RTC_IRQP_READ
  
Actual results:
The RTC_IRQP_READ returns the default value.


Expected results:
The RTC_IRQP_READ returns the set value.


Additional info: This bug has been open also in CentOS http://bugs.centos.org/view.php?id=5064
Comment 1 Prarit Bhargava 2011-11-30 10:49:00 EST
Created attachment 538614 [details]
RHEL5 fix for this issue
Comment 2 RHEL Product and Program Management 2011-11-30 11:00:34 EST
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 5 Jarod Wilson 2011-12-05 09:48:30 EST
Patch(es) available in kernel-2.6.18-300.el5
You can download this test kernel (or newer) from http://people.redhat.com/jwilson/el5/
Detailed testing feedback is always welcomed.
If you require guidance regarding testing, please ask the bug assignee.
Comment 8 Olivier BONHOMME 2012-02-17 03:25:21 EST
Hello,

Sorry for the delay but I was missing time for testing your kernel. So I just installed it on my system and here are the result of my test program : 

$ sudo ./rtc_test 
RTC Value is 64
SET return code = 0
RTC Value is 64

So the fix is okay for me.
Comment 9 errata-xmlrpc 2012-02-20 22:56:47 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0150.html

Note You need to log in before you can comment on or make changes to this bug.