[LinuxPPS] patch for 2.6.30
Udo van den Heuvel
udovdh at xs4all.nl
Tue May 12 16:21:31 CEST 2009
Hello,
Anticipating `the` patch for 2.6.30 I am trying to make stuff work for
2.6.30-rc5.
Mostly the patch works, with surprisingly large offsets, a few rejects.
Most important are, I think, the arch/x86/kernel/irq_32.c.rej and
arch/x86/kernel/irq_64.c.rej files.
Where do all the rejects go and how do they fit in the changed code for
2.6.30?
This is one reject in irq_64.c:
***************
*** 65,73 ****
#endif
desc = irq_to_desc(irq);
- if (likely(desc))
generic_handle_irq_desc(irq, desc);
- else {
if (!disable_apic)
ack_APIC_irq();
--- 77,90 ----
#endif
desc = irq_to_desc(irq);
+ if (likely(desc)) {
+ #ifdef CONFIG_PPS_IRQ_EVENTS
+ /* Then, after sanity check, store the IRQ timestamp */
+ pps_irq_ts[irq] = ts;
+ #endif
+
generic_handle_irq_desc(irq, desc);
+ } else {
if (!disable_apic)
ack_APIC_irq();
I made this of the pieces:
bool handle_irq(unsigned irq, struct pt_regs *regs)
{
struct irq_desc *desc;
#ifdef CONFIG_PPS_IRQ_EVENTS
struct timespec ts;
/* Get IRQ timestamps as soon as possible for the PPS layer */
getnstimeofday(&ts);
#endif
stack_overflow_check(regs);
desc = irq_to_desc(irq);
if (unlikely(!desc))
return false;
#ifdef CONFIG_PPS_IRQ_EVENTS
/* Then, after sanity check, store the IRQ timestamp */
pps_irq_ts[irq] = ts;
#endif
generic_handle_irq_desc(irq, desc);
} else {
return true;
}
Also irq_32.c:
***************
*** 205,211 ****
unsigned vector = ~regs->orig_ax;
struct irq_desc *desc;
unsigned irq;
old_regs = set_irq_regs(regs);
irq_enter();
--- 211,222 ----
unsigned vector = ~regs->orig_ax;
struct irq_desc *desc;
unsigned irq;
+ #ifdef CONFIG_PPS_IRQ_EVENTS
+ struct timespec ts;
+ /* Get IRQ timestamps as soon as possible for the PPS layer */
+ getnstimeofday(&ts);
+ #endif
old_regs = set_irq_regs(regs);
irq_enter();
I made this of the pieces:
bool handle_irq(unsigned irq, struct pt_regs *regs)
{
struct irq_desc *desc;
int overflow;
#ifdef CONFIG_PPS_IRQ_EVENTS
struct timespec ts;
/* Get IRQ timestamps as soon as possible for the PPS layer */
getnstimeofday(&ts);
#endif
overflow = check_stack_overflow();
desc = irq_to_desc(irq);
if (unlikely(!desc))
return false;
#ifdef CONFIG_PPS_IRQ_EVENTS
/* Then, after sanity check, store the IRQ timestamp */
pps_irq_ts[irq] = ts;
#endif
if (!execute_on_irq_stack(overflow, desc, irq)) {
if (unlikely(overflow))
print_stack_overflow();
desc->handle_irq(irq, desc);
}
return true;
}
Looks good? Comments?
What about the offsets? (see below)
Kind regards,
Udo
# patch -p1 < /home/udo/Download/Linux/ntp-pps-2.6.28-rc6-ter.diff
patching file Documentation/ABI/testing/sysfs-pps
patching file Documentation/ioctl/ioctl-number.txt
Hunk #1 succeeded at 149 (offset 2 lines).
patching file Documentation/pps/Makefile
patching file Documentation/pps/pps.txt
patching file Documentation/pps/ppsfind
patching file Documentation/pps/ppsldisc.c
patching file Documentation/pps/ppstest.c
patching file Documentation/pps/timepps.h
patching file Documentation/serial/tty.txt
patching file MAINTAINERS
Hunk #1 succeeded at 4460 with fuzz 2 (offset 1039 lines).
patching file arch/x86/kernel/irq_32.c
Hunk #1 FAILED at 15.
Hunk #2 succeeded at 27 (offset 1 line).
Hunk #3 FAILED at 211.
Hunk #4 succeeded at 213 with fuzz 2 (offset -17 lines).
2 out of 4 hunks FAILED -- saving rejects to file
arch/x86/kernel/irq_32.c.rej
patching file arch/x86/kernel/irq_64.c
Hunk #1 FAILED at 17.
Hunk #2 succeeded at 57 with fuzz 2.
Hunk #3 FAILED at 77.
?******* 2 out of 3 hunks FAILED -- saving rejects to file
arch/x86/kernel/irq_64.c.rej
patching file drivers/Kconfig
patching file drivers/Makefile
Hunk #1 FAILED at 67.
**** 1 out of 1 hunk FAILED -- saving rejects to file drivers/Makefile.rej
patching file drivers/char/lp.c
patching file drivers/char/n_tty.c
Hunk #1 FAILED at 43.
Hunk #2 succeeded at 211 (offset 17 lines).
Hunk #4 succeeded at 239 (offset 17 lines).
Hunk #6 FAILED at 923.
Hunk #7 succeeded at 1372 (offset 427 lines).
Hunk #9 succeeded at 1468 (offset 427 lines).
Hunk #11 succeeded at 1559 (offset 427 lines).
Hunk #12 succeeded at 1144 with fuzz 1 (offset 4 lines).
Hunk #13 succeeded at 1579 (offset 427 lines).
Hunk #14 succeeded at 1181 (offset 10 lines).
Hunk #15 succeeded at 1713 (offset 427 lines).
Hunk #16 succeeded at 1496 (offset 10 lines).
Hunk #17 FAILED at 1513.
Hunk #18 succeeded at 2014 with fuzz 1 (offset 439 lines).
Hunk #19 succeeded at 1601 (offset 10 lines).
Hunk #20 succeeded at 2057 (offset 439 lines).
**** 3 out of 20 hunks FAILED -- saving rejects to file
drivers/char/n_tty.c.rej
patching file drivers/pps/Kconfig
patching file drivers/pps/Makefile
patching file drivers/pps/clients/Kconfig
patching file drivers/pps/clients/Makefile
patching file drivers/pps/clients/ktimer.c
patching file drivers/pps/clients/pps-ldisc.c
patching file drivers/pps/kapi.c
patching file drivers/pps/pps.c
patching file drivers/pps/sysfs.c
patching file drivers/serial/8250.c
Hunk #1 succeeded at 2397 (offset 84 lines).
patching file include/linux/Kbuild
Hunk #1 succeeded at 306 (offset -3 lines).
patching file include/linux/parport.h
patching file include/linux/pps.h
patching file include/linux/serial_core.h
Hunk #1 succeeded at 177 (offset 9 lines).
Hunk #2 succeeded at 503 (offset 11 lines).
Hunk #3 succeeded at 523 (offset 9 lines).
patching file include/linux/tty.h
Hunk #2 succeeded at 456 (offset 23 lines).
patching file include/linux/tty_ldisc.h
More information about the LinuxPPS
mailing list