Merge commit 'v2.6.29-rc1' into perfcounters/core
Conflicts: include/linux/kernel_stat.h
This commit is contained in:
commit
506c10f26c
6192 changed files with 842449 additions and 152253 deletions
1
.mailmap
1
.mailmap
|
@ -32,6 +32,7 @@ Christoph Hellwig <hch@lst.de>
|
||||||
Corey Minyard <minyard@acm.org>
|
Corey Minyard <minyard@acm.org>
|
||||||
David Brownell <david-b@pacbell.net>
|
David Brownell <david-b@pacbell.net>
|
||||||
David Woodhouse <dwmw2@shinybook.infradead.org>
|
David Woodhouse <dwmw2@shinybook.infradead.org>
|
||||||
|
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
|
||||||
Domen Puncer <domen@coderock.org>
|
Domen Puncer <domen@coderock.org>
|
||||||
Douglas Gilbert <dougg@torque.net>
|
Douglas Gilbert <dougg@torque.net>
|
||||||
Ed L. Cashin <ecashin@coraid.com>
|
Ed L. Cashin <ecashin@coraid.com>
|
||||||
|
|
27
CREDITS
27
CREDITS
|
@ -369,10 +369,10 @@ P: 1024/8462A731 4C 55 86 34 44 59 A7 99 2B 97 88 4A 88 9A 0D 97
|
||||||
D: sun4 port, Sparc hacker
|
D: sun4 port, Sparc hacker
|
||||||
|
|
||||||
N: Hugh Blemings
|
N: Hugh Blemings
|
||||||
E: hugh@misc.nu
|
E: hugh@blemings.org
|
||||||
W: http://misc.nu/hugh/
|
W: http://blemings.org/hugh
|
||||||
D: Author and maintainer of the Keyspan USB to Serial drivers
|
D: Original author of the Keyspan USB to serial drivers, random PowerPC hacker
|
||||||
S: Po Box 234
|
S: PO Box 234
|
||||||
S: Belconnen ACT 2616
|
S: Belconnen ACT 2616
|
||||||
S: Australia
|
S: Australia
|
||||||
|
|
||||||
|
@ -464,6 +464,11 @@ S: 1200 Goldenrod Dr.
|
||||||
S: Nampa, Idaho 83686
|
S: Nampa, Idaho 83686
|
||||||
S: USA
|
S: USA
|
||||||
|
|
||||||
|
N: Dirk J. Brandewie
|
||||||
|
E: dirk.j.brandewie@intel.com
|
||||||
|
E: linux-wimax@intel.com
|
||||||
|
D: Intel Wireless WiMAX Connection 2400 SDIO driver
|
||||||
|
|
||||||
N: Derrick J. Brashear
|
N: Derrick J. Brashear
|
||||||
E: shadow@dementia.org
|
E: shadow@dementia.org
|
||||||
W: http://www.dementia.org/~shadow
|
W: http://www.dementia.org/~shadow
|
||||||
|
@ -1681,7 +1686,7 @@ E: ajoshi@shell.unixbox.com
|
||||||
D: fbdev hacking
|
D: fbdev hacking
|
||||||
|
|
||||||
N: Jesper Juhl
|
N: Jesper Juhl
|
||||||
E: jesper.juhl@gmail.com
|
E: jj@chaosbits.net
|
||||||
D: Various fixes, cleanups and minor features all over the tree.
|
D: Various fixes, cleanups and minor features all over the tree.
|
||||||
D: Wrote initial version of the hdaps driver (since passed on to others).
|
D: Wrote initial version of the hdaps driver (since passed on to others).
|
||||||
S: Lemnosvej 1, 3.tv
|
S: Lemnosvej 1, 3.tv
|
||||||
|
@ -2119,6 +2124,11 @@ N: H.J. Lu
|
||||||
E: hjl@gnu.ai.mit.edu
|
E: hjl@gnu.ai.mit.edu
|
||||||
D: GCC + libraries hacker
|
D: GCC + libraries hacker
|
||||||
|
|
||||||
|
N: Yanir Lubetkin
|
||||||
|
E: yanirx.lubatkin@intel.com
|
||||||
|
E: linux-wimax@intel.com
|
||||||
|
D: Intel Wireless WiMAX Connection 2400 driver
|
||||||
|
|
||||||
N: Michal Ludvig
|
N: Michal Ludvig
|
||||||
E: michal@logix.cz
|
E: michal@logix.cz
|
||||||
E: michal.ludvig@asterisk.co.nz
|
E: michal.ludvig@asterisk.co.nz
|
||||||
|
@ -2693,6 +2703,13 @@ S: RR #5, 497 Pole Line Road
|
||||||
S: Thunder Bay, Ontario
|
S: Thunder Bay, Ontario
|
||||||
S: CANADA P7C 5M9
|
S: CANADA P7C 5M9
|
||||||
|
|
||||||
|
N: Inaky Perez-Gonzalez
|
||||||
|
E: inaky.perez-gonzalez@intel.com
|
||||||
|
E: linux-wimax@intel.com
|
||||||
|
E: inakypg@yahoo.com
|
||||||
|
D: WiMAX stack
|
||||||
|
D: Intel Wireless WiMAX Connection 2400 driver
|
||||||
|
|
||||||
N: Yuri Per
|
N: Yuri Per
|
||||||
E: yuri@pts.mipt.ru
|
E: yuri@pts.mipt.ru
|
||||||
D: Some smbfs fixes
|
D: Some smbfs fixes
|
||||||
|
|
|
@ -3,8 +3,9 @@ Date: April 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
state. This holds the regulator output state.
|
state. This reports the regulator enable status, for
|
||||||
|
regulators which can report that value.
|
||||||
|
|
||||||
This will be one of the following strings:
|
This will be one of the following strings:
|
||||||
|
|
||||||
|
@ -18,7 +19,8 @@ Description:
|
||||||
'disabled' means the regulator output is OFF and is not
|
'disabled' means the regulator output is OFF and is not
|
||||||
supplying power to the system..
|
supplying power to the system..
|
||||||
|
|
||||||
'unknown' means software cannot determine the state.
|
'unknown' means software cannot determine the state, or
|
||||||
|
the reported state is invalid.
|
||||||
|
|
||||||
NOTE: this field can be used in conjunction with microvolts
|
NOTE: this field can be used in conjunction with microvolts
|
||||||
and microamps to determine regulator output levels.
|
and microamps to determine regulator output levels.
|
||||||
|
@ -53,9 +55,10 @@ Date: April 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
microvolts. This holds the regulator output voltage setting
|
microvolts. This holds the regulator output voltage setting
|
||||||
measured in microvolts (i.e. E-6 Volts).
|
measured in microvolts (i.e. E-6 Volts), for regulators
|
||||||
|
which can report that voltage.
|
||||||
|
|
||||||
NOTE: This value should not be used to determine the regulator
|
NOTE: This value should not be used to determine the regulator
|
||||||
output voltage level as this value is the same regardless of
|
output voltage level as this value is the same regardless of
|
||||||
|
@ -67,9 +70,10 @@ Date: April 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
microamps. This holds the regulator output current limit
|
microamps. This holds the regulator output current limit
|
||||||
setting measured in microamps (i.e. E-6 Amps).
|
setting measured in microamps (i.e. E-6 Amps), for regulators
|
||||||
|
which can report that current.
|
||||||
|
|
||||||
NOTE: This value should not be used to determine the regulator
|
NOTE: This value should not be used to determine the regulator
|
||||||
output current level as this value is the same regardless of
|
output current level as this value is the same regardless of
|
||||||
|
@ -81,8 +85,9 @@ Date: April 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
opmode. This holds the regulator operating mode setting.
|
opmode. This holds the current regulator operating mode,
|
||||||
|
for regulators which can report it.
|
||||||
|
|
||||||
The opmode value can be one of the following strings:
|
The opmode value can be one of the following strings:
|
||||||
|
|
||||||
|
@ -92,7 +97,7 @@ Description:
|
||||||
'standby'
|
'standby'
|
||||||
'unknown'
|
'unknown'
|
||||||
|
|
||||||
The modes are described in include/linux/regulator/regulator.h
|
The modes are described in include/linux/regulator/consumer.h
|
||||||
|
|
||||||
NOTE: This value should not be used to determine the regulator
|
NOTE: This value should not be used to determine the regulator
|
||||||
output operating mode as this value is the same regardless of
|
output operating mode as this value is the same regardless of
|
||||||
|
@ -104,9 +109,10 @@ Date: April 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
min_microvolts. This holds the minimum safe working regulator
|
min_microvolts. This holds the minimum safe working regulator
|
||||||
output voltage setting for this domain measured in microvolts.
|
output voltage setting for this domain measured in microvolts,
|
||||||
|
for regulators which support voltage constraints.
|
||||||
|
|
||||||
NOTE: this will return the string 'constraint not defined' if
|
NOTE: this will return the string 'constraint not defined' if
|
||||||
the power domain has no min microvolts constraint defined by
|
the power domain has no min microvolts constraint defined by
|
||||||
|
@ -118,9 +124,10 @@ Date: April 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
max_microvolts. This holds the maximum safe working regulator
|
max_microvolts. This holds the maximum safe working regulator
|
||||||
output voltage setting for this domain measured in microvolts.
|
output voltage setting for this domain measured in microvolts,
|
||||||
|
for regulators which support voltage constraints.
|
||||||
|
|
||||||
NOTE: this will return the string 'constraint not defined' if
|
NOTE: this will return the string 'constraint not defined' if
|
||||||
the power domain has no max microvolts constraint defined by
|
the power domain has no max microvolts constraint defined by
|
||||||
|
@ -132,10 +139,10 @@ Date: April 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
min_microamps. This holds the minimum safe working regulator
|
min_microamps. This holds the minimum safe working regulator
|
||||||
output current limit setting for this domain measured in
|
output current limit setting for this domain measured in
|
||||||
microamps.
|
microamps, for regulators which support current constraints.
|
||||||
|
|
||||||
NOTE: this will return the string 'constraint not defined' if
|
NOTE: this will return the string 'constraint not defined' if
|
||||||
the power domain has no min microamps constraint defined by
|
the power domain has no min microamps constraint defined by
|
||||||
|
@ -147,10 +154,10 @@ Date: April 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
max_microamps. This holds the maximum safe working regulator
|
max_microamps. This holds the maximum safe working regulator
|
||||||
output current limit setting for this domain measured in
|
output current limit setting for this domain measured in
|
||||||
microamps.
|
microamps, for regulators which support current constraints.
|
||||||
|
|
||||||
NOTE: this will return the string 'constraint not defined' if
|
NOTE: this will return the string 'constraint not defined' if
|
||||||
the power domain has no max microamps constraint defined by
|
the power domain has no max microamps constraint defined by
|
||||||
|
@ -185,7 +192,7 @@ Date: April 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
requested_microamps. This holds the total requested load
|
requested_microamps. This holds the total requested load
|
||||||
current in microamps for this regulator from all its consumer
|
current in microamps for this regulator from all its consumer
|
||||||
devices.
|
devices.
|
||||||
|
@ -204,125 +211,102 @@ Date: May 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
suspend_mem_microvolts. This holds the regulator output
|
suspend_mem_microvolts. This holds the regulator output
|
||||||
voltage setting for this domain measured in microvolts when
|
voltage setting for this domain measured in microvolts when
|
||||||
the system is suspended to memory.
|
the system is suspended to memory, for voltage regulators
|
||||||
|
implementing suspend voltage configuration constraints.
|
||||||
NOTE: this will return the string 'not defined' if
|
|
||||||
the power domain has no suspend to memory voltage defined by
|
|
||||||
platform code.
|
|
||||||
|
|
||||||
What: /sys/class/regulator/.../suspend_disk_microvolts
|
What: /sys/class/regulator/.../suspend_disk_microvolts
|
||||||
Date: May 2008
|
Date: May 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
suspend_disk_microvolts. This holds the regulator output
|
suspend_disk_microvolts. This holds the regulator output
|
||||||
voltage setting for this domain measured in microvolts when
|
voltage setting for this domain measured in microvolts when
|
||||||
the system is suspended to disk.
|
the system is suspended to disk, for voltage regulators
|
||||||
|
implementing suspend voltage configuration constraints.
|
||||||
NOTE: this will return the string 'not defined' if
|
|
||||||
the power domain has no suspend to disk voltage defined by
|
|
||||||
platform code.
|
|
||||||
|
|
||||||
What: /sys/class/regulator/.../suspend_standby_microvolts
|
What: /sys/class/regulator/.../suspend_standby_microvolts
|
||||||
Date: May 2008
|
Date: May 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
suspend_standby_microvolts. This holds the regulator output
|
suspend_standby_microvolts. This holds the regulator output
|
||||||
voltage setting for this domain measured in microvolts when
|
voltage setting for this domain measured in microvolts when
|
||||||
the system is suspended to standby.
|
the system is suspended to standby, for voltage regulators
|
||||||
|
implementing suspend voltage configuration constraints.
|
||||||
NOTE: this will return the string 'not defined' if
|
|
||||||
the power domain has no suspend to standby voltage defined by
|
|
||||||
platform code.
|
|
||||||
|
|
||||||
What: /sys/class/regulator/.../suspend_mem_mode
|
What: /sys/class/regulator/.../suspend_mem_mode
|
||||||
Date: May 2008
|
Date: May 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
suspend_mem_mode. This holds the regulator operating mode
|
suspend_mem_mode. This holds the regulator operating mode
|
||||||
setting for this domain when the system is suspended to
|
setting for this domain when the system is suspended to
|
||||||
memory.
|
memory, for regulators implementing suspend mode
|
||||||
|
configuration constraints.
|
||||||
NOTE: this will return the string 'not defined' if
|
|
||||||
the power domain has no suspend to memory mode defined by
|
|
||||||
platform code.
|
|
||||||
|
|
||||||
What: /sys/class/regulator/.../suspend_disk_mode
|
What: /sys/class/regulator/.../suspend_disk_mode
|
||||||
Date: May 2008
|
Date: May 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
suspend_disk_mode. This holds the regulator operating mode
|
suspend_disk_mode. This holds the regulator operating mode
|
||||||
setting for this domain when the system is suspended to disk.
|
setting for this domain when the system is suspended to disk,
|
||||||
|
for regulators implementing suspend mode configuration
|
||||||
NOTE: this will return the string 'not defined' if
|
constraints.
|
||||||
the power domain has no suspend to disk mode defined by
|
|
||||||
platform code.
|
|
||||||
|
|
||||||
What: /sys/class/regulator/.../suspend_standby_mode
|
What: /sys/class/regulator/.../suspend_standby_mode
|
||||||
Date: May 2008
|
Date: May 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
suspend_standby_mode. This holds the regulator operating mode
|
suspend_standby_mode. This holds the regulator operating mode
|
||||||
setting for this domain when the system is suspended to
|
setting for this domain when the system is suspended to
|
||||||
standby.
|
standby, for regulators implementing suspend mode
|
||||||
|
configuration constraints.
|
||||||
NOTE: this will return the string 'not defined' if
|
|
||||||
the power domain has no suspend to standby mode defined by
|
|
||||||
platform code.
|
|
||||||
|
|
||||||
What: /sys/class/regulator/.../suspend_mem_state
|
What: /sys/class/regulator/.../suspend_mem_state
|
||||||
Date: May 2008
|
Date: May 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
suspend_mem_state. This holds the regulator operating state
|
suspend_mem_state. This holds the regulator operating state
|
||||||
when suspended to memory.
|
when suspended to memory, for regulators implementing suspend
|
||||||
|
configuration constraints.
|
||||||
|
|
||||||
This will be one of the following strings:
|
This will be one of the same strings reported by
|
||||||
|
the "state" attribute.
|
||||||
'enabled'
|
|
||||||
'disabled'
|
|
||||||
'not defined'
|
|
||||||
|
|
||||||
What: /sys/class/regulator/.../suspend_disk_state
|
What: /sys/class/regulator/.../suspend_disk_state
|
||||||
Date: May 2008
|
Date: May 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
suspend_disk_state. This holds the regulator operating state
|
suspend_disk_state. This holds the regulator operating state
|
||||||
when suspended to disk.
|
when suspended to disk, for regulators implementing
|
||||||
|
suspend configuration constraints.
|
||||||
|
|
||||||
This will be one of the following strings:
|
This will be one of the same strings reported by
|
||||||
|
the "state" attribute.
|
||||||
'enabled'
|
|
||||||
'disabled'
|
|
||||||
'not defined'
|
|
||||||
|
|
||||||
What: /sys/class/regulator/.../suspend_standby_state
|
What: /sys/class/regulator/.../suspend_standby_state
|
||||||
Date: May 2008
|
Date: May 2008
|
||||||
KernelVersion: 2.6.26
|
KernelVersion: 2.6.26
|
||||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||||
Description:
|
Description:
|
||||||
Each regulator directory will contain a field called
|
Some regulator directories will contain a field called
|
||||||
suspend_standby_state. This holds the regulator operating
|
suspend_standby_state. This holds the regulator operating
|
||||||
state when suspended to standby.
|
state when suspended to standby, for regulators implementing
|
||||||
|
suspend configuration constraints.
|
||||||
|
|
||||||
This will be one of the following strings:
|
This will be one of the same strings reported by
|
||||||
|
the "state" attribute.
|
||||||
'enabled'
|
|
||||||
'disabled'
|
|
||||||
'not defined'
|
|
||||||
|
|
|
@ -32,14 +32,16 @@ Contact: linux-usb@vger.kernel.org
|
||||||
Description:
|
Description:
|
||||||
Write:
|
Write:
|
||||||
|
|
||||||
<channel> [<bpst offset>]
|
<channel>
|
||||||
|
|
||||||
to start beaconing on a specific channel, or stop
|
to force a specific channel to be used when beaconing,
|
||||||
beaconing if <channel> is -1. Valid channels depends
|
or, if <channel> is -1, to prohibit beaconing. If
|
||||||
on the radio controller's supported band groups.
|
<channel> is 0, then the default channel selection
|
||||||
|
algorithm will be used. Valid channels depends on the
|
||||||
|
radio controller's supported band groups.
|
||||||
|
|
||||||
<bpst offset> may be used to try and join a specific
|
Reading returns the currently active channel, or -1 if
|
||||||
beacon group if more than one was found during a scan.
|
the radio controller is not beaconing.
|
||||||
|
|
||||||
What: /sys/class/uwb_rc/uwbN/scan
|
What: /sys/class/uwb_rc/uwbN/scan
|
||||||
Date: July 2008
|
Date: July 2008
|
||||||
|
|
|
@ -6,7 +6,6 @@ Description:
|
||||||
internal state of the kernel memory blocks. Files could be
|
internal state of the kernel memory blocks. Files could be
|
||||||
added or removed dynamically to represent hot-add/remove
|
added or removed dynamically to represent hot-add/remove
|
||||||
operations.
|
operations.
|
||||||
|
|
||||||
Users: hotplug memory add/remove tools
|
Users: hotplug memory add/remove tools
|
||||||
https://w3.opensource.ibm.com/projects/powerpc-utils/
|
https://w3.opensource.ibm.com/projects/powerpc-utils/
|
||||||
|
|
||||||
|
@ -19,6 +18,56 @@ Description:
|
||||||
This is useful for a user-level agent to determine
|
This is useful for a user-level agent to determine
|
||||||
identify removable sections of the memory before attempting
|
identify removable sections of the memory before attempting
|
||||||
potentially expensive hot-remove memory operation
|
potentially expensive hot-remove memory operation
|
||||||
|
|
||||||
Users: hotplug memory remove tools
|
Users: hotplug memory remove tools
|
||||||
https://w3.opensource.ibm.com/projects/powerpc-utils/
|
https://w3.opensource.ibm.com/projects/powerpc-utils/
|
||||||
|
|
||||||
|
What: /sys/devices/system/memory/memoryX/phys_device
|
||||||
|
Date: September 2008
|
||||||
|
Contact: Badari Pulavarty <pbadari@us.ibm.com>
|
||||||
|
Description:
|
||||||
|
The file /sys/devices/system/memory/memoryX/phys_device
|
||||||
|
is read-only and is designed to show the name of physical
|
||||||
|
memory device. Implementation is currently incomplete.
|
||||||
|
|
||||||
|
What: /sys/devices/system/memory/memoryX/phys_index
|
||||||
|
Date: September 2008
|
||||||
|
Contact: Badari Pulavarty <pbadari@us.ibm.com>
|
||||||
|
Description:
|
||||||
|
The file /sys/devices/system/memory/memoryX/phys_index
|
||||||
|
is read-only and contains the section ID in hexadecimal
|
||||||
|
which is equivalent to decimal X contained in the
|
||||||
|
memory section directory name.
|
||||||
|
|
||||||
|
What: /sys/devices/system/memory/memoryX/state
|
||||||
|
Date: September 2008
|
||||||
|
Contact: Badari Pulavarty <pbadari@us.ibm.com>
|
||||||
|
Description:
|
||||||
|
The file /sys/devices/system/memory/memoryX/state
|
||||||
|
is read-write. When read, it's contents show the
|
||||||
|
online/offline state of the memory section. When written,
|
||||||
|
root can toggle the the online/offline state of a removable
|
||||||
|
memory section (see removable file description above)
|
||||||
|
using the following commands.
|
||||||
|
# echo online > /sys/devices/system/memory/memoryX/state
|
||||||
|
# echo offline > /sys/devices/system/memory/memoryX/state
|
||||||
|
|
||||||
|
For example, if /sys/devices/system/memory/memory22/removable
|
||||||
|
contains a value of 1 and
|
||||||
|
/sys/devices/system/memory/memory22/state contains the
|
||||||
|
string "online" the following command can be executed by
|
||||||
|
by root to offline that section.
|
||||||
|
# echo offline > /sys/devices/system/memory/memory22/state
|
||||||
|
Users: hotplug memory remove tools
|
||||||
|
https://w3.opensource.ibm.com/projects/powerpc-utils/
|
||||||
|
|
||||||
|
What: /sys/devices/system/node/nodeX/memoryY
|
||||||
|
Date: September 2008
|
||||||
|
Contact: Gary Hade <garyhade@us.ibm.com>
|
||||||
|
Description:
|
||||||
|
When CONFIG_NUMA is enabled
|
||||||
|
/sys/devices/system/node/nodeX/memoryY is a symbolic link that
|
||||||
|
points to the corresponding /sys/devices/system/memory/memoryY
|
||||||
|
memory section directory. For example, the following symbolic
|
||||||
|
link is created for memory section 9 on node0.
|
||||||
|
/sys/devices/system/node/node0/memory9 -> ../../memory/memory9
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ mapped only for the time they are actually used and unmapped after the DMA
|
||||||
transfer.
|
transfer.
|
||||||
|
|
||||||
The following API will work of course even on platforms where no such
|
The following API will work of course even on platforms where no such
|
||||||
hardware exists, see e.g. include/asm-i386/pci.h for how it is implemented on
|
hardware exists, see e.g. arch/x86/include/asm/pci.h for how it is implemented on
|
||||||
top of the virt_to_bus interface.
|
top of the virt_to_bus interface.
|
||||||
|
|
||||||
First of all, you should make sure
|
First of all, you should make sure
|
||||||
|
|
|
@ -12,7 +12,7 @@ DOCBOOKS := z8530book.xml mcabook.xml \
|
||||||
kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \
|
kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \
|
||||||
gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
|
gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
|
||||||
genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
|
genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
|
||||||
mac80211.xml debugobjects.xml sh.xml
|
mac80211.xml debugobjects.xml sh.xml regulator.xml
|
||||||
|
|
||||||
###
|
###
|
||||||
# The build process is as follows (targets):
|
# The build process is as follows (targets):
|
||||||
|
|
|
@ -74,6 +74,14 @@
|
||||||
!Enet/sunrpc/rpcb_clnt.c
|
!Enet/sunrpc/rpcb_clnt.c
|
||||||
!Enet/sunrpc/clnt.c
|
!Enet/sunrpc/clnt.c
|
||||||
</sect1>
|
</sect1>
|
||||||
|
<sect1><title>WiMAX</title>
|
||||||
|
!Enet/wimax/op-msg.c
|
||||||
|
!Enet/wimax/op-reset.c
|
||||||
|
!Enet/wimax/op-rfkill.c
|
||||||
|
!Enet/wimax/stack.c
|
||||||
|
!Iinclude/net/wimax.h
|
||||||
|
!Iinclude/linux/wimax.h
|
||||||
|
</sect1>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
<chapter id="netdev">
|
<chapter id="netdev">
|
||||||
|
|
304
Documentation/DocBook/regulator.tmpl
Normal file
304
Documentation/DocBook/regulator.tmpl
Normal file
|
@ -0,0 +1,304 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
|
||||||
|
|
||||||
|
<book id="regulator-api">
|
||||||
|
<bookinfo>
|
||||||
|
<title>Voltage and current regulator API</title>
|
||||||
|
|
||||||
|
<authorgroup>
|
||||||
|
<author>
|
||||||
|
<firstname>Liam</firstname>
|
||||||
|
<surname>Girdwood</surname>
|
||||||
|
<affiliation>
|
||||||
|
<address>
|
||||||
|
<email>lrg@slimlogic.co.uk</email>
|
||||||
|
</address>
|
||||||
|
</affiliation>
|
||||||
|
</author>
|
||||||
|
<author>
|
||||||
|
<firstname>Mark</firstname>
|
||||||
|
<surname>Brown</surname>
|
||||||
|
<affiliation>
|
||||||
|
<orgname>Wolfson Microelectronics</orgname>
|
||||||
|
<address>
|
||||||
|
<email>broonie@opensource.wolfsonmicro.com</email>
|
||||||
|
</address>
|
||||||
|
</affiliation>
|
||||||
|
</author>
|
||||||
|
</authorgroup>
|
||||||
|
|
||||||
|
<copyright>
|
||||||
|
<year>2007-2008</year>
|
||||||
|
<holder>Wolfson Microelectronics</holder>
|
||||||
|
</copyright>
|
||||||
|
<copyright>
|
||||||
|
<year>2008</year>
|
||||||
|
<holder>Liam Girdwood</holder>
|
||||||
|
</copyright>
|
||||||
|
|
||||||
|
<legalnotice>
|
||||||
|
<para>
|
||||||
|
This documentation is free software; you can redistribute
|
||||||
|
it and/or modify it under the terms of the GNU General Public
|
||||||
|
License version 2 as published by the Free Software Foundation.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
This program is distributed in the hope that it will be
|
||||||
|
useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
|
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
See the GNU General Public License for more details.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
You should have received a copy of the GNU General Public
|
||||||
|
License along with this program; if not, write to the Free
|
||||||
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
MA 02111-1307 USA
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
For more details see the file COPYING in the source
|
||||||
|
distribution of Linux.
|
||||||
|
</para>
|
||||||
|
</legalnotice>
|
||||||
|
</bookinfo>
|
||||||
|
|
||||||
|
<toc></toc>
|
||||||
|
|
||||||
|
<chapter id="intro">
|
||||||
|
<title>Introduction</title>
|
||||||
|
<para>
|
||||||
|
This framework is designed to provide a standard kernel
|
||||||
|
interface to control voltage and current regulators.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
The intention is to allow systems to dynamically control
|
||||||
|
regulator power output in order to save power and prolong
|
||||||
|
battery life. This applies to both voltage regulators (where
|
||||||
|
voltage output is controllable) and current sinks (where current
|
||||||
|
limit is controllable).
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Note that additional (and currently more complete) documentation
|
||||||
|
is available in the Linux kernel source under
|
||||||
|
<filename>Documentation/power/regulator</filename>.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<sect1 id="glossary">
|
||||||
|
<title>Glossary</title>
|
||||||
|
<para>
|
||||||
|
The regulator API uses a number of terms which may not be
|
||||||
|
familiar:
|
||||||
|
</para>
|
||||||
|
<glossary>
|
||||||
|
|
||||||
|
<glossentry>
|
||||||
|
<glossterm>Regulator</glossterm>
|
||||||
|
<glossdef>
|
||||||
|
<para>
|
||||||
|
Electronic device that supplies power to other devices. Most
|
||||||
|
regulators can enable and disable their output and some can also
|
||||||
|
control their output voltage or current.
|
||||||
|
</para>
|
||||||
|
</glossdef>
|
||||||
|
</glossentry>
|
||||||
|
|
||||||
|
<glossentry>
|
||||||
|
<glossterm>Consumer</glossterm>
|
||||||
|
<glossdef>
|
||||||
|
<para>
|
||||||
|
Electronic device which consumes power provided by a regulator.
|
||||||
|
These may either be static, requiring only a fixed supply, or
|
||||||
|
dynamic, requiring active management of the regulator at
|
||||||
|
runtime.
|
||||||
|
</para>
|
||||||
|
</glossdef>
|
||||||
|
</glossentry>
|
||||||
|
|
||||||
|
<glossentry>
|
||||||
|
<glossterm>Power Domain</glossterm>
|
||||||
|
<glossdef>
|
||||||
|
<para>
|
||||||
|
The electronic circuit supplied by a given regulator, including
|
||||||
|
the regulator and all consumer devices. The configuration of
|
||||||
|
the regulator is shared between all the components in the
|
||||||
|
circuit.
|
||||||
|
</para>
|
||||||
|
</glossdef>
|
||||||
|
</glossentry>
|
||||||
|
|
||||||
|
<glossentry>
|
||||||
|
<glossterm>Power Management Integrated Circuit</glossterm>
|
||||||
|
<acronym>PMIC</acronym>
|
||||||
|
<glossdef>
|
||||||
|
<para>
|
||||||
|
An IC which contains numerous regulators and often also other
|
||||||
|
subsystems. In an embedded system the primary PMIC is often
|
||||||
|
equivalent to a combination of the PSU and southbridge in a
|
||||||
|
desktop system.
|
||||||
|
</para>
|
||||||
|
</glossdef>
|
||||||
|
</glossentry>
|
||||||
|
</glossary>
|
||||||
|
</sect1>
|
||||||
|
</chapter>
|
||||||
|
|
||||||
|
<chapter id="consumer">
|
||||||
|
<title>Consumer driver interface</title>
|
||||||
|
<para>
|
||||||
|
This offers a similar API to the kernel clock framework.
|
||||||
|
Consumer drivers use <link
|
||||||
|
linkend='API-regulator-get'>get</link> and <link
|
||||||
|
linkend='API-regulator-put'>put</link> operations to acquire and
|
||||||
|
release regulators. Functions are
|
||||||
|
provided to <link linkend='API-regulator-enable'>enable</link>
|
||||||
|
and <link linkend='API-regulator-disable'>disable</link> the
|
||||||
|
reguator and to get and set the runtime parameters of the
|
||||||
|
regulator.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
When requesting regulators consumers use symbolic names for their
|
||||||
|
supplies, such as "Vcc", which are mapped into actual regulator
|
||||||
|
devices by the machine interface.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
A stub version of this API is provided when the regulator
|
||||||
|
framework is not in use in order to minimise the need to use
|
||||||
|
ifdefs.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<sect1 id="consumer-enable">
|
||||||
|
<title>Enabling and disabling</title>
|
||||||
|
<para>
|
||||||
|
The regulator API provides reference counted enabling and
|
||||||
|
disabling of regulators. Consumer devices use the <function><link
|
||||||
|
linkend='API-regulator-enable'>regulator_enable</link></function>
|
||||||
|
and <function><link
|
||||||
|
linkend='API-regulator-disable'>regulator_disable</link>
|
||||||
|
</function> functions to enable and disable regulators. Calls
|
||||||
|
to the two functions must be balanced.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Note that since multiple consumers may be using a regulator and
|
||||||
|
machine constraints may not allow the regulator to be disabled
|
||||||
|
there is no guarantee that calling
|
||||||
|
<function>regulator_disable</function> will actually cause the
|
||||||
|
supply provided by the regulator to be disabled. Consumer
|
||||||
|
drivers should assume that the regulator may be enabled at all
|
||||||
|
times.
|
||||||
|
</para>
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
<sect1 id="consumer-config">
|
||||||
|
<title>Configuration</title>
|
||||||
|
<para>
|
||||||
|
Some consumer devices may need to be able to dynamically
|
||||||
|
configure their supplies. For example, MMC drivers may need to
|
||||||
|
select the correct operating voltage for their cards. This may
|
||||||
|
be done while the regulator is enabled or disabled.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
The <function><link
|
||||||
|
linkend='API-regulator-set-voltage'>regulator_set_voltage</link>
|
||||||
|
</function> and <function><link
|
||||||
|
linkend='API-regulator-set-current-limit'
|
||||||
|
>regulator_set_current_limit</link>
|
||||||
|
</function> functions provide the primary interface for this.
|
||||||
|
Both take ranges of voltages and currents, supporting drivers
|
||||||
|
that do not require a specific value (eg, CPU frequency scaling
|
||||||
|
normally permits the CPU to use a wider range of supply
|
||||||
|
voltages at lower frequencies but does not require that the
|
||||||
|
supply voltage be lowered). Where an exact value is required
|
||||||
|
both minimum and maximum values should be identical.
|
||||||
|
</para>
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
<sect1 id="consumer-callback">
|
||||||
|
<title>Callbacks</title>
|
||||||
|
<para>
|
||||||
|
Callbacks may also be <link
|
||||||
|
linkend='API-regulator-register-notifier'>registered</link>
|
||||||
|
for events such as regulation failures.
|
||||||
|
</para>
|
||||||
|
</sect1>
|
||||||
|
</chapter>
|
||||||
|
|
||||||
|
<chapter id="driver">
|
||||||
|
<title>Regulator driver interface</title>
|
||||||
|
<para>
|
||||||
|
Drivers for regulator chips <link
|
||||||
|
linkend='API-regulator-register'>register</link> the regulators
|
||||||
|
with the regulator core, providing operations structures to the
|
||||||
|
core. A <link
|
||||||
|
linkend='API-regulator-notifier-call-chain'>notifier</link> interface
|
||||||
|
allows error conditions to be reported to the core.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Registration should be triggered by explicit setup done by the
|
||||||
|
platform, supplying a <link
|
||||||
|
linkend='API-struct-regulator-init-data'>struct
|
||||||
|
regulator_init_data</link> for the regulator containing
|
||||||
|
<link linkend='machine-constraint'>constraint</link> and
|
||||||
|
<link linkend='machine-supply'>supply</link> information.
|
||||||
|
</para>
|
||||||
|
</chapter>
|
||||||
|
|
||||||
|
<chapter id="machine">
|
||||||
|
<title>Machine interface</title>
|
||||||
|
<para>
|
||||||
|
This interface provides a way to define how regulators are
|
||||||
|
connected to consumers on a given system and what the valid
|
||||||
|
operating parameters are for the system.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<sect1 id="machine-supply">
|
||||||
|
<title>Supplies</title>
|
||||||
|
<para>
|
||||||
|
Regulator supplies are specified using <link
|
||||||
|
linkend='API-struct-regulator-consumer-supply'>struct
|
||||||
|
regulator_consumer_supply</link>. This is done at
|
||||||
|
<link linkend='driver'>driver registration
|
||||||
|
time</link> as part of the machine constraints.
|
||||||
|
</para>
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
<sect1 id="machine-constraint">
|
||||||
|
<title>Constraints</title>
|
||||||
|
<para>
|
||||||
|
As well as definining the connections the machine interface
|
||||||
|
also provides constraints definining the operations that
|
||||||
|
clients are allowed to perform and the parameters that may be
|
||||||
|
set. This is required since generally regulator devices will
|
||||||
|
offer more flexibility than it is safe to use on a given
|
||||||
|
system, for example supporting higher supply voltages than the
|
||||||
|
consumers are rated for.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
This is done at <link linkend='driver'>driver
|
||||||
|
registration time</link> by providing a <link
|
||||||
|
linkend='API-struct-regulation-constraints'>struct
|
||||||
|
regulation_constraints</link>.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
The constraints may also specify an initial configuration for the
|
||||||
|
regulator in the constraints, which is particularly useful for
|
||||||
|
use with static consumers.
|
||||||
|
</para>
|
||||||
|
</sect1>
|
||||||
|
</chapter>
|
||||||
|
|
||||||
|
<chapter id="api">
|
||||||
|
<title>API reference</title>
|
||||||
|
<para>
|
||||||
|
Due to limitations of the kernel documentation framework and the
|
||||||
|
existing layout of the source code the entire regulator API is
|
||||||
|
documented here.
|
||||||
|
</para>
|
||||||
|
!Iinclude/linux/regulator/consumer.h
|
||||||
|
!Iinclude/linux/regulator/machine.h
|
||||||
|
!Iinclude/linux/regulator/driver.h
|
||||||
|
!Edrivers/regulator/core.c
|
||||||
|
</chapter>
|
||||||
|
</book>
|
|
@ -41,6 +41,12 @@ GPL version 2.
|
||||||
</abstract>
|
</abstract>
|
||||||
|
|
||||||
<revhistory>
|
<revhistory>
|
||||||
|
<revision>
|
||||||
|
<revnumber>0.6</revnumber>
|
||||||
|
<date>2008-12-05</date>
|
||||||
|
<authorinitials>hjk</authorinitials>
|
||||||
|
<revremark>Added description of portio sysfs attributes.</revremark>
|
||||||
|
</revision>
|
||||||
<revision>
|
<revision>
|
||||||
<revnumber>0.5</revnumber>
|
<revnumber>0.5</revnumber>
|
||||||
<date>2008-05-22</date>
|
<date>2008-05-22</date>
|
||||||
|
@ -318,6 +324,54 @@ interested in translating it, please email me
|
||||||
offset = N * getpagesize();
|
offset = N * getpagesize();
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Sometimes there is hardware with memory-like regions that can not be
|
||||||
|
mapped with the technique described here, but there are still ways to
|
||||||
|
access them from userspace. The most common example are x86 ioports.
|
||||||
|
On x86 systems, userspace can access these ioports using
|
||||||
|
<function>ioperm()</function>, <function>iopl()</function>,
|
||||||
|
<function>inb()</function>, <function>outb()</function>, and similar
|
||||||
|
functions.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Since these ioport regions can not be mapped, they will not appear under
|
||||||
|
<filename>/sys/class/uio/uioX/maps/</filename> like the normal memory
|
||||||
|
described above. Without information about the port regions a hardware
|
||||||
|
has to offer, it becomes difficult for the userspace part of the
|
||||||
|
driver to find out which ports belong to which UIO device.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
To address this situation, the new directory
|
||||||
|
<filename>/sys/class/uio/uioX/portio/</filename> was added. It only
|
||||||
|
exists if the driver wants to pass information about one or more port
|
||||||
|
regions to userspace. If that is the case, subdirectories named
|
||||||
|
<filename>port0</filename>, <filename>port1</filename>, and so on,
|
||||||
|
will appear underneath
|
||||||
|
<filename>/sys/class/uio/uioX/portio/</filename>.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Each <filename>portX/</filename> directory contains three read-only
|
||||||
|
files that show start, size, and type of the port region:
|
||||||
|
</para>
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
<filename>start</filename>: The first port of this region.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
<filename>size</filename>: The number of ports in this region.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
<filename>porttype</filename>: A string describing the type of port.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
|
@ -339,12 +393,12 @@ offset = N * getpagesize();
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem><para>
|
<listitem><para>
|
||||||
<varname>char *name</varname>: Required. The name of your driver as
|
<varname>const char *name</varname>: Required. The name of your driver as
|
||||||
it will appear in sysfs. I recommend using the name of your module for this.
|
it will appear in sysfs. I recommend using the name of your module for this.
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
|
|
||||||
<listitem><para>
|
<listitem><para>
|
||||||
<varname>char *version</varname>: Required. This string appears in
|
<varname>const char *version</varname>: Required. This string appears in
|
||||||
<filename>/sys/class/uio/uioX/version</filename>.
|
<filename>/sys/class/uio/uioX/version</filename>.
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
|
|
||||||
|
@ -355,6 +409,13 @@ mapping you need to fill one of the <varname>uio_mem</varname> structures.
|
||||||
See the description below for details.
|
See the description below for details.
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
|
|
||||||
|
<listitem><para>
|
||||||
|
<varname>struct uio_port port[ MAX_UIO_PORTS_REGIONS ]</varname>: Required
|
||||||
|
if you want to pass information about ioports to userspace. For each port
|
||||||
|
region you need to fill one of the <varname>uio_port</varname> structures.
|
||||||
|
See the description below for details.
|
||||||
|
</para></listitem>
|
||||||
|
|
||||||
<listitem><para>
|
<listitem><para>
|
||||||
<varname>long irq</varname>: Required. If your hardware generates an
|
<varname>long irq</varname>: Required. If your hardware generates an
|
||||||
interrupt, it's your modules task to determine the irq number during
|
interrupt, it's your modules task to determine the irq number during
|
||||||
|
@ -448,6 +509,42 @@ Please do not touch the <varname>kobj</varname> element of
|
||||||
<varname>struct uio_mem</varname>! It is used by the UIO framework
|
<varname>struct uio_mem</varname>! It is used by the UIO framework
|
||||||
to set up sysfs files for this mapping. Simply leave it alone.
|
to set up sysfs files for this mapping. Simply leave it alone.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Sometimes, your device can have one or more port regions which can not be
|
||||||
|
mapped to userspace. But if there are other possibilities for userspace to
|
||||||
|
access these ports, it makes sense to make information about the ports
|
||||||
|
available in sysfs. For each region, you have to set up a
|
||||||
|
<varname>struct uio_port</varname> in the <varname>port[]</varname> array.
|
||||||
|
Here's a description of the fields of <varname>struct uio_port</varname>:
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem><para>
|
||||||
|
<varname>char *porttype</varname>: Required. Set this to one of the predefined
|
||||||
|
constants. Use <varname>UIO_PORT_X86</varname> for the ioports found in x86
|
||||||
|
architectures.
|
||||||
|
</para></listitem>
|
||||||
|
|
||||||
|
<listitem><para>
|
||||||
|
<varname>unsigned long start</varname>: Required if the port region is used.
|
||||||
|
Fill in the number of the first port of this region.
|
||||||
|
</para></listitem>
|
||||||
|
|
||||||
|
<listitem><para>
|
||||||
|
<varname>unsigned long size</varname>: Fill in the number of ports in this
|
||||||
|
region. If <varname>size</varname> is zero, the region is considered unused.
|
||||||
|
Note that you <emphasis>must</emphasis> initialize <varname>size</varname>
|
||||||
|
with zero for all unused regions.
|
||||||
|
</para></listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Please do not touch the <varname>portio</varname> element of
|
||||||
|
<varname>struct uio_port</varname>! It is used internally by the UIO
|
||||||
|
framework to set up sysfs files for this region. Simply leave it alone.
|
||||||
|
</para>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
<sect1 id="adding_irq_handler">
|
<sect1 id="adding_irq_handler">
|
||||||
|
|
|
@ -294,7 +294,8 @@ NOTE: pci_enable_device() can fail! Check the return value.
|
||||||
|
|
||||||
pci_set_master() will enable DMA by setting the bus master bit
|
pci_set_master() will enable DMA by setting the bus master bit
|
||||||
in the PCI_COMMAND register. It also fixes the latency timer value if
|
in the PCI_COMMAND register. It also fixes the latency timer value if
|
||||||
it's set to something bogus by the BIOS.
|
it's set to something bogus by the BIOS. pci_clear_master() will
|
||||||
|
disable DMA by clearing the bus master bit.
|
||||||
|
|
||||||
If the PCI device can use the PCI Memory-Write-Invalidate transaction,
|
If the PCI device can use the PCI Memory-Write-Invalidate transaction,
|
||||||
call pci_set_mwi(). This enables the PCI_COMMAND bit for Mem-Wr-Inval
|
call pci_set_mwi(). This enables the PCI_COMMAND bit for Mem-Wr-Inval
|
||||||
|
|
|
@ -12,10 +12,14 @@ rcuref.txt
|
||||||
- Reference-count design for elements of lists/arrays protected by RCU
|
- Reference-count design for elements of lists/arrays protected by RCU
|
||||||
rcu.txt
|
rcu.txt
|
||||||
- RCU Concepts
|
- RCU Concepts
|
||||||
|
rcubarrier.txt
|
||||||
|
- Unloading modules that use RCU callbacks
|
||||||
RTFP.txt
|
RTFP.txt
|
||||||
- List of RCU papers (bibliography) going back to 1980.
|
- List of RCU papers (bibliography) going back to 1980.
|
||||||
torture.txt
|
torture.txt
|
||||||
- RCU Torture Test Operation (CONFIG_RCU_TORTURE_TEST)
|
- RCU Torture Test Operation (CONFIG_RCU_TORTURE_TEST)
|
||||||
|
trace.txt
|
||||||
|
- CONFIG_RCU_TRACE debugfs files and formats
|
||||||
UP.txt
|
UP.txt
|
||||||
- RCU on Uniprocessor Systems
|
- RCU on Uniprocessor Systems
|
||||||
whatisRCU.txt
|
whatisRCU.txt
|
||||||
|
|
304
Documentation/RCU/rcubarrier.txt
Normal file
304
Documentation/RCU/rcubarrier.txt
Normal file
|
@ -0,0 +1,304 @@
|
||||||
|
RCU and Unloadable Modules
|
||||||
|
|
||||||
|
[Originally published in LWN Jan. 14, 2007: http://lwn.net/Articles/217484/]
|
||||||
|
|
||||||
|
RCU (read-copy update) is a synchronization mechanism that can be thought
|
||||||
|
of as a replacement for read-writer locking (among other things), but with
|
||||||
|
very low-overhead readers that are immune to deadlock, priority inversion,
|
||||||
|
and unbounded latency. RCU read-side critical sections are delimited
|
||||||
|
by rcu_read_lock() and rcu_read_unlock(), which, in non-CONFIG_PREEMPT
|
||||||
|
kernels, generate no code whatsoever.
|
||||||
|
|
||||||
|
This means that RCU writers are unaware of the presence of concurrent
|
||||||
|
readers, so that RCU updates to shared data must be undertaken quite
|
||||||
|
carefully, leaving an old version of the data structure in place until all
|
||||||
|
pre-existing readers have finished. These old versions are needed because
|
||||||
|
such readers might hold a reference to them. RCU updates can therefore be
|
||||||
|
rather expensive, and RCU is thus best suited for read-mostly situations.
|
||||||
|
|
||||||
|
How can an RCU writer possibly determine when all readers are finished,
|
||||||
|
given that readers might well leave absolutely no trace of their
|
||||||
|
presence? There is a synchronize_rcu() primitive that blocks until all
|
||||||
|
pre-existing readers have completed. An updater wishing to delete an
|
||||||
|
element p from a linked list might do the following, while holding an
|
||||||
|
appropriate lock, of course:
|
||||||
|
|
||||||
|
list_del_rcu(p);
|
||||||
|
synchronize_rcu();
|
||||||
|
kfree(p);
|
||||||
|
|
||||||
|
But the above code cannot be used in IRQ context -- the call_rcu()
|
||||||
|
primitive must be used instead. This primitive takes a pointer to an
|
||||||
|
rcu_head struct placed within the RCU-protected data structure and
|
||||||
|
another pointer to a function that may be invoked later to free that
|
||||||
|
structure. Code to delete an element p from the linked list from IRQ
|
||||||
|
context might then be as follows:
|
||||||
|
|
||||||
|
list_del_rcu(p);
|
||||||
|
call_rcu(&p->rcu, p_callback);
|
||||||
|
|
||||||
|
Since call_rcu() never blocks, this code can safely be used from within
|
||||||
|
IRQ context. The function p_callback() might be defined as follows:
|
||||||
|
|
||||||
|
static void p_callback(struct rcu_head *rp)
|
||||||
|
{
|
||||||
|
struct pstruct *p = container_of(rp, struct pstruct, rcu);
|
||||||
|
|
||||||
|
kfree(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Unloading Modules That Use call_rcu()
|
||||||
|
|
||||||
|
But what if p_callback is defined in an unloadable module?
|
||||||
|
|
||||||
|
If we unload the module while some RCU callbacks are pending,
|
||||||
|
the CPUs executing these callbacks are going to be severely
|
||||||
|
disappointed when they are later invoked, as fancifully depicted at
|
||||||
|
http://lwn.net/images/ns/kernel/rcu-drop.jpg.
|
||||||
|
|
||||||
|
We could try placing a synchronize_rcu() in the module-exit code path,
|
||||||
|
but this is not sufficient. Although synchronize_rcu() does wait for a
|
||||||
|
grace period to elapse, it does not wait for the callbacks to complete.
|
||||||
|
|
||||||
|
One might be tempted to try several back-to-back synchronize_rcu()
|
||||||
|
calls, but this is still not guaranteed to work. If there is a very
|
||||||
|
heavy RCU-callback load, then some of the callbacks might be deferred
|
||||||
|
in order to allow other processing to proceed. Such deferral is required
|
||||||
|
in realtime kernels in order to avoid excessive scheduling latencies.
|
||||||
|
|
||||||
|
|
||||||
|
rcu_barrier()
|
||||||
|
|
||||||
|
We instead need the rcu_barrier() primitive. This primitive is similar
|
||||||
|
to synchronize_rcu(), but instead of waiting solely for a grace
|
||||||
|
period to elapse, it also waits for all outstanding RCU callbacks to
|
||||||
|
complete. Pseudo-code using rcu_barrier() is as follows:
|
||||||
|
|
||||||
|
1. Prevent any new RCU callbacks from being posted.
|
||||||
|
2. Execute rcu_barrier().
|
||||||
|
3. Allow the module to be unloaded.
|
||||||
|
|
||||||
|
Quick Quiz #1: Why is there no srcu_barrier()?
|
||||||
|
|
||||||
|
The rcutorture module makes use of rcu_barrier in its exit function
|
||||||
|
as follows:
|
||||||
|
|
||||||
|
1 static void
|
||||||
|
2 rcu_torture_cleanup(void)
|
||||||
|
3 {
|
||||||
|
4 int i;
|
||||||
|
5
|
||||||
|
6 fullstop = 1;
|
||||||
|
7 if (shuffler_task != NULL) {
|
||||||
|
8 VERBOSE_PRINTK_STRING("Stopping rcu_torture_shuffle task");
|
||||||
|
9 kthread_stop(shuffler_task);
|
||||||
|
10 }
|
||||||
|
11 shuffler_task = NULL;
|
||||||
|
12
|
||||||
|
13 if (writer_task != NULL) {
|
||||||
|
14 VERBOSE_PRINTK_STRING("Stopping rcu_torture_writer task");
|
||||||
|
15 kthread_stop(writer_task);
|
||||||
|
16 }
|
||||||
|
17 writer_task = NULL;
|
||||||
|
18
|
||||||
|
19 if (reader_tasks != NULL) {
|
||||||
|
20 for (i = 0; i < nrealreaders; i++) {
|
||||||
|
21 if (reader_tasks[i] != NULL) {
|
||||||
|
22 VERBOSE_PRINTK_STRING(
|
||||||
|
23 "Stopping rcu_torture_reader task");
|
||||||
|
24 kthread_stop(reader_tasks[i]);
|
||||||
|
25 }
|
||||||
|
26 reader_tasks[i] = NULL;
|
||||||
|
27 }
|
||||||
|
28 kfree(reader_tasks);
|
||||||
|
29 reader_tasks = NULL;
|
||||||
|
30 }
|
||||||
|
31 rcu_torture_current = NULL;
|
||||||
|
32
|
||||||
|
33 if (fakewriter_tasks != NULL) {
|
||||||
|
34 for (i = 0; i < nfakewriters; i++) {
|
||||||
|
35 if (fakewriter_tasks[i] != NULL) {
|
||||||
|
36 VERBOSE_PRINTK_STRING(
|
||||||
|
37 "Stopping rcu_torture_fakewriter task");
|
||||||
|
38 kthread_stop(fakewriter_tasks[i]);
|
||||||
|
39 }
|
||||||
|
40 fakewriter_tasks[i] = NULL;
|
||||||
|
41 }
|
||||||
|
42 kfree(fakewriter_tasks);
|
||||||
|
43 fakewriter_tasks = NULL;
|
||||||
|
44 }
|
||||||
|
45
|
||||||
|
46 if (stats_task != NULL) {
|
||||||
|
47 VERBOSE_PRINTK_STRING("Stopping rcu_torture_stats task");
|
||||||
|
48 kthread_stop(stats_task);
|
||||||
|
49 }
|
||||||
|
50 stats_task = NULL;
|
||||||
|
51
|
||||||
|
52 /* Wait for all RCU callbacks to fire. */
|
||||||
|
53 rcu_barrier();
|
||||||
|
54
|
||||||
|
55 rcu_torture_stats_print(); /* -After- the stats thread is stopped! */
|
||||||
|
56
|
||||||
|
57 if (cur_ops->cleanup != NULL)
|
||||||
|
58 cur_ops->cleanup();
|
||||||
|
59 if (atomic_read(&n_rcu_torture_error))
|
||||||
|
60 rcu_torture_print_module_parms("End of test: FAILURE");
|
||||||
|
61 else
|
||||||
|
62 rcu_torture_print_module_parms("End of test: SUCCESS");
|
||||||
|
63 }
|
||||||
|
|
||||||
|
Line 6 sets a global variable that prevents any RCU callbacks from
|
||||||
|
re-posting themselves. This will not be necessary in most cases, since
|
||||||
|
RCU callbacks rarely include calls to call_rcu(). However, the rcutorture
|
||||||
|
module is an exception to this rule, and therefore needs to set this
|
||||||
|
global variable.
|
||||||
|
|
||||||
|
Lines 7-50 stop all the kernel tasks associated with the rcutorture
|
||||||
|
module. Therefore, once execution reaches line 53, no more rcutorture
|
||||||
|
RCU callbacks will be posted. The rcu_barrier() call on line 53 waits
|
||||||
|
for any pre-existing callbacks to complete.
|
||||||
|
|
||||||
|
Then lines 55-62 print status and do operation-specific cleanup, and
|
||||||
|
then return, permitting the module-unload operation to be completed.
|
||||||
|
|
||||||
|
Quick Quiz #2: Is there any other situation where rcu_barrier() might
|
||||||
|
be required?
|
||||||
|
|
||||||
|
Your module might have additional complications. For example, if your
|
||||||
|
module invokes call_rcu() from timers, you will need to first cancel all
|
||||||
|
the timers, and only then invoke rcu_barrier() to wait for any remaining
|
||||||
|
RCU callbacks to complete.
|
||||||
|
|
||||||
|
|
||||||
|
Implementing rcu_barrier()
|
||||||
|
|
||||||
|
Dipankar Sarma's implementation of rcu_barrier() makes use of the fact
|
||||||
|
that RCU callbacks are never reordered once queued on one of the per-CPU
|
||||||
|
queues. His implementation queues an RCU callback on each of the per-CPU
|
||||||
|
callback queues, and then waits until they have all started executing, at
|
||||||
|
which point, all earlier RCU callbacks are guaranteed to have completed.
|
||||||
|
|
||||||
|
The original code for rcu_barrier() was as follows:
|
||||||
|
|
||||||
|
1 void rcu_barrier(void)
|
||||||
|
2 {
|
||||||
|
3 BUG_ON(in_interrupt());
|
||||||
|
4 /* Take cpucontrol mutex to protect against CPU hotplug */
|
||||||
|
5 mutex_lock(&rcu_barrier_mutex);
|
||||||
|
6 init_completion(&rcu_barrier_completion);
|
||||||
|
7 atomic_set(&rcu_barrier_cpu_count, 0);
|
||||||
|
8 on_each_cpu(rcu_barrier_func, NULL, 0, 1);
|
||||||
|
9 wait_for_completion(&rcu_barrier_completion);
|
||||||
|
10 mutex_unlock(&rcu_barrier_mutex);
|
||||||
|
11 }
|
||||||
|
|
||||||
|
Line 3 verifies that the caller is in process context, and lines 5 and 10
|
||||||
|
use rcu_barrier_mutex to ensure that only one rcu_barrier() is using the
|
||||||
|
global completion and counters at a time, which are initialized on lines
|
||||||
|
6 and 7. Line 8 causes each CPU to invoke rcu_barrier_func(), which is
|
||||||
|
shown below. Note that the final "1" in on_each_cpu()'s argument list
|
||||||
|
ensures that all the calls to rcu_barrier_func() will have completed
|
||||||
|
before on_each_cpu() returns. Line 9 then waits for the completion.
|
||||||
|
|
||||||
|
This code was rewritten in 2008 to support rcu_barrier_bh() and
|
||||||
|
rcu_barrier_sched() in addition to the original rcu_barrier().
|
||||||
|
|
||||||
|
The rcu_barrier_func() runs on each CPU, where it invokes call_rcu()
|
||||||
|
to post an RCU callback, as follows:
|
||||||
|
|
||||||
|
1 static void rcu_barrier_func(void *notused)
|
||||||
|
2 {
|
||||||
|
3 int cpu = smp_processor_id();
|
||||||
|
4 struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
|
||||||
|
5 struct rcu_head *head;
|
||||||
|
6
|
||||||
|
7 head = &rdp->barrier;
|
||||||
|
8 atomic_inc(&rcu_barrier_cpu_count);
|
||||||
|
9 call_rcu(head, rcu_barrier_callback);
|
||||||
|
10 }
|
||||||
|
|
||||||
|
Lines 3 and 4 locate RCU's internal per-CPU rcu_data structure,
|
||||||
|
which contains the struct rcu_head that needed for the later call to
|
||||||
|
call_rcu(). Line 7 picks up a pointer to this struct rcu_head, and line
|
||||||
|
8 increments a global counter. This counter will later be decremented
|
||||||
|
by the callback. Line 9 then registers the rcu_barrier_callback() on
|
||||||
|
the current CPU's queue.
|
||||||
|
|
||||||
|
The rcu_barrier_callback() function simply atomically decrements the
|
||||||
|
rcu_barrier_cpu_count variable and finalizes the completion when it
|
||||||
|
reaches zero, as follows:
|
||||||
|
|
||||||
|
1 static void rcu_barrier_callback(struct rcu_head *notused)
|
||||||
|
2 {
|
||||||
|
3 if (atomic_dec_and_test(&rcu_barrier_cpu_count))
|
||||||
|
4 complete(&rcu_barrier_completion);
|
||||||
|
5 }
|
||||||
|
|
||||||
|
Quick Quiz #3: What happens if CPU 0's rcu_barrier_func() executes
|
||||||
|
immediately (thus incrementing rcu_barrier_cpu_count to the
|
||||||
|
value one), but the other CPU's rcu_barrier_func() invocations
|
||||||
|
are delayed for a full grace period? Couldn't this result in
|
||||||
|
rcu_barrier() returning prematurely?
|
||||||
|
|
||||||
|
|
||||||
|
rcu_barrier() Summary
|
||||||
|
|
||||||
|
The rcu_barrier() primitive has seen relatively little use, since most
|
||||||
|
code using RCU is in the core kernel rather than in modules. However, if
|
||||||
|
you are using RCU from an unloadable module, you need to use rcu_barrier()
|
||||||
|
so that your module may be safely unloaded.
|
||||||
|
|
||||||
|
|
||||||
|
Answers to Quick Quizzes
|
||||||
|
|
||||||
|
Quick Quiz #1: Why is there no srcu_barrier()?
|
||||||
|
|
||||||
|
Answer: Since there is no call_srcu(), there can be no outstanding SRCU
|
||||||
|
callbacks. Therefore, there is no need to wait for them.
|
||||||
|
|
||||||
|
Quick Quiz #2: Is there any other situation where rcu_barrier() might
|
||||||
|
be required?
|
||||||
|
|
||||||
|
Answer: Interestingly enough, rcu_barrier() was not originally
|
||||||
|
implemented for module unloading. Nikita Danilov was using
|
||||||
|
RCU in a filesystem, which resulted in a similar situation at
|
||||||
|
filesystem-unmount time. Dipankar Sarma coded up rcu_barrier()
|
||||||
|
in response, so that Nikita could invoke it during the
|
||||||
|
filesystem-unmount process.
|
||||||
|
|
||||||
|
Much later, yours truly hit the RCU module-unload problem when
|
||||||
|
implementing rcutorture, and found that rcu_barrier() solves
|
||||||
|
this problem as well.
|
||||||
|
|
||||||
|
Quick Quiz #3: What happens if CPU 0's rcu_barrier_func() executes
|
||||||
|
immediately (thus incrementing rcu_barrier_cpu_count to the
|
||||||
|
value one), but the other CPU's rcu_barrier_func() invocations
|
||||||
|
are delayed for a full grace period? Couldn't this result in
|
||||||
|
rcu_barrier() returning prematurely?
|
||||||
|
|
||||||
|
Answer: This cannot happen. The reason is that on_each_cpu() has its last
|
||||||
|
argument, the wait flag, set to "1". This flag is passed through
|
||||||
|
to smp_call_function() and further to smp_call_function_on_cpu(),
|
||||||
|
causing this latter to spin until the cross-CPU invocation of
|
||||||
|
rcu_barrier_func() has completed. This by itself would prevent
|
||||||
|
a grace period from completing on non-CONFIG_PREEMPT kernels,
|
||||||
|
since each CPU must undergo a context switch (or other quiescent
|
||||||
|
state) before the grace period can complete. However, this is
|
||||||
|
of no use in CONFIG_PREEMPT kernels.
|
||||||
|
|
||||||
|
Therefore, on_each_cpu() disables preemption across its call
|
||||||
|
to smp_call_function() and also across the local call to
|
||||||
|
rcu_barrier_func(). This prevents the local CPU from context
|
||||||
|
switching, again preventing grace periods from completing. This
|
||||||
|
means that all CPUs have executed rcu_barrier_func() before
|
||||||
|
the first rcu_barrier_callback() can possibly execute, in turn
|
||||||
|
preventing rcu_barrier_cpu_count from prematurely reaching zero.
|
||||||
|
|
||||||
|
Currently, -rt implementations of RCU keep but a single global
|
||||||
|
queue for RCU callbacks, and thus do not suffer from this
|
||||||
|
problem. However, when the -rt RCU eventually does have per-CPU
|
||||||
|
callback queues, things will have to change. One simple change
|
||||||
|
is to add an rcu_read_lock() before line 8 of rcu_barrier()
|
||||||
|
and an rcu_read_unlock() after line 8 of this same function. If
|
||||||
|
you can think of a better change, please let me know!
|
413
Documentation/RCU/trace.txt
Normal file
413
Documentation/RCU/trace.txt
Normal file
|
@ -0,0 +1,413 @@
|
||||||
|
CONFIG_RCU_TRACE debugfs Files and Formats
|
||||||
|
|
||||||
|
|
||||||
|
The rcupreempt and rcutree implementations of RCU provide debugfs trace
|
||||||
|
output that summarizes counters and state. This information is useful for
|
||||||
|
debugging RCU itself, and can sometimes also help to debug abuses of RCU.
|
||||||
|
Note that the rcuclassic implementation of RCU does not provide debugfs
|
||||||
|
trace output.
|
||||||
|
|
||||||
|
The following sections describe the debugfs files and formats for
|
||||||
|
preemptable RCU (rcupreempt) and hierarchical RCU (rcutree).
|
||||||
|
|
||||||
|
|
||||||
|
Preemptable RCU debugfs Files and Formats
|
||||||
|
|
||||||
|
This implementation of RCU provides three debugfs files under the
|
||||||
|
top-level directory RCU: rcu/rcuctrs (which displays the per-CPU
|
||||||
|
counters used by preemptable RCU) rcu/rcugp (which displays grace-period
|
||||||
|
counters), and rcu/rcustats (which internal counters for debugging RCU).
|
||||||
|
|
||||||
|
The output of "cat rcu/rcuctrs" looks as follows:
|
||||||
|
|
||||||
|
CPU last cur F M
|
||||||
|
0 5 -5 0 0
|
||||||
|
1 -1 0 0 0
|
||||||
|
2 0 1 0 0
|
||||||
|
3 0 1 0 0
|
||||||
|
4 0 1 0 0
|
||||||
|
5 0 1 0 0
|
||||||
|
6 0 2 0 0
|
||||||
|
7 0 -1 0 0
|
||||||
|
8 0 1 0 0
|
||||||
|
ggp = 26226, state = waitzero
|
||||||
|
|
||||||
|
The per-CPU fields are as follows:
|
||||||
|
|
||||||
|
o "CPU" gives the CPU number. Offline CPUs are not displayed.
|
||||||
|
|
||||||
|
o "last" gives the value of the counter that is being decremented
|
||||||
|
for the current grace period phase. In the example above,
|
||||||
|
the counters sum to 4, indicating that there are still four
|
||||||
|
RCU read-side critical sections still running that started
|
||||||
|
before the last counter flip.
|
||||||
|
|
||||||
|
o "cur" gives the value of the counter that is currently being
|
||||||
|
both incremented (by rcu_read_lock()) and decremented (by
|
||||||
|
rcu_read_unlock()). In the example above, the counters sum to
|
||||||
|
1, indicating that there is only one RCU read-side critical section
|
||||||
|
still running that started after the last counter flip.
|
||||||
|
|
||||||
|
o "F" indicates whether RCU is waiting for this CPU to acknowledge
|
||||||
|
a counter flip. In the above example, RCU is not waiting on any,
|
||||||
|
which is consistent with the state being "waitzero" rather than
|
||||||
|
"waitack".
|
||||||
|
|
||||||
|
o "M" indicates whether RCU is waiting for this CPU to execute a
|
||||||
|
memory barrier. In the above example, RCU is not waiting on any,
|
||||||
|
which is consistent with the state being "waitzero" rather than
|
||||||
|
"waitmb".
|
||||||
|
|
||||||
|
o "ggp" is the global grace-period counter.
|
||||||
|
|
||||||
|
o "state" is the RCU state, which can be one of the following:
|
||||||
|
|
||||||
|
o "idle": there is no grace period in progress.
|
||||||
|
|
||||||
|
o "waitack": RCU just incremented the global grace-period
|
||||||
|
counter, which has the effect of reversing the roles of
|
||||||
|
the "last" and "cur" counters above, and is waiting for
|
||||||
|
all the CPUs to acknowledge the flip. Once the flip has
|
||||||
|
been acknowledged, CPUs will no longer be incrementing
|
||||||
|
what are now the "last" counters, so that their sum will
|
||||||
|
decrease monotonically down to zero.
|
||||||
|
|
||||||
|
o "waitzero": RCU is waiting for the sum of the "last" counters
|
||||||
|
to decrease to zero.
|
||||||
|
|
||||||
|
o "waitmb": RCU is waiting for each CPU to execute a memory
|
||||||
|
barrier, which ensures that instructions from a given CPU's
|
||||||
|
last RCU read-side critical section cannot be reordered
|
||||||
|
with instructions following the memory-barrier instruction.
|
||||||
|
|
||||||
|
The output of "cat rcu/rcugp" looks as follows:
|
||||||
|
|
||||||
|
oldggp=48870 newggp=48873
|
||||||
|
|
||||||
|
Note that reading from this file provokes a synchronize_rcu(). The
|
||||||
|
"oldggp" value is that of "ggp" from rcu/rcuctrs above, taken before
|
||||||
|
executing the synchronize_rcu(), and the "newggp" value is also the
|
||||||
|
"ggp" value, but taken after the synchronize_rcu() command returns.
|
||||||
|
|
||||||
|
|
||||||
|
The output of "cat rcu/rcugp" looks as follows:
|
||||||
|
|
||||||
|
na=1337955 nl=40 wa=1337915 wl=44 da=1337871 dl=0 dr=1337871 di=1337871
|
||||||
|
1=50989 e1=6138 i1=49722 ie1=82 g1=49640 a1=315203 ae1=265563 a2=49640
|
||||||
|
z1=1401244 ze1=1351605 z2=49639 m1=5661253 me1=5611614 m2=49639
|
||||||
|
|
||||||
|
These are counters tracking internal preemptable-RCU events, however,
|
||||||
|
some of them may be useful for debugging algorithms using RCU. In
|
||||||
|
particular, the "nl", "wl", and "dl" values track the number of RCU
|
||||||
|
callbacks in various states. The fields are as follows:
|
||||||
|
|
||||||
|
o "na" is the total number of RCU callbacks that have been enqueued
|
||||||
|
since boot.
|
||||||
|
|
||||||
|
o "nl" is the number of RCU callbacks waiting for the previous
|
||||||
|
grace period to end so that they can start waiting on the next
|
||||||
|
grace period.
|
||||||
|
|
||||||
|
o "wa" is the total number of RCU callbacks that have started waiting
|
||||||
|
for a grace period since boot. "na" should be roughly equal to
|
||||||
|
"nl" plus "wa".
|
||||||
|
|
||||||
|
o "wl" is the number of RCU callbacks currently waiting for their
|
||||||
|
grace period to end.
|
||||||
|
|
||||||
|
o "da" is the total number of RCU callbacks whose grace periods
|
||||||
|
have completed since boot. "wa" should be roughly equal to
|
||||||
|
"wl" plus "da".
|
||||||
|
|
||||||
|
o "dr" is the total number of RCU callbacks that have been removed
|
||||||
|
from the list of callbacks ready to invoke. "dr" should be roughly
|
||||||
|
equal to "da".
|
||||||
|
|
||||||
|
o "di" is the total number of RCU callbacks that have been invoked
|
||||||
|
since boot. "di" should be roughly equal to "da", though some
|
||||||
|
early versions of preemptable RCU had a bug so that only the
|
||||||
|
last CPU's count of invocations was displayed, rather than the
|
||||||
|
sum of all CPU's counts.
|
||||||
|
|
||||||
|
o "1" is the number of calls to rcu_try_flip(). This should be
|
||||||
|
roughly equal to the sum of "e1", "i1", "a1", "z1", and "m1"
|
||||||
|
described below. In other words, the number of times that
|
||||||
|
the state machine is visited should be equal to the sum of the
|
||||||
|
number of times that each state is visited plus the number of
|
||||||
|
times that the state-machine lock acquisition failed.
|
||||||
|
|
||||||
|
o "e1" is the number of times that rcu_try_flip() was unable to
|
||||||
|
acquire the fliplock.
|
||||||
|
|
||||||
|
o "i1" is the number of calls to rcu_try_flip_idle().
|
||||||
|
|
||||||
|
o "ie1" is the number of times rcu_try_flip_idle() exited early
|
||||||
|
due to the calling CPU having no work for RCU.
|
||||||
|
|
||||||
|
o "g1" is the number of times that rcu_try_flip_idle() decided
|
||||||
|
to start a new grace period. "i1" should be roughly equal to
|
||||||
|
"ie1" plus "g1".
|
||||||
|
|
||||||
|
o "a1" is the number of calls to rcu_try_flip_waitack().
|
||||||
|
|
||||||
|
o "ae1" is the number of times that rcu_try_flip_waitack() found
|
||||||
|
that at least one CPU had not yet acknowledge the new grace period
|
||||||
|
(AKA "counter flip").
|
||||||
|
|
||||||
|
o "a2" is the number of time rcu_try_flip_waitack() found that
|
||||||
|
all CPUs had acknowledged. "a1" should be roughly equal to
|
||||||
|
"ae1" plus "a2". (This particular output was collected on
|
||||||
|
a 128-CPU machine, hence the smaller-than-usual fraction of
|
||||||
|
calls to rcu_try_flip_waitack() finding all CPUs having already
|
||||||
|
acknowledged.)
|
||||||
|
|
||||||
|
o "z1" is the number of calls to rcu_try_flip_waitzero().
|
||||||
|
|
||||||
|
o "ze1" is the number of times that rcu_try_flip_waitzero() found
|
||||||
|
that not all of the old RCU read-side critical sections had
|
||||||
|
completed.
|
||||||
|
|
||||||
|
o "z2" is the number of times that rcu_try_flip_waitzero() finds
|
||||||
|
the sum of the counters equal to zero, in other words, that
|
||||||
|
all of the old RCU read-side critical sections had completed.
|
||||||
|
The value of "z1" should be roughly equal to "ze1" plus
|
||||||
|
"z2".
|
||||||
|
|
||||||
|
o "m1" is the number of calls to rcu_try_flip_waitmb().
|
||||||
|
|
||||||
|
o "me1" is the number of times that rcu_try_flip_waitmb() finds
|
||||||
|
that at least one CPU has not yet executed a memory barrier.
|
||||||
|
|
||||||
|
o "m2" is the number of times that rcu_try_flip_waitmb() finds that
|
||||||
|
all CPUs have executed a memory barrier.
|
||||||
|
|
||||||
|
|
||||||
|
Hierarchical RCU debugfs Files and Formats
|
||||||
|
|
||||||
|
This implementation of RCU provides three debugfs files under the
|
||||||
|
top-level directory RCU: rcu/rcudata (which displays fields in struct
|
||||||
|
rcu_data), rcu/rcugp (which displays grace-period counters), and
|
||||||
|
rcu/rcuhier (which displays the struct rcu_node hierarchy).
|
||||||
|
|
||||||
|
The output of "cat rcu/rcudata" looks as follows:
|
||||||
|
|
||||||
|
rcu:
|
||||||
|
0 c=4011 g=4012 pq=1 pqc=4011 qp=0 rpfq=1 rp=3c2a dt=23301/73 dn=2 df=1882 of=0 ri=2126 ql=2 b=10
|
||||||
|
1 c=4011 g=4012 pq=1 pqc=4011 qp=0 rpfq=3 rp=39a6 dt=78073/1 dn=2 df=1402 of=0 ri=1875 ql=46 b=10
|
||||||
|
2 c=4010 g=4010 pq=1 pqc=4010 qp=0 rpfq=-5 rp=1d12 dt=16646/0 dn=2 df=3140 of=0 ri=2080 ql=0 b=10
|
||||||
|
3 c=4012 g=4013 pq=1 pqc=4012 qp=1 rpfq=3 rp=2b50 dt=21159/1 dn=2 df=2230 of=0 ri=1923 ql=72 b=10
|
||||||
|
4 c=4012 g=4013 pq=1 pqc=4012 qp=1 rpfq=3 rp=1644 dt=5783/1 dn=2 df=3348 of=0 ri=2805 ql=7 b=10
|
||||||
|
5 c=4012 g=4013 pq=0 pqc=4011 qp=1 rpfq=3 rp=1aac dt=5879/1 dn=2 df=3140 of=0 ri=2066 ql=10 b=10
|
||||||
|
6 c=4012 g=4013 pq=1 pqc=4012 qp=1 rpfq=3 rp=ed8 dt=5847/1 dn=2 df=3797 of=0 ri=1266 ql=10 b=10
|
||||||
|
7 c=4012 g=4013 pq=1 pqc=4012 qp=1 rpfq=3 rp=1fa2 dt=6199/1 dn=2 df=2795 of=0 ri=2162 ql=28 b=10
|
||||||
|
rcu_bh:
|
||||||
|
0 c=-268 g=-268 pq=1 pqc=-268 qp=0 rpfq=-145 rp=21d6 dt=23301/73 dn=2 df=0 of=0 ri=0 ql=0 b=10
|
||||||
|
1 c=-268 g=-268 pq=1 pqc=-268 qp=1 rpfq=-170 rp=20ce dt=78073/1 dn=2 df=26 of=0 ri=5 ql=0 b=10
|
||||||
|
2 c=-268 g=-268 pq=1 pqc=-268 qp=1 rpfq=-83 rp=fbd dt=16646/0 dn=2 df=28 of=0 ri=4 ql=0 b=10
|
||||||
|
3 c=-268 g=-268 pq=1 pqc=-268 qp=0 rpfq=-105 rp=178c dt=21159/1 dn=2 df=28 of=0 ri=2 ql=0 b=10
|
||||||
|
4 c=-268 g=-268 pq=1 pqc=-268 qp=1 rpfq=-30 rp=b54 dt=5783/1 dn=2 df=32 of=0 ri=0 ql=0 b=10
|
||||||
|
5 c=-268 g=-268 pq=1 pqc=-268 qp=1 rpfq=-29 rp=df5 dt=5879/1 dn=2 df=30 of=0 ri=3 ql=0 b=10
|
||||||
|
6 c=-268 g=-268 pq=1 pqc=-268 qp=1 rpfq=-28 rp=788 dt=5847/1 dn=2 df=32 of=0 ri=0 ql=0 b=10
|
||||||
|
7 c=-268 g=-268 pq=1 pqc=-268 qp=1 rpfq=-53 rp=1098 dt=6199/1 dn=2 df=30 of=0 ri=3 ql=0 b=10
|
||||||
|
|
||||||
|
The first section lists the rcu_data structures for rcu, the second for
|
||||||
|
rcu_bh. Each section has one line per CPU, or eight for this 8-CPU system.
|
||||||
|
The fields are as follows:
|
||||||
|
|
||||||
|
o The number at the beginning of each line is the CPU number.
|
||||||
|
CPUs numbers followed by an exclamation mark are offline,
|
||||||
|
but have been online at least once since boot. There will be
|
||||||
|
no output for CPUs that have never been online, which can be
|
||||||
|
a good thing in the surprisingly common case where NR_CPUS is
|
||||||
|
substantially larger than the number of actual CPUs.
|
||||||
|
|
||||||
|
o "c" is the count of grace periods that this CPU believes have
|
||||||
|
completed. CPUs in dynticks idle mode may lag quite a ways
|
||||||
|
behind, for example, CPU 4 under "rcu" above, which has slept
|
||||||
|
through the past 25 RCU grace periods. It is not unusual to
|
||||||
|
see CPUs lagging by thousands of grace periods.
|
||||||
|
|
||||||
|
o "g" is the count of grace periods that this CPU believes have
|
||||||
|
started. Again, CPUs in dynticks idle mode may lag behind.
|
||||||
|
If the "c" and "g" values are equal, this CPU has already
|
||||||
|
reported a quiescent state for the last RCU grace period that
|
||||||
|
it is aware of, otherwise, the CPU believes that it owes RCU a
|
||||||
|
quiescent state.
|
||||||
|
|
||||||
|
o "pq" indicates that this CPU has passed through a quiescent state
|
||||||
|
for the current grace period. It is possible for "pq" to be
|
||||||
|
"1" and "c" different than "g", which indicates that although
|
||||||
|
the CPU has passed through a quiescent state, either (1) this
|
||||||
|
CPU has not yet reported that fact, (2) some other CPU has not
|
||||||
|
yet reported for this grace period, or (3) both.
|
||||||
|
|
||||||
|
o "pqc" indicates which grace period the last-observed quiescent
|
||||||
|
state for this CPU corresponds to. This is important for handling
|
||||||
|
the race between CPU 0 reporting an extended dynticks-idle
|
||||||
|
quiescent state for CPU 1 and CPU 1 suddenly waking up and
|
||||||
|
reporting its own quiescent state. If CPU 1 was the last CPU
|
||||||
|
for the current grace period, then the CPU that loses this race
|
||||||
|
will attempt to incorrectly mark CPU 1 as having checked in for
|
||||||
|
the next grace period!
|
||||||
|
|
||||||
|
o "qp" indicates that RCU still expects a quiescent state from
|
||||||
|
this CPU.
|
||||||
|
|
||||||
|
o "rpfq" is the number of rcu_pending() calls on this CPU required
|
||||||
|
to induce this CPU to invoke force_quiescent_state().
|
||||||
|
|
||||||
|
o "rp" is low-order four hex digits of the count of how many times
|
||||||
|
rcu_pending() has been invoked on this CPU.
|
||||||
|
|
||||||
|
o "dt" is the current value of the dyntick counter that is incremented
|
||||||
|
when entering or leaving dynticks idle state, either by the
|
||||||
|
scheduler or by irq. The number after the "/" is the interrupt
|
||||||
|
nesting depth when in dyntick-idle state, or one greater than
|
||||||
|
the interrupt-nesting depth otherwise.
|
||||||
|
|
||||||
|
This field is displayed only for CONFIG_NO_HZ kernels.
|
||||||
|
|
||||||
|
o "dn" is the current value of the dyntick counter that is incremented
|
||||||
|
when entering or leaving dynticks idle state via NMI. If both
|
||||||
|
the "dt" and "dn" values are even, then this CPU is in dynticks
|
||||||
|
idle mode and may be ignored by RCU. If either of these two
|
||||||
|
counters is odd, then RCU must be alert to the possibility of
|
||||||
|
an RCU read-side critical section running on this CPU.
|
||||||
|
|
||||||
|
This field is displayed only for CONFIG_NO_HZ kernels.
|
||||||
|
|
||||||
|
o "df" is the number of times that some other CPU has forced a
|
||||||
|
quiescent state on behalf of this CPU due to this CPU being in
|
||||||
|
dynticks-idle state.
|
||||||
|
|
||||||
|
This field is displayed only for CONFIG_NO_HZ kernels.
|
||||||
|
|
||||||
|
o "of" is the number of times that some other CPU has forced a
|
||||||
|
quiescent state on behalf of this CPU due to this CPU being
|
||||||
|
offline. In a perfect world, this might neve happen, but it
|
||||||
|
turns out that offlining and onlining a CPU can take several grace
|
||||||
|
periods, and so there is likely to be an extended period of time
|
||||||
|
when RCU believes that the CPU is online when it really is not.
|
||||||
|
Please note that erring in the other direction (RCU believing a
|
||||||
|
CPU is offline when it is really alive and kicking) is a fatal
|
||||||
|
error, so it makes sense to err conservatively.
|
||||||
|
|
||||||
|
o "ri" is the number of times that RCU has seen fit to send a
|
||||||
|
reschedule IPI to this CPU in order to get it to report a
|
||||||
|
quiescent state.
|
||||||
|
|
||||||
|
o "ql" is the number of RCU callbacks currently residing on
|
||||||
|
this CPU. This is the total number of callbacks, regardless
|
||||||
|
of what state they are in (new, waiting for grace period to
|
||||||
|
start, waiting for grace period to end, ready to invoke).
|
||||||
|
|
||||||
|
o "b" is the batch limit for this CPU. If more than this number
|
||||||
|
of RCU callbacks is ready to invoke, then the remainder will
|
||||||
|
be deferred.
|
||||||
|
|
||||||
|
|
||||||
|
The output of "cat rcu/rcugp" looks as follows:
|
||||||
|
|
||||||
|
rcu: completed=33062 gpnum=33063
|
||||||
|
rcu_bh: completed=464 gpnum=464
|
||||||
|
|
||||||
|
Again, this output is for both "rcu" and "rcu_bh". The fields are
|
||||||
|
taken from the rcu_state structure, and are as follows:
|
||||||
|
|
||||||
|
o "completed" is the number of grace periods that have completed.
|
||||||
|
It is comparable to the "c" field from rcu/rcudata in that a
|
||||||
|
CPU whose "c" field matches the value of "completed" is aware
|
||||||
|
that the corresponding RCU grace period has completed.
|
||||||
|
|
||||||
|
o "gpnum" is the number of grace periods that have started. It is
|
||||||
|
comparable to the "g" field from rcu/rcudata in that a CPU
|
||||||
|
whose "g" field matches the value of "gpnum" is aware that the
|
||||||
|
corresponding RCU grace period has started.
|
||||||
|
|
||||||
|
If these two fields are equal (as they are for "rcu_bh" above),
|
||||||
|
then there is no grace period in progress, in other words, RCU
|
||||||
|
is idle. On the other hand, if the two fields differ (as they
|
||||||
|
do for "rcu" above), then an RCU grace period is in progress.
|
||||||
|
|
||||||
|
|
||||||
|
The output of "cat rcu/rcuhier" looks as follows, with very long lines:
|
||||||
|
|
||||||
|
c=6902 g=6903 s=2 jfq=3 j=72c7 nfqs=13142/nfqsng=0(13142) fqlh=6
|
||||||
|
1/1 0:127 ^0
|
||||||
|
3/3 0:35 ^0 0/0 36:71 ^1 0/0 72:107 ^2 0/0 108:127 ^3
|
||||||
|
3/3f 0:5 ^0 2/3 6:11 ^1 0/0 12:17 ^2 0/0 18:23 ^3 0/0 24:29 ^4 0/0 30:35 ^5 0/0 36:41 ^0 0/0 42:47 ^1 0/0 48:53 ^2 0/0 54:59 ^3 0/0 60:65 ^4 0/0 66:71 ^5 0/0 72:77 ^0 0/0 78:83 ^1 0/0 84:89 ^2 0/0 90:95 ^3 0/0 96:101 ^4 0/0 102:107 ^5 0/0 108:113 ^0 0/0 114:119 ^1 0/0 120:125 ^2 0/0 126:127 ^3
|
||||||
|
rcu_bh:
|
||||||
|
c=-226 g=-226 s=1 jfq=-5701 j=72c7 nfqs=88/nfqsng=0(88) fqlh=0
|
||||||
|
0/1 0:127 ^0
|
||||||
|
0/3 0:35 ^0 0/0 36:71 ^1 0/0 72:107 ^2 0/0 108:127 ^3
|
||||||
|
0/3f 0:5 ^0 0/3 6:11 ^1 0/0 12:17 ^2 0/0 18:23 ^3 0/0 24:29 ^4 0/0 30:35 ^5 0/0 36:41 ^0 0/0 42:47 ^1 0/0 48:53 ^2 0/0 54:59 ^3 0/0 60:65 ^4 0/0 66:71 ^5 0/0 72:77 ^0 0/0 78:83 ^1 0/0 84:89 ^2 0/0 90:95 ^3 0/0 96:101 ^4 0/0 102:107 ^5 0/0 108:113 ^0 0/0 114:119 ^1 0/0 120:125 ^2 0/0 126:127 ^3
|
||||||
|
|
||||||
|
This is once again split into "rcu" and "rcu_bh" portions. The fields are
|
||||||
|
as follows:
|
||||||
|
|
||||||
|
o "c" is exactly the same as "completed" under rcu/rcugp.
|
||||||
|
|
||||||
|
o "g" is exactly the same as "gpnum" under rcu/rcugp.
|
||||||
|
|
||||||
|
o "s" is the "signaled" state that drives force_quiescent_state()'s
|
||||||
|
state machine.
|
||||||
|
|
||||||
|
o "jfq" is the number of jiffies remaining for this grace period
|
||||||
|
before force_quiescent_state() is invoked to help push things
|
||||||
|
along. Note that CPUs in dyntick-idle mode thoughout the grace
|
||||||
|
period will not report on their own, but rather must be check by
|
||||||
|
some other CPU via force_quiescent_state().
|
||||||
|
|
||||||
|
o "j" is the low-order four hex digits of the jiffies counter.
|
||||||
|
Yes, Paul did run into a number of problems that turned out to
|
||||||
|
be due to the jiffies counter no longer counting. Why do you ask?
|
||||||
|
|
||||||
|
o "nfqs" is the number of calls to force_quiescent_state() since
|
||||||
|
boot.
|
||||||
|
|
||||||
|
o "nfqsng" is the number of useless calls to force_quiescent_state(),
|
||||||
|
where there wasn't actually a grace period active. This can
|
||||||
|
happen due to races. The number in parentheses is the difference
|
||||||
|
between "nfqs" and "nfqsng", or the number of times that
|
||||||
|
force_quiescent_state() actually did some real work.
|
||||||
|
|
||||||
|
o "fqlh" is the number of calls to force_quiescent_state() that
|
||||||
|
exited immediately (without even being counted in nfqs above)
|
||||||
|
due to contention on ->fqslock.
|
||||||
|
|
||||||
|
o Each element of the form "1/1 0:127 ^0" represents one struct
|
||||||
|
rcu_node. Each line represents one level of the hierarchy, from
|
||||||
|
root to leaves. It is best to think of the rcu_data structures
|
||||||
|
as forming yet another level after the leaves. Note that there
|
||||||
|
might be either one, two, or three levels of rcu_node structures,
|
||||||
|
depending on the relationship between CONFIG_RCU_FANOUT and
|
||||||
|
CONFIG_NR_CPUS.
|
||||||
|
|
||||||
|
o The numbers separated by the "/" are the qsmask followed
|
||||||
|
by the qsmaskinit. The qsmask will have one bit
|
||||||
|
set for each entity in the next lower level that
|
||||||
|
has not yet checked in for the current grace period.
|
||||||
|
The qsmaskinit will have one bit for each entity that is
|
||||||
|
currently expected to check in during each grace period.
|
||||||
|
The value of qsmaskinit is assigned to that of qsmask
|
||||||
|
at the beginning of each grace period.
|
||||||
|
|
||||||
|
For example, for "rcu", the qsmask of the first entry
|
||||||
|
of the lowest level is 0x14, meaning that we are still
|
||||||
|
waiting for CPUs 2 and 4 to check in for the current
|
||||||
|
grace period.
|
||||||
|
|
||||||
|
o The numbers separated by the ":" are the range of CPUs
|
||||||
|
served by this struct rcu_node. This can be helpful
|
||||||
|
in working out how the hierarchy is wired together.
|
||||||
|
|
||||||
|
For example, the first entry at the lowest level shows
|
||||||
|
"0:5", indicating that it covers CPUs 0 through 5.
|
||||||
|
|
||||||
|
o The number after the "^" indicates the bit in the
|
||||||
|
next higher level rcu_node structure that this
|
||||||
|
rcu_node structure corresponds to.
|
||||||
|
|
||||||
|
For example, the first entry at the lowest level shows
|
||||||
|
"^0", indicating that it corresponds to bit zero in
|
||||||
|
the first entry at the middle level.
|
286
Documentation/arm/pxa/mfp.txt
Normal file
286
Documentation/arm/pxa/mfp.txt
Normal file
|
@ -0,0 +1,286 @@
|
||||||
|
MFP Configuration for PXA2xx/PXA3xx Processors
|
||||||
|
|
||||||
|
Eric Miao <eric.miao@marvell.com>
|
||||||
|
|
||||||
|
MFP stands for Multi-Function Pin, which is the pin-mux logic on PXA3xx and
|
||||||
|
later PXA series processors. This document describes the existing MFP API,
|
||||||
|
and how board/platform driver authors could make use of it.
|
||||||
|
|
||||||
|
Basic Concept
|
||||||
|
===============
|
||||||
|
|
||||||
|
Unlike the GPIO alternate function settings on PXA25x and PXA27x, a new MFP
|
||||||
|
mechanism is introduced from PXA3xx to completely move the pin-mux functions
|
||||||
|
out of the GPIO controller. In addition to pin-mux configurations, the MFP
|
||||||
|
also controls the low power state, driving strength, pull-up/down and event
|
||||||
|
detection of each pin. Below is a diagram of internal connections between
|
||||||
|
the MFP logic and the remaining SoC peripherals:
|
||||||
|
|
||||||
|
+--------+
|
||||||
|
| |--(GPIO19)--+
|
||||||
|
| GPIO | |
|
||||||
|
| |--(GPIO...) |
|
||||||
|
+--------+ |
|
||||||
|
| +---------+
|
||||||
|
+--------+ +------>| |
|
||||||
|
| PWM2 |--(PWM_OUT)-------->| MFP |
|
||||||
|
+--------+ +------>| |-------> to external PAD
|
||||||
|
| +---->| |
|
||||||
|
+--------+ | | +-->| |
|
||||||
|
| SSP2 |---(TXD)----+ | | +---------+
|
||||||
|
+--------+ | |
|
||||||
|
| |
|
||||||
|
+--------+ | |
|
||||||
|
| Keypad |--(MKOUT4)----+ |
|
||||||
|
+--------+ |
|
||||||
|
|
|
||||||
|
+--------+ |
|
||||||
|
| UART2 |---(TXD)--------+
|
||||||
|
+--------+
|
||||||
|
|
||||||
|
NOTE: the external pad is named as MFP_PIN_GPIO19, it doesn't necessarily
|
||||||
|
mean it's dedicated for GPIO19, only as a hint that internally this pin
|
||||||
|
can be routed from GPIO19 of the GPIO controller.
|
||||||
|
|
||||||
|
To better understand the change from PXA25x/PXA27x GPIO alternate function
|
||||||
|
to this new MFP mechanism, here are several key points:
|
||||||
|
|
||||||
|
1. GPIO controller on PXA3xx is now a dedicated controller, same as other
|
||||||
|
internal controllers like PWM, SSP and UART, with 128 internal signals
|
||||||
|
which can be routed to external through one or more MFPs (e.g. GPIO<0>
|
||||||
|
can be routed through either MFP_PIN_GPIO0 as well as MFP_PIN_GPIO0_2,
|
||||||
|
see arch/arm/mach-pxa/mach/include/mfp-pxa300.h)
|
||||||
|
|
||||||
|
2. Alternate function configuration is removed from this GPIO controller,
|
||||||
|
the remaining functions are pure GPIO-specific, i.e.
|
||||||
|
|
||||||
|
- GPIO signal level control
|
||||||
|
- GPIO direction control
|
||||||
|
- GPIO level change detection
|
||||||
|
|
||||||
|
3. Low power state for each pin is now controlled by MFP, this means the
|
||||||
|
PGSRx registers on PXA2xx are now useless on PXA3xx
|
||||||
|
|
||||||
|
4. Wakeup detection is now controlled by MFP, PWER does not control the
|
||||||
|
wakeup from GPIO(s) any more, depending on the sleeping state, ADxER
|
||||||
|
(as defined in pxa3xx-regs.h) controls the wakeup from MFP
|
||||||
|
|
||||||
|
NOTE: with such a clear separation of MFP and GPIO, by GPIO<xx> we normally
|
||||||
|
mean it is a GPIO signal, and by MFP<xxx> or pin xxx, we mean a physical
|
||||||
|
pad (or ball).
|
||||||
|
|
||||||
|
MFP API Usage
|
||||||
|
===============
|
||||||
|
|
||||||
|
For board code writers, here are some guidelines:
|
||||||
|
|
||||||
|
1. include ONE of the following header files in your <board>.c:
|
||||||
|
|
||||||
|
- #include <mach/mfp-pxa25x.h>
|
||||||
|
- #include <mach/mfp-pxa27x.h>
|
||||||
|
- #include <mach/mfp-pxa300.h>
|
||||||
|
- #include <mach/mfp-pxa320.h>
|
||||||
|
- #include <mach/mfp-pxa930.h>
|
||||||
|
|
||||||
|
NOTE: only one file in your <board>.c, depending on the processors used,
|
||||||
|
because pin configuration definitions may conflict in these file (i.e.
|
||||||
|
same name, different meaning and settings on different processors). E.g.
|
||||||
|
for zylonite platform, which support both PXA300/PXA310 and PXA320, two
|
||||||
|
separate files are introduced: zylonite_pxa300.c and zylonite_pxa320.c
|
||||||
|
(in addition to handle MFP configuration differences, they also handle
|
||||||
|
the other differences between the two combinations).
|
||||||
|
|
||||||
|
NOTE: PXA300 and PXA310 are almost identical in pin configurations (with
|
||||||
|
PXA310 supporting some additional ones), thus the difference is actually
|
||||||
|
covered in a single mfp-pxa300.h.
|
||||||
|
|
||||||
|
2. prepare an array for the initial pin configurations, e.g.:
|
||||||
|
|
||||||
|
static unsigned long mainstone_pin_config[] __initdata = {
|
||||||
|
/* Chip Select */
|
||||||
|
GPIO15_nCS_1,
|
||||||
|
|
||||||
|
/* LCD - 16bpp Active TFT */
|
||||||
|
GPIOxx_TFT_LCD_16BPP,
|
||||||
|
GPIO16_PWM0_OUT, /* Backlight */
|
||||||
|
|
||||||
|
/* MMC */
|
||||||
|
GPIO32_MMC_CLK,
|
||||||
|
GPIO112_MMC_CMD,
|
||||||
|
GPIO92_MMC_DAT_0,
|
||||||
|
GPIO109_MMC_DAT_1,
|
||||||
|
GPIO110_MMC_DAT_2,
|
||||||
|
GPIO111_MMC_DAT_3,
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
/* GPIO */
|
||||||
|
GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH,
|
||||||
|
};
|
||||||
|
|
||||||
|
a) once the pin configurations are passed to pxa{2xx,3xx}_mfp_config(),
|
||||||
|
and written to the actual registers, they are useless and may discard,
|
||||||
|
adding '__initdata' will help save some additional bytes here.
|
||||||
|
|
||||||
|
b) when there is only one possible pin configurations for a component,
|
||||||
|
some simplified definitions can be used, e.g. GPIOxx_TFT_LCD_16BPP on
|
||||||
|
PXA25x and PXA27x processors
|
||||||
|
|
||||||
|
c) if by board design, a pin can be configured to wake up the system
|
||||||
|
from low power state, it can be 'OR'ed with any of:
|
||||||
|
|
||||||
|
WAKEUP_ON_EDGE_BOTH
|
||||||
|
WAKEUP_ON_EDGE_RISE
|
||||||
|
WAKEUP_ON_EDGE_FALL
|
||||||
|
WAKEUP_ON_LEVEL_HIGH - specifically for enabling of keypad GPIOs,
|
||||||
|
|
||||||
|
to indicate that this pin has the capability of wake-up the system,
|
||||||
|
and on which edge(s). This, however, doesn't necessarily mean the
|
||||||
|
pin _will_ wakeup the system, it will only when set_irq_wake() is
|
||||||
|
invoked with the corresponding GPIO IRQ (GPIO_IRQ(xx) or gpio_to_irq())
|
||||||
|
and eventually calls gpio_set_wake() for the actual register setting.
|
||||||
|
|
||||||
|
d) although PXA3xx MFP supports edge detection on each pin, the
|
||||||
|
internal logic will only wakeup the system when those specific bits
|
||||||
|
in ADxER registers are set, which can be well mapped to the
|
||||||
|
corresponding peripheral, thus set_irq_wake() can be called with
|
||||||
|
the peripheral IRQ to enable the wakeup.
|
||||||
|
|
||||||
|
|
||||||
|
MFP on PXA3xx
|
||||||
|
===============
|
||||||
|
|
||||||
|
Every external I/O pad on PXA3xx (excluding those for special purpose) has
|
||||||
|
one MFP logic associated, and is controlled by one MFP register (MFPR).
|
||||||
|
|
||||||
|
The MFPR has the following bit definitions (for PXA300/PXA310/PXA320):
|
||||||
|
|
||||||
|
31 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
|
||||||
|
+-------------------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||||
|
| RESERVED |PS|PU|PD| DRIVE |SS|SD|SO|EC|EF|ER|--| AF_SEL |
|
||||||
|
+-------------------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||||
|
|
||||||
|
Bit 3: RESERVED
|
||||||
|
Bit 4: EDGE_RISE_EN - enable detection of rising edge on this pin
|
||||||
|
Bit 5: EDGE_FALL_EN - enable detection of falling edge on this pin
|
||||||
|
Bit 6: EDGE_CLEAR - disable edge detection on this pin
|
||||||
|
Bit 7: SLEEP_OE_N - enable outputs during low power modes
|
||||||
|
Bit 8: SLEEP_DATA - output data on the pin during low power modes
|
||||||
|
Bit 9: SLEEP_SEL - selection control for low power modes signals
|
||||||
|
Bit 13: PULLDOWN_EN - enable the internal pull-down resistor on this pin
|
||||||
|
Bit 14: PULLUP_EN - enable the internal pull-up resistor on this pin
|
||||||
|
Bit 15: PULL_SEL - pull state controlled by selected alternate function
|
||||||
|
(0) or by PULL{UP,DOWN}_EN bits (1)
|
||||||
|
|
||||||
|
Bit 0 - 2: AF_SEL - alternate function selection, 8 possibilities, from 0-7
|
||||||
|
Bit 10-12: DRIVE - drive strength and slew rate
|
||||||
|
0b000 - fast 1mA
|
||||||
|
0b001 - fast 2mA
|
||||||
|
0b002 - fast 3mA
|
||||||
|
0b003 - fast 4mA
|
||||||
|
0b004 - slow 6mA
|
||||||
|
0b005 - fast 6mA
|
||||||
|
0b006 - slow 10mA
|
||||||
|
0b007 - fast 10mA
|
||||||
|
|
||||||
|
MFP Design for PXA2xx/PXA3xx
|
||||||
|
==============================
|
||||||
|
|
||||||
|
Due to the difference of pin-mux handling between PXA2xx and PXA3xx, a unified
|
||||||
|
MFP API is introduced to cover both series of processors.
|
||||||
|
|
||||||
|
The basic idea of this design is to introduce definitions for all possible pin
|
||||||
|
configurations, these definitions are processor and platform independent, and
|
||||||
|
the actual API invoked to convert these definitions into register settings and
|
||||||
|
make them effective there-after.
|
||||||
|
|
||||||
|
Files Involved
|
||||||
|
--------------
|
||||||
|
|
||||||
|
- arch/arm/mach-pxa/include/mach/mfp.h
|
||||||
|
|
||||||
|
for
|
||||||
|
1. Unified pin definitions - enum constants for all configurable pins
|
||||||
|
2. processor-neutral bit definitions for a possible MFP configuration
|
||||||
|
|
||||||
|
- arch/arm/mach-pxa/include/mach/mfp-pxa3xx.h
|
||||||
|
|
||||||
|
for PXA3xx specific MFPR register bit definitions and PXA3xx common pin
|
||||||
|
configurations
|
||||||
|
|
||||||
|
- arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
|
||||||
|
|
||||||
|
for PXA2xx specific definitions and PXA25x/PXA27x common pin configurations
|
||||||
|
|
||||||
|
- arch/arm/mach-pxa/include/mach/mfp-pxa25x.h
|
||||||
|
arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
|
||||||
|
arch/arm/mach-pxa/include/mach/mfp-pxa300.h
|
||||||
|
arch/arm/mach-pxa/include/mach/mfp-pxa320.h
|
||||||
|
arch/arm/mach-pxa/include/mach/mfp-pxa930.h
|
||||||
|
|
||||||
|
for processor specific definitions
|
||||||
|
|
||||||
|
- arch/arm/mach-pxa/mfp-pxa3xx.c
|
||||||
|
- arch/arm/mach-pxa/mfp-pxa2xx.c
|
||||||
|
|
||||||
|
for implementation of the pin configuration to take effect for the actual
|
||||||
|
processor.
|
||||||
|
|
||||||
|
Pin Configuration
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
The following comments are copied from mfp.h (see the actual source code
|
||||||
|
for most updated info)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* a possible MFP configuration is represented by a 32-bit integer
|
||||||
|
*
|
||||||
|
* bit 0.. 9 - MFP Pin Number (1024 Pins Maximum)
|
||||||
|
* bit 10..12 - Alternate Function Selection
|
||||||
|
* bit 13..15 - Drive Strength
|
||||||
|
* bit 16..18 - Low Power Mode State
|
||||||
|
* bit 19..20 - Low Power Mode Edge Detection
|
||||||
|
* bit 21..22 - Run Mode Pull State
|
||||||
|
*
|
||||||
|
* to facilitate the definition, the following macros are provided
|
||||||
|
*
|
||||||
|
* MFP_CFG_DEFAULT - default MFP configuration value, with
|
||||||
|
* alternate function = 0,
|
||||||
|
* drive strength = fast 3mA (MFP_DS03X)
|
||||||
|
* low power mode = default
|
||||||
|
* edge detection = none
|
||||||
|
*
|
||||||
|
* MFP_CFG - default MFPR value with alternate function
|
||||||
|
* MFP_CFG_DRV - default MFPR value with alternate function and
|
||||||
|
* pin drive strength
|
||||||
|
* MFP_CFG_LPM - default MFPR value with alternate function and
|
||||||
|
* low power mode
|
||||||
|
* MFP_CFG_X - default MFPR value with alternate function,
|
||||||
|
* pin drive strength and low power mode
|
||||||
|
*/
|
||||||
|
|
||||||
|
Examples of pin configurations are:
|
||||||
|
|
||||||
|
#define GPIO94_SSP3_RXD MFP_CFG_X(GPIO94, AF1, DS08X, FLOAT)
|
||||||
|
|
||||||
|
which reads GPIO94 can be configured as SSP3_RXD, with alternate function
|
||||||
|
selection of 1, driving strength of 0b101, and a float state in low power
|
||||||
|
modes.
|
||||||
|
|
||||||
|
NOTE: this is the default setting of this pin being configured as SSP3_RXD
|
||||||
|
which can be modified a bit in board code, though it is not recommended to
|
||||||
|
do so, simply because this default setting is usually carefully encoded,
|
||||||
|
and is supposed to work in most cases.
|
||||||
|
|
||||||
|
Register Settings
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
Register settings on PXA3xx for a pin configuration is actually very
|
||||||
|
straight-forward, most bits can be converted directly into MFPR value
|
||||||
|
in a easier way. Two sets of MFPR values are calculated: the run-time
|
||||||
|
ones and the low power mode ones, to allow different settings.
|
||||||
|
|
||||||
|
The conversion from a generic pin configuration to the actual register
|
||||||
|
settings on PXA2xx is a bit complicated: many registers are involved,
|
||||||
|
including GAFRx, GPDRx, PGSRx, PWER, PKWR, PFER and PRER. Please see
|
||||||
|
mfp-pxa2xx.c for how the conversion is made.
|
45
Documentation/bad_memory.txt
Normal file
45
Documentation/bad_memory.txt
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
March 2008
|
||||||
|
Jan-Simon Moeller, dl9pf@gmx.de
|
||||||
|
|
||||||
|
|
||||||
|
How to deal with bad memory e.g. reported by memtest86+ ?
|
||||||
|
#########################################################
|
||||||
|
|
||||||
|
There are three possibilities I know of:
|
||||||
|
|
||||||
|
1) Reinsert/swap the memory modules
|
||||||
|
|
||||||
|
2) Buy new modules (best!) or try to exchange the memory
|
||||||
|
if you have spare-parts
|
||||||
|
|
||||||
|
3) Use BadRAM or memmap
|
||||||
|
|
||||||
|
This Howto is about number 3) .
|
||||||
|
|
||||||
|
|
||||||
|
BadRAM
|
||||||
|
######
|
||||||
|
BadRAM is the actively developed and available as kernel-patch
|
||||||
|
here: http://rick.vanrein.org/linux/badram/
|
||||||
|
|
||||||
|
For more details see the BadRAM documentation.
|
||||||
|
|
||||||
|
memmap
|
||||||
|
######
|
||||||
|
|
||||||
|
memmap is already in the kernel and usable as kernel-parameter at
|
||||||
|
boot-time. Its syntax is slightly strange and you may need to
|
||||||
|
calculate the values by yourself!
|
||||||
|
|
||||||
|
Syntax to exclude a memory area (see kernel-parameters.txt for details):
|
||||||
|
memmap=<size>$<address>
|
||||||
|
|
||||||
|
Example: memtest86+ reported here errors at address 0x18691458, 0x18698424 and
|
||||||
|
some others. All had 0x1869xxxx in common, so I chose a pattern of
|
||||||
|
0x18690000,0xffff0000.
|
||||||
|
|
||||||
|
With the numbers of the example above:
|
||||||
|
memmap=64K$0x18690000
|
||||||
|
or
|
||||||
|
memmap=0x10000$0x18690000
|
||||||
|
|
|
@ -9,3 +9,6 @@ cachefeatures.txt
|
||||||
|
|
||||||
Filesystems
|
Filesystems
|
||||||
- Requirements for mounting the root file system.
|
- Requirements for mounting the root file system.
|
||||||
|
|
||||||
|
bfin-gpio-note.txt
|
||||||
|
- Notes in developing/using bfin-gpio driver.
|
||||||
|
|
71
Documentation/blackfin/bfin-gpio-notes.txt
Normal file
71
Documentation/blackfin/bfin-gpio-notes.txt
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
/*
|
||||||
|
* File: Documentation/blackfin/bfin-gpio-note.txt
|
||||||
|
* Based on:
|
||||||
|
* Author:
|
||||||
|
*
|
||||||
|
* Created: $Id: bfin-gpio-note.txt 2008-11-24 16:42 grafyang $
|
||||||
|
* Description: This file contains the notes in developing/using bfin-gpio.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Rev:
|
||||||
|
*
|
||||||
|
* Modified:
|
||||||
|
* Copyright 2004-2008 Analog Devices Inc.
|
||||||
|
*
|
||||||
|
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
1. Blackfin GPIO introduction
|
||||||
|
|
||||||
|
There are many GPIO pins on Blackfin. Most of these pins are muxed to
|
||||||
|
multi-functions. They can be configured as peripheral, or just as GPIO,
|
||||||
|
configured to input with interrupt enabled, or output.
|
||||||
|
|
||||||
|
For detailed information, please see "arch/blackfin/kernel/bfin_gpio.c",
|
||||||
|
or the relevant HRM.
|
||||||
|
|
||||||
|
|
||||||
|
2. Avoiding resource conflict
|
||||||
|
|
||||||
|
Followed function groups are used to avoiding resource conflict,
|
||||||
|
- Use the pin as peripheral,
|
||||||
|
int peripheral_request(unsigned short per, const char *label);
|
||||||
|
int peripheral_request_list(const unsigned short per[], const char *label);
|
||||||
|
void peripheral_free(unsigned short per);
|
||||||
|
void peripheral_free_list(const unsigned short per[]);
|
||||||
|
- Use the pin as GPIO,
|
||||||
|
int bfin_gpio_request(unsigned gpio, const char *label);
|
||||||
|
void bfin_gpio_free(unsigned gpio);
|
||||||
|
- Use the pin as GPIO interrupt,
|
||||||
|
int bfin_gpio_irq_request(unsigned gpio, const char *label);
|
||||||
|
void bfin_gpio_irq_free(unsigned gpio);
|
||||||
|
|
||||||
|
The request functions will record the function state for a certain pin,
|
||||||
|
the free functions will clear it's function state.
|
||||||
|
Once a pin is requested, it can't be requested again before it is freed by
|
||||||
|
previous caller, otherwise kernel will dump stacks, and the request
|
||||||
|
function fail.
|
||||||
|
These functions are wrapped by other functions, most of the users need not
|
||||||
|
care.
|
||||||
|
|
||||||
|
|
||||||
|
3. But there are some exceptions
|
||||||
|
- Kernel permit the identical GPIO be requested both as GPIO and GPIO
|
||||||
|
interrut.
|
||||||
|
Some drivers, like gpio-keys, need this behavior. Kernel only print out
|
||||||
|
warning messages like,
|
||||||
|
bfin-gpio: GPIO 24 is already reserved by gpio-keys: BTN0, and you are
|
||||||
|
configuring it as IRQ!
|
||||||
|
|
||||||
|
Note: Consider the case that, if there are two drivers need the
|
||||||
|
identical GPIO, one of them use it as GPIO, the other use it as
|
||||||
|
GPIO interrupt. This will really cause resource conflict. So if
|
||||||
|
there is any abnormal driver behavior, please check the bfin-gpio
|
||||||
|
warning messages.
|
||||||
|
|
||||||
|
- Kernel permit the identical GPIO be requested from the same driver twice.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -914,7 +914,7 @@ I/O scheduler, a.k.a. elevator, is implemented in two layers. Generic dispatch
|
||||||
queue and specific I/O schedulers. Unless stated otherwise, elevator is used
|
queue and specific I/O schedulers. Unless stated otherwise, elevator is used
|
||||||
to refer to both parts and I/O scheduler to specific I/O schedulers.
|
to refer to both parts and I/O scheduler to specific I/O schedulers.
|
||||||
|
|
||||||
Block layer implements generic dispatch queue in ll_rw_blk.c and elevator.c.
|
Block layer implements generic dispatch queue in block/*.c.
|
||||||
The generic dispatch queue is responsible for properly ordering barrier
|
The generic dispatch queue is responsible for properly ordering barrier
|
||||||
requests, requeueing, handling non-fs requests and all other subtleties.
|
requests, requeueing, handling non-fs requests and all other subtleties.
|
||||||
|
|
||||||
|
@ -926,8 +926,8 @@ be built inside the kernel. Each queue can choose different one and can also
|
||||||
change to another one dynamically.
|
change to another one dynamically.
|
||||||
|
|
||||||
A block layer call to the i/o scheduler follows the convention elv_xxx(). This
|
A block layer call to the i/o scheduler follows the convention elv_xxx(). This
|
||||||
calls elevator_xxx_fn in the elevator switch (drivers/block/elevator.c). Oh,
|
calls elevator_xxx_fn in the elevator switch (block/elevator.c). Oh, xxx
|
||||||
xxx and xxx might not match exactly, but use your imagination. If an elevator
|
and xxx might not match exactly, but use your imagination. If an elevator
|
||||||
doesn't implement a function, the switch does nothing or some minimal house
|
doesn't implement a function, the switch does nothing or some minimal house
|
||||||
keeping work.
|
keeping work.
|
||||||
|
|
||||||
|
|
|
@ -227,7 +227,6 @@ Each cgroup is represented by a directory in the cgroup file system
|
||||||
containing the following files describing that cgroup:
|
containing the following files describing that cgroup:
|
||||||
|
|
||||||
- tasks: list of tasks (by pid) attached to that cgroup
|
- tasks: list of tasks (by pid) attached to that cgroup
|
||||||
- releasable flag: cgroup currently removeable?
|
|
||||||
- notify_on_release flag: run the release agent on exit?
|
- notify_on_release flag: run the release agent on exit?
|
||||||
- release_agent: the path to use for release notifications (this file
|
- release_agent: the path to use for release notifications (this file
|
||||||
exists in the top cgroup only)
|
exists in the top cgroup only)
|
||||||
|
@ -360,7 +359,7 @@ Now you want to do something with this cgroup.
|
||||||
|
|
||||||
In this directory you can find several files:
|
In this directory you can find several files:
|
||||||
# ls
|
# ls
|
||||||
notify_on_release releasable tasks
|
notify_on_release tasks
|
||||||
(plus whatever files added by the attached subsystems)
|
(plus whatever files added by the attached subsystems)
|
||||||
|
|
||||||
Now attach your shell to this cgroup:
|
Now attach your shell to this cgroup:
|
||||||
|
@ -479,7 +478,6 @@ newly-created cgroup if an error occurs after this subsystem's
|
||||||
create() method has been called for the new cgroup).
|
create() method has been called for the new cgroup).
|
||||||
|
|
||||||
void pre_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp);
|
void pre_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp);
|
||||||
(cgroup_mutex held by caller)
|
|
||||||
|
|
||||||
Called before checking the reference count on each subsystem. This may
|
Called before checking the reference count on each subsystem. This may
|
||||||
be useful for subsystems which have some extra references even if
|
be useful for subsystems which have some extra references even if
|
||||||
|
@ -498,6 +496,7 @@ remain valid while the caller holds cgroup_mutex.
|
||||||
|
|
||||||
void attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
void attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
||||||
struct cgroup *old_cgrp, struct task_struct *task)
|
struct cgroup *old_cgrp, struct task_struct *task)
|
||||||
|
(cgroup_mutex held by caller)
|
||||||
|
|
||||||
Called after the task has been attached to the cgroup, to allow any
|
Called after the task has been attached to the cgroup, to allow any
|
||||||
post-attachment activity that requires memory allocations or blocking.
|
post-attachment activity that requires memory allocations or blocking.
|
||||||
|
@ -511,6 +510,7 @@ void exit(struct cgroup_subsys *ss, struct task_struct *task)
|
||||||
Called during task exit.
|
Called during task exit.
|
||||||
|
|
||||||
int populate(struct cgroup_subsys *ss, struct cgroup *cgrp)
|
int populate(struct cgroup_subsys *ss, struct cgroup *cgrp)
|
||||||
|
(cgroup_mutex held by caller)
|
||||||
|
|
||||||
Called after creation of a cgroup to allow a subsystem to populate
|
Called after creation of a cgroup to allow a subsystem to populate
|
||||||
the cgroup directory with file entries. The subsystem should make
|
the cgroup directory with file entries. The subsystem should make
|
||||||
|
@ -520,6 +520,7 @@ method can return an error code, the error code is currently not
|
||||||
always handled well.
|
always handled well.
|
||||||
|
|
||||||
void post_clone(struct cgroup_subsys *ss, struct cgroup *cgrp)
|
void post_clone(struct cgroup_subsys *ss, struct cgroup *cgrp)
|
||||||
|
(cgroup_mutex held by caller)
|
||||||
|
|
||||||
Called at the end of cgroup_clone() to do any paramater
|
Called at the end of cgroup_clone() to do any paramater
|
||||||
initialization which might be required before a task could attach. For
|
initialization which might be required before a task could attach. For
|
||||||
|
@ -527,7 +528,7 @@ example in cpusets, no task may attach before 'cpus' and 'mems' are set
|
||||||
up.
|
up.
|
||||||
|
|
||||||
void bind(struct cgroup_subsys *ss, struct cgroup *root)
|
void bind(struct cgroup_subsys *ss, struct cgroup *root)
|
||||||
(cgroup_mutex held by caller)
|
(cgroup_mutex and ss->hierarchy_mutex held by caller)
|
||||||
|
|
||||||
Called when a cgroup subsystem is rebound to a different hierarchy
|
Called when a cgroup subsystem is rebound to a different hierarchy
|
||||||
and root cgroup. Currently this will only involve movement between
|
and root cgroup. Currently this will only involve movement between
|
||||||
|
|
342
Documentation/controllers/memcg_test.txt
Normal file
342
Documentation/controllers/memcg_test.txt
Normal file
|
@ -0,0 +1,342 @@
|
||||||
|
Memory Resource Controller(Memcg) Implementation Memo.
|
||||||
|
Last Updated: 2008/12/15
|
||||||
|
Base Kernel Version: based on 2.6.28-rc8-mm.
|
||||||
|
|
||||||
|
Because VM is getting complex (one of reasons is memcg...), memcg's behavior
|
||||||
|
is complex. This is a document for memcg's internal behavior.
|
||||||
|
Please note that implementation details can be changed.
|
||||||
|
|
||||||
|
(*) Topics on API should be in Documentation/controllers/memory.txt)
|
||||||
|
|
||||||
|
0. How to record usage ?
|
||||||
|
2 objects are used.
|
||||||
|
|
||||||
|
page_cgroup ....an object per page.
|
||||||
|
Allocated at boot or memory hotplug. Freed at memory hot removal.
|
||||||
|
|
||||||
|
swap_cgroup ... an entry per swp_entry.
|
||||||
|
Allocated at swapon(). Freed at swapoff().
|
||||||
|
|
||||||
|
The page_cgroup has USED bit and double count against a page_cgroup never
|
||||||
|
occurs. swap_cgroup is used only when a charged page is swapped-out.
|
||||||
|
|
||||||
|
1. Charge
|
||||||
|
|
||||||
|
a page/swp_entry may be charged (usage += PAGE_SIZE) at
|
||||||
|
|
||||||
|
mem_cgroup_newpage_charge()
|
||||||
|
Called at new page fault and Copy-On-Write.
|
||||||
|
|
||||||
|
mem_cgroup_try_charge_swapin()
|
||||||
|
Called at do_swap_page() (page fault on swap entry) and swapoff.
|
||||||
|
Followed by charge-commit-cancel protocol. (With swap accounting)
|
||||||
|
At commit, a charge recorded in swap_cgroup is removed.
|
||||||
|
|
||||||
|
mem_cgroup_cache_charge()
|
||||||
|
Called at add_to_page_cache()
|
||||||
|
|
||||||
|
mem_cgroup_cache_charge_swapin()
|
||||||
|
Called at shmem's swapin.
|
||||||
|
|
||||||
|
mem_cgroup_prepare_migration()
|
||||||
|
Called before migration. "extra" charge is done and followed by
|
||||||
|
charge-commit-cancel protocol.
|
||||||
|
At commit, charge against oldpage or newpage will be committed.
|
||||||
|
|
||||||
|
2. Uncharge
|
||||||
|
a page/swp_entry may be uncharged (usage -= PAGE_SIZE) by
|
||||||
|
|
||||||
|
mem_cgroup_uncharge_page()
|
||||||
|
Called when an anonymous page is fully unmapped. I.e., mapcount goes
|
||||||
|
to 0. If the page is SwapCache, uncharge is delayed until
|
||||||
|
mem_cgroup_uncharge_swapcache().
|
||||||
|
|
||||||
|
mem_cgroup_uncharge_cache_page()
|
||||||
|
Called when a page-cache is deleted from radix-tree. If the page is
|
||||||
|
SwapCache, uncharge is delayed until mem_cgroup_uncharge_swapcache().
|
||||||
|
|
||||||
|
mem_cgroup_uncharge_swapcache()
|
||||||
|
Called when SwapCache is removed from radix-tree. The charge itself
|
||||||
|
is moved to swap_cgroup. (If mem+swap controller is disabled, no
|
||||||
|
charge to swap occurs.)
|
||||||
|
|
||||||
|
mem_cgroup_uncharge_swap()
|
||||||
|
Called when swp_entry's refcnt goes down to 0. A charge against swap
|
||||||
|
disappears.
|
||||||
|
|
||||||
|
mem_cgroup_end_migration(old, new)
|
||||||
|
At success of migration old is uncharged (if necessary), a charge
|
||||||
|
to new page is committed. At failure, charge to old page is committed.
|
||||||
|
|
||||||
|
3. charge-commit-cancel
|
||||||
|
In some case, we can't know this "charge" is valid or not at charging
|
||||||
|
(because of races).
|
||||||
|
To handle such case, there are charge-commit-cancel functions.
|
||||||
|
mem_cgroup_try_charge_XXX
|
||||||
|
mem_cgroup_commit_charge_XXX
|
||||||
|
mem_cgroup_cancel_charge_XXX
|
||||||
|
these are used in swap-in and migration.
|
||||||
|
|
||||||
|
At try_charge(), there are no flags to say "this page is charged".
|
||||||
|
at this point, usage += PAGE_SIZE.
|
||||||
|
|
||||||
|
At commit(), the function checks the page should be charged or not
|
||||||
|
and set flags or avoid charging.(usage -= PAGE_SIZE)
|
||||||
|
|
||||||
|
At cancel(), simply usage -= PAGE_SIZE.
|
||||||
|
|
||||||
|
Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
|
||||||
|
|
||||||
|
4. Anonymous
|
||||||
|
Anonymous page is newly allocated at
|
||||||
|
- page fault into MAP_ANONYMOUS mapping.
|
||||||
|
- Copy-On-Write.
|
||||||
|
It is charged right after it's allocated before doing any page table
|
||||||
|
related operations. Of course, it's uncharged when another page is used
|
||||||
|
for the fault address.
|
||||||
|
|
||||||
|
At freeing anonymous page (by exit() or munmap()), zap_pte() is called
|
||||||
|
and pages for ptes are freed one by one.(see mm/memory.c). Uncharges
|
||||||
|
are done at page_remove_rmap() when page_mapcount() goes down to 0.
|
||||||
|
|
||||||
|
Another page freeing is by page-reclaim (vmscan.c) and anonymous
|
||||||
|
pages are swapped out. In this case, the page is marked as
|
||||||
|
PageSwapCache(). uncharge() routine doesn't uncharge the page marked
|
||||||
|
as SwapCache(). It's delayed until __delete_from_swap_cache().
|
||||||
|
|
||||||
|
4.1 Swap-in.
|
||||||
|
At swap-in, the page is taken from swap-cache. There are 2 cases.
|
||||||
|
|
||||||
|
(a) If the SwapCache is newly allocated and read, it has no charges.
|
||||||
|
(b) If the SwapCache has been mapped by processes, it has been
|
||||||
|
charged already.
|
||||||
|
|
||||||
|
This swap-in is one of the most complicated work. In do_swap_page(),
|
||||||
|
following events occur when pte is unchanged.
|
||||||
|
|
||||||
|
(1) the page (SwapCache) is looked up.
|
||||||
|
(2) lock_page()
|
||||||
|
(3) try_charge_swapin()
|
||||||
|
(4) reuse_swap_page() (may call delete_swap_cache())
|
||||||
|
(5) commit_charge_swapin()
|
||||||
|
(6) swap_free().
|
||||||
|
|
||||||
|
Considering following situation for example.
|
||||||
|
|
||||||
|
(A) The page has not been charged before (2) and reuse_swap_page()
|
||||||
|
doesn't call delete_from_swap_cache().
|
||||||
|
(B) The page has not been charged before (2) and reuse_swap_page()
|
||||||
|
calls delete_from_swap_cache().
|
||||||
|
(C) The page has been charged before (2) and reuse_swap_page() doesn't
|
||||||
|
call delete_from_swap_cache().
|
||||||
|
(D) The page has been charged before (2) and reuse_swap_page() calls
|
||||||
|
delete_from_swap_cache().
|
||||||
|
|
||||||
|
memory.usage/memsw.usage changes to this page/swp_entry will be
|
||||||
|
Case (A) (B) (C) (D)
|
||||||
|
Event
|
||||||
|
Before (2) 0/ 1 0/ 1 1/ 1 1/ 1
|
||||||
|
===========================================
|
||||||
|
(3) +1/+1 +1/+1 +1/+1 +1/+1
|
||||||
|
(4) - 0/ 0 - -1/ 0
|
||||||
|
(5) 0/-1 0/ 0 -1/-1 0/ 0
|
||||||
|
(6) - 0/-1 - 0/-1
|
||||||
|
===========================================
|
||||||
|
Result 1/ 1 1/ 1 1/ 1 1/ 1
|
||||||
|
|
||||||
|
In any cases, charges to this page should be 1/ 1.
|
||||||
|
|
||||||
|
4.2 Swap-out.
|
||||||
|
At swap-out, typical state transition is below.
|
||||||
|
|
||||||
|
(a) add to swap cache. (marked as SwapCache)
|
||||||
|
swp_entry's refcnt += 1.
|
||||||
|
(b) fully unmapped.
|
||||||
|
swp_entry's refcnt += # of ptes.
|
||||||
|
(c) write back to swap.
|
||||||
|
(d) delete from swap cache. (remove from SwapCache)
|
||||||
|
swp_entry's refcnt -= 1.
|
||||||
|
|
||||||
|
|
||||||
|
At (b), the page is marked as SwapCache and not uncharged.
|
||||||
|
At (d), the page is removed from SwapCache and a charge in page_cgroup
|
||||||
|
is moved to swap_cgroup.
|
||||||
|
|
||||||
|
Finally, at task exit,
|
||||||
|
(e) zap_pte() is called and swp_entry's refcnt -=1 -> 0.
|
||||||
|
Here, a charge in swap_cgroup disappears.
|
||||||
|
|
||||||
|
5. Page Cache
|
||||||
|
Page Cache is charged at
|
||||||
|
- add_to_page_cache_locked().
|
||||||
|
|
||||||
|
uncharged at
|
||||||
|
- __remove_from_page_cache().
|
||||||
|
|
||||||
|
The logic is very clear. (About migration, see below)
|
||||||
|
Note: __remove_from_page_cache() is called by remove_from_page_cache()
|
||||||
|
and __remove_mapping().
|
||||||
|
|
||||||
|
6. Shmem(tmpfs) Page Cache
|
||||||
|
Memcg's charge/uncharge have special handlers of shmem. The best way
|
||||||
|
to understand shmem's page state transition is to read mm/shmem.c.
|
||||||
|
But brief explanation of the behavior of memcg around shmem will be
|
||||||
|
helpful to understand the logic.
|
||||||
|
|
||||||
|
Shmem's page (just leaf page, not direct/indirect block) can be on
|
||||||
|
- radix-tree of shmem's inode.
|
||||||
|
- SwapCache.
|
||||||
|
- Both on radix-tree and SwapCache. This happens at swap-in
|
||||||
|
and swap-out,
|
||||||
|
|
||||||
|
It's charged when...
|
||||||
|
- A new page is added to shmem's radix-tree.
|
||||||
|
- A swp page is read. (move a charge from swap_cgroup to page_cgroup)
|
||||||
|
It's uncharged when
|
||||||
|
- A page is removed from radix-tree and not SwapCache.
|
||||||
|
- When SwapCache is removed, a charge is moved to swap_cgroup.
|
||||||
|
- When swp_entry's refcnt goes down to 0, a charge in swap_cgroup
|
||||||
|
disappears.
|
||||||
|
|
||||||
|
7. Page Migration
|
||||||
|
One of the most complicated functions is page-migration-handler.
|
||||||
|
Memcg has 2 routines. Assume that we are migrating a page's contents
|
||||||
|
from OLDPAGE to NEWPAGE.
|
||||||
|
|
||||||
|
Usual migration logic is..
|
||||||
|
(a) remove the page from LRU.
|
||||||
|
(b) allocate NEWPAGE (migration target)
|
||||||
|
(c) lock by lock_page().
|
||||||
|
(d) unmap all mappings.
|
||||||
|
(e-1) If necessary, replace entry in radix-tree.
|
||||||
|
(e-2) move contents of a page.
|
||||||
|
(f) map all mappings again.
|
||||||
|
(g) pushback the page to LRU.
|
||||||
|
(-) OLDPAGE will be freed.
|
||||||
|
|
||||||
|
Before (g), memcg should complete all necessary charge/uncharge to
|
||||||
|
NEWPAGE/OLDPAGE.
|
||||||
|
|
||||||
|
The point is....
|
||||||
|
- If OLDPAGE is anonymous, all charges will be dropped at (d) because
|
||||||
|
try_to_unmap() drops all mapcount and the page will not be
|
||||||
|
SwapCache.
|
||||||
|
|
||||||
|
- If OLDPAGE is SwapCache, charges will be kept at (g) because
|
||||||
|
__delete_from_swap_cache() isn't called at (e-1)
|
||||||
|
|
||||||
|
- If OLDPAGE is page-cache, charges will be kept at (g) because
|
||||||
|
remove_from_swap_cache() isn't called at (e-1)
|
||||||
|
|
||||||
|
memcg provides following hooks.
|
||||||
|
|
||||||
|
- mem_cgroup_prepare_migration(OLDPAGE)
|
||||||
|
Called after (b) to account a charge (usage += PAGE_SIZE) against
|
||||||
|
memcg which OLDPAGE belongs to.
|
||||||
|
|
||||||
|
- mem_cgroup_end_migration(OLDPAGE, NEWPAGE)
|
||||||
|
Called after (f) before (g).
|
||||||
|
If OLDPAGE is used, commit OLDPAGE again. If OLDPAGE is already
|
||||||
|
charged, a charge by prepare_migration() is automatically canceled.
|
||||||
|
If NEWPAGE is used, commit NEWPAGE and uncharge OLDPAGE.
|
||||||
|
|
||||||
|
But zap_pte() (by exit or munmap) can be called while migration,
|
||||||
|
we have to check if OLDPAGE/NEWPAGE is a valid page after commit().
|
||||||
|
|
||||||
|
8. LRU
|
||||||
|
Each memcg has its own private LRU. Now, it's handling is under global
|
||||||
|
VM's control (means that it's handled under global zone->lru_lock).
|
||||||
|
Almost all routines around memcg's LRU is called by global LRU's
|
||||||
|
list management functions under zone->lru_lock().
|
||||||
|
|
||||||
|
A special function is mem_cgroup_isolate_pages(). This scans
|
||||||
|
memcg's private LRU and call __isolate_lru_page() to extract a page
|
||||||
|
from LRU.
|
||||||
|
(By __isolate_lru_page(), the page is removed from both of global and
|
||||||
|
private LRU.)
|
||||||
|
|
||||||
|
|
||||||
|
9. Typical Tests.
|
||||||
|
|
||||||
|
Tests for racy cases.
|
||||||
|
|
||||||
|
9.1 Small limit to memcg.
|
||||||
|
When you do test to do racy case, it's good test to set memcg's limit
|
||||||
|
to be very small rather than GB. Many races found in the test under
|
||||||
|
xKB or xxMB limits.
|
||||||
|
(Memory behavior under GB and Memory behavior under MB shows very
|
||||||
|
different situation.)
|
||||||
|
|
||||||
|
9.2 Shmem
|
||||||
|
Historically, memcg's shmem handling was poor and we saw some amount
|
||||||
|
of troubles here. This is because shmem is page-cache but can be
|
||||||
|
SwapCache. Test with shmem/tmpfs is always good test.
|
||||||
|
|
||||||
|
9.3 Migration
|
||||||
|
For NUMA, migration is an another special case. To do easy test, cpuset
|
||||||
|
is useful. Following is a sample script to do migration.
|
||||||
|
|
||||||
|
mount -t cgroup -o cpuset none /opt/cpuset
|
||||||
|
|
||||||
|
mkdir /opt/cpuset/01
|
||||||
|
echo 1 > /opt/cpuset/01/cpuset.cpus
|
||||||
|
echo 0 > /opt/cpuset/01/cpuset.mems
|
||||||
|
echo 1 > /opt/cpuset/01/cpuset.memory_migrate
|
||||||
|
mkdir /opt/cpuset/02
|
||||||
|
echo 1 > /opt/cpuset/02/cpuset.cpus
|
||||||
|
echo 1 > /opt/cpuset/02/cpuset.mems
|
||||||
|
echo 1 > /opt/cpuset/02/cpuset.memory_migrate
|
||||||
|
|
||||||
|
In above set, when you moves a task from 01 to 02, page migration to
|
||||||
|
node 0 to node 1 will occur. Following is a script to migrate all
|
||||||
|
under cpuset.
|
||||||
|
--
|
||||||
|
move_task()
|
||||||
|
{
|
||||||
|
for pid in $1
|
||||||
|
do
|
||||||
|
/bin/echo $pid >$2/tasks 2>/dev/null
|
||||||
|
echo -n $pid
|
||||||
|
echo -n " "
|
||||||
|
done
|
||||||
|
echo END
|
||||||
|
}
|
||||||
|
|
||||||
|
G1_TASK=`cat ${G1}/tasks`
|
||||||
|
G2_TASK=`cat ${G2}/tasks`
|
||||||
|
move_task "${G1_TASK}" ${G2} &
|
||||||
|
--
|
||||||
|
9.4 Memory hotplug.
|
||||||
|
memory hotplug test is one of good test.
|
||||||
|
to offline memory, do following.
|
||||||
|
# echo offline > /sys/devices/system/memory/memoryXXX/state
|
||||||
|
(XXX is the place of memory)
|
||||||
|
This is an easy way to test page migration, too.
|
||||||
|
|
||||||
|
9.5 mkdir/rmdir
|
||||||
|
When using hierarchy, mkdir/rmdir test should be done.
|
||||||
|
Use tests like the following.
|
||||||
|
|
||||||
|
echo 1 >/opt/cgroup/01/memory/use_hierarchy
|
||||||
|
mkdir /opt/cgroup/01/child_a
|
||||||
|
mkdir /opt/cgroup/01/child_b
|
||||||
|
|
||||||
|
set limit to 01.
|
||||||
|
add limit to 01/child_b
|
||||||
|
run jobs under child_a and child_b
|
||||||
|
|
||||||
|
create/delete following groups at random while jobs are running.
|
||||||
|
/opt/cgroup/01/child_a/child_aa
|
||||||
|
/opt/cgroup/01/child_b/child_bb
|
||||||
|
/opt/cgroup/01/child_c
|
||||||
|
|
||||||
|
running new jobs in new group is also good.
|
||||||
|
|
||||||
|
9.6 Mount with other subsystems.
|
||||||
|
Mounting with other subsystems is a good test because there is a
|
||||||
|
race and lock dependency with other cgroup subsystems.
|
||||||
|
|
||||||
|
example)
|
||||||
|
# mount -t cgroup none /cgroup -t cpuset,memory,cpu,devices
|
||||||
|
|
||||||
|
and do task move, mkdir, rmdir etc...under this.
|
|
@ -137,7 +137,32 @@ behind this approach is that a cgroup that aggressively uses a shared
|
||||||
page will eventually get charged for it (once it is uncharged from
|
page will eventually get charged for it (once it is uncharged from
|
||||||
the cgroup that brought it in -- this will happen on memory pressure).
|
the cgroup that brought it in -- this will happen on memory pressure).
|
||||||
|
|
||||||
2.4 Reclaim
|
Exception: If CONFIG_CGROUP_CGROUP_MEM_RES_CTLR_SWAP is not used..
|
||||||
|
When you do swapoff and make swapped-out pages of shmem(tmpfs) to
|
||||||
|
be backed into memory in force, charges for pages are accounted against the
|
||||||
|
caller of swapoff rather than the users of shmem.
|
||||||
|
|
||||||
|
|
||||||
|
2.4 Swap Extension (CONFIG_CGROUP_MEM_RES_CTLR_SWAP)
|
||||||
|
Swap Extension allows you to record charge for swap. A swapped-in page is
|
||||||
|
charged back to original page allocator if possible.
|
||||||
|
|
||||||
|
When swap is accounted, following files are added.
|
||||||
|
- memory.memsw.usage_in_bytes.
|
||||||
|
- memory.memsw.limit_in_bytes.
|
||||||
|
|
||||||
|
usage of mem+swap is limited by memsw.limit_in_bytes.
|
||||||
|
|
||||||
|
Note: why 'mem+swap' rather than swap.
|
||||||
|
The global LRU(kswapd) can swap out arbitrary pages. Swap-out means
|
||||||
|
to move account from memory to swap...there is no change in usage of
|
||||||
|
mem+swap.
|
||||||
|
|
||||||
|
In other words, when we want to limit the usage of swap without affecting
|
||||||
|
global LRU, mem+swap limit is better than just limiting swap from OS point
|
||||||
|
of view.
|
||||||
|
|
||||||
|
2.5 Reclaim
|
||||||
|
|
||||||
Each cgroup maintains a per cgroup LRU that consists of an active
|
Each cgroup maintains a per cgroup LRU that consists of an active
|
||||||
and inactive list. When a cgroup goes over its limit, we first try
|
and inactive list. When a cgroup goes over its limit, we first try
|
||||||
|
@ -207,12 +232,6 @@ exceeded.
|
||||||
The memory.stat file gives accounting information. Now, the number of
|
The memory.stat file gives accounting information. Now, the number of
|
||||||
caches, RSS and Active pages/Inactive pages are shown.
|
caches, RSS and Active pages/Inactive pages are shown.
|
||||||
|
|
||||||
The memory.force_empty gives an interface to drop *all* charges by force.
|
|
||||||
|
|
||||||
# echo 1 > memory.force_empty
|
|
||||||
|
|
||||||
will drop all charges in cgroup. Currently, this is maintained for test.
|
|
||||||
|
|
||||||
4. Testing
|
4. Testing
|
||||||
|
|
||||||
Balbir posted lmbench, AIM9, LTP and vmmstress results [10] and [11].
|
Balbir posted lmbench, AIM9, LTP and vmmstress results [10] and [11].
|
||||||
|
@ -242,10 +261,106 @@ reclaimed.
|
||||||
|
|
||||||
A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a
|
A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a
|
||||||
cgroup might have some charge associated with it, even though all
|
cgroup might have some charge associated with it, even though all
|
||||||
tasks have migrated away from it. Such charges are automatically dropped at
|
tasks have migrated away from it.
|
||||||
rmdir() if there are no tasks.
|
Such charges are freed(at default) or moved to its parent. When moved,
|
||||||
|
both of RSS and CACHES are moved to parent.
|
||||||
|
If both of them are busy, rmdir() returns -EBUSY. See 5.1 Also.
|
||||||
|
|
||||||
5. TODO
|
Charges recorded in swap information is not updated at removal of cgroup.
|
||||||
|
Recorded information is discarded and a cgroup which uses swap (swapcache)
|
||||||
|
will be charged as a new owner of it.
|
||||||
|
|
||||||
|
|
||||||
|
5. Misc. interfaces.
|
||||||
|
|
||||||
|
5.1 force_empty
|
||||||
|
memory.force_empty interface is provided to make cgroup's memory usage empty.
|
||||||
|
You can use this interface only when the cgroup has no tasks.
|
||||||
|
When writing anything to this
|
||||||
|
|
||||||
|
# echo 0 > memory.force_empty
|
||||||
|
|
||||||
|
Almost all pages tracked by this memcg will be unmapped and freed. Some of
|
||||||
|
pages cannot be freed because it's locked or in-use. Such pages are moved
|
||||||
|
to parent and this cgroup will be empty. But this may return -EBUSY in
|
||||||
|
some too busy case.
|
||||||
|
|
||||||
|
Typical use case of this interface is that calling this before rmdir().
|
||||||
|
Because rmdir() moves all pages to parent, some out-of-use page caches can be
|
||||||
|
moved to the parent. If you want to avoid that, force_empty will be useful.
|
||||||
|
|
||||||
|
5.2 stat file
|
||||||
|
memory.stat file includes following statistics (now)
|
||||||
|
cache - # of pages from page-cache and shmem.
|
||||||
|
rss - # of pages from anonymous memory.
|
||||||
|
pgpgin - # of event of charging
|
||||||
|
pgpgout - # of event of uncharging
|
||||||
|
active_anon - # of pages on active lru of anon, shmem.
|
||||||
|
inactive_anon - # of pages on active lru of anon, shmem
|
||||||
|
active_file - # of pages on active lru of file-cache
|
||||||
|
inactive_file - # of pages on inactive lru of file cache
|
||||||
|
unevictable - # of pages cannot be reclaimed.(mlocked etc)
|
||||||
|
|
||||||
|
Below is depend on CONFIG_DEBUG_VM.
|
||||||
|
inactive_ratio - VM inernal parameter. (see mm/page_alloc.c)
|
||||||
|
recent_rotated_anon - VM internal parameter. (see mm/vmscan.c)
|
||||||
|
recent_rotated_file - VM internal parameter. (see mm/vmscan.c)
|
||||||
|
recent_scanned_anon - VM internal parameter. (see mm/vmscan.c)
|
||||||
|
recent_scanned_file - VM internal parameter. (see mm/vmscan.c)
|
||||||
|
|
||||||
|
Memo:
|
||||||
|
recent_rotated means recent frequency of lru rotation.
|
||||||
|
recent_scanned means recent # of scans to lru.
|
||||||
|
showing for better debug please see the code for meanings.
|
||||||
|
|
||||||
|
|
||||||
|
5.3 swappiness
|
||||||
|
Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only.
|
||||||
|
|
||||||
|
Following cgroup's swapiness can't be changed.
|
||||||
|
- root cgroup (uses /proc/sys/vm/swappiness).
|
||||||
|
- a cgroup which uses hierarchy and it has child cgroup.
|
||||||
|
- a cgroup which uses hierarchy and not the root of hierarchy.
|
||||||
|
|
||||||
|
|
||||||
|
6. Hierarchy support
|
||||||
|
|
||||||
|
The memory controller supports a deep hierarchy and hierarchical accounting.
|
||||||
|
The hierarchy is created by creating the appropriate cgroups in the
|
||||||
|
cgroup filesystem. Consider for example, the following cgroup filesystem
|
||||||
|
hierarchy
|
||||||
|
|
||||||
|
root
|
||||||
|
/ | \
|
||||||
|
/ | \
|
||||||
|
a b c
|
||||||
|
| \
|
||||||
|
| \
|
||||||
|
d e
|
||||||
|
|
||||||
|
In the diagram above, with hierarchical accounting enabled, all memory
|
||||||
|
usage of e, is accounted to its ancestors up until the root (i.e, c and root),
|
||||||
|
that has memory.use_hierarchy enabled. If one of the ancestors goes over its
|
||||||
|
limit, the reclaim algorithm reclaims from the tasks in the ancestor and the
|
||||||
|
children of the ancestor.
|
||||||
|
|
||||||
|
6.1 Enabling hierarchical accounting and reclaim
|
||||||
|
|
||||||
|
The memory controller by default disables the hierarchy feature. Support
|
||||||
|
can be enabled by writing 1 to memory.use_hierarchy file of the root cgroup
|
||||||
|
|
||||||
|
# echo 1 > memory.use_hierarchy
|
||||||
|
|
||||||
|
The feature can be disabled by
|
||||||
|
|
||||||
|
# echo 0 > memory.use_hierarchy
|
||||||
|
|
||||||
|
NOTE1: Enabling/disabling will fail if the cgroup already has other
|
||||||
|
cgroups created below it.
|
||||||
|
|
||||||
|
NOTE2: This feature can be enabled/disabled per subtree.
|
||||||
|
|
||||||
|
7. TODO
|
||||||
|
|
||||||
1. Add support for accounting huge pages (as a separate controller)
|
1. Add support for accounting huge pages (as a separate controller)
|
||||||
2. Make per-cgroup scanner reclaim not-shared pages first
|
2. Make per-cgroup scanner reclaim not-shared pages first
|
||||||
|
|
|
@ -50,16 +50,17 @@ additional_cpus=n (*) Use this to limit hotpluggable cpus. This option sets
|
||||||
cpu_possible_map = cpu_present_map + additional_cpus
|
cpu_possible_map = cpu_present_map + additional_cpus
|
||||||
|
|
||||||
(*) Option valid only for following architectures
|
(*) Option valid only for following architectures
|
||||||
- x86_64, ia64
|
- ia64
|
||||||
|
|
||||||
ia64 and x86_64 use the number of disabled local apics in ACPI tables MADT
|
ia64 uses the number of disabled local apics in ACPI tables MADT to
|
||||||
to determine the number of potentially hot-pluggable cpus. The implementation
|
determine the number of potentially hot-pluggable cpus. The implementation
|
||||||
should only rely on this to count the # of cpus, but *MUST* not rely on the
|
should only rely on this to count the # of cpus, but *MUST* not rely
|
||||||
apicid values in those tables for disabled apics. In the event BIOS doesn't
|
on the apicid values in those tables for disabled apics. In the event
|
||||||
mark such hot-pluggable cpus as disabled entries, one could use this
|
BIOS doesn't mark such hot-pluggable cpus as disabled entries, one could
|
||||||
parameter "additional_cpus=x" to represent those cpus in the cpu_possible_map.
|
use this parameter "additional_cpus=x" to represent those cpus in the
|
||||||
|
cpu_possible_map.
|
||||||
|
|
||||||
possible_cpus=n [s390 only] use this to set hotpluggable cpus.
|
possible_cpus=n [s390,x86_64] use this to set hotpluggable cpus.
|
||||||
This option sets possible_cpus bits in
|
This option sets possible_cpus bits in
|
||||||
cpu_possible_map. Thus keeping the numbers of bits set
|
cpu_possible_map. Thus keeping the numbers of bits set
|
||||||
constant even if the machine gets rebooted.
|
constant even if the machine gets rebooted.
|
||||||
|
|
|
@ -31,3 +31,51 @@ not defined by include/asm-XXX/topology.h:
|
||||||
2) core_id: 0
|
2) core_id: 0
|
||||||
3) thread_siblings: just the given CPU
|
3) thread_siblings: just the given CPU
|
||||||
4) core_siblings: just the given CPU
|
4) core_siblings: just the given CPU
|
||||||
|
|
||||||
|
Additionally, cpu topology information is provided under
|
||||||
|
/sys/devices/system/cpu and includes these files. The internal
|
||||||
|
source for the output is in brackets ("[]").
|
||||||
|
|
||||||
|
kernel_max: the maximum cpu index allowed by the kernel configuration.
|
||||||
|
[NR_CPUS-1]
|
||||||
|
|
||||||
|
offline: cpus that are not online because they have been
|
||||||
|
HOTPLUGGED off (see cpu-hotplug.txt) or exceed the limit
|
||||||
|
of cpus allowed by the kernel configuration (kernel_max
|
||||||
|
above). [~cpu_online_mask + cpus >= NR_CPUS]
|
||||||
|
|
||||||
|
online: cpus that are online and being scheduled [cpu_online_mask]
|
||||||
|
|
||||||
|
possible: cpus that have been allocated resources and can be
|
||||||
|
brought online if they are present. [cpu_possible_mask]
|
||||||
|
|
||||||
|
present: cpus that have been identified as being present in the
|
||||||
|
system. [cpu_present_mask]
|
||||||
|
|
||||||
|
The format for the above output is compatible with cpulist_parse()
|
||||||
|
[see <linux/cpumask.h>]. Some examples follow.
|
||||||
|
|
||||||
|
In this example, there are 64 cpus in the system but cpus 32-63 exceed
|
||||||
|
the kernel max which is limited to 0..31 by the NR_CPUS config option
|
||||||
|
being 32. Note also that cpus 2 and 4-31 are not online but could be
|
||||||
|
brought online as they are both present and possible.
|
||||||
|
|
||||||
|
kernel_max: 31
|
||||||
|
offline: 2,4-31,32-63
|
||||||
|
online: 0-1,3
|
||||||
|
possible: 0-31
|
||||||
|
present: 0-31
|
||||||
|
|
||||||
|
In this example, the NR_CPUS config option is 128, but the kernel was
|
||||||
|
started with possible_cpus=144. There are 4 cpus in the system and cpu2
|
||||||
|
was manually taken offline (and is the only cpu that can be brought
|
||||||
|
online.)
|
||||||
|
|
||||||
|
kernel_max: 127
|
||||||
|
offline: 2,4-127,128-143
|
||||||
|
online: 0-1,3
|
||||||
|
possible: 0-127
|
||||||
|
present: 0-3
|
||||||
|
|
||||||
|
See cpu-hotplug.txt for the possible_cpus=NUM kernel start parameter
|
||||||
|
as well as more information on the various cpumask's.
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
3.6 Constraints
|
3.6 Constraints
|
||||||
3.7 Example
|
3.7 Example
|
||||||
|
|
||||||
4 DRIVER DEVELOPER NOTES
|
4 DMAENGINE DRIVER DEVELOPER NOTES
|
||||||
4.1 Conformance points
|
4.1 Conformance points
|
||||||
4.2 "My application needs finer control of hardware channels"
|
4.2 "My application needs exclusive control of hardware channels"
|
||||||
|
|
||||||
5 SOURCE
|
5 SOURCE
|
||||||
|
|
||||||
|
@ -150,6 +150,7 @@ ops_run_* and ops_complete_* routines in drivers/md/raid5.c for more
|
||||||
implementation examples.
|
implementation examples.
|
||||||
|
|
||||||
4 DRIVER DEVELOPMENT NOTES
|
4 DRIVER DEVELOPMENT NOTES
|
||||||
|
|
||||||
4.1 Conformance points:
|
4.1 Conformance points:
|
||||||
There are a few conformance points required in dmaengine drivers to
|
There are a few conformance points required in dmaengine drivers to
|
||||||
accommodate assumptions made by applications using the async_tx API:
|
accommodate assumptions made by applications using the async_tx API:
|
||||||
|
@ -158,58 +159,49 @@ accommodate assumptions made by applications using the async_tx API:
|
||||||
3/ Use async_tx_run_dependencies() in the descriptor clean up path to
|
3/ Use async_tx_run_dependencies() in the descriptor clean up path to
|
||||||
handle submission of dependent operations
|
handle submission of dependent operations
|
||||||
|
|
||||||
4.2 "My application needs finer control of hardware channels"
|
4.2 "My application needs exclusive control of hardware channels"
|
||||||
This requirement seems to arise from cases where a DMA engine driver is
|
Primarily this requirement arises from cases where a DMA engine driver
|
||||||
trying to support device-to-memory DMA. The dmaengine and async_tx
|
is being used to support device-to-memory operations. A channel that is
|
||||||
implementations were designed for offloading memory-to-memory
|
performing these operations cannot, for many platform specific reasons,
|
||||||
operations; however, there are some capabilities of the dmaengine layer
|
be shared. For these cases the dma_request_channel() interface is
|
||||||
that can be used for platform-specific channel management.
|
provided.
|
||||||
Platform-specific constraints can be handled by registering the
|
|
||||||
application as a 'dma_client' and implementing a 'dma_event_callback' to
|
|
||||||
apply a filter to the available channels in the system. Before showing
|
|
||||||
how to implement a custom dma_event callback some background of
|
|
||||||
dmaengine's client support is required.
|
|
||||||
|
|
||||||
The following routines in dmaengine support multiple clients requesting
|
The interface is:
|
||||||
use of a channel:
|
struct dma_chan *dma_request_channel(dma_cap_mask_t mask,
|
||||||
- dma_async_client_register(struct dma_client *client)
|
dma_filter_fn filter_fn,
|
||||||
- dma_async_client_chan_request(struct dma_client *client)
|
void *filter_param);
|
||||||
|
|
||||||
dma_async_client_register takes a pointer to an initialized dma_client
|
Where dma_filter_fn is defined as:
|
||||||
structure. It expects that the 'event_callback' and 'cap_mask' fields
|
typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param);
|
||||||
are already initialized.
|
|
||||||
|
|
||||||
dma_async_client_chan_request triggers dmaengine to notify the client of
|
When the optional 'filter_fn' parameter is set to NULL
|
||||||
all channels that satisfy the capability mask. It is up to the client's
|
dma_request_channel simply returns the first channel that satisfies the
|
||||||
event_callback routine to track how many channels the client needs and
|
capability mask. Otherwise, when the mask parameter is insufficient for
|
||||||
how many it is currently using. The dma_event_callback routine returns a
|
specifying the necessary channel, the filter_fn routine can be used to
|
||||||
dma_state_client code to let dmaengine know the status of the
|
disposition the available channels in the system. The filter_fn routine
|
||||||
allocation.
|
is called once for each free channel in the system. Upon seeing a
|
||||||
|
suitable channel filter_fn returns DMA_ACK which flags that channel to
|
||||||
|
be the return value from dma_request_channel. A channel allocated via
|
||||||
|
this interface is exclusive to the caller, until dma_release_channel()
|
||||||
|
is called.
|
||||||
|
|
||||||
Below is the example of how to extend this functionality for
|
The DMA_PRIVATE capability flag is used to tag dma devices that should
|
||||||
platform-specific filtering of the available channels beyond the
|
not be used by the general-purpose allocator. It can be set at
|
||||||
standard capability mask:
|
initialization time if it is known that a channel will always be
|
||||||
|
private. Alternatively, it is set when dma_request_channel() finds an
|
||||||
|
unused "public" channel.
|
||||||
|
|
||||||
static enum dma_state_client
|
A couple caveats to note when implementing a driver and consumer:
|
||||||
my_dma_client_callback(struct dma_client *client,
|
1/ Once a channel has been privately allocated it will no longer be
|
||||||
struct dma_chan *chan, enum dma_state state)
|
considered by the general-purpose allocator even after a call to
|
||||||
{
|
dma_release_channel().
|
||||||
struct dma_device *dma_dev;
|
2/ Since capabilities are specified at the device level a dma_device
|
||||||
struct my_platform_specific_dma *plat_dma_dev;
|
with multiple channels will either have all channels public, or all
|
||||||
|
channels private.
|
||||||
dma_dev = chan->device;
|
|
||||||
plat_dma_dev = container_of(dma_dev,
|
|
||||||
struct my_platform_specific_dma,
|
|
||||||
dma_dev);
|
|
||||||
|
|
||||||
if (!plat_dma_dev->platform_specific_capability)
|
|
||||||
return DMA_DUP;
|
|
||||||
|
|
||||||
. . .
|
|
||||||
}
|
|
||||||
|
|
||||||
5 SOURCE
|
5 SOURCE
|
||||||
include/linux/dmaengine.h: core header file for DMA drivers and clients
|
|
||||||
|
include/linux/dmaengine.h: core header file for DMA drivers and api users
|
||||||
drivers/dma/dmaengine.c: offload engine channel management routines
|
drivers/dma/dmaengine.c: offload engine channel management routines
|
||||||
drivers/dma/: location for offload engine drivers
|
drivers/dma/: location for offload engine drivers
|
||||||
include/linux/async_tx.h: core header file for the async_tx api
|
include/linux/async_tx.h: core header file for the async_tx api
|
||||||
|
|
|
@ -81,8 +81,8 @@ Until this step is completed the driver cannot be unloaded.
|
||||||
Also echoing either mono ,packet or init in to image_type will free up the
|
Also echoing either mono ,packet or init in to image_type will free up the
|
||||||
memory allocated by the driver.
|
memory allocated by the driver.
|
||||||
|
|
||||||
If an user by accident executes steps 1 and 3 above without executing step 2;
|
If a user by accident executes steps 1 and 3 above without executing step 2;
|
||||||
it will make the /sys/class/firmware/dell_rbu/ entries to disappear.
|
it will make the /sys/class/firmware/dell_rbu/ entries disappear.
|
||||||
The entries can be recreated by doing the following
|
The entries can be recreated by doing the following
|
||||||
echo init > /sys/devices/platform/dell_rbu/image_type
|
echo init > /sys/devices/platform/dell_rbu/image_type
|
||||||
NOTE: echoing init in image_type does not change it original value.
|
NOTE: echoing init in image_type does not change it original value.
|
||||||
|
|
|
@ -380,5 +380,5 @@ This will help you to be sure that you have found all in-tree uses of that
|
||||||
interface. It will also alert developers of out-of-tree code that there is
|
interface. It will also alert developers of out-of-tree code that there is
|
||||||
a change that they need to respond to. Supporting out-of-tree code is not
|
a change that they need to respond to. Supporting out-of-tree code is not
|
||||||
something that kernel developers need to be worried about, but we also do
|
something that kernel developers need to be worried about, but we also do
|
||||||
not have to make life harder for out-of-tree developers than it it needs to
|
not have to make life harder for out-of-tree developers than it needs to
|
||||||
be.
|
be.
|
||||||
|
|
1
Documentation/dmaengine.txt
Normal file
1
Documentation/dmaengine.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
See Documentation/crypto/async-tx-api.txt
|
69
Documentation/dvb/technisat.txt
Normal file
69
Documentation/dvb/technisat.txt
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
How to set up the Technisat devices
|
||||||
|
===================================
|
||||||
|
|
||||||
|
1) Find out what device you have
|
||||||
|
================================
|
||||||
|
|
||||||
|
First start your linux box with a shipped kernel:
|
||||||
|
lspci -vvv for a PCI device (lsusb -vvv for an USB device) will show you for example:
|
||||||
|
02:0b.0 Network controller: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card (rev 02)
|
||||||
|
|
||||||
|
dmesg | grep frontend may show you for example:
|
||||||
|
DVB: registering frontend 0 (Conexant CX24123/CX24109)...
|
||||||
|
|
||||||
|
2) Kernel compilation:
|
||||||
|
======================
|
||||||
|
|
||||||
|
If the Technisat is the only TV device in your box get rid of unnecessary modules and check this one:
|
||||||
|
"Multimedia devices" => "Customise analog and hybrid tuner modules to build"
|
||||||
|
In this directory uncheck every driver which is activated there.
|
||||||
|
|
||||||
|
Then please activate:
|
||||||
|
2a) Main module part:
|
||||||
|
|
||||||
|
a.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters"
|
||||||
|
b.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Technisat/B2C2 Air/Sky/Cable2PC PCI" in case of a PCI card OR
|
||||||
|
c.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Technisat/B2C2 Air/Sky/Cable2PC USB" in case of an USB 1.1 adapter
|
||||||
|
d.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Enable debug for the B2C2 FlexCop drivers"
|
||||||
|
Notice: d.) is helpful for troubleshooting
|
||||||
|
|
||||||
|
2b) Frontend module part:
|
||||||
|
|
||||||
|
1.) Revision 2.3:
|
||||||
|
a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build"
|
||||||
|
b.)"Multimedia devices" => "Customise DVB frontends" => "Zarlink VP310/MT312/ZL10313 based"
|
||||||
|
|
||||||
|
2.) Revision 2.6:
|
||||||
|
a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build"
|
||||||
|
b.)"Multimedia devices" => "Customise DVB frontends" => "ST STV0299 based"
|
||||||
|
|
||||||
|
3.) Revision 2.7:
|
||||||
|
a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build"
|
||||||
|
b.)"Multimedia devices" => "Customise DVB frontends" => "Samsung S5H1420 based"
|
||||||
|
c.)"Multimedia devices" => "Customise DVB frontends" => "Integrant ITD1000 Zero IF tuner for DVB-S/DSS"
|
||||||
|
d.)"Multimedia devices" => "Customise DVB frontends" => "ISL6421 SEC controller"
|
||||||
|
|
||||||
|
4.) Revision 2.8:
|
||||||
|
a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build"
|
||||||
|
b.)"Multimedia devices" => "Customise DVB frontends" => "Conexant CX24113/CX24128 tuner for DVB-S/DSS"
|
||||||
|
c.)"Multimedia devices" => "Customise DVB frontends" => "Conexant CX24123 based"
|
||||||
|
d.)"Multimedia devices" => "Customise DVB frontends" => "ISL6421 SEC controller"
|
||||||
|
|
||||||
|
5.) DVB-T card:
|
||||||
|
a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build"
|
||||||
|
b.)"Multimedia devices" => "Customise DVB frontends" => "Zarlink MT352 based"
|
||||||
|
|
||||||
|
6.) DVB-C card:
|
||||||
|
a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build"
|
||||||
|
b.)"Multimedia devices" => "Customise DVB frontends" => "ST STV0297 based"
|
||||||
|
|
||||||
|
7.) ATSC card 1st generation:
|
||||||
|
a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build"
|
||||||
|
b.)"Multimedia devices" => "Customise DVB frontends" => "Broadcom BCM3510"
|
||||||
|
|
||||||
|
8.) ATSC card 2nd generation:
|
||||||
|
a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build"
|
||||||
|
b.)"Multimedia devices" => "Customise DVB frontends" => "NxtWave Communications NXT2002/NXT2004 based"
|
||||||
|
c.)"Multimedia devices" => "Customise DVB frontends" => "LG Electronics LGDT3302/LGDT3303 based"
|
||||||
|
|
||||||
|
Author: Uwe Bugla <uwe.bugla@gmx.de> December 2008
|
|
@ -5,9 +5,13 @@ The driver supports the following options, either via
|
||||||
options=<OPTIONS> when modular or video=pxafb:<OPTIONS> when built in.
|
options=<OPTIONS> when modular or video=pxafb:<OPTIONS> when built in.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
modprobe pxafb options=mode:640x480-8,passive
|
modprobe pxafb options=vmem:2M,mode:640x480-8,passive
|
||||||
or on the kernel command line
|
or on the kernel command line
|
||||||
video=pxafb:mode:640x480-8,passive
|
video=pxafb:vmem:2M,mode:640x480-8,passive
|
||||||
|
|
||||||
|
vmem: VIDEO_MEM_SIZE
|
||||||
|
Amount of video memory to allocate (can be suffixed with K or M
|
||||||
|
for kilobytes or megabytes)
|
||||||
|
|
||||||
mode:XRESxYRES[-BPP]
|
mode:XRESxYRES[-BPP]
|
||||||
XRES == LCCR1_PPL + 1
|
XRES == LCCR1_PPL + 1
|
||||||
|
@ -52,3 +56,87 @@ outputen:POLARITY
|
||||||
pixclockpol:POLARITY
|
pixclockpol:POLARITY
|
||||||
pixel clock polarity
|
pixel clock polarity
|
||||||
0 => falling edge, 1 => rising edge
|
0 => falling edge, 1 => rising edge
|
||||||
|
|
||||||
|
|
||||||
|
Overlay Support for PXA27x and later LCD controllers
|
||||||
|
====================================================
|
||||||
|
|
||||||
|
PXA27x and later processors support overlay1 and overlay2 on-top of the
|
||||||
|
base framebuffer (although under-neath the base is also possible). They
|
||||||
|
support palette and no-palette RGB formats, as well as YUV formats (only
|
||||||
|
available on overlay2). These overlays have dedicated DMA channels and
|
||||||
|
behave in a similar way as a framebuffer.
|
||||||
|
|
||||||
|
However, there are some differences between these overlay framebuffers
|
||||||
|
and normal framebuffers, as listed below:
|
||||||
|
|
||||||
|
1. overlay can start at a 32-bit word aligned position within the base
|
||||||
|
framebuffer, which means they have a start (x, y). This information
|
||||||
|
is encoded into var->nonstd (no, var->xoffset and var->yoffset are
|
||||||
|
not for such purpose).
|
||||||
|
|
||||||
|
2. overlay framebuffer is allocated dynamically according to specified
|
||||||
|
'struct fb_var_screeninfo', the amount is decided by:
|
||||||
|
|
||||||
|
var->xres_virtual * var->yres_virtual * bpp
|
||||||
|
|
||||||
|
bpp = 16 -- for RGB565 or RGBT555
|
||||||
|
= 24 -- for YUV444 packed
|
||||||
|
= 24 -- for YUV444 planar
|
||||||
|
= 16 -- for YUV422 planar (1 pixel = 1 Y + 1/2 Cb + 1/2 Cr)
|
||||||
|
= 12 -- for YUV420 planar (1 pixel = 1 Y + 1/4 Cb + 1/4 Cr)
|
||||||
|
|
||||||
|
NOTE:
|
||||||
|
|
||||||
|
a. overlay does not support panning in x-direction, thus
|
||||||
|
var->xres_virtual will always be equal to var->xres
|
||||||
|
|
||||||
|
b. line length of overlay(s) must be on a 32-bit word boundary,
|
||||||
|
for YUV planar modes, it is a requirement for the component
|
||||||
|
with minimum bits per pixel, e.g. for YUV420, Cr component
|
||||||
|
for one pixel is actually 2-bits, it means the line length
|
||||||
|
should be a multiple of 16-pixels
|
||||||
|
|
||||||
|
c. starting horizontal position (XPOS) should start on a 32-bit
|
||||||
|
word boundary, otherwise the fb_check_var() will just fail.
|
||||||
|
|
||||||
|
d. the rectangle of the overlay should be within the base plane,
|
||||||
|
otherwise fail
|
||||||
|
|
||||||
|
Applications should follow the sequence below to operate an overlay
|
||||||
|
framebuffer:
|
||||||
|
|
||||||
|
a. open("/dev/fb[1-2]", ...)
|
||||||
|
b. ioctl(fd, FBIOGET_VSCREENINFO, ...)
|
||||||
|
c. modify 'var' with desired parameters:
|
||||||
|
1) var->xres and var->yres
|
||||||
|
2) larger var->yres_virtual if more memory is required,
|
||||||
|
usually for double-buffering
|
||||||
|
3) var->nonstd for starting (x, y) and color format
|
||||||
|
4) var->{red, green, blue, transp} if RGB mode is to be used
|
||||||
|
d. ioctl(fd, FBIOPUT_VSCREENINFO, ...)
|
||||||
|
e. ioctl(fd, FBIOGET_FSCREENINFO, ...)
|
||||||
|
f. mmap
|
||||||
|
g. ...
|
||||||
|
|
||||||
|
3. for YUV planar formats, these are actually not supported within the
|
||||||
|
framebuffer framework, application has to take care of the offsets
|
||||||
|
and lengths of each component within the framebuffer.
|
||||||
|
|
||||||
|
4. var->nonstd is used to pass starting (x, y) position and color format,
|
||||||
|
the detailed bit fields are shown below:
|
||||||
|
|
||||||
|
31 23 20 10 0
|
||||||
|
+-----------------+---+----------+----------+
|
||||||
|
| ... unused ... |FOR| XPOS | YPOS |
|
||||||
|
+-----------------+---+----------+----------+
|
||||||
|
|
||||||
|
FOR - color format, as defined by OVERLAY_FORMAT_* in pxafb.h
|
||||||
|
0 - RGB
|
||||||
|
1 - YUV444 PACKED
|
||||||
|
2 - YUV444 PLANAR
|
||||||
|
3 - YUV422 PLANAR
|
||||||
|
4 - YUR420 PLANAR
|
||||||
|
|
||||||
|
XPOS - starting horizontal position
|
||||||
|
YPOS - starting vertical position
|
||||||
|
|
|
@ -310,17 +310,28 @@ Who: Krzysztof Piotr Oledzki <ole@ans.pl>
|
||||||
|
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
What: ide-scsi (BLK_DEV_IDESCSI)
|
|
||||||
When: 2.6.29
|
|
||||||
Why: The 2.6 kernel supports direct writing to ide CD drives, which
|
|
||||||
eliminates the need for ide-scsi. The new method is more
|
|
||||||
efficient in every way.
|
|
||||||
Who: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
||||||
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
What: i2c_attach_client(), i2c_detach_client(), i2c_driver->detach_client()
|
What: i2c_attach_client(), i2c_detach_client(), i2c_driver->detach_client()
|
||||||
When: 2.6.29 (ideally) or 2.6.30 (more likely)
|
When: 2.6.29 (ideally) or 2.6.30 (more likely)
|
||||||
Why: Deprecated by the new (standard) device driver binding model. Use
|
Why: Deprecated by the new (standard) device driver binding model. Use
|
||||||
i2c_driver->probe() and ->remove() instead.
|
i2c_driver->probe() and ->remove() instead.
|
||||||
Who: Jean Delvare <khali@linux-fr.org>
|
Who: Jean Delvare <khali@linux-fr.org>
|
||||||
|
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
What: fscher and fscpos drivers
|
||||||
|
When: June 2009
|
||||||
|
Why: Deprecated by the new fschmd driver.
|
||||||
|
Who: Hans de Goede <hdegoede@redhat.com>
|
||||||
|
Jean Delvare <khali@linux-fr.org>
|
||||||
|
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
What: SELinux "compat_net" functionality
|
||||||
|
When: 2.6.30 at the earliest
|
||||||
|
Why: In 2.6.18 the Secmark concept was introduced to replace the "compat_net"
|
||||||
|
network access control functionality of SELinux. Secmark offers both
|
||||||
|
better performance and greater flexibility than the "compat_net"
|
||||||
|
mechanism. Now that the major Linux distributions have moved to
|
||||||
|
Secmark, it is time to deprecate the older mechanism and start the
|
||||||
|
process of removing the old code.
|
||||||
|
Who: Paul Moore <paul.moore@hp.com>
|
||||||
|
|
|
@ -97,8 +97,8 @@ prototypes:
|
||||||
void (*put_super) (struct super_block *);
|
void (*put_super) (struct super_block *);
|
||||||
void (*write_super) (struct super_block *);
|
void (*write_super) (struct super_block *);
|
||||||
int (*sync_fs)(struct super_block *sb, int wait);
|
int (*sync_fs)(struct super_block *sb, int wait);
|
||||||
void (*write_super_lockfs) (struct super_block *);
|
int (*freeze_fs) (struct super_block *);
|
||||||
void (*unlockfs) (struct super_block *);
|
int (*unfreeze_fs) (struct super_block *);
|
||||||
int (*statfs) (struct dentry *, struct kstatfs *);
|
int (*statfs) (struct dentry *, struct kstatfs *);
|
||||||
int (*remount_fs) (struct super_block *, int *, char *);
|
int (*remount_fs) (struct super_block *, int *, char *);
|
||||||
void (*clear_inode) (struct inode *);
|
void (*clear_inode) (struct inode *);
|
||||||
|
@ -119,8 +119,8 @@ delete_inode: no
|
||||||
put_super: yes yes no
|
put_super: yes yes no
|
||||||
write_super: no yes read
|
write_super: no yes read
|
||||||
sync_fs: no no read
|
sync_fs: no no read
|
||||||
write_super_lockfs: ?
|
freeze_fs: ?
|
||||||
unlockfs: ?
|
unfreeze_fs: ?
|
||||||
statfs: no no no
|
statfs: no no no
|
||||||
remount_fs: yes yes maybe (see below)
|
remount_fs: yes yes maybe (see below)
|
||||||
clear_inode: no
|
clear_inode: no
|
||||||
|
@ -394,11 +394,10 @@ prototypes:
|
||||||
unsigned long (*get_unmapped_area)(struct file *, unsigned long,
|
unsigned long (*get_unmapped_area)(struct file *, unsigned long,
|
||||||
unsigned long, unsigned long, unsigned long);
|
unsigned long, unsigned long, unsigned long);
|
||||||
int (*check_flags)(int);
|
int (*check_flags)(int);
|
||||||
int (*dir_notify)(struct file *, unsigned long);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
locking rules:
|
locking rules:
|
||||||
All except ->poll() may block.
|
All may block.
|
||||||
BKL
|
BKL
|
||||||
llseek: no (see below)
|
llseek: no (see below)
|
||||||
read: no
|
read: no
|
||||||
|
@ -424,7 +423,6 @@ sendfile: no
|
||||||
sendpage: no
|
sendpage: no
|
||||||
get_unmapped_area: no
|
get_unmapped_area: no
|
||||||
check_flags: no
|
check_flags: no
|
||||||
dir_notify: no
|
|
||||||
|
|
||||||
->llseek() locking has moved from llseek to the individual llseek
|
->llseek() locking has moved from llseek to the individual llseek
|
||||||
implementations. If your fs is not using generic_file_llseek, you
|
implementations. If your fs is not using generic_file_llseek, you
|
||||||
|
|
91
Documentation/filesystems/btrfs.txt
Normal file
91
Documentation/filesystems/btrfs.txt
Normal file
|
@ -0,0 +1,91 @@
|
||||||
|
|
||||||
|
BTRFS
|
||||||
|
=====
|
||||||
|
|
||||||
|
Btrfs is a new copy on write filesystem for Linux aimed at
|
||||||
|
implementing advanced features while focusing on fault tolerance,
|
||||||
|
repair and easy administration. Initially developed by Oracle, Btrfs
|
||||||
|
is licensed under the GPL and open for contribution from anyone.
|
||||||
|
|
||||||
|
Linux has a wealth of filesystems to choose from, but we are facing a
|
||||||
|
number of challenges with scaling to the large storage subsystems that
|
||||||
|
are becoming common in today's data centers. Filesystems need to scale
|
||||||
|
in their ability to address and manage large storage, and also in
|
||||||
|
their ability to detect, repair and tolerate errors in the data stored
|
||||||
|
on disk. Btrfs is under heavy development, and is not suitable for
|
||||||
|
any uses other than benchmarking and review. The Btrfs disk format is
|
||||||
|
not yet finalized.
|
||||||
|
|
||||||
|
The main Btrfs features include:
|
||||||
|
|
||||||
|
* Extent based file storage (2^64 max file size)
|
||||||
|
* Space efficient packing of small files
|
||||||
|
* Space efficient indexed directories
|
||||||
|
* Dynamic inode allocation
|
||||||
|
* Writable snapshots
|
||||||
|
* Subvolumes (separate internal filesystem roots)
|
||||||
|
* Object level mirroring and striping
|
||||||
|
* Checksums on data and metadata (multiple algorithms available)
|
||||||
|
* Compression
|
||||||
|
* Integrated multiple device support, with several raid algorithms
|
||||||
|
* Online filesystem check (not yet implemented)
|
||||||
|
* Very fast offline filesystem check
|
||||||
|
* Efficient incremental backup and FS mirroring (not yet implemented)
|
||||||
|
* Online filesystem defragmentation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
MAILING LIST
|
||||||
|
============
|
||||||
|
|
||||||
|
There is a Btrfs mailing list hosted on vger.kernel.org. You can
|
||||||
|
find details on how to subscribe here:
|
||||||
|
|
||||||
|
http://vger.kernel.org/vger-lists.html#linux-btrfs
|
||||||
|
|
||||||
|
Mailing list archives are available from gmane:
|
||||||
|
|
||||||
|
http://dir.gmane.org/gmane.comp.file-systems.btrfs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
IRC
|
||||||
|
===
|
||||||
|
|
||||||
|
Discussion of Btrfs also occurs on the #btrfs channel of the Freenode
|
||||||
|
IRC network.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
UTILITIES
|
||||||
|
=========
|
||||||
|
|
||||||
|
Userspace tools for creating and manipulating Btrfs file systems are
|
||||||
|
available from the git repository at the following location:
|
||||||
|
|
||||||
|
http://git.kernel.org/?p=linux/kernel/git/mason/btrfs-progs-unstable.git
|
||||||
|
git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs-unstable.git
|
||||||
|
|
||||||
|
These include the following tools:
|
||||||
|
|
||||||
|
mkfs.btrfs: create a filesystem
|
||||||
|
|
||||||
|
btrfsctl: control program to create snapshots and subvolumes:
|
||||||
|
|
||||||
|
mount /dev/sda2 /mnt
|
||||||
|
btrfsctl -s new_subvol_name /mnt
|
||||||
|
btrfsctl -s snapshot_of_default /mnt/default
|
||||||
|
btrfsctl -s snapshot_of_new_subvol /mnt/new_subvol_name
|
||||||
|
btrfsctl -s snapshot_of_a_snapshot /mnt/snapshot_of_new_subvol
|
||||||
|
ls /mnt
|
||||||
|
default snapshot_of_a_snapshot snapshot_of_new_subvol
|
||||||
|
new_subvol_name snapshot_of_default
|
||||||
|
|
||||||
|
Snapshots and subvolumes cannot be deleted right now, but you can
|
||||||
|
rm -rf all the files and directories inside them.
|
||||||
|
|
||||||
|
btrfsck: do a limited check of the FS extent trees.
|
||||||
|
|
||||||
|
btrfs-debug-tree: print all of the FS metadata in text form. Example:
|
||||||
|
|
||||||
|
btrfs-debug-tree /dev/sda2 >& big_output_file
|
132
Documentation/filesystems/devpts.txt
Normal file
132
Documentation/filesystems/devpts.txt
Normal file
|
@ -0,0 +1,132 @@
|
||||||
|
|
||||||
|
To support containers, we now allow multiple instances of devpts filesystem,
|
||||||
|
such that indices of ptys allocated in one instance are independent of indices
|
||||||
|
allocated in other instances of devpts.
|
||||||
|
|
||||||
|
To preserve backward compatibility, this support for multiple instances is
|
||||||
|
enabled only if:
|
||||||
|
|
||||||
|
- CONFIG_DEVPTS_MULTIPLE_INSTANCES=y, and
|
||||||
|
- '-o newinstance' mount option is specified while mounting devpts
|
||||||
|
|
||||||
|
IOW, devpts now supports both single-instance and multi-instance semantics.
|
||||||
|
|
||||||
|
If CONFIG_DEVPTS_MULTIPLE_INSTANCES=n, there is no change in behavior and
|
||||||
|
this referred to as the "legacy" mode. In this mode, the new mount options
|
||||||
|
(-o newinstance and -o ptmxmode) will be ignored with a 'bogus option' message
|
||||||
|
on console.
|
||||||
|
|
||||||
|
If CONFIG_DEVPTS_MULTIPLE_INSTANCES=y and devpts is mounted without the
|
||||||
|
'newinstance' option (as in current start-up scripts) the new mount binds
|
||||||
|
to the initial kernel mount of devpts. This mode is referred to as the
|
||||||
|
'single-instance' mode and the current, single-instance semantics are
|
||||||
|
preserved, i.e PTYs are common across the system.
|
||||||
|
|
||||||
|
The only difference between this single-instance mode and the legacy mode
|
||||||
|
is the presence of new, '/dev/pts/ptmx' node with permissions 0000, which
|
||||||
|
can safely be ignored.
|
||||||
|
|
||||||
|
If CONFIG_DEVPTS_MULTIPLE_INSTANCES=y and 'newinstance' option is specified,
|
||||||
|
the mount is considered to be in the multi-instance mode and a new instance
|
||||||
|
of the devpts fs is created. Any ptys created in this instance are independent
|
||||||
|
of ptys in other instances of devpts. Like in the single-instance mode, the
|
||||||
|
/dev/pts/ptmx node is present. To effectively use the multi-instance mode,
|
||||||
|
open of /dev/ptmx must be a redirected to '/dev/pts/ptmx' using a symlink or
|
||||||
|
bind-mount.
|
||||||
|
|
||||||
|
Eg: A container startup script could do the following:
|
||||||
|
|
||||||
|
$ chmod 0666 /dev/pts/ptmx
|
||||||
|
$ rm /dev/ptmx
|
||||||
|
$ ln -s pts/ptmx /dev/ptmx
|
||||||
|
$ ns_exec -cm /bin/bash
|
||||||
|
|
||||||
|
# We are now in new container
|
||||||
|
|
||||||
|
$ umount /dev/pts
|
||||||
|
$ mount -t devpts -o newinstance lxcpts /dev/pts
|
||||||
|
$ sshd -p 1234
|
||||||
|
|
||||||
|
where 'ns_exec -cm /bin/bash' calls clone() with CLONE_NEWNS flag and execs
|
||||||
|
/bin/bash in the child process. A pty created by the sshd is not visible in
|
||||||
|
the original mount of /dev/pts.
|
||||||
|
|
||||||
|
User-space changes
|
||||||
|
------------------
|
||||||
|
|
||||||
|
In multi-instance mode (i.e '-o newinstance' mount option is specified at least
|
||||||
|
once), following user-space issues should be noted.
|
||||||
|
|
||||||
|
1. If -o newinstance mount option is never used, /dev/pts/ptmx can be ignored
|
||||||
|
and no change is needed to system-startup scripts.
|
||||||
|
|
||||||
|
2. To effectively use multi-instance mode (i.e -o newinstance is specified)
|
||||||
|
administrators or startup scripts should "redirect" open of /dev/ptmx to
|
||||||
|
/dev/pts/ptmx using either a bind mount or symlink.
|
||||||
|
|
||||||
|
$ mount -t devpts -o newinstance devpts /dev/pts
|
||||||
|
|
||||||
|
followed by either
|
||||||
|
|
||||||
|
$ rm /dev/ptmx
|
||||||
|
$ ln -s pts/ptmx /dev/ptmx
|
||||||
|
$ chmod 666 /dev/pts/ptmx
|
||||||
|
or
|
||||||
|
$ mount -o bind /dev/pts/ptmx /dev/ptmx
|
||||||
|
|
||||||
|
3. The '/dev/ptmx -> pts/ptmx' symlink is the preferred method since it
|
||||||
|
enables better error-reporting and treats both single-instance and
|
||||||
|
multi-instance mounts similarly.
|
||||||
|
|
||||||
|
But this method requires that system-startup scripts set the mode of
|
||||||
|
/dev/pts/ptmx correctly (default mode is 0000). The scripts can set the
|
||||||
|
mode by, either
|
||||||
|
|
||||||
|
- adding ptmxmode mount option to devpts entry in /etc/fstab, or
|
||||||
|
- using 'chmod 0666 /dev/pts/ptmx'
|
||||||
|
|
||||||
|
4. If multi-instance mode mount is needed for containers, but the system
|
||||||
|
startup scripts have not yet been updated, container-startup scripts
|
||||||
|
should bind mount /dev/ptmx to /dev/pts/ptmx to avoid breaking single-
|
||||||
|
instance mounts.
|
||||||
|
|
||||||
|
Or, in general, container-startup scripts should use:
|
||||||
|
|
||||||
|
mount -t devpts -o newinstance -o ptmxmode=0666 devpts /dev/pts
|
||||||
|
if [ ! -L /dev/ptmx ]; then
|
||||||
|
mount -o bind /dev/pts/ptmx /dev/ptmx
|
||||||
|
fi
|
||||||
|
|
||||||
|
When all devpts mounts are multi-instance, /dev/ptmx can permanently be
|
||||||
|
a symlink to pts/ptmx and the bind mount can be ignored.
|
||||||
|
|
||||||
|
5. A multi-instance mount that is not accompanied by the /dev/ptmx to
|
||||||
|
/dev/pts/ptmx redirection would result in an unusable/unreachable pty.
|
||||||
|
|
||||||
|
mount -t devpts -o newinstance lxcpts /dev/pts
|
||||||
|
|
||||||
|
immediately followed by:
|
||||||
|
|
||||||
|
open("/dev/ptmx")
|
||||||
|
|
||||||
|
would create a pty, say /dev/pts/7, in the initial kernel mount.
|
||||||
|
But /dev/pts/7 would be invisible in the new mount.
|
||||||
|
|
||||||
|
6. The permissions for /dev/pts/ptmx node should be specified when mounting
|
||||||
|
/dev/pts, using the '-o ptmxmode=%o' mount option (default is 0000).
|
||||||
|
|
||||||
|
mount -t devpts -o newinstance -o ptmxmode=0644 devpts /dev/pts
|
||||||
|
|
||||||
|
The permissions can be later be changed as usual with 'chmod'.
|
||||||
|
|
||||||
|
chmod 666 /dev/pts/ptmx
|
||||||
|
|
||||||
|
7. A mount of devpts without the 'newinstance' option results in binding to
|
||||||
|
initial kernel mount. This behavior while preserving legacy semantics,
|
||||||
|
does not provide strict isolation in a container environment. i.e by
|
||||||
|
mounting devpts without the 'newinstance' option, a container could
|
||||||
|
get visibility into the 'host' or root container's devpts.
|
||||||
|
|
||||||
|
To workaround this and have strict isolation, all mounts of devpts,
|
||||||
|
including the mount in the root container, should use the newinstance
|
||||||
|
option.
|
|
@ -58,13 +58,22 @@ Note: More extensive information for getting started with ext4 can be
|
||||||
|
|
||||||
# mount -t ext4 /dev/hda1 /wherever
|
# mount -t ext4 /dev/hda1 /wherever
|
||||||
|
|
||||||
- When comparing performance with other filesystems, remember that
|
- When comparing performance with other filesystems, it's always
|
||||||
ext3/4 by default offers higher data integrity guarantees than most.
|
important to try multiple workloads; very often a subtle change in a
|
||||||
So when comparing with a metadata-only journalling filesystem, such
|
workload parameter can completely change the ranking of which
|
||||||
as ext3, use `mount -o data=writeback'. And you might as well use
|
filesystems do well compared to others. When comparing versus ext3,
|
||||||
`mount -o nobh' too along with it. Making the journal larger than
|
note that ext4 enables write barriers by default, while ext3 does
|
||||||
the mke2fs default often helps performance with metadata-intensive
|
not enable write barriers by default. So it is useful to use
|
||||||
workloads.
|
explicitly specify whether barriers are enabled or not when via the
|
||||||
|
'-o barriers=[0|1]' mount option for both ext3 and ext4 filesystems
|
||||||
|
for a fair comparison. When tuning ext3 for best benchmark numbers,
|
||||||
|
it is often worthwhile to try changing the data journaling mode; '-o
|
||||||
|
data=writeback,nobh' can be faster for some workloads. (Note
|
||||||
|
however that running mounted with data=writeback can potentially
|
||||||
|
leave stale data exposed in recently written files in case of an
|
||||||
|
unclean shutdown, which could be a security exposure in some
|
||||||
|
situations.) Configuring the filesystem with a large journal can
|
||||||
|
also be helpful for metadata-intensive workloads.
|
||||||
|
|
||||||
2. Features
|
2. Features
|
||||||
===========
|
===========
|
||||||
|
@ -74,7 +83,7 @@ Note: More extensive information for getting started with ext4 can be
|
||||||
* ability to use filesystems > 16TB (e2fsprogs support not available yet)
|
* ability to use filesystems > 16TB (e2fsprogs support not available yet)
|
||||||
* extent format reduces metadata overhead (RAM, IO for access, transactions)
|
* extent format reduces metadata overhead (RAM, IO for access, transactions)
|
||||||
* extent format more robust in face of on-disk corruption due to magics,
|
* extent format more robust in face of on-disk corruption due to magics,
|
||||||
* internal redunancy in tree
|
* internal redundancy in tree
|
||||||
* improved file allocation (multi-block alloc)
|
* improved file allocation (multi-block alloc)
|
||||||
* fix 32000 subdirectory limit
|
* fix 32000 subdirectory limit
|
||||||
* nsec timestamps for mtime, atime, ctime, create time
|
* nsec timestamps for mtime, atime, ctime, create time
|
||||||
|
@ -116,10 +125,11 @@ grouping of bitmaps and inode tables. Some test results available here:
|
||||||
When mounting an ext4 filesystem, the following option are accepted:
|
When mounting an ext4 filesystem, the following option are accepted:
|
||||||
(*) == default
|
(*) == default
|
||||||
|
|
||||||
extents (*) ext4 will use extents to address file data. The
|
ro Mount filesystem read only. Note that ext4 will
|
||||||
file system will no longer be mountable by ext3.
|
replay the journal (and thus write to the
|
||||||
|
partition) even when mounted "read only". The
|
||||||
noextents ext4 will not use extents for newly created files
|
mount options "ro,noload" can be used to prevent
|
||||||
|
writes to the filesystem.
|
||||||
|
|
||||||
journal_checksum Enable checksumming of the journal transactions.
|
journal_checksum Enable checksumming of the journal transactions.
|
||||||
This will allow the recovery code in e2fsck and the
|
This will allow the recovery code in e2fsck and the
|
||||||
|
@ -134,17 +144,17 @@ journal_async_commit Commit block can be written to disk without waiting
|
||||||
journal=update Update the ext4 file system's journal to the current
|
journal=update Update the ext4 file system's journal to the current
|
||||||
format.
|
format.
|
||||||
|
|
||||||
journal=inum When a journal already exists, this option is ignored.
|
|
||||||
Otherwise, it specifies the number of the inode which
|
|
||||||
will represent the ext4 file system's journal file.
|
|
||||||
|
|
||||||
journal_dev=devnum When the external journal device's major/minor numbers
|
journal_dev=devnum When the external journal device's major/minor numbers
|
||||||
have changed, this option allows the user to specify
|
have changed, this option allows the user to specify
|
||||||
the new journal location. The journal device is
|
the new journal location. The journal device is
|
||||||
identified through its new major/minor numbers encoded
|
identified through its new major/minor numbers encoded
|
||||||
in devnum.
|
in devnum.
|
||||||
|
|
||||||
noload Don't load the journal on mounting.
|
noload Don't load the journal on mounting. Note that
|
||||||
|
if the filesystem was not unmounted cleanly,
|
||||||
|
skipping the journal replay will lead to the
|
||||||
|
filesystem containing inconsistencies that can
|
||||||
|
lead to any number of problems.
|
||||||
|
|
||||||
data=journal All data are committed into the journal prior to being
|
data=journal All data are committed into the journal prior to being
|
||||||
written into the main file system.
|
written into the main file system.
|
||||||
|
@ -219,9 +229,12 @@ minixdf Make 'df' act like Minix.
|
||||||
|
|
||||||
debug Extra debugging information is sent to syslog.
|
debug Extra debugging information is sent to syslog.
|
||||||
|
|
||||||
errors=remount-ro(*) Remount the filesystem read-only on an error.
|
errors=remount-ro Remount the filesystem read-only on an error.
|
||||||
errors=continue Keep going on a filesystem error.
|
errors=continue Keep going on a filesystem error.
|
||||||
errors=panic Panic and halt the machine if an error occurs.
|
errors=panic Panic and halt the machine if an error occurs.
|
||||||
|
(These mount options override the errors behavior
|
||||||
|
specified in the superblock, which can be configured
|
||||||
|
using tune2fs)
|
||||||
|
|
||||||
data_err=ignore(*) Just print an error message if an error occurs
|
data_err=ignore(*) Just print an error message if an error occurs
|
||||||
in a file data buffer in ordered mode.
|
in a file data buffer in ordered mode.
|
||||||
|
@ -261,6 +274,42 @@ delalloc (*) Deferring block allocation until write-out time.
|
||||||
nodelalloc Disable delayed allocation. Blocks are allocation
|
nodelalloc Disable delayed allocation. Blocks are allocation
|
||||||
when data is copied from user to page cache.
|
when data is copied from user to page cache.
|
||||||
|
|
||||||
|
max_batch_time=usec Maximum amount of time ext4 should wait for
|
||||||
|
additional filesystem operations to be batch
|
||||||
|
together with a synchronous write operation.
|
||||||
|
Since a synchronous write operation is going to
|
||||||
|
force a commit and then a wait for the I/O
|
||||||
|
complete, it doesn't cost much, and can be a
|
||||||
|
huge throughput win, we wait for a small amount
|
||||||
|
of time to see if any other transactions can
|
||||||
|
piggyback on the synchronous write. The
|
||||||
|
algorithm used is designed to automatically tune
|
||||||
|
for the speed of the disk, by measuring the
|
||||||
|
amount of time (on average) that it takes to
|
||||||
|
finish committing a transaction. Call this time
|
||||||
|
the "commit time". If the time that the
|
||||||
|
transactoin has been running is less than the
|
||||||
|
commit time, ext4 will try sleeping for the
|
||||||
|
commit time to see if other operations will join
|
||||||
|
the transaction. The commit time is capped by
|
||||||
|
the max_batch_time, which defaults to 15000us
|
||||||
|
(15ms). This optimization can be turned off
|
||||||
|
entirely by setting max_batch_time to 0.
|
||||||
|
|
||||||
|
min_batch_time=usec This parameter sets the commit time (as
|
||||||
|
described above) to be at least min_batch_time.
|
||||||
|
It defaults to zero microseconds. Increasing
|
||||||
|
this parameter may improve the throughput of
|
||||||
|
multi-threaded, synchronous workloads on very
|
||||||
|
fast disks, at the cost of increasing latency.
|
||||||
|
|
||||||
|
journal_ioprio=prio The I/O priority (from 0 to 7, where 0 is the
|
||||||
|
highest priorty) which should be used for I/O
|
||||||
|
operations submitted by kjournald2 during a
|
||||||
|
commit operation. This defaults to 3, which is
|
||||||
|
a slightly higher priority than the default I/O
|
||||||
|
priority.
|
||||||
|
|
||||||
Data Mode
|
Data Mode
|
||||||
=========
|
=========
|
||||||
There are 3 different data modes:
|
There are 3 different data modes:
|
||||||
|
|
|
@ -76,13 +76,13 @@ the fdtable structure -
|
||||||
5. Handling of the file structures is special. Since the look-up
|
5. Handling of the file structures is special. Since the look-up
|
||||||
of the fd (fget()/fget_light()) are lock-free, it is possible
|
of the fd (fget()/fget_light()) are lock-free, it is possible
|
||||||
that look-up may race with the last put() operation on the
|
that look-up may race with the last put() operation on the
|
||||||
file structure. This is avoided using atomic_inc_not_zero()
|
file structure. This is avoided using atomic_long_inc_not_zero()
|
||||||
on ->f_count :
|
on ->f_count :
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
file = fcheck_files(files, fd);
|
file = fcheck_files(files, fd);
|
||||||
if (file) {
|
if (file) {
|
||||||
if (atomic_inc_not_zero(&file->f_count))
|
if (atomic_long_inc_not_zero(&file->f_count))
|
||||||
*fput_needed = 1;
|
*fput_needed = 1;
|
||||||
else
|
else
|
||||||
/* Didn't get the reference, someone's freed */
|
/* Didn't get the reference, someone's freed */
|
||||||
|
@ -92,7 +92,7 @@ the fdtable structure -
|
||||||
....
|
....
|
||||||
return file;
|
return file;
|
||||||
|
|
||||||
atomic_inc_not_zero() detects if refcounts is already zero or
|
atomic_long_inc_not_zero() detects if refcounts is already zero or
|
||||||
goes to zero during increment. If it does, we fail
|
goes to zero during increment. If it does, we fail
|
||||||
fget()/fget_light().
|
fget()/fget_light().
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@ Features which OCFS2 does not support yet:
|
||||||
- quotas
|
- quotas
|
||||||
- Directory change notification (F_NOTIFY)
|
- Directory change notification (F_NOTIFY)
|
||||||
- Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease)
|
- Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease)
|
||||||
- POSIX ACLs
|
|
||||||
|
|
||||||
Mount options
|
Mount options
|
||||||
=============
|
=============
|
||||||
|
@ -79,3 +78,5 @@ inode64 Indicates that Ocfs2 is allowed to create inodes at
|
||||||
bits of significance.
|
bits of significance.
|
||||||
user_xattr (*) Enables Extended User Attributes.
|
user_xattr (*) Enables Extended User Attributes.
|
||||||
nouser_xattr Disables Extended User Attributes.
|
nouser_xattr Disables Extended User Attributes.
|
||||||
|
acl Enables POSIX Access Control Lists support.
|
||||||
|
noacl (*) Disables POSIX Access Control Lists support.
|
||||||
|
|
|
@ -140,6 +140,7 @@ Table 1-1: Process specific entries in /proc
|
||||||
statm Process memory status information
|
statm Process memory status information
|
||||||
status Process status in human readable form
|
status Process status in human readable form
|
||||||
wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan
|
wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan
|
||||||
|
stack Report full stack trace, enable via CONFIG_STACKTRACE
|
||||||
smaps Extension based on maps, the rss size for each mapped file
|
smaps Extension based on maps, the rss size for each mapped file
|
||||||
..............................................................................
|
..............................................................................
|
||||||
|
|
||||||
|
@ -1385,6 +1386,15 @@ swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer
|
||||||
to retain dentry and inode caches. Increasing vfs_cache_pressure beyond 100
|
to retain dentry and inode caches. Increasing vfs_cache_pressure beyond 100
|
||||||
causes the kernel to prefer to reclaim dentries and inodes.
|
causes the kernel to prefer to reclaim dentries and inodes.
|
||||||
|
|
||||||
|
dirty_background_bytes
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
Contains the amount of dirty memory at which the pdflush background writeback
|
||||||
|
daemon will start writeback.
|
||||||
|
|
||||||
|
If dirty_background_bytes is written, dirty_background_ratio becomes a function
|
||||||
|
of its value (dirty_background_bytes / the amount of dirtyable system memory).
|
||||||
|
|
||||||
dirty_background_ratio
|
dirty_background_ratio
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
@ -1393,14 +1403,29 @@ pages + file cache, not including locked pages and HugePages), the number of
|
||||||
pages at which the pdflush background writeback daemon will start writing out
|
pages at which the pdflush background writeback daemon will start writing out
|
||||||
dirty data.
|
dirty data.
|
||||||
|
|
||||||
|
If dirty_background_ratio is written, dirty_background_bytes becomes a function
|
||||||
|
of its value (dirty_background_ratio * the amount of dirtyable system memory).
|
||||||
|
|
||||||
|
dirty_bytes
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Contains the amount of dirty memory at which a process generating disk writes
|
||||||
|
will itself start writeback.
|
||||||
|
|
||||||
|
If dirty_bytes is written, dirty_ratio becomes a function of its value
|
||||||
|
(dirty_bytes / the amount of dirtyable system memory).
|
||||||
|
|
||||||
dirty_ratio
|
dirty_ratio
|
||||||
-----------------
|
-----------
|
||||||
|
|
||||||
Contains, as a percentage of the dirtyable system memory (free pages + mapped
|
Contains, as a percentage of the dirtyable system memory (free pages + mapped
|
||||||
pages + file cache, not including locked pages and HugePages), the number of
|
pages + file cache, not including locked pages and HugePages), the number of
|
||||||
pages at which a process which is generating disk writes will itself start
|
pages at which a process which is generating disk writes will itself start
|
||||||
writing out dirty data.
|
writing out dirty data.
|
||||||
|
|
||||||
|
If dirty_ratio is written, dirty_bytes becomes a function of its value
|
||||||
|
(dirty_ratio * the amount of dirtyable system memory).
|
||||||
|
|
||||||
dirty_writeback_centisecs
|
dirty_writeback_centisecs
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
|
|
225
Documentation/filesystems/squashfs.txt
Normal file
225
Documentation/filesystems/squashfs.txt
Normal file
|
@ -0,0 +1,225 @@
|
||||||
|
SQUASHFS 4.0 FILESYSTEM
|
||||||
|
=======================
|
||||||
|
|
||||||
|
Squashfs is a compressed read-only filesystem for Linux.
|
||||||
|
It uses zlib compression to compress files, inodes and directories.
|
||||||
|
Inodes in the system are very small and all blocks are packed to minimise
|
||||||
|
data overhead. Block sizes greater than 4K are supported up to a maximum
|
||||||
|
of 1Mbytes (default block size 128K).
|
||||||
|
|
||||||
|
Squashfs is intended for general read-only filesystem use, for archival
|
||||||
|
use (i.e. in cases where a .tar.gz file may be used), and in constrained
|
||||||
|
block device/memory systems (e.g. embedded systems) where low overhead is
|
||||||
|
needed.
|
||||||
|
|
||||||
|
Mailing list: squashfs-devel@lists.sourceforge.net
|
||||||
|
Web site: www.squashfs.org
|
||||||
|
|
||||||
|
1. FILESYSTEM FEATURES
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
Squashfs filesystem features versus Cramfs:
|
||||||
|
|
||||||
|
Squashfs Cramfs
|
||||||
|
|
||||||
|
Max filesystem size: 2^64 16 MiB
|
||||||
|
Max file size: ~ 2 TiB 16 MiB
|
||||||
|
Max files: unlimited unlimited
|
||||||
|
Max directories: unlimited unlimited
|
||||||
|
Max entries per directory: unlimited unlimited
|
||||||
|
Max block size: 1 MiB 4 KiB
|
||||||
|
Metadata compression: yes no
|
||||||
|
Directory indexes: yes no
|
||||||
|
Sparse file support: yes no
|
||||||
|
Tail-end packing (fragments): yes no
|
||||||
|
Exportable (NFS etc.): yes no
|
||||||
|
Hard link support: yes no
|
||||||
|
"." and ".." in readdir: yes no
|
||||||
|
Real inode numbers: yes no
|
||||||
|
32-bit uids/gids: yes no
|
||||||
|
File creation time: yes no
|
||||||
|
Xattr and ACL support: no no
|
||||||
|
|
||||||
|
Squashfs compresses data, inodes and directories. In addition, inode and
|
||||||
|
directory data are highly compacted, and packed on byte boundaries. Each
|
||||||
|
compressed inode is on average 8 bytes in length (the exact length varies on
|
||||||
|
file type, i.e. regular file, directory, symbolic link, and block/char device
|
||||||
|
inodes have different sizes).
|
||||||
|
|
||||||
|
2. USING SQUASHFS
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
As squashfs is a read-only filesystem, the mksquashfs program must be used to
|
||||||
|
create populated squashfs filesystems. This and other squashfs utilities
|
||||||
|
can be obtained from http://www.squashfs.org. Usage instructions can be
|
||||||
|
obtained from this site also.
|
||||||
|
|
||||||
|
|
||||||
|
3. SQUASHFS FILESYSTEM DESIGN
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
A squashfs filesystem consists of seven parts, packed together on a byte
|
||||||
|
alignment:
|
||||||
|
|
||||||
|
---------------
|
||||||
|
| superblock |
|
||||||
|
|---------------|
|
||||||
|
| datablocks |
|
||||||
|
| & fragments |
|
||||||
|
|---------------|
|
||||||
|
| inode table |
|
||||||
|
|---------------|
|
||||||
|
| directory |
|
||||||
|
| table |
|
||||||
|
|---------------|
|
||||||
|
| fragment |
|
||||||
|
| table |
|
||||||
|
|---------------|
|
||||||
|
| export |
|
||||||
|
| table |
|
||||||
|
|---------------|
|
||||||
|
| uid/gid |
|
||||||
|
| lookup table |
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Compressed data blocks are written to the filesystem as files are read from
|
||||||
|
the source directory, and checked for duplicates. Once all file data has been
|
||||||
|
written the completed inode, directory, fragment, export and uid/gid lookup
|
||||||
|
tables are written.
|
||||||
|
|
||||||
|
3.1 Inodes
|
||||||
|
----------
|
||||||
|
|
||||||
|
Metadata (inodes and directories) are compressed in 8Kbyte blocks. Each
|
||||||
|
compressed block is prefixed by a two byte length, the top bit is set if the
|
||||||
|
block is uncompressed. A block will be uncompressed if the -noI option is set,
|
||||||
|
or if the compressed block was larger than the uncompressed block.
|
||||||
|
|
||||||
|
Inodes are packed into the metadata blocks, and are not aligned to block
|
||||||
|
boundaries, therefore inodes overlap compressed blocks. Inodes are identified
|
||||||
|
by a 48-bit number which encodes the location of the compressed metadata block
|
||||||
|
containing the inode, and the byte offset into that block where the inode is
|
||||||
|
placed (<block, offset>).
|
||||||
|
|
||||||
|
To maximise compression there are different inodes for each file type
|
||||||
|
(regular file, directory, device, etc.), the inode contents and length
|
||||||
|
varying with the type.
|
||||||
|
|
||||||
|
To further maximise compression, two types of regular file inode and
|
||||||
|
directory inode are defined: inodes optimised for frequently occurring
|
||||||
|
regular files and directories, and extended types where extra
|
||||||
|
information has to be stored.
|
||||||
|
|
||||||
|
3.2 Directories
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Like inodes, directories are packed into compressed metadata blocks, stored
|
||||||
|
in a directory table. Directories are accessed using the start address of
|
||||||
|
the metablock containing the directory and the offset into the
|
||||||
|
decompressed block (<block, offset>).
|
||||||
|
|
||||||
|
Directories are organised in a slightly complex way, and are not simply
|
||||||
|
a list of file names. The organisation takes advantage of the
|
||||||
|
fact that (in most cases) the inodes of the files will be in the same
|
||||||
|
compressed metadata block, and therefore, can share the start block.
|
||||||
|
Directories are therefore organised in a two level list, a directory
|
||||||
|
header containing the shared start block value, and a sequence of directory
|
||||||
|
entries, each of which share the shared start block. A new directory header
|
||||||
|
is written once/if the inode start block changes. The directory
|
||||||
|
header/directory entry list is repeated as many times as necessary.
|
||||||
|
|
||||||
|
Directories are sorted, and can contain a directory index to speed up
|
||||||
|
file lookup. Directory indexes store one entry per metablock, each entry
|
||||||
|
storing the index/filename mapping to the first directory header
|
||||||
|
in each metadata block. Directories are sorted in alphabetical order,
|
||||||
|
and at lookup the index is scanned linearly looking for the first filename
|
||||||
|
alphabetically larger than the filename being looked up. At this point the
|
||||||
|
location of the metadata block the filename is in has been found.
|
||||||
|
The general idea of the index is ensure only one metadata block needs to be
|
||||||
|
decompressed to do a lookup irrespective of the length of the directory.
|
||||||
|
This scheme has the advantage that it doesn't require extra memory overhead
|
||||||
|
and doesn't require much extra storage on disk.
|
||||||
|
|
||||||
|
3.3 File data
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Regular files consist of a sequence of contiguous compressed blocks, and/or a
|
||||||
|
compressed fragment block (tail-end packed block). The compressed size
|
||||||
|
of each datablock is stored in a block list contained within the
|
||||||
|
file inode.
|
||||||
|
|
||||||
|
To speed up access to datablocks when reading 'large' files (256 Mbytes or
|
||||||
|
larger), the code implements an index cache that caches the mapping from
|
||||||
|
block index to datablock location on disk.
|
||||||
|
|
||||||
|
The index cache allows Squashfs to handle large files (up to 1.75 TiB) while
|
||||||
|
retaining a simple and space-efficient block list on disk. The cache
|
||||||
|
is split into slots, caching up to eight 224 GiB files (128 KiB blocks).
|
||||||
|
Larger files use multiple slots, with 1.75 TiB files using all 8 slots.
|
||||||
|
The index cache is designed to be memory efficient, and by default uses
|
||||||
|
16 KiB.
|
||||||
|
|
||||||
|
3.4 Fragment lookup table
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
Regular files can contain a fragment index which is mapped to a fragment
|
||||||
|
location on disk and compressed size using a fragment lookup table. This
|
||||||
|
fragment lookup table is itself stored compressed into metadata blocks.
|
||||||
|
A second index table is used to locate these. This second index table for
|
||||||
|
speed of access (and because it is small) is read at mount time and cached
|
||||||
|
in memory.
|
||||||
|
|
||||||
|
3.5 Uid/gid lookup table
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
For space efficiency regular files store uid and gid indexes, which are
|
||||||
|
converted to 32-bit uids/gids using an id look up table. This table is
|
||||||
|
stored compressed into metadata blocks. A second index table is used to
|
||||||
|
locate these. This second index table for speed of access (and because it
|
||||||
|
is small) is read at mount time and cached in memory.
|
||||||
|
|
||||||
|
3.6 Export table
|
||||||
|
----------------
|
||||||
|
|
||||||
|
To enable Squashfs filesystems to be exportable (via NFS etc.) filesystems
|
||||||
|
can optionally (disabled with the -no-exports Mksquashfs option) contain
|
||||||
|
an inode number to inode disk location lookup table. This is required to
|
||||||
|
enable Squashfs to map inode numbers passed in filehandles to the inode
|
||||||
|
location on disk, which is necessary when the export code reinstantiates
|
||||||
|
expired/flushed inodes.
|
||||||
|
|
||||||
|
This table is stored compressed into metadata blocks. A second index table is
|
||||||
|
used to locate these. This second index table for speed of access (and because
|
||||||
|
it is small) is read at mount time and cached in memory.
|
||||||
|
|
||||||
|
|
||||||
|
4. TODOS AND OUTSTANDING ISSUES
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
4.1 Todo list
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Implement Xattr and ACL support. The Squashfs 4.0 filesystem layout has hooks
|
||||||
|
for these but the code has not been written. Once the code has been written
|
||||||
|
the existing layout should not require modification.
|
||||||
|
|
||||||
|
4.2 Squashfs internal cache
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
Blocks in Squashfs are compressed. To avoid repeatedly decompressing
|
||||||
|
recently accessed data Squashfs uses two small metadata and fragment caches.
|
||||||
|
|
||||||
|
The cache is not used for file datablocks, these are decompressed and cached in
|
||||||
|
the page-cache in the normal way. The cache is used to temporarily cache
|
||||||
|
fragment and metadata blocks which have been read as a result of a metadata
|
||||||
|
(i.e. inode or directory) or fragment access. Because metadata and fragments
|
||||||
|
are packed together into blocks (to gain greater compression) the read of a
|
||||||
|
particular piece of metadata or fragment will retrieve other metadata/fragments
|
||||||
|
which have been packed with it, these because of locality-of-reference may be
|
||||||
|
read in the near future. Temporarily caching them ensures they are available
|
||||||
|
for near future access without requiring an additional read and decompress.
|
||||||
|
|
||||||
|
In the future this internal cache may be replaced with an implementation which
|
||||||
|
uses the kernel page cache. Because the page cache operates on page sized
|
||||||
|
units this may introduce additional complexity in terms of locking and
|
||||||
|
associated race conditions.
|
|
@ -95,6 +95,9 @@ no_chk_data_crc skip checking of CRCs on data nodes in order to
|
||||||
of this option is that corruption of the contents
|
of this option is that corruption of the contents
|
||||||
of a file can go unnoticed.
|
of a file can go unnoticed.
|
||||||
chk_data_crc (*) do not skip checking CRCs on data nodes
|
chk_data_crc (*) do not skip checking CRCs on data nodes
|
||||||
|
compr=none override default compressor and set it to "none"
|
||||||
|
compr=lzo override default compressor and set it to "lzo"
|
||||||
|
compr=zlib override default compressor and set it to "zlib"
|
||||||
|
|
||||||
|
|
||||||
Quick usage instructions
|
Quick usage instructions
|
||||||
|
|
|
@ -210,8 +210,8 @@ struct super_operations {
|
||||||
void (*put_super) (struct super_block *);
|
void (*put_super) (struct super_block *);
|
||||||
void (*write_super) (struct super_block *);
|
void (*write_super) (struct super_block *);
|
||||||
int (*sync_fs)(struct super_block *sb, int wait);
|
int (*sync_fs)(struct super_block *sb, int wait);
|
||||||
void (*write_super_lockfs) (struct super_block *);
|
int (*freeze_fs) (struct super_block *);
|
||||||
void (*unlockfs) (struct super_block *);
|
int (*unfreeze_fs) (struct super_block *);
|
||||||
int (*statfs) (struct dentry *, struct kstatfs *);
|
int (*statfs) (struct dentry *, struct kstatfs *);
|
||||||
int (*remount_fs) (struct super_block *, int *, char *);
|
int (*remount_fs) (struct super_block *, int *, char *);
|
||||||
void (*clear_inode) (struct inode *);
|
void (*clear_inode) (struct inode *);
|
||||||
|
@ -270,11 +270,11 @@ or bottom half).
|
||||||
a superblock. The second parameter indicates whether the method
|
a superblock. The second parameter indicates whether the method
|
||||||
should wait until the write out has been completed. Optional.
|
should wait until the write out has been completed. Optional.
|
||||||
|
|
||||||
write_super_lockfs: called when VFS is locking a filesystem and
|
freeze_fs: called when VFS is locking a filesystem and
|
||||||
forcing it into a consistent state. This method is currently
|
forcing it into a consistent state. This method is currently
|
||||||
used by the Logical Volume Manager (LVM).
|
used by the Logical Volume Manager (LVM).
|
||||||
|
|
||||||
unlockfs: called when VFS is unlocking a filesystem and making it writable
|
unfreeze_fs: called when VFS is unlocking a filesystem and making it writable
|
||||||
again.
|
again.
|
||||||
|
|
||||||
statfs: called when the VFS needs to get filesystem statistics. This
|
statfs: called when the VFS needs to get filesystem statistics. This
|
||||||
|
@ -733,7 +733,6 @@ struct file_operations {
|
||||||
ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
|
ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
|
||||||
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
|
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
|
||||||
int (*check_flags)(int);
|
int (*check_flags)(int);
|
||||||
int (*dir_notify)(struct file *filp, unsigned long arg);
|
|
||||||
int (*flock) (struct file *, int, struct file_lock *);
|
int (*flock) (struct file *, int, struct file_lock *);
|
||||||
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, size_t, unsigned int);
|
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, size_t, unsigned int);
|
||||||
ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned int);
|
ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned int);
|
||||||
|
@ -800,8 +799,6 @@ otherwise noted.
|
||||||
|
|
||||||
check_flags: called by the fcntl(2) system call for F_SETFL command
|
check_flags: called by the fcntl(2) system call for F_SETFL command
|
||||||
|
|
||||||
dir_notify: called by the fcntl(2) system call for F_NOTIFY command
|
|
||||||
|
|
||||||
flock: called by the flock(2) system call
|
flock: called by the flock(2) system call
|
||||||
|
|
||||||
splice_write: called by the VFS to splice data from a pipe to a file. This
|
splice_write: called by the VFS to splice data from a pipe to a file. This
|
||||||
|
@ -931,7 +928,7 @@ manipulate dentries:
|
||||||
d_lookup: look up a dentry given its parent and path name component
|
d_lookup: look up a dentry given its parent and path name component
|
||||||
It looks up the child of that given name from the dcache
|
It looks up the child of that given name from the dcache
|
||||||
hash table. If it is found, the reference count is incremented
|
hash table. If it is found, the reference count is incremented
|
||||||
and the dentry is returned. The caller must use d_put()
|
and the dentry is returned. The caller must use dput()
|
||||||
to free the dentry when it finishes using it.
|
to free the dentry when it finishes using it.
|
||||||
|
|
||||||
For further information on dentry locking, please refer to the document
|
For further information on dentry locking, please refer to the document
|
||||||
|
|
|
@ -229,10 +229,6 @@ The following sysctls are available for the XFS filesystem:
|
||||||
ISGID bit is cleared if the irix_sgid_inherit compatibility sysctl
|
ISGID bit is cleared if the irix_sgid_inherit compatibility sysctl
|
||||||
is set.
|
is set.
|
||||||
|
|
||||||
fs.xfs.restrict_chown (Min: 0 Default: 1 Max: 1)
|
|
||||||
Controls whether unprivileged users can use chown to "give away"
|
|
||||||
a file to another user.
|
|
||||||
|
|
||||||
fs.xfs.inherit_sync (Min: 0 Default: 1 Max: 1)
|
fs.xfs.inherit_sync (Min: 0 Default: 1 Max: 1)
|
||||||
Setting this to "1" will cause the "sync" flag set
|
Setting this to "1" will cause the "sync" flag set
|
||||||
by the xfs_io(8) chattr command on a directory to be
|
by the xfs_io(8) chattr command on a directory to be
|
||||||
|
|
|
@ -74,7 +74,7 @@ a sensor.
|
||||||
Notice that some banks have both a read and a write address this is how the
|
Notice that some banks have both a read and a write address this is how the
|
||||||
uGuru determines if a read from or a write to the bank is taking place, thus
|
uGuru determines if a read from or a write to the bank is taking place, thus
|
||||||
when reading you should always use the read address and when writing the
|
when reading you should always use the read address and when writing the
|
||||||
write address. The write address is always one (1) more then the read address.
|
write address. The write address is always one (1) more than the read address.
|
||||||
|
|
||||||
|
|
||||||
uGuru ready
|
uGuru ready
|
||||||
|
@ -121,7 +121,7 @@ Once all bytes have been read data will hold 0x09, but there is no reason to
|
||||||
test for this. Notice that the number of bytes is bank address dependent see
|
test for this. Notice that the number of bytes is bank address dependent see
|
||||||
above and below.
|
above and below.
|
||||||
|
|
||||||
After completing a successfull read it is advised to put the uGuru back in
|
After completing a successful read it is advised to put the uGuru back in
|
||||||
ready mode, so that it is ready for the next read / write cycle. This way
|
ready mode, so that it is ready for the next read / write cycle. This way
|
||||||
if your program / driver is unloaded and later loaded again the detection
|
if your program / driver is unloaded and later loaded again the detection
|
||||||
algorithm described above will still work.
|
algorithm described above will still work.
|
||||||
|
@ -141,7 +141,7 @@ don't ask why this is the way it is.
|
||||||
|
|
||||||
Once DATA holds 0x01 read CMD it should hold 0xAC now.
|
Once DATA holds 0x01 read CMD it should hold 0xAC now.
|
||||||
|
|
||||||
After completing a successfull write it is advised to put the uGuru back in
|
After completing a successful write it is advised to put the uGuru back in
|
||||||
ready mode, so that it is ready for the next read / write cycle. This way
|
ready mode, so that it is ready for the next read / write cycle. This way
|
||||||
if your program / driver is unloaded and later loaded again the detection
|
if your program / driver is unloaded and later loaded again the detection
|
||||||
algorithm described above will still work.
|
algorithm described above will still work.
|
||||||
|
@ -224,7 +224,7 @@ Bit 3: Beep if alarm (RW)
|
||||||
Bit 4: 1 if alarm cause measured temp is over the warning threshold (R)
|
Bit 4: 1 if alarm cause measured temp is over the warning threshold (R)
|
||||||
Bit 5: 1 if alarm cause measured volt is over the max threshold (R)
|
Bit 5: 1 if alarm cause measured volt is over the max threshold (R)
|
||||||
Bit 6: 1 if alarm cause measured volt is under the min threshold (R)
|
Bit 6: 1 if alarm cause measured volt is under the min threshold (R)
|
||||||
Bit 7: Volt sensor: Shutdown if alarm persist for more then 4 seconds (RW)
|
Bit 7: Volt sensor: Shutdown if alarm persist for more than 4 seconds (RW)
|
||||||
Temp sensor: Shutdown if temp is over the shutdown threshold (RW)
|
Temp sensor: Shutdown if temp is over the shutdown threshold (RW)
|
||||||
|
|
||||||
* This bit is only honored/used by the uGuru if a temp sensor is connected
|
* This bit is only honored/used by the uGuru if a temp sensor is connected
|
||||||
|
@ -293,7 +293,7 @@ Byte 0:
|
||||||
Alarm behaviour for the selected sensor. A 1 enables the described behaviour.
|
Alarm behaviour for the selected sensor. A 1 enables the described behaviour.
|
||||||
Bit 0: Give an alarm if measured rpm is under the min threshold (RW)
|
Bit 0: Give an alarm if measured rpm is under the min threshold (RW)
|
||||||
Bit 3: Beep if alarm (RW)
|
Bit 3: Beep if alarm (RW)
|
||||||
Bit 7: Shutdown if alarm persist for more then 4 seconds (RW)
|
Bit 7: Shutdown if alarm persist for more than 4 seconds (RW)
|
||||||
|
|
||||||
Byte 1:
|
Byte 1:
|
||||||
min threshold (scale as bank 0x26)
|
min threshold (scale as bank 0x26)
|
||||||
|
|
|
@ -31,15 +31,11 @@ Each of the measured inputs (temperature, fan speed) has corresponding high/low
|
||||||
limit values. The ADT7470 will signal an ALARM if any measured value exceeds
|
limit values. The ADT7470 will signal an ALARM if any measured value exceeds
|
||||||
either limit.
|
either limit.
|
||||||
|
|
||||||
The ADT7470 DOES NOT sample all inputs continuously. A single pin on the
|
The ADT7470 samples all inputs continuously. A kernel thread is started up for
|
||||||
ADT7470 is connected to a multitude of thermal diodes, but the chip must be
|
the purpose of periodically querying the temperature sensors, thus allowing the
|
||||||
instructed explicitly to read the multitude of diodes. If you want to use
|
automatic fan pwm control to set the fan speed. The driver will not read the
|
||||||
automatic fan control mode, you must manually read any of the temperature
|
registers more often than once every 5 seconds. Further, configuration data is
|
||||||
sensors or the fan control algorithm will not run. The chip WILL NOT DO THIS
|
only read once per minute.
|
||||||
AUTOMATICALLY; this must be done from userspace. This may be a bug in the chip
|
|
||||||
design, given that many other AD chips take care of this. The driver will not
|
|
||||||
read the registers more often than once every 5 seconds. Further,
|
|
||||||
configuration data is only read once per minute.
|
|
||||||
|
|
||||||
Special Features
|
Special Features
|
||||||
----------------
|
----------------
|
||||||
|
@ -72,5 +68,6 @@ pwm#_auto_point2_temp.
|
||||||
Notes
|
Notes
|
||||||
-----
|
-----
|
||||||
|
|
||||||
As stated above, the temperature inputs must be read periodically from
|
The temperature inputs no longer need to be read periodically from userspace in
|
||||||
userspace in order for the automatic pwm algorithm to run.
|
order for the automatic pwm algorithm to run. This was the case for earlier
|
||||||
|
versions of the driver.
|
||||||
|
|
89
Documentation/hwmon/f71882fg
Normal file
89
Documentation/hwmon/f71882fg
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
Kernel driver f71882fg
|
||||||
|
======================
|
||||||
|
|
||||||
|
Supported chips:
|
||||||
|
* Fintek F71882FG and F71883FG
|
||||||
|
Prefix: 'f71882fg'
|
||||||
|
Addresses scanned: none, address read from Super I/O config space
|
||||||
|
Datasheet: Available from the Fintek website
|
||||||
|
* Fintek F71862FG and F71863FG
|
||||||
|
Prefix: 'f71862fg'
|
||||||
|
Addresses scanned: none, address read from Super I/O config space
|
||||||
|
Datasheet: Available from the Fintek website
|
||||||
|
* Fintek F8000
|
||||||
|
Prefix: 'f8000'
|
||||||
|
Addresses scanned: none, address read from Super I/O config space
|
||||||
|
Datasheet: Not public
|
||||||
|
|
||||||
|
Author: Hans de Goede <hdegoede@redhat.com>
|
||||||
|
|
||||||
|
|
||||||
|
Description
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Fintek F718xxFG/F8000 Super I/O chips include complete hardware monitoring
|
||||||
|
capabilities. They can monitor up to 9 voltages (3 for the F8000), 4 fans and
|
||||||
|
3 temperature sensors.
|
||||||
|
|
||||||
|
These chips also have fan controlling features, using either DC or PWM, in
|
||||||
|
three different modes (one manual, two automatic).
|
||||||
|
|
||||||
|
The driver assumes that no more than one chip is present, which seems
|
||||||
|
reasonable.
|
||||||
|
|
||||||
|
|
||||||
|
Monitoring
|
||||||
|
----------
|
||||||
|
|
||||||
|
The Voltage, Fan and Temperature Monitoring uses the standard sysfs
|
||||||
|
interface as documented in sysfs-interface, without any exceptions.
|
||||||
|
|
||||||
|
|
||||||
|
Fan Control
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Both PWM (pulse-width modulation) and DC fan speed control methods are
|
||||||
|
supported. The right one to use depends on external circuitry on the
|
||||||
|
motherboard, so the driver assumes that the BIOS set the method
|
||||||
|
properly.
|
||||||
|
|
||||||
|
There are 2 modes to specify the speed of the fan, PWM duty cycle (or DC
|
||||||
|
voltage) mode, where 0-100% duty cycle (0-100% of 12V) is specified. And RPM
|
||||||
|
mode where the actual RPM of the fan (as measured) is controlled and the speed
|
||||||
|
gets specified as 0-100% of the fan#_full_speed file.
|
||||||
|
|
||||||
|
Since both modes work in a 0-100% (mapped to 0-255) scale, there isn't a
|
||||||
|
whole lot of a difference when modifying fan control settings. The only
|
||||||
|
important difference is that in RPM mode the 0-100% controls the fan speed
|
||||||
|
between 0-100% of fan#_full_speed. It is assumed that if the BIOS programs
|
||||||
|
RPM mode, it will also set fan#_full_speed properly, if it does not then
|
||||||
|
fan control will not work properly, unless you set a sane fan#_full_speed
|
||||||
|
value yourself.
|
||||||
|
|
||||||
|
Switching between these modes requires re-initializing a whole bunch of
|
||||||
|
registers, so the mode which the BIOS has set is kept. The mode is
|
||||||
|
printed when loading the driver.
|
||||||
|
|
||||||
|
Three different fan control modes are supported; the mode number is written
|
||||||
|
to the pwm#_enable file. Note that not all modes are supported on all
|
||||||
|
chips, and some modes may only be available in RPM / PWM mode on the F8000.
|
||||||
|
Writing an unsupported mode will result in an invalid parameter error.
|
||||||
|
|
||||||
|
* 1: Manual mode
|
||||||
|
You ask for a specific PWM duty cycle / DC voltage or a specific % of
|
||||||
|
fan#_full_speed by writing to the pwm# file. This mode is only
|
||||||
|
available on the F8000 if the fan channel is in RPM mode.
|
||||||
|
|
||||||
|
* 2: Normal auto mode
|
||||||
|
You can define a number of temperature/fan speed trip points, which % the
|
||||||
|
fan should run at at this temp and which temp a fan should follow using the
|
||||||
|
standard sysfs interface. The number and type of trip points is chip
|
||||||
|
depended, see which files are available in sysfs.
|
||||||
|
Fan/PWM channel 3 of the F8000 is always in this mode!
|
||||||
|
|
||||||
|
* 3: Thermostat mode (Only available on the F8000 when in duty cycle mode)
|
||||||
|
The fan speed is regulated to keep the temp the fan is mapped to between
|
||||||
|
temp#_auto_point2_temp and temp#_auto_point3_temp.
|
||||||
|
|
||||||
|
Both of the automatic modes require that pwm1 corresponds to fan1, pwm2 to
|
||||||
|
fan2 and pwm3 to fan3.
|
|
@ -26,6 +26,10 @@ Supported chips:
|
||||||
Datasheet: Publicly available at the ITE website
|
Datasheet: Publicly available at the ITE website
|
||||||
http://www.ite.com.tw/product_info/file/pc/IT8718F_V0.2.zip
|
http://www.ite.com.tw/product_info/file/pc/IT8718F_V0.2.zip
|
||||||
http://www.ite.com.tw/product_info/file/pc/IT8718F_V0%203_(for%20C%20version).zip
|
http://www.ite.com.tw/product_info/file/pc/IT8718F_V0%203_(for%20C%20version).zip
|
||||||
|
* IT8720F
|
||||||
|
Prefix: 'it8720'
|
||||||
|
Addresses scanned: from Super I/O config space (8 I/O ports)
|
||||||
|
Datasheet: Not yet publicly available.
|
||||||
* SiS950 [clone of IT8705F]
|
* SiS950 [clone of IT8705F]
|
||||||
Prefix: 'it87'
|
Prefix: 'it87'
|
||||||
Addresses scanned: from Super I/O config space (8 I/O ports)
|
Addresses scanned: from Super I/O config space (8 I/O ports)
|
||||||
|
@ -71,7 +75,7 @@ Description
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
This driver implements support for the IT8705F, IT8712F, IT8716F,
|
This driver implements support for the IT8705F, IT8712F, IT8716F,
|
||||||
IT8718F, IT8726F and SiS950 chips.
|
IT8718F, IT8720F, IT8726F and SiS950 chips.
|
||||||
|
|
||||||
These chips are 'Super I/O chips', supporting floppy disks, infrared ports,
|
These chips are 'Super I/O chips', supporting floppy disks, infrared ports,
|
||||||
joysticks and other miscellaneous stuff. For hardware monitoring, they
|
joysticks and other miscellaneous stuff. For hardware monitoring, they
|
||||||
|
@ -84,19 +88,19 @@ the IT8716F and late IT8712F have 6. They are shared with other functions
|
||||||
though, so the functionality may not be available on a given system.
|
though, so the functionality may not be available on a given system.
|
||||||
The driver dumbly assume it is there.
|
The driver dumbly assume it is there.
|
||||||
|
|
||||||
The IT8718F also features VID inputs (up to 8 pins) but the value is
|
The IT8718F and IT8720F also features VID inputs (up to 8 pins) but the value
|
||||||
stored in the Super-I/O configuration space. Due to technical limitations,
|
is stored in the Super-I/O configuration space. Due to technical limitations,
|
||||||
this value can currently only be read once at initialization time, so
|
this value can currently only be read once at initialization time, so
|
||||||
the driver won't notice and report changes in the VID value. The two
|
the driver won't notice and report changes in the VID value. The two
|
||||||
upper VID bits share their pins with voltage inputs (in5 and in6) so you
|
upper VID bits share their pins with voltage inputs (in5 and in6) so you
|
||||||
can't have both on a given board.
|
can't have both on a given board.
|
||||||
|
|
||||||
The IT8716F, IT8718F and later IT8712F revisions have support for
|
The IT8716F, IT8718F, IT8720F and later IT8712F revisions have support for
|
||||||
2 additional fans. The additional fans are supported by the driver.
|
2 additional fans. The additional fans are supported by the driver.
|
||||||
|
|
||||||
The IT8716F and IT8718F, and late IT8712F and IT8705F also have optional
|
The IT8716F, IT8718F and IT8720F, and late IT8712F and IT8705F also have
|
||||||
16-bit tachometer counters for fans 1 to 3. This is better (no more fan
|
optional 16-bit tachometer counters for fans 1 to 3. This is better (no more
|
||||||
clock divider mess) but not compatible with the older chips and
|
fan clock divider mess) but not compatible with the older chips and
|
||||||
revisions. The 16-bit tachometer mode is enabled by the driver when one
|
revisions. The 16-bit tachometer mode is enabled by the driver when one
|
||||||
of the above chips is detected.
|
of the above chips is detected.
|
||||||
|
|
||||||
|
@ -122,7 +126,7 @@ zero'; this is important for negative voltage measurements. All voltage
|
||||||
inputs can measure voltages between 0 and 4.08 volts, with a resolution of
|
inputs can measure voltages between 0 and 4.08 volts, with a resolution of
|
||||||
0.016 volt. The battery voltage in8 does not have limit registers.
|
0.016 volt. The battery voltage in8 does not have limit registers.
|
||||||
|
|
||||||
The VID lines (IT8712F/IT8716F/IT8718F) encode the core voltage value:
|
The VID lines (IT8712F/IT8716F/IT8718F/IT8720F) encode the core voltage value:
|
||||||
the voltage level your processor should work with. This is hardcoded by
|
the voltage level your processor should work with. This is hardcoded by
|
||||||
the mainboard and/or processor itself. It is a value in volts.
|
the mainboard and/or processor itself. It is a value in volts.
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
Kernel driver lm70
|
Kernel driver lm70
|
||||||
==================
|
==================
|
||||||
|
|
||||||
Supported chip:
|
Supported chips:
|
||||||
* National Semiconductor LM70
|
* National Semiconductor LM70
|
||||||
Datasheet: http://www.national.com/pf/LM/LM70.html
|
Datasheet: http://www.national.com/pf/LM/LM70.html
|
||||||
|
* Texas Instruments TMP121/TMP123
|
||||||
|
Information: http://focus.ti.com/docs/prod/folders/print/tmp121.html
|
||||||
|
|
||||||
Author:
|
Author:
|
||||||
Kaiwan N Billimoria <kaiwan@designergraphix.com>
|
Kaiwan N Billimoria <kaiwan@designergraphix.com>
|
||||||
|
@ -25,6 +27,14 @@ complement digital temperature (sent via the SIO line), is available in the
|
||||||
driver for interpretation. This driver makes use of the kernel's in-core
|
driver for interpretation. This driver makes use of the kernel's in-core
|
||||||
SPI support.
|
SPI support.
|
||||||
|
|
||||||
|
As a real (in-tree) example of this "SPI protocol driver" interfacing
|
||||||
|
with a "SPI master controller driver", see drivers/spi/spi_lm70llp.c
|
||||||
|
and its associated documentation.
|
||||||
|
|
||||||
|
The TMP121/TMP123 are very similar; main differences are 4 wire SPI inter-
|
||||||
|
face (read only) and 13-bit temperature data (0.0625 degrees celsius reso-
|
||||||
|
lution).
|
||||||
|
|
||||||
Thanks to
|
Thanks to
|
||||||
---------
|
---------
|
||||||
Jean Delvare <khali@linux-fr.org> for mentoring the hwmon-side driver
|
Jean Delvare <khali@linux-fr.org> for mentoring the hwmon-side driver
|
||||||
|
|
|
@ -164,7 +164,7 @@ configured individually according to the following options.
|
||||||
temperature. (PWM value from 0 to 255)
|
temperature. (PWM value from 0 to 255)
|
||||||
|
|
||||||
* pwm#_auto_pwm_minctl - this flags selects for temp#_auto_temp_off temperature
|
* pwm#_auto_pwm_minctl - this flags selects for temp#_auto_temp_off temperature
|
||||||
the bahaviour of fans. Write 1 to let fans spinning at
|
the behaviour of fans. Write 1 to let fans spinning at
|
||||||
pwm#_auto_pwm_min or write 0 to let them off.
|
pwm#_auto_pwm_min or write 0 to let them off.
|
||||||
|
|
||||||
NOTE: It has been reported that there is a bug in the LM85 that causes the flag
|
NOTE: It has been reported that there is a bug in the LM85 that causes the flag
|
||||||
|
|
81
Documentation/hwmon/ltc4245
Normal file
81
Documentation/hwmon/ltc4245
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
Kernel driver ltc4245
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Supported chips:
|
||||||
|
* Linear Technology LTC4245
|
||||||
|
Prefix: 'ltc4245'
|
||||||
|
Addresses scanned: 0x20-0x3f
|
||||||
|
Datasheet:
|
||||||
|
http://www.linear.com/pc/downloadDocument.do?navId=H0,C1,C1003,C1006,C1140,P19392,D13517
|
||||||
|
|
||||||
|
Author: Ira W. Snyder <iws@ovro.caltech.edu>
|
||||||
|
|
||||||
|
|
||||||
|
Description
|
||||||
|
-----------
|
||||||
|
|
||||||
|
The LTC4245 controller allows a board to be safely inserted and removed
|
||||||
|
from a live backplane in multiple supply systems such as CompactPCI and
|
||||||
|
PCI Express.
|
||||||
|
|
||||||
|
|
||||||
|
Usage Notes
|
||||||
|
-----------
|
||||||
|
|
||||||
|
This driver does not probe for LTC4245 devices, due to the fact that some
|
||||||
|
of the possible addresses are unfriendly to probing. You will need to use
|
||||||
|
the "force" parameter to tell the driver where to find the device.
|
||||||
|
|
||||||
|
Example: the following will load the driver for an LTC4245 at address 0x23
|
||||||
|
on I2C bus #1:
|
||||||
|
$ modprobe ltc4245 force=1,0x23
|
||||||
|
|
||||||
|
|
||||||
|
Sysfs entries
|
||||||
|
-------------
|
||||||
|
|
||||||
|
The LTC4245 has built-in limits for over and under current warnings. This
|
||||||
|
makes it very likely that the reference circuit will be used.
|
||||||
|
|
||||||
|
This driver uses the values in the datasheet to change the register values
|
||||||
|
into the values specified in the sysfs-interface document. The current readings
|
||||||
|
rely on the sense resistors listed in Table 2: "Sense Resistor Values".
|
||||||
|
|
||||||
|
in1_input 12v input voltage (mV)
|
||||||
|
in2_input 5v input voltage (mV)
|
||||||
|
in3_input 3v input voltage (mV)
|
||||||
|
in4_input Vee (-12v) input voltage (mV)
|
||||||
|
|
||||||
|
in1_min_alarm 12v input undervoltage alarm
|
||||||
|
in2_min_alarm 5v input undervoltage alarm
|
||||||
|
in3_min_alarm 3v input undervoltage alarm
|
||||||
|
in4_min_alarm Vee (-12v) input undervoltage alarm
|
||||||
|
|
||||||
|
curr1_input 12v current (mA)
|
||||||
|
curr2_input 5v current (mA)
|
||||||
|
curr3_input 3v current (mA)
|
||||||
|
curr4_input Vee (-12v) current (mA)
|
||||||
|
|
||||||
|
curr1_max_alarm 12v overcurrent alarm
|
||||||
|
curr2_max_alarm 5v overcurrent alarm
|
||||||
|
curr3_max_alarm 3v overcurrent alarm
|
||||||
|
curr4_max_alarm Vee (-12v) overcurrent alarm
|
||||||
|
|
||||||
|
in5_input 12v output voltage (mV)
|
||||||
|
in6_input 5v output voltage (mV)
|
||||||
|
in7_input 3v output voltage (mV)
|
||||||
|
in8_input Vee (-12v) output voltage (mV)
|
||||||
|
|
||||||
|
in5_min_alarm 12v output undervoltage alarm
|
||||||
|
in6_min_alarm 5v output undervoltage alarm
|
||||||
|
in7_min_alarm 3v output undervoltage alarm
|
||||||
|
in8_min_alarm Vee (-12v) output undervoltage alarm
|
||||||
|
|
||||||
|
in9_input GPIO #1 voltage data
|
||||||
|
in10_input GPIO #2 voltage data
|
||||||
|
in11_input GPIO #3 voltage data
|
||||||
|
|
||||||
|
power1_input 12v power usage (mW)
|
||||||
|
power2_input 5v power usage (mW)
|
||||||
|
power3_input 3v power usage (mW)
|
||||||
|
power4_input Vee (-12v) power usage (mW)
|
|
@ -11,3 +11,8 @@ unplug old device(s) and plug new device(s)
|
||||||
# echo -n "1" > /sys/class/ide_port/idex/scan
|
# echo -n "1" > /sys/class/ide_port/idex/scan
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
NOTE: please make sure that partitions are unmounted and that there are
|
||||||
|
no other active references to devices before doing "delete_devices" step,
|
||||||
|
also do not attempt "scan" step on devices currently in use -- otherwise
|
||||||
|
results may be unpredictable and lead to data loss if you're unlucky
|
||||||
|
|
109
Documentation/input/walkera0701.txt
Normal file
109
Documentation/input/walkera0701.txt
Normal file
|
@ -0,0 +1,109 @@
|
||||||
|
|
||||||
|
Walkera WK-0701 transmitter is supplied with a ready to fly Walkera
|
||||||
|
helicopters such as HM36, HM37, HM60. The walkera0701 module enables to use
|
||||||
|
this transmitter as joystick
|
||||||
|
|
||||||
|
Devel homepage and download:
|
||||||
|
http://zub.fei.tuke.sk/walkera-wk0701/
|
||||||
|
|
||||||
|
or use cogito:
|
||||||
|
cg-clone http://zub.fei.tuke.sk/GIT/walkera0701-joystick
|
||||||
|
|
||||||
|
|
||||||
|
Connecting to PC:
|
||||||
|
|
||||||
|
At back side of transmitter S-video connector can be found. Modulation
|
||||||
|
pulses from processor to HF part can be found at pin 2 of this connector,
|
||||||
|
pin 3 is GND. Between pin 3 and CPU 5k6 resistor can be found. To get
|
||||||
|
modulation pulses to PC, signal pulses must be amplified.
|
||||||
|
|
||||||
|
Cable: (walkera TX to parport)
|
||||||
|
|
||||||
|
Walkera WK-0701 TX S-VIDEO connector:
|
||||||
|
(back side of TX)
|
||||||
|
__ __ S-video: canon25
|
||||||
|
/ |_| \ pin 2 (signal) NPN parport
|
||||||
|
/ O 4 3 O \ pin 3 (GND) LED ________________ 10 ACK
|
||||||
|
( O 2 1 O ) | C
|
||||||
|
\ ___ / 2 ________________________|\|_____|/
|
||||||
|
| [___] | |/| B |\
|
||||||
|
------- 3 __________________________________|________________ 25 GND
|
||||||
|
E
|
||||||
|
|
||||||
|
|
||||||
|
I use green LED and BC109 NPN transistor.
|
||||||
|
|
||||||
|
Software:
|
||||||
|
|
||||||
|
Build kernel with walkera0701 module. Module walkera0701 need exclusive
|
||||||
|
access to parport, modules like lp must be unloaded before loading
|
||||||
|
walkera0701 module, check dmesg for error messages. Connect TX to PC by
|
||||||
|
cable and run jstest /dev/input/js0 to see values from TX. If no value can
|
||||||
|
be changed by TX "joystick", check output from /proc/interrupts. Value for
|
||||||
|
(usually irq7) parport must increase if TX is on.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Technical details:
|
||||||
|
|
||||||
|
Driver use interrupt from parport ACK input bit to measure pulse length
|
||||||
|
using hrtimers.
|
||||||
|
|
||||||
|
Frame format:
|
||||||
|
Based on walkera WK-0701 PCM Format description by Shaul Eizikovich.
|
||||||
|
(downloaded from http://www.smartpropoplus.com/Docs/Walkera_Wk-0701_PCM.pdf)
|
||||||
|
|
||||||
|
Signal pulses:
|
||||||
|
(ANALOG)
|
||||||
|
SYNC BIN OCT
|
||||||
|
+---------+ +------+
|
||||||
|
| | | |
|
||||||
|
--+ +------+ +---
|
||||||
|
|
||||||
|
Frame:
|
||||||
|
SYNC , BIN1, OCT1, BIN2, OCT2 ... BIN24, OCT24, BIN25, next frame SYNC ..
|
||||||
|
|
||||||
|
pulse length:
|
||||||
|
Binary values: Analog octal values:
|
||||||
|
|
||||||
|
288 uS Binary 0 318 uS 000
|
||||||
|
438 uS Binary 1 398 uS 001
|
||||||
|
478 uS 010
|
||||||
|
558 uS 011
|
||||||
|
638 uS 100
|
||||||
|
1306 uS SYNC 718 uS 101
|
||||||
|
798 uS 110
|
||||||
|
878 uS 111
|
||||||
|
|
||||||
|
24 bin+oct values + 1 bin value = 24*4+1 bits = 97 bits
|
||||||
|
|
||||||
|
(Warning, pulses on ACK ar inverted by transistor, irq is rised up on sync
|
||||||
|
to bin change or octal value to bin change).
|
||||||
|
|
||||||
|
Binary data representations:
|
||||||
|
|
||||||
|
One binary and octal value can be grouped to nibble. 24 nibbles + one binary
|
||||||
|
values can be sampled between sync pulses.
|
||||||
|
|
||||||
|
Values for first four channels (analog joystick values) can be found in
|
||||||
|
first 10 nibbles. Analog value is represented by one sign bit and 9 bit
|
||||||
|
absolute binary value. (10 bits per channel). Next nibble is checksum for
|
||||||
|
first ten nibbles.
|
||||||
|
|
||||||
|
Next nibbles 12 .. 21 represents four channels (not all channels can be
|
||||||
|
directly controlled from TX). Binary representations ar the same as in first
|
||||||
|
four channels. In nibbles 22 and 23 is a special magic number. Nibble 24 is
|
||||||
|
checksum for nibbles 12..23.
|
||||||
|
|
||||||
|
After last octal value for nibble 24 and next sync pulse one additional
|
||||||
|
binary value can be sampled. This bit and magic number is not used in
|
||||||
|
software driver. Some details about this magic numbers can be found in
|
||||||
|
Walkera_Wk-0701_PCM.pdf.
|
||||||
|
|
||||||
|
Checksum calculation:
|
||||||
|
|
||||||
|
Summary of octal values in nibbles must be same as octal value in checksum
|
||||||
|
nibble (only first 3 bits are used). Binary value for checksum nibble is
|
||||||
|
calculated by sum of binary values in checked nibbles + sum of octal values
|
||||||
|
in checked nibbles divided by 8. Only bit 0 of this sum is used.
|
||||||
|
|
|
@ -84,7 +84,7 @@ Code Seq# Include File Comments
|
||||||
'B' C0-FF advanced bbus
|
'B' C0-FF advanced bbus
|
||||||
<mailto:maassen@uni-freiburg.de>
|
<mailto:maassen@uni-freiburg.de>
|
||||||
'C' all linux/soundcard.h
|
'C' all linux/soundcard.h
|
||||||
'D' all asm-s390/dasd.h
|
'D' all arch/s390/include/asm/dasd.h
|
||||||
'E' all linux/input.h
|
'E' all linux/input.h
|
||||||
'F' all linux/fb.h
|
'F' all linux/fb.h
|
||||||
'H' all linux/hiddev.h
|
'H' all linux/hiddev.h
|
||||||
|
@ -97,6 +97,7 @@ Code Seq# Include File Comments
|
||||||
<http://linux01.gwdg.de/~alatham/ppdd.html>
|
<http://linux01.gwdg.de/~alatham/ppdd.html>
|
||||||
'M' all linux/soundcard.h
|
'M' all linux/soundcard.h
|
||||||
'N' 00-1F drivers/usb/scanner.h
|
'N' 00-1F drivers/usb/scanner.h
|
||||||
|
'O' 00-02 include/mtd/ubi-user.h UBI
|
||||||
'P' all linux/soundcard.h
|
'P' all linux/soundcard.h
|
||||||
'Q' all linux/soundcard.h
|
'Q' all linux/soundcard.h
|
||||||
'R' 00-1F linux/random.h
|
'R' 00-1F linux/random.h
|
||||||
|
@ -104,7 +105,7 @@ Code Seq# Include File Comments
|
||||||
'S' 80-81 scsi/scsi_ioctl.h conflict!
|
'S' 80-81 scsi/scsi_ioctl.h conflict!
|
||||||
'S' 82-FF scsi/scsi.h conflict!
|
'S' 82-FF scsi/scsi.h conflict!
|
||||||
'T' all linux/soundcard.h conflict!
|
'T' all linux/soundcard.h conflict!
|
||||||
'T' all asm-i386/ioctls.h conflict!
|
'T' all arch/x86/include/asm/ioctls.h conflict!
|
||||||
'U' 00-EF linux/drivers/usb/usb.h
|
'U' 00-EF linux/drivers/usb/usb.h
|
||||||
'V' all linux/vt.h
|
'V' all linux/vt.h
|
||||||
'W' 00-1F linux/watchdog.h conflict!
|
'W' 00-1F linux/watchdog.h conflict!
|
||||||
|
@ -119,7 +120,7 @@ Code Seq# Include File Comments
|
||||||
<mailto:natalia@nikhefk.nikhef.nl>
|
<mailto:natalia@nikhefk.nikhef.nl>
|
||||||
'c' 00-7F linux/comstats.h conflict!
|
'c' 00-7F linux/comstats.h conflict!
|
||||||
'c' 00-7F linux/coda.h conflict!
|
'c' 00-7F linux/coda.h conflict!
|
||||||
'c' 80-9F asm-s390/chsc.h
|
'c' 80-9F arch/s390/include/asm/chsc.h
|
||||||
'd' 00-FF linux/char/drm/drm/h conflict!
|
'd' 00-FF linux/char/drm/drm/h conflict!
|
||||||
'd' 00-DF linux/video_decoder.h conflict!
|
'd' 00-DF linux/video_decoder.h conflict!
|
||||||
'd' F0-FF linux/digi1.h
|
'd' F0-FF linux/digi1.h
|
||||||
|
@ -142,6 +143,9 @@ Code Seq# Include File Comments
|
||||||
'n' 00-7F linux/ncp_fs.h
|
'n' 00-7F linux/ncp_fs.h
|
||||||
'n' E0-FF video/matrox.h matroxfb
|
'n' E0-FF video/matrox.h matroxfb
|
||||||
'o' 00-1F fs/ocfs2/ocfs2_fs.h OCFS2
|
'o' 00-1F fs/ocfs2/ocfs2_fs.h OCFS2
|
||||||
|
'o' 00-03 include/mtd/ubi-user.h conflict! (OCFS2 and UBI overlaps)
|
||||||
|
'o' 40-41 include/mtd/ubi-user.h UBI
|
||||||
|
'o' 01-A1 include/linux/dvb/*.h DVB
|
||||||
'p' 00-0F linux/phantom.h conflict! (OpenHaptics needs this)
|
'p' 00-0F linux/phantom.h conflict! (OpenHaptics needs this)
|
||||||
'p' 00-3F linux/mc146818rtc.h conflict!
|
'p' 00-3F linux/mc146818rtc.h conflict!
|
||||||
'p' 40-7F linux/nvram.h
|
'p' 40-7F linux/nvram.h
|
||||||
|
@ -166,7 +170,7 @@ Code Seq# Include File Comments
|
||||||
<mailto:oe@port.de>
|
<mailto:oe@port.de>
|
||||||
0x80 00-1F linux/fb.h
|
0x80 00-1F linux/fb.h
|
||||||
0x81 00-1F linux/videotext.h
|
0x81 00-1F linux/videotext.h
|
||||||
0x89 00-06 asm-i386/sockios.h
|
0x89 00-06 arch/x86/include/asm/sockios.h
|
||||||
0x89 0B-DF linux/sockios.h
|
0x89 0B-DF linux/sockios.h
|
||||||
0x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range
|
0x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range
|
||||||
0x89 F0-FF linux/sockios.h SIOCDEVPRIVATE range
|
0x89 F0-FF linux/sockios.h SIOCDEVPRIVATE range
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
00-INDEX
|
00-INDEX
|
||||||
- this file: info on the kernel build process
|
- this file: info on the kernel build process
|
||||||
|
kbuild.txt
|
||||||
|
- developer information on kbuild
|
||||||
|
kconfig.txt
|
||||||
|
- usage help for make *config
|
||||||
kconfig-language.txt
|
kconfig-language.txt
|
||||||
- specification of Config Language, the language in Kconfig files
|
- specification of Config Language, the language in Kconfig files
|
||||||
makefiles.txt
|
makefiles.txt
|
||||||
|
|
133
Documentation/kbuild/kbuild.txt
Normal file
133
Documentation/kbuild/kbuild.txt
Normal file
|
@ -0,0 +1,133 @@
|
||||||
|
Environment variables
|
||||||
|
|
||||||
|
KCPPFLAGS
|
||||||
|
--------------------------------------------------
|
||||||
|
Additional options to pass when preprocessing. The preprocessing options
|
||||||
|
will be used in all cases where kbuild do preprocessing including
|
||||||
|
building C files and assembler files.
|
||||||
|
|
||||||
|
KAFLAGS
|
||||||
|
--------------------------------------------------
|
||||||
|
Additional options to the assembler.
|
||||||
|
|
||||||
|
KCFLAGS
|
||||||
|
--------------------------------------------------
|
||||||
|
Additional options to the C compiler.
|
||||||
|
|
||||||
|
KBUILD_VERBOSE
|
||||||
|
--------------------------------------------------
|
||||||
|
Set the kbuild verbosity. Can be assinged same values as "V=...".
|
||||||
|
See make help for the full list.
|
||||||
|
Setting "V=..." takes precedence over KBUILD_VERBOSE.
|
||||||
|
|
||||||
|
KBUILD_EXTMOD
|
||||||
|
--------------------------------------------------
|
||||||
|
Set the directory to look for the kernel source when building external
|
||||||
|
modules.
|
||||||
|
The directory can be specified in several ways:
|
||||||
|
1) Use "M=..." on the command line
|
||||||
|
2) Environmnet variable KBUILD_EXTMOD
|
||||||
|
3) Environmnet variable SUBDIRS
|
||||||
|
The possibilities are listed in the order they take precedence.
|
||||||
|
Using "M=..." will always override the others.
|
||||||
|
|
||||||
|
KBUILD_OUTPUT
|
||||||
|
--------------------------------------------------
|
||||||
|
Specify the output directory when building the kernel.
|
||||||
|
The output directory can also be specificed using "O=...".
|
||||||
|
Setting "O=..." takes precedence over KBUILD_OUTPUT
|
||||||
|
|
||||||
|
ARCH
|
||||||
|
--------------------------------------------------
|
||||||
|
Set ARCH to the architecture to be built.
|
||||||
|
In most cases the name of the architecture is the same as the
|
||||||
|
directory name found in the arch/ directory.
|
||||||
|
But some architectures suach as x86 and sparc has aliases.
|
||||||
|
x86: i386 for 32 bit, x86_64 for 64 bit
|
||||||
|
sparc: sparc for 32 bit, sparc64 for 64 bit
|
||||||
|
|
||||||
|
CROSS_COMPILE
|
||||||
|
--------------------------------------------------
|
||||||
|
Specify an optional fixed part of the binutils filename.
|
||||||
|
CROSS_COMPILE can be a part of the filename or the full path.
|
||||||
|
|
||||||
|
CROSS_COMPILE is also used for ccache is some setups.
|
||||||
|
|
||||||
|
CF
|
||||||
|
--------------------------------------------------
|
||||||
|
Additional options for sparse.
|
||||||
|
CF is often used on the command-line like this:
|
||||||
|
|
||||||
|
make CF=-Wbitwise C=2
|
||||||
|
|
||||||
|
INSTALL_PATH
|
||||||
|
--------------------------------------------------
|
||||||
|
INSTALL_PATH specifies where to place the updated kernel and system map
|
||||||
|
images. Default is /boot, but you can set it to other values
|
||||||
|
|
||||||
|
|
||||||
|
MODLIB
|
||||||
|
--------------------------------------------------
|
||||||
|
Specify where to install modules.
|
||||||
|
The default value is:
|
||||||
|
|
||||||
|
$(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
|
||||||
|
|
||||||
|
The value can be overridden in which case the default value is ignored.
|
||||||
|
|
||||||
|
INSTALL_MOD_PATH
|
||||||
|
--------------------------------------------------
|
||||||
|
INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
|
||||||
|
relocations required by build roots. This is not defined in the
|
||||||
|
makefile but the argument can be passed to make if needed.
|
||||||
|
|
||||||
|
INSTALL_MOD_STRIP
|
||||||
|
--------------------------------------------------
|
||||||
|
INSTALL_MOD_STRIP, if defined, will cause modules to be
|
||||||
|
stripped after they are installed. If INSTALL_MOD_STRIP is '1', then
|
||||||
|
the default option --strip-debug will be used. Otherwise,
|
||||||
|
INSTALL_MOD_STRIP will used as the options to the strip command.
|
||||||
|
|
||||||
|
INSTALL_FW_PATH
|
||||||
|
--------------------------------------------------
|
||||||
|
INSTALL_FW_PATH specify where to install the firmware blobs.
|
||||||
|
The default value is:
|
||||||
|
|
||||||
|
$(INSTALL_MOD_PATH)/lib/firmware
|
||||||
|
|
||||||
|
The value can be overridden in which case the default value is ignored.
|
||||||
|
|
||||||
|
INSTALL_HDR_PATH
|
||||||
|
--------------------------------------------------
|
||||||
|
INSTALL_HDR_PATH specify where to install user space headers when
|
||||||
|
executing "make headers_*".
|
||||||
|
The default value is:
|
||||||
|
|
||||||
|
$(objtree)/usr
|
||||||
|
|
||||||
|
$(objtree) is the directory where output files are saved.
|
||||||
|
The output directory is often set using "O=..." on the commandline.
|
||||||
|
|
||||||
|
The value can be overridden in which case the default value is ignored.
|
||||||
|
|
||||||
|
KBUILD_MODPOST_WARN
|
||||||
|
--------------------------------------------------
|
||||||
|
KBUILD_MODPOST_WARN can be set to avoid error out in case of undefined
|
||||||
|
symbols in the final module linking stage.
|
||||||
|
|
||||||
|
KBUILD_MODPOST_FINAL
|
||||||
|
--------------------------------------------------
|
||||||
|
KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
|
||||||
|
This is solely usefull to speed up test compiles.
|
||||||
|
|
||||||
|
KBUILD_EXTRA_SYMBOLS
|
||||||
|
--------------------------------------------------
|
||||||
|
For modules use symbols from another modules.
|
||||||
|
See more details in modules.txt.
|
||||||
|
|
||||||
|
ALLSOURCE_ARCHS
|
||||||
|
--------------------------------------------------
|
||||||
|
For tags/TAGS/cscope targets, you can specify more than one archs
|
||||||
|
to be included in the databases, separated by blankspace. e.g.
|
||||||
|
|
||||||
|
$ make ALLSOURCE_ARCHS="x86 mips arm" tags
|
188
Documentation/kbuild/kconfig.txt
Normal file
188
Documentation/kbuild/kconfig.txt
Normal file
|
@ -0,0 +1,188 @@
|
||||||
|
This file contains some assistance for using "make *config".
|
||||||
|
|
||||||
|
Use "make help" to list all of the possible configuration targets.
|
||||||
|
|
||||||
|
The xconfig ('qconf') and menuconfig ('mconf') programs also
|
||||||
|
have embedded help text. Be sure to check it for navigation,
|
||||||
|
search, and other general help text.
|
||||||
|
|
||||||
|
======================================================================
|
||||||
|
General
|
||||||
|
--------------------------------------------------
|
||||||
|
|
||||||
|
New kernel releases often introduce new config symbols. Often more
|
||||||
|
important, new kernel releases may rename config symbols. When
|
||||||
|
this happens, using a previously working .config file and running
|
||||||
|
"make oldconfig" won't necessarily produce a working new kernel
|
||||||
|
for you, so you may find that you need to see what NEW kernel
|
||||||
|
symbols have been introduced.
|
||||||
|
|
||||||
|
To see a list of new config symbols when using "make oldconfig", use
|
||||||
|
|
||||||
|
cp user/some/old.config .config
|
||||||
|
yes "" | make oldconfig >conf.new
|
||||||
|
|
||||||
|
and the config program will list as (NEW) any new symbols that have
|
||||||
|
unknown values. Of course, the .config file is also updated with
|
||||||
|
new (default) values, so you can use:
|
||||||
|
|
||||||
|
grep "(NEW)" conf.new
|
||||||
|
|
||||||
|
to see the new config symbols or you can 'diff' the previous and
|
||||||
|
new .config files to see the differences:
|
||||||
|
|
||||||
|
diff .config.old .config | less
|
||||||
|
|
||||||
|
(Yes, we need something better here.)
|
||||||
|
|
||||||
|
|
||||||
|
======================================================================
|
||||||
|
menuconfig
|
||||||
|
--------------------------------------------------
|
||||||
|
|
||||||
|
SEARCHING for CONFIG symbols
|
||||||
|
|
||||||
|
Searching in menuconfig:
|
||||||
|
|
||||||
|
The Search function searches for kernel configuration symbol
|
||||||
|
names, so you have to know something close to what you are
|
||||||
|
looking for.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
/hotplug
|
||||||
|
This lists all config symbols that contain "hotplug",
|
||||||
|
e.g., HOTPLUG, HOTPLUG_CPU, MEMORY_HOTPLUG.
|
||||||
|
|
||||||
|
For search help, enter / followed TAB-TAB-TAB (to highlight
|
||||||
|
<Help>) and Enter. This will tell you that you can also use
|
||||||
|
regular expressions (regexes) in the search string, so if you
|
||||||
|
are not interested in MEMORY_HOTPLUG, you could try
|
||||||
|
|
||||||
|
/^hotplug
|
||||||
|
|
||||||
|
|
||||||
|
______________________________________________________________________
|
||||||
|
Color Themes for 'menuconfig'
|
||||||
|
|
||||||
|
It is possible to select different color themes using the variable
|
||||||
|
MENUCONFIG_COLOR. To select a theme use:
|
||||||
|
|
||||||
|
make MENUCONFIG_COLOR=<theme> menuconfig
|
||||||
|
|
||||||
|
Available themes are:
|
||||||
|
mono => selects colors suitable for monochrome displays
|
||||||
|
blackbg => selects a color scheme with black background
|
||||||
|
classic => theme with blue background. The classic look
|
||||||
|
bluetitle => a LCD friendly version of classic. (default)
|
||||||
|
|
||||||
|
______________________________________________________________________
|
||||||
|
Environment variables in 'menuconfig'
|
||||||
|
|
||||||
|
KCONFIG_ALLCONFIG
|
||||||
|
--------------------------------------------------
|
||||||
|
(partially based on lkml email from/by Rob Landley, re: miniconfig)
|
||||||
|
--------------------------------------------------
|
||||||
|
The allyesconfig/allmodconfig/allnoconfig/randconfig variants can
|
||||||
|
also use the environment variable KCONFIG_ALLCONFIG as a flag or a
|
||||||
|
filename that contains config symbols that the user requires to be
|
||||||
|
set to a specific value. If KCONFIG_ALLCONFIG is used without a
|
||||||
|
filename, "make *config" checks for a file named
|
||||||
|
"all{yes/mod/no/random}.config" (corresponding to the *config command
|
||||||
|
that was used) for symbol values that are to be forced. If this file
|
||||||
|
is not found, it checks for a file named "all.config" to contain forced
|
||||||
|
values.
|
||||||
|
|
||||||
|
This enables you to create "miniature" config (miniconfig) or custom
|
||||||
|
config files containing just the config symbols that you are interested
|
||||||
|
in. Then the kernel config system generates the full .config file,
|
||||||
|
including dependencies of your miniconfig file, based on the miniconfig
|
||||||
|
file.
|
||||||
|
|
||||||
|
This 'KCONFIG_ALLCONFIG' file is a config file which contains
|
||||||
|
(usually a subset of all) preset config symbols. These variable
|
||||||
|
settings are still subject to normal dependency checks.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
KCONFIG_ALLCONFIG=custom-notebook.config make allnoconfig
|
||||||
|
or
|
||||||
|
KCONFIG_ALLCONFIG=mini.config make allnoconfig
|
||||||
|
or
|
||||||
|
make KCONFIG_ALLCONFIG=mini.config allnoconfig
|
||||||
|
|
||||||
|
These examples will disable most options (allnoconfig) but enable or
|
||||||
|
disable the options that are explicitly listed in the specified
|
||||||
|
mini-config files.
|
||||||
|
|
||||||
|
KCONFIG_NOSILENTUPDATE
|
||||||
|
--------------------------------------------------
|
||||||
|
If this variable has a non-blank value, it prevents silent kernel
|
||||||
|
config udpates (requires explicit updates).
|
||||||
|
|
||||||
|
KCONFIG_CONFIG
|
||||||
|
--------------------------------------------------
|
||||||
|
This environment variable can be used to specify a default kernel config
|
||||||
|
file name to override the default name of ".config".
|
||||||
|
|
||||||
|
KCONFIG_OVERWRITECONFIG
|
||||||
|
--------------------------------------------------
|
||||||
|
If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not
|
||||||
|
break symlinks when .config is a symlink to somewhere else.
|
||||||
|
|
||||||
|
KCONFIG_NOTIMESTAMP
|
||||||
|
--------------------------------------------------
|
||||||
|
If this environment variable exists and is non-null, the timestamp line
|
||||||
|
in generated .config files is omitted.
|
||||||
|
|
||||||
|
KCONFIG_AUTOCONFIG
|
||||||
|
--------------------------------------------------
|
||||||
|
This environment variable can be set to specify the path & name of the
|
||||||
|
"auto.conf" file. Its default value is "include/config/auto.conf".
|
||||||
|
|
||||||
|
KCONFIG_AUTOHEADER
|
||||||
|
--------------------------------------------------
|
||||||
|
This environment variable can be set to specify the path & name of the
|
||||||
|
"autoconf.h" (header) file. Its default value is "include/linux/autoconf.h".
|
||||||
|
|
||||||
|
______________________________________________________________________
|
||||||
|
menuconfig User Interface Options
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
MENUCONFIG_MODE
|
||||||
|
--------------------------------------------------
|
||||||
|
This mode shows all sub-menus in one large tree.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
MENUCONFIG_MODE=single_menu make menuconfig
|
||||||
|
|
||||||
|
======================================================================
|
||||||
|
xconfig
|
||||||
|
--------------------------------------------------
|
||||||
|
|
||||||
|
Searching in xconfig:
|
||||||
|
|
||||||
|
The Search function searches for kernel configuration symbol
|
||||||
|
names, so you have to know something close to what you are
|
||||||
|
looking for.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
Ctrl-F hotplug
|
||||||
|
or
|
||||||
|
Menu: File, Search, hotplug
|
||||||
|
|
||||||
|
lists all config symbol entries that contain "hotplug" in
|
||||||
|
the symbol name. In this Search dialog, you may change the
|
||||||
|
config setting for any of the entries that are not grayed out.
|
||||||
|
You can also enter a different search string without having
|
||||||
|
to return to the main menu.
|
||||||
|
|
||||||
|
|
||||||
|
======================================================================
|
||||||
|
gconfig
|
||||||
|
--------------------------------------------------
|
||||||
|
|
||||||
|
Searching in gconfig:
|
||||||
|
|
||||||
|
None (gconfig isn't maintained as well as xconfig or menuconfig);
|
||||||
|
however, gconfig does have a few more viewing choices than
|
||||||
|
xconfig does.
|
||||||
|
|
||||||
|
###
|
|
@ -253,7 +253,7 @@ following files:
|
||||||
|
|
||||||
# Module specific targets
|
# Module specific targets
|
||||||
genbin:
|
genbin:
|
||||||
echo "X" > 8123_bin_shipped
|
echo "X" > 8123_bin.o_shipped
|
||||||
|
|
||||||
|
|
||||||
In example 2, we are down to two fairly simple files and for simple
|
In example 2, we are down to two fairly simple files and for simple
|
||||||
|
@ -279,7 +279,7 @@ following files:
|
||||||
|
|
||||||
# Module specific targets
|
# Module specific targets
|
||||||
genbin:
|
genbin:
|
||||||
echo "X" > 8123_bin_shipped
|
echo "X" > 8123_bin.o_shipped
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,11 @@ The @argument descriptions must begin on the very next line following
|
||||||
this opening short function description line, with no intervening
|
this opening short function description line, with no intervening
|
||||||
empty comment lines.
|
empty comment lines.
|
||||||
|
|
||||||
|
If a function parameter is "..." (varargs), it should be listed in
|
||||||
|
kernel-doc notation as:
|
||||||
|
* @...: description
|
||||||
|
|
||||||
|
|
||||||
Example kernel-doc data structure comment.
|
Example kernel-doc data structure comment.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -282,6 +287,32 @@ struct my_struct {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Including documentation blocks in source files
|
||||||
|
----------------------------------------------
|
||||||
|
|
||||||
|
To facilitate having source code and comments close together, you can
|
||||||
|
include kernel-doc documentation blocks that are free-form comments
|
||||||
|
instead of being kernel-doc for functions, structures, unions,
|
||||||
|
enums, or typedefs. This could be used for something like a
|
||||||
|
theory of operation for a driver or library code, for example.
|
||||||
|
|
||||||
|
This is done by using a DOC: section keyword with a section title. E.g.:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DOC: Theory of Operation
|
||||||
|
*
|
||||||
|
* The whizbang foobar is a dilly of a gizmo. It can do whatever you
|
||||||
|
* want it to do, at any time. It reads your mind. Here's how it works.
|
||||||
|
*
|
||||||
|
* foo bar splat
|
||||||
|
*
|
||||||
|
* The only drawback to this gizmo is that is can sometimes damage
|
||||||
|
* hardware, software, or its subject(s).
|
||||||
|
*/
|
||||||
|
|
||||||
|
DOC: sections are used in SGML templates files as indicated below.
|
||||||
|
|
||||||
|
|
||||||
How to make new SGML template files
|
How to make new SGML template files
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
|
@ -302,6 +333,9 @@ exported using EXPORT_SYMBOL.
|
||||||
!F<filename> <function [functions...]> is replaced by the
|
!F<filename> <function [functions...]> is replaced by the
|
||||||
documentation, in <filename>, for the functions listed.
|
documentation, in <filename>, for the functions listed.
|
||||||
|
|
||||||
|
!P<filename> <section title> is replaced by the contents of the DOC:
|
||||||
|
section titled <section title> from <filename>.
|
||||||
|
Spaces are allowed in <section title>; do not quote the <section title>.
|
||||||
|
|
||||||
Tim.
|
Tim.
|
||||||
*/ <twaugh@redhat.com>
|
*/ <twaugh@redhat.com>
|
||||||
|
|
|
@ -91,6 +91,7 @@ parameter is applicable:
|
||||||
SUSPEND System suspend states are enabled.
|
SUSPEND System suspend states are enabled.
|
||||||
FTRACE Function tracing enabled.
|
FTRACE Function tracing enabled.
|
||||||
TS Appropriate touchscreen support is enabled.
|
TS Appropriate touchscreen support is enabled.
|
||||||
|
UMS USB Mass Storage support is enabled.
|
||||||
USB USB support is enabled.
|
USB USB support is enabled.
|
||||||
USBHID USB Human Interface Device support is enabled.
|
USBHID USB Human Interface Device support is enabled.
|
||||||
V4L Video For Linux support is enabled.
|
V4L Video For Linux support is enabled.
|
||||||
|
@ -140,6 +141,7 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||||
ht -- run only enough ACPI to enable Hyper Threading
|
ht -- run only enough ACPI to enable Hyper Threading
|
||||||
strict -- Be less tolerant of platforms that are not
|
strict -- Be less tolerant of platforms that are not
|
||||||
strictly ACPI specification compliant.
|
strictly ACPI specification compliant.
|
||||||
|
rsdt -- prefer RSDT over (default) XSDT
|
||||||
|
|
||||||
See also Documentation/power/pm.txt, pci=noacpi
|
See also Documentation/power/pm.txt, pci=noacpi
|
||||||
|
|
||||||
|
@ -150,16 +152,20 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||||
default: 0
|
default: 0
|
||||||
|
|
||||||
acpi_sleep= [HW,ACPI] Sleep options
|
acpi_sleep= [HW,ACPI] Sleep options
|
||||||
Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig, old_ordering }
|
Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig,
|
||||||
See Documentation/power/video.txt for s3_bios and s3_mode.
|
old_ordering, s4_nonvs }
|
||||||
|
See Documentation/power/video.txt for information on
|
||||||
|
s3_bios and s3_mode.
|
||||||
s3_beep is for debugging; it makes the PC's speaker beep
|
s3_beep is for debugging; it makes the PC's speaker beep
|
||||||
as soon as the kernel's real-mode entry point is called.
|
as soon as the kernel's real-mode entry point is called.
|
||||||
s4_nohwsig prevents ACPI hardware signature from being
|
s4_nohwsig prevents ACPI hardware signature from being
|
||||||
used during resume from hibernation.
|
used during resume from hibernation.
|
||||||
old_ordering causes the ACPI 1.0 ordering of the _PTS
|
old_ordering causes the ACPI 1.0 ordering of the _PTS
|
||||||
control method, wrt putting devices into low power
|
control method, with respect to putting devices into
|
||||||
states, to be enforced (the ACPI 2.0 ordering of _PTS is
|
low power states, to be enforced (the ACPI 2.0 ordering
|
||||||
used by default).
|
of _PTS is used by default).
|
||||||
|
s4_nonvs prevents the kernel from saving/restoring the
|
||||||
|
ACPI NVS memory during hibernation.
|
||||||
|
|
||||||
acpi_sci= [HW,ACPI] ACPI System Control Interrupt trigger mode
|
acpi_sci= [HW,ACPI] ACPI System Control Interrupt trigger mode
|
||||||
Format: { level | edge | high | low }
|
Format: { level | edge | high | low }
|
||||||
|
@ -194,7 +200,7 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||||
acpi_skip_timer_override [HW,ACPI]
|
acpi_skip_timer_override [HW,ACPI]
|
||||||
Recognize and ignore IRQ0/pin2 Interrupt Override.
|
Recognize and ignore IRQ0/pin2 Interrupt Override.
|
||||||
For broken nForce2 BIOS resulting in XT-PIC timer.
|
For broken nForce2 BIOS resulting in XT-PIC timer.
|
||||||
acpi_use_timer_override [HW,ACPI}
|
acpi_use_timer_override [HW,ACPI]
|
||||||
Use timer override. For some broken Nvidia NF5 boards
|
Use timer override. For some broken Nvidia NF5 boards
|
||||||
that require a timer override, but don't have
|
that require a timer override, but don't have
|
||||||
HPET
|
HPET
|
||||||
|
@ -469,8 +475,8 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||||
|
|
||||||
clearcpuid=BITNUM [X86]
|
clearcpuid=BITNUM [X86]
|
||||||
Disable CPUID feature X for the kernel. See
|
Disable CPUID feature X for the kernel. See
|
||||||
include/asm-x86/cpufeature.h for the valid bit numbers.
|
arch/x86/include/asm/cpufeature.h for the valid bit
|
||||||
Note the Linux specific bits are not necessarily
|
numbers. Note the Linux specific bits are not necessarily
|
||||||
stable over kernel options, but the vendor specific
|
stable over kernel options, but the vendor specific
|
||||||
ones should be.
|
ones should be.
|
||||||
Also note that user programs calling CPUID directly
|
Also note that user programs calling CPUID directly
|
||||||
|
@ -551,6 +557,11 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||||
not work reliably with all consoles, but is known
|
not work reliably with all consoles, but is known
|
||||||
to work with serial and VGA consoles.
|
to work with serial and VGA consoles.
|
||||||
|
|
||||||
|
coredump_filter=
|
||||||
|
[KNL] Change the default value for
|
||||||
|
/proc/<pid>/coredump_filter.
|
||||||
|
See also Documentation/filesystems/proc.txt.
|
||||||
|
|
||||||
cpcihp_generic= [HW,PCI] Generic port I/O CompactPCI driver
|
cpcihp_generic= [HW,PCI] Generic port I/O CompactPCI driver
|
||||||
Format:
|
Format:
|
||||||
<first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
|
<first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
|
||||||
|
@ -823,8 +834,8 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||||
|
|
||||||
hlt [BUGS=ARM,SH]
|
hlt [BUGS=ARM,SH]
|
||||||
|
|
||||||
hvc_iucv= [S390] Number of z/VM IUCV Hypervisor console (HVC)
|
hvc_iucv= [S390] Number of z/VM IUCV hypervisor console (HVC)
|
||||||
back-ends. Valid parameters: 0..8
|
terminal devices. Valid values: 0..8
|
||||||
|
|
||||||
i8042.debug [HW] Toggle i8042 debug mode
|
i8042.debug [HW] Toggle i8042 debug mode
|
||||||
i8042.direct [HW] Put keyboard port into non-translated mode
|
i8042.direct [HW] Put keyboard port into non-translated mode
|
||||||
|
@ -872,17 +883,19 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||||
See Documentation/ide/ide.txt.
|
See Documentation/ide/ide.txt.
|
||||||
|
|
||||||
idle= [X86]
|
idle= [X86]
|
||||||
Format: idle=poll or idle=mwait, idle=halt, idle=nomwait
|
Format: idle=poll, idle=mwait, idle=halt, idle=nomwait
|
||||||
Poll forces a polling idle loop that can slightly improves the performance
|
Poll forces a polling idle loop that can slightly
|
||||||
of waking up a idle CPU, but will use a lot of power and make the system
|
improve the performance of waking up a idle CPU, but
|
||||||
run hot. Not recommended.
|
will use a lot of power and make the system run hot.
|
||||||
idle=mwait. On systems which support MONITOR/MWAIT but the kernel chose
|
Not recommended.
|
||||||
to not use it because it doesn't save as much power as a normal idle
|
idle=mwait: On systems which support MONITOR/MWAIT but
|
||||||
loop use the MONITOR/MWAIT idle loop anyways. Performance should be the same
|
the kernel chose to not use it because it doesn't save
|
||||||
as idle=poll.
|
as much power as a normal idle loop, use the
|
||||||
idle=halt. Halt is forced to be used for CPU idle.
|
MONITOR/MWAIT idle loop anyways. Performance should be
|
||||||
|
the same as idle=poll.
|
||||||
|
idle=halt: Halt is forced to be used for CPU idle.
|
||||||
In such case C2/C3 won't be used again.
|
In such case C2/C3 won't be used again.
|
||||||
idle=nomwait. Disable mwait for CPU C-states
|
idle=nomwait: Disable mwait for CPU C-states
|
||||||
|
|
||||||
ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem
|
ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem
|
||||||
Claim all unknown PCI IDE storage controllers.
|
Claim all unknown PCI IDE storage controllers.
|
||||||
|
@ -913,6 +926,10 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||||
|
|
||||||
inttest= [IA64]
|
inttest= [IA64]
|
||||||
|
|
||||||
|
iomem= Disable strict checking of access to MMIO memory
|
||||||
|
strict regions from userspace.
|
||||||
|
relaxed
|
||||||
|
|
||||||
iommu= [x86]
|
iommu= [x86]
|
||||||
off
|
off
|
||||||
force
|
force
|
||||||
|
@ -1064,8 +1081,8 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||||
lapic [X86-32,APIC] Enable the local APIC even if BIOS
|
lapic [X86-32,APIC] Enable the local APIC even if BIOS
|
||||||
disabled it.
|
disabled it.
|
||||||
|
|
||||||
lapic_timer_c2_ok [X86-32,x86-64,APIC] trust the local apic timer in
|
lapic_timer_c2_ok [X86-32,x86-64,APIC] trust the local apic timer
|
||||||
C2 power state.
|
in C2 power state.
|
||||||
|
|
||||||
libata.dma= [LIBATA] DMA control
|
libata.dma= [LIBATA] DMA control
|
||||||
libata.dma=0 Disable all PATA and SATA DMA
|
libata.dma=0 Disable all PATA and SATA DMA
|
||||||
|
@ -1117,6 +1134,8 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||||
If there are multiple matching configurations changing
|
If there are multiple matching configurations changing
|
||||||
the same attribute, the last one is used.
|
the same attribute, the last one is used.
|
||||||
|
|
||||||
|
lmb=debug [KNL] Enable lmb debug messages.
|
||||||
|
|
||||||
load_ramdisk= [RAM] List of ramdisks to load from floppy
|
load_ramdisk= [RAM] List of ramdisks to load from floppy
|
||||||
See Documentation/blockdev/ramdisk.txt.
|
See Documentation/blockdev/ramdisk.txt.
|
||||||
|
|
||||||
|
@ -1550,6 +1569,9 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||||
|
|
||||||
nosoftlockup [KNL] Disable the soft-lockup detector.
|
nosoftlockup [KNL] Disable the soft-lockup detector.
|
||||||
|
|
||||||
|
noswapaccount [KNL] Disable accounting of swap in memory resource
|
||||||
|
controller. (See Documentation/controllers/memory.txt)
|
||||||
|
|
||||||
nosync [HW,M68K] Disables sync negotiation for all devices.
|
nosync [HW,M68K] Disables sync negotiation for all devices.
|
||||||
|
|
||||||
notsc [BUGS=X86-32] Disable Time Stamp Counter
|
notsc [BUGS=X86-32] Disable Time Stamp Counter
|
||||||
|
@ -1569,6 +1591,10 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||||
|
|
||||||
nr_uarts= [SERIAL] maximum number of UARTs to be registered.
|
nr_uarts= [SERIAL] maximum number of UARTs to be registered.
|
||||||
|
|
||||||
|
ohci1394_dma=early [HW] enable debugging via the ohci1394 driver.
|
||||||
|
See Documentation/debugging-via-ohci1394.txt for more
|
||||||
|
info.
|
||||||
|
|
||||||
olpc_ec_timeout= [OLPC] ms delay when issuing EC commands
|
olpc_ec_timeout= [OLPC] ms delay when issuing EC commands
|
||||||
Rather than timing out after 20 ms if an EC
|
Rather than timing out after 20 ms if an EC
|
||||||
command is not properly ACKed, override the length
|
command is not properly ACKed, override the length
|
||||||
|
@ -1793,10 +1819,10 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||||
autoconfiguration.
|
autoconfiguration.
|
||||||
Ranges are in pairs (memory base and size).
|
Ranges are in pairs (memory base and size).
|
||||||
|
|
||||||
dynamic_printk
|
dynamic_printk Enables pr_debug()/dev_dbg() calls if
|
||||||
Enables pr_debug()/dev_dbg() calls if
|
CONFIG_DYNAMIC_PRINTK_DEBUG has been enabled.
|
||||||
CONFIG_DYNAMIC_PRINTK_DEBUG has been enabled. These can also
|
These can also be switched on/off via
|
||||||
be switched on/off via <debugfs>/dynamic_printk/modules
|
<debugfs>/dynamic_printk/modules
|
||||||
|
|
||||||
print-fatal-signals=
|
print-fatal-signals=
|
||||||
[KNL] debug: print fatal signals
|
[KNL] debug: print fatal signals
|
||||||
|
@ -2284,7 +2310,8 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||||
|
|
||||||
thermal.psv= [HW,ACPI]
|
thermal.psv= [HW,ACPI]
|
||||||
-1: disable all passive trip points
|
-1: disable all passive trip points
|
||||||
<degrees C>: override all passive trip points to this value
|
<degrees C>: override all passive trip points to this
|
||||||
|
value
|
||||||
|
|
||||||
thermal.tzp= [HW,ACPI]
|
thermal.tzp= [HW,ACPI]
|
||||||
Specify global default ACPI thermal zone polling rate
|
Specify global default ACPI thermal zone polling rate
|
||||||
|
@ -2372,6 +2399,41 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||||
usbhid.mousepoll=
|
usbhid.mousepoll=
|
||||||
[USBHID] The interval which mice are to be polled at.
|
[USBHID] The interval which mice are to be polled at.
|
||||||
|
|
||||||
|
usb-storage.delay_use=
|
||||||
|
[UMS] The delay in seconds before a new device is
|
||||||
|
scanned for Logical Units (default 5).
|
||||||
|
|
||||||
|
usb-storage.quirks=
|
||||||
|
[UMS] A list of quirks entries to supplement or
|
||||||
|
override the built-in unusual_devs list. List
|
||||||
|
entries are separated by commas. Each entry has
|
||||||
|
the form VID:PID:Flags where VID and PID are Vendor
|
||||||
|
and Product ID values (4-digit hex numbers) and
|
||||||
|
Flags is a set of characters, each corresponding
|
||||||
|
to a common usb-storage quirk flag as follows:
|
||||||
|
a = SANE_SENSE (collect more than 18 bytes
|
||||||
|
of sense data);
|
||||||
|
c = FIX_CAPACITY (decrease the reported
|
||||||
|
device capacity by one sector);
|
||||||
|
h = CAPACITY_HEURISTICS (decrease the
|
||||||
|
reported device capacity by one
|
||||||
|
sector if the number is odd);
|
||||||
|
i = IGNORE_DEVICE (don't bind to this
|
||||||
|
device);
|
||||||
|
l = NOT_LOCKABLE (don't try to lock and
|
||||||
|
unlock ejectable media);
|
||||||
|
m = MAX_SECTORS_64 (don't transfer more
|
||||||
|
than 64 sectors = 32 KB at a time);
|
||||||
|
o = CAPACITY_OK (accept the capacity
|
||||||
|
reported by the device);
|
||||||
|
r = IGNORE_RESIDUE (the device reports
|
||||||
|
bogus residue values);
|
||||||
|
s = SINGLE_LUN (the device has only one
|
||||||
|
Logical Unit);
|
||||||
|
w = NO_WP_DETECT (don't test whether the
|
||||||
|
medium is write-protected).
|
||||||
|
Example: quirks=0419:aaf5:rl,0421:0433:rc
|
||||||
|
|
||||||
add_efi_memmap [EFI; x86-32,X86-64] Include EFI memory map in
|
add_efi_memmap [EFI; x86-32,X86-64] Include EFI memory map in
|
||||||
kernel's map of available physical RAM.
|
kernel's map of available physical RAM.
|
||||||
|
|
||||||
|
@ -2432,8 +2494,8 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||||
Format:
|
Format:
|
||||||
<irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]]
|
<irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]]
|
||||||
|
|
||||||
norandmaps Don't use address space randomization
|
norandmaps Don't use address space randomization. Equivalent to
|
||||||
Equivalent to echo 0 > /proc/sys/kernel/randomize_va_space
|
echo 0 > /proc/sys/kernel/randomize_va_space
|
||||||
|
|
||||||
______________________________________________________________________
|
______________________________________________________________________
|
||||||
|
|
||||||
|
|
|
@ -118,8 +118,8 @@ the name of the kobject, call kobject_rename():
|
||||||
|
|
||||||
int kobject_rename(struct kobject *kobj, const char *new_name);
|
int kobject_rename(struct kobject *kobj, const char *new_name);
|
||||||
|
|
||||||
Note kobject_rename does perform any locking or have a solid notion of
|
kobject_rename does not perform any locking or have a solid notion of
|
||||||
what names are valid so the provide must provide their own sanity checking
|
what names are valid so the caller must provide their own sanity checking
|
||||||
and serialization.
|
and serialization.
|
||||||
|
|
||||||
There is a function called kobject_set_name() but that is legacy cruft and
|
There is a function called kobject_set_name() but that is legacy cruft and
|
||||||
|
|
|
@ -497,7 +497,10 @@ The first column provides the kernel address where the probe is inserted.
|
||||||
The second column identifies the type of probe (k - kprobe, r - kretprobe
|
The second column identifies the type of probe (k - kprobe, r - kretprobe
|
||||||
and j - jprobe), while the third column specifies the symbol+offset of
|
and j - jprobe), while the third column specifies the symbol+offset of
|
||||||
the probe. If the probed function belongs to a module, the module name
|
the probe. If the probed function belongs to a module, the module name
|
||||||
is also specified.
|
is also specified. Following columns show probe status. If the probe is on
|
||||||
|
a virtual address that is no longer valid (module init sections, module
|
||||||
|
virtual addresses that correspond to modules that've been unloaded),
|
||||||
|
such probes are marked with [GONE].
|
||||||
|
|
||||||
/debug/kprobes/enabled: Turn kprobes ON/OFF
|
/debug/kprobes/enabled: Turn kprobes ON/OFF
|
||||||
|
|
||||||
|
|
|
@ -1475,7 +1475,7 @@ Sysfs interface changelog:
|
||||||
|
|
||||||
0x020100: Marker for thinkpad-acpi with hot key NVRAM polling
|
0x020100: Marker for thinkpad-acpi with hot key NVRAM polling
|
||||||
support. If you must, use it to know you should not
|
support. If you must, use it to know you should not
|
||||||
start an userspace NVRAM poller (allows to detect when
|
start a userspace NVRAM poller (allows to detect when
|
||||||
NVRAM is compiled out by the user because it is
|
NVRAM is compiled out by the user because it is
|
||||||
unneeded/undesired in the first place).
|
unneeded/undesired in the first place).
|
||||||
0x020101: Marker for thinkpad-acpi with hot key NVRAM polling
|
0x020101: Marker for thinkpad-acpi with hot key NVRAM polling
|
||||||
|
|
|
@ -481,51 +481,6 @@ static unsigned long load_initrd(const char *name, unsigned long mem)
|
||||||
/* We return the initrd size. */
|
/* We return the initrd size. */
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Once we know how much memory we have we can construct simple linear page
|
|
||||||
* tables which set virtual == physical which will get the Guest far enough
|
|
||||||
* into the boot to create its own.
|
|
||||||
*
|
|
||||||
* We lay them out of the way, just below the initrd (which is why we need to
|
|
||||||
* know its size here). */
|
|
||||||
static unsigned long setup_pagetables(unsigned long mem,
|
|
||||||
unsigned long initrd_size)
|
|
||||||
{
|
|
||||||
unsigned long *pgdir, *linear;
|
|
||||||
unsigned int mapped_pages, i, linear_pages;
|
|
||||||
unsigned int ptes_per_page = getpagesize()/sizeof(void *);
|
|
||||||
|
|
||||||
mapped_pages = mem/getpagesize();
|
|
||||||
|
|
||||||
/* Each PTE page can map ptes_per_page pages: how many do we need? */
|
|
||||||
linear_pages = (mapped_pages + ptes_per_page-1)/ptes_per_page;
|
|
||||||
|
|
||||||
/* We put the toplevel page directory page at the top of memory. */
|
|
||||||
pgdir = from_guest_phys(mem) - initrd_size - getpagesize();
|
|
||||||
|
|
||||||
/* Now we use the next linear_pages pages as pte pages */
|
|
||||||
linear = (void *)pgdir - linear_pages*getpagesize();
|
|
||||||
|
|
||||||
/* Linear mapping is easy: put every page's address into the mapping in
|
|
||||||
* order. PAGE_PRESENT contains the flags Present, Writable and
|
|
||||||
* Executable. */
|
|
||||||
for (i = 0; i < mapped_pages; i++)
|
|
||||||
linear[i] = ((i * getpagesize()) | PAGE_PRESENT);
|
|
||||||
|
|
||||||
/* The top level points to the linear page table pages above. */
|
|
||||||
for (i = 0; i < mapped_pages; i += ptes_per_page) {
|
|
||||||
pgdir[i/ptes_per_page]
|
|
||||||
= ((to_guest_phys(linear) + i*sizeof(void *))
|
|
||||||
| PAGE_PRESENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
verbose("Linear mapping of %u pages in %u pte pages at %#lx\n",
|
|
||||||
mapped_pages, linear_pages, to_guest_phys(linear));
|
|
||||||
|
|
||||||
/* We return the top level (guest-physical) address: the kernel needs
|
|
||||||
* to know where it is. */
|
|
||||||
return to_guest_phys(pgdir);
|
|
||||||
}
|
|
||||||
/*:*/
|
/*:*/
|
||||||
|
|
||||||
/* Simple routine to roll all the commandline arguments together with spaces
|
/* Simple routine to roll all the commandline arguments together with spaces
|
||||||
|
@ -548,13 +503,13 @@ static void concat(char *dst, char *args[])
|
||||||
|
|
||||||
/*L:185 This is where we actually tell the kernel to initialize the Guest. We
|
/*L:185 This is where we actually tell the kernel to initialize the Guest. We
|
||||||
* saw the arguments it expects when we looked at initialize() in lguest_user.c:
|
* saw the arguments it expects when we looked at initialize() in lguest_user.c:
|
||||||
* the base of Guest "physical" memory, the top physical page to allow, the
|
* the base of Guest "physical" memory, the top physical page to allow and the
|
||||||
* top level pagetable and the entry point for the Guest. */
|
* entry point for the Guest. */
|
||||||
static int tell_kernel(unsigned long pgdir, unsigned long start)
|
static int tell_kernel(unsigned long start)
|
||||||
{
|
{
|
||||||
unsigned long args[] = { LHREQ_INITIALIZE,
|
unsigned long args[] = { LHREQ_INITIALIZE,
|
||||||
(unsigned long)guest_base,
|
(unsigned long)guest_base,
|
||||||
guest_limit / getpagesize(), pgdir, start };
|
guest_limit / getpagesize(), start };
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
verbose("Guest: %p - %p (%#lx)\n",
|
verbose("Guest: %p - %p (%#lx)\n",
|
||||||
|
@ -1030,7 +985,7 @@ static void update_device_status(struct device *dev)
|
||||||
/* Zero out the virtqueues. */
|
/* Zero out the virtqueues. */
|
||||||
for (vq = dev->vq; vq; vq = vq->next) {
|
for (vq = dev->vq; vq; vq = vq->next) {
|
||||||
memset(vq->vring.desc, 0,
|
memset(vq->vring.desc, 0,
|
||||||
vring_size(vq->config.num, getpagesize()));
|
vring_size(vq->config.num, LGUEST_VRING_ALIGN));
|
||||||
lg_last_avail(vq) = 0;
|
lg_last_avail(vq) = 0;
|
||||||
}
|
}
|
||||||
} else if (dev->desc->status & VIRTIO_CONFIG_S_FAILED) {
|
} else if (dev->desc->status & VIRTIO_CONFIG_S_FAILED) {
|
||||||
|
@ -1211,7 +1166,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
/* First we need some memory for this virtqueue. */
|
/* First we need some memory for this virtqueue. */
|
||||||
pages = (vring_size(num_descs, getpagesize()) + getpagesize() - 1)
|
pages = (vring_size(num_descs, LGUEST_VRING_ALIGN) + getpagesize() - 1)
|
||||||
/ getpagesize();
|
/ getpagesize();
|
||||||
p = get_pages(pages);
|
p = get_pages(pages);
|
||||||
|
|
||||||
|
@ -1228,7 +1183,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
|
||||||
vq->config.pfn = to_guest_phys(p) / getpagesize();
|
vq->config.pfn = to_guest_phys(p) / getpagesize();
|
||||||
|
|
||||||
/* Initialize the vring. */
|
/* Initialize the vring. */
|
||||||
vring_init(&vq->vring, num_descs, p, getpagesize());
|
vring_init(&vq->vring, num_descs, p, LGUEST_VRING_ALIGN);
|
||||||
|
|
||||||
/* Append virtqueue to this device's descriptor. We use
|
/* Append virtqueue to this device's descriptor. We use
|
||||||
* device_config() to get the end of the device's current virtqueues;
|
* device_config() to get the end of the device's current virtqueues;
|
||||||
|
@ -1941,7 +1896,7 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
/* Memory, top-level pagetable, code startpoint and size of the
|
/* Memory, top-level pagetable, code startpoint and size of the
|
||||||
* (optional) initrd. */
|
* (optional) initrd. */
|
||||||
unsigned long mem = 0, pgdir, start, initrd_size = 0;
|
unsigned long mem = 0, start, initrd_size = 0;
|
||||||
/* Two temporaries and the /dev/lguest file descriptor. */
|
/* Two temporaries and the /dev/lguest file descriptor. */
|
||||||
int i, c, lguest_fd;
|
int i, c, lguest_fd;
|
||||||
/* The boot information for the Guest. */
|
/* The boot information for the Guest. */
|
||||||
|
@ -2040,9 +1995,6 @@ int main(int argc, char *argv[])
|
||||||
boot->hdr.type_of_loader = 0xFF;
|
boot->hdr.type_of_loader = 0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set up the initial linear pagetables, starting below the initrd. */
|
|
||||||
pgdir = setup_pagetables(mem, initrd_size);
|
|
||||||
|
|
||||||
/* The Linux boot header contains an "E820" memory map: ours is a
|
/* The Linux boot header contains an "E820" memory map: ours is a
|
||||||
* simple, single region. */
|
* simple, single region. */
|
||||||
boot->e820_entries = 1;
|
boot->e820_entries = 1;
|
||||||
|
@ -2064,7 +2016,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
/* We tell the kernel to initialize the Guest: this returns the open
|
/* We tell the kernel to initialize the Guest: this returns the open
|
||||||
* /dev/lguest file descriptor. */
|
* /dev/lguest file descriptor. */
|
||||||
lguest_fd = tell_kernel(pgdir, start);
|
lguest_fd = tell_kernel(start);
|
||||||
|
|
||||||
/* We clone off a thread, which wakes the Launcher whenever one of the
|
/* We clone off a thread, which wakes the Launcher whenever one of the
|
||||||
* input file descriptors needs attention. We call this the Waker, and
|
* input file descriptors needs attention. We call this the Waker, and
|
||||||
|
|
|
@ -71,35 +71,50 @@ Look at the current lock statistics:
|
||||||
|
|
||||||
# less /proc/lock_stat
|
# less /proc/lock_stat
|
||||||
|
|
||||||
01 lock_stat version 0.2
|
01 lock_stat version 0.3
|
||||||
02 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
02 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
03 class name con-bounces contentions waittime-min waittime-max waittime-total acq-bounces acquisitions holdtime-min holdtime-max holdtime-total
|
03 class name con-bounces contentions waittime-min waittime-max waittime-total acq-bounces acquisitions holdtime-min holdtime-max holdtime-total
|
||||||
04 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
04 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
05
|
05
|
||||||
06 &inode->i_data.tree_lock-W: 15 21657 0.18 1093295.30 11547131054.85 58 10415 0.16 87.51 6387.60
|
06 &mm->mmap_sem-W: 233 538 18446744073708 22924.27 607243.51 1342 45806 1.71 8595.89 1180582.34
|
||||||
07 &inode->i_data.tree_lock-R: 0 0 0.00 0.00 0.00 23302 231198 0.25 8.45 98023.38
|
07 &mm->mmap_sem-R: 205 587 18446744073708 28403.36 731975.00 1940 412426 0.58 187825.45 6307502.88
|
||||||
08 --------------------------
|
08 ---------------
|
||||||
09 &inode->i_data.tree_lock 0 [<ffffffff8027c08f>] add_to_page_cache+0x5f/0x190
|
09 &mm->mmap_sem 487 [<ffffffff8053491f>] do_page_fault+0x466/0x928
|
||||||
10
|
10 &mm->mmap_sem 179 [<ffffffff802a6200>] sys_mprotect+0xcd/0x21d
|
||||||
11 ...............................................................................................................................................................................................
|
11 &mm->mmap_sem 279 [<ffffffff80210a57>] sys_mmap+0x75/0xce
|
||||||
12
|
12 &mm->mmap_sem 76 [<ffffffff802a490b>] sys_munmap+0x32/0x59
|
||||||
13 dcache_lock: 1037 1161 0.38 45.32 774.51 6611 243371 0.15 306.48 77387.24
|
13 ---------------
|
||||||
14 -----------
|
14 &mm->mmap_sem 270 [<ffffffff80210a57>] sys_mmap+0x75/0xce
|
||||||
15 dcache_lock 180 [<ffffffff802c0d7e>] sys_getcwd+0x11e/0x230
|
15 &mm->mmap_sem 431 [<ffffffff8053491f>] do_page_fault+0x466/0x928
|
||||||
16 dcache_lock 165 [<ffffffff802c002a>] d_alloc+0x15a/0x210
|
16 &mm->mmap_sem 138 [<ffffffff802a490b>] sys_munmap+0x32/0x59
|
||||||
17 dcache_lock 33 [<ffffffff8035818d>] _atomic_dec_and_lock+0x4d/0x70
|
17 &mm->mmap_sem 145 [<ffffffff802a6200>] sys_mprotect+0xcd/0x21d
|
||||||
18 dcache_lock 1 [<ffffffff802beef8>] shrink_dcache_parent+0x18/0x130
|
18
|
||||||
|
19 ...............................................................................................................................................................................................
|
||||||
|
20
|
||||||
|
21 dcache_lock: 621 623 0.52 118.26 1053.02 6745 91930 0.29 316.29 118423.41
|
||||||
|
22 -----------
|
||||||
|
23 dcache_lock 179 [<ffffffff80378274>] _atomic_dec_and_lock+0x34/0x54
|
||||||
|
24 dcache_lock 113 [<ffffffff802cc17b>] d_alloc+0x19a/0x1eb
|
||||||
|
25 dcache_lock 99 [<ffffffff802ca0dc>] d_rehash+0x1b/0x44
|
||||||
|
26 dcache_lock 104 [<ffffffff802cbca0>] d_instantiate+0x36/0x8a
|
||||||
|
27 -----------
|
||||||
|
28 dcache_lock 192 [<ffffffff80378274>] _atomic_dec_and_lock+0x34/0x54
|
||||||
|
29 dcache_lock 98 [<ffffffff802ca0dc>] d_rehash+0x1b/0x44
|
||||||
|
30 dcache_lock 72 [<ffffffff802cc17b>] d_alloc+0x19a/0x1eb
|
||||||
|
31 dcache_lock 112 [<ffffffff802cbca0>] d_instantiate+0x36/0x8a
|
||||||
|
|
||||||
This excerpt shows the first two lock class statistics. Line 01 shows the
|
This excerpt shows the first two lock class statistics. Line 01 shows the
|
||||||
output version - each time the format changes this will be updated. Line 02-04
|
output version - each time the format changes this will be updated. Line 02-04
|
||||||
show the header with column descriptions. Lines 05-10 and 13-18 show the actual
|
show the header with column descriptions. Lines 05-18 and 20-31 show the actual
|
||||||
statistics. These statistics come in two parts; the actual stats separated by a
|
statistics. These statistics come in two parts; the actual stats separated by a
|
||||||
short separator (line 08, 14) from the contention points.
|
short separator (line 08, 13) from the contention points.
|
||||||
|
|
||||||
The first lock (05-10) is a read/write lock, and shows two lines above the
|
The first lock (05-18) is a read/write lock, and shows two lines above the
|
||||||
short separator. The contention points don't match the column descriptors,
|
short separator. The contention points don't match the column descriptors,
|
||||||
they have two: contentions and [<IP>] symbol.
|
they have two: contentions and [<IP>] symbol. The second set of contention
|
||||||
|
points are the points we're contending with.
|
||||||
|
|
||||||
|
The integer part of the time values is in us.
|
||||||
|
|
||||||
View the top contending locks:
|
View the top contending locks:
|
||||||
|
|
||||||
|
|
|
@ -125,14 +125,14 @@ TRIDENT_CARD_MAGIC 0x5072696E trident_card sound/oss/trident.c
|
||||||
ROUTER_MAGIC 0x524d4157 wan_device include/linux/wanrouter.h
|
ROUTER_MAGIC 0x524d4157 wan_device include/linux/wanrouter.h
|
||||||
SCC_MAGIC 0x52696368 gs_port drivers/char/scc.h
|
SCC_MAGIC 0x52696368 gs_port drivers/char/scc.h
|
||||||
SAVEKMSG_MAGIC1 0x53415645 savekmsg arch/*/amiga/config.c
|
SAVEKMSG_MAGIC1 0x53415645 savekmsg arch/*/amiga/config.c
|
||||||
GDA_MAGIC 0x58464552 gda include/asm-mips64/sn/gda.h
|
GDA_MAGIC 0x58464552 gda arch/mips/include/asm/sn/gda.h
|
||||||
RED_MAGIC1 0x5a2cf071 (any) mm/slab.c
|
RED_MAGIC1 0x5a2cf071 (any) mm/slab.c
|
||||||
STL_PORTMAGIC 0x5a7182c9 stlport include/linux/stallion.h
|
STL_PORTMAGIC 0x5a7182c9 stlport include/linux/stallion.h
|
||||||
EEPROM_MAGIC_VALUE 0x5ab478d2 lanai_dev drivers/atm/lanai.c
|
EEPROM_MAGIC_VALUE 0x5ab478d2 lanai_dev drivers/atm/lanai.c
|
||||||
HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state include/linux/hdlcdrv.h
|
HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state include/linux/hdlcdrv.h
|
||||||
EPCA_MAGIC 0x5c6df104 channel include/linux/epca.h
|
EPCA_MAGIC 0x5c6df104 channel include/linux/epca.h
|
||||||
PCXX_MAGIC 0x5c6df104 channel drivers/char/pcxx.h
|
PCXX_MAGIC 0x5c6df104 channel drivers/char/pcxx.h
|
||||||
KV_MAGIC 0x5f4b565f kernel_vars_s include/asm-mips64/sn/klkernvars.h
|
KV_MAGIC 0x5f4b565f kernel_vars_s arch/mips/include/asm/sn/klkernvars.h
|
||||||
I810_STATE_MAGIC 0x63657373 i810_state sound/oss/i810_audio.c
|
I810_STATE_MAGIC 0x63657373 i810_state sound/oss/i810_audio.c
|
||||||
TRIDENT_STATE_MAGIC 0x63657373 trient_state sound/oss/trident.c
|
TRIDENT_STATE_MAGIC 0x63657373 trient_state sound/oss/trident.c
|
||||||
M3_CARD_MAGIC 0x646e6f50 m3_card sound/oss/maestro3.c
|
M3_CARD_MAGIC 0x646e6f50 m3_card sound/oss/maestro3.c
|
||||||
|
@ -158,7 +158,7 @@ CCB_MAGIC 0xf2691ad2 ccb drivers/scsi/ncr53c8xx.c
|
||||||
QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry drivers/scsi/arm/queue.c
|
QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry drivers/scsi/arm/queue.c
|
||||||
QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry drivers/scsi/arm/queue.c
|
QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry drivers/scsi/arm/queue.c
|
||||||
HTB_CMAGIC 0xFEFAFEF1 htb_class net/sched/sch_htb.c
|
HTB_CMAGIC 0xFEFAFEF1 htb_class net/sched/sch_htb.c
|
||||||
NMI_MAGIC 0x48414d4d455201 nmi_s include/asm-mips64/sn/nmi.h
|
NMI_MAGIC 0x48414d4d455201 nmi_s arch/mips/include/asm/sn/nmi.h
|
||||||
|
|
||||||
Note that there are also defined special per-driver magic numbers in sound
|
Note that there are also defined special per-driver magic numbers in sound
|
||||||
memory management. See include/sound/sndmagic.h for complete list of them. Many
|
memory management. See include/sound/sndmagic.h for complete list of them. Many
|
||||||
|
|
|
@ -124,7 +124,7 @@ config options.
|
||||||
This option can be kernel module too.
|
This option can be kernel module too.
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
3 sysfs files for memory hotplug
|
4 sysfs files for memory hotplug
|
||||||
--------------------------------
|
--------------------------------
|
||||||
All sections have their device information under /sys/devices/system/memory as
|
All sections have their device information under /sys/devices/system/memory as
|
||||||
|
|
||||||
|
@ -138,11 +138,12 @@ For example, assume 1GiB section size. A device for a memory starting at
|
||||||
(0x100000000 / 1Gib = 4)
|
(0x100000000 / 1Gib = 4)
|
||||||
This device covers address range [0x100000000 ... 0x140000000)
|
This device covers address range [0x100000000 ... 0x140000000)
|
||||||
|
|
||||||
Under each section, you can see 3 files.
|
Under each section, you can see 4 files.
|
||||||
|
|
||||||
/sys/devices/system/memory/memoryXXX/phys_index
|
/sys/devices/system/memory/memoryXXX/phys_index
|
||||||
/sys/devices/system/memory/memoryXXX/phys_device
|
/sys/devices/system/memory/memoryXXX/phys_device
|
||||||
/sys/devices/system/memory/memoryXXX/state
|
/sys/devices/system/memory/memoryXXX/state
|
||||||
|
/sys/devices/system/memory/memoryXXX/removable
|
||||||
|
|
||||||
'phys_index' : read-only and contains section id, same as XXX.
|
'phys_index' : read-only and contains section id, same as XXX.
|
||||||
'state' : read-write
|
'state' : read-write
|
||||||
|
@ -150,10 +151,20 @@ Under each section, you can see 3 files.
|
||||||
at write: user can specify "online", "offline" command
|
at write: user can specify "online", "offline" command
|
||||||
'phys_device': read-only: designed to show the name of physical memory device.
|
'phys_device': read-only: designed to show the name of physical memory device.
|
||||||
This is not well implemented now.
|
This is not well implemented now.
|
||||||
|
'removable' : read-only: contains an integer value indicating
|
||||||
|
whether the memory section is removable or not
|
||||||
|
removable. A value of 1 indicates that the memory
|
||||||
|
section is removable and a value of 0 indicates that
|
||||||
|
it is not removable.
|
||||||
|
|
||||||
NOTE:
|
NOTE:
|
||||||
These directories/files appear after physical memory hotplug phase.
|
These directories/files appear after physical memory hotplug phase.
|
||||||
|
|
||||||
|
If CONFIG_NUMA is enabled the
|
||||||
|
/sys/devices/system/memory/memoryXXX memory section
|
||||||
|
directories can also be accessed via symbolic links located in
|
||||||
|
the /sys/devices/system/node/node* directories. For example:
|
||||||
|
/sys/devices/system/node/node0/memory9 -> ../../memory/memory9
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
4. Physical memory hot-add phase
|
4. Physical memory hot-add phase
|
||||||
|
@ -365,7 +376,6 @@ node if necessary.
|
||||||
- allowing memory hot-add to ZONE_MOVABLE. maybe we need some switch like
|
- allowing memory hot-add to ZONE_MOVABLE. maybe we need some switch like
|
||||||
sysctl or new control file.
|
sysctl or new control file.
|
||||||
- showing memory section and physical device relationship.
|
- showing memory section and physical device relationship.
|
||||||
- showing memory section and node relationship (maybe good for NUMA)
|
|
||||||
- showing memory section is under ZONE_MOVABLE or not
|
- showing memory section is under ZONE_MOVABLE or not
|
||||||
- test and make it better memory offlining.
|
- test and make it better memory offlining.
|
||||||
- support HugeTLB page migration and offlining.
|
- support HugeTLB page migration and offlining.
|
||||||
|
|
|
@ -44,7 +44,7 @@ FILES, CONFIGS AND COMPATABILITY
|
||||||
|
|
||||||
Two files are introduced:
|
Two files are introduced:
|
||||||
|
|
||||||
a) 'include/asm-mips/mach-au1x00/au1xxx_ide.h'
|
a) 'arch/mips/include/asm/mach-au1x00/au1xxx_ide.h'
|
||||||
containes : struct _auide_hwif
|
containes : struct _auide_hwif
|
||||||
timing parameters for PIO mode 0/1/2/3/4
|
timing parameters for PIO mode 0/1/2/3/4
|
||||||
timing parameters for MWDMA 0/1/2
|
timing parameters for MWDMA 0/1/2
|
||||||
|
|
|
@ -540,7 +540,7 @@ A client would issue an operation by:
|
||||||
MSG_MORE should be set in msghdr::msg_flags on all but the last part of
|
MSG_MORE should be set in msghdr::msg_flags on all but the last part of
|
||||||
the request. Multiple requests may be made simultaneously.
|
the request. Multiple requests may be made simultaneously.
|
||||||
|
|
||||||
If a call is intended to go to a destination other then the default
|
If a call is intended to go to a destination other than the default
|
||||||
specified through connect(), then msghdr::msg_name should be set on the
|
specified through connect(), then msghdr::msg_name should be set on the
|
||||||
first request message of that call.
|
first request message of that call.
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ As mentioned above, main purpose of TUN/TAP driver is tunneling.
|
||||||
It is used by VTun (http://vtun.sourceforge.net).
|
It is used by VTun (http://vtun.sourceforge.net).
|
||||||
|
|
||||||
Another interesting application using TUN/TAP is pipsecd
|
Another interesting application using TUN/TAP is pipsecd
|
||||||
(http://perso.enst.fr/~beyssac/pipsec/), an userspace IPSec
|
(http://perso.enst.fr/~beyssac/pipsec/), a userspace IPSec
|
||||||
implementation that can use complete kernel routing (unlike FreeS/WAN).
|
implementation that can use complete kernel routing (unlike FreeS/WAN).
|
||||||
|
|
||||||
3. How does Virtual network device actually work ?
|
3. How does Virtual network device actually work ?
|
||||||
|
|
|
@ -109,12 +109,18 @@ and it's also much more restricted in the latter case:
|
||||||
FURTHER NOTES ON NO-MMU MMAP
|
FURTHER NOTES ON NO-MMU MMAP
|
||||||
============================
|
============================
|
||||||
|
|
||||||
(*) A request for a private mapping of less than a page in size may not return
|
(*) A request for a private mapping of a file may return a buffer that is not
|
||||||
a page-aligned buffer. This is because the kernel calls kmalloc() to
|
page-aligned. This is because XIP may take place, and the data may not be
|
||||||
allocate the buffer, not get_free_page().
|
paged aligned in the backing store.
|
||||||
|
|
||||||
(*) A list of all the mappings on the system is visible through /proc/maps in
|
(*) A request for an anonymous mapping will always be page aligned. If
|
||||||
no-MMU mode.
|
possible the size of the request should be a power of two otherwise some
|
||||||
|
of the space may be wasted as the kernel must allocate a power-of-2
|
||||||
|
granule but will only discard the excess if appropriately configured as
|
||||||
|
this has an effect on fragmentation.
|
||||||
|
|
||||||
|
(*) A list of all the private copy and anonymous mappings on the system is
|
||||||
|
visible through /proc/maps in no-MMU mode.
|
||||||
|
|
||||||
(*) A list of all the mappings in use by a process is visible through
|
(*) A list of all the mappings in use by a process is visible through
|
||||||
/proc/<pid>/maps in no-MMU mode.
|
/proc/<pid>/maps in no-MMU mode.
|
||||||
|
@ -242,3 +248,18 @@ PROVIDING SHAREABLE BLOCK DEVICE SUPPORT
|
||||||
Provision of shared mappings on block device files is exactly the same as for
|
Provision of shared mappings on block device files is exactly the same as for
|
||||||
character devices. If there isn't a real device underneath, then the driver
|
character devices. If there isn't a real device underneath, then the driver
|
||||||
should allocate sufficient contiguous memory to honour any supported mapping.
|
should allocate sufficient contiguous memory to honour any supported mapping.
|
||||||
|
|
||||||
|
|
||||||
|
=================================
|
||||||
|
ADJUSTING PAGE TRIMMING BEHAVIOUR
|
||||||
|
=================================
|
||||||
|
|
||||||
|
NOMMU mmap automatically rounds up to the nearest power-of-2 number of pages
|
||||||
|
when performing an allocation. This can have adverse effects on memory
|
||||||
|
fragmentation, and as such, is left configurable. The default behaviour is to
|
||||||
|
aggressively trim allocations and discard any excess pages back in to the page
|
||||||
|
allocator. In order to retain finer-grained control over fragmentation, this
|
||||||
|
behaviour can either be disabled completely, or bumped up to a higher page
|
||||||
|
watermark where trimming begins.
|
||||||
|
|
||||||
|
Page trimming behaviour is configurable via the sysctl `vm.nr_trim_pages'.
|
||||||
|
|
|
@ -31,7 +31,7 @@ anyways).
|
||||||
|
|
||||||
After detecting the processor type, the kernel patches out sections of code
|
After detecting the processor type, the kernel patches out sections of code
|
||||||
that shouldn't be used by writing nop's over it. Using cpufeatures requires
|
that shouldn't be used by writing nop's over it. Using cpufeatures requires
|
||||||
just 2 macros (found in include/asm-ppc/cputable.h), as seen in head.S
|
just 2 macros (found in arch/powerpc/include/asm/cputable.h), as seen in head.S
|
||||||
transfer_to_handler:
|
transfer_to_handler:
|
||||||
|
|
||||||
#ifdef CONFIG_ALTIVEC
|
#ifdef CONFIG_ALTIVEC
|
||||||
|
|
39
Documentation/powerpc/dts-bindings/4xx/ndfc.txt
Normal file
39
Documentation/powerpc/dts-bindings/4xx/ndfc.txt
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
AMCC NDFC (NanD Flash Controller)
|
||||||
|
|
||||||
|
Required properties:
|
||||||
|
- compatible : "ibm,ndfc".
|
||||||
|
- reg : should specify chip select and size used for the chip (0x2000).
|
||||||
|
|
||||||
|
Optional properties:
|
||||||
|
- ccr : NDFC config and control register value (default 0).
|
||||||
|
- bank-settings : NDFC bank configuration register value (default 0).
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
- partition(s) - follows the OF MTD standard for partitions
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
ndfc@1,0 {
|
||||||
|
compatible = "ibm,ndfc";
|
||||||
|
reg = <0x00000001 0x00000000 0x00002000>;
|
||||||
|
ccr = <0x00001000>;
|
||||||
|
bank-settings = <0x80002222>;
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
|
||||||
|
nand {
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
|
||||||
|
partition@0 {
|
||||||
|
label = "kernel";
|
||||||
|
reg = <0x00000000 0x00200000>;
|
||||||
|
};
|
||||||
|
partition@200000 {
|
||||||
|
label = "root";
|
||||||
|
reg = <0x00200000 0x03E00000>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ This is the memory-mapped registers for on board FPGA.
|
||||||
|
|
||||||
Required properities:
|
Required properities:
|
||||||
- compatible : should be "fsl,fpga-pixis".
|
- compatible : should be "fsl,fpga-pixis".
|
||||||
- reg : should contain the address and the lenght of the FPPGA register
|
- reg : should contain the address and the length of the FPPGA register
|
||||||
set.
|
set.
|
||||||
|
|
||||||
Example (MPC8610HPCD):
|
Example (MPC8610HPCD):
|
||||||
|
@ -27,3 +27,33 @@ Example (MPC8610HPCD):
|
||||||
compatible = "fsl,fpga-pixis";
|
compatible = "fsl,fpga-pixis";
|
||||||
reg = <0xe8000000 32>;
|
reg = <0xe8000000 32>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
* Freescale BCSR GPIO banks
|
||||||
|
|
||||||
|
Some BCSR registers act as simple GPIO controllers, each such
|
||||||
|
register can be represented by the gpio-controller node.
|
||||||
|
|
||||||
|
Required properities:
|
||||||
|
- compatible : Should be "fsl,<board>-bcsr-gpio".
|
||||||
|
- reg : Should contain the address and the length of the GPIO bank
|
||||||
|
register.
|
||||||
|
- #gpio-cells : Should be two. The first cell is the pin number and the
|
||||||
|
second cell is used to specify optional paramters (currently unused).
|
||||||
|
- gpio-controller : Marks the port as GPIO controller.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
bcsr@1,0 {
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
compatible = "fsl,mpc8360mds-bcsr";
|
||||||
|
reg = <1 0 0x8000>;
|
||||||
|
ranges = <0 1 0 0x8000>;
|
||||||
|
|
||||||
|
bcsr13: gpio-controller@d {
|
||||||
|
#gpio-cells = <2>;
|
||||||
|
compatible = "fsl,mpc8360mds-bcsr-gpio";
|
||||||
|
reg = <0xd 1>;
|
||||||
|
gpio-controller;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
|
@ -1402,7 +1402,7 @@ Syscalls are implemented on Linux for S390 by the Supervisor call instruction (S
|
||||||
possibilities of these as the instruction is made up of a 0xA opcode & the second byte being
|
possibilities of these as the instruction is made up of a 0xA opcode & the second byte being
|
||||||
the syscall number. They are traced using the simple command.
|
the syscall number. They are traced using the simple command.
|
||||||
TR SVC <Optional value or range>
|
TR SVC <Optional value or range>
|
||||||
the syscalls are defined in linux/include/asm-s390/unistd.h
|
the syscalls are defined in linux/arch/s390/include/asm/unistd.h
|
||||||
e.g. to trace all file opens just do
|
e.g. to trace all file opens just do
|
||||||
TR SVC 5 ( as this is the syscall number of open )
|
TR SVC 5 ( as this is the syscall number of open )
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ platform. Some of the interface routines are specific to Linux/390 and some
|
||||||
of them can be found on other Linux platforms implementations too.
|
of them can be found on other Linux platforms implementations too.
|
||||||
Miscellaneous function prototypes, data declarations, and macro definitions
|
Miscellaneous function prototypes, data declarations, and macro definitions
|
||||||
can be found in the architecture specific C header file
|
can be found in the architecture specific C header file
|
||||||
linux/include/asm-s390/irq.h.
|
linux/arch/s390/include/asm/irq.h.
|
||||||
|
|
||||||
Overview of CDS interface concepts
|
Overview of CDS interface concepts
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ S390 Debug Feature
|
||||||
==================
|
==================
|
||||||
|
|
||||||
files: arch/s390/kernel/debug.c
|
files: arch/s390/kernel/debug.c
|
||||||
include/asm-s390/debug.h
|
arch/s390/include/asm/debug.h
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
------------
|
------------
|
||||||
|
|
|
@ -733,7 +733,7 @@ Changes from 20040920 to 20041018
|
||||||
I/O completion path a little more, especially taking care of
|
I/O completion path a little more, especially taking care of
|
||||||
fast-pathing the non-error case. Also removes tons of dead
|
fast-pathing the non-error case. Also removes tons of dead
|
||||||
members and defines from lpfc_scsi.h - e.g. lpfc_target is down
|
members and defines from lpfc_scsi.h - e.g. lpfc_target is down
|
||||||
to nothing more then the lpfc_nodelist pointer.
|
to nothing more than the lpfc_nodelist pointer.
|
||||||
* Added binary sysfs file to issue mbox commands
|
* Added binary sysfs file to issue mbox commands
|
||||||
* Replaced #if __BIG_ENDIAN with #if __BIG_ENDIAN_BITFIELD for
|
* Replaced #if __BIG_ENDIAN with #if __BIG_ENDIAN_BITFIELD for
|
||||||
compatibility with the user space applications.
|
compatibility with the user space applications.
|
||||||
|
|
|
@ -19,7 +19,7 @@ Sun Sep 24 21:30 2000 Gerard Roudier (groudier@club-internet.fr)
|
||||||
|
|
||||||
Wed Jul 26 23:30 2000 Gerard Roudier (groudier@club-internet.fr)
|
Wed Jul 26 23:30 2000 Gerard Roudier (groudier@club-internet.fr)
|
||||||
* version ncr53c8xx-3.4.1
|
* version ncr53c8xx-3.4.1
|
||||||
- Provide OpenFirmare path through the proc FS on PPC.
|
- Provide OpenFirmware path through the proc FS on PPC.
|
||||||
- Remove trailing argument #2 from a couple of #undefs.
|
- Remove trailing argument #2 from a couple of #undefs.
|
||||||
|
|
||||||
Sun Jul 09 16:30 2000 Gerard Roudier (groudier@club-internet.fr)
|
Sun Jul 09 16:30 2000 Gerard Roudier (groudier@club-internet.fr)
|
||||||
|
|
|
@ -81,7 +81,7 @@ Sun Sep 24 21:30 2000 Gerard Roudier (groudier@club-internet.fr)
|
||||||
|
|
||||||
Wed Jul 26 23:30 2000 Gerard Roudier (groudier@club-internet.fr)
|
Wed Jul 26 23:30 2000 Gerard Roudier (groudier@club-internet.fr)
|
||||||
* version sym53c8xx-1.7.1
|
* version sym53c8xx-1.7.1
|
||||||
- Provide OpenFirmare path through the proc FS on PPC.
|
- Provide OpenFirmware path through the proc FS on PPC.
|
||||||
- Download of on-chip SRAM using memcpy_toio() doesn't work
|
- Download of on-chip SRAM using memcpy_toio() doesn't work
|
||||||
on PPC. Restore previous method (MEMORY MOVE from SCRIPTS).
|
on PPC. Restore previous method (MEMORY MOVE from SCRIPTS).
|
||||||
- Remove trailing argument #2 from a couple of #undefs.
|
- Remove trailing argument #2 from a couple of #undefs.
|
||||||
|
|
85
Documentation/scsi/cxgb3i.txt
Normal file
85
Documentation/scsi/cxgb3i.txt
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
Chelsio S3 iSCSI Driver for Linux
|
||||||
|
|
||||||
|
Introduction
|
||||||
|
============
|
||||||
|
|
||||||
|
The Chelsio T3 ASIC based Adapters (S310, S320, S302, S304, Mezz cards, etc.
|
||||||
|
series of products) supports iSCSI acceleration and iSCSI Direct Data Placement
|
||||||
|
(DDP) where the hardware handles the expensive byte touching operations, such
|
||||||
|
as CRC computation and verification, and direct DMA to the final host memory
|
||||||
|
destination:
|
||||||
|
|
||||||
|
- iSCSI PDU digest generation and verification
|
||||||
|
|
||||||
|
On transmitting, Chelsio S3 h/w computes and inserts the Header and
|
||||||
|
Data digest into the PDUs.
|
||||||
|
On receiving, Chelsio S3 h/w computes and verifies the Header and
|
||||||
|
Data digest of the PDUs.
|
||||||
|
|
||||||
|
- Direct Data Placement (DDP)
|
||||||
|
|
||||||
|
S3 h/w can directly place the iSCSI Data-In or Data-Out PDU's
|
||||||
|
payload into pre-posted final destination host-memory buffers based
|
||||||
|
on the Initiator Task Tag (ITT) in Data-In or Target Task Tag (TTT)
|
||||||
|
in Data-Out PDUs.
|
||||||
|
|
||||||
|
- PDU Transmit and Recovery
|
||||||
|
|
||||||
|
On transmitting, S3 h/w accepts the complete PDU (header + data)
|
||||||
|
from the host driver, computes and inserts the digests, decomposes
|
||||||
|
the PDU into multiple TCP segments if necessary, and transmit all
|
||||||
|
the TCP segments onto the wire. It handles TCP retransmission if
|
||||||
|
needed.
|
||||||
|
|
||||||
|
On receving, S3 h/w recovers the iSCSI PDU by reassembling TCP
|
||||||
|
segments, separating the header and data, calculating and verifying
|
||||||
|
the digests, then forwards the header to the host. The payload data,
|
||||||
|
if possible, will be directly placed into the pre-posted host DDP
|
||||||
|
buffer. Otherwise, the payload data will be sent to the host too.
|
||||||
|
|
||||||
|
The cxgb3i driver interfaces with open-iscsi initiator and provides the iSCSI
|
||||||
|
acceleration through Chelsio hardware wherever applicable.
|
||||||
|
|
||||||
|
Using the cxgb3i Driver
|
||||||
|
=======================
|
||||||
|
|
||||||
|
The following steps need to be taken to accelerates the open-iscsi initiator:
|
||||||
|
|
||||||
|
1. Load the cxgb3i driver: "modprobe cxgb3i"
|
||||||
|
|
||||||
|
The cxgb3i module registers a new transport class "cxgb3i" with open-iscsi.
|
||||||
|
|
||||||
|
* in the case of recompiling the kernel, the cxgb3i selection is located at
|
||||||
|
Device Drivers
|
||||||
|
SCSI device support --->
|
||||||
|
[*] SCSI low-level drivers --->
|
||||||
|
<M> Chelsio S3xx iSCSI support
|
||||||
|
|
||||||
|
2. Create an interface file located under /etc/iscsi/ifaces/ for the new
|
||||||
|
transport class "cxgb3i".
|
||||||
|
|
||||||
|
The content of the file should be in the following format:
|
||||||
|
iface.transport_name = cxgb3i
|
||||||
|
iface.net_ifacename = <ethX>
|
||||||
|
iface.ipaddress = <iscsi ip address>
|
||||||
|
|
||||||
|
* if iface.ipaddress is specified, <iscsi ip address> needs to be either the
|
||||||
|
same as the ethX's ip address or an address on the same subnet. Make
|
||||||
|
sure the ip address is unique in the network.
|
||||||
|
|
||||||
|
3. edit /etc/iscsi/iscsid.conf
|
||||||
|
The default setting for MaxRecvDataSegmentLength (131072) is too big,
|
||||||
|
replace "node.conn[0].iscsi.MaxRecvDataSegmentLength" to be a value no
|
||||||
|
bigger than 15360 (for example 8192):
|
||||||
|
|
||||||
|
node.conn[0].iscsi.MaxRecvDataSegmentLength = 8192
|
||||||
|
|
||||||
|
* The login would fail for a normal session if MaxRecvDataSegmentLength is
|
||||||
|
too big. A error message in the format of
|
||||||
|
"cxgb3i: ERR! MaxRecvSegmentLength <X> too big. Need to be <= <Y>."
|
||||||
|
would be logged to dmesg.
|
||||||
|
|
||||||
|
4. To direct open-iscsi traffic to go through cxgb3i's accelerated path,
|
||||||
|
"-I <iface file name>" option needs to be specified with most of the
|
||||||
|
iscsiadm command. <iface file name> is the transport interface file created
|
||||||
|
in step 2.
|
|
@ -191,7 +191,7 @@ Vport States:
|
||||||
This is equivalent to a driver "attach" on an adapter, which is
|
This is equivalent to a driver "attach" on an adapter, which is
|
||||||
independent of the adapter's link state.
|
independent of the adapter's link state.
|
||||||
- Instantiation of the vport on the FC link via ELS traffic, etc.
|
- Instantiation of the vport on the FC link via ELS traffic, etc.
|
||||||
This is equivalent to a "link up" and successfull link initialization.
|
This is equivalent to a "link up" and successful link initialization.
|
||||||
Further information can be found in the interfaces section below for
|
Further information can be found in the interfaces section below for
|
||||||
Vport Creation.
|
Vport Creation.
|
||||||
|
|
||||||
|
@ -320,7 +320,7 @@ Vport Creation:
|
||||||
This is equivalent to a driver "attach" on an adapter, which is
|
This is equivalent to a driver "attach" on an adapter, which is
|
||||||
independent of the adapter's link state.
|
independent of the adapter's link state.
|
||||||
- Instantiation of the vport on the FC link via ELS traffic, etc.
|
- Instantiation of the vport on the FC link via ELS traffic, etc.
|
||||||
This is equivalent to a "link up" and successfull link initialization.
|
This is equivalent to a "link up" and successful link initialization.
|
||||||
|
|
||||||
The LLDD's vport_create() function will not synchronously wait for both
|
The LLDD's vport_create() function will not synchronously wait for both
|
||||||
parts to be fully completed before returning. It must validate that the
|
parts to be fully completed before returning. It must validate that the
|
||||||
|
|
|
@ -13,10 +13,20 @@ Description
|
||||||
This driver provides glue code connecting a National Semiconductor LM70 LLP
|
This driver provides glue code connecting a National Semiconductor LM70 LLP
|
||||||
temperature sensor evaluation board to the kernel's SPI core subsystem.
|
temperature sensor evaluation board to the kernel's SPI core subsystem.
|
||||||
|
|
||||||
|
This is a SPI master controller driver. It can be used in conjunction with
|
||||||
|
(layered under) the LM70 logical driver (a "SPI protocol driver").
|
||||||
In effect, this driver turns the parallel port interface on the eval board
|
In effect, this driver turns the parallel port interface on the eval board
|
||||||
into a SPI bus with a single device, which will be driven by the generic
|
into a SPI bus with a single device, which will be driven by the generic
|
||||||
LM70 driver (drivers/hwmon/lm70.c).
|
LM70 driver (drivers/hwmon/lm70.c).
|
||||||
|
|
||||||
|
|
||||||
|
Hardware Interfacing
|
||||||
|
--------------------
|
||||||
|
The schematic for this particular board (the LM70EVAL-LLP) is
|
||||||
|
available (on page 4) here:
|
||||||
|
|
||||||
|
http://www.national.com/appinfo/tempsensors/files/LM70LLPEVALmanual.pdf
|
||||||
|
|
||||||
The hardware interfacing on the LM70 LLP eval board is as follows:
|
The hardware interfacing on the LM70 LLP eval board is as follows:
|
||||||
|
|
||||||
Parallel LM70 LLP
|
Parallel LM70 LLP
|
||||||
|
|
|
@ -38,10 +38,12 @@ Currently, these files are in /proc/sys/vm:
|
||||||
- numa_zonelist_order
|
- numa_zonelist_order
|
||||||
- nr_hugepages
|
- nr_hugepages
|
||||||
- nr_overcommit_hugepages
|
- nr_overcommit_hugepages
|
||||||
|
- nr_trim_pages (only if CONFIG_MMU=n)
|
||||||
|
|
||||||
==============================================================
|
==============================================================
|
||||||
|
|
||||||
dirty_ratio, dirty_background_ratio, dirty_expire_centisecs,
|
dirty_bytes, dirty_ratio, dirty_background_bytes,
|
||||||
|
dirty_background_ratio, dirty_expire_centisecs,
|
||||||
dirty_writeback_centisecs, highmem_is_dirtyable,
|
dirty_writeback_centisecs, highmem_is_dirtyable,
|
||||||
vfs_cache_pressure, laptop_mode, block_dump, swap_token_timeout,
|
vfs_cache_pressure, laptop_mode, block_dump, swap_token_timeout,
|
||||||
drop-caches, hugepages_treat_as_movable:
|
drop-caches, hugepages_treat_as_movable:
|
||||||
|
@ -347,3 +349,20 @@ Change the maximum size of the hugepage pool. The maximum is
|
||||||
nr_hugepages + nr_overcommit_hugepages.
|
nr_hugepages + nr_overcommit_hugepages.
|
||||||
|
|
||||||
See Documentation/vm/hugetlbpage.txt
|
See Documentation/vm/hugetlbpage.txt
|
||||||
|
|
||||||
|
==============================================================
|
||||||
|
|
||||||
|
nr_trim_pages
|
||||||
|
|
||||||
|
This is available only on NOMMU kernels.
|
||||||
|
|
||||||
|
This value adjusts the excess page trimming behaviour of power-of-2 aligned
|
||||||
|
NOMMU mmap allocations.
|
||||||
|
|
||||||
|
A value of 0 disables trimming of allocations entirely, while a value of 1
|
||||||
|
trims excess pages aggressively. Any value >= 1 acts as the watermark where
|
||||||
|
trimming of allocations is initiated.
|
||||||
|
|
||||||
|
The default value is 1.
|
||||||
|
|
||||||
|
See Documentation/nommu-mmap.txt for more information.
|
||||||
|
|
|
@ -313,11 +313,13 @@ three of the methods listed above. In addition, a driver indicates
|
||||||
that it supports autosuspend by setting the .supports_autosuspend flag
|
that it supports autosuspend by setting the .supports_autosuspend flag
|
||||||
in its usb_driver structure. It is then responsible for informing the
|
in its usb_driver structure. It is then responsible for informing the
|
||||||
USB core whenever one of its interfaces becomes busy or idle. The
|
USB core whenever one of its interfaces becomes busy or idle. The
|
||||||
driver does so by calling these three functions:
|
driver does so by calling these five functions:
|
||||||
|
|
||||||
int usb_autopm_get_interface(struct usb_interface *intf);
|
int usb_autopm_get_interface(struct usb_interface *intf);
|
||||||
void usb_autopm_put_interface(struct usb_interface *intf);
|
void usb_autopm_put_interface(struct usb_interface *intf);
|
||||||
int usb_autopm_set_interface(struct usb_interface *intf);
|
int usb_autopm_set_interface(struct usb_interface *intf);
|
||||||
|
int usb_autopm_get_interface_async(struct usb_interface *intf);
|
||||||
|
void usb_autopm_put_interface_async(struct usb_interface *intf);
|
||||||
|
|
||||||
The functions work by maintaining a counter in the usb_interface
|
The functions work by maintaining a counter in the usb_interface
|
||||||
structure. When intf->pm_usage_count is > 0 then the interface is
|
structure. When intf->pm_usage_count is > 0 then the interface is
|
||||||
|
@ -330,10 +332,12 @@ associated with the device itself rather than any of its interfaces.
|
||||||
This field is used only by the USB core.)
|
This field is used only by the USB core.)
|
||||||
|
|
||||||
The driver owns intf->pm_usage_count; it can modify the value however
|
The driver owns intf->pm_usage_count; it can modify the value however
|
||||||
and whenever it likes. A nice aspect of the usb_autopm_* routines is
|
and whenever it likes. A nice aspect of the non-async usb_autopm_*
|
||||||
that the changes they make are protected by the usb_device structure's
|
routines is that the changes they make are protected by the usb_device
|
||||||
PM mutex (udev->pm_mutex); however drivers may change pm_usage_count
|
structure's PM mutex (udev->pm_mutex); however drivers may change
|
||||||
without holding the mutex.
|
pm_usage_count without holding the mutex. Drivers using the async
|
||||||
|
routines are responsible for their own synchronization and mutual
|
||||||
|
exclusion.
|
||||||
|
|
||||||
usb_autopm_get_interface() increments pm_usage_count and
|
usb_autopm_get_interface() increments pm_usage_count and
|
||||||
attempts an autoresume if the new value is > 0 and the
|
attempts an autoresume if the new value is > 0 and the
|
||||||
|
@ -348,6 +352,14 @@ without holding the mutex.
|
||||||
is suspended, and it attempts an autosuspend if the value is
|
is suspended, and it attempts an autosuspend if the value is
|
||||||
<= 0 and the device isn't suspended.
|
<= 0 and the device isn't suspended.
|
||||||
|
|
||||||
|
usb_autopm_get_interface_async() and
|
||||||
|
usb_autopm_put_interface_async() do almost the same things as
|
||||||
|
their non-async counterparts. The differences are: they do
|
||||||
|
not acquire the PM mutex, and they use a workqueue to do their
|
||||||
|
jobs. As a result they can be called in an atomic context,
|
||||||
|
such as an URB's completion handler, but when they return the
|
||||||
|
device will not generally not yet be in the desired state.
|
||||||
|
|
||||||
There also are a couple of utility routines drivers can use:
|
There also are a couple of utility routines drivers can use:
|
||||||
|
|
||||||
usb_autopm_enable() sets pm_usage_cnt to 0 and then calls
|
usb_autopm_enable() sets pm_usage_cnt to 0 and then calls
|
||||||
|
|
|
@ -80,12 +80,6 @@ case $1 in
|
||||||
start)
|
start)
|
||||||
for dev in ${2:-$hdevs}
|
for dev in ${2:-$hdevs}
|
||||||
do
|
do
|
||||||
uwb_rc=$(readlink -f $dev/uwb_rc)
|
|
||||||
if cat $uwb_rc/beacon | grep -q -- "-1"
|
|
||||||
then
|
|
||||||
echo 13 0 > $uwb_rc/beacon
|
|
||||||
echo I: started beaconing on ch 13 on $(basename $uwb_rc) >&2
|
|
||||||
fi
|
|
||||||
echo $host_CHID > $dev/wusb_chid
|
echo $host_CHID > $dev/wusb_chid
|
||||||
echo I: started host $(basename $dev) >&2
|
echo I: started host $(basename $dev) >&2
|
||||||
done
|
done
|
||||||
|
@ -95,9 +89,6 @@ case $1 in
|
||||||
do
|
do
|
||||||
echo 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > $dev/wusb_chid
|
echo 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > $dev/wusb_chid
|
||||||
echo I: stopped host $(basename $dev) >&2
|
echo I: stopped host $(basename $dev) >&2
|
||||||
uwb_rc=$(readlink -f $dev/uwb_rc)
|
|
||||||
echo -1 | cat > $uwb_rc/beacon
|
|
||||||
echo I: stopped beaconing on $(basename $uwb_rc) >&2
|
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
set-chid)
|
set-chid)
|
||||||
|
|
|
@ -1,16 +1,27 @@
|
||||||
<TITLE>V4L API</TITLE>
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
<H1>Video For Linux APIs</H1>
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||||
<table border=0>
|
<head>
|
||||||
<tr>
|
<meta content="text/html;charset=ISO-8859-2" http-equiv="Content-Type" />
|
||||||
<td>
|
<title>V4L API</title>
|
||||||
<A HREF=http://www.linuxtv.org/downloads/video4linux/API/V4L1_API.html>
|
</head>
|
||||||
V4L original API</a>
|
<body>
|
||||||
</td><td>
|
<h1>Video For Linux APIs</h1>
|
||||||
Obsoleted by V4L2 API
|
<table border="0">
|
||||||
</td></tr><tr><td>
|
<tr>
|
||||||
<A HREF=http://www.linuxtv.org/downloads/video4linux/API/V4L2_API>
|
<td>
|
||||||
V4L2 API</a>
|
<a href="http://www.linuxtv.org/downloads/video4linux/API/V4L1_API.html">V4L original API</a>
|
||||||
</td><td>
|
</td>
|
||||||
Should be used for new projects
|
<td>
|
||||||
</td></tr>
|
Obsoleted by V4L2 API
|
||||||
</table>
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="http://www.linuxtv.org/downloads/video4linux/API/V4L2_API">V4L2 API</a>
|
||||||
|
</td>
|
||||||
|
<td>Should be used for new projects
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -104,8 +104,8 @@
|
||||||
103 -> Grand X-Guard / Trust 814PCI [0304:0102]
|
103 -> Grand X-Guard / Trust 814PCI [0304:0102]
|
||||||
104 -> Nebula Electronics DigiTV [0071:0101]
|
104 -> Nebula Electronics DigiTV [0071:0101]
|
||||||
105 -> ProVideo PV143 [aa00:1430,aa00:1431,aa00:1432,aa00:1433,aa03:1433]
|
105 -> ProVideo PV143 [aa00:1430,aa00:1431,aa00:1432,aa00:1433,aa03:1433]
|
||||||
106 -> PHYTEC VD-009-X1 MiniDIN (bt878)
|
106 -> PHYTEC VD-009-X1 VD-011 MiniDIN (bt878)
|
||||||
107 -> PHYTEC VD-009-X1 Combi (bt878)
|
107 -> PHYTEC VD-009-X1 VD-011 Combi (bt878)
|
||||||
108 -> PHYTEC VD-009 MiniDIN (bt878)
|
108 -> PHYTEC VD-009 MiniDIN (bt878)
|
||||||
109 -> PHYTEC VD-009 Combi (bt878)
|
109 -> PHYTEC VD-009 Combi (bt878)
|
||||||
110 -> IVC-100 [ff00:a132]
|
110 -> IVC-100 [ff00:a132]
|
||||||
|
@ -151,3 +151,6 @@
|
||||||
150 -> Geovision GV-600 [008a:763c]
|
150 -> Geovision GV-600 [008a:763c]
|
||||||
151 -> Kozumi KTV-01C
|
151 -> Kozumi KTV-01C
|
||||||
152 -> Encore ENL TV-FM-2 [1000:1801]
|
152 -> Encore ENL TV-FM-2 [1000:1801]
|
||||||
|
153 -> PHYTEC VD-012 (bt878)
|
||||||
|
154 -> PHYTEC VD-012-X1 (bt878)
|
||||||
|
155 -> PHYTEC VD-012-X2 (bt878)
|
||||||
|
|
|
@ -11,3 +11,4 @@
|
||||||
10 -> DViCO FusionHDTV7 Dual Express [18ac:d618]
|
10 -> DViCO FusionHDTV7 Dual Express [18ac:d618]
|
||||||
11 -> DViCO FusionHDTV DVB-T Dual Express [18ac:db78]
|
11 -> DViCO FusionHDTV DVB-T Dual Express [18ac:db78]
|
||||||
12 -> Leadtek Winfast PxDVR3200 H [107d:6681]
|
12 -> Leadtek Winfast PxDVR3200 H [107d:6681]
|
||||||
|
13 -> Compro VideoMate E650F [185b:e800]
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
1 -> Hauppauge WinTV 34xxx models [0070:3400,0070:3401]
|
1 -> Hauppauge WinTV 34xxx models [0070:3400,0070:3401]
|
||||||
2 -> GDI Black Gold [14c7:0106,14c7:0107]
|
2 -> GDI Black Gold [14c7:0106,14c7:0107]
|
||||||
3 -> PixelView [1554:4811]
|
3 -> PixelView [1554:4811]
|
||||||
4 -> ATI TV Wonder Pro [1002:00f8]
|
4 -> ATI TV Wonder Pro [1002:00f8,1002:00f9]
|
||||||
5 -> Leadtek Winfast 2000XP Expert [107d:6611,107d:6613]
|
5 -> Leadtek Winfast 2000XP Expert [107d:6611,107d:6613]
|
||||||
6 -> AverTV Studio 303 (M126) [1461:000b]
|
6 -> AverTV Studio 303 (M126) [1461:000b]
|
||||||
7 -> MSI TV-@nywhere Master [1462:8606]
|
7 -> MSI TV-@nywhere Master [1462:8606]
|
||||||
|
@ -74,3 +74,6 @@
|
||||||
73 -> TeVii S420 DVB-S [d420:9022]
|
73 -> TeVii S420 DVB-S [d420:9022]
|
||||||
74 -> Prolink Pixelview Global Extreme [1554:4976]
|
74 -> Prolink Pixelview Global Extreme [1554:4976]
|
||||||
75 -> PROF 7300 DVB-S/S2 [B033:3033]
|
75 -> PROF 7300 DVB-S/S2 [B033:3033]
|
||||||
|
76 -> SATTRADE ST4200 DVB-S/S2 [b200:4200]
|
||||||
|
77 -> TBS 8910 DVB-S [8910:8888]
|
||||||
|
78 -> Prof 6200 DVB-S [b022:3022]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800]
|
0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800]
|
||||||
1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2820,eb1a:2860,eb1a:2861,eb1a:2870,eb1a:2881,eb1a:2883]
|
1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2870,eb1a:2881,eb1a:2883]
|
||||||
2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036]
|
2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036]
|
||||||
3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208]
|
3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208]
|
||||||
4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201]
|
4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201]
|
||||||
|
@ -12,9 +12,9 @@
|
||||||
11 -> Terratec Hybrid XS (em2880) [0ccd:0042]
|
11 -> Terratec Hybrid XS (em2880) [0ccd:0042]
|
||||||
12 -> Kworld PVR TV 2800 RF (em2820/em2840)
|
12 -> Kworld PVR TV 2800 RF (em2820/em2840)
|
||||||
13 -> Terratec Prodigy XS (em2880) [0ccd:0047]
|
13 -> Terratec Prodigy XS (em2880) [0ccd:0047]
|
||||||
14 -> Pixelview Prolink PlayTV USB 2.0 (em2820/em2840) [eb1a:2821]
|
14 -> Pixelview Prolink PlayTV USB 2.0 (em2820/em2840)
|
||||||
15 -> V-Gear PocketTV (em2800)
|
15 -> V-Gear PocketTV (em2800)
|
||||||
16 -> Hauppauge WinTV HVR 950 (em2883) [2040:6513,2040:6517,2040:651b,2040:651f]
|
16 -> Hauppauge WinTV HVR 950 (em2883) [2040:6513,2040:6517,2040:651b]
|
||||||
17 -> Pinnacle PCTV HD Pro Stick (em2880) [2304:0227]
|
17 -> Pinnacle PCTV HD Pro Stick (em2880) [2304:0227]
|
||||||
18 -> Hauppauge WinTV HVR 900 (R2) (em2880) [2040:6502]
|
18 -> Hauppauge WinTV HVR 900 (R2) (em2880) [2040:6502]
|
||||||
19 -> PointNix Intra-Oral Camera (em2860)
|
19 -> PointNix Intra-Oral Camera (em2860)
|
||||||
|
@ -27,7 +27,6 @@
|
||||||
26 -> Hercules Smart TV USB 2.0 (em2820/em2840)
|
26 -> Hercules Smart TV USB 2.0 (em2820/em2840)
|
||||||
27 -> Pinnacle PCTV USB 2 (Philips FM1216ME) (em2820/em2840)
|
27 -> Pinnacle PCTV USB 2 (Philips FM1216ME) (em2820/em2840)
|
||||||
28 -> Leadtek Winfast USB II Deluxe (em2820/em2840)
|
28 -> Leadtek Winfast USB II Deluxe (em2820/em2840)
|
||||||
29 -> Pinnacle Dazzle DVC 100 (em2820/em2840)
|
|
||||||
30 -> Videology 20K14XUSB USB2.0 (em2820/em2840)
|
30 -> Videology 20K14XUSB USB2.0 (em2820/em2840)
|
||||||
31 -> Usbgear VD204v9 (em2821)
|
31 -> Usbgear VD204v9 (em2821)
|
||||||
32 -> Supercomp USB 2.0 TV (em2821)
|
32 -> Supercomp USB 2.0 TV (em2821)
|
||||||
|
@ -57,3 +56,5 @@
|
||||||
56 -> Pinnacle Hybrid Pro (2) (em2882) [2304:0226]
|
56 -> Pinnacle Hybrid Pro (2) (em2882) [2304:0226]
|
||||||
57 -> Kworld PlusTV HD Hybrid 330 (em2883) [eb1a:a316]
|
57 -> Kworld PlusTV HD Hybrid 330 (em2883) [eb1a:a316]
|
||||||
58 -> Compro VideoMate ForYou/Stereo (em2820/em2840) [185b:2041]
|
58 -> Compro VideoMate ForYou/Stereo (em2820/em2840) [185b:2041]
|
||||||
|
60 -> Hauppauge WinTV HVR 850 (em2883) [2040:651f]
|
||||||
|
61 -> Pixelview PlayTV Box 4 USB 2.0 (em2820/em2840)
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
9 -> Medion 5044
|
9 -> Medion 5044
|
||||||
10 -> Kworld/KuroutoShikou SAA7130-TVPCI
|
10 -> Kworld/KuroutoShikou SAA7130-TVPCI
|
||||||
11 -> Terratec Cinergy 600 TV [153b:1143]
|
11 -> Terratec Cinergy 600 TV [153b:1143]
|
||||||
12 -> Medion 7134 [16be:0003]
|
12 -> Medion 7134 [16be:0003,16be:5000]
|
||||||
13 -> Typhoon TV+Radio 90031
|
13 -> Typhoon TV+Radio 90031
|
||||||
14 -> ELSA EX-VISION 300TV [1048:226b]
|
14 -> ELSA EX-VISION 300TV [1048:226b]
|
||||||
15 -> ELSA EX-VISION 500TV [1048:226a]
|
15 -> ELSA EX-VISION 500TV [1048:226a]
|
||||||
|
@ -151,3 +151,5 @@
|
||||||
150 -> Zogis Real Angel 220
|
150 -> Zogis Real Angel 220
|
||||||
151 -> ADS Tech Instant HDTV [1421:0380]
|
151 -> ADS Tech Instant HDTV [1421:0380]
|
||||||
152 -> Asus Tiger Rev:1.00 [1043:4857]
|
152 -> Asus Tiger Rev:1.00 [1043:4857]
|
||||||
|
153 -> Kworld Plus TV Analog Lite PCI [17de:7128]
|
||||||
|
154 -> Avermedia AVerTV GO 007 FM Plus [1461:f31d]
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
cx8800 release notes
|
cx8800 release notes
|
||||||
====================
|
====================
|
||||||
|
|
||||||
|
@ -10,21 +9,20 @@ current status
|
||||||
|
|
||||||
video
|
video
|
||||||
- Basically works.
|
- Basically works.
|
||||||
- Some minor image quality glitches.
|
- For now, only capture and read(). Overlay isn't supported.
|
||||||
- For now only capture, overlay support isn't completed yet.
|
|
||||||
|
|
||||||
audio
|
audio
|
||||||
- The chip specs for the on-chip TV sound decoder are next
|
- The chip specs for the on-chip TV sound decoder are next
|
||||||
to useless :-/
|
to useless :-/
|
||||||
- Neverless the builtin TV sound decoder starts working now,
|
- Neverless the builtin TV sound decoder starts working now,
|
||||||
at least for PAL-BG. Other TV norms need other code ...
|
at least for some standards.
|
||||||
FOR ANY REPORTS ON THIS PLEASE MENTION THE TV NORM YOU ARE
|
FOR ANY REPORTS ON THIS PLEASE MENTION THE TV NORM YOU ARE
|
||||||
USING.
|
USING.
|
||||||
- Most tuner chips do provide mono sound, which may or may not
|
- Most tuner chips do provide mono sound, which may or may not
|
||||||
be useable depending on the board design. With the Hauppauge
|
be useable depending on the board design. With the Hauppauge
|
||||||
cards it works, so there is mono sound available as fallback.
|
cards it works, so there is mono sound available as fallback.
|
||||||
- audio data dma (i.e. recording without loopback cable to the
|
- audio data dma (i.e. recording without loopback cable to the
|
||||||
sound card) should be possible, but there is no code yet ...
|
sound card) is supported via cx88-alsa.
|
||||||
|
|
||||||
vbi
|
vbi
|
||||||
- Code present. Works for NTSC closed caption. PAL and other
|
- Code present. Works for NTSC closed caption. PAL and other
|
||||||
|
|
|
@ -50,9 +50,14 @@ ov519 045e:028c Micro$oft xbox cam
|
||||||
spca508 0461:0815 Micro Innovation IC200
|
spca508 0461:0815 Micro Innovation IC200
|
||||||
sunplus 0461:0821 Fujifilm MV-1
|
sunplus 0461:0821 Fujifilm MV-1
|
||||||
zc3xx 0461:0a00 MicroInnovation WebCam320
|
zc3xx 0461:0a00 MicroInnovation WebCam320
|
||||||
|
stv06xx 046d:0840 QuickCam Express
|
||||||
|
stv06xx 046d:0850 LEGO cam / QuickCam Web
|
||||||
|
stv06xx 046d:0870 Dexxa WebCam USB
|
||||||
spca500 046d:0890 Logitech QuickCam traveler
|
spca500 046d:0890 Logitech QuickCam traveler
|
||||||
vc032x 046d:0892 Logitech Orbicam
|
vc032x 046d:0892 Logitech Orbicam
|
||||||
vc032x 046d:0896 Logitech Orbicam
|
vc032x 046d:0896 Logitech Orbicam
|
||||||
|
vc032x 046d:0897 Logitech QuickCam for Dell notebooks
|
||||||
|
zc3xx 046d:089d Logitech QuickCam E2500
|
||||||
zc3xx 046d:08a0 Logitech QC IM
|
zc3xx 046d:08a0 Logitech QC IM
|
||||||
zc3xx 046d:08a1 Logitech QC IM 0x08A1 +sound
|
zc3xx 046d:08a1 Logitech QC IM 0x08A1 +sound
|
||||||
zc3xx 046d:08a2 Labtec Webcam Pro
|
zc3xx 046d:08a2 Labtec Webcam Pro
|
||||||
|
@ -169,6 +174,9 @@ spca500 06bd:0404 Agfa CL20
|
||||||
spca500 06be:0800 Optimedia
|
spca500 06be:0800 Optimedia
|
||||||
sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom
|
sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom
|
||||||
spca506 06e1:a190 ADS Instant VCD
|
spca506 06e1:a190 ADS Instant VCD
|
||||||
|
ov534 06f8:3002 Hercules Blog Webcam
|
||||||
|
ov534 06f8:3003 Hercules Dualpix HD Weblog
|
||||||
|
sonixj 06f8:3004 Hercules Classic Silver
|
||||||
spca508 0733:0110 ViewQuest VQ110
|
spca508 0733:0110 ViewQuest VQ110
|
||||||
spca508 0130:0130 Clone Digital Webcam 11043
|
spca508 0130:0130 Clone Digital Webcam 11043
|
||||||
spca501 0733:0401 Intel Create and Share
|
spca501 0733:0401 Intel Create and Share
|
||||||
|
@ -199,7 +207,8 @@ sunplus 08ca:2050 Medion MD 41437
|
||||||
sunplus 08ca:2060 Aiptek PocketDV5300
|
sunplus 08ca:2060 Aiptek PocketDV5300
|
||||||
tv8532 0923:010f ICM532 cams
|
tv8532 0923:010f ICM532 cams
|
||||||
mars 093a:050f Mars-Semi Pc-Camera
|
mars 093a:050f Mars-Semi Pc-Camera
|
||||||
pac207 093a:2460 PAC207 Qtec Webcam 100
|
pac207 093a:2460 Qtec Webcam 100
|
||||||
|
pac207 093a:2461 HP Webcam
|
||||||
pac207 093a:2463 Philips SPC 220 NC
|
pac207 093a:2463 Philips SPC 220 NC
|
||||||
pac207 093a:2464 Labtec Webcam 1200
|
pac207 093a:2464 Labtec Webcam 1200
|
||||||
pac207 093a:2468 PAC207
|
pac207 093a:2468 PAC207
|
||||||
|
@ -213,10 +222,13 @@ pac7311 093a:2603 PAC7312
|
||||||
pac7311 093a:2608 Trust WB-3300p
|
pac7311 093a:2608 Trust WB-3300p
|
||||||
pac7311 093a:260e Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350
|
pac7311 093a:260e Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350
|
||||||
pac7311 093a:260f SnakeCam
|
pac7311 093a:260f SnakeCam
|
||||||
|
pac7311 093a:2620 Apollo AC-905
|
||||||
pac7311 093a:2621 PAC731x
|
pac7311 093a:2621 PAC731x
|
||||||
|
pac7311 093a:2622 Genius Eye 312
|
||||||
pac7311 093a:2624 PAC7302
|
pac7311 093a:2624 PAC7302
|
||||||
pac7311 093a:2626 Labtec 2200
|
pac7311 093a:2626 Labtec 2200
|
||||||
pac7311 093a:262a Webcam 300k
|
pac7311 093a:262a Webcam 300k
|
||||||
|
pac7311 093a:262c Philips SPC 230 NC
|
||||||
zc3xx 0ac8:0302 Z-star Vimicro zc0302
|
zc3xx 0ac8:0302 Z-star Vimicro zc0302
|
||||||
vc032x 0ac8:0321 Vimicro generic vc0321
|
vc032x 0ac8:0321 Vimicro generic vc0321
|
||||||
vc032x 0ac8:0323 Vimicro Vc0323
|
vc032x 0ac8:0323 Vimicro Vc0323
|
||||||
|
@ -249,11 +261,13 @@ sonixj 0c45:60c0 Sangha Sn535
|
||||||
sonixj 0c45:60ec SN9C105+MO4000
|
sonixj 0c45:60ec SN9C105+MO4000
|
||||||
sonixj 0c45:60fb Surfer NoName
|
sonixj 0c45:60fb Surfer NoName
|
||||||
sonixj 0c45:60fc LG-LIC300
|
sonixj 0c45:60fc LG-LIC300
|
||||||
|
sonixj 0c45:60fe Microdia Audio
|
||||||
sonixj 0c45:6128 Microdia/Sonix SNP325
|
sonixj 0c45:6128 Microdia/Sonix SNP325
|
||||||
sonixj 0c45:612a Avant Camera
|
sonixj 0c45:612a Avant Camera
|
||||||
sonixj 0c45:612c Typhoon Rasy Cam 1.3MPix
|
sonixj 0c45:612c Typhoon Rasy Cam 1.3MPix
|
||||||
sonixj 0c45:6130 Sonix Pccam
|
sonixj 0c45:6130 Sonix Pccam
|
||||||
sonixj 0c45:6138 Sn9c120 Mo4000
|
sonixj 0c45:6138 Sn9c120 Mo4000
|
||||||
|
sonixj 0c45:613a Microdia Sonix PC Camera
|
||||||
sonixj 0c45:613b Surfer SN-206
|
sonixj 0c45:613b Surfer SN-206
|
||||||
sonixj 0c45:613c Sonix Pccam168
|
sonixj 0c45:613c Sonix Pccam168
|
||||||
sonixj 0c45:6143 Sonix Pccam168
|
sonixj 0c45:6143 Sonix Pccam168
|
||||||
|
@ -263,6 +277,9 @@ etoms 102c:6251 Qcam xxxxxx VGA
|
||||||
zc3xx 10fd:0128 Typhoon Webshot II USB 300k 0x0128
|
zc3xx 10fd:0128 Typhoon Webshot II USB 300k 0x0128
|
||||||
spca561 10fd:7e50 FlyCam Usb 100
|
spca561 10fd:7e50 FlyCam Usb 100
|
||||||
zc3xx 10fd:8050 Typhoon Webshot II USB 300k
|
zc3xx 10fd:8050 Typhoon Webshot II USB 300k
|
||||||
|
ov534 1415:2000 Sony HD Eye for PS3 (SLEH 00201)
|
||||||
|
pac207 145f:013a Trust WB-1300N
|
||||||
|
vc032x 15b8:6002 HP 2.0 Megapixel rz406aa
|
||||||
spca501 1776:501c Arowana 300K CMOS Camera
|
spca501 1776:501c Arowana 300K CMOS Camera
|
||||||
t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops
|
t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops
|
||||||
vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC
|
vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC
|
||||||
|
|
|
@ -41,6 +41,7 @@ chips are known to work:
|
||||||
- 10c4:818a: Silicon Labs USB FM Radio Reference Design
|
- 10c4:818a: Silicon Labs USB FM Radio Reference Design
|
||||||
- 06e1:a155: ADS/Tech FM Radio Receiver (formerly Instant FM Music) (RDX-155-EF)
|
- 06e1:a155: ADS/Tech FM Radio Receiver (formerly Instant FM Music) (RDX-155-EF)
|
||||||
- 1b80:d700: KWorld USB FM Radio SnapMusic Mobile 700 (FM700)
|
- 1b80:d700: KWorld USB FM Radio SnapMusic Mobile 700 (FM700)
|
||||||
|
- 10c5:819a: DealExtreme USB Radio
|
||||||
|
|
||||||
|
|
||||||
Software
|
Software
|
||||||
|
|
521
Documentation/video4linux/v4l2-framework.txt
Normal file
521
Documentation/video4linux/v4l2-framework.txt
Normal file
|
@ -0,0 +1,521 @@
|
||||||
|
Overview of the V4L2 driver framework
|
||||||
|
=====================================
|
||||||
|
|
||||||
|
This text documents the various structures provided by the V4L2 framework and
|
||||||
|
their relationships.
|
||||||
|
|
||||||
|
|
||||||
|
Introduction
|
||||||
|
------------
|
||||||
|
|
||||||
|
The V4L2 drivers tend to be very complex due to the complexity of the
|
||||||
|
hardware: most devices have multiple ICs, export multiple device nodes in
|
||||||
|
/dev, and create also non-V4L2 devices such as DVB, ALSA, FB, I2C and input
|
||||||
|
(IR) devices.
|
||||||
|
|
||||||
|
Especially the fact that V4L2 drivers have to setup supporting ICs to
|
||||||
|
do audio/video muxing/encoding/decoding makes it more complex than most.
|
||||||
|
Usually these ICs are connected to the main bridge driver through one or
|
||||||
|
more I2C busses, but other busses can also be used. Such devices are
|
||||||
|
called 'sub-devices'.
|
||||||
|
|
||||||
|
For a long time the framework was limited to the video_device struct for
|
||||||
|
creating V4L device nodes and video_buf for handling the video buffers
|
||||||
|
(note that this document does not discuss the video_buf framework).
|
||||||
|
|
||||||
|
This meant that all drivers had to do the setup of device instances and
|
||||||
|
connecting to sub-devices themselves. Some of this is quite complicated
|
||||||
|
to do right and many drivers never did do it correctly.
|
||||||
|
|
||||||
|
There is also a lot of common code that could never be refactored due to
|
||||||
|
the lack of a framework.
|
||||||
|
|
||||||
|
So this framework sets up the basic building blocks that all drivers
|
||||||
|
need and this same framework should make it much easier to refactor
|
||||||
|
common code into utility functions shared by all drivers.
|
||||||
|
|
||||||
|
|
||||||
|
Structure of a driver
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
All drivers have the following structure:
|
||||||
|
|
||||||
|
1) A struct for each device instance containing the device state.
|
||||||
|
|
||||||
|
2) A way of initializing and commanding sub-devices (if any).
|
||||||
|
|
||||||
|
3) Creating V4L2 device nodes (/dev/videoX, /dev/vbiX, /dev/radioX and
|
||||||
|
/dev/vtxX) and keeping track of device-node specific data.
|
||||||
|
|
||||||
|
4) Filehandle-specific structs containing per-filehandle data.
|
||||||
|
|
||||||
|
This is a rough schematic of how it all relates:
|
||||||
|
|
||||||
|
device instances
|
||||||
|
|
|
||||||
|
+-sub-device instances
|
||||||
|
|
|
||||||
|
\-V4L2 device nodes
|
||||||
|
|
|
||||||
|
\-filehandle instances
|
||||||
|
|
||||||
|
|
||||||
|
Structure of the framework
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
The framework closely resembles the driver structure: it has a v4l2_device
|
||||||
|
struct for the device instance data, a v4l2_subdev struct to refer to
|
||||||
|
sub-device instances, the video_device struct stores V4L2 device node data
|
||||||
|
and in the future a v4l2_fh struct will keep track of filehandle instances
|
||||||
|
(this is not yet implemented).
|
||||||
|
|
||||||
|
|
||||||
|
struct v4l2_device
|
||||||
|
------------------
|
||||||
|
|
||||||
|
Each device instance is represented by a struct v4l2_device (v4l2-device.h).
|
||||||
|
Very simple devices can just allocate this struct, but most of the time you
|
||||||
|
would embed this struct inside a larger struct.
|
||||||
|
|
||||||
|
You must register the device instance:
|
||||||
|
|
||||||
|
v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev);
|
||||||
|
|
||||||
|
Registration will initialize the v4l2_device struct and link dev->driver_data
|
||||||
|
to v4l2_dev. Registration will also set v4l2_dev->name to a value derived from
|
||||||
|
dev (driver name followed by the bus_id, to be precise). You may change the
|
||||||
|
name after registration if you want.
|
||||||
|
|
||||||
|
The first 'dev' argument is normally the struct device pointer of a pci_dev,
|
||||||
|
usb_device or platform_device.
|
||||||
|
|
||||||
|
You unregister with:
|
||||||
|
|
||||||
|
v4l2_device_unregister(struct v4l2_device *v4l2_dev);
|
||||||
|
|
||||||
|
Unregistering will also automatically unregister all subdevs from the device.
|
||||||
|
|
||||||
|
Sometimes you need to iterate over all devices registered by a specific
|
||||||
|
driver. This is usually the case if multiple device drivers use the same
|
||||||
|
hardware. E.g. the ivtvfb driver is a framebuffer driver that uses the ivtv
|
||||||
|
hardware. The same is true for alsa drivers for example.
|
||||||
|
|
||||||
|
You can iterate over all registered devices as follows:
|
||||||
|
|
||||||
|
static int callback(struct device *dev, void *p)
|
||||||
|
{
|
||||||
|
struct v4l2_device *v4l2_dev = dev_get_drvdata(dev);
|
||||||
|
|
||||||
|
/* test if this device was inited */
|
||||||
|
if (v4l2_dev == NULL)
|
||||||
|
return 0;
|
||||||
|
...
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int iterate(void *p)
|
||||||
|
{
|
||||||
|
struct device_driver *drv;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
/* Find driver 'ivtv' on the PCI bus.
|
||||||
|
pci_bus_type is a global. For USB busses use usb_bus_type. */
|
||||||
|
drv = driver_find("ivtv", &pci_bus_type);
|
||||||
|
/* iterate over all ivtv device instances */
|
||||||
|
err = driver_for_each_device(drv, NULL, p, callback);
|
||||||
|
put_driver(drv);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
Sometimes you need to keep a running counter of the device instance. This is
|
||||||
|
commonly used to map a device instance to an index of a module option array.
|
||||||
|
|
||||||
|
The recommended approach is as follows:
|
||||||
|
|
||||||
|
static atomic_t drv_instance = ATOMIC_INIT(0);
|
||||||
|
|
||||||
|
static int __devinit drv_probe(struct pci_dev *dev,
|
||||||
|
const struct pci_device_id *pci_id)
|
||||||
|
{
|
||||||
|
...
|
||||||
|
state->instance = atomic_inc_return(&drv_instance) - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct v4l2_subdev
|
||||||
|
------------------
|
||||||
|
|
||||||
|
Many drivers need to communicate with sub-devices. These devices can do all
|
||||||
|
sort of tasks, but most commonly they handle audio and/or video muxing,
|
||||||
|
encoding or decoding. For webcams common sub-devices are sensors and camera
|
||||||
|
controllers.
|
||||||
|
|
||||||
|
Usually these are I2C devices, but not necessarily. In order to provide the
|
||||||
|
driver with a consistent interface to these sub-devices the v4l2_subdev struct
|
||||||
|
(v4l2-subdev.h) was created.
|
||||||
|
|
||||||
|
Each sub-device driver must have a v4l2_subdev struct. This struct can be
|
||||||
|
stand-alone for simple sub-devices or it might be embedded in a larger struct
|
||||||
|
if more state information needs to be stored. Usually there is a low-level
|
||||||
|
device struct (e.g. i2c_client) that contains the device data as setup
|
||||||
|
by the kernel. It is recommended to store that pointer in the private
|
||||||
|
data of v4l2_subdev using v4l2_set_subdevdata(). That makes it easy to go
|
||||||
|
from a v4l2_subdev to the actual low-level bus-specific device data.
|
||||||
|
|
||||||
|
You also need a way to go from the low-level struct to v4l2_subdev. For the
|
||||||
|
common i2c_client struct the i2c_set_clientdata() call is used to store a
|
||||||
|
v4l2_subdev pointer, for other busses you may have to use other methods.
|
||||||
|
|
||||||
|
From the bridge driver perspective you load the sub-device module and somehow
|
||||||
|
obtain the v4l2_subdev pointer. For i2c devices this is easy: you call
|
||||||
|
i2c_get_clientdata(). For other busses something similar needs to be done.
|
||||||
|
Helper functions exists for sub-devices on an I2C bus that do most of this
|
||||||
|
tricky work for you.
|
||||||
|
|
||||||
|
Each v4l2_subdev contains function pointers that sub-device drivers can
|
||||||
|
implement (or leave NULL if it is not applicable). Since sub-devices can do
|
||||||
|
so many different things and you do not want to end up with a huge ops struct
|
||||||
|
of which only a handful of ops are commonly implemented, the function pointers
|
||||||
|
are sorted according to category and each category has its own ops struct.
|
||||||
|
|
||||||
|
The top-level ops struct contains pointers to the category ops structs, which
|
||||||
|
may be NULL if the subdev driver does not support anything from that category.
|
||||||
|
|
||||||
|
It looks like this:
|
||||||
|
|
||||||
|
struct v4l2_subdev_core_ops {
|
||||||
|
int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
|
||||||
|
int (*log_status)(struct v4l2_subdev *sd);
|
||||||
|
int (*init)(struct v4l2_subdev *sd, u32 val);
|
||||||
|
...
|
||||||
|
};
|
||||||
|
|
||||||
|
struct v4l2_subdev_tuner_ops {
|
||||||
|
...
|
||||||
|
};
|
||||||
|
|
||||||
|
struct v4l2_subdev_audio_ops {
|
||||||
|
...
|
||||||
|
};
|
||||||
|
|
||||||
|
struct v4l2_subdev_video_ops {
|
||||||
|
...
|
||||||
|
};
|
||||||
|
|
||||||
|
struct v4l2_subdev_ops {
|
||||||
|
const struct v4l2_subdev_core_ops *core;
|
||||||
|
const struct v4l2_subdev_tuner_ops *tuner;
|
||||||
|
const struct v4l2_subdev_audio_ops *audio;
|
||||||
|
const struct v4l2_subdev_video_ops *video;
|
||||||
|
};
|
||||||
|
|
||||||
|
The core ops are common to all subdevs, the other categories are implemented
|
||||||
|
depending on the sub-device. E.g. a video device is unlikely to support the
|
||||||
|
audio ops and vice versa.
|
||||||
|
|
||||||
|
This setup limits the number of function pointers while still making it easy
|
||||||
|
to add new ops and categories.
|
||||||
|
|
||||||
|
A sub-device driver initializes the v4l2_subdev struct using:
|
||||||
|
|
||||||
|
v4l2_subdev_init(subdev, &ops);
|
||||||
|
|
||||||
|
Afterwards you need to initialize subdev->name with a unique name and set the
|
||||||
|
module owner. This is done for you if you use the i2c helper functions.
|
||||||
|
|
||||||
|
A device (bridge) driver needs to register the v4l2_subdev with the
|
||||||
|
v4l2_device:
|
||||||
|
|
||||||
|
int err = v4l2_device_register_subdev(device, subdev);
|
||||||
|
|
||||||
|
This can fail if the subdev module disappeared before it could be registered.
|
||||||
|
After this function was called successfully the subdev->dev field points to
|
||||||
|
the v4l2_device.
|
||||||
|
|
||||||
|
You can unregister a sub-device using:
|
||||||
|
|
||||||
|
v4l2_device_unregister_subdev(subdev);
|
||||||
|
|
||||||
|
Afterwards the subdev module can be unloaded and subdev->dev == NULL.
|
||||||
|
|
||||||
|
You can call an ops function either directly:
|
||||||
|
|
||||||
|
err = subdev->ops->core->g_chip_ident(subdev, &chip);
|
||||||
|
|
||||||
|
but it is better and easier to use this macro:
|
||||||
|
|
||||||
|
err = v4l2_subdev_call(subdev, core, g_chip_ident, &chip);
|
||||||
|
|
||||||
|
The macro will to the right NULL pointer checks and returns -ENODEV if subdev
|
||||||
|
is NULL, -ENOIOCTLCMD if either subdev->core or subdev->core->g_chip_ident is
|
||||||
|
NULL, or the actual result of the subdev->ops->core->g_chip_ident ops.
|
||||||
|
|
||||||
|
It is also possible to call all or a subset of the sub-devices:
|
||||||
|
|
||||||
|
v4l2_device_call_all(dev, 0, core, g_chip_ident, &chip);
|
||||||
|
|
||||||
|
Any subdev that does not support this ops is skipped and error results are
|
||||||
|
ignored. If you want to check for errors use this:
|
||||||
|
|
||||||
|
err = v4l2_device_call_until_err(dev, 0, core, g_chip_ident, &chip);
|
||||||
|
|
||||||
|
Any error except -ENOIOCTLCMD will exit the loop with that error. If no
|
||||||
|
errors (except -ENOIOCTLCMD) occured, then 0 is returned.
|
||||||
|
|
||||||
|
The second argument to both calls is a group ID. If 0, then all subdevs are
|
||||||
|
called. If non-zero, then only those whose group ID match that value will
|
||||||
|
be called. Before a bridge driver registers a subdev it can set subdev->grp_id
|
||||||
|
to whatever value it wants (it's 0 by default). This value is owned by the
|
||||||
|
bridge driver and the sub-device driver will never modify or use it.
|
||||||
|
|
||||||
|
The group ID gives the bridge driver more control how callbacks are called.
|
||||||
|
For example, there may be multiple audio chips on a board, each capable of
|
||||||
|
changing the volume. But usually only one will actually be used when the
|
||||||
|
user want to change the volume. You can set the group ID for that subdev to
|
||||||
|
e.g. AUDIO_CONTROLLER and specify that as the group ID value when calling
|
||||||
|
v4l2_device_call_all(). That ensures that it will only go to the subdev
|
||||||
|
that needs it.
|
||||||
|
|
||||||
|
The advantage of using v4l2_subdev is that it is a generic struct and does
|
||||||
|
not contain any knowledge about the underlying hardware. So a driver might
|
||||||
|
contain several subdevs that use an I2C bus, but also a subdev that is
|
||||||
|
controlled through GPIO pins. This distinction is only relevant when setting
|
||||||
|
up the device, but once the subdev is registered it is completely transparent.
|
||||||
|
|
||||||
|
|
||||||
|
I2C sub-device drivers
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
Since these drivers are so common, special helper functions are available to
|
||||||
|
ease the use of these drivers (v4l2-common.h).
|
||||||
|
|
||||||
|
The recommended method of adding v4l2_subdev support to an I2C driver is to
|
||||||
|
embed the v4l2_subdev struct into the state struct that is created for each
|
||||||
|
I2C device instance. Very simple devices have no state struct and in that case
|
||||||
|
you can just create a v4l2_subdev directly.
|
||||||
|
|
||||||
|
A typical state struct would look like this (where 'chipname' is replaced by
|
||||||
|
the name of the chip):
|
||||||
|
|
||||||
|
struct chipname_state {
|
||||||
|
struct v4l2_subdev sd;
|
||||||
|
... /* additional state fields */
|
||||||
|
};
|
||||||
|
|
||||||
|
Initialize the v4l2_subdev struct as follows:
|
||||||
|
|
||||||
|
v4l2_i2c_subdev_init(&state->sd, client, subdev_ops);
|
||||||
|
|
||||||
|
This function will fill in all the fields of v4l2_subdev and ensure that the
|
||||||
|
v4l2_subdev and i2c_client both point to one another.
|
||||||
|
|
||||||
|
You should also add a helper inline function to go from a v4l2_subdev pointer
|
||||||
|
to a chipname_state struct:
|
||||||
|
|
||||||
|
static inline struct chipname_state *to_state(struct v4l2_subdev *sd)
|
||||||
|
{
|
||||||
|
return container_of(sd, struct chipname_state, sd);
|
||||||
|
}
|
||||||
|
|
||||||
|
Use this to go from the v4l2_subdev struct to the i2c_client struct:
|
||||||
|
|
||||||
|
struct i2c_client *client = v4l2_get_subdevdata(sd);
|
||||||
|
|
||||||
|
And this to go from an i2c_client to a v4l2_subdev struct:
|
||||||
|
|
||||||
|
struct v4l2_subdev *sd = i2c_get_clientdata(client);
|
||||||
|
|
||||||
|
Finally you need to make a command function to make driver->command()
|
||||||
|
call the right subdev_ops functions:
|
||||||
|
|
||||||
|
static int subdev_command(struct i2c_client *client, unsigned cmd, void *arg)
|
||||||
|
{
|
||||||
|
return v4l2_subdev_command(i2c_get_clientdata(client), cmd, arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
If driver->command is never used then you can leave this out. Eventually the
|
||||||
|
driver->command usage should be removed from v4l.
|
||||||
|
|
||||||
|
Make sure to call v4l2_device_unregister_subdev(sd) when the remove() callback
|
||||||
|
is called. This will unregister the sub-device from the bridge driver. It is
|
||||||
|
safe to call this even if the sub-device was never registered.
|
||||||
|
|
||||||
|
|
||||||
|
The bridge driver also has some helper functions it can use:
|
||||||
|
|
||||||
|
struct v4l2_subdev *sd = v4l2_i2c_new_subdev(adapter, "module_foo", "chipid", 0x36);
|
||||||
|
|
||||||
|
This loads the given module (can be NULL if no module needs to be loaded) and
|
||||||
|
calls i2c_new_device() with the given i2c_adapter and chip/address arguments.
|
||||||
|
If all goes well, then it registers the subdev with the v4l2_device. It gets
|
||||||
|
the v4l2_device by calling i2c_get_adapdata(adapter), so you should make sure
|
||||||
|
that adapdata is set to v4l2_device when you setup the i2c_adapter in your
|
||||||
|
driver.
|
||||||
|
|
||||||
|
You can also use v4l2_i2c_new_probed_subdev() which is very similar to
|
||||||
|
v4l2_i2c_new_subdev(), except that it has an array of possible I2C addresses
|
||||||
|
that it should probe. Internally it calls i2c_new_probed_device().
|
||||||
|
|
||||||
|
Both functions return NULL if something went wrong.
|
||||||
|
|
||||||
|
|
||||||
|
struct video_device
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
The actual device nodes in the /dev directory are created using the
|
||||||
|
video_device struct (v4l2-dev.h). This struct can either be allocated
|
||||||
|
dynamically or embedded in a larger struct.
|
||||||
|
|
||||||
|
To allocate it dynamically use:
|
||||||
|
|
||||||
|
struct video_device *vdev = video_device_alloc();
|
||||||
|
|
||||||
|
if (vdev == NULL)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
vdev->release = video_device_release;
|
||||||
|
|
||||||
|
If you embed it in a larger struct, then you must set the release()
|
||||||
|
callback to your own function:
|
||||||
|
|
||||||
|
struct video_device *vdev = &my_vdev->vdev;
|
||||||
|
|
||||||
|
vdev->release = my_vdev_release;
|
||||||
|
|
||||||
|
The release callback must be set and it is called when the last user
|
||||||
|
of the video device exits.
|
||||||
|
|
||||||
|
The default video_device_release() callback just calls kfree to free the
|
||||||
|
allocated memory.
|
||||||
|
|
||||||
|
You should also set these fields:
|
||||||
|
|
||||||
|
- v4l2_dev: set to the v4l2_device parent device.
|
||||||
|
- name: set to something descriptive and unique.
|
||||||
|
- fops: set to the v4l2_file_operations struct.
|
||||||
|
- ioctl_ops: if you use the v4l2_ioctl_ops to simplify ioctl maintenance
|
||||||
|
(highly recommended to use this and it might become compulsory in the
|
||||||
|
future!), then set this to your v4l2_ioctl_ops struct.
|
||||||
|
|
||||||
|
If you use v4l2_ioctl_ops, then you should set either .unlocked_ioctl or
|
||||||
|
.ioctl to video_ioctl2 in your v4l2_file_operations struct.
|
||||||
|
|
||||||
|
The v4l2_file_operations struct is a subset of file_operations. The main
|
||||||
|
difference is that the inode argument is omitted since it is never used.
|
||||||
|
|
||||||
|
|
||||||
|
video_device registration
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
Next you register the video device: this will create the character device
|
||||||
|
for you.
|
||||||
|
|
||||||
|
err = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
|
||||||
|
if (err) {
|
||||||
|
video_device_release(vdev); /* or kfree(my_vdev); */
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
Which device is registered depends on the type argument. The following
|
||||||
|
types exist:
|
||||||
|
|
||||||
|
VFL_TYPE_GRABBER: videoX for video input/output devices
|
||||||
|
VFL_TYPE_VBI: vbiX for vertical blank data (i.e. closed captions, teletext)
|
||||||
|
VFL_TYPE_RADIO: radioX for radio tuners
|
||||||
|
VFL_TYPE_VTX: vtxX for teletext devices (deprecated, don't use)
|
||||||
|
|
||||||
|
The last argument gives you a certain amount of control over the device
|
||||||
|
kernel number used (i.e. the X in videoX). Normally you will pass -1 to
|
||||||
|
let the v4l2 framework pick the first free number. But if a driver creates
|
||||||
|
many devices, then it can be useful to have different video devices in
|
||||||
|
separate ranges. For example, video capture devices start at 0, video
|
||||||
|
output devices start at 16.
|
||||||
|
|
||||||
|
So you can use the last argument to specify a minimum kernel number and
|
||||||
|
the v4l2 framework will try to pick the first free number that is equal
|
||||||
|
or higher to what you passed. If that fails, then it will just pick the
|
||||||
|
first free number.
|
||||||
|
|
||||||
|
Whenever a device node is created some attributes are also created for you.
|
||||||
|
If you look in /sys/class/video4linux you see the devices. Go into e.g.
|
||||||
|
video0 and you will see 'name' and 'index' attributes. The 'name' attribute
|
||||||
|
is the 'name' field of the video_device struct. The 'index' attribute is
|
||||||
|
a device node index that can be assigned by the driver, or that is calculated
|
||||||
|
for you.
|
||||||
|
|
||||||
|
If you call video_register_device(), then the index is just increased by
|
||||||
|
1 for each device node you register. The first video device node you register
|
||||||
|
always starts off with 0.
|
||||||
|
|
||||||
|
Alternatively you can call video_register_device_index() which is identical
|
||||||
|
to video_register_device(), but with an extra index argument. Here you can
|
||||||
|
pass a specific index value (between 0 and 31) that should be used.
|
||||||
|
|
||||||
|
Users can setup udev rules that utilize the index attribute to make fancy
|
||||||
|
device names (e.g. 'mpegX' for MPEG video capture device nodes).
|
||||||
|
|
||||||
|
After the device was successfully registered, then you can use these fields:
|
||||||
|
|
||||||
|
- vfl_type: the device type passed to video_register_device.
|
||||||
|
- minor: the assigned device minor number.
|
||||||
|
- num: the device kernel number (i.e. the X in videoX).
|
||||||
|
- index: the device index number (calculated or set explicitly using
|
||||||
|
video_register_device_index).
|
||||||
|
|
||||||
|
If the registration failed, then you need to call video_device_release()
|
||||||
|
to free the allocated video_device struct, or free your own struct if the
|
||||||
|
video_device was embedded in it. The vdev->release() callback will never
|
||||||
|
be called if the registration failed, nor should you ever attempt to
|
||||||
|
unregister the device if the registration failed.
|
||||||
|
|
||||||
|
|
||||||
|
video_device cleanup
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
When the video device nodes have to be removed, either during the unload
|
||||||
|
of the driver or because the USB device was disconnected, then you should
|
||||||
|
unregister them:
|
||||||
|
|
||||||
|
video_unregister_device(vdev);
|
||||||
|
|
||||||
|
This will remove the device nodes from sysfs (causing udev to remove them
|
||||||
|
from /dev).
|
||||||
|
|
||||||
|
After video_unregister_device() returns no new opens can be done.
|
||||||
|
|
||||||
|
However, in the case of USB devices some application might still have one
|
||||||
|
of these device nodes open. You should block all new accesses to read,
|
||||||
|
write, poll, etc. except possibly for certain ioctl operations like
|
||||||
|
queueing buffers.
|
||||||
|
|
||||||
|
When the last user of the video device node exits, then the vdev->release()
|
||||||
|
callback is called and you can do the final cleanup there.
|
||||||
|
|
||||||
|
|
||||||
|
video_device helper functions
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
There are a few useful helper functions:
|
||||||
|
|
||||||
|
You can set/get driver private data in the video_device struct using:
|
||||||
|
|
||||||
|
void *video_get_drvdata(struct video_device *dev);
|
||||||
|
void video_set_drvdata(struct video_device *dev, void *data);
|
||||||
|
|
||||||
|
Note that you can safely call video_set_drvdata() before calling
|
||||||
|
video_register_device().
|
||||||
|
|
||||||
|
And this function:
|
||||||
|
|
||||||
|
struct video_device *video_devdata(struct file *file);
|
||||||
|
|
||||||
|
returns the video_device belonging to the file struct.
|
||||||
|
|
||||||
|
The final helper function combines video_get_drvdata with
|
||||||
|
video_devdata:
|
||||||
|
|
||||||
|
void *video_drvdata(struct file *file);
|
||||||
|
|
||||||
|
You can go from a video_device struct to the v4l2_device struct using:
|
||||||
|
|
||||||
|
struct v4l2_device *v4l2_dev = vdev->v4l2_dev;
|
|
@ -137,13 +137,6 @@ shrink_page_list() where they will be detected when vmscan walks the reverse
|
||||||
map in try_to_unmap(). If try_to_unmap() returns SWAP_MLOCK, shrink_page_list()
|
map in try_to_unmap(). If try_to_unmap() returns SWAP_MLOCK, shrink_page_list()
|
||||||
will cull the page at that point.
|
will cull the page at that point.
|
||||||
|
|
||||||
Note that for anonymous pages, shrink_page_list() attempts to add the page to
|
|
||||||
the swap cache before it tries to unmap the page. To avoid this unnecessary
|
|
||||||
consumption of swap space, shrink_page_list() calls try_to_munlock() to check
|
|
||||||
whether any VM_LOCKED vmas map the page without attempting to unmap the page.
|
|
||||||
If try_to_munlock() returns SWAP_MLOCK, shrink_page_list() will cull the page
|
|
||||||
without consuming swap space. try_to_munlock() will be described below.
|
|
||||||
|
|
||||||
To "cull" an unevictable page, vmscan simply puts the page back on the lru
|
To "cull" an unevictable page, vmscan simply puts the page back on the lru
|
||||||
list using putback_lru_page()--the inverse operation to isolate_lru_page()--
|
list using putback_lru_page()--the inverse operation to isolate_lru_page()--
|
||||||
after dropping the page lock. Because the condition which makes the page
|
after dropping the page lock. Because the condition which makes the page
|
||||||
|
@ -190,8 +183,8 @@ several places:
|
||||||
in the VM_LOCKED flag being set for the vma.
|
in the VM_LOCKED flag being set for the vma.
|
||||||
3) in the fault path, if mlocked pages are "culled" in the fault path,
|
3) in the fault path, if mlocked pages are "culled" in the fault path,
|
||||||
and when a VM_LOCKED stack segment is expanded.
|
and when a VM_LOCKED stack segment is expanded.
|
||||||
4) as mentioned above, in vmscan:shrink_page_list() with attempting to
|
4) as mentioned above, in vmscan:shrink_page_list() when attempting to
|
||||||
reclaim a page in a VM_LOCKED vma--via try_to_unmap() or try_to_munlock().
|
reclaim a page in a VM_LOCKED vma via try_to_unmap().
|
||||||
|
|
||||||
Mlocked pages become unlocked and rescued from the unevictable list when:
|
Mlocked pages become unlocked and rescued from the unevictable list when:
|
||||||
|
|
||||||
|
@ -260,9 +253,9 @@ mlock_fixup() filters several classes of "special" vmas:
|
||||||
|
|
||||||
2) vmas mapping hugetlbfs page are already effectively pinned into memory.
|
2) vmas mapping hugetlbfs page are already effectively pinned into memory.
|
||||||
We don't need nor want to mlock() these pages. However, to preserve the
|
We don't need nor want to mlock() these pages. However, to preserve the
|
||||||
prior behavior of mlock()--before the unevictable/mlock changes--mlock_fixup()
|
prior behavior of mlock()--before the unevictable/mlock changes--
|
||||||
will call make_pages_present() in the hugetlbfs vma range to allocate the
|
mlock_fixup() will call make_pages_present() in the hugetlbfs vma range
|
||||||
huge pages and populate the ptes.
|
to allocate the huge pages and populate the ptes.
|
||||||
|
|
||||||
3) vmas with VM_DONTEXPAND|VM_RESERVED are generally user space mappings of
|
3) vmas with VM_DONTEXPAND|VM_RESERVED are generally user space mappings of
|
||||||
kernel pages, such as the vdso page, relay channel pages, etc. These pages
|
kernel pages, such as the vdso page, relay channel pages, etc. These pages
|
||||||
|
@ -322,7 +315,7 @@ __mlock_vma_pages_range()--the same function used to mlock a vma range--
|
||||||
passing a flag to indicate that munlock() is being performed.
|
passing a flag to indicate that munlock() is being performed.
|
||||||
|
|
||||||
Because the vma access protections could have been changed to PROT_NONE after
|
Because the vma access protections could have been changed to PROT_NONE after
|
||||||
faulting in and mlocking some pages, get_user_pages() was unreliable for visiting
|
faulting in and mlocking pages, get_user_pages() was unreliable for visiting
|
||||||
these pages for munlocking. Because we don't want to leave pages mlocked(),
|
these pages for munlocking. Because we don't want to leave pages mlocked(),
|
||||||
get_user_pages() was enhanced to accept a flag to ignore the permissions when
|
get_user_pages() was enhanced to accept a flag to ignore the permissions when
|
||||||
fetching the pages--all of which should be resident as a result of previous
|
fetching the pages--all of which should be resident as a result of previous
|
||||||
|
@ -416,8 +409,8 @@ Mlocked Pages: munmap()/exit()/exec() System Call Handling
|
||||||
When unmapping an mlocked region of memory, whether by an explicit call to
|
When unmapping an mlocked region of memory, whether by an explicit call to
|
||||||
munmap() or via an internal unmap from exit() or exec() processing, we must
|
munmap() or via an internal unmap from exit() or exec() processing, we must
|
||||||
munlock the pages if we're removing the last VM_LOCKED vma that maps the pages.
|
munlock the pages if we're removing the last VM_LOCKED vma that maps the pages.
|
||||||
Before the unevictable/mlock changes, mlocking did not mark the pages in any way,
|
Before the unevictable/mlock changes, mlocking did not mark the pages in any
|
||||||
so unmapping them required no processing.
|
way, so unmapping them required no processing.
|
||||||
|
|
||||||
To munlock a range of memory under the unevictable/mlock infrastructure, the
|
To munlock a range of memory under the unevictable/mlock infrastructure, the
|
||||||
munmap() hander and task address space tear down function call
|
munmap() hander and task address space tear down function call
|
||||||
|
@ -517,12 +510,10 @@ couldn't be mlocked.
|
||||||
Mlocked pages: try_to_munlock() Reverse Map Scan
|
Mlocked pages: try_to_munlock() Reverse Map Scan
|
||||||
|
|
||||||
TODO/FIXME: a better name might be page_mlocked()--analogous to the
|
TODO/FIXME: a better name might be page_mlocked()--analogous to the
|
||||||
page_referenced() reverse map walker--especially if we continue to call this
|
page_referenced() reverse map walker.
|
||||||
from shrink_page_list(). See related TODO/FIXME below.
|
|
||||||
|
|
||||||
When munlock_vma_page()--see "Mlocked Pages: munlock()/munlockall() System
|
When munlock_vma_page()--see "Mlocked Pages: munlock()/munlockall()
|
||||||
Call Handling" above--tries to munlock a page, or when shrink_page_list()
|
System Call Handling" above--tries to munlock a page, it needs to
|
||||||
encounters an anonymous page that is not yet in the swap cache, they need to
|
|
||||||
determine whether or not the page is mapped by any VM_LOCKED vma, without
|
determine whether or not the page is mapped by any VM_LOCKED vma, without
|
||||||
actually attempting to unmap all ptes from the page. For this purpose, the
|
actually attempting to unmap all ptes from the page. For this purpose, the
|
||||||
unevictable/mlock infrastructure introduced a variant of try_to_unmap() called
|
unevictable/mlock infrastructure introduced a variant of try_to_unmap() called
|
||||||
|
@ -535,10 +526,7 @@ for VM_LOCKED vmas. When such a vma is found for anonymous pages and file
|
||||||
pages mapped in linear VMAs, as in the try_to_unmap() case, the functions
|
pages mapped in linear VMAs, as in the try_to_unmap() case, the functions
|
||||||
attempt to acquire the associated mmap semphore, mlock the page via
|
attempt to acquire the associated mmap semphore, mlock the page via
|
||||||
mlock_vma_page() and return SWAP_MLOCK. This effectively undoes the
|
mlock_vma_page() and return SWAP_MLOCK. This effectively undoes the
|
||||||
pre-clearing of the page's PG_mlocked done by munlock_vma_page() and informs
|
pre-clearing of the page's PG_mlocked done by munlock_vma_page.
|
||||||
shrink_page_list() that the anonymous page should be culled rather than added
|
|
||||||
to the swap cache in preparation for a try_to_unmap() that will almost
|
|
||||||
certainly fail.
|
|
||||||
|
|
||||||
If try_to_unmap() is unable to acquire a VM_LOCKED vma's associated mmap
|
If try_to_unmap() is unable to acquire a VM_LOCKED vma's associated mmap
|
||||||
semaphore, it will return SWAP_AGAIN. This will allow shrink_page_list()
|
semaphore, it will return SWAP_AGAIN. This will allow shrink_page_list()
|
||||||
|
@ -557,10 +545,7 @@ However, the scan can terminate when it encounters a VM_LOCKED vma and can
|
||||||
successfully acquire the vma's mmap semphore for read and mlock the page.
|
successfully acquire the vma's mmap semphore for read and mlock the page.
|
||||||
Although try_to_munlock() can be called many [very many!] times when
|
Although try_to_munlock() can be called many [very many!] times when
|
||||||
munlock()ing a large region or tearing down a large address space that has been
|
munlock()ing a large region or tearing down a large address space that has been
|
||||||
mlocked via mlockall(), overall this is a fairly rare event. In addition,
|
mlocked via mlockall(), overall this is a fairly rare event.
|
||||||
although shrink_page_list() calls try_to_munlock() for every anonymous page that
|
|
||||||
it handles that is not yet in the swap cache, on average anonymous pages will
|
|
||||||
have very short reverse map lists.
|
|
||||||
|
|
||||||
Mlocked Page: Page Reclaim in shrink_*_list()
|
Mlocked Page: Page Reclaim in shrink_*_list()
|
||||||
|
|
||||||
|
@ -588,8 +573,8 @@ Some examples of these unevictable pages on the LRU lists are:
|
||||||
munlock_vma_page() was forced to let the page back on to the normal
|
munlock_vma_page() was forced to let the page back on to the normal
|
||||||
LRU list for vmscan to handle.
|
LRU list for vmscan to handle.
|
||||||
|
|
||||||
shrink_inactive_list() also culls any unevictable pages that it finds
|
shrink_inactive_list() also culls any unevictable pages that it finds on
|
||||||
on the inactive lists, again diverting them to the appropriate zone's unevictable
|
the inactive lists, again diverting them to the appropriate zone's unevictable
|
||||||
lru list. shrink_inactive_list() should only see SHM_LOCKed pages that became
|
lru list. shrink_inactive_list() should only see SHM_LOCKed pages that became
|
||||||
SHM_LOCKed after shrink_active_list() had moved them to the inactive list, or
|
SHM_LOCKed after shrink_active_list() had moved them to the inactive list, or
|
||||||
pages mapped into VM_LOCKED vmas that munlock_vma_page() couldn't isolate from
|
pages mapped into VM_LOCKED vmas that munlock_vma_page() couldn't isolate from
|
||||||
|
@ -597,19 +582,7 @@ the lru to recheck via try_to_munlock(). shrink_inactive_list() won't notice
|
||||||
the latter, but will pass on to shrink_page_list().
|
the latter, but will pass on to shrink_page_list().
|
||||||
|
|
||||||
shrink_page_list() again culls obviously unevictable pages that it could
|
shrink_page_list() again culls obviously unevictable pages that it could
|
||||||
encounter for similar reason to shrink_inactive_list(). As already discussed,
|
encounter for similar reason to shrink_inactive_list(). Pages mapped into
|
||||||
shrink_page_list() proactively looks for anonymous pages that should have
|
|
||||||
PG_mlocked set but don't--these would not be detected by page_evictable()--to
|
|
||||||
avoid adding them to the swap cache unnecessarily. File pages mapped into
|
|
||||||
VM_LOCKED vmas but without PG_mlocked set will make it all the way to
|
VM_LOCKED vmas but without PG_mlocked set will make it all the way to
|
||||||
try_to_unmap(). shrink_page_list() will divert them to the unevictable list when
|
try_to_unmap(). shrink_page_list() will divert them to the unevictable list
|
||||||
try_to_unmap() returns SWAP_MLOCK, as discussed above.
|
when try_to_unmap() returns SWAP_MLOCK, as discussed above.
|
||||||
|
|
||||||
TODO/FIXME: If we can enhance the swap cache to reliably remove entries
|
|
||||||
with page_count(page) > 2, as long as all ptes are mapped to the page and
|
|
||||||
not the swap entry, we can probably remove the call to try_to_munlock() in
|
|
||||||
shrink_page_list() and just remove the page from the swap cache when
|
|
||||||
try_to_unmap() returns SWAP_MLOCK. Currently, remove_exclusive_swap_page()
|
|
||||||
doesn't seem to allow that.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,5 +4,7 @@ ds2482
|
||||||
- The Maxim/Dallas Semiconductor DS2482 provides 1-wire busses.
|
- The Maxim/Dallas Semiconductor DS2482 provides 1-wire busses.
|
||||||
ds2490
|
ds2490
|
||||||
- The Maxim/Dallas Semiconductor DS2490 builds USB <-> W1 bridges.
|
- The Maxim/Dallas Semiconductor DS2490 builds USB <-> W1 bridges.
|
||||||
|
mxc_w1
|
||||||
|
- W1 master controller driver found on Freescale MX2/MX3 SoCs
|
||||||
w1-gpio
|
w1-gpio
|
||||||
- GPIO 1-wire bus master driver.
|
- GPIO 1-wire bus master driver.
|
||||||
|
|
11
Documentation/w1/masters/mxc-w1
Normal file
11
Documentation/w1/masters/mxc-w1
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
Kernel driver mxc_w1
|
||||||
|
====================
|
||||||
|
|
||||||
|
Supported chips:
|
||||||
|
* Freescale MX27, MX31 and probably other i.MX SoCs
|
||||||
|
Datasheets:
|
||||||
|
http://www.freescale.com/files/32bit/doc/data_sheet/MCIMX31.pdf?fpsp=1
|
||||||
|
http://www.freescale.com/files/dsp/MCIMX27.pdf?fpsp=1
|
||||||
|
|
||||||
|
Author: Originally based on Freescale code, prepared for mainline by
|
||||||
|
Sascha Hauer <s.hauer@pengutronix.de>
|
|
@ -5,69 +5,157 @@ Message types.
|
||||||
=============
|
=============
|
||||||
|
|
||||||
There are three types of messages between w1 core and userspace:
|
There are three types of messages between w1 core and userspace:
|
||||||
1. Events. They are generated each time new master or slave device found
|
1. Events. They are generated each time new master or slave device
|
||||||
either due to automatic or requested search.
|
found either due to automatic or requested search.
|
||||||
2. Userspace commands. Includes read/write and search/alarm search comamnds.
|
2. Userspace commands.
|
||||||
3. Replies to userspace commands.
|
3. Replies to userspace commands.
|
||||||
|
|
||||||
|
|
||||||
Protocol.
|
Protocol.
|
||||||
========
|
========
|
||||||
|
|
||||||
[struct cn_msg] - connector header. It's length field is equal to size of the attached data.
|
[struct cn_msg] - connector header.
|
||||||
|
Its length field is equal to size of the attached data
|
||||||
[struct w1_netlink_msg] - w1 netlink header.
|
[struct w1_netlink_msg] - w1 netlink header.
|
||||||
__u8 type - message type.
|
__u8 type - message type.
|
||||||
W1_SLAVE_ADD/W1_SLAVE_REMOVE - slave add/remove events.
|
W1_LIST_MASTERS
|
||||||
W1_MASTER_ADD/W1_MASTER_REMOVE - master add/remove events.
|
list current bus masters
|
||||||
W1_MASTER_CMD - userspace command for bus master device (search/alarm search).
|
W1_SLAVE_ADD/W1_SLAVE_REMOVE
|
||||||
W1_SLAVE_CMD - userspace command for slave device (read/write/ search/alarm search
|
slave add/remove events
|
||||||
for bus master device where given slave device found).
|
W1_MASTER_ADD/W1_MASTER_REMOVE
|
||||||
|
master add/remove events
|
||||||
|
W1_MASTER_CMD
|
||||||
|
userspace command for bus master
|
||||||
|
device (search/alarm search)
|
||||||
|
W1_SLAVE_CMD
|
||||||
|
userspace command for slave device
|
||||||
|
(read/write/touch)
|
||||||
__u8 res - reserved
|
__u8 res - reserved
|
||||||
__u16 len - size of attached to this header data.
|
__u16 len - size of data attached to this header data
|
||||||
union {
|
union {
|
||||||
__u8 id; - slave unique device id
|
__u8 id[8]; - slave unique device id
|
||||||
struct w1_mst {
|
struct w1_mst {
|
||||||
__u32 id; - master's id.
|
__u32 id; - master's id
|
||||||
__u32 res; - reserved
|
__u32 res; - reserved
|
||||||
} mst;
|
} mst;
|
||||||
} id;
|
} id;
|
||||||
|
|
||||||
[strucrt w1_netlink_cmd] - command for gived master or slave device.
|
[struct w1_netlink_cmd] - command for given master or slave device.
|
||||||
__u8 cmd - command opcode.
|
__u8 cmd - command opcode.
|
||||||
W1_CMD_READ - read command.
|
W1_CMD_READ - read command
|
||||||
W1_CMD_WRITE - write command.
|
W1_CMD_WRITE - write command
|
||||||
W1_CMD_SEARCH - search command.
|
W1_CMD_TOUCH - touch command
|
||||||
W1_CMD_ALARM_SEARCH - alarm search command.
|
(write and sample data back to userspace)
|
||||||
|
W1_CMD_SEARCH - search command
|
||||||
|
W1_CMD_ALARM_SEARCH - alarm search command
|
||||||
__u8 res - reserved
|
__u8 res - reserved
|
||||||
__u16 len - length of data for this command.
|
__u16 len - length of data for this command
|
||||||
For read command data must be allocated like for write command.
|
For read command data must be allocated like for write command
|
||||||
__u8 data[0] - data for this command.
|
__u8 data[0] - data for this command
|
||||||
|
|
||||||
|
|
||||||
Each connector message can include one or more w1_netlink_msg with zero of more attached w1_netlink_cmd messages.
|
Each connector message can include one or more w1_netlink_msg with
|
||||||
|
zero or more attached w1_netlink_cmd messages.
|
||||||
|
|
||||||
For event messages there are no w1_netlink_cmd embedded structures, only connector header
|
For event messages there are no w1_netlink_cmd embedded structures,
|
||||||
and w1_netlink_msg strucutre with "len" field being zero and filled type (one of event types)
|
only connector header and w1_netlink_msg strucutre with "len" field
|
||||||
and id - either 8 bytes of slave unique id in host order, or master's id, which is assigned
|
being zero and filled type (one of event types) and id:
|
||||||
to bus master device when it is added to w1 core.
|
either 8 bytes of slave unique id in host order,
|
||||||
|
or master's id, which is assigned to bus master device
|
||||||
|
when it is added to w1 core.
|
||||||
|
|
||||||
|
Currently replies to userspace commands are only generated for read
|
||||||
|
command request. One reply is generated exactly for one w1_netlink_cmd
|
||||||
|
read request. Replies are not combined when sent - i.e. typical reply
|
||||||
|
messages looks like the following:
|
||||||
|
|
||||||
Currently replies to userspace commands are only generated for read command request.
|
|
||||||
One reply is generated exactly for one w1_netlink_cmd read request.
|
|
||||||
Replies are not combined when sent - i.e. typical reply messages looks like the following:
|
|
||||||
[cn_msg][w1_netlink_msg][w1_netlink_cmd]
|
[cn_msg][w1_netlink_msg][w1_netlink_cmd]
|
||||||
cn_msg.len = sizeof(struct w1_netlink_msg) + sizeof(struct w1_netlink_cmd) + cmd->len;
|
cn_msg.len = sizeof(struct w1_netlink_msg) +
|
||||||
|
sizeof(struct w1_netlink_cmd) +
|
||||||
|
cmd->len;
|
||||||
w1_netlink_msg.len = sizeof(struct w1_netlink_cmd) + cmd->len;
|
w1_netlink_msg.len = sizeof(struct w1_netlink_cmd) + cmd->len;
|
||||||
w1_netlink_cmd.len = cmd->len;
|
w1_netlink_cmd.len = cmd->len;
|
||||||
|
|
||||||
|
Replies to W1_LIST_MASTERS should send a message back to the userspace
|
||||||
|
which will contain list of all registered master ids in the following
|
||||||
|
format:
|
||||||
|
|
||||||
|
cn_msg (CN_W1_IDX.CN_W1_VAL as id, len is equal to sizeof(struct
|
||||||
|
w1_netlink_msg) plus number of masters multipled by 4)
|
||||||
|
w1_netlink_msg (type: W1_LIST_MASTERS, len is equal to
|
||||||
|
number of masters multiplied by 4 (u32 size))
|
||||||
|
id0 ... idN
|
||||||
|
|
||||||
|
Each message is at most 4k in size, so if number of master devices
|
||||||
|
exceeds this, it will be split into several messages,
|
||||||
|
cn.seq will be increased for each one.
|
||||||
|
|
||||||
|
W1 search and alarm search commands.
|
||||||
|
request:
|
||||||
|
[cn_msg]
|
||||||
|
[w1_netlink_msg type = W1_MASTER_CMD
|
||||||
|
id is equal to the bus master id to use for searching]
|
||||||
|
[w1_netlink_cmd cmd = W1_CMD_SEARCH or W1_CMD_ALARM_SEARCH]
|
||||||
|
|
||||||
|
reply:
|
||||||
|
[cn_msg, ack = 1 and increasing, 0 means the last message,
|
||||||
|
seq is equal to the request seq]
|
||||||
|
[w1_netlink_msg type = W1_MASTER_CMD]
|
||||||
|
[w1_netlink_cmd cmd = W1_CMD_SEARCH or W1_CMD_ALARM_SEARCH
|
||||||
|
len is equal to number of IDs multiplied by 8]
|
||||||
|
[64bit-id0 ... 64bit-idN]
|
||||||
|
Length in each header corresponds to the size of the data behind it, so
|
||||||
|
w1_netlink_cmd->len = N * 8; where N is number of IDs in this message.
|
||||||
|
Can be zero.
|
||||||
|
w1_netlink_msg->len = sizeof(struct w1_netlink_cmd) + N * 8;
|
||||||
|
cn_msg->len = sizeof(struct w1_netlink_msg) +
|
||||||
|
sizeof(struct w1_netlink_cmd) +
|
||||||
|
N*8;
|
||||||
|
|
||||||
|
W1 reset command.
|
||||||
|
[cn_msg]
|
||||||
|
[w1_netlink_msg type = W1_MASTER_CMD
|
||||||
|
id is equal to the bus master id to use for searching]
|
||||||
|
[w1_netlink_cmd cmd = W1_CMD_RESET]
|
||||||
|
|
||||||
|
|
||||||
|
Command status replies.
|
||||||
|
======================
|
||||||
|
|
||||||
|
Each command (either root, master or slave with or without w1_netlink_cmd
|
||||||
|
structure) will be 'acked' by the w1 core. Format of the reply is the same
|
||||||
|
as request message except that length parameters do not account for data
|
||||||
|
requested by the user, i.e. read/write/touch IO requests will not contain
|
||||||
|
data, so w1_netlink_cmd.len will be 0, w1_netlink_msg.len will be size
|
||||||
|
of the w1_netlink_cmd structure and cn_msg.len will be equal to the sum
|
||||||
|
of the sizeof(struct w1_netlink_msg) and sizeof(struct w1_netlink_cmd).
|
||||||
|
If reply is generated for master or root command (which do not have
|
||||||
|
w1_netlink_cmd attached), reply will contain only cn_msg and w1_netlink_msg
|
||||||
|
structires.
|
||||||
|
|
||||||
|
w1_netlink_msg.status field will carry positive error value
|
||||||
|
(EINVAL for example) or zero in case of success.
|
||||||
|
|
||||||
|
All other fields in every structure will mirror the same parameters in the
|
||||||
|
request message (except lengths as described above).
|
||||||
|
|
||||||
|
Status reply is generated for every w1_netlink_cmd embedded in the
|
||||||
|
w1_netlink_msg, if there are no w1_netlink_cmd structures,
|
||||||
|
reply will be generated for the w1_netlink_msg.
|
||||||
|
|
||||||
|
All w1_netlink_cmd command structures are handled in every w1_netlink_msg,
|
||||||
|
even if there were errors, only length mismatch interrupts message processing.
|
||||||
|
|
||||||
|
|
||||||
Operation steps in w1 core when new command is received.
|
Operation steps in w1 core when new command is received.
|
||||||
=======================================================
|
=======================================================
|
||||||
|
|
||||||
When new message (w1_netlink_msg) is received w1 core detects if it is master of slave request,
|
When new message (w1_netlink_msg) is received w1 core detects if it is
|
||||||
according to w1_netlink_msg.type field.
|
master or slave request, according to w1_netlink_msg.type field.
|
||||||
Then master or slave device is searched for.
|
Then master or slave device is searched for.
|
||||||
When found, master device (requested or those one on where slave device is found) is locked.
|
When found, master device (requested or those one on where slave device
|
||||||
If slave command is requested, then reset/select procedure is started to select given device.
|
is found) is locked. If slave command is requested, then reset/select
|
||||||
|
procedure is started to select given device.
|
||||||
|
|
||||||
Then all requested in w1_netlink_msg operations are performed one by one.
|
Then all requested in w1_netlink_msg operations are performed one by one.
|
||||||
If command requires reply (like read command) it is sent on command completion.
|
If command requires reply (like read command) it is sent on command completion.
|
||||||
|
@ -82,8 +170,8 @@ Connector [1] specific documentation.
|
||||||
Each connector message includes two u32 fields as "address".
|
Each connector message includes two u32 fields as "address".
|
||||||
w1 uses CN_W1_IDX and CN_W1_VAL defined in include/linux/connector.h header.
|
w1 uses CN_W1_IDX and CN_W1_VAL defined in include/linux/connector.h header.
|
||||||
Each message also includes sequence and acknowledge numbers.
|
Each message also includes sequence and acknowledge numbers.
|
||||||
Sequence number for event messages is appropriate bus master sequence number increased with
|
Sequence number for event messages is appropriate bus master sequence number
|
||||||
each event message sent "through" this master.
|
increased with each event message sent "through" this master.
|
||||||
Sequence number for userspace requests is set by userspace application.
|
Sequence number for userspace requests is set by userspace application.
|
||||||
Sequence number for reply is the same as was in request, and
|
Sequence number for reply is the same as was in request, and
|
||||||
acknowledge number is set to seq+1.
|
acknowledge number is set to seq+1.
|
||||||
|
@ -93,6 +181,6 @@ Additional documantion, source code examples.
|
||||||
============================================
|
============================================
|
||||||
|
|
||||||
1. Documentation/connector
|
1. Documentation/connector
|
||||||
2. http://tservice.net.ru/~s0mbre/archive/w1
|
2. http://www.ioremap.net/archive/w1
|
||||||
This archive includes userspace application w1d.c which
|
This archive includes userspace application w1d.c which uses
|
||||||
uses read/write/search commands for all master/slave devices found on the bus.
|
read/write/search commands for all master/slave devices found on the bus.
|
||||||
|
|
260
Documentation/wimax/README.i2400m
Normal file
260
Documentation/wimax/README.i2400m
Normal file
|
@ -0,0 +1,260 @@
|
||||||
|
|
||||||
|
Driver for the Intel Wireless Wimax Connection 2400m
|
||||||
|
|
||||||
|
(C) 2008 Intel Corporation < linux-wimax@intel.com >
|
||||||
|
|
||||||
|
This provides a driver for the Intel Wireless WiMAX Connection 2400m
|
||||||
|
and a basic Linux kernel WiMAX stack.
|
||||||
|
|
||||||
|
1. Requirements
|
||||||
|
|
||||||
|
* Linux installation with Linux kernel 2.6.22 or newer (if building
|
||||||
|
from a separate tree)
|
||||||
|
* Intel i2400m Echo Peak or Baxter Peak; this includes the Intel
|
||||||
|
Wireless WiMAX/WiFi Link 5x50 series.
|
||||||
|
* build tools:
|
||||||
|
+ Linux kernel development package for the target kernel; to
|
||||||
|
build against your currently running kernel, you need to have
|
||||||
|
the kernel development package corresponding to the running
|
||||||
|
image installed (usually if your kernel is named
|
||||||
|
linux-VERSION, the development package is called
|
||||||
|
linux-dev-VERSION or linux-headers-VERSION).
|
||||||
|
+ GNU C Compiler, make
|
||||||
|
|
||||||
|
2. Compilation and installation
|
||||||
|
|
||||||
|
2.1. Compilation of the drivers included in the kernel
|
||||||
|
|
||||||
|
Configure the kernel; to enable the WiMAX drivers select Drivers >
|
||||||
|
Networking Drivers > WiMAX device support. Enable all of them as
|
||||||
|
modules (easier).
|
||||||
|
|
||||||
|
If USB or SDIO are not enabled in the kernel configuration, the options
|
||||||
|
to build the i2400m USB or SDIO drivers will not show. Enable said
|
||||||
|
subsystems and go back to the WiMAX menu to enable the drivers.
|
||||||
|
|
||||||
|
Compile and install your kernel as usual.
|
||||||
|
|
||||||
|
2.2. Compilation of the drivers distributed as an standalone module
|
||||||
|
|
||||||
|
To compile
|
||||||
|
|
||||||
|
$ cd source/directory
|
||||||
|
$ make
|
||||||
|
|
||||||
|
Once built you can load and unload using the provided load.sh script;
|
||||||
|
load.sh will load the modules, load.sh u will unload them.
|
||||||
|
|
||||||
|
To install in the default kernel directories (and enable auto loading
|
||||||
|
when the device is plugged):
|
||||||
|
|
||||||
|
$ make install
|
||||||
|
$ depmod -a
|
||||||
|
|
||||||
|
If your kernel development files are located in a non standard
|
||||||
|
directory or if you want to build for a kernel that is not the
|
||||||
|
currently running one, set KDIR to the right location:
|
||||||
|
|
||||||
|
$ make KDIR=/path/to/kernel/dev/tree
|
||||||
|
|
||||||
|
For more information, please contact linux-wimax@intel.com.
|
||||||
|
|
||||||
|
3. Installing the firmware
|
||||||
|
|
||||||
|
The firmware can be obtained from http://linuxwimax.org or might have
|
||||||
|
been supplied with your hardware.
|
||||||
|
|
||||||
|
It has to be installed in the target system:
|
||||||
|
*
|
||||||
|
$ cp FIRMWAREFILE.sbcf /lib/firmware/i2400m-fw-BUSTYPE-1.3.sbcf
|
||||||
|
|
||||||
|
* NOTE: if your firmware came in an .rpm or .deb file, just install
|
||||||
|
it as normal, with the rpm (rpm -i FIRMWARE.rpm) or dpkg
|
||||||
|
(dpkg -i FIRMWARE.deb) commands. No further action is needed.
|
||||||
|
* BUSTYPE will be usb or sdio, depending on the hardware you have.
|
||||||
|
Each hardware type comes with its own firmware and will not work
|
||||||
|
with other types.
|
||||||
|
|
||||||
|
4. Design
|
||||||
|
|
||||||
|
This package contains two major parts: a WiMAX kernel stack and a
|
||||||
|
driver for the Intel i2400m.
|
||||||
|
|
||||||
|
The WiMAX stack is designed to provide for common WiMAX control
|
||||||
|
services to current and future WiMAX devices from any vendor; please
|
||||||
|
see README.wimax for details.
|
||||||
|
|
||||||
|
The i2400m kernel driver is broken up in two main parts: the bus
|
||||||
|
generic driver and the bus-specific drivers. The bus generic driver
|
||||||
|
forms the drivercore and contain no knowledge of the actual method we
|
||||||
|
use to connect to the device. The bus specific drivers are just the
|
||||||
|
glue to connect the bus-generic driver and the device. Currently only
|
||||||
|
USB and SDIO are supported. See drivers/net/wimax/i2400m/i2400m.h for
|
||||||
|
more information.
|
||||||
|
|
||||||
|
The bus generic driver is logically broken up in two parts: OS-glue and
|
||||||
|
hardware-glue. The OS-glue interfaces with Linux. The hardware-glue
|
||||||
|
interfaces with the device on using an interface provided by the
|
||||||
|
bus-specific driver. The reason for this breakup is to be able to
|
||||||
|
easily reuse the hardware-glue to write drivers for other OSes; note
|
||||||
|
the hardware glue part is written as a native Linux driver; no
|
||||||
|
abstraction layers are used, so to port to another OS, the Linux kernel
|
||||||
|
API calls should be replaced with the target OS's.
|
||||||
|
|
||||||
|
5. Usage
|
||||||
|
|
||||||
|
To load the driver, follow the instructions in the install section;
|
||||||
|
once the driver is loaded, plug in the device (unless it is permanently
|
||||||
|
plugged in). The driver will enumerate the device, upload the firmware
|
||||||
|
and output messages in the kernel log (dmesg, /var/log/messages or
|
||||||
|
/var/log/kern.log) such as:
|
||||||
|
|
||||||
|
...
|
||||||
|
i2400m_usb 5-4:1.0: firmware interface version 8.0.0
|
||||||
|
i2400m_usb 5-4:1.0: WiMAX interface wmx0 (00:1d:e1:01:94:2c) ready
|
||||||
|
|
||||||
|
At this point the device is ready to work.
|
||||||
|
|
||||||
|
Current versions require the Intel WiMAX Network Service in userspace
|
||||||
|
to make things work. See the network service's README for instructions
|
||||||
|
on how to scan, connect and disconnect.
|
||||||
|
|
||||||
|
5.1. Module parameters
|
||||||
|
|
||||||
|
Module parameters can be set at kernel or module load time or by
|
||||||
|
echoing values:
|
||||||
|
|
||||||
|
$ echo VALUE > /sys/module/MODULENAME/parameters/PARAMETERNAME
|
||||||
|
|
||||||
|
To make changes permanent, for example, for the i2400m module, you can
|
||||||
|
also create a file named /etc/modprobe.d/i2400m containing:
|
||||||
|
|
||||||
|
options i2400m idle_mode_disabled=1
|
||||||
|
|
||||||
|
To find which parameters are supported by a module, run:
|
||||||
|
|
||||||
|
$ modinfo path/to/module.ko
|
||||||
|
|
||||||
|
During kernel bootup (if the driver is linked in the kernel), specify
|
||||||
|
the following to the kernel command line:
|
||||||
|
|
||||||
|
i2400m.PARAMETER=VALUE
|
||||||
|
|
||||||
|
5.1.1. i2400m: idle_mode_disabled
|
||||||
|
|
||||||
|
The i2400m module supports a parameter to disable idle mode. This
|
||||||
|
parameter, once set, will take effect only when the device is
|
||||||
|
reinitialized by the driver (eg: following a reset or a reconnect).
|
||||||
|
|
||||||
|
5.2. Debug operations: debugfs entries
|
||||||
|
|
||||||
|
The driver will register debugfs entries that allow the user to tweak
|
||||||
|
debug settings. There are three main container directories where
|
||||||
|
entries are placed, which correspond to the three blocks a i2400m WiMAX
|
||||||
|
driver has:
|
||||||
|
* /sys/kernel/debug/wimax:DEVNAME/ for the generic WiMAX stack
|
||||||
|
controls
|
||||||
|
* /sys/kernel/debug/wimax:DEVNAME/i2400m for the i2400m generic
|
||||||
|
driver controls
|
||||||
|
* /sys/kernel/debug/wimax:DEVNAME/i2400m-usb (or -sdio) for the
|
||||||
|
bus-specific i2400m-usb or i2400m-sdio controls).
|
||||||
|
|
||||||
|
Of course, if debugfs is mounted in a directory other than
|
||||||
|
/sys/kernel/debug, those paths will change.
|
||||||
|
|
||||||
|
5.2.1. Increasing debug output
|
||||||
|
|
||||||
|
The files named *dl_* indicate knobs for controlling the debug output
|
||||||
|
of different submodules:
|
||||||
|
*
|
||||||
|
# find /sys/kernel/debug/wimax\:wmx0 -name \*dl_\*
|
||||||
|
/sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_tx
|
||||||
|
/sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_rx
|
||||||
|
/sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_notif
|
||||||
|
/sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_fw
|
||||||
|
/sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_usb
|
||||||
|
/sys/kernel/debug/wimax:wmx0/i2400m/dl_tx
|
||||||
|
/sys/kernel/debug/wimax:wmx0/i2400m/dl_rx
|
||||||
|
/sys/kernel/debug/wimax:wmx0/i2400m/dl_rfkill
|
||||||
|
/sys/kernel/debug/wimax:wmx0/i2400m/dl_netdev
|
||||||
|
/sys/kernel/debug/wimax:wmx0/i2400m/dl_fw
|
||||||
|
/sys/kernel/debug/wimax:wmx0/i2400m/dl_debugfs
|
||||||
|
/sys/kernel/debug/wimax:wmx0/i2400m/dl_driver
|
||||||
|
/sys/kernel/debug/wimax:wmx0/i2400m/dl_control
|
||||||
|
/sys/kernel/debug/wimax:wmx0/wimax_dl_stack
|
||||||
|
/sys/kernel/debug/wimax:wmx0/wimax_dl_op_rfkill
|
||||||
|
/sys/kernel/debug/wimax:wmx0/wimax_dl_op_reset
|
||||||
|
/sys/kernel/debug/wimax:wmx0/wimax_dl_op_msg
|
||||||
|
/sys/kernel/debug/wimax:wmx0/wimax_dl_id_table
|
||||||
|
/sys/kernel/debug/wimax:wmx0/wimax_dl_debugfs
|
||||||
|
|
||||||
|
By reading the file you can obtain the current value of said debug
|
||||||
|
level; by writing to it, you can set it.
|
||||||
|
|
||||||
|
To increase the debug level of, for example, the i2400m's generic TX
|
||||||
|
engine, just write:
|
||||||
|
|
||||||
|
$ echo 3 > /sys/kernel/debug/wimax:wmx0/i2400m/dl_tx
|
||||||
|
|
||||||
|
Increasing numbers yield increasing debug information; for details of
|
||||||
|
what is printed and the available levels, check the source. The code
|
||||||
|
uses 0 for disabled and increasing values until 8.
|
||||||
|
|
||||||
|
5.2.2. RX and TX statistics
|
||||||
|
|
||||||
|
The i2400m/rx_stats and i2400m/tx_stats provide statistics about the
|
||||||
|
data reception/delivery from the device:
|
||||||
|
|
||||||
|
$ cat /sys/kernel/debug/wimax:wmx0/i2400m/rx_stats
|
||||||
|
45 1 3 34 3104 48 480
|
||||||
|
|
||||||
|
The numbers reported are
|
||||||
|
* packets/RX-buffer: total, min, max
|
||||||
|
* RX-buffers: total RX buffers received, accumulated RX buffer size
|
||||||
|
in bytes, min size received, max size received
|
||||||
|
|
||||||
|
Thus, to find the average buffer size received, divide accumulated
|
||||||
|
RX-buffer / total RX-buffers.
|
||||||
|
|
||||||
|
To clear the statistics back to 0, write anything to the rx_stats file:
|
||||||
|
|
||||||
|
$ echo 1 > /sys/kernel/debug/wimax:wmx0/i2400m_rx_stats
|
||||||
|
|
||||||
|
Likewise for TX.
|
||||||
|
|
||||||
|
Note the packets this debug file refers to are not network packet, but
|
||||||
|
packets in the sense of the device-specific protocol for communication
|
||||||
|
to the host. See drivers/net/wimax/i2400m/tx.c.
|
||||||
|
|
||||||
|
5.2.3. Tracing messages received from user space
|
||||||
|
|
||||||
|
To echo messages received from user space into the trace pipe that the
|
||||||
|
i2400m driver creates, set the debug file i2400m/trace_msg_from_user to
|
||||||
|
1:
|
||||||
|
*
|
||||||
|
$ echo 1 > /sys/kernel/debug/wimax:wmx0/i2400m/trace_msg_from_user
|
||||||
|
|
||||||
|
5.2.4. Performing a device reset
|
||||||
|
|
||||||
|
By writing a 0, a 1 or a 2 to the file
|
||||||
|
/sys/kernel/debug/wimax:wmx0/reset, the driver performs a warm (without
|
||||||
|
disconnecting from the bus), cold (disconnecting from the bus) or bus
|
||||||
|
(bus specific) reset on the device.
|
||||||
|
|
||||||
|
5.2.5. Asking the device to enter power saving mode
|
||||||
|
|
||||||
|
By writing any value to the /sys/kernel/debug/wimax:wmx0 file, the
|
||||||
|
device will attempt to enter power saving mode.
|
||||||
|
|
||||||
|
6. Troubleshooting
|
||||||
|
|
||||||
|
6.1. Driver complains about 'i2400m-fw-usb-1.2.sbcf: request failed'
|
||||||
|
|
||||||
|
If upon connecting the device, the following is output in the kernel
|
||||||
|
log:
|
||||||
|
|
||||||
|
i2400m_usb 5-4:1.0: fw i2400m-fw-usb-1.3.sbcf: request failed: -2
|
||||||
|
|
||||||
|
This means that the driver cannot locate the firmware file named
|
||||||
|
/lib/firmware/i2400m-fw-usb-1.2.sbcf. Check that the file is present in
|
||||||
|
the right location.
|
81
Documentation/wimax/README.wimax
Normal file
81
Documentation/wimax/README.wimax
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
|
||||||
|
Linux kernel WiMAX stack
|
||||||
|
|
||||||
|
(C) 2008 Intel Corporation < linux-wimax@intel.com >
|
||||||
|
|
||||||
|
This provides a basic Linux kernel WiMAX stack to provide a common
|
||||||
|
control API for WiMAX devices, usable from kernel and user space.
|
||||||
|
|
||||||
|
1. Design
|
||||||
|
|
||||||
|
The WiMAX stack is designed to provide for common WiMAX control
|
||||||
|
services to current and future WiMAX devices from any vendor.
|
||||||
|
|
||||||
|
Because currently there is only one and we don't know what would be the
|
||||||
|
common services, the APIs it currently provides are very minimal.
|
||||||
|
However, it is done in such a way that it is easily extensible to
|
||||||
|
accommodate future requirements.
|
||||||
|
|
||||||
|
The stack works by embedding a struct wimax_dev in your device's
|
||||||
|
control structures. This provides a set of callbacks that the WiMAX
|
||||||
|
stack will call in order to implement control operations requested by
|
||||||
|
the user. As well, the stack provides API functions that the driver
|
||||||
|
calls to notify about changes of state in the device.
|
||||||
|
|
||||||
|
The stack exports the API calls needed to control the device to user
|
||||||
|
space using generic netlink as a marshalling mechanism. You can access
|
||||||
|
them using your own code or use the wrappers provided for your
|
||||||
|
convenience in libwimax (in the wimax-tools package).
|
||||||
|
|
||||||
|
For detailed information on the stack, please see
|
||||||
|
include/linux/wimax.h.
|
||||||
|
|
||||||
|
2. Usage
|
||||||
|
|
||||||
|
For usage in a driver (registration, API, etc) please refer to the
|
||||||
|
instructions in the header file include/linux/wimax.h.
|
||||||
|
|
||||||
|
When a device is registered with the WiMAX stack, a set of debugfs
|
||||||
|
files will appear in /sys/kernel/debug/wimax:wmxX can tweak for
|
||||||
|
control.
|
||||||
|
|
||||||
|
2.1. Obtaining debug information: debugfs entries
|
||||||
|
|
||||||
|
The WiMAX stack is compiled, by default, with debug messages that can
|
||||||
|
be used to diagnose issues. By default, said messages are disabled.
|
||||||
|
|
||||||
|
The drivers will register debugfs entries that allow the user to tweak
|
||||||
|
debug settings.
|
||||||
|
|
||||||
|
Each driver, when registering with the stack, will cause a debugfs
|
||||||
|
directory named wimax:DEVICENAME to be created; optionally, it might
|
||||||
|
create more subentries below it.
|
||||||
|
|
||||||
|
2.1.1. Increasing debug output
|
||||||
|
|
||||||
|
The files named *dl_* indicate knobs for controlling the debug output
|
||||||
|
of different submodules of the WiMAX stack:
|
||||||
|
*
|
||||||
|
# find /sys/kernel/debug/wimax\:wmx0 -name \*dl_\*
|
||||||
|
/sys/kernel/debug/wimax:wmx0/wimax_dl_stack
|
||||||
|
/sys/kernel/debug/wimax:wmx0/wimax_dl_op_rfkill
|
||||||
|
/sys/kernel/debug/wimax:wmx0/wimax_dl_op_reset
|
||||||
|
/sys/kernel/debug/wimax:wmx0/wimax_dl_op_msg
|
||||||
|
/sys/kernel/debug/wimax:wmx0/wimax_dl_id_table
|
||||||
|
/sys/kernel/debug/wimax:wmx0/wimax_dl_debugfs
|
||||||
|
/sys/kernel/debug/wimax:wmx0/.... # other driver specific files
|
||||||
|
|
||||||
|
NOTE: Of course, if debugfs is mounted in a directory other than
|
||||||
|
/sys/kernel/debug, those paths will change.
|
||||||
|
|
||||||
|
By reading the file you can obtain the current value of said debug
|
||||||
|
level; by writing to it, you can set it.
|
||||||
|
|
||||||
|
To increase the debug level of, for example, the id-table submodule,
|
||||||
|
just write:
|
||||||
|
|
||||||
|
$ echo 3 > /sys/kernel/debug/wimax:wmx0/wimax_dl_id_table
|
||||||
|
|
||||||
|
Increasing numbers yield increasing debug information; for details of
|
||||||
|
what is printed and the available levels, check the source. The code
|
||||||
|
uses 0 for disabled and increasing values until 8.
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue