From 3b2b64fd311c92f2137eb7cee7025794cd854057 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 31 Aug 2007 20:13:57 -0700 Subject: Do not use the ia64 clocksource on non-ia64 architectures The HPET clocksource in drivers/char/hpet.c was written as generic code for ia64, but it is not yet ready to replace the native HPET clocksource implementations that the i386/x86-64 architectures use. On x86[-64], trying to register this clocksource results in potentially multiple hpet-based clocksources being registered, and if the ia64 one is chosen on x86_64 some users have experienced hangs. Eventually all three architectures may end up using the same code, but that is not the case right now. Cc: John Stultz Cc: Tony Luck Cc: Paolo Ornati Cc: Bob Picco Cc: Thomas Gleixner Cc: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/hpet.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/char') diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 77bf4aa..7ecffc9 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c @@ -909,6 +909,8 @@ int hpet_alloc(struct hpet_data *hdp) hpetp->hp_delta = hpet_calibrate(hpetp); +/* This clocksource driver currently only works on ia64 */ +#ifdef CONFIG_IA64 if (!hpet_clocksource) { hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc; CLKSRC_FSYS_MMIO_SET(clocksource_hpet.fsys_mmio, hpet_mctr); @@ -918,6 +920,7 @@ int hpet_alloc(struct hpet_data *hdp) hpetp->hp_clocksource = &clocksource_hpet; hpet_clocksource = &clocksource_hpet; } +#endif return 0; } -- cgit v1.1 From f629307c857c030d5a3dd777fee37c8bb395e171 Mon Sep 17 00:00:00 2001 From: David Miller Date: Tue, 11 Sep 2007 15:23:50 -0700 Subject: tty: termios locking functions break with new termios type I ran into a few problems. n_tty_ioctl() for instance: drivers/char/tty_ioctl.c:799: error: $,1rxstruct termios$,1ry has no member named $,1rxc_ispeed$,1ry This is calling the copy interface that is supposed to be using a termios2 when the new interfaces are defined, however: case TIOCGLCKTRMIOS: if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked)) return -EFAULT; return 0; This is going to write over the end of the userspace structure by a few bytes, and wasn't caught by you yet because the i386 implementation is simply copy_to_user() which does zero type checking. Signed-off-by: Alan Cox Cc: "David S. Miller" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/tty_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/char') diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c index 3423e9ee..4a8969c 100644 --- a/drivers/char/tty_ioctl.c +++ b/drivers/char/tty_ioctl.c @@ -796,14 +796,14 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file, retval = inq_canon(tty); return put_user(retval, (unsigned int __user *) arg); case TIOCGLCKTRMIOS: - if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked)) + if (kernel_termios_to_user_termios_1((struct termios __user *)arg, real_tty->termios_locked)) return -EFAULT; return 0; case TIOCSLCKTRMIOS: if (!capable(CAP_SYS_ADMIN)) return -EPERM; - if (user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios __user *) arg)) + if (user_termios_to_kernel_termios_1(real_tty->termios_locked, (struct termios __user *) arg)) return -EFAULT; return 0; -- cgit v1.1 From f443675affe3f16dd428e46f0f7fd3f4d703eeab Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Tue, 11 Sep 2007 15:23:57 -0700 Subject: intel_agp: fix stolen mem range on G33 G33 GTT stolen memory is below graphics data stolen memory and be seperate, so don't subtract it in stolen mem counting. Signed-off-by: Zhenyu Wang Acked-by: Dave Airlie Cc: Dave Jones Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/agp/intel-agp.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/char') diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index 2c9ca2c..581f922 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c @@ -506,6 +506,11 @@ static void intel_i830_init_gtt_entries(void) break; } } else { + /* G33's GTT stolen memory is separate from gfx data + * stolen memory. + */ + if (IS_G33) + size = 0; switch (gmch_ctrl & I830_GMCH_GMS_MASK) { case I855_GMCH_GMS_STOLEN_1M: gtt_entries = MB(1) - KB(size); -- cgit v1.1 From 4740622c5c805d88c63a50747a2d05537dd233cf Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Tue, 11 Sep 2007 15:23:58 -0700 Subject: intel_agp: fix GTT map size on G33 G33 has 1MB GTT table range. Fix GTT mapping in case like 512MB aperture size. Signed-off-by: Zhenyu Wang Acked-by: Dave Airlie Cc: Dave Jones Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/agp/intel-agp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/char') diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index 581f922..7c69bf2 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c @@ -919,6 +919,7 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge) struct aper_size_info_fixed *size; int num_entries; u32 temp, temp2; + int gtt_map_size = 256 * 1024; size = agp_bridge->current_size; page_order = size->page_order; @@ -928,7 +929,9 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge) pci_read_config_dword(intel_private.pcidev, I915_MMADDR, &temp); pci_read_config_dword(intel_private.pcidev, I915_PTEADDR,&temp2); - intel_private.gtt = ioremap(temp2, 256 * 1024); + if (IS_G33) + gtt_map_size = 1024 * 1024; /* 1M on G33 */ + intel_private.gtt = ioremap(temp2, gtt_map_size); if (!intel_private.gtt) return -ENOMEM; -- cgit v1.1