Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'sh/for-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6

* 'sh/for-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
serial: sh-sci: Reorder the SCxTDR write after the TDxE clear.
sh: __copy_user function can corrupt the stack in case of exception
sh: Fixed the TMU0 reload value on resume
sh: Don't factor in PAGE_OFFSET for valid_phys_addr_range() check.
sh: early printk port type fix
i2c: fix i2c-sh_mobile rx underrun
sh: Provide a sane valid_phys_addr_range() to prevent TLB reset with PMB.
usb: r8a66597-hcd: fix wrong data access in SuperH on-chip USB
fix sci type for SH7723
serial: sh-sci: fix cannot work SH7723 SCIFA
sh: Handle fixmap TLB eviction more coherently.

+108 -32
+4
arch/sh/include/asm/io.h
··· 293 293 */ 294 294 #define xlate_dev_kmem_ptr(p) p 295 295 296 + #define ARCH_HAS_VALID_PHYS_ADDR_RANGE 297 + int valid_phys_addr_range(unsigned long addr, size_t size); 298 + int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); 299 + 296 300 #endif /* __KERNEL__ */ 297 301 298 302 #endif /* __ASM_SH_IO_H */
+6
arch/sh/include/asm/pgtable.h
··· 148 148 extern void page_table_range_init(unsigned long start, unsigned long end, 149 149 pgd_t *pgd); 150 150 151 + #if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_CPU_SH4) && defined(CONFIG_MMU) 152 + extern void kmap_coherent_init(void); 153 + #else 154 + #define kmap_coherent_init() do { } while (0) 155 + #endif 156 + 151 157 #include <asm-generic/pgtable.h> 152 158 153 159 #endif /* __ASM_SH_PGTABLE_H */
+3 -3
arch/sh/kernel/cpu/sh4a/setup-sh7723.c
··· 119 119 },{ 120 120 .mapbase = 0xa4e30000, 121 121 .flags = UPF_BOOT_AUTOCONF, 122 - .type = PORT_SCI, 122 + .type = PORT_SCIFA, 123 123 .irqs = { 56, 56, 56, 56 }, 124 124 },{ 125 125 .mapbase = 0xa4e40000, 126 126 .flags = UPF_BOOT_AUTOCONF, 127 - .type = PORT_SCI, 127 + .type = PORT_SCIFA, 128 128 .irqs = { 88, 88, 88, 88 }, 129 129 },{ 130 130 .mapbase = 0xa4e50000, 131 131 .flags = UPF_BOOT_AUTOCONF, 132 - .type = PORT_SCI, 132 + .type = PORT_SCIFA, 133 133 .irqs = { 109, 109, 109, 109 }, 134 134 }, { 135 135 .flags = 0,
+2 -1
arch/sh/kernel/early_printk.c
··· 75 75 #endif 76 76 77 77 static struct uart_port scif_port = { 78 + .type = PORT_SCIF, 78 79 .mapbase = CONFIG_EARLY_SCIF_CONSOLE_PORT, 79 80 .membase = (char __iomem *)CONFIG_EARLY_SCIF_CONSOLE_PORT, 80 81 }; ··· 85 84 while (((sci_in(&scif_port, SCFDR) & EPK_FIFO_BITS) >= EPK_FIFO_SIZE)) 86 85 ; 87 86 88 - sci_out(&scif_port, SCxTDR, c); 89 87 sci_in(&scif_port, SCxSR); 90 88 sci_out(&scif_port, SCxSR, 0xf3 & ~(0x20 | 0x40)); 89 + sci_out(&scif_port, SCxTDR, c); 91 90 92 91 while ((sci_in(&scif_port, SCxSR) & 0x40) == 0) 93 92 ;
+1 -1
arch/sh/kernel/timers/timer-tmu.c
··· 120 120 { 121 121 switch (mode) { 122 122 case CLOCK_EVT_MODE_PERIODIC: 123 - ctrl_outl(ctrl_inl(TMU0_TCNT), TMU0_TCOR); 123 + ctrl_outl(tmu_latest_interval[TMU0], TMU0_TCOR); 124 124 break; 125 125 case CLOCK_EVT_MODE_ONESHOT: 126 126 ctrl_outl(0, TMU0_TCOR);
+8 -3
arch/sh/lib/copy_page.S
··· 80 80 .section __ex_table, "a"; \ 81 81 .long 9999b, 6000f ; \ 82 82 .previous 83 + #define EX_NO_POP(...) \ 84 + 9999: __VA_ARGS__ ; \ 85 + .section __ex_table, "a"; \ 86 + .long 9999b, 6005f ; \ 87 + .previous 83 88 ENTRY(__copy_user) 84 89 ! Check if small number of bytes 85 90 mov #11,r0 ··· 144 139 bt 1f 145 140 146 141 2: 147 - EX( mov.b @r5+,r0 ) 142 + EX_NO_POP( mov.b @r5+,r0 ) 148 143 dt r6 149 - EX( mov.b r0,@r4 ) 144 + EX_NO_POP( mov.b r0,@r4 ) 150 145 bf/s 2b 151 146 add #1,r4 152 147 ··· 155 150 156 151 # Exception handler: 157 152 .section .fixup, "ax" 158 - 6000: 153 + 6005: 159 154 mov.l 8000f,r1 160 155 mov r3,r0 161 156 jmp @r1
+1 -1
arch/sh/mm/Makefile_32
··· 2 2 # Makefile for the Linux SuperH-specific parts of the memory manager. 3 3 # 4 4 5 - obj-y := init.o extable_32.o consistent.o 5 + obj-y := init.o extable_32.o consistent.o mmap.o 6 6 7 7 ifndef CONFIG_CACHE_OFF 8 8 cache-$(CONFIG_CPU_SH2) := cache-sh2.o
+1 -1
arch/sh/mm/Makefile_64
··· 2 2 # Makefile for the Linux SuperH-specific parts of the memory manager. 3 3 # 4 4 5 - obj-y := init.o consistent.o 5 + obj-y := init.o consistent.o mmap.o 6 6 7 7 mmu-y := tlb-nommu.o pg-nommu.o extable_32.o 8 8 mmu-$(CONFIG_MMU) := fault_64.o ioremap_64.o tlbflush_64.o tlb-sh5.o \
+9 -3
arch/sh/mm/init.c
··· 137 137 void __init paging_init(void) 138 138 { 139 139 unsigned long max_zone_pfns[MAX_NR_ZONES]; 140 + unsigned long vaddr; 140 141 int nid; 141 142 142 143 /* We don't need to map the kernel through the TLB, as ··· 149 148 * check for a null value. */ 150 149 set_TTB(swapper_pg_dir); 151 150 152 - /* Populate the relevant portions of swapper_pg_dir so that 151 + /* 152 + * Populate the relevant portions of swapper_pg_dir so that 153 153 * we can use the fixmap entries without calling kmalloc. 154 - * pte's will be filled in by __set_fixmap(). */ 155 - page_table_range_init(FIXADDR_START, FIXADDR_TOP, swapper_pg_dir); 154 + * pte's will be filled in by __set_fixmap(). 155 + */ 156 + vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK; 157 + page_table_range_init(vaddr, 0, swapper_pg_dir); 158 + 159 + kmap_coherent_init(); 156 160 157 161 memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); 158 162
+31
arch/sh/mm/mmap.c
··· 1 + /* 2 + * arch/sh/mm/mmap.c 3 + * 4 + * Copyright (C) 2008 Paul Mundt 5 + * 6 + * This file is subject to the terms and conditions of the GNU General Public 7 + * License. See the file "COPYING" in the main directory of this archive 8 + * for more details. 9 + */ 10 + #include <linux/io.h> 11 + #include <linux/mm.h> 12 + #include <asm/page.h> 13 + 14 + /* 15 + * You really shouldn't be using read() or write() on /dev/mem. This 16 + * might go away in the future. 17 + */ 18 + int valid_phys_addr_range(unsigned long addr, size_t count) 19 + { 20 + if (addr < __MEMORY_START) 21 + return 0; 22 + if (addr + count > __pa(high_memory)) 23 + return 0; 24 + 25 + return 1; 26 + } 27 + 28 + int valid_mmap_phys_addr_range(unsigned long pfn, size_t size) 29 + { 30 + return 1; 31 + }
+17
arch/sh/mm/pg-sh4.c
··· 7 7 * Released under the terms of the GNU GPL v2.0. 8 8 */ 9 9 #include <linux/mm.h> 10 + #include <linux/init.h> 10 11 #include <linux/mutex.h> 11 12 #include <linux/fs.h> 12 13 #include <linux/highmem.h> ··· 16 15 #include <asm/cacheflush.h> 17 16 18 17 #define CACHE_ALIAS (current_cpu_data.dcache.alias_mask) 18 + 19 + #define kmap_get_fixmap_pte(vaddr) \ 20 + pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)), (vaddr)) 21 + 22 + static pte_t *kmap_coherent_pte; 23 + 24 + void __init kmap_coherent_init(void) 25 + { 26 + unsigned long vaddr; 27 + 28 + /* cache the first coherent kmap pte */ 29 + vaddr = __fix_to_virt(FIX_CMAP_BEGIN); 30 + kmap_coherent_pte = kmap_get_fixmap_pte(vaddr); 31 + } 19 32 20 33 static inline void *kmap_coherent(struct page *page, unsigned long addr) 21 34 { ··· 48 33 local_irq_restore(flags); 49 34 50 35 update_mmu_cache(NULL, vaddr, pte); 36 + 37 + set_pte(kmap_coherent_pte - (FIX_CMAP_END - idx), pte); 51 38 52 39 return (void *)vaddr; 53 40 }
+2 -1
drivers/i2c/busses/i2c-sh_mobile.c
··· 318 318 } else 319 319 data = i2c_op(pd, OP_RX, 0); 320 320 321 - pd->msg->buf[real_pos] = data; 321 + if (real_pos >= 0) 322 + pd->msg->buf[real_pos] = data; 322 323 } while (0); 323 324 324 325 pd->pos++;
+12 -10
drivers/serial/sh-sci.c
··· 144 144 status = sci_in(port, SCxSR); 145 145 } while (!(status & SCxSR_TDxE(port))); 146 146 147 - sci_out(port, SCxTDR, c); 148 147 sci_in(port, SCxSR); /* Dummy read */ 149 148 sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); 149 + sci_out(port, SCxTDR, c); 150 150 151 151 spin_unlock_irqrestore(&port->lock, flags); 152 152 } ··· 478 478 return; 479 479 } 480 480 481 - if (port->type == PORT_SCIF) 482 - count = scif_txroom(port); 483 - else 481 + if (port->type == PORT_SCI) 484 482 count = sci_txroom(port); 483 + else 484 + count = scif_txroom(port); 485 485 486 486 do { 487 487 unsigned char c; ··· 510 510 } else { 511 511 ctrl = sci_in(port, SCSCR); 512 512 513 - if (port->type == PORT_SCIF) { 513 + if (port->type != PORT_SCI) { 514 514 sci_in(port, SCxSR); /* Dummy read */ 515 515 sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); 516 516 } ··· 536 536 return; 537 537 538 538 while (1) { 539 - if (port->type == PORT_SCIF) 540 - count = scif_rxroom(port); 541 - else 539 + if (port->type == PORT_SCI) 542 540 count = sci_rxroom(port); 541 + else 542 + count = scif_rxroom(port); 543 543 544 544 /* Don't copy more bytes than there is room for in the buffer */ 545 545 count = tty_buffer_request_room(tty, count); ··· 714 714 715 715 #if defined(SCIF_ORER) 716 716 /* XXX: Handle SCIF overrun error */ 717 - if (port->type == PORT_SCIF && (sci_in(port, SCLSR) & SCIF_ORER) != 0) { 717 + if (port->type != PORT_SCI && (sci_in(port, SCLSR) & SCIF_ORER) != 0) { 718 718 sci_out(port, SCLSR, 0); 719 719 if (tty_insert_flip_char(tty, 0, TTY_OVERRUN)) { 720 720 copied++; ··· 1042 1042 1043 1043 sci_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */ 1044 1044 1045 - if (port->type == PORT_SCIF) 1045 + if (port->type != PORT_SCI) 1046 1046 sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST); 1047 1047 1048 1048 smr_val = sci_in(port, SCSMR) & 3; ··· 1085 1085 case PORT_SCI: return "sci"; 1086 1086 case PORT_SCIF: return "scif"; 1087 1087 case PORT_IRDA: return "irda"; 1088 + case PORT_SCIFA: return "scifa"; 1088 1089 } 1089 1090 1090 1091 return NULL; ··· 1113 1112 s->init_pins = sci_init_pins_sci; 1114 1113 break; 1115 1114 case PORT_SCIF: 1115 + case PORT_SCIFA: 1116 1116 s->init_pins = sci_init_pins_scif; 1117 1117 break; 1118 1118 case PORT_IRDA:
+8 -8
drivers/serial/sh-sci.h
··· 289 289 #define CPU_SCIx_FNS(name, sci_offset, sci_size, scif_offset, scif_size)\ 290 290 static inline unsigned int sci_##name##_in(struct uart_port *port) \ 291 291 { \ 292 - if (port->type == PORT_SCI) { \ 293 - SCI_IN(sci_size, sci_offset) \ 294 - } else { \ 295 - SCI_IN(scif_size, scif_offset); \ 292 + if (port->type == PORT_SCIF) { \ 293 + SCI_IN(scif_size, scif_offset) \ 294 + } else { /* PORT_SCI or PORT_SCIFA */ \ 295 + SCI_IN(sci_size, sci_offset); \ 296 296 } \ 297 297 } \ 298 298 static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \ 299 299 { \ 300 - if (port->type == PORT_SCI) { \ 301 - SCI_OUT(sci_size, sci_offset, value) \ 302 - } else { \ 303 - SCI_OUT(scif_size, scif_offset, value); \ 300 + if (port->type == PORT_SCIF) { \ 301 + SCI_OUT(scif_size, scif_offset, value) \ 302 + } else { /* PORT_SCI or PORT_SCIFA */ \ 303 + SCI_OUT(sci_size, sci_offset, value); \ 304 304 } \ 305 305 } 306 306
+3
include/linux/serial_core.h
··· 155 155 156 156 #define PORT_SC26XX 82 157 157 158 + /* SH-SCI */ 159 + #define PORT_SCIFA 83 160 + 158 161 #ifdef __KERNEL__ 159 162 160 163 #include <linux/compiler.h>