22 Sep, 2009
2 commits
-
Recently we encountered OOM problems due to memory use of the GEM cache.
Generally a large amuont of Shmem/Tmpfs pages tend to create a memory
shortage problem.We often use the following calculation to determine the amount of shmem
pages:shmem = NR_ACTIVE_ANON + NR_INACTIVE_ANON - NR_ANON_PAGES
however the expression does not consider isolated and mlocked pages.
This patch adds explicit accounting for pages used by shmem and tmpfs.
Signed-off-by: KOSAKI Motohiro
Acked-by: Rik van Riel
Reviewed-by: Christoph Lameter
Acked-by: Wu Fengguang
Cc: David Rientjes
Cc: Hugh Dickins
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The amount of memory allocated to kernel stacks can become significant and
cause OOM conditions. However, we do not display the amount of memory
consumed by stacks.Add code to display the amount of memory used for stacks in /proc/meminfo.
Signed-off-by: KOSAKI Motohiro
Reviewed-by: Christoph Lameter
Reviewed-by: Minchan Kim
Reviewed-by: Rik van Riel
Cc: David Rientjes
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
20 Sep, 2009
1 commit
-
This allows subsytems to provide devtmpfs with non-default permissions
for the device node. Instead of the default mode of 0600, null, zero,
random, urandom, full, tty, ptmx now have a mode of 0666, which allows
non-privileged processes to access standard device nodes in case no
other userspace process applies the expected permissions.This also fixes a wrong assignment in pktcdvd and a checkpatch.pl complain.
Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
16 Sep, 2009
7 commits
-
Devtmpfs lets the kernel create a tmpfs instance called devtmpfs
very early at kernel initialization, before any driver-core device
is registered. Every device with a major/minor will provide a
device node in devtmpfs.Devtmpfs can be changed and altered by userspace at any time,
and in any way needed - just like today's udev-mounted tmpfs.
Unmodified udev versions will run just fine on top of it, and will
recognize an already existing kernel-created device node and use it.
The default node permissions are root:root 0600. Proper permissions
and user/group ownership, meaningful symlinks, all other policy still
needs to be applied by userspace.If a node is created by devtmps, devtmpfs will remove the device node
when the device goes away. If the device node was created by
userspace, or the devtmpfs created node was replaced by userspace, it
will no longer be removed by devtmpfs.If it is requested to auto-mount it, it makes init=/bin/sh work
without any further userspace support. /dev will be fully populated
and dynamic, and always reflect the current device state of the kernel.
With the commonly used dynamic device numbers, it solves the problem
where static devices nodes may point to the wrong devices.It is intended to make the initial bootup logic simpler and more robust,
by de-coupling the creation of the inital environment, to reliably run
userspace processes, from a complex userspace bootstrap logic to provide
a working /dev.Signed-off-by: Kay Sievers
Signed-off-by: Jan Blunck
Tested-By: Harald Hoyer
Tested-By: Scott James Remnant
Signed-off-by: Greg Kroah-Hartman -
Instead of open-coding it.
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman -
When turning class devices into bus devices, we may need to
temporarily add links in sysfs so that user-space applications
are not confused. This is done by adding the following API:* Functions to register and unregister compatibility classes.
These appear in sysfs at the same location as regular classes, but
instead of class devices, they contain links to bus devices.
* Functions to create and delete such links. Additionally, the caller
can optionally pass a target device to which a "device" link should
point (typically that would be the device's parent), to fully emulate
the original class device.The i2c subsystem will be the first user of this API, as i2c adapters
are being converted from class devices to bus devices.Signed-off-by: Jean Delvare
Signed-off-by: Kay Sievers -
Placing dma-coherent.c in driver/base is better than in kernel,
since it contains code to do per-device coherent dma memory
handling.Signed-off-by: Ming Lei
Signed-off-by: Greg Kroah-Hartman -
Let attribute group vectors be declared "const". We'd
like to let most attribute metadata live in read-only
sections... this is a start.Signed-off-by: David Brownell
Signed-off-by: Greg Kroah-Hartman -
No one should directly access the driver_data field, so remove the field
and make it private. We dynamically create the private field now if it
is needed, to handle drivers that call get/set before they are
registered with the driver core.Also update the copyright notices on these files while we are there.
Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
This patch (as1271) affects when new devices get linked into their
bus's list of devices. Currently this happens after probing, and it
doesn't happen at all if probing fails. Clearly this is wrong,
because at that point quite a few symbolic links have already been
created in sysfs. We are committed to adding the device, so it should
be linked into the bus's list regardless.In addition, this needs to happen before the uevent announcing the new
device gets issued. Otherwise user programs might try to access the
device before it has been added to the bus.To fix both these problems, the patch moves the call to
klist_add_tail() forward from bus_attach_device() to bus_add_device().
Since bus_attach_device() now does nothing but probe for drivers, it
has been renamed to bus_probe_device(). And lastly, the kerneldoc is
updated.Signed-off-by: Alan Stern
CC: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
15 Sep, 2009
2 commits
-
transition_started should be set once the preparation of devices for
a PM has started, reset before starting to resume devices. When
resuming devices, kernel calls dpm_resume_noirq then
dpm_resume_end(dpm_resume). Thus we should reset transition_started
at dpm_resume_noirq.This patch fixes ACPI warning when resuming from suspend/hibernate:
ACPI: \_SB_.PCI0.IDE1.PRI1.MAS1 - docking
------------[ cut here ]------------
WARNING: at drivers/base/power/main.c:87 device_pm_add+0x8b/0xcc()
Hardware name: OptiPlex 760
Device: acpi
Parentless device registered during a PM transaction[rjw: Fixed up the changelog.]
Signed-off-by: Xiaotian Feng
Signed-off-by: Rafael J. Wysocki -
The kerneldoc comments in drivers/base/power/main.c are generally
outdated and some of them don't describe the functions very
accurately. Update them and standardize the format to use spaces
instead of tabs.Signed-off-by: Rafael J. Wysocki
Acked-by: Randy Dunlap
Acked-by: Greg Kroah-Hartman
Acked-by: Alan Stern
23 Aug, 2009
2 commits
-
This patch adds default Runtime PM callbacks to the dev_pm_ops
belonging to the platform bus. The callbacks are weak symbols
that architecture specific code can override.Allows Runtime PM even though CONFIG_PM_SLEEP=n.
Signed-off-by: Magnus Damm
Acked-by: Greg Kroah-Hartman
Signed-off-by: Rafael J. Wysocki -
Introduce a core framework for run-time power management of I/O
devices. Add device run-time PM fields to 'struct dev_pm_info'
and device run-time PM callbacks to 'struct dev_pm_ops'. Introduce
a run-time PM workqueue and define some device run-time PM helper
functions at the core level. Document all these things.Special thanks to Alan Stern for his help with the design and
multiple detailed reviews of the pereceding versions of this patch
and to Magnus Damm for testing feedback.Signed-off-by: Rafael J. Wysocki
Acked-by: Magnus Damm
16 Aug, 2009
1 commit
11 Aug, 2009
1 commit
-
Commit 783ea7d4eeefe895f2731fe73ac951e94418927b
(Driver Core: Rework platform suspend/resume, print warning)
added a warning message printed for platform drivers that use the
legacy PM callbacks rather than struct dev_pm_ops. Unfortunately,
this resulted in some confusion and made some people try to convert
drivers by replacing the old callbacks with struct dev_pm_ops in
automatic way, which generally is not a good idea.Remove the platform device runtime dev_pm_ops warning for now,
because it's annoying to users and it's not really necessary right
now.[rjw: Modified the changelog to be more informative.]
Signed-off-by: Magnus Damm
Acked-by: Greg Kroah-Hartman
Signed-off-by: Rafael J. Wysocki
31 Jul, 2009
1 commit
29 Jul, 2009
2 commits
-
If kobject_init_and_add fails, sysdev_register should not send KOBJ_ADD
uevent to userspace.Signed-off-by: Xiaotian Feng
Signed-off-by: Greg Kroah-Hartman -
The page pointers array is allocated in fw_realloc_buffer() called by
firmware_data_write(), and should be freed in release function of firmware
device.Signed-off-by: Ming Lei
Reported-by: Catalin Marinas
Acked-by: David Woodhouse
Signed-off-by: Greg Kroah-Hartman
24 Jul, 2009
1 commit
-
They are not supposed to be modified by drivers, so make them const.
Signed-off-by: Dmitry Torokhov
Acked-by: Greg Kroah-Hartman
Signed-off-by: Rafael J. Wysocki
22 Jul, 2009
1 commit
-
This is V2 of the platform driver power management late/early
callback removal patch. The callbacks ->suspend_late() and
->resume_early() are removed since all in-tree users now have
been migrated to dev_pm_ops.Signed-off-by: Magnus Damm
Acked-by: Greg Kroah-Hartman
Acked-by: Pavel Machek
Signed-off-by: Rafael J. Wysocki
13 Jul, 2009
2 commits
-
Add omitted unlock in firmware_data_read.
Signed-off-by: Jiri Slaby
Signed-off-by: Greg Kroah-Hartman -
I just debugged an obscure crash caused by a device_del() of a all NULL'd
out struct device (in usb-serial) and found that a patch like this one would
have saved me time (in addition to improved chances of a bug report from
users hitting similar driver bugs).[akpm@linux-foundation.org: cleanup]
Signed-off-by: Benjamin Herrenschmidt
Cc: Kay Sievers
Cc: Tejun Heo
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman
09 Jul, 2009
2 commits
-
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
PM: Clear -EAGAIN in dpm_prepare
x86: Fix resume from suspend when CONFIG_CC_STACKPROTECTOR -
The f_dev in _request_firmware() is allocated via the fw_setup_device()
and fw_register_device() calls and its class set to firmware_class (the
class release function is fw_dev_release).Commit 6acf70f078ca replaced the kfree(dev) in fw_dev_release() with a
put_device() call but my understanding is that the release function is
called via put_device -> kobject_put -> kref_put -> koject_release etc.
and it should call kfree since it's the last to see this device
structure alive.Because of that, the _request_firmware() function on its -ENOENT error
path only calls device_unregister(f_dev) which would eventually call
fw_dev_release() but there is no kfree (the subsequent put_device call
would just make the kref negative).Signed-off-by: Catalin Marinas
Acked-by: Cornelia Huck
Acked-by: Ming Lei
Signed-off-by: Linus Torvalds
08 Jul, 2009
1 commit
-
When the last device in the dpm list is unregistered directly after its
prepare() callback returned with -EAGAIN, the return code is passed to
the calling function, resulting in a suspend failure. Prevent this by
clearing the return code after -EAGAIN.Signed-off-by: Sebastian Ott
Signed-off-by: Rafael J. Wysocki
17 Jun, 2009
2 commits
-
* akpm: (182 commits)
fbdev: bf54x-lq043fb: use kzalloc over kmalloc/memset
fbdev: *bfin*: fix __dev{init,exit} markings
fbdev: *bfin*: drop unnecessary calls to memset
fbdev: bfin-t350mcqb-fb: drop unused local variables
fbdev: blackfin has __raw I/O accessors, so use them in fb.h
fbdev: s1d13xxxfb: add accelerated bitblt functions
tcx: use standard fields for framebuffer physical address and length
fbdev: add support for handoff from firmware to hw framebuffers
intelfb: fix a bug when changing video timing
fbdev: use framebuffer_release() for freeing fb_info structures
radeon: P2G2CLK_ALWAYS_ONb tested twice, should 2nd be P2G2CLK_DAC_ALWAYS_ONb?
s3c-fb: CPUFREQ frequency scaling support
s3c-fb: fix resource releasing on error during probing
carminefb: fix possible access beyond end of carmine_modedb[]
acornfb: remove fb_mmap function
mb862xxfb: use CONFIG_OF instead of CONFIG_PPC_OF
mb862xxfb: restrict compliation of platform driver to PPC
Samsung SoC Framebuffer driver: add Alpha Channel support
atmel-lcdc: fix pixclock upper bound detection
offb: use framebuffer_alloc() to allocate fb_info struct
...Manually fix up conflicts due to kmemcheck in mm/slab.c
-
Currently, nobody wants to turn UNEVICTABLE_LRU off. Thus this
configurability is unnecessary.Signed-off-by: KOSAKI Motohiro
Cc: Johannes Weiner
Cc: Andi Kleen
Acked-by: Minchan Kim
Cc: David Woodhouse
Cc: Matt Mackall
Cc: Rik van Riel
Cc: Lee Schermerhorn
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
16 Jun, 2009
10 commits
-
This adds the nodename callback for struct class, struct device_type and
struct device, to allow drivers to send userspace hints on the device
name and subdirectory that should be used for it.Signed-off-by: Kay Sievers
Signed-off-by: Jan Blunck
Signed-off-by: Greg Kroah-Hartman -
This removes the
warning: format not a string literal and no format arguments
warnings in the driver core that gcc 4.3.3 complains about.Signed-off-by: Greg Kroah-Hartman
-
The firmware loader has a statically allocated 30 bytes long string for
the firmware id (a.k.a. the firmware file name). There is no reason why
we couldnt allocate it dynamically, and avoid having restrictions on the
firmware names lengths.Signed-off-by: Samuel Ortiz
Cc: Marcel Holtmann
Cc: Zhu Yi ,
Cc: John Linville
Signed-off-by: Greg Kroah-Hartman -
request_firmware_nowait declares it can be called in non-sleep contexts,
but kthead_run called by request_firmware_nowait may sleep. So fix its
documentation and comment to make callers clear about it.Signed-off-by: Ming Lei
Signed-off-by: Greg Kroah-Hartman -
A patch series to make .shutdown execute asynchronously. Some drivers's
shutdown can take a lot of time. The patches can help save some shutdown
time. The patches use Arjan's async API.This patch:
synchronize all tasks submitted by .shutdown
Signed-off-by: Shaohua Li
Cc: Arjan van de Ven
Cc: Dmitry Torokhov
Cc: James Bottomley
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman -
sysdev_class_register should check the kobject_set_name return value.
Add the return value checking code.
Signed-off-by: Dave Young
Signed-off-by: Greg Kroah-Hartman -
We are looking for matching drivers, not devices.
Signed-off-by: Dmitry Torokhov
Signed-off-by: Greg Kroah-Hartman -
This converts resource and IRQ getbyname functions for the platform
bus to use const char *, I ran into compiler moanings when I tried
using a const char * for looking up a certain resource.Signed-off-by: Linus Walleij
Signed-off-by: Greg Kroah-Hartman -
This patch adds a new bus notifier event which is emitted _after_ a
device is removed from its driver. This event will be used by the
dma-api debug code to check if a driver has released all dma allocations
for that device.Signed-off-by: Joerg Roedel
Signed-off-by: Greg Kroah-Hartman -
against v2.6.30-rc3-next tree.
Signed-off-by: Ming Lei
Signed-off-by: Greg Kroah-Hartman
15 Jun, 2009
1 commit
-
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (31 commits)
trivial: remove the trivial patch monkey's name from SubmittingPatches
trivial: Fix a typo in comment of addrconf_dad_start()
trivial: usb: fix missing space typo in doc
trivial: pci hotplug: adding __init/__exit macros to sgi_hotplug
trivial: Remove the hyphen from git commands
trivial: fix ETIMEOUT -> ETIMEDOUT typos
trivial: Kconfig: .ko is normally not included in module names
trivial: SubmittingPatches: fix typo
trivial: Documentation/dell_rbu.txt: fix typos
trivial: Fix Pavel's address in MAINTAINERS
trivial: ftrace:fix description of trace directory
trivial: unnecessary (void*) cast removal in sound/oss/msnd.c
trivial: input/misc: Fix typo in Kconfig
trivial: fix grammo in bus_for_each_dev() kerneldoc
trivial: rbtree.txt: fix rb_entry() parameters in sample code
trivial: spelling fix in ppc code comments
trivial: fix typo in bio_alloc kernel doc
trivial: Documentation/rbtree.txt: cleanup kerneldoc of rbtree.txt
trivial: Miscellaneous documentation typo fixes
trivial: fix typo milisecond/millisecond for documentation and source comments.
...
13 Jun, 2009
1 commit
-
This patch reworks the platform driver code for legacy
suspend and resume to avoid installing callbacks in
struct device_driver. A warning is also added telling
users to update the platform driver to use dev_pm_ops.The functions platform_legacy_suspend()/resume() directly
call suspend and resume callbacks in struct platform_driver
instead of wrapping things in platform_drv_suspend()/resume().Signed-off-by: Magnus Damm
Acked-by: Greg Kroah-Hartman
Signed-off-by: Rafael J. Wysocki