aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-08-14m68k: Truncate base in do_div()Andreas Schwab1-4/+5
Explicitly truncate the second operand of do_div() to 32 bits to guard against bogus code calling it with a 64-bit divisor. [Thorsten] After upgrading from 3.2 to 3.10, mounting a btrfs volume fails with: btrfs: setting nodatacow, compression disabled btrfs: enabling auto recovery btrfs: disk space caching is enabled *** ZERO DIVIDE *** FORMAT=2 Current process id is 722 BAD KERNEL TRAP: 00000000 Modules linked in: evdev mac_hid ext4 crc16 jbd2 mbcache btrfs xor lzo_compress zlib_deflate raid6_pq crc32c libcrc32c PC: [<319535b2>] __btrfs_map_block+0x11c/0x119a [btrfs] SR: 2000 SP: 30c1fab4 a2: 30f0faf0 d0: 00000000 d1: 00001000 d2: 00000000 d3: 00000000 d4: 00010000 d5: 00000000 a0: 3085c72c a1: 3085c72c Process mount (pid: 722, task=30f0faf0) Frame format=2 instr addr=319535ae Stack from 30c1faec: 00000000 00000020 00000000 00001000 00000000 01401000 30253928 300ffc00 00a843ac 3026f640 00000000 00010000 0009e250 00d106c0 00011220 00000000 00001000 301c6830 0009e32a 000000ff 00000009 3085c72c 00000000 00000000 30c1fd14 00000000 00000020 00000000 30c1fd14 0009e26c 00000020 00000003 00000000 0009dd8a 300b0b6c 30253928 00a843ac 00001000 00000000 00000000 0000a008 3194e76a 30253928 00a843ac 00001000 00000000 00000000 00000002 Call Trace: [<00001000>] kernel_pg_dir+0x0/0x1000 [...] Code: 222e ff74 2a2e ff5c 2c2e ff60 4c45 1402 <2d40> ff64 2d41 ff68 2205 4c2e 1800 ff68 4c04 0800 2041 d1c0 2206 4c2e 1400 ff68 [Geert] As diagnosed by Andreas, fs/btrfs/volumes.c:__btrfs_map_block() calls do_div(stripe_nr, stripe_len); with stripe_len u64, while do_div() assumes the divisor is a 32-bit number. Due to the lack of truncation in the m68k-specific implementation of do_div(), the division is performed using the upper 32-bit word of stripe_len, which is zero. This was introduced by commit 53b381b3abeb86f12787a6c40fee9b2f71edc23b ("Btrfs: RAID5 and RAID6"), which changed the divisor from map->stripe_len (struct map_lookup.stripe_len is int) to a 64-bit temporary. Reported-by: Thorsten Glaser <tg@debian.org> Signed-off-by: Andreas Schwab <schwab@linux-m68k.org> Tested-by: Thorsten Glaser <tg@debian.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: stable@vger.kernel.org
2013-08-14m68k/atari: ARAnyM - Fix NatFeat module supportGeert Uytterhoeven1-4/+19
As pointed out by Andreas Schwab, pointers passed to ARAnyM NatFeat calls should be physical addresses, not virtual addresses. Fortunately on Atari, physical and virtual kernel addresses are the same, as long as normal kernel memory is concerned, so this usually worked fine without conversion. But for modules, pointers to literal strings are located in vmalloc()ed memory. Depending on the version of ARAnyM, this causes the nf_get_id() call to just fail, or worse, crash ARAnyM itself with e.g. Gotcha! Illegal memory access. Atari PC = $968c This is a big issue for distro kernels, who want to have all drivers as loadable modules in an initrd. Add a wrapper for nf_get_id() that copies the literal to the stack to work around this issue. Reported-by: Thorsten Glaser <tg@debian.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: stable@vger.kernel.org
2013-07-03Merge branch 'akpm' (updates from Andrew Morton)Linus Torvalds1-37/+11
Merge first patch-bomb from Andrew Morton: - various misc bits - I'm been patchmonkeying ocfs2 for a while, as Joel and Mark have been distracted. There has been quite a bit of activity. - About half the MM queue - Some backlight bits - Various lib/ updates - checkpatch updates - zillions more little rtc patches - ptrace - signals - exec - procfs - rapidio - nbd - aoe - pps - memstick - tools/testing/selftests updates * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (445 commits) tools/testing/selftests: don't assume the x bit is set on scripts selftests: add .gitignore for kcmp selftests: fix clean target in kcmp Makefile selftests: add .gitignore for vm selftests: add hugetlbfstest self-test: fix make clean selftests: exit 1 on failure kernel/resource.c: remove the unneeded assignment in function __find_resource aio: fix wrong comment in aio_complete() drivers/w1/slaves/w1_ds2408.c: add magic sequence to disable P0 test mode drivers/memstick/host/r592.c: convert to module_pci_driver drivers/memstick/host/jmb38x_ms: convert to module_pci_driver pps-gpio: add device-tree binding and support drivers/pps/clients/pps-gpio.c: convert to module_platform_driver drivers/pps/clients/pps-gpio.c: convert to devm_* helpers drivers/parport/share.c: use kzalloc Documentation/accounting/getdelays.c: avoid strncpy in accounting tool aoe: update internal version number to v83 aoe: update copyright date aoe: perform I/O completions in parallel ...
2013-07-03Merge tag 'pci-v3.11-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pciLinus Torvalds1-1/+0
Pull PCI changes from Bjorn Helgaas: "PCI device hotplug - Add pci_alloc_dev() interface (Gu Zheng) - Add pci_bus_get()/put() for reference counting (Jiang Liu) - Fix SR-IOV reference count issues (Jiang Liu) - Remove unused acpi_pci_roots list (Jiang Liu) MSI - Conserve interrupt resources on x86 (Alexander Gordeev) AER - Force fatal severity when component has been reset (Betty Dall) - Reset link below Root Port as well as Downstream Port (Betty Dall) - Fix "Firmware first" flag setting (Bjorn Helgaas) - Don't parse HEST for non-PCIe devices (Bjorn Helgaas) ASPM - Warn when we can't disable ASPM as driver requests (Bjorn Helgaas) Miscellaneous - Add CircuitCo PCI IDs (Darren Hart) - Add AMD CZ SATA and SMBus PCI IDs (Shane Huang) - Work around Ivytown NTB BAR size issue (Jon Mason) - Detect invalid initial BAR values (Kevin Hao) - Add pcibios_release_device() (Sebastian Ott) - Fix powerpc & sparc PCI_UNKNOWN power state usage (Bjorn Helgaas)" * tag 'pci-v3.11-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (51 commits) MAINTAINERS: Add ACPI folks for ACPI-related things under drivers/pci PCI: Add CircuitCo vendor ID and subsystem ID PCI: Use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM) PCI: Return early on allocation failures to unindent mainline code PCI: Simplify IOV implementation and fix reference count races PCI: Drop redundant setting of bus->is_added in virtfn_add_bus() unicore32/PCI: Remove redundant call of pci_bus_add_devices() m68k/PCI: Remove redundant call of pci_bus_add_devices() PCI / ACPI / PM: Use correct power state strings in messages PCI: Fix comment typo for pcie_pme_remove() PCI: Rename pci_release_bus_bridge_dev() to pci_release_host_bridge_dev() PCI: Fix refcount issue in pci_create_root_bus() error recovery path ia64/PCI: Clean up pci_scan_root_bus() usage PCI/AER: Reset link for devices below Root Port or Downstream Port ACPI / APEI: Force fatal AER severity when component has been reset PCI/AER: Remove "extern" from function declarations PCI/AER: Move AER severity defines to aer.h PCI/AER: Set dev->__aer_firmware_first only for matching devices PCI/AER: Factor out HEST device type matching PCI/AER: Don't parse HEST table for non-PCIe devices ...
2013-07-03mm/m68k: fix build warning of unused variableJiang Liu1-5/+8
Fix build warning of unused variable: arch/m68k/mm/init.c: In function 'mem_init': arch/m68k/mm/init.c:151:6: warning: unused variable 'i' [-Wunused-variable] Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Greg Ungerer <gerg@uclinux.org> Cc: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-07-03mm/m68k: prepare for killing free_all_bootmem_node()Jiang Liu1-3/+1
Prepare for killing free_all_bootmem_node() by using free_all_bootmem(). Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-07-03mm/m68k: prepare for removing num_physpages and simplify mem_init()Jiang Liu1-29/+2
Prepare for removing num_physpages and simplify mem_init(). Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Acked-by: Greg Ungerer <gerg@uclinux.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-07-03mm: concentrate modification of totalram_pages into the mm coreJiang Liu1-2/+2
Concentrate code to modify totalram_pages into the mm core, so the arch memory initialized code doesn't need to take care of it. With these changes applied, only following functions from mm core modify global variable totalram_pages: free_bootmem_late(), free_all_bootmem(), free_all_bootmem_node(), adjust_managed_page_count(). With this patch applied, it will be much more easier for us to keep totalram_pages and zone->managed_pages in consistence. Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Acked-by: David Howells <dhowells@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: <sworddragon2@aol.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Chris Metcalf <cmetcalf@tilera.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Jianguo Wu <wujianguo@huawei.com> Cc: Joonsoo Kim <js1304@gmail.com> Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Michel Lespinasse <walken@google.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Rik van Riel <riel@redhat.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Tang Chen <tangchen@cn.fujitsu.com> Cc: Tejun Heo <tj@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Wen Congyang <wency@cn.fujitsu.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-07-03mm: enhance free_reserved_area() to support poisoning memory with zeroJiang Liu1-2/+2
Address more review comments from last round of code review. 1) Enhance free_reserved_area() to support poisoning freed memory with pattern '0'. This could be used to get rid of poison_init_mem() on ARM64. 2) A previous patch has disabled memory poison for initmem on s390 by mistake, so restore to the original behavior. 3) Remove redundant PAGE_ALIGN() when calling free_reserved_area(). Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: <sworddragon2@aol.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Chris Metcalf <cmetcalf@tilera.com> Cc: David Howells <dhowells@redhat.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Jianguo Wu <wujianguo@huawei.com> Cc: Joonsoo Kim <js1304@gmail.com> Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Michel Lespinasse <walken@google.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Rik van Riel <riel@redhat.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Tang Chen <tangchen@cn.fujitsu.com> Cc: Tejun Heo <tj@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Wen Congyang <wency@cn.fujitsu.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-07-03mm: change signature of free_reserved_area() to fix building warningsJiang Liu1-1/+1
Change signature of free_reserved_area() according to Russell King's suggestion to fix following build warnings: arch/arm/mm/init.c: In function 'mem_init': arch/arm/mm/init.c:603:2: warning: passing argument 1 of 'free_reserved_area' makes integer from pointer without a cast [enabled by default] free_reserved_area(__va(PHYS_PFN_OFFSET), swapper_pg_dir, 0, NULL); ^ In file included from include/linux/mman.h:4:0, from arch/arm/mm/init.c:15: include/linux/mm.h:1301:22: note: expected 'long unsigned int' but argument is of type 'void *' extern unsigned long free_reserved_area(unsigned long start, unsigned long end, mm/page_alloc.c: In function 'free_reserved_area': >> mm/page_alloc.c:5134:3: warning: passing argument 1 of 'virt_to_phys' makes pointer from integer without a cast [enabled by default] In file included from arch/mips/include/asm/page.h:49:0, from include/linux/mmzone.h:20, from include/linux/gfp.h:4, from include/linux/mm.h:8, from mm/page_alloc.c:18: arch/mips/include/asm/io.h:119:29: note: expected 'const volatile void *' but argument is of type 'long unsigned int' mm/page_alloc.c: In function 'free_area_init_nodes': mm/page_alloc.c:5030:34: warning: array subscript is below array bounds [-Warray-bounds] Also address some minor code review comments. Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Reported-by: Arnd Bergmann <arnd@arndb.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: <sworddragon2@aol.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Chris Metcalf <cmetcalf@tilera.com> Cc: David Howells <dhowells@redhat.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Jianguo Wu <wujianguo@huawei.com> Cc: Joonsoo Kim <js1304@gmail.com> Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Michel Lespinasse <walken@google.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Rik van Riel <riel@redhat.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Tang Chen <tangchen@cn.fujitsu.com> Cc: Tejun Heo <tj@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Wen Congyang <wency@cn.fujitsu.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-07-03Merge branch 'exotic-arch-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68kLinus Torvalds1-1/+1
Pull "exotic" arch fixes from Geert Uytterhoeven: "This is a collection of several exotic architecture fixes, and a few other fixes for issues that were detected while doing the former" * 'exotic-arch-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: (35 commits) lib: Move fonts from drivers/video/console/ to lib/fonts/ console/font: Refactor font support code selection logic Revert "staging/solo6x10: depend on CONFIG_FONTS" input: cros_ec_keyb_clear_keyboard() depends on CONFIG_PM_SLEEP score: Wire up asm-generic/xor.h score: Remove unneeded <asm/dma-mapping.h> openrisc: Wire up asm-generic/xor.h h8300/boot: Use POSIX "$((..))" instead of bashism "$[...]" h8300: Mark H83002 and H83048 CPU support broken h8300: Switch h8300 to drivers/Kconfig h8300: Limit timer channel ranges in Kconfig h8300: Wire up asm-generic/xor.h h8300: Fill the system call table using a CALL() macro h8300: Fix <asm/tlb.h> h8300: Hardcode symbol prefixes in asm sources h8300: add missing definition for read_barries_depends() frv: head.S - Remove commented-out initialization code cris: Wire up asm-generic/vga.h parport: disable PC-style parallel port support on cris console: Disable VGA text console support on cris ...
2013-07-03Merge branch 'for-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68kLinus Torvalds12-67/+22
Pull m68k updates from Geert Uytterhoeven. * 'for-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k/q40: Enable PC parallel port in defconfig m68k/q40: Undefine insl/outsl before redefining them m68k/uaccess: Fix asm constraints for userspace access swim: Release memory region after incorrect return/goto m68k/irq: Vector ints need a valid interrupt handler m68k/math-emu: unsigned issue, 'unsigned long' will never be less than zero m68k: remove CONFIG_EARLY_PRINTK dependency on CONFIG_EMBEDDED, default to n m68k/sun3: remove inline marking of EXPORT_SYMBOL functions [SCSI] a3000: use module_platform_driver_probe() [SCSI] a4000t: use module_platform_driver_probe() m68k: Remove inline strcpy() and strcat() implementations
2013-06-29consolidate io_remap_pfn_range definitionsAl Viro2-6/+0
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-06-28lib: Move fonts from drivers/video/console/ to lib/fonts/Geert Uytterhoeven1-1/+1
Several drivers need font support independent of CONFIG_VT, cfr. commit 9cbce8d7e1dae0744ca4f68d62aa7de18196b6f4, "console/font: Refactor font support code selection logic"). Hence move the fonts and their support logic from drivers/video/console/ to its own library directory lib/fonts/. This also allows to limit processing of drivers/video/console/Makefile to CONFIG_VT=y again. [Kevin Hilman <khilman@linaro.org>: Update arch/arm/boot/compressed/Makefile] Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2013-06-24m68k/q40: Enable PC parallel port in defconfigGeert Uytterhoeven2-0/+8
Enable the PC parallel port and other related options in the Q40-specific and multi-platform defconfigs. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2013-06-24m68k/q40: Undefine insl/outsl before redefining themGeert Uytterhoeven1-0/+2
To use the PC parallel port driver on Q40, we need non-standard versions of the insl/outsl accessors. Make sure to undefine them first, to kill this compiler warning: In file included from drivers/parport/parport_pc.c:67: arch/m68k/include/asm/parport.h:14:1: warning: "insl" redefined In file included from arch/m68k/include/asm/io.h:4, from include/linux/scatterlist.h:10, from include/linux/dma-mapping.h:9, from drivers/parport/parport_pc.c:54: arch/m68k/include/asm/io_mm.h:370:1: warning: this is the location of the previous definition In file included from drivers/parport/parport_pc.c:67: arch/m68k/include/asm/parport.h:15:1: warning: "outsl" redefined In file included from arch/m68k/include/asm/io.h:4, from include/linux/scatterlist.h:10, from include/linux/dma-mapping.h:9, from drivers/parport/parport_pc.c:54: arch/m68k/include/asm/io_mm.h:373:1: warning: this is the location of the previous definition Reported-by: Thorsten Glaser <tg@debian.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2013-06-24m68k/uaccess: Fix asm constraints for userspace accessGeert Uytterhoeven2-7/+7
When compiling a MMU kernel with CPU_HAS_ADDRESS_SPACES=n (e.g. "MMU=y allnoconfig": "echo CONFIG_MMU=y > allno.config && make KCONFIG_ALLCONFIG=1 allnoconfig"), we use plain "move" instead of "moves", and I got: CC arch/m68k/lib/uaccess.o {standard input}: Assembler messages: {standard input}:47: Error: operands mismatch -- statement `move.b %a0,(%a1)' ignored This happens because plain "move" doesn't support byte transfers between memory and address registers, while "moves" does. Fix the asm constraints for __generic_copy_from_user(), __generic_copy_to_user(), and __clear_user() to only use data registers when accessing userspace. Also, relax the asm constraints for 16-bit userspace accesses in __put_user() and __get_user(), as both "move" and "moves" do support such transfers between memory and address registers. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2013-06-24m68k/irq: Vector ints need a valid interrupt handlerThomas Bogendoerfer1-1/+1
To get vectored interrupts working we need to switch from the default handler handle_bad_irq() to something more sensible. Tested on a MVME177 board. Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2013-06-24m68k/math-emu: unsigned issue, 'unsigned long' will never be less than zeroChen Gang1-1/+1
'oldmant.m32[1]' is 'unsigned long' which can never be '< 0', and the original author wanted to check whether the highest bit is set. So make the bit test explicit (which is better than casting from 'unsigned long' to 'long'). The related warning: (with EXTRA_CFLAGS=-W ARCH=m68k for allmodconfig) arch/m68k/math-emu/fp_arith.c:522:4: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] Signed-off-by: Chen Gang <gang.chen@asianux.com> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2013-06-24m68k: remove CONFIG_EARLY_PRINTK dependency on CONFIG_EMBEDDED, default to nFinn Thain1-2/+1
Allow CONFIG_EARLY_PRINTK without requiring both CONFIG_EMBEDDED and CONFIG_DEBUG. Default to disabled. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2013-06-24m68k/sun3: remove inline marking of EXPORT_SYMBOL functionsDenis Efremov1-1/+1
EXPORT_SYMBOL and inline directives are contradictory to each other. The patch fixes this inconsistency. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Denis Efremov <yefremov.denis@gmail.com> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2013-06-24m68k: Remove inline strcpy() and strcat() implementationsGeert Uytterhoeven3-55/+1
Gcc may replace calls to standard string functions by open code and/or calls to other standard string functions. If the replacement function is not available out-of-line, link errors will happen. To avoid this, the out-of-line versions were provided by arch/m68k/lib/string.c, but they were usually not linked in anymore as typically none of its symbols are referenced by built-in code. However, if any module would need them, they would not be available. Hence remove the inline strcpy() and strcat() implementations, remove arch/m68k/lib/string.c, and let the generic string library code handle it. Impact on a typical kernel build seems minimal or nonexistent: - .text : 0x00001000 - 0x002aac74 (2728 KiB) - .data : 0x002ada48 - 0x00392148 ( 914 KiB) + .text : 0x00001000 - 0x002aacf4 (2728 KiB) + .data : 0x002adac8 - 0x00392148 ( 914 KiB) See also commit e00c73ee05dc38ecaccced55d4f5fc58b0b769f7 ("m68k: Remove inline strlen() implementation"). Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2013-06-14m68k/PCI: Remove redundant call of pci_bus_add_devices()Jiang Liu1-1/+0
pci_scan_bus() has called pci_bus_add_devices() already, so remove the redundant call of pci_bus_add_devices(). subsys_init() callbacks will be invoked before device_init() callbacks, so it should be safe to remove the redundant calls. [bhelgaas: split unicore32 into a separate patch] Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Greg Ungerer <gerg@uclinux.org>
2013-06-08Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommuLinus Torvalds1-1/+2
Pull m68knommu fix from Greg Ungerer: "A single fix for compilation breakage to many of the ColdFire CPU targets" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68k: only use local gpio_request_one if not using GPIOLIB
2013-06-03Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68kLinus Torvalds1-10/+19
Pull m68k fix from Geert Uytterhoeven: "A boot lock-up on Mac, also destined for stable" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k/mac: Fix unexpected interrupt with CONFIG_EARLY_PRINTK
2013-05-31m68k/mac: Fix unexpected interrupt with CONFIG_EARLY_PRINTKFinn Thain1-10/+19
The present code does not wait for the SCC to finish resetting itself before trying to initialise the device. The result is that the SCC interrupt sources become enabled (if they weren't already). This leads to an early boot crash (unexpected interrupt) given CONFIG_EARLY_PRINTK. Fix this by adding a delay. A successful reset disables the interrupt sources. Also, after the reset for channel A setup, the SCC then gets a second reset for channel B setup which leaves channel A uninitialised again. Fix this by performing the reset only once. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Cc: stable@vger.kernel.org Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2013-05-29m68k: only use local gpio_request_one if not using GPIOLIBGreg Ungerer1-1/+2
Compiling for targets that use the local gpio code (not GPIOLIB) fail to compile with: CC arch/m68k/platform/coldfire/device.o In file included from include/linux/gpio.h:45:0, from arch/m68k/platform/coldfire/device.c:15: /home/gerg/new-wave.git/linux-3.x/arch/m68k/include/asm/gpio.h:89:19: error: static declaration of ‘gpio_request_one’ follows non-static declaration include/asm-generic/gpio.h:195:12: note: previous declaration of ‘gpio_request_one’ was here Fix by conditionally using the local gpio_request_one() function based on !CONFIG_GPIOLIB. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
2013-05-28m68k: Update defconfigs for v3.9Geert Uytterhoeven12-698/+1982
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2013-05-21m68k: implement futex.h to support userspace robust futexes and PI mutexesMikael Pettersson2-1/+94
Linux/M68K currently doesn't support robust futexes or PI mutexes. The problem is that the futex code needs to perform certain ops (cmpxchg, set, add, or, andn, xor) atomically on user-space addresses, and M68K's lack of a futex.h causes those operations to be unsupported and disabled. This patch adds that support, but only for uniprocessor machines, which is adequate for M68K. For UP it's enough to disable preemption to ensure mutual exclusion (futexes don't need to care about other hardware agents), and the mandatory pagefault_disable() does just that. This patch is closely based on the one I co-wrote for UP ARM back in August 2008. The main change is that this patch uses the C get_user/put_user accessors instead of inline assembly code with exception table fixups. For non-MMU machines the new futex.h simply redirects to the generic futex.h, so there is no functional change for them. Tested on aranym with the glibc-2.17 test suite: no regressions, and a number of mutex/condvar test cases went from failing to succeeding (tst-mutexpi{5,5a,6,9}, tst-cond2[45], tst-robust[1-9], tst-robustpi[1-8]). Also tested with glibc-2.18 HEAD and a local glibc patch to enable PI mutexes: no regressions. Signed-off-by: Mikael Pettersson <mikpe@it.uu.se> Acked-by: Andreas Schwab <schwab@linux-m68k.org> [geert: Added removal of ""generic-y += futex.h"] Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2013-05-10Merge tag 'for-linus-20130509' of git://git.infradead.org/~dwmw2/random-2.6Linus Torvalds1-17/+0
Pull misc fixes from David Woodhouse: "This is some miscellaneous cleanups that don't really belong anywhere else (or were ignored), that have been sitting in linux-next for some time. Two of them are fixes resulting from my audit of krealloc() usage that don't seem to have elicited any response when I posted them, and the other three are patches from Artem removing dead code." * tag 'for-linus-20130509' of git://git.infradead.org/~dwmw2/random-2.6: pcmcia: remove RPX board stuff m68k: remove rpxlite stuff pcmcia: remove Motorola MBX860 support params: Fix potential memory leak in add_sysfs_param() dell-laptop: Fix krealloc() misuse in parse_da_table()
2013-05-10Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommuLinus Torvalds14-47/+56
Pull m68knommu updates from Greg Ungerer: "The bulk of the changes are generalizing the ColdFire v3 core support and adding in 537x CPU support. Also a couple of other bug fixes, one to fix a reintroduction of a past bug in the romfs filesystem nommu support." * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68knommu: enable Timer on coldfire 532x m68knommu: fix ColdFire 5373/5329 QSPI base address m68knommu: add support for configuring a Freescale M5373EVB board m68knommu: add support for the ColdFire 537x family of CPUs m68knommu: make ColdFire M532x platform support more v3 generic m68knommu: create and use a common M53xx ColdFire class of CPUs m68k: remove unused asm/dbg.h m68k: Set ColdFire ACR1 cache mode depending on kernel configuration romfs: fix nommu map length to keep inside filesystem m68k: clean up unused "config ROMVECSIZE"
2013-05-09Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linuxLinus Torvalds2-5/+1
Pull removal of GENERIC_GPIO from Grant Likely: "GENERIC_GPIO now synonymous with GPIOLIB. There are no longer any valid cases for enableing GENERIC_GPIO without GPIOLIB, even though it is possible to do so which has been causing confusion and breakage. This branch does the work to completely eliminate GENERIC_GPIO." * tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux: gpio: update gpio Chinese documentation Remove GENERIC_GPIO config option Convert selectors of GENERIC_GPIO to GPIOLIB blackfin: force use of gpiolib m68k: coldfire: use gpiolib mips: pnx833x: remove requirement for GENERIC_GPIO openrisc: default GENERIC_GPIO to false avr32: default GENERIC_GPIO to false xtensa: remove explicit selection of GENERIC_GPIO sh: replace CONFIG_GENERIC_GPIO by CONFIG_GPIOLIB powerpc: remove redundant GENERIC_GPIO selection unicore32: default GENERIC_GPIO to false unicore32: remove unneeded select GENERIC_GPIO arm: plat-orion: use GPIO driver on CONFIG_GPIOLIB arm: remove redundant GENERIC_GPIO selection mips: alchemy: require gpiolib mips: txx9: change GENERIC_GPIO to GPIOLIB mips: loongson: use GPIO driver on CONFIG_GPIOLIB mips: remove redundant GENERIC_GPIO select
2013-05-01Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signalLinus Torvalds1-8/+0
Pull compat cleanup from Al Viro: "Mostly about syscall wrappers this time; there will be another pile with patches in the same general area from various people, but I'd rather push those after both that and vfs.git pile are in." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: syscalls.h: slightly reduce the jungles of macros get rid of union semop in sys_semctl(2) arguments make do_mremap() static sparc: no need to sign-extend in sync_file_range() wrapper ppc compat wrappers for add_key(2) and request_key(2) are pointless x86: trim sys_ia32.h x86: sys32_kill and sys32_mprotect are pointless get rid of compat_sys_semctl() and friends in case of ARCH_WANT_OLD_COMPAT_IPC merge compat sys_ipc instances consolidate compat lookup_dcookie() convert vmsplice to COMPAT_SYSCALL_DEFINE switch getrusage() to COMPAT_SYSCALL_DEFINE switch epoll_pwait to COMPAT_SYSCALL_DEFINE convert sendfile{,64} to COMPAT_SYSCALL_DEFINE switch signalfd{,4}() to COMPAT_SYSCALL_DEFINE make SYSCALL_DEFINE<n>-generated wrappers do asmlinkage_protect make HAVE_SYSCALL_WRAPPERS unconditional consolidate cond_syscall and SYSCALL_ALIAS declarations teach SYSCALL_DEFINE<n> how to deal with long long/unsigned long long get rid of duplicate logics in __SC_....[1-6] definitions
2013-04-30dump_stack: consolidate dump_stack() implementations and unify their behaviorsTejun Heo1-12/+0
Both dump_stack() and show_stack() are currently implemented by each architecture. show_stack(NULL, NULL) dumps the backtrace for the current task as does dump_stack(). On some archs, dump_stack() prints extra information - pid, utsname and so on - in addition to the backtrace while the two are identical on other archs. The usages in arch-independent code of the two functions indicate show_stack(NULL, NULL) should print out bare backtrace while dump_stack() is used for debugging purposes when something went wrong, so it does make sense to print additional information on the task which triggered dump_stack(). There's no reason to require archs to implement two separate but mostly identical functions. It leads to unnecessary subtle information. This patch expands the dummy fallback dump_stack() implementation in lib/dump_stack.c such that it prints out debug information (taken from x86) and invokes show_stack(NULL, NULL) and drops arch-specific dump_stack() implementations in all archs except blackfin. Blackfin's dump_stack() does something wonky that I don't understand. Debug information can be printed separately by calling dump_stack_print_info() so that arch-specific dump_stack() implementation can still emit the same debug information. This is used in blackfin. This patch brings the following behavior changes. * On some archs, an extra level in backtrace for show_stack() could be printed. This is because the top frame was determined in dump_stack() on those archs while generic dump_stack() can't do that reliably. It can be compensated by inlining dump_stack() but not sure whether that'd be necessary. * Most archs didn't use to print debug info on dump_stack(). They do now. An example WARN dump follows. WARNING: at kernel/workqueue.c:4841 init_workqueues+0x35/0x505() Hardware name: empty Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.9.0-rc1-work+ #9 0000000000000009 ffff88007c861e08 ffffffff81c614dc ffff88007c861e48 ffffffff8108f50f ffffffff82228240 0000000000000040 ffffffff8234a03c 0000000000000000 0000000000000000 0000000000000000 ffff88007c861e58 Call Trace: [<ffffffff81c614dc>] dump_stack+0x19/0x1b [<ffffffff8108f50f>] warn_slowpath_common+0x7f/0xc0 [<ffffffff8108f56a>] warn_slowpath_null+0x1a/0x20 [<ffffffff8234a071>] init_workqueues+0x35/0x505 ... v2: CPU number added to the generic debug info as requested by s390 folks and dropped the s390 specific dump_stack(). This loses %ksp from the debug message which the maintainers think isn't important enough to keep the s390-specific dump_stack() implementation. dump_stack_print_info() is moved to kernel/printk.c from lib/dump_stack.c. Because linkage is per objecct file, dump_stack_print_info() living in the same lib file as generic dump_stack() means that archs which implement custom dump_stack() - at this point, only blackfin - can't use dump_stack_print_info() as that will bring in the generic version of dump_stack() too. v1 The v1 patch broke build on blackfin due to this issue. The build breakage was reported by Fengguang Wu. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Vineet Gupta <vgupta@synopsys.com> Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> Acked-by: Vineet Gupta <vgupta@synopsys.com> Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> [s390 bits] Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Fengguang Wu <fengguang.wu@intel.com> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Sam Ravnborg <sam@ravnborg.org> Acked-by: Richard Kuo <rkuo@codeaurora.org> [hexagon bits] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-04-30Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68kLinus Torvalds14-24/+717
Pull m68k update from Geert Uytterhoeven. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: Remove inline strlen() implementation m68k/atari: USB - add platform devices for EtherNAT/NetUSBee ISP1160 HCD m68k: Implement ndelay() based on the existing udelay() logic m68k/atari: EtherNAT - add interrupt chip definition for CPLD interrupts m68k/atari: EtherNEC - add platform device support m68k/atari: EtherNAT - platform device and IRQ support code m68k/atari: use dedicated irq_chip for timer D interrupts m68k/atari: ROM port ISA adapter support m68k: Add missing cmpxchg64() if CONFIG_RMW_INSNS=y
2013-04-30Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tipLinus Torvalds1-28/+4
Pull SMP/hotplug changes from Ingo Molnar: "This is a pretty large, multi-arch series unifying and generalizing the various disjunct pieces of idle routines that architectures have historically copied from each other and have grown in random, wildly inconsistent and sometimes buggy directions: 101 files changed, 455 insertions(+), 1328 deletions(-) this went through a number of review and test iterations before it was committed, it was tested on various architectures, was exposed to linux-next for quite some time - nevertheless it might cause problems on architectures that don't read the mailing lists and don't regularly test linux-next. This cat herding excercise was motivated by the -rt kernel, and was brought to you by Thomas "the Whip" Gleixner." * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (40 commits) idle: Remove GENERIC_IDLE_LOOP config switch um: Use generic idle loop ia64: Make sure interrupts enabled when we "safe_halt()" sparc: Use generic idle loop idle: Remove unused ARCH_HAS_DEFAULT_IDLE bfin: Fix typo in arch_cpu_idle() xtensa: Use generic idle loop x86: Use generic idle loop unicore: Use generic idle loop tile: Use generic idle loop tile: Enter idle with preemption disabled sh: Use generic idle loop score: Use generic idle loop s390: Use generic idle loop powerpc: Use generic idle loop parisc: Use generic idle loop openrisc: Use generic idle loop mn10300: Use generic idle loop mips: Use generic idle loop microblaze: Use generic idle loop ...
2013-04-29mm/m68k: use common help functions to free reserved pagesJiang Liu1-22/+2
Use common help functions to free reserved pages. Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-04-29m68knommu: enable Timer on coldfire 532xGreg Ungerer1-3/+2
This patch enables the initial Timer on coldfire 532x systems. Without this, the scheduler will not be triggered and the system hangs, after all sequential code is executed. It should also apply on later kernel versions. Signed-off-by: Christian Gieseler <christiangieseler@yahoo.de> Signed-off-by: Greg Ungerer <gerg@uclinux.org>
2013-04-29m68knommu: fix ColdFire 5373/5329 QSPI base addressGreg Ungerer1-1/+1
The base address of the QSPI hardware module should be 0xFC05C000. Fix its definition. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
2013-04-29m68knommu: add support for configuring a Freescale M5373EVB boardGreg Ungerer1-0/+7
Add a configuration switch for supporting the Freescale M5373EVB board. It is based on the newly added ColdFire 537x CPU support. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
2013-04-29m68knommu: add support for the ColdFire 537x family of CPUsGreg Ungerer2-0/+9
The ColdFire 537x family is very similar internally to the ColdFire 532x family. So with just a little extra configuration we can configure and target them as well. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
2013-04-29m68knommu: make ColdFire M532x platform support more v3 genericGreg Ungerer2-10/+10
The M532x CPU platform support can be used on more ColdFire CPU families than just the 532x types. So rename and reconfigure it to reflect that. The ColdFire 537x family has virtualy identical internals to the 532x, and so it will be able to share this code when we add support for them. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
2013-04-29m68knommu: create and use a common M53xx ColdFire class of CPUsGreg Ungerer8-17/+21
The current CONFIG_M532x support definitions are actually common to a larger set of version 3 ColdFire CPU types. In the future we want to add support for the 537x family. It is very similar to the 532x internally, and will be able to use most of the same definitions. Create a CONFIG_M53xx option that is enabled to support any of the common 532x and 537x CPU types. Convert the current users of CONFIG_M532x to use CONFIG_M53xx instead. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
2013-04-29m68k: remove unused asm/dbg.hGreg Ungerer1-6/+0
The contents of the m68k asm/dbg.h are never used, remove the file and remove the one reference to it. Signed-off-by: Greg Ungerer <gerg@uclinux.org> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
2013-04-29m68k: Set ColdFire ACR1 cache mode depending on kernel configurationStany MARCEL1-1/+6
For coldfire with MMU enabled, data cache did not follow the configuration but was configured in writethrough mode. Signed-off-by: Stany MARCEL <stany.marcel@novasys-ingenierie.com> Signed-off-by: Greg Ungerer <gerg@uclinux.org>
2013-04-29m68k: clean up unused "config ROMVECSIZE"Paul Bolle1-9/+0
Kconfig symbol ROMVECSIZE is unused since commit f84f52a5c15db7d14a534815f27253b001735183 ("m68knommu: clean up linker script"). Let's clean up its Kconfig entry too. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Greg Ungerer <gerg@uclinux.org>
2013-04-17idle: Remove GENERIC_IDLE_LOOP config switchThomas Gleixner1-1/+0
All archs are converted over. Remove the config switch and the fallback code. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2013-04-16m68k: Remove inline strlen() implementationMichal Marek2-15/+1
GCC can replace a strncat() call with constant second argument into a strlen + store, which results in a link error: ERROR: "strlen" [net/ipv4/ip_tunnel.ko] undefined! The inline function is a simple for loop in C. Other architectures either use an asm optimized variant, or use the generic function from lib/string.c. Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Michal Marek <mmarek@suse.cz> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2013-04-16m68k/atari: USB - add platform devices for EtherNAT/NetUSBee ISP1160 HCDMichael Schmitz1-6/+129
Add platform devices used by the isp116x-hcd driver for EtherNAT and NetUSBee. Note that the NetUSBee also contains a RTL8019 Ethernet chip, so its platform device is used to cover the EtherNEC case, too. Register definitions thanks to David Galvez <dgalvez75@gmail.com> [Geert] Conditionalize isp1160_delay() definition Signed-off-by: Michael Schmitz <schmitz@debian.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2013-04-16m68k: Implement ndelay() based on the existing udelay() logicMichael Schmitz1-0/+23
Add a ndelay macro modeled after the Coldfire udelay(). The ISP1160 driver needs a 150ns delay, so we need to have ndelay(). Signed-off-by: Michael Schmitz <schmitz@debian.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>