mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sripathi Kodi <sripathik@in.ibm.com>
To: benh@kernel.crashing.org
Cc: linux-kernel@vger.kernel.org
Subject: Problem due to removing ppc64 rtc.c?
Date: Tue, 27 Dec 2005 15:45:22 +0530 (IST)	[thread overview]
Message-ID: <Pine.LNX.4.63.0512271505030.3537@sripathi.in.ibm.com> (raw)

Hi Ben,

I am seeing a problem on a PPC64  machine due to your patch "kill ppc64 rtc.c,
use  genrtc   instead"  (http://patchwork.ozlabs.org/linuxppc64/patch?id=3336)
that went into 2.6.15-rc2.

I see  that RTC_RD_TIME ioctl  returns wrong  values. This is  making commands
like 'hwclock' loop forever.

[root@hv42-lp2 ~]# cat /proc/driver/rtc
rtc_time        : 165:165:165
rtc_date        : 2065-165-165
rtc_epoch       : 1900
alarm           : **:**:**
DST_enable      : yes
BCD             : no
24hr            : yes
square_wave     : yes
alarm_IRQ       : yes
update_IRQ      : yes
periodic_IRQ    : yes
periodic_freq   : 0
batt_status     : okay

Portion of  strace on 'hwclock'  command. The time it  reads does not  seem to
change and so the command does not return even after a number of minutes:

write(1, "/dev/rtc does not have interrupt"..., 93/dev/rtc does not have
interrupt functions. Waiting in loop for time from /dev/rtc to change
) = 93
ioctl(4, RTC_RD_TIME, {tm_sec=165, tm_min=165, tm_hour=165, tm_mday=165,
tm_mon=164, tm_year=165, ...}) = 0
ioctl(4, RTC_RD_TIME, {tm_sec=165, tm_min=165, tm_hour=165, tm_mday=165,
tm_mon=164, tm_year=165, ...}) = 0
ioctl(4, RTC_RD_TIME, {tm_sec=165, tm_min=165, tm_hour=165, tm_mday=165,
tm_mon=164, tm_year=165, ...}) = 0

Before your changes,  rtc_ioctl was implemented in the PPC  specific rtc.c and
it used  to call ppc_md.get_rtc_time  for RTC_RD_TIME,  which I think  used to
end  up  in  rtas_get_rtc_time.  After  your changes,  time  is  now  read  in
rtc_get_rtc_time using CMOS_READ calls, which apparently is resulting in wrong
values being  read. I changed  rtc_do_ioctl to make it  call rtas_get_rtc_time
for RTC_RD_TIME call and the problem went away.

Have I  missed something or  does this  need fixing? Do  we really need  a PPC
specific rtc_ioctl call that calls into rtas_get_rtc_time?

Thanks,
Sripathi.

             reply	other threads:[~2005-12-27 10:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-27 10:15 Sripathi Kodi [this message]
2005-12-27 10:25 ` Benjamin Herrenschmidt
2005-12-27 10:49   ` Sripathi Kodi

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=Pine.LNX.4.63.0512271505030.3537@sripathi.in.ibm.com \
    --to=sripathik@in.ibm.com \
    --cc=benh@kernel.crashing.org \
    --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

all inboxes | Powered by JetHome®