Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 301757 Details for
Bug 434947
adjtime() doesn't work correctly on ppc
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Fix detection of need for time adjustment.
bugzilla-43828.patch (text/plain), 3.68 KB, created by
IBM Bug Proxy
on 2008-04-09 07:32:39 UTC
(
hide
)
Description:
Fix detection of need for time adjustment.
Filename:
MIME Type:
Creator:
IBM Bug Proxy
Created:
2008-04-09 07:32:39 UTC
Size:
3.68 KB
patch
obsolete
>commit 56431d908e578512221974045542998f1c1bf5cf >Author: Tony Breeds <tony@bakeyournoodle.com> >Date: Wed Apr 9 17:17:49 2008 +1000 > > [POWERPC] Call ppc_adjtimex() when asked to adjust the time in ADJ_OFFSET_SINGLESHOT mode. > > When making the adjtimex() system call in ADJ_OFFSET_SINGLESHOT, we fail to correctly detect that time needs to be adjusted. This patch checks the current time step at the begining of a decrementer tick and adjusts the varisou timeing paramenters to cope with the requested change in ttime. When we have successfully adjusted time as requested revert to the "stable" values. > > Fixes both the 32-bit (compat) and 64-bit cases. > > Signed-off-by: Tony Breeds <tony@bakeyournoodle.com> > >diff --git a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c >index ed58c85..cbc2eaa 100644 >--- a/arch/ppc64/kernel/sys_ppc32.c >+++ b/arch/ppc64/kernel/sys_ppc32.c >@@ -291,7 +291,6 @@ struct timex32 { > }; > > extern int do_adjtimex(struct timex *); >-extern void ppc_adjtimex(void); > > asmlinkage long sys32_adjtimex(struct timex32 __user *utp) > { >@@ -324,9 +323,6 @@ asmlinkage long sys32_adjtimex(struct timex32 __user *utp) > > ret = do_adjtimex(&txc); > >- /* adjust the conversion of TB to time of day to track adjtimex */ >- ppc_adjtimex(); >- > if(put_user(txc.modes, &utp->modes) || > __put_user(txc.offset, &utp->offset) || > __put_user(txc.freq, &utp->freq) || >diff --git a/arch/ppc64/kernel/time.c b/arch/ppc64/kernel/time.c >index 3c51a36..420b17f 100644 >--- a/arch/ppc64/kernel/time.c >+++ b/arch/ppc64/kernel/time.c >@@ -107,6 +107,7 @@ extern struct timezone sys_tz; > void ppc_adjtimex(void); > > static unsigned adjusting_time = 0; >+static long time_adjust_step = 0; > > static __inline__ void timer_check_rtc(void) > { >@@ -237,6 +238,26 @@ static void iSeries_tb_recal(void) > > unsigned long tb_last_stamp __cacheline_aligned_in_smp; > >+int get_time_step(void) >+{ >+ int tmp_step; >+ >+ tmp_step = time_adjust; >+ if (tmp_step) { >+ /* We are doing an adjtime thing. >+ * >+ * Limit the amount of the step to be in the range >+ * -tickadj .. +tickadj >+ */ >+ if (time_adjust > tickadj) >+ tmp_step = tickadj; >+ else if (time_adjust < -tickadj) >+ tmp_step = -tickadj; >+ } >+ >+ return tmp_step; >+} >+ > /* > * timer_interrupt - gets called when the decrementer overflows, > * with interrupts disabled. >@@ -244,6 +265,7 @@ unsigned long tb_last_stamp __cacheline_aligned_in_smp; > int timer_interrupt(struct pt_regs * regs) > { > int next_dec; >+ int current_step; > unsigned long cur_tb; > struct paca_struct *lpaca = get_paca(); > unsigned long cpu = smp_processor_id(); >@@ -280,8 +302,11 @@ int timer_interrupt(struct pt_regs * regs) > timer_sync_xtime( cur_tb ); > timer_check_rtc(); > write_sequnlock(&xtime_lock); >- if ( adjusting_time && (time_adjust == 0) ) >+ current_step = get_time_step(); >+ if ( current_step != time_adjust_step ) { >+ time_adjust_step = current_step; > ppc_adjtimex(); >+ } > } > lpaca->next_jiffy_update_tb += tb_ticks_per_jiffy; > } >@@ -505,6 +530,7 @@ void __init time_init(void) > */ > > /* #define DEBUG_PPC_ADJTIMEX 1 */ >+#define DEBUG_PPC_ADJTIMEX 1 > > void ppc_adjtimex(void) > { >diff --git a/include/linux/timex.h b/include/linux/timex.h >index ee8cafa..9b57ac3 100644 >--- a/include/linux/timex.h >+++ b/include/linux/timex.h >@@ -301,6 +301,7 @@ extern long time_esterror; /* estimated error */ > extern long time_phase; /* phase offset (scaled us) */ > extern long time_freq; /* frequency offset (scaled ppm) */ > extern long time_adj; /* tick adjust (scaled 1 / HZ) */ >+extern int tickadj; /* maximal value (in usec) adjustable / tick */ > extern long time_reftime; /* time at last adjustment (s) */ > > extern long time_adjust; /* The amount of adjtime left */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 434947
: 301757 |
301758