Commit Graph

17017 Commits

Author SHA1 Message Date
Lennart Poettering
29d449ffbc sched: Introduce SCHED_RESET_ON_FORK scheduling policy flag
This patch introduces a new flag SCHED_RESET_ON_FORK which can be passed
to the kernel via sched_setscheduler(), ORed in the policy parameter. If
set this will make sure that when the process forks a) the scheduling
priority is reset to DEFAULT_PRIO if it was higher and b) the scheduling
policy is reset to SCHED_NORMAL if it was either SCHED_FIFO or SCHED_RR.

Why have this?

Currently, if a process is real-time scheduled this will 'leak' to all
its child processes. For security reasons it is often (always?) a good
idea to make sure that if a process acquires RT scheduling this is
confined to this process and only this process. More specifically this
makes the per-process resource limit RLIMIT_RTTIME useful for security
purposes, because it makes it impossible to use a fork bomb to
circumvent the per-process RLIMIT_RTTIME accounting.

This feature is also useful for tools like 'renice' which can then
change the nice level of a process without having this spill to all its
child processes.

Why expose this via sched_setscheduler() and not other syscalls such as
prctl() or sched_setparam()?

prctl() does not take a pid parameter. Due to that it would be
impossible to modify this flag for other processes than the current one.

The struct passed to sched_setparam() can unfortunately not be extended
without breaking compatibility, since sched_setparam() lacks a size
parameter.

How to use this from userspace? In your RT program simply replace this:

  sched_setscheduler(pid, SCHED_FIFO, &param);

by this:

  sched_setscheduler(pid, SCHED_FIFO|SCHED_RESET_ON_FORK, &param);

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090615152714.GA29092@tango.0pointer.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
(cherry picked from commit ca94c442535a44d508c99a77e54f21a59f4fc462)
2011-02-03 08:25:26 -06:00
Matt Sealey
93b58cfb3d backlight: add power management hook to pwm backlight platform data 2011-02-01 19:51:33 -06:00
Guennadi Liakhovetski
08235ab815 fbdev: when parsing E-EDID blocks, also use SVD entries
Add parsing of E-EDID SVD entries. In this first version only a few
CEA/EIA-861E modes are implemented, more can be added as needed.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-01-30 20:37:06 -06:00
Erik Gilling
4779967299 video: add fb_edid_add_monspecs for parsing extended edid information
Modern monitors/tvs have more extended EDID information blocks which can
contain extra detailed modes.  This adds a fb_edid_add_monspecs function
which drivers can use to parse those additions blocks.

Signed-off-by: Erik Gilling <konkers@android.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-01-30 20:36:28 -06:00
Saleem Abdulrasool
82d7751991 siihdmi: the deferred timeout is not a settle period 2011-01-30 11:57:00 -08:00
Saleem Abdulrasool
f1b420c6e5 siihdmi: checksum edid blocks 2011-01-30 00:29:25 -08:00
Saleem Abdulrasool
38a89ac217 cea861: vsdb is entirely opaque 2011-01-30 00:29:24 -08:00
Saleem Abdulrasool
ec9fa83266 siihdmi: rework edid exporting to userspace 2011-01-30 00:29:23 -08:00
Saleem Abdulrasool
5dd29cec57 siihdmi: use struct resource over int for irq 2011-01-30 00:29:22 -08:00
Saleem Abdulrasool
d08f0d6429 edid: a few minor fixes for edid header 2011-01-29 20:58:09 -08:00
Saleem Abdulrasool
4655f71d0f sbs: add support for presence/alert IRQs 2011-01-29 20:58:08 -08:00
Matt Sealey
189a808937 siihdmi: binary edid property support (/sys/class/graphics/fb0/EDID) 2011-01-28 11:47:36 -06:00
Matt Sealey
3e0543205a cea861: fix hdmi version of vsdb (should match cea one, port configuration was not little endian ordered) 2011-01-27 11:02:09 -06:00
Matt Sealey
863319833d cea861: fix vendor specific data block (not an extension!) 2011-01-27 11:00:04 -06:00
Saleem Abdulrasool
5070e11542 sbs: rename platform insertion status functions 2011-01-26 20:42:18 -08:00
Saleem Abdulrasool
53eca9c65d sbs: support mains/battery availability checks 2011-01-25 19:48:44 -08:00
Matt Sealey
6f61305258 synaptics-usb 1.5rc8 for hacking around with the touchpad (no mods made for detection yet) 2011-01-24 11:56:07 -06:00
Saleem Abdulrasool
f0b5078568 siihdmi: sii_hdmi.h -> siihdmi.h 2011-01-23 00:12:06 -08:00
Saleem Abdulrasool
8fc68cb0aa siihdmi: max pixclock is platform specific data 2011-01-23 00:12:06 -08:00
Saleem Abdulrasool
bdffde6c3f siihdmi: cleanup siihdmi_santize_modelist
Use list_for_each_entry_safe to make the code easier to follow, re-order the
checks for removal, and break once the remove flag is set in the list traversal.
2011-01-23 00:12:06 -08:00
Saleem Abdulrasool
d7d2fc3aae siihdmi: move res_equal into modedb
The comparitor function is not specific to SII9xxx, but a generic modedb
function.  Move it to a more appropriate home.
2011-01-23 00:12:05 -08:00
Saleem Abdulrasool
ecfe4e9900 siihdmi: add siihdmi_platform_data
SII9022 requires some platform specific data that was previously hardcoded into
the driver.  Create a new siihdmi_platform_data struct to actually get this
information.  This allows a particular vendor to supply the IRQ vector, the
reset method, the framebuffer id, as well as the vendor/description for the SPD
block currently.
2011-01-23 00:12:05 -08:00
Saleem Abdulrasool
da3599e3fa siihdmi: cache edid data 2011-01-23 00:12:04 -08:00
Saleem Abdulrasool
94ecb0a6b2 siihdmi: more uniform naming
SIIHDMI_INFO_FRAME_<type> is more fitting with the rest of the code
2011-01-23 00:12:04 -08:00
Ben Hutchings
0c9f5ecd01 usbnet: Set link down initially for drivers that update link state
Some usbnet drivers update link state while others do not due to
hardware limitations.  Add a flag to distinguish those that do, and
set the link down initially for their devices.

This is intended to fix this bug: http://bugs.debian.org/444043

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-01-21 23:23:07 -06:00
Matt Sealey
87576c788f IPU updates from latest FSL BSP, seemingly all related to burst sizes and so on. New pixel format. 2011-01-21 21:43:30 -06:00
Matt Sealey
bd9d5d59ab siihdmi: native panel resolution and mode culling support
* Will now parse the mode list to:
 - Remove pixel clocks above 133MHz which the MX51 IPU DI cannot display (PLL limitation)
 - Remove modes from mode list that are interlaced (cannot display)
 - Find and save the best (native) panel mode and try and match a mode as close as possible instead of
   arbitrarily trying 1280x720 (unless EDID failed for some reason)
* Reduce bus timeout default to 10ms as it always takes less (<4ms or so, but we want to handle slow monitors)
* Comment out instrumentation until it returns reasonable values (jiffies aren't accurate enough)
* Some variable renames for clearer code
2011-01-21 15:19:15 -06:00
Saleem Abdulrasool
4e355880b6 siihdmi: fix up cea861 header parsing
The data block collection can be arbitrarily ordered.  We need to iterate over
all the blocks and check them.
2011-01-19 20:44:57 -08:00
Saleem Abdulrasool
25054f8e22 siihdmi: various cleanups
Cleanup the siihdmi header (which really is pointless to split out...), redefine
the fields for the sii info frame packets, and restructure sizes to be in terms
of registers.
2011-01-16 16:41:45 -08:00
Saleem Abdulrasool
0f7c600578 siihdmi: fixup tmds_state handling
tmds_state is really a boolean, so rename it to tmds_enabled.  Furthermore, use
boolean values to interact with the boolean type.
2011-01-16 14:04:25 -08:00
Saleem Abdulrasool
b9b3689853 cea861: improve CEA EDID extension block definition
Improve the CEA861 EDID block definition so that we can use it ot properly
identify a HDMI sink.
2011-01-16 13:57:57 -08:00
Saleem Abdulrasool
b8276b737b edid: improve edid parsing
Use a proper edid structure definition rather than indexing into a data blob.
This also adds additional helper functions to work with the returned edid data.

There is much room for further improvements still.  We should simply read the
first block, then use that to actually determine the number of blocks we need to
read from the device.  We cant simply read all the potential blocks as that can
be up to 32K of data.

Once we are reading all the EDID extensions, we should iterate over the blocks
to find the CEA block rather than assuming that the device is sending the CEA
block as the first block (especially given that the VESA spec calls for block 1
to be an extension map if there are more than 1 block present).
2011-01-16 13:41:26 -08:00
Saleem Abdulrasool
6f1fcd9297 refactor info frame management
info frame checksumming is defined by the CEA861-E standard, and is not specific
to SII9xxx, so move that into the CEA861 header.

Don't bother allocating the info frame structures off the heap.  That causes
unnecessary fragmentation and complexity.  Allocate them off the stack as they
are small enough.  This also helps keep everything simple.

As a bonus, fixed up the SII HDMI structures and the CEA861 InfoFrame structures
in the process as well.  Also clean up the magic number in the AVI InfoFrame
assertion.
2011-01-15 14:43:51 -08:00
Saleem Abdulrasool
6c9f4fe62f move edid definitions into an external header 2011-01-15 09:29:14 -08:00
Saleem Abdulrasool
f5fd774dae some whitespace fixes 2011-01-15 09:29:14 -08:00
Matt Sealey
40b3a1aa6f siihdmi: embed delayed_work into the structure instead of trying to allocate it
also make kmalloc/memset into kzalloc in probe
2011-01-14 14:18:18 -06:00
Matt Sealey
1daf20abcc siihdmi: improve irq handler, edge trigger it. change the way the workqueue works. retries->timeouts. general cleanliness updates. 2011-01-14 12:16:07 -06:00
Matt Sealey
34626f4751 siihdmi: add CEA Data Block Collection definitions so we can parse them properly and accurately detect an HDMI sink 2010-12-21 12:43:08 -06:00
Matt Sealey
f6ecf7665b drag mxc_v4l2_output video overlay code into the modern world (BSP 10.11.01)
drag mxc_ipuv3_fb with it (remove final efikamx specific stuff)
update some IPU stuff and ioctls for it all to interoperate

notes:
	that line_length bug is still there, I really can't find why it's 0...
	doesn't register because the platform_device isn't in a/a/p-mxc/devices.?
2010-12-18 01:09:45 -06:00
Matt Sealey
f63b8eb795 Bring IPU up to latest BSP, including these fixes:
ENGR00133954 ipuv3: remove FB_SYNC_EXT flag
ENGR00133034 ipuv3: fix black flash issue during high resolution video playback
ENGR00134076 ipuv3: should not set burst size again
ENGR00133345 IPUv3 VDI:Support bottom field first setting
ENGR00131660 ipuv3: left stripe output column should be set to zero

This actually fixes the clock sync problem with the AOC HDMI monitor we have (perfectly
working display but "input not support" floating around). Happily, the boot splash
actually works, too (previously it would not work until the second set of the display
when GDM booted). Hopefully IPU support is nice and stable now.
2010-12-14 00:45:28 -06:00
Matt Sealey
6f660227c7 siihdmi: add hdmi hotplug event handler (only registers the event, doesn't do anything yet) 2010-12-13 09:11:52 -06:00
Matt Sealey
9f8576bec1 experimental: more generic sii hdmi driver 2010-12-11 15:46:40 -06:00
Matt Sealey
79dbe9115f fs: unionfs 2.5.7 for linux 2.6.31.14 2010-12-07 07:10:30 -06:00
Matt Sealey
b761b6b198 dev_get_platdata is static 2010-12-06 00:32:03 -06:00
Matt Sealey
b3a91a785b spi_imx: add dev_get_platdata from more recent kernels 2010-12-06 00:09:27 -06:00
David Brownell
0db6265609 spi: handle TX-only/RX-only
Support two new half-duplex SPI implementation restrictions, for links
that talk to TX-only or RX-only devices.  (Existing half-duplex flavors
support both transfer directions, just not at the same time.)

Move spi_async() into the spi.c core, and stop inlining it.  Then make
that function perform error checks and reject messages that demand more
than the underlying controller can support.

Based on a patch from Marek Szyprowski which did this only for the
bitbanged GPIO driver.

Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-12-03 05:46:21 -06:00
Feng Tang
8c63257607 spi: enable spi_board_info to be registered after spi_master
Currently spi_register_board_info() has to be called before its related
spi_master be registered, otherwise these board info will be just ignored.

This patch will remove this order limit, it adds a global spi master list
like the existing global board info listr. Whenever a board info or a
spi_master is registered, the spi master list or board info list
will be scanned, and a new spi device will be created if there is a
master-board info match.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-12-03 05:42:53 -06:00
Anton Vorontsov
38962b9aff spi: prefix modalias with "spi:"
This makes it consistent with other buses (platform, i2c, vio, ...).  I'm
not sure why we use the prefixes, but there must be a reason.

This was easy enough to do it, and I did it.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Samuel Ortiz <sameo@openedhand.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Acked-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-12-03 05:36:50 -06:00
Anton Vorontsov
ee15db82e8 spi: add support for device table matching
With this patch spi drivers can use standard spi_driver.id_table and
MODULE_DEVICE_TABLE() mechanisms to bind against the devices.  Just like
we do with I2C drivers.

This is useful when a single driver supports several variants of devices
but it is not possible to detect them in run-time (like non-JEDEC chips
probing in drivers/mtd/devices/m25p80.c), and when platform_data usage is
overkill.

This patch also makes life a lot easier on OpenFirmware platforms, since
with OF we extensively use proper device IDs in modaliases.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-12-03 05:33:34 -06:00
hartleys
66552f8908 spi: move bitbang txrx utility functions to private header
A number of files in drivers/spi fail checkincludes.pl due to the double
include of <linux/spi/spi_bitbang.h>.

The first include is needed to get the struct spi_bitbang definition and
the spi_bitbang_* function prototypes.

The second include happens after defining EXPAND_BITBANG_TXRX to get the
inlined bitbang_txrx_* utility functions.

The <linux/spi/spi_bitbang.h> header is also included by a number of other
spi drivers, as well as some arch/ code, in order to use struct spi_bitbang
and the associated functions.

To fix the double include, and remove any potential confusion about it, move
the inlined bitbang_txrx_* functions to a new private header in drivers/spi
and also remove the need to define EXPAND_BITBANG_TXRX.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-12-03 00:01:39 -06:00