From: "dev@savarinetworks.com" <dev@savarinetworks.com>
To: linux-kernel@vger.kernel.org
Subject: rtc: restoring of periodic irq freqeuncy to original state
Date: Wed, 02 May 2012 14:10:16 +0600 [thread overview]
Message-ID: <4FA0EBE8.5030805@savarinetworks.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 545 bytes --]
Hi Kernel Folks,
Dont' know whether this is a bug or feature. sorry :(.
when the periodic irq's are enabled from the application through the
ioctl, and when the application suddenly stops, the irq frequency was
not reverted back to the original one.
say for ex..
if my original freq was 1024, and i set it using IRQP_SET
with 512.
so when i stop my program the original freq was not set back
and the program set frequency is appearing in the /proc/driver/rtc.
Attached is the test program.
Thanks,
Devendra C.
[-- Attachment #2: hwclock_freq_timer.c --]
[-- Type: text/x-csrc, Size: 865 bytes --]
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/rtc.h>
main()
{
struct rtc_time rtc_time;
int fd;
char data[BUFSIZ];
int irqfre;
int ret;
fd = open("/dev/rtc", O_RDWR);
if (fd < 0) {
printf("can't open /dev/rtc\n");
return;
}
ret = ioctl(fd, RTC_IRQP_READ, &irqfre);
if (ret == 0) {
/*
printf("Rate: %d\n", irqfre);
*/
irqfre = 1024;
ret = ioctl(fd, RTC_IRQP_SET, irqfre);
}
if (ret < 0) {
printf("Can't read periodic IRQ's\n");
}
ret = ioctl(fd, RTC_PIE_ON, NULL);
if (ret < 0) {
printf("can't set the periodic irq\n");
close(fd);
return;
}
while(read(fd, &data, sizeof(data)) > 0) {
printf("Intr\n");
}
}
reply other threads:[~2012-05-02 8:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FA0EBE8.5030805@savarinetworks.com \
--to=dev@savarinetworks.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome