Age | Commit message (Collapse) | Author | Files | Lines |
|
Remove the code since 'node' has already been initialized in the begin of
the function
Signed-off-by: Xiao Guangrong <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
- Generate a 64-bit pattern more efficiently
memchr_inv needs to generate a 64-bit pattern filled with a target
character. The operation can be done by more efficient way.
- Don't call the slow check_bytes() if the memory area is 64-bit aligned
memchr_inv compares contiguous 64-bit words with the 64-bit pattern as
much as possible. The outside of the region is checked by check_bytes()
that scans for each byte. Unfortunately, the first 64-bit word is
unexpectedly scanned by check_bytes() even if the memory area is aligned
to a 64-bit boundary.
Both changes were originally suggested by Eric Dumazet.
Signed-off-by: Akinobu Mita <[email protected]>
Suggested-by: Eric Dumazet <[email protected]>
Cc: Brian Norris <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
After moving some core functions to led-core.c, led-class.c can be built
as module again.
Signed-off-by: Bryan Wu <[email protected]>
Acked-by: Richard Purdie <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Improve the readability by moving the code setting gen_config to one
place.
[[email protected]: fix some patch skew]
Signed-off-by: Axel Lin <[email protected]>
Cc: Shreshtha Kumar Sahu <[email protected]>
Cc: "Milo(Woogyom) Kim" <[email protected]>
Cc: Richard Purdie <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Cc: Peter Meerwald <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Use 'pdata' rather than 'pltfm' in lm3530_init_registers().
Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Richard Purdie <[email protected]>
Cc: Axel Lin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
LM3530_ALS_ZONE_REG is read-only register.
Writing this register is not necessary.
Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
* add 'struct lm3530_pwm_data' in the platform data
The pwm data is the platform specific functions which generate the pwm.
The pwm data is only valid when brightness is pwm input mode.
Functions should be implemented by the pwm driver.
pwm_set_intensity() : set duty of pwm.
pwm_get_intensity() : get current the brightness.
* brightness control by pwm
If the control mode is pwm, then brightness is changed by the duty of
pwm=. So pwm platform function should be called in lm3530_brightness_set().
* do not update brightness register when pwm input mode
In pwm input mode, brightness register is not used.
If any value is updated in this register, then the led will be off.
* when input mode is changed, set duty of pwm to 0 if unnecessary.
Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
To get members of lm3530_data, use 'struct led_classdev' rather than
'struct i2c_client'.
[[email protected]: fix 80-column fixes more nicely]
Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Only 7 bits are used for updating the brightness. (register address :
A0h) So the max_brightness property of lm3530 should be set to 127.
On initializing registers, maximum initial brightness is limited to
'max_brightness'.
Division-by-two is removed on updating the brightness. This arithmetic is
not necessary because the range of brightness is 0 ~ 127= .
Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Direct usage of the asm include has long been deprecated by the
introduction of gpiolib.
Signed-off-by: Mark Brown <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Driver for the PCA9633 I2C chip supporting four LEDs and 255 brightness
levels.
[[email protected]: fix kcalloc() call]
[[email protected]: fix kcalloc parameters swapped]
Signed-off-by: Peter Meerwald <[email protected]>
Signed-off-by: Axel Lin <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Saves ~50 bytes text and speeds things up.
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Fix it by assigning the lp5521_read return value.
Signed-off-by: srinidhi kasagar <[email protected]>
Cc: Milo(Woogyom) Kim <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Arun MURTHY <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
For better readability, values of LP5521_REG_ENABLE register were
redefined= . Additional definitions: LP5521_ENABLE_DEFAULT and
LP5521_ENABLE_RUN_PROGRAM= .
Use definition rather than hard code value.
: 0x3F -> 'LP5521_CMD_DIRECT'
Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Cc: Arun MURTHY <[email protected]>
Cc: Srinidhi Kasagar <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
The lp5521 has autonomous operation mode without external control.
Using lp5521_platform_data, various led patterns can be configurable.
For supporting this feature, new functions and device attribute are
added.
Structure of lp5521_led_pattern: 3 channels are supported - red, green
and blue. Pattern(s) of each channel and numbers of pattern(s) are
defined in the pla= tform data. Pattern data are hexa codes which
include pattern commands such like set pwm, wait, ramp up/down, branch
and so on.
Pattern mode functions:
* lp5521_clear_program_memory
Before running new led pattern, program memory should be cleared.
* lp5521_write_program_memory
Pattern data updated in the program memory via the i2c.
* lp5521_get_pattern
Get pattern from predefined in the platform data.
* lp5521_run_led_pattern
Stop current pattern or run new pattern.
Transition time is required between different operation mode.
Device attribute - 'led_pattern': To load specific led pattern, new device
attribute is added.
When the lp5521 driver is unloaded, stop current led pattern mode.
Documentation updated : description about how to define the led patterns
and example.
[[email protected]: checkpatch fixes]
Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Cc: Arun MURTHY <[email protected]>
Cc: Srinidhi Kasagar <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
The value of CONFIG register(Addr 08h) is configurable. For supporting
this feature, update_config is added in the platform data. If
'update_config' is not defined, the default value is 'LP5521_PWRSAVE_EN |
LP5521_CP_MODE_AUTO | LP5521_R_TO_BATT'.
To define CONFIG register in the platform data, the bit definitions were
mo= ved to the header file.
Documentation updated : description about 'update_config' and example.
Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Cc: Arun MURTHY <[email protected]>
Cc: Srinidhi Kasagar <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
The name of each led channel can be configurable. For the compatibility,
the name is set to default value(xx:channelN) when 'name' is not defined.
Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Cc: Arun MURTHY <[email protected]>
Cc: Srinidhi Kasagar <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
A few new i2c-drivers came into the kernel which clear the
clientdata-pointer on exit or error. This is obsolete meanwhile, the
core will do it.
Signed-off-by: Wolfram Sang <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Just a small tidy-up.
1) There is a NULL dereference if the tca allocation fails.
2) The call to cancel_work_sync() isn't needed because we haven't
scheduled any work.
3) The call to i2c_set_clientdata() isn't needed because the core
handles that automatically if probe() fails.
4) I added some curly braces for style reasons.
Signed-off-by: Dan Carpenter <[email protected]>
Cc: Richard Purdie <[email protected]>
Acked-by: NeilBrown <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
"reseting" -> "resetting"
Signed-off-by: Masanari Iida <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Use for_each_clear_bit() to iterate over all the cleared bit in a
memory region.
Signed-off-by: Akinobu Mita <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Use for_each_clear_bit() to iterate over all the cleared bit in a
memory region.
Signed-off-by: Akinobu Mita <[email protected]>
Cc: Stefano Panella <[email protected]>
Cc: David Vrabel <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Use for_each_clear_bit() to iterate over all the cleared bit in a
memory region.
Signed-off-by: Akinobu Mita <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Heiko Carstens <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Use for_each_clear_bit() to iterate over all the cleared bit in a
memory region.
Signed-off-by: Akinobu Mita <[email protected]>
Cc: David Woodhouse <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Introduce for_each_clear_bit() and for_each_clear_bit_from(). They are
similar to for_each_set_bit() and list_for_each_set_bit_from(), but they
iterate over all the cleared bits in a memory region.
Signed-off-by: Akinobu Mita <[email protected]>
Cc: Robert Richter <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Stefano Panella <[email protected]>
Cc: David Vrabel <[email protected]>
Cc: Sergei Shtylyov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Remove for_each_set_bit_cont() after confirming that no one uses
for_each_set_bit_cont() anymore.
[[email protected]: regmap: cope with bitops API change]
Signed-off-by: Akinobu Mita <[email protected]>
Signed-off-by: Stephen Rothwell <[email protected]>
Cc: Robert Richter <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Mark Brown <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
This renames for_each_set_bit_cont() to for_each_set_bit_from() because
it is analogous to list_for_each_entry_from() in list.h rather than
list_for_each_entry_continue().
This doesn't remove for_each_set_bit_cont() for now.
Signed-off-by: Akinobu Mita <[email protected]>
Cc: Robert Richter <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Fix build error when GPIO_CS5535 is not enabled:
drivers/built-in.o: In function `ot200_backlight_probe':
ot200_bl.c:(.text+0x205bf): undefined reference to `cs5535_gpio_set'
ot200_bl.c:(.text+0x205d1): undefined reference to `cs5535_gpio_set'
Signed-off-by: Randy Dunlap <[email protected]>
Cc: Christian Gmeiner <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.
Signed-off-by: Jingoo Han <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Add support for pandora (openpandora.org) backlight.
It might look like all this could be done using pwm_bl.c instead, but
there is a need of special programming sequence when turning on the LED
driver chip or else it will misbehave. Doing this using pwm_bl.c would
require to use some register programming and pwm functions from platform
code, and ARM maintainers are allergic to driver-like code in /arch/arm
nowadays. The PMIC PWM driver is currently missing too, so pwm_bl.c
can't be used anyway.
Signed-off-by: Grazvydas Ignotas <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Add backlight driver for Bachmann's ot200 visualisation device. The
driver uses MFGPT 7 of CS5535 silicon to regulate the backlight.
[[email protected]: remove redundant test of `brightness']
Signed-off-by: Christian Gmeiner <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>
Cc: Andres Salomon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
THis driver supports TI LP8550/LP8551/LP8552/LP8553/LP8556 backlight
devices.
The brightness can be controlled by the I2C or PWM input. The lp855x
driver provides both modes. For the PWM control, pwm-specific functions
can be defined in the platform data. And some information can be read
via the sysfs(lp855x device attributes).
For details, please refer to Documentation/backlight/lp855x-driver.txt.
[[email protected]: add missing mutex_unlock in lp855x_read_byte() error path]
[[email protected]: check platform data in lp855x_probe()]
[[email protected]: small cleanups]
[[email protected]: silence a compiler warning]
[[email protected]: use id->driver_data to differentiate lp855x chips]
[[email protected]: simplify boolean return expression]
Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
The various devm_ functions allocate memory that is released when a driver
detaches. This patch uses these functions for data that is allocated in
the probe function of a platform device and is only freed in the remove
function.
Signed-off-by: Julia Lawall <[email protected]>
Cc: Dimitris Papastamos <[email protected]>
Cc: Richard Purdie <[email protected]>
Cc: Florian Tobias Schandinat <[email protected]>
Cc: Mark Brown <[email protected]>
Acked-by: Michael Hennerich <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
The various devm_ functions allocate memory that is released when a driver
detaches. This patch uses these functions for data that is allocated in
the probe function of a platform device and is only freed in the remove
function.
Signed-off-by: Julia Lawall <[email protected]>
Cc: Dimitris Papastamos <[email protected]>
Cc: Richard Purdie <[email protected]>
Cc: Florian Tobias Schandinat <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Michael Hennerich <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
The various devm_ functions allocate memory that is released when a driver
detaches. This patch uses these functions for data that is allocated in
the probe function of a platform device and is only freed in the remove
function.
Signed-off-by: Julia Lawall <[email protected]>
Cc: Dimitris Papastamos <[email protected]>
Cc: Richard Purdie <[email protected]>
Cc: Florian Tobias Schandinat <[email protected]>
Acked-by: Mark Brown <[email protected]>
Cc: Michael Hennerich <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Factor out some boilerplate code for spi driver registration into
module_spi_driver.
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Jingoo Han <[email protected]>
Cc: Eric Miao <[email protected]>
Acked-by: Alberto Panizzo <[email protected]>
Cc: Donghwa Lee <[email protected]>
Acked-by: Marek Vasut <[email protected]>
Cc: Haavard Skinnemoen <[email protected]>
Cc: InKi Dae <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Ben Dooks <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Factor out some boilerplate code for i2c driver registration into
module_i2c_driver.
Signed-off-by: Axel Lin <[email protected]>
Cc: Michael Hennerich <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
The maintainership of LTP is out of date, so update it.
Signed-off-by: Wanlong Gao <[email protected]>
Signed-off-by: Cyril Hrubis <[email protected]>
Signed-off-by: Caspar Zhang <[email protected]>
Reviewed-by: Rishikesh K Rajak <[email protected]>
Acked-by: Subrata Modak <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Russell King seems to be maintaining these. Might as well mark them with
the appropriate S: entry
Signed-off-by: Joe Perches <[email protected]>
Cc: Russell King <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Add missing S: status line to ALPHA.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Update the various git urls for name changes from 2.6.
Signed-off-by: Joe Perches <[email protected]>
Reviewed-by: Jesper Juhl <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
The MCA section included a file referring to Machine Check rather than
Microchannel.
Rename the section to spell out Microchannel and drop the bad file
reference.
Reported-by: Greg Pearson <[email protected]>
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Currently get_maintainer.pl reports moderated lists as open, which is just
wrong.
Signed-off-by: Richard Weinberger <[email protected]>
Acked-by: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
When an "S:" status line is unavailable, use a default "unknown" role.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Revelation from Peter.
Cc: Peter Zijlstra <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
It fixes some 80-col wordwrappings and adds some consistency.
Cc: Ingo Molnar <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
If the system is loaded while hotplugging a CPU we might end up with a
bogus hardlockup detection. This has been seen during LTP pounder test
executed in parallel with hotplug test.
The main problem is that enable_watchdog (called when CPU is brought up)
registers perf event which periodically checks per-cpu counter
(hrtimer_interrupts), updated from a hrtimer callback, but the hrtimer
is fired from the kernel thread.
This means that while we already do check for the hard lockup the kernel
thread might be sitting on the runqueue with zillions of tasks so there
is nobody to update the value we rely on and so we KABOOM.
Let's fix this by boosting the watchdog thread priority before we wake
it up rather than when it's already running. This still doesn't handle
a case where we have the same amount of high prio FIFO tasks but that
doesn't seem to be common. The current implementation doesn't handle
that case anyway so this is not worse at least.
Unfortunately, we cannot start perf counter from the watchdog thread
because we could miss a real lock up and also we cannot start the
hrtimer watchdog_enable because we there is no way (at least I don't
know any) to start a hrtimer from a different CPU.
[[email protected]: fix compile issue with param]
Cc: Ingo Molnar <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Reviewed-by: Mandeep Singh Baines <[email protected]>
Signed-off-by: Michal Hocko <[email protected]>
Signed-off-by: Don Zickus <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
I just received another user's pleas for help when their init
mysteriously died. I again explained that they need to check whether it
died because of bad instruction, a segv, or something else. Which was
an annoying detour into writing a trivial C program to spawn his init
and print its exit code:
http://lists.busybox.net/pipermail/busybox/2012-January/077172.html
I hear you saying "just test it under /bin/sh". Well, the crashing init
_was_ /bin/sh.
Which prompted me to make kernel do this first step automatically. We can
print exit code, which makes it possible to see that death was from e.g.
SIGILL without writing test programs.
[[email protected]: add 0x to hex number output]
Signed-off-by: Denys Vlasenko <[email protected]>
Acked-by: Oleg Nesterov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Userspace service managers/supervisors need to track their started
services. Many services daemonize by double-forking and get implicitly
re-parented to PID 1. The service manager will no longer be able to
receive the SIGCHLD signals for them, and is no longer in charge of
reaping the children with wait(). All information about the children is
lost at the moment PID 1 cleans up the re-parented processes.
With this prctl, a service manager process can mark itself as a sort of
'sub-init', able to stay as the parent for all orphaned processes
created by the started services. All SIGCHLD signals will be delivered
to the service manager.
Receiving SIGCHLD and doing wait() is in cases of a service-manager much
preferred over any possible asynchronous notification about specific
PIDs, because the service manager has full access to the child process
data in /proc and the PID can not be re-used until the wait(), the
service-manager itself is in charge of, has happened.
As a side effect, the relevant parent PID information does not get lost
by a double-fork, which results in a more elaborate process tree and
'ps' output:
before:
# ps afx
253 ? Ss 0:00 /bin/dbus-daemon --system --nofork
294 ? Sl 0:00 /usr/libexec/polkit-1/polkitd
328 ? S 0:00 /usr/sbin/modem-manager
608 ? Sl 0:00 /usr/libexec/colord
658 ? Sl 0:00 /usr/libexec/upowerd
819 ? Sl 0:00 /usr/libexec/imsettings-daemon
916 ? Sl 0:00 /usr/libexec/udisks-daemon
917 ? S 0:00 \_ udisks-daemon: not polling any devices
after:
# ps afx
294 ? Ss 0:00 /bin/dbus-daemon --system --nofork
426 ? Sl 0:00 \_ /usr/libexec/polkit-1/polkitd
449 ? S 0:00 \_ /usr/sbin/modem-manager
635 ? Sl 0:00 \_ /usr/libexec/colord
705 ? Sl 0:00 \_ /usr/libexec/upowerd
959 ? Sl 0:00 \_ /usr/libexec/udisks-daemon
960 ? S 0:00 | \_ udisks-daemon: not polling any devices
977 ? Sl 0:00 \_ /usr/libexec/packagekitd
This prctl is orthogonal to PID namespaces. PID namespaces are isolated
from each other, while a service management process usually requires the
services to live in the same namespace, to be able to talk to each
other.
Users of this will be the systemd per-user instance, which provides
init-like functionality for the user's login session and D-Bus, which
activates bus services on-demand. Both need init-like capabilities to
be able to properly keep track of the services they start.
Many thanks to Oleg for several rounds of review and insights.
[[email protected]: fix comment layout and spelling]
[[email protected]: add lengthy code comment from Oleg]
Reviewed-by: Oleg Nesterov <[email protected]>
Signed-off-by: Lennart Poettering <[email protected]>
Signed-off-by: Kay Sievers <[email protected]>
Acked-by: Valdis Kletnieks <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|