aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2009-01-07kbuild: add a symlink to the source for separate objdirsAndi Kleen1-0/+1
I have some scripts which need to map back to the source directory from an objdir. This was so far done by parsing the Makefile, but the Makefile format changes occasionally and breaks my scripts then. To make this more reliable add a "source" symlink back. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-01-07kconfig: add script to manipulate .config files on the command lineAndi Kleen1-0/+150
I often change single options in .config files. Instead of using an editor or one of the frontends it's convenient to do this from the command line. It's also useful to do from automated build scripts when building different variants from a base config file. I extracted most of the CONFIG manipulation code from one of my build scripts into a new shell script scripts/config The script is not integrated with the normal Kconfig machinery and doesn't do any checking against Kconfig files, but just manipulates that text format. This is always done at make time anyways. I believe this script would be a useful standard addition for scripts/* Sample usage: ./scripts/config --disable smp Disable SMP in .config file ./scripts/config --file otherdir/.config --module e1000e Enable E1000E as module in otherdir/.config ./scripts/config --state smp y Check state of config option CONFIG_SMP After merging into git please make scripts/config executable Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-01-07kbuild: reintroduce ALLSOURCE_ARCHS support for tags/cscopeJike Song2-5/+20
This patch reintroduce the ALLSOURCE_ARCHS support for tags/TAGS/ cscope targets. The Kbuild previously has this feature, but after moving the targets into scripts/tags.sh, ALLSOURCE_ARCHS disappears. It's something like this: $ make ALLSOURCE_ARCHS="x86 mips arm" tags cscope Signed-off-by: Jike Song <albcamus@gmail.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-01-07bootchart: improve output based on Dave Jones' feedbackArjan van de Ven1-5/+11
Dave Jones, in his blog, had some feedback about the bootchart script: Primarily his complaint was that shorter delays weren't visualized. The reason for that was that too small delays will have their labels mixed up in the graph in an unreadable mess. This patch has a fix for this; for one, it makes the output wider, so more will fit. The second part is that smaller delays are now shown with a much smaller font for the label; while this isn't per se readable at a 1:1 zoom, at least you can zoom in with most SVG viewing applications and see what it is you are looking at. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-01-07fix modules_install via NFSSam Ravnborg5-8/+7
Rafael reported: I get the following error from 'make modules_install' on my test boxes: HOSTCC firmware/ihex2fw /home/rafael/src/linux-2.6/firmware/ihex2fw.c:268: fatal error: opening dependency file firmware/.ihex2fw.d: Read-only file system compilation terminated. make[3]: *** [firmware/ihex2fw] Error 1 make[2]: *** [_modinst_post] Error 2 make[1]: *** [sub-make] Error 2 make: *** [all] Error 2 where the configuration is that the kernel is compiled on a build box with 'make O=<destdir> -j5' and then <destdir> is mounted over NFS read-only by each test box (full path to this directory is the same on the build box and on the test boxes). Then, I cd into <destdir>, run 'make modules_install' and get the error above. The issue turns out to be that we when we install firmware pick up the list of firmware blobs from firmware/Makefile. And this triggers the Makefile rules to update ihex2fw. There were two solutions for this issue: 1) Move the list of firmware blobs to a separate file 2) Avoid ihex2fw rebuild by moving it to scripts As I seriously beleive that the list of firmware blobs should be done in a fundamental different way solution 2) was selected. Reported-and-tested-by: "Rafael J. Wysocki" <rjw@sisk.pl> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: David Woodhouse <dwmw2@infradead.org>
2009-01-07qnx: include <linux/types.h> for definitions of __[us]{8,16,32,64} typesAnders Larsen2-6/+3
On 2008-12-30 11:32:33, Sam Ravnborg wrote: > We have added a few additional validation checks of the userspace headers: ... > 3) We should include <linux/types.h> and not <asm/types.h> > 4) If we use a __[us]{8,16,32,64} type then we must include <linux/types.h> Satisfy these requirements for the linux/qnx*.h headers. Signed-off-by: Anders Larsen <al@alarsen.net> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-01-06Fix up 64-bit byte swaps for most 32-bit architecturesLinus Torvalds1-1/+1
The __SWAB_64_THRU_32__ case of a 64-bit byte swap was depending on the no-longer-existant ___swab32() method (three underscores). We got rid of some of the worst indirection and complexity, and now it should just use the 32-bit swab function that was defined right above it. Reported-and-tested-by: Nicolas Pitre <nico@cam.org> Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06byteorder: remove the now unused byteorder.hHarvey Harrison2-373/+0
This implementation caused problems in userspace which can, and does define _both_ __LITTLE_ENDIAN and __BIG_ENDIAN. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06mn10300: introduce asm/swab.hHarvey Harrison3-40/+44
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06frv: introduce asm/swab.hHarvey Harrison3-7/+12
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06m32r: introduce asm/swab.hHarvey Harrison3-6/+12
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06m68knommu: introduce asm/swab.hHarvey Harrison3-21/+27
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06h8300: introduce asm/swab.hHarvey Harrison3-7/+12
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06ia64: introduce asm/swab.hHarvey Harrison3-36/+36
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06blackfin: introduce asm/swab.hHarvey Harrison3-42/+50
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06arm: introduce asm/swab.hHarvey Harrison3-32/+52
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06alpha: introduce asm/swab.hHarvey Harrison3-41/+44
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06m68k: introduce asm/swab.hHarvey Harrison3-14/+19
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06x86: introduce asm/swab.hHarvey Harrison3-60/+64
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06sparc: introduce asm/swab.hHarvey Harrison3-44/+48
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06sh: introduce asm/swab.hHarvey Harrison3-59/+64
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06s390: introduce asm/swab.hHarvey Harrison3-90/+94
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06powerpc: introduce asm/swab.hHarvey Harrison3-81/+93
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06mips: introduce asm/swab.hHarvey Harrison3-49/+59
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06avr32: introduce asm/swab.hHarvey Harrison3-29/+38
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06byteorder: only use linux/swab.hHarvey Harrison6-388/+27
The first step to make swab.h a regular header that will include an asm/swab.h with arch overrides. Avoid the gratuitous differences introduced in the new linux/swab.h by naming the ___constant_swabXX bits and __fswabXX bits exactly as found in the old implementation in byteorder/swab[b].h Use this new swab.h in byteorder/[big|little]_endian.h and remove the two old swab headers. Although the inclusion of asm/byteorder.h looks strange in linux/swab.h, this will allow each arch to move the actual arch overrides for the swab bits in an asm file and then the includes can be cleaned up without requiring a flag day for all arches at once. Keep providing __fswabXX in case some userspace was using them directly, but the revised __swabXX should be used instead in any new code and will always do constant folding not dependent on the optimization level, which means the __constant versions can be phased out in-kernel. Arches that use the old-style arch macros will lose their optimized versions until they move to the new style, but at least they will still compile. Many arches have already moved and the patches to move the remaining arches are trivial. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06Merge branch 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6Linus Torvalds10-39/+397
* 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: drm: fix ordering of driver unload vs agp unload. drm/i915: Respect the other stolen memory sizes we know of. drm/i915: Non-mobile parts don't have integrated TV-out. drm/i915: Add support for integrated HDMI on G4X hardware. drm/i915: Pin cursor bo and unpin old bo when setting cursor. drm/i915: Don't allow objects to get bound while VT switched.
2009-01-07drm: fix ordering of driver unload vs agp unload.Dave Airlie1-3/+3
For KMS drivers, we really need to cleanup the driver before disabling the AGP subsystem. Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-01-07drm/i915: Respect the other stolen memory sizes we know of.Eric Anholt2-14/+40
fd.o bug #19336. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-01-07drm/i915: Non-mobile parts don't have integrated TV-out.Eric Anholt1-1/+1
Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-01-07drm/i915: Add support for integrated HDMI on G4X hardware.Eric Anholt7-7/+322
This is ported directly from the userland 2D driver code. The HDMI audio bits aren't hooked up yet. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-01-07drm/i915: Pin cursor bo and unpin old bo when setting cursor.Kristian Høgsberg2-8/+22
We also didn't track the cursor bo before and would leak a reference when the cursor image was change. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-01-07drm/i915: Don't allow objects to get bound while VT switched.Eric Anholt1-6/+9
This avoids a BUG_ON in the enter_vt path due to objects being in the GTT when we shouldn't have ever let them be (as we're not supposed to touch the device during that time). This was triggered by a change in the 2D driver to use the GTT mapping of objects after pinning them to improve software fallback performance. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-01-06Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds54-522/+3105
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (29 commits) Input: i8042 - add Dell Vostro 1510 to nomux list Input: gtco - use USB endpoint API Input: add support for Maple controller as a joystick Input: atkbd - broaden the Dell DMI signatures Input: HIL drivers - add MODULE_ALIAS() Input: map_to_7segment.h - convert to __inline__ for userspace Input: add support for enhanced rotary controller on pxa930 and pxa935 Input: add support for trackball on pxa930 and pxa935 Input: add da9034 touchscreen support Input: ads7846 - strict_strtoul takes unsigned long Input: make some variables and functions static Input: add tsc2007 based touchscreen driver Input: psmouse - add module parameters to control OLPC touchpad delays Input: i8042 - add Gigabyte M912 netbook to noloop exception table Input: atkbd - Samsung NC10 key repeat fix Input: atkbd - add keyboard quirk for HP Pavilion ZV6100 laptop Input: libps2 - handle 0xfc responses from devices Input: add support for Wacom W8001 penabled serial touchscreen Input: synaptics - report multi-taps only if supported by the device Input: add joystick driver for Walkera WK-0701 RC transmitter ...
2009-01-06Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6Linus Torvalds26-423/+1229
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: CRED: Fix regression in cap_capable() as shown up by sys_faccessat() [ver #3] Revert "CRED: Fix regression in cap_capable() as shown up by sys_faccessat() [ver #2]" SELinux: shrink sizeof av_inhert selinux_class_perm and context CRED: Fix regression in cap_capable() as shown up by sys_faccessat() [ver #2] keys: fix sparse warning by adding __user annotation to cast smack: Add support for unlabeled network hosts and networks selinux: Deprecate and schedule the removal of the the compat_net functionality netlabel: Update kernel configuration API
2009-01-06Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tipLinus Torvalds2-73/+72
* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: hrtimer: splitout peek ahead functionality, fix hrtimer: fixup comments hrtimer: fix recursion deadlock by re-introducing the softirq hrtimer: simplify hotplug migration hrtimer: fix HOTPLUG_CPU=n compile warning hrtimer: splitout peek ahead functionality
2009-01-06Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tipLinus Torvalds8-37/+35
* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: sched: fix section mismatch sched: fix double kfree in failure path sched: clean up arch_reinit_sched_domains() sched: mark sched_create_sysfs_power_savings_entries() as __init getrusage: RUSAGE_THREAD should return ru_utime and ru_stime sched: fix sched_slice() sched_clock: prevent scd->clock from moving backwards, take #2 sched: sched.c declare variables before they get used
2009-01-06Merge branch 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tipLinus Torvalds1-1/+6
* 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: genirq: provide irq_to_desc() to non-genirq architectures too
2009-01-06Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tipLinus Torvalds15-301/+195
* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: rcu: fix rcutorture bug rcu: eliminate synchronize_rcu_xxx macro rcu: make treercu safe for suspend and resume rcu: fix rcutree grace-period-latency bug on small systems futex: catch certain assymetric (get|put)_futex_key calls futex: make futex_(get|put)_key() calls symmetric locking, percpu counters: introduce separate lock classes swiotlb: clean up EXPORT_SYMBOL usage swiotlb: remove unnecessary declaration swiotlb: replace architecture-specific swiotlb.h with linux/swiotlb.h swiotlb: add support for systems with highmem swiotlb: store phys address in io_tlb_orig_addr array swiotlb: add hwdev to swiotlb_phys_to_bus() / swiotlb_sg_to_bus()
2009-01-06Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6Linus Torvalds11-85/+464
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: ASoC: Fix SND_SOC_ALL_CODECS handling of dual SPI and I2C control buses ASoC: Use snd_soc_dapm_nc_pin() in at91sam9g20ek ASoC: TWL4030: Convert the bitfield enums to VALUE_ENUM type ASoC: New enum type: value_enum pxa2xx-ac97: switch AC unit to correct state before probing ASoC: Clocking fixes for davinci-evm.c ASoC: Mark non-connected TWL4030 pins for pandora ASoC: OMAP: Select OMAP pin multiplexing when using Nokia N810 ASoC drivers
2009-01-06Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6Linus Torvalds778-26439/+472655
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (237 commits) Staging: android: binder: fix build errors Staging: android: add lowmemorykiller driver Staging: android: remove dummy android.c driver Staging: android: timed_gpio: Rename android_timed_gpio to timed_gpio Staging: android: add timed_gpio driver Staging: android: add ram_console driver Staging: android: add logging driver staging: android: binder: Fix use of euid Staging: android: binder: Fix gcc warnings about improper format specifiers for size_t in printk Staging: android: add binder driver Staging: add android framework Staging: epl: fix netdev->priv b0rkage Staging: epl: hr timers all run in hard irq context now Staging: epl: run Lindent on *.c files Staging: epl: run Lindent on *.h files Staging: epl: run Lindent on all user/*.h files Staging: epl: run Lindent on all kernel/*.h files Staging: add epl stack Staging: frontier: fix compiler warnings Staging: frontier: remove unused alphatrack_sysfs.c file ...
2009-01-06Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6Linus Torvalds129-701/+1063
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (60 commits) uio: make uio_info's name and version const UIO: Documentation for UIO ioport info handling UIO: Pass information about ioports to userspace (V2) UIO: uio_pdrv_genirq: allow custom irq_flags UIO: use pci_ioremap_bar() in drivers/uio arm: struct device - replace bus_id with dev_name(), dev_set_name() libata: struct device - replace bus_id with dev_name(), dev_set_name() avr: struct device - replace bus_id with dev_name(), dev_set_name() block: struct device - replace bus_id with dev_name(), dev_set_name() chris: struct device - replace bus_id with dev_name(), dev_set_name() dmi: struct device - replace bus_id with dev_name(), dev_set_name() gadget: struct device - replace bus_id with dev_name(), dev_set_name() gpio: struct device - replace bus_id with dev_name(), dev_set_name() gpu: struct device - replace bus_id with dev_name(), dev_set_name() hwmon: struct device - replace bus_id with dev_name(), dev_set_name() i2o: struct device - replace bus_id with dev_name(), dev_set_name() IA64: struct device - replace bus_id with dev_name(), dev_set_name() i7300_idle: struct device - replace bus_id with dev_name(), dev_set_name() infiniband: struct device - replace bus_id with dev_name(), dev_set_name() ISDN: struct device - replace bus_id with dev_name(), dev_set_name() ...
2009-01-06Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuseLinus Torvalds8-202/+783
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: fuse: clean up annotations of fc->lock fuse: fix sparse warning in ioctl fuse: update interface version fuse: add fuse_conn->release() fuse: separate out fuse_conn_init() from new_conn() fuse: add fuse_ prefix to several functions fuse: implement poll support fuse: implement unsolicited notification fuse: add file kernel handle fuse: implement ioctl support fuse: don't let fuse_req->end() put the base reference fuse: move FUSE_MINOR to miscdevice.h fuse: style fixes
2009-01-06Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6Linus Torvalds64-1184/+1036
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (41 commits) scc_pata: make use of scc_dma_sff_read_status() ide-dma-sff: factor out ide_dma_sff_write_status() ide: move read_sff_dma_status() method to 'struct ide_dma_ops' ide: don't set hwif->dma_ops in init_dma() method Resurrect IT8172 IDE controller driver piix: sync ich_laptop[] with ata_piix.c ide: update warm-plug HOWTO ide: fix ide_port_scan() to do ACPI setup after initializing request queues ide: remove now redundant ->cur_dev checks ide: remove unused ide_hwif_t.sg_mapped field ide: struct ide_atapi_pc - remove unused fields and update documentation ide: remove superfluous hwif variable assignment from ide_timer_expiry() ide: use ide_pci_is_in_compatibility_mode() helper in setup-pci.c ide: make "paranoia" ->handler check in ide_intr() more strict ide-cd: convert to ide-atapi facilities ide-cd: start DMA before sending the actual packet command ide-cd: wait for DRQ to get set per default ide: Fix drive's DWORD-IO handling ide: add port and host iterators ide: dynamic allocation of device structures ...
2009-01-06parport: ieee1284: use del_timer_sync() in parport_wait_event()Michael Buesch1-1/+1
Use del_timer_sync() instead of del_timer() to make sure the timer won't be running when we return from parport_wait_event(), because this would crash due to destruction of timer_list. This is untested and just based on a code review. Just think about the following sequence of events: - add_timer() - down_interruptible() is interrupted by a signal. - we enter the timer callback handler on another CPU. - del_timer(), but the timer callback is still running. - eturn from parport_wait_even, which destroys the automatic variable "timer" while the callback is running on another CPU. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06bfs: check that filesystem fits on the blockdeviceEric Sesterhenn1-0/+12
Since all sanity checks rely on the validity of s_start which gets only checked to be smaller than s_end, we should also check if s_end is sane. Now we also try to retrieve the last block of the filesystem, which is computed by s_end. If this fails, something is bogus. Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Acked-by: Tigran Aivazian <tigran@aivazian.fsnet.co.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06bfs: add some basic sanity checksEric Sesterhenn1-0/+33
bfs_fill_super() already touches all inodes, so we can easily add some cheap sanity checks and check if the inode start and end blocks are smaller than the maximum number of blocks, the inode start block lies behind the end block or the file end offset is behind the end of the filesystem. Also check if the start of data offset in the super block fits the filesystem. The added sanity checks catch softlockup issues early when we try to sb_bread() lots of blocks in a loop in bfs_readdir() and bfs_find_entry(). In addition an oom issue in bfs_fill_super() is prevented by this when s_start is corrupted, which influences imap_len and we try to allocate a huge info->si_imap. Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Acked-by: Tigran Aivazian <tigran@aivazian.fsnet.co.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06dma-coherent: catch oversized requests to dma_alloc_from_coherent()Johannes Weiner1-0/+2
Prevent passing an order to bitmap_find_free_region() that is larger than the actual bitmap can represent. These requests can come from device drivers that have no idea how big the dma region is and need to rely on dma_alloc_from_coherent() to sort it out for them. Reported-by: Guennadi Liakhovetski <lg@denx.de> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Dmitry Baryshkov <dbaryshkov@gmail.com> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06dma_alloc_coherent: clean it upAndrew Morton1-25/+29
This thing was rather stupidly coded. Rework it all prior to making changes. Also, rename local variable `page': kernel readers expect something called `page' to have type `struct page *'. Cc: Guennadi Liakhovetski <lg@denx.de> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Dmitry Baryshkov <dbaryshkov@gmail.com> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06dma_alloc_from_coherent(): fix fallback to generic memoryAndrew Morton1-1/+15
If bitmap_find_free_region() fails and DMA_MEMORY_EXCLUSIVE is not set, the function will fail to write anything to *ret and will return 1. This will cause dma_alloc_coherent() to return an uninitialised value, crashing the kernel, perhaps via DMA to a random address. Fix that by changing it to return zero in this case, so the caller will proceed to allocate the memory from the generic memory allocator. Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> Cc: Dmitry Baryshkov <dbaryshkov@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>