From 16a1a66a5e8324dd6a2864ceaf3e246fc11f93a5 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 2 Jan 2017 04:53:54 -0500 Subject: m68k/mac: Clean up interrupt debug macros and printk statements Mac interrupt code has been debugged. The Penguin deficiencies that still cause unhandled interrupts aren't fixable here. Besides, interrupts are fast and frequent and these printk statements were never really useful IMO. Remove them. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/macints.h | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'arch/m68k/include') diff --git a/arch/m68k/include/asm/macints.h b/arch/m68k/include/asm/macints.h index 92aa8a4c2d03..cddb2d3ea49b 100644 --- a/arch/m68k/include/asm/macints.h +++ b/arch/m68k/include/asm/macints.h @@ -14,22 +14,6 @@ #include -/* Setting this prints debugging info for unclaimed interrupts */ - -#define DEBUG_SPURIOUS - -/* Setting this prints debugging info on each autovector interrupt */ - -/* #define DEBUG_IRQS */ - -/* Setting this prints debugging info on each Nubus interrupt */ - -/* #define DEBUG_NUBUS_INT */ - -/* Setting this prints debugging info on irqs as they enabled and disabled. */ - -/* #define DEBUG_IRQUSE */ - /* * Base IRQ number for all Mac68K interrupt sources. Each source * has eight indexes (base -> base+7). -- cgit v1.2.3-59-g8ed1b From 4eee1e72ad06bdc942b8f8c221d49691ef232c56 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 6 Dec 2016 17:14:40 +0100 Subject: m68k/sun3x: Modernize printing of kernel messages - Convert from printk() to pr_*(), - Remove #undef DEBUG, - Drop useless Warning prefix, - Use TABs for indentation while at it. Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/sun3xflop.h | 14 +++++++------- arch/m68k/sun3x/dvma.c | 35 +++++++++++++---------------------- arch/m68k/sun3x/prom.c | 4 ++-- 3 files changed, 22 insertions(+), 31 deletions(-) (limited to 'arch/m68k/include') diff --git a/arch/m68k/include/asm/sun3xflop.h b/arch/m68k/include/asm/sun3xflop.h index a02ea3a7bb20..159269b7f2e8 100644 --- a/arch/m68k/include/asm/sun3xflop.h +++ b/arch/m68k/include/asm/sun3xflop.h @@ -48,7 +48,7 @@ static unsigned char sun3x_82072_fd_inb(int port) // udelay(5); switch(port & 7) { default: - printk("floppy: Asked to read unknown port %d\n", port); + pr_crit("floppy: Asked to read unknown port %d\n", port); panic("floppy: Port bolixed."); case 4: /* FD_STATUS */ return (*sun3x_fdc.status_r) & ~STATUS_DMA; @@ -70,7 +70,7 @@ static void sun3x_82072_fd_outb(unsigned char value, int port) // udelay(5); switch(port & 7) { default: - printk("floppy: Asked to write to unknown port %d\n", port); + pr_crit("floppy: Asked to write to unknown port %d\n", port); panic("floppy: Port bolixed."); case 2: /* FD_DOR */ /* Oh geese, 82072 on the Sun has no DOR register, @@ -127,7 +127,7 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id) return IRQ_HANDLED; } -// printk("doing pdma\n");// st %x\n", sun_fdc->status_82072); +// pr_info("doing pdma\n");// st %x\n", sun_fdc->status_82072); #ifdef TRACE_FLPY_INT if(!calls) @@ -171,7 +171,7 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id) #ifdef TRACE_FLPY_INT calls++; #endif -// printk("st=%02x\n", st); +// pr_info("st=%02x\n", st); if(st == 0x20) return IRQ_HANDLED; if(!(st & 0x20)) { @@ -180,9 +180,9 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id) doing_pdma = 0; #ifdef TRACE_FLPY_INT - printk("count=%x, residue=%x calls=%d bytes=%x dma_wait=%d\n", - virtual_dma_count, virtual_dma_residue, calls, bytes, - dma_wait); + pr_info("count=%x, residue=%x calls=%d bytes=%x dma_wait=%d\n", + virtual_dma_count, virtual_dma_residue, calls, bytes, + dma_wait); calls = 0; dma_wait=0; #endif diff --git a/arch/m68k/sun3x/dvma.c b/arch/m68k/sun3x/dvma.c index d5ddcdaa2347..9413c8724b0d 100644 --- a/arch/m68k/sun3x/dvma.c +++ b/arch/m68k/sun3x/dvma.c @@ -58,21 +58,17 @@ static volatile unsigned long *iommu_pte = (unsigned long *)SUN3X_IOMMU; ((addr & 0x03c00000) >> \ (DVMA_PAGE_SHIFT+4))) -#undef DEBUG - #ifdef DEBUG /* code to print out a dvma mapping for debugging purposes */ void dvma_print (unsigned long dvma_addr) { - unsigned long index; - - index = dvma_addr >> DVMA_PAGE_SHIFT; - - printk("idx %lx dvma_addr %08lx paddr %08lx\n", index, dvma_addr, - dvma_entry_paddr(index)); + unsigned long index; + index = dvma_addr >> DVMA_PAGE_SHIFT; + pr_info("idx %lx dvma_addr %08lx paddr %08lx\n", index, dvma_addr, + dvma_entry_paddr(index)); } #endif @@ -91,10 +87,7 @@ inline int dvma_map_cpu(unsigned long kaddr, end = PAGE_ALIGN(vaddr + len); -#ifdef DEBUG - printk("dvma: mapping kern %08lx to virt %08lx\n", - kaddr, vaddr); -#endif + pr_debug("dvma: mapping kern %08lx to virt %08lx\n", kaddr, vaddr); pgd = pgd_offset_k(vaddr); do { @@ -126,10 +119,8 @@ inline int dvma_map_cpu(unsigned long kaddr, end3 = end2; do { -#ifdef DEBUG - printk("mapping %08lx phys to %08lx\n", - __pa(kaddr), vaddr); -#endif + pr_debug("mapping %08lx phys to %08lx\n", + __pa(kaddr), vaddr); set_pte(pte, pfn_pte(virt_to_pfn(kaddr), PAGE_KERNEL)); pte++; @@ -162,7 +153,8 @@ inline int dvma_map_iommu(unsigned long kaddr, unsigned long baddr, for(; index < end ; index++) { // if(dvma_entry_use(index)) // BUG(); -// printk("mapping pa %lx to ba %lx\n", __pa(kaddr), index << DVMA_PAGE_SHIFT); +// pr_info("mapping pa %lx to ba %lx\n", __pa(kaddr), +// index << DVMA_PAGE_SHIFT); dvma_entry_set(index, __pa(kaddr)); @@ -190,13 +182,12 @@ void dvma_unmap_iommu(unsigned long baddr, int len) end = (DVMA_PAGE_ALIGN(baddr+len) >> DVMA_PAGE_SHIFT); for(; index < end ; index++) { -#ifdef DEBUG - printk("freeing bus mapping %08x\n", index << DVMA_PAGE_SHIFT); -#endif + pr_debug("freeing bus mapping %08x\n", + index << DVMA_PAGE_SHIFT); #if 0 if(!dvma_entry_use(index)) - printk("dvma_unmap freeing unused entry %04x\n", - index); + pr_info("dvma_unmap freeing unused entry %04x\n", + index); else dvma_entry_dec(index); #endif diff --git a/arch/m68k/sun3x/prom.c b/arch/m68k/sun3x/prom.c index 0898c3f81508..5d60e65c1ee5 100644 --- a/arch/m68k/sun3x/prom.c +++ b/arch/m68k/sun3x/prom.c @@ -106,9 +106,9 @@ void __init sun3x_prom_init(void) idprom_init(); if (!((idprom->id_machtype & SM_ARCH_MASK) == SM_SUN3X)) { - printk("Warning: machine reports strange type %02x\n", + pr_warn("Machine reports strange type %02x\n", idprom->id_machtype); - printk("Pretending it's a 3/80, but very afraid...\n"); + pr_warn("Pretending it's a 3/80, but very afraid...\n"); idprom->id_machtype = SM_SUN3X | SM_3_80; } -- cgit v1.2.3-59-g8ed1b From 05b70ff69cdaf0b84f231c2460bf08b27bad3e95 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 6 Dec 2016 17:25:06 +0100 Subject: m68k/mm: sun3 - Modernize printing of kernel messages - Convert from printk() to pr_*(), - Add missing print to do_page_mapin(), as print_pte_vaddr() calls pr_cont(). Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/sun3_pgtable.h | 6 +++--- arch/m68k/mm/sun3kmap.c | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'arch/m68k/include') diff --git a/arch/m68k/include/asm/sun3_pgtable.h b/arch/m68k/include/asm/sun3_pgtable.h index 48657f9fdece..d5104a7b5388 100644 --- a/arch/m68k/include/asm/sun3_pgtable.h +++ b/arch/m68k/include/asm/sun3_pgtable.h @@ -151,11 +151,11 @@ static inline void pgd_clear (pgd_t *pgdp) {} #define pte_ERROR(e) \ - printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) + pr_err("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) #define pmd_ERROR(e) \ - printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e)) + pr_err("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e)) #define pgd_ERROR(e) \ - printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) + pr_err("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) /* diff --git a/arch/m68k/mm/sun3kmap.c b/arch/m68k/mm/sun3kmap.c index 3dc41158c05e..ae03555449b8 100644 --- a/arch/m68k/mm/sun3kmap.c +++ b/arch/m68k/mm/sun3kmap.c @@ -40,6 +40,7 @@ static inline void do_page_mapin(unsigned long phys, unsigned long virt, sun3_put_pte(virt, pte); #ifdef SUN3_KMAP_DEBUG + pr_info("mapin:"); print_pte_vaddr(virt); #endif @@ -80,8 +81,8 @@ void __iomem *sun3_ioremap(unsigned long phys, unsigned long size, return NULL; #ifdef SUN3_KMAP_DEBUG - printk("ioremap: got virt %p size %lx(%lx)\n", - area->addr, size, area->size); + pr_info("ioremap: got virt %p size %lx(%lx)\n", area->addr, size, + area->size); #endif pages = size / PAGE_SIZE; -- cgit v1.2.3-59-g8ed1b From f0b914aeea8ed2abe8e53779ec620eac2129d03f Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 6 Dec 2016 20:05:26 +0100 Subject: m68k/include: Modernize printing of kernel messages - Convert from printk() to pr_*(), - Add dummies for validating format strings when debugging is disabled. Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/bug.h | 4 ++-- arch/m68k/include/asm/floppy.h | 6 +++--- arch/m68k/include/asm/math-emu.h | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'arch/m68k/include') diff --git a/arch/m68k/include/asm/bug.h b/arch/m68k/include/asm/bug.h index ef9a2e47352f..5bc8d91d68d4 100644 --- a/arch/m68k/include/asm/bug.h +++ b/arch/m68k/include/asm/bug.h @@ -6,12 +6,12 @@ #ifdef CONFIG_DEBUG_BUGVERBOSE #ifndef CONFIG_SUN3 #define BUG() do { \ - printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ + pr_crit("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ __builtin_trap(); \ } while (0) #else #define BUG() do { \ - printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ + pr_crit("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ panic("BUG!"); \ } while (0) #endif diff --git a/arch/m68k/include/asm/floppy.h b/arch/m68k/include/asm/floppy.h index 47365b1ccbec..c3b9ad6732fc 100644 --- a/arch/m68k/include/asm/floppy.h +++ b/arch/m68k/include/asm/floppy.h @@ -234,9 +234,9 @@ asmlinkage irqreturn_t floppy_hardint(int irq, void *dev_id) virtual_dma_residue += virtual_dma_count; virtual_dma_count=0; #ifdef TRACE_FLPY_INT - printk("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n", - virtual_dma_count, virtual_dma_residue, calls, bytes, - dma_wait); + pr_info("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n", + virtual_dma_count, virtual_dma_residue, calls, bytes, + dma_wait); calls = 0; dma_wait=0; #endif diff --git a/arch/m68k/include/asm/math-emu.h b/arch/m68k/include/asm/math-emu.h index 5e9249b0014c..b062696d5a0d 100644 --- a/arch/m68k/include/asm/math-emu.h +++ b/arch/m68k/include/asm/math-emu.h @@ -105,21 +105,21 @@ struct fp_data { #ifdef FPU_EMU_DEBUG extern unsigned int fp_debugprint; -#define dprint(bit, fmt, args...) ({ \ +#define dprint(bit, fmt, ...) ({ \ if (fp_debugprint & (1 << (bit))) \ - printk(fmt, ## args); \ + pr_info(fmt, ##__VA_ARGS__); \ }) #else -#define dprint(bit, fmt, args...) +#define dprint(bit, fmt, ...) no_printk(fmt, ##__VA_ARGS__) #endif #define uprint(str) ({ \ static int __count = 3; \ \ if (__count > 0) { \ - printk("You just hit an unimplemented " \ + pr_err("You just hit an unimplemented " \ "fpu instruction (%s)\n", str); \ - printk("Please report this to ....\n"); \ + pr_err("Please report this to ....\n"); \ __count--; \ } \ }) -- cgit v1.2.3-59-g8ed1b