From 1bd4b280394cdd14f82efc00808c6d77b097285a Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Fri, 24 Aug 2007 22:05:44 -0700 Subject: [PATCH 1/6] [SUNVDC]: Use slice 0xff on VD_DISK_TYPE_DISK. While debugging issues with the VDS server I made the driver use partition 2 to get at the whole disk since this is the "whole disk" partition in the Sun disk label. We really should use slice 0xff which really means the whole physical disk in the VIO disk protocol. Otherwise things won't work well on a disk image that doesn't have a proper disk label on it. Signed-off-by: David S. Miller --- drivers/block/sunvdc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c index 4dff49256ac2..317a790c153b 100644 --- a/drivers/block/sunvdc.c +++ b/drivers/block/sunvdc.c @@ -417,7 +417,7 @@ static int __send_request(struct request *req) desc->req_id = port->req_id; desc->operation = op; if (port->vdisk_type == VD_DISK_TYPE_DISK) { - desc->slice = 2; + desc->slice = 0xff; } else { desc->slice = 0; } From 6c8f5b90bfbe69a27763fb0e181bd2465181446d Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Fri, 24 Aug 2007 22:33:15 -0700 Subject: [PATCH 2/6] [VIDEO]: Do not prom_halt() in cg3 and bw2 device probe. Just give a normal kernel log message of the problem and return failure. Based upon a patch from Mark Fortescue. Signed-off-by: David S. Miller --- drivers/video/bw2.c | 22 +++++++++++++--------- drivers/video/cg3.c | 17 ++++++++++------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c index 718b9f83736e..833b10c84064 100644 --- a/drivers/video/bw2.c +++ b/drivers/video/bw2.c @@ -233,9 +233,9 @@ static u8 bw2regs_66hz[] __devinitdata = { 0x10, 0x20, 0 }; -static void __devinit bw2_do_default_mode(struct bw2_par *par, - struct fb_info *info, - int *linebytes) +static int __devinit bw2_do_default_mode(struct bw2_par *par, + struct fb_info *info, + int *linebytes) { u8 status, mon; u8 *p; @@ -266,17 +266,18 @@ static void __devinit bw2_do_default_mode(struct bw2_par *par, break; case BWTWO_SR_ID_NOCONN: - return; + return 0; default: - prom_printf("bw2: can't handle SR %02x\n", - status); - prom_halt(); + printk(KERN_ERR "bw2: can't handle SR %02x\n", + status); + return -EINVAL; } for ( ; *p; p += 2) { u8 __iomem *regp = &((u8 __iomem *)par->regs)[p[0]]; sbus_writeb(p[1], regp); } + return 0; } static int __devinit bw2_probe(struct of_device *op, const struct of_device_id *match) @@ -312,8 +313,11 @@ static int __devinit bw2_probe(struct of_device *op, const struct of_device_id * if (!par->regs) goto out_release_fb; - if (!of_find_property(dp, "width", NULL)) - bw2_do_default_mode(par, info, &linebytes); + if (!of_find_property(dp, "width", NULL)) { + err = bw2_do_default_mode(par, info, &linebytes); + if (err) + goto out_unmap_regs; + } par->fbsize = PAGE_ALIGN(linebytes * info->var.yres); diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c index 5741b46ade1b..a5c7fb331527 100644 --- a/drivers/video/cg3.c +++ b/drivers/video/cg3.c @@ -315,7 +315,7 @@ static u_char cg3_dacvals[] __devinitdata = { 4, 0xff, 5, 0x00, 6, 0x70, 7, 0x00, 0 }; -static void __devinit cg3_do_default_mode(struct cg3_par *par) +static int __devinit cg3_do_default_mode(struct cg3_par *par) { enum cg3_type type; u8 *p; @@ -332,10 +332,9 @@ static void __devinit cg3_do_default_mode(struct cg3_par *par) else type = CG3_AT_66HZ; } else { - prom_printf("cgthree: can't handle SR %02x\n", - status); - prom_halt(); - return; + printk(KERN_ERR "cgthree: can't handle SR %02x\n", + status); + return -EINVAL; } } @@ -351,6 +350,7 @@ static void __devinit cg3_do_default_mode(struct cg3_par *par) regp = (u8 __iomem *)&par->regs->cmap.control; sbus_writeb(p[1], regp); } + return 0; } static int __devinit cg3_probe(struct of_device *op, @@ -400,8 +400,11 @@ static int __devinit cg3_probe(struct of_device *op, cg3_blank(0, info); - if (!of_find_property(dp, "width", NULL)) - cg3_do_default_mode(par); + if (!of_find_property(dp, "width", NULL)) { + err = cg3_do_default_mode(par); + if (err) + goto out_unmap_screen; + } if (fb_alloc_cmap(&info->cmap, 256, 0)) goto out_unmap_screen; From 6cc0735d0dbf6a0e5f802f47d51e1e463466955c Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sat, 25 Aug 2007 15:10:44 -0700 Subject: [PATCH 3/6] [SPARC32]: Add __cmpdi2() libcall implementation ala. MIPS. Device mapper generates calls to this with recent versions of gcc. Signed-off-by: David S. Miller --- arch/sparc/lib/Makefile | 3 ++- arch/sparc/lib/cmpdi2.c | 27 +++++++++++++++++++++++++++ arch/sparc/lib/libgcc.h | 18 ++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 arch/sparc/lib/cmpdi2.c create mode 100644 arch/sparc/lib/libgcc.h diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile index 9ddc5b9ce3bd..76effdbea075 100644 --- a/arch/sparc/lib/Makefile +++ b/arch/sparc/lib/Makefile @@ -8,6 +8,7 @@ lib-y := mul.o rem.o sdiv.o udiv.o umul.o urem.o ashrdi3.o memcpy.o memset.o \ strlen.o checksum.o blockops.o memscan.o memcmp.o strncmp.o \ strncpy_from_user.o divdi3.o udivdi3.o strlen_user.o \ copy_user.o locks.o atomic.o \ - lshrdi3.o ashldi3.o rwsem.o muldi3.o bitext.o + lshrdi3.o ashldi3.o rwsem.o muldi3.o bitext.o \ + cmpdi2.o obj-y += iomap.o atomic32.o diff --git a/arch/sparc/lib/cmpdi2.c b/arch/sparc/lib/cmpdi2.c new file mode 100644 index 000000000000..8c1306437ed1 --- /dev/null +++ b/arch/sparc/lib/cmpdi2.c @@ -0,0 +1,27 @@ +#include + +#include "libgcc.h" + +word_type __cmpdi2(long long a, long long b) +{ + const DWunion au = { + .ll = a + }; + const DWunion bu = { + .ll = b + }; + + if (au.s.high < bu.s.high) + return 0; + else if (au.s.high > bu.s.high) + return 2; + + if ((unsigned int) au.s.low < (unsigned int) bu.s.low) + return 0; + else if ((unsigned int) au.s.low > (unsigned int) bu.s.low) + return 2; + + return 1; +} + +EXPORT_SYMBOL(__cmpdi2); diff --git a/arch/sparc/lib/libgcc.h b/arch/sparc/lib/libgcc.h new file mode 100644 index 000000000000..b84fd797f3ea --- /dev/null +++ b/arch/sparc/lib/libgcc.h @@ -0,0 +1,18 @@ +#ifndef __ASM_LIBGCC_H +#define __ASM_LIBGCC_H + +#include + +typedef int word_type __attribute__ ((mode (__word__))); + +struct DWstruct { + int high, low; +}; + +typedef union +{ + struct DWstruct s; + long long ll; +} DWunion; + +#endif /* __ASM_LIBGCC_H */ From 7bcd4dae6261b221108148befee20286c6c3a230 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sat, 25 Aug 2007 15:12:32 -0700 Subject: [PATCH 4/6] [SPARC32]: Kill unused vars and macros from prom/console.c This should have been removed during the of_console_device changes. Signed-off-by: David S. Miller --- arch/sparc/prom/console.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/sparc/prom/console.c b/arch/sparc/prom/console.c index 8d1cfb0d5068..2a007a784415 100644 --- a/arch/sparc/prom/console.c +++ b/arch/sparc/prom/console.c @@ -17,9 +17,6 @@ extern void restore_current(void); -static char con_name_jmc[] = "/obio/su@"; /* "/obio/su@0,3002f8"; */ -#define CON_SIZE_JMC (sizeof(con_name_jmc)) - /* Non blocking get character from console input device, returns -1 * if no input was taken. This can be used for polling. */ From 4f1296a5169c13b2c1f76c1446aaf361e8519050 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sat, 25 Aug 2007 15:17:31 -0700 Subject: [PATCH 5/6] [SERIAL]: Fix 32-bit warnings in sunzilog.c and sunsu.c resource_size_t can be either a u64 or a u32, and we can't really know for sure, so when printing such a value out always use long-long printf formatting and cast the argument to that type. Signed-off-by: David S. Miller --- drivers/serial/sunsu.c | 5 +++-- drivers/serial/sunzilog.c | 14 ++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index 79b13685bdfa..e074943feff5 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c @@ -1198,10 +1198,11 @@ static int __init sunsu_kbd_ms_init(struct uart_sunsu_port *up) if (up->port.type == PORT_UNKNOWN) return -ENODEV; - printk("%s: %s port at %lx, irq %u\n", + printk("%s: %s port at %llx, irq %u\n", to_of_device(up->port.dev)->node->full_name, (up->su_type == SU_PORT_KBD) ? "Keyboard" : "Mouse", - up->port.mapbase, up->port.irq); + (unsigned long long) up->port.mapbase, + up->port.irq); #ifdef CONFIG_SERIO serio = &up->serio; diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c index 1d262c0c613f..283bef0d24cb 100644 --- a/drivers/serial/sunzilog.c +++ b/drivers/serial/sunzilog.c @@ -1431,14 +1431,16 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m return err; } } else { - printk(KERN_INFO "%s: Keyboard at MMIO 0x%lx (irq = %d) " + printk(KERN_INFO "%s: Keyboard at MMIO 0x%llx (irq = %d) " "is a %s\n", - op->dev.bus_id, up[0].port.mapbase, op->irqs[0], - sunzilog_type (&up[0].port)); - printk(KERN_INFO "%s: Mouse at MMIO 0x%lx (irq = %d) " + op->dev.bus_id, + (unsigned long long) up[0].port.mapbase, + op->irqs[0], sunzilog_type(&up[0].port)); + printk(KERN_INFO "%s: Mouse at MMIO 0x%llx (irq = %d) " "is a %s\n", - op->dev.bus_id, up[1].port.mapbase, op->irqs[0], - sunzilog_type (&up[1].port)); + op->dev.bus_id, + (unsigned long long) up[1].port.mapbase, + op->irqs[0], sunzilog_type(&up[1].port)); } dev_set_drvdata(&op->dev, &up[0]); From 17a82e932d67e2885d9fa18d4656ff53337b1130 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sat, 25 Aug 2007 15:21:51 -0700 Subject: [PATCH 6/6] [SPARC32]: Make flush_tlb_kernel_range() an inline function. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids unused variable warnings in places like mm/vmalloc.c: mm/vmalloc.c: In function ‘unmap_kernel_range’: mm/vmalloc.c:75: warning: unused variable ‘start’ caused by it previously being a macro. Signed-off-by: David S. Miller --- include/asm-sparc/tlbflush.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/asm-sparc/tlbflush.h b/include/asm-sparc/tlbflush.h index 4a3b66618e75..a619da5cfaa9 100644 --- a/include/asm-sparc/tlbflush.h +++ b/include/asm-sparc/tlbflush.h @@ -57,6 +57,10 @@ BTFIXUPDEF_CALL(void, flush_tlb_page, struct vm_area_struct *, unsigned long) /* * This is a kludge, until I know better. --zaitcev XXX */ -#define flush_tlb_kernel_range(start, end) flush_tlb_all() +static inline void flush_tlb_kernel_range(unsigned long start, + unsigned long end) +{ + flush_tlb_all(); +} #endif /* _SPARC_TLBFLUSH_H */