# System clock gets delayed when in linux

## Deathwing00

I don't know what happens to my linux on my laptop. Perhaps it's something with the kernel/ACPI. It seems to lose minutes and get the system's clock delayed. This happens almost always and I need it repaired. What do I have to change?

----------

## green sun

I have the same problem with a Dell Inspiron. I haven't bothered to track it down because I just loaded ntp & have it run on boot. If you connect to the Internet, this will automatically set your time. You have to configure /etc/ntp.conf to point to a ntp server on the internet, but the file has clear instructions. It can be added to start on boot with:

```
rc-update add ntpd default
```

----------

## Deathwing00

Well... this is like a work-around to solve the problem... but it just does the trick for what I want so... thanks mate!

----------

## kniteshade

i have the same problem with a dell inspiron too - its a known problem

basically whenever linux probes the acpi for the battery levels, the few milliseconds it takes it just 'forgets' the 'tics' that get sent while its probing the bios. The tics are sent from the bios to keep the software clock knowing what time is is - so if it doens't get them then the clock 'loses time'

If ya look for the dell-linux group on yahoo they have lots more information about it - but as of a few months ago it was an un-fixable problem.

The way i got around it is to hack up the script that synchs the hardware clock from the software one on shutdown so i lose time over the day but next day (i shut down each night) its refreshed from the hardware one

The other way is to just not run any acpi apps (battery levels etc) but thats annoying cos then ya never know when ya battery is getting low!

There might be some fixes coming soon but i think its just the whole way acpi is implemented in the kernel (cos windows doens't have the problem so it MUST be possible to fix0r)

If anyone finds anything out then post it cos i cbf looking now but would be interested is perhaps 2.4.21 or 2.5.x has it fixed

Ben

----------

## green sun

 *kniteshade wrote:*   

> i have the same problem with a dell inspiron too - its a known problem
> 
> basically whenever linux probes the acpi for the battery levels, the few milliseconds it takes it just 'forgets' the 'tics' that get sent while its probing the bios. The tics are sent from the bios to keep the software clock knowing what time is is - so if it doens't get them then the clock 'loses time'
> 
> If ya look for the dell-linux group on yahoo they have lots more information about it - but as of a few months ago it was an un-fixable problem.
> ...

 

knightshade

thanks for the info... like I said, I never looked into it too deeply. I use ntp to fix the clock (except on my home PC, which because my ISP blocks the ntp port?!?) But its not too annoying anyways... besides, I could probably run an ntp server at work & connect over a different port should I *really* need to do so at home...

----------

## lannie

Hi !

I have one of those troubled Dell Inspirons (Inspiron 4000). From my past experiences the gentoo-sources give the most time lag

I use the vanilla-sources and that fixes the time lag. However I don't use ACPI in the kernel... i use APM  :Very Happy: 

Other from that, I don't know why there is the time lag... I remembered that when i used the pre-empt patches for the kernels... it always stuffed up the time on the machine.

well hope this helps

-Lan

----------

## Deathwing00

After all this, what I say is we have to wait for a kernel with a completely working ACPI and, meanwhile, have a work-around on the problem. Thanks to all for your answers.

----------

## Deathwing00

 *lannie wrote:*   

> Hi !
> 
> I have one of those troubled Dell Inspirons (Inspiron 4000). From my past experiences the gentoo-sources give the most time lag
> 
> I use the vanilla-sources and that fixes the time lag. However I don't use ACPI in the kernel... i use APM 
> ...

 

What happens in my laptop it's that it's completely new and has no APM, only ACPI... APM is considered obsolete by manufacturers right now.

----------

## lannie

 *Quote:*   

> APM is considered obsolete by manufacturers right now.

 

after all dude, my laptop is old after all  :Very Happy: 

...well you could try ACPI without the pre-empt patches... see how that goes...

reason being.. when i tried the pre-empt patches on the laptop... it will screw up the time no matter what... this was true on the redhat 9 and mandrake 9.1 kernels... (when i put the computer into suspend mode)

well .. good luck  :Smile: 

-Lan

B.T.W - Does anyone know if the development kernels will fix these problems?

----------

## Deathwing00

 *lannie wrote:*   

>  *Quote:*   APM is considered obsolete by manufacturers right now. 
> 
> after all dude, my laptop is old after all 
> 
> ...well you could try ACPI without the pre-empt patches... see how that goes...
> ...

 

I have ACPI enabled and everything works... I don't mind having to sync clock, even manually, I just wanted to know why and how... I can wait for a new kernel  :Razz: 

----------

## snowpatch

This may not help with an ACPI only laptop, but my Inspiron 4150 (which can use either) is using APM, and I came across a post in the linux-dell-laptops yahoo forum:

http://groups.yahoo.com/group/linux-dell-laptops/message/19594

Apparently upgrading to BIOS A06 has helped a few people with clock-drift  and suspend/resume problems.

----------

## BitJam

My clock is fixed on a Dell Inspiron 8200

I installed the lastest BIOS, and use the 2.4.22_pre2-gss kernel with APM enabled.

I stopped running ntpd weeks ago.   I just checked and I'm within 4 seconds of nist time.

----------

## swimgeek

Hi,

I have an inspiron 4150 and I upgraded to A06 today. After synching the BIOS clock I rebooted, and checked the BIOS clock and the time seemed to be fine. However as soon as I booted into Linux (without network, so that ntpd didn't startup) the time was offset by about 30 minutes. I'm going to try with the vanilla 2.4.21 and see if it makes difference, but my past experience has showed it doesn't. Should I try a premptible kernel? Will that affect anything else?

thanks!

----------

## BitJam

I've wondered about that.   You could always give it a try.   I've got my clocking working just fine now on an 8200 and my kernel is configured with preemptible on.

----------

## kronon

since some time my laptop has the same problem but probably wors. I don't lose milisecond I lose minutes. Today my clock is 5 minutes behind. I don't know how this can be but I hope it get's solved soon.

----------

## swimgeek

I removed /etc/adjtime and rebooted (the system time from ntpd was written to hwclock during shutdown) without network (so that ntpd wouldn't start) and time seemed to be fine!! I will follow up on this approach in the days to come and see if it continues to work  :Smile: 

----------

## Yukimura

Hello everyone!  :Smile: 

I'm having problems with time on my gentoo desktop machine. I don't know what the cause might be but for some strange reason when I boot my system I see my clock at least 20min behind the real clock, but it usually happens that my clock on pc is late for 7 hours. 

Any idea what can I do?

Kind regards.  :Wink: 

----------

## nixnut

merged above post here.

You should find some ideas here.

----------

## Yukimura

Hello!

I found the "solution" for this one. I edited /etc/conf.d/clock and changed the next line:

 *Quote:*   

> # If you want to set the Hardware Clock to the current System Time
> 
> # during shutdown, then say "yes" here.
> 
> CLOCK_SYSTOHC="yes"

 

It works for me! There are some minimal delays but that's like a minute or so. 

Kind regards! :Smile: 

----------

