From: <nsl...@li...> - 2005-05-25 21:11:25
|
This BitKeeper patch contains the following changesets: jbowler@marsco.kalmiopsis|ChangeSet|20050525203245|27453 # ID: ke...@ze...|ChangeSet|20030602211901|40961|4f9b117aa66a8ba3 # User: jbowler # Host: marsco.kalmiopsis # Root: /home/nslu2/openembedded # Patch vers: 1.3 # Patch type: REGULAR == ChangeSet == ke...@ze...|ChangeSet|20030602211901|40961|4f9b117aa66a8ba3 jbowler@marsco.kalmiopsis|ChangeSet|20050525202601|27475 D 1.3343 05/05/25 13:32:45-07:00 jbowler@marsco.kalmiopsis +2 -0 B ke...@ze...|ChangeSet|20030602211901|40961|4f9b117aa66a8ba3 C c Complete RTC clock fixes so tha the sync API is fully functional. K 27453 P ChangeSet ------------------------------------------------ 0a0 > g2...@gi...|packages/linux/openslug-kernel-2.6.11.2/x1205-rtc.c|20050311151154|48609|a4994350630a1038 jbowler@marsco.kalmiopsis|packages/linux/openslug-kernel-2.6.11.2/x1205-rtc.c|20050525203244|31835 > g2...@gi...|packages/linux/openslug-kernel_2.6.11.2.bb|20050311151154|57374|11164f593d16f119 jbowler@marsco.kalmiopsis|packages/linux/openslug-kernel_2.6.11.2.bb|20050525203244|51790 == packages/linux/openslug-kernel-2.6.11.2/x1205-rtc.c == g2...@gi...|packages/linux/openslug-kernel-2.6.11.2/x1205-rtc.c|20050311151154|48609|a4994350630a1038 jbowler@marsco.kalmiopsis|packages/linux/openslug-kernel-2.6.11.2/x1205-rtc.c|20050525044814|51736 D 1.4 05/05/25 13:32:44-07:00 jbowler@marsco.kalmiopsis +92 -57 B ke...@ze...|ChangeSet|20030602211901|40961|4f9b117aa66a8ba3 C c Correct fix for the RTC problems. c This ensures that rtc_sync can sync to any change, no matter c how large. Debugging code from previous fixes tidied up. K 31835 O -rw-rw---- P packages/linux/openslug-kernel-2.6.11.2/x1205-rtc.c ------------------------------------------------ D354 31 I384 15 if (datetoo) { /* This used to be 1900, not epoch, but all the read APIs subtract * epoch, not 1900, and the result of these APIs *is* fed back in * to x1205_command (which calls this.) */ tm->tm_year += epoch; \ /* The RTC uses a byte containing a BCD year value, so this is * limited to the range 0..99 from rtc_epoch. */ if ((tm->tm_year < rtc_epoch || tm->tm_year > rtc_epoch + 99) || ((tm->tm_mon > 11) || tm->tm_mon < 0 || (tm->tm_mday <= 0)) || (tm->tm_mday > (days_in_mo[tm->tm_mon] + ( (tm->tm_mon == 1) && ((!(tm->tm_year % 4) && (tm->tm_year % 100) ) || !(tm->tm_year % 400))))) ) { D386 1 I386 1 tm->tm_year, tm->tm_mon, tm->tm_mday); D388 6 D395 3 D399 4 I402 2 tm->tm_year -= epoch; } D404 1 I404 2 if (((tm->tm_hour < 0) || (tm->tm_min < 0) || (tm->tm_sec < 0)) || ((tm->tm_hour >= 24) || (tm->tm_min >= 60) || (tm->tm_sec >= 60))) { I406 1 return -EINVAL; D409 1 I409 1 return NOERR; D489 1 I489 26 rem = new_s - mktime(tm.tm_year+epoch, tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); if (rem != 0) { int dif; \ /* Make an approximation to year/month/day. */ rem = div; div = (2*div)/61; // 30.5 days/month tm.tm_mday = 1 + rem - (div*61)/2; rem = div; div /= 12; rem -= 12*div; while (tm.tm_mday > days_in_mo[rem]) { tm.tm_mday -= days_in_mo[rem]; if (++rem >= 12) { rem -= 12; ++div; } } tm.tm_mon = rem; div += 1970; // base of tv_sec \ /* Calculate the error in the approximation as a signed * int value. */ dif = new_s - mktime(div, tm.tm_mon+1, tm.tm_mday, D491 6 I496 36 while (dif < 0) { --(tm.tm_mday); dif += 86400; } while (dif >= 86400) { ++(tm.tm_mday); dif -= 86400; } if (dif != 0) printk(KERN_ERR "x1205_sync_rtc (error in date %d)\n", dif); \ /* Normalise the result. */ while (tm.tm_mday <= 0) { if (--(tm.tm_mon) < 0) { tm.tm_mon += 12; --div; } tm.tm_mday += days_in_mo[tm.tm_mon] + (tm.tm_mon==1 && ((!(div % 4) && (div % 100) ) || !(div % 400))); } \ do { rem = days_in_mo[tm.tm_mon] + (tm.tm_mon==1 && ((!(div % 4) && (div % 100) ) || !(div % 400))); if (tm.tm_mday > rem) { tm.tm_mday -= rem; if (++(tm.tm_mon) >= 12) { tm.tm_mon -= 12; ++div; } } else { break; } } while (1); \ tm.tm_year = div-epoch; D498 1 I498 8 printk(KERN_DEBUG "x1205_sync_rtc exit (change date %d)\n", new_s-old_s); } else { printk(KERN_DEBUG "x1205_sync_rtc exit (change seconds %d)\n", new_s-old_s); /* But avoid the race condition when the date is about to * change. */ if (tm.tm_min == 59 && tm.tm_hour == 23) cmd = RTC_SETDATETIME; D500 2 == packages/linux/openslug-kernel_2.6.11.2.bb == g2...@gi...|packages/linux/openslug-kernel_2.6.11.2.bb|20050311151154|57374|11164f593d16f119 jbowler@marsco.kalmiopsis|packages/linux/openslug-kernel_2.6.11.2.bb|20050525044814|51789 D 1.11 05/05/25 13:32:44-07:00 jbowler@marsco.kalmiopsis +1 -1 B ke...@ze...|ChangeSet|20030602211901|40961|4f9b117aa66a8ba3 C c Pump kernel version for modified RTC code K 51790 O -rw-rw---- P packages/linux/openslug-kernel_2.6.11.2.bb ------------------------------------------------ D5 1 I5 1 PR = "r9" # Patch checksum=9dac788e |