Commit 2f9ef055 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'docs-5.13' of git://git.lwn.net/linux

Pull documentation updates from Jonathan Corbet:
 "It's been a relatively busy cycle in docsland, though more than
  usually well contained to Documentation/ itself. Highlights include:

   - The Chinese translators have been busy and show no signs of
     stopping anytime soon. Italian has also caught up.

   - Aditya Srivastava has been working on improvements to the
     kernel-doc script.

   - Thorsten continues his work on reporting-issues.rst and related
     documentation around regression reporting.

   - Lots of documentation updates, typo fixes, etc. as usual"

* tag 'docs-5.13' of git://git.lwn.net/linux: (139 commits)
  docs/zh_CN: add openrisc translation to zh_CN index
  docs/zh_CN: add openrisc index.rst translation
  docs/zh_CN: add openrisc todo.rst translation
  docs/zh_CN: add openrisc openrisc_port.rst translation
  docs/zh_CN: add core api translation to zh_CN index
  docs/zh_CN: add core-api index.rst translation
  docs/zh_CN: add core-api irq index.rst translation
  docs/zh_CN: add core-api irq irqflags-tracing.rst translation
  docs/zh_CN: add core-api irq irq-domain.rst translation
  docs/zh_CN: add core-api irq irq-affinity.rst translation
  docs/zh_CN: add core-api irq concepts.rst translation
  docs: sphinx-pre-install: don't barf on beta Sphinx releases
  scripts: kernel-doc: improve parsing for kernel-doc comments syntax
  docs/zh_CN: two minor fixes in zh_CN/doc-guide/
  Documentation: dev-tools: Add Testing Overview
  docs/zh_CN: add translations in zh_CN/dev-tools/gcov
  docs: reporting-issues: make people CC the regressions list
  MAINTAINERS: add regressions mailing list
  doc:it_IT: align Italian documentation
  docs/zh_CN: sync reporting-issues.rst
  ...
parents 0c855563 441ca977
...@@ -25,8 +25,9 @@ Alexandre Belloni <alexandre.belloni@bootlin.com> <alexandre.belloni@free-electr ...@@ -25,8 +25,9 @@ Alexandre Belloni <alexandre.belloni@bootlin.com> <alexandre.belloni@free-electr
Alexei Starovoitov <ast@kernel.org> <alexei.starovoitov@gmail.com> Alexei Starovoitov <ast@kernel.org> <alexei.starovoitov@gmail.com>
Alexei Starovoitov <ast@kernel.org> <ast@fb.com> Alexei Starovoitov <ast@kernel.org> <ast@fb.com>
Alexei Starovoitov <ast@kernel.org> <ast@plumgrid.com> Alexei Starovoitov <ast@kernel.org> <ast@plumgrid.com>
Alex Shi <alex.shi@linux.alibaba.com> <alex.shi@intel.com> Alex Shi <alexs@kernel.org> <alex.shi@intel.com>
Alex Shi <alex.shi@linux.alibaba.com> <alex.shi@linaro.org> Alex Shi <alexs@kernel.org> <alex.shi@linaro.org>
Alex Shi <alexs@kernel.org> <alex.shi@linux.alibaba.com>
Al Viro <viro@ftp.linux.org.uk> Al Viro <viro@ftp.linux.org.uk>
Al Viro <viro@zenIV.linux.org.uk> Al Viro <viro@zenIV.linux.org.uk>
Andi Kleen <ak@linux.intel.com> <ak@suse.de> Andi Kleen <ak@linux.intel.com> <ak@suse.de>
......
...@@ -550,7 +550,7 @@ D: gadget layers, SPI subsystem, GPIO subsystem, and more than a few ...@@ -550,7 +550,7 @@ D: gadget layers, SPI subsystem, GPIO subsystem, and more than a few
D: device drivers. His encouragement also helped many engineers get D: device drivers. His encouragement also helped many engineers get
D: started working on the Linux kernel. David passed away in early D: started working on the Linux kernel. David passed away in early
D: 2011, and will be greatly missed. D: 2011, and will be greatly missed.
W: https://lkml.org/lkml/2011/4/5/36 W: https://lore.kernel.org/lkml/20110405034819.GA7872@kroah.com
N: Gary Brubaker N: Gary Brubaker
E: xavyer@ix.netcom.com E: xavyer@ix.netcom.com
......
...@@ -11,8 +11,8 @@ restrictions without needing to sign the files individually. ...@@ -11,8 +11,8 @@ restrictions without needing to sign the files individually.
The LSM is selectable at build-time with ``CONFIG_SECURITY_LOADPIN``, and The LSM is selectable at build-time with ``CONFIG_SECURITY_LOADPIN``, and
can be controlled at boot-time with the kernel command line option can be controlled at boot-time with the kernel command line option
"``loadpin.enabled``". By default, it is enabled, but can be disabled at "``loadpin.enforce``". By default, it is enabled, but can be disabled at
boot ("``loadpin.enabled=0``"). boot ("``loadpin.enforce=0``").
LoadPin starts pinning when it sees the first file loaded. If the LoadPin starts pinning when it sees the first file loaded. If the
block device backing the filesystem is not read-only, a sysctl is block device backing the filesystem is not read-only, a sysctl is
...@@ -28,4 +28,4 @@ different mechanisms such as ``CONFIG_MODULE_SIG`` and ...@@ -28,4 +28,4 @@ different mechanisms such as ``CONFIG_MODULE_SIG`` and
``CONFIG_KEXEC_VERIFY_SIG`` to verify kernel module and kernel image while ``CONFIG_KEXEC_VERIFY_SIG`` to verify kernel module and kernel image while
still use LoadPin to protect the integrity of other files kernel loads. The still use LoadPin to protect the integrity of other files kernel loads. The
full list of valid file types can be found in ``kernel_read_file_str`` full list of valid file types can be found in ``kernel_read_file_str``
defined in ``include/linux/fs.h``. defined in ``include/linux/kernel_read_file.h``.
...@@ -360,8 +360,8 @@ U != 0, K = unlimited: ...@@ -360,8 +360,8 @@ U != 0, K = unlimited:
U != 0, K < U: U != 0, K < U:
Kernel memory is a subset of the user memory. This setup is useful in Kernel memory is a subset of the user memory. This setup is useful in
deployments where the total amount of memory per-cgroup is overcommited. deployments where the total amount of memory per-cgroup is overcommitted.
Overcommiting kernel memory limits is definitely not recommended, since the Overcommitting kernel memory limits is definitely not recommended, since the
box can still run out of non-reclaimable memory. box can still run out of non-reclaimable memory.
In this case, the admin could set up K so that the sum of all groups is In this case, the admin could set up K so that the sum of all groups is
never greater than the total memory, and freely set U at the cost of his never greater than the total memory, and freely set U at the cost of his
...@@ -851,6 +851,9 @@ At reading, current status of OOM is shown. ...@@ -851,6 +851,9 @@ At reading, current status of OOM is shown.
(if 1, oom-killer is disabled) (if 1, oom-killer is disabled)
- under_oom 0 or 1 - under_oom 0 or 1
(if 1, the memory cgroup is under OOM, tasks may be stopped.) (if 1, the memory cgroup is under OOM, tasks may be stopped.)
- oom_kill integer counter
The number of processes belonging to this cgroup killed by any
kind of OOM killer.
11. Memory Pressure 11. Memory Pressure
=================== ===================
......
...@@ -347,7 +347,7 @@ Examples ...@@ -347,7 +347,7 @@ Examples
<debugfs>/dynamic_debug/control <debugfs>/dynamic_debug/control
// enable messages in files of which the paths include string "usb" // enable messages in files of which the paths include string "usb"
nullarbor:~ # echo -n '*usb* +p' > <debugfs>/dynamic_debug/control nullarbor:~ # echo -n 'file *usb* +p' > <debugfs>/dynamic_debug/control
// enable all messages // enable all messages
nullarbor:~ # echo -n '+p' > <debugfs>/dynamic_debug/control nullarbor:~ # echo -n '+p' > <debugfs>/dynamic_debug/control
......
...@@ -35,7 +35,6 @@ problems and bugs in particular. ...@@ -35,7 +35,6 @@ problems and bugs in particular.
:maxdepth: 1 :maxdepth: 1
reporting-issues reporting-issues
Reporting bugs (obsolete) <reporting-bugs>
security-bugs security-bugs
bug-hunting bug-hunting
bug-bisect bug-bisect
......
...@@ -140,6 +140,7 @@ parameter is applicable:: ...@@ -140,6 +140,7 @@ parameter is applicable::
PPT Parallel port support is enabled. PPT Parallel port support is enabled.
PS2 Appropriate PS/2 support is enabled. PS2 Appropriate PS/2 support is enabled.
RAM RAM disk support is enabled. RAM RAM disk support is enabled.
RISCV RISCV architecture is enabled.
RDT Intel Resource Director Technology. RDT Intel Resource Director Technology.
S390 S390 architecture is enabled. S390 S390 architecture is enabled.
SCSI Appropriate SCSI support is enabled. SCSI Appropriate SCSI support is enabled.
......
...@@ -3471,7 +3471,8 @@ ...@@ -3471,7 +3471,8 @@
nr_uarts= [SERIAL] maximum number of UARTs to be registered. nr_uarts= [SERIAL] maximum number of UARTs to be registered.
numa_balancing= [KNL,X86] Enable or disable automatic NUMA balancing. numa_balancing= [KNL,ARM64,PPC,RISCV,S390,X86] Enable or disable automatic
NUMA balancing.
Allowed values are enable and disable Allowed values are enable and disable
numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA. numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA.
......
...@@ -332,23 +332,3 @@ To reduce its OS jitter, do at least one of the following: ...@@ -332,23 +332,3 @@ To reduce its OS jitter, do at least one of the following:
kthreads from being created in the first place. However, please kthreads from being created in the first place. However, please
note that this will not eliminate OS jitter, but will instead note that this will not eliminate OS jitter, but will instead
shift it to RCU_SOFTIRQ. shift it to RCU_SOFTIRQ.
Name:
watchdog/%u
Purpose:
Detect software lockups on each CPU.
To reduce its OS jitter, do at least one of the following:
1. Build with CONFIG_LOCKUP_DETECTOR=n, which will prevent these
kthreads from being created in the first place.
2. Boot with "nosoftlockup=0", which will also prevent these kthreads
from being created. Other related watchdog and softlockup boot
parameters may be found in Documentation/admin-guide/kernel-parameters.rst
and Documentation/watchdog/watchdog-parameters.rst.
3. Echo a zero to /proc/sys/kernel/watchdog to disable the
watchdog timer.
4. Echo a large number of /proc/sys/kernel/watchdog_thresh in
order to reduce the frequency of OS jitter due to the watchdog
timer down to a level that is acceptable for your workload.
...@@ -151,7 +151,7 @@ Each cache level's directory provides its attributes. For example, the ...@@ -151,7 +151,7 @@ Each cache level's directory provides its attributes. For example, the
following shows a single cache level and the attributes available for following shows a single cache level and the attributes available for
software to query:: software to query::
# tree sys/devices/system/node/node0/memory_side_cache/ # tree /sys/devices/system/node/node0/memory_side_cache/
/sys/devices/system/node/node0/memory_side_cache/ /sys/devices/system/node/node0/memory_side_cache/
|-- index1 |-- index1
| |-- indexing | |-- indexing
......
.. _reportingbugs:
.. note::
This document is obsolete, and will be replaced by
'Documentation/admin-guide/reporting-issues.rst' in the near future.
Reporting bugs
++++++++++++++
Background
==========
The upstream Linux kernel maintainers only fix bugs for specific kernel
versions. Those versions include the current "release candidate" (or -rc)
kernel, any "stable" kernel versions, and any "long term" kernels.
Please see https://www.kernel.org/ for a list of supported kernels. Any
kernel marked with [EOL] is "end of life" and will not have any fixes
backported to it.
If you've found a bug on a kernel version that isn't listed on kernel.org,
contact your Linux distribution or embedded vendor for support.
Alternatively, you can attempt to run one of the supported stable or -rc
kernels, and see if you can reproduce the bug on that. It's preferable
to reproduce the bug on the latest -rc kernel.
How to report Linux kernel bugs
===============================
Identify the problematic subsystem
----------------------------------
Identifying which part of the Linux kernel might be causing your issue
increases your chances of getting your bug fixed. Simply posting to the
generic linux-kernel mailing list (LKML) may cause your bug report to be
lost in the noise of a mailing list that gets 1000+ emails a day.
Instead, try to figure out which kernel subsystem is causing the issue,
and email that subsystem's maintainer and mailing list. If the subsystem
maintainer doesn't answer, then expand your scope to mailing lists like
LKML.
Identify who to notify
----------------------
Once you know the subsystem that is causing the issue, you should send a
bug report. Some maintainers prefer bugs to be reported via bugzilla
(https://bugzilla.kernel.org), while others prefer that bugs be reported
via the subsystem mailing list.
To find out where to send an emailed bug report, find your subsystem or
device driver in the MAINTAINERS file. Search in the file for relevant
entries, and send your bug report to the person(s) listed in the "M:"
lines, making sure to Cc the mailing list(s) in the "L:" lines. When the
maintainer replies to you, make sure to 'Reply-all' in order to keep the
public mailing list(s) in the email thread.
If you know which driver is causing issues, you can pass one of the driver
files to the get_maintainer.pl script::
perl scripts/get_maintainer.pl -f <filename>
If it is a security bug, please copy the Security Contact listed in the
MAINTAINERS file. They can help coordinate bugfix and disclosure. See
:ref:`Documentation/admin-guide/security-bugs.rst <securitybugs>` for more information.
If you can't figure out which subsystem caused the issue, you should file
a bug in kernel.org bugzilla and send email to
linux-kernel@vger.kernel.org, referencing the bugzilla URL. (For more
information on the linux-kernel mailing list see
http://vger.kernel.org/lkml/).
Tips for reporting bugs
-----------------------
If you haven't reported a bug before, please read:
https://www.chiark.greenend.org.uk/~sgtatham/bugs.html
http://www.catb.org/esr/faqs/smart-questions.html
It's REALLY important to report bugs that seem unrelated as separate email
threads or separate bugzilla entries. If you report several unrelated
bugs at once, it's difficult for maintainers to tease apart the relevant
data.
Gather information
------------------
The most important information in a bug report is how to reproduce the
bug. This includes system information, and (most importantly)
step-by-step instructions for how a user can trigger the bug.
If the failure includes an "OOPS:", take a picture of the screen, capture
a netconsole trace, or type the message from your screen into the bug
report. Please read "Documentation/admin-guide/bug-hunting.rst" before posting your
bug report. This explains what you should do with the "Oops" information
to make it useful to the recipient.
This is a suggested format for a bug report sent via email or bugzilla.
Having a standardized bug report form makes it easier for you not to
overlook things, and easier for the developers to find the pieces of
information they're really interested in. If some information is not
relevant to your bug, feel free to exclude it.
First run the ver_linux script included as scripts/ver_linux, which
reports the version of some important subsystems. Run this script with
the command ``awk -f scripts/ver_linux``.
Use that information to fill in all fields of the bug report form, and
post it to the mailing list with a subject of "PROBLEM: <one line
summary from [1.]>" for easy identification by the developers::
[1.] One line summary of the problem:
[2.] Full description of the problem/report:
[3.] Keywords (i.e., modules, networking, kernel):
[4.] Kernel information
[4.1.] Kernel version (from /proc/version):
[4.2.] Kernel .config file:
[5.] Most recent kernel version which did not have the bug:
[6.] Output of Oops.. message (if applicable) with symbolic information
resolved (see Documentation/admin-guide/bug-hunting.rst)
[7.] A small shell script or example program which triggers the
problem (if possible)
[8.] Environment
[8.1.] Software (add the output of the ver_linux script here)
[8.2.] Processor information (from /proc/cpuinfo):
[8.3.] Module information (from /proc/modules):
[8.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem)
[8.5.] PCI information ('lspci -vvv' as root)
[8.6.] SCSI information (from /proc/scsi/scsi)
[8.7.] Other information that might be relevant to the problem
(please look in /proc and include all information that you
think to be relevant):
[X.] Other notes, patches, fixes, workarounds:
Follow up
=========
Expectations for bug reporters
------------------------------
Linux kernel maintainers expect bug reporters to be able to follow up on
bug reports. That may include running new tests, applying patches,
recompiling your kernel, and/or re-triggering your bug. The most
frustrating thing for maintainers is for someone to report a bug, and then
never follow up on a request to try out a fix.
That said, it's still useful for a kernel maintainer to know a bug exists
on a supported kernel, even if you can't follow up with retests. Follow
up reports, such as replying to the email thread with "I tried the latest
kernel and I can't reproduce my bug anymore" are also helpful, because
maintainers have to assume silence means things are still broken.
Expectations for kernel maintainers
-----------------------------------
Linux kernel maintainers are busy, overworked human beings. Some times
they may not be able to address your bug in a day, a week, or two weeks.
If they don't answer your email, they may be on vacation, or at a Linux
conference. Check the conference schedule at https://LWN.net for more info:
https://lwn.net/Calendar/
In general, kernel maintainers take 1 to 5 business days to respond to
bugs. The majority of kernel maintainers are employed to work on the
kernel, and they may not work on the weekends. Maintainers are scattered
around the world, and they may not work in your time zone. Unless you
have a high priority bug, please wait at least a week after the first bug
report before sending the maintainer a reminder email.
The exceptions to this rule are regressions, kernel crashes, security holes,
or userspace breakage caused by new kernel behavior. Those bugs should be
addressed by the maintainers ASAP. If you suspect a maintainer is not
responding to these types of bugs in a timely manner (especially during a
merge window), escalate the bug to LKML and Linus Torvalds.
Thank you!
[Some of this is taken from Frohwalt Egerer's original linux-kernel FAQ]
...@@ -90,8 +90,8 @@ Command Function ...@@ -90,8 +90,8 @@ Command Function
``b`` Will immediately reboot the system without syncing or unmounting ``b`` Will immediately reboot the system without syncing or unmounting
your disks. your disks.
``c`` Will perform a system crash by a NULL pointer dereference. ``c`` Will perform a system crash and a crashdump will be taken
A crashdump will be taken if configured. if configured.
``d`` Shows all locks that are held. ``d`` Shows all locks that are held.
......
.. SPDX-License-Identifier: GPL-2.0
CPU Architectures
=================
These books provide programming details about architecture-specific
implementation.
.. toctree::
:maxdepth: 2
arm/index
arm64/index
ia64/index
m68k/index
mips/index
nios2/index
openrisc/index
parisc/index
powerpc/index
riscv/index
s390/index
sh/index
sparc/index
x86/index
xtensa/index
This diff is collapsed.
...@@ -64,4 +64,11 @@ linux,uefi-mmap-desc-size 32-bit Size in bytes of each entry in the UEFI ...@@ -64,4 +64,11 @@ linux,uefi-mmap-desc-size 32-bit Size in bytes of each entry in the UEFI
memory map. memory map.
linux,uefi-mmap-desc-ver 32-bit Version of the mmap descriptor format. linux,uefi-mmap-desc-ver 32-bit Version of the mmap descriptor format.
linux,initrd-start 64-bit Physical start address of an initrd
linux,initrd-end 64-bit Physical end address of an initrd
kaslr-seed 64-bit Entropy used to randomize the kernel image
base address location.
========================== ====== =========================================== ========================== ====== ===========================================
...@@ -331,27 +331,34 @@ htmlhelp_basename = 'TheLinuxKerneldoc' ...@@ -331,27 +331,34 @@ htmlhelp_basename = 'TheLinuxKerneldoc'
# -- Options for LaTeX output --------------------------------------------- # -- Options for LaTeX output ---------------------------------------------
latex_elements = { latex_elements = {
# The paper size ('letterpaper' or 'a4paper'). # The paper size ('letterpaper' or 'a4paper').
'papersize': 'a4paper', 'papersize': 'a4paper',
# The font size ('10pt', '11pt' or '12pt'). # The font size ('10pt', '11pt' or '12pt').
'pointsize': '11pt', 'pointsize': '11pt',
# Latex figure (float) alignment # Latex figure (float) alignment
#'figure_align': 'htbp', #'figure_align': 'htbp',
# Don't mangle with UTF-8 chars # Don't mangle with UTF-8 chars
'inputenc': '', 'inputenc': '',
'utf8extra': '', 'utf8extra': '',
# Additional stuff for the LaTeX preamble. # Set document margins
'sphinxsetup': '''
hmargin=0.5in, vmargin=1in,
parsedliteralwraps=true,
verbatimhintsturnover=false,
''',
# Additional stuff for the LaTeX preamble.
'preamble': ''' 'preamble': '''
% Use some font with UTF-8 support with XeLaTeX % Use some font with UTF-8 support with XeLaTeX
\\usepackage{fontspec} \\usepackage{fontspec}
\\setsansfont{DejaVu Sans} \\setsansfont{DejaVu Sans}
\\setromanfont{DejaVu Serif} \\setromanfont{DejaVu Serif}
\\setmonofont{DejaVu Sans Mono} \\setmonofont{DejaVu Sans Mono}
''' ''',
} }
# At least one book (translations) may have Asian characters # At least one book (translations) may have Asian characters
......
...@@ -201,7 +201,7 @@ search trees, such as for traversals or users relying on a the particular ...@@ -201,7 +201,7 @@ search trees, such as for traversals or users relying on a the particular
order for their own logic. To this end, users can use 'struct rb_root_cached' order for their own logic. To this end, users can use 'struct rb_root_cached'
to optimize O(logN) rb_first() calls to a simple pointer fetch avoiding to optimize O(logN) rb_first() calls to a simple pointer fetch avoiding
potentially expensive tree iterations. This is done at negligible runtime potentially expensive tree iterations. This is done at negligible runtime
overhead for maintanence; albeit larger memory footprint. overhead for maintenance; albeit larger memory footprint.
Similar to the rb_root structure, cached rbtrees are initialized to be Similar to the rb_root structure, cached rbtrees are initialized to be
empty via:: empty via::
......
This diff is collapsed.
...@@ -124,6 +124,8 @@ box for setups where kernels are built and run on the same machine. In ...@@ -124,6 +124,8 @@ box for setups where kernels are built and run on the same machine. In
cases where the kernel runs on a separate machine, special preparations cases where the kernel runs on a separate machine, special preparations
must be made, depending on where the gcov tool is used: must be made, depending on where the gcov tool is used:
.. _gcov-test:
a) gcov is run on the TEST machine a) gcov is run on the TEST machine
The gcov tool version on the test machine must be compatible with the The gcov tool version on the test machine must be compatible with the
...@@ -143,6 +145,8 @@ a) gcov is run on the TEST machine ...@@ -143,6 +145,8 @@ a) gcov is run on the TEST machine
machine. If any of the path components is symbolic link, the actual machine. If any of the path components is symbolic link, the actual
directory needs to be used instead (due to make's CURDIR handling). directory needs to be used instead (due to make's CURDIR handling).
.. _gcov-build:
b) gcov is run on the BUILD machine b) gcov is run on the BUILD machine
The following files need to be copied after each test case from test The following files need to be copied after each test case from test
...@@ -211,7 +215,7 @@ Appendix A: gather_on_build.sh ...@@ -211,7 +215,7 @@ Appendix A: gather_on_build.sh
------------------------------ ------------------------------
Sample script to gather coverage meta files on the build machine Sample script to gather coverage meta files on the build machine
(see 6a): (see :ref:`Separated build and test machines a. <gcov-test>`):
.. code-block:: sh .. code-block:: sh
...@@ -244,7 +248,7 @@ Appendix B: gather_on_test.sh ...@@ -244,7 +248,7 @@ Appendix B: gather_on_test.sh
----------------------------- -----------------------------
Sample script to gather coverage data files on the test machine Sample script to gather coverage data files on the test machine
(see 6b): (see :ref:`Separated build and test machines b. <gcov-build>`):
.. code-block:: sh .. code-block:: sh
......
...@@ -7,6 +7,9 @@ be used to work on the kernel. For now, the documents have been pulled ...@@ -7,6 +7,9 @@ be used to work on the kernel. For now, the documents have been pulled
together without any significant effort to integrate them into a coherent together without any significant effort to integrate them into a coherent
whole; patches welcome! whole; patches welcome!
A brief overview of testing-specific tools can be found in
Documentation/dev-tools/testing-overview.rst
.. class:: toc-title .. class:: toc-title
Table of contents Table of contents
...@@ -14,6 +17,8 @@ whole; patches welcome! ...@@ -14,6 +17,8 @@ whole; patches welcome!
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
testing-overview
checkpatch
coccinelle coccinelle
sparse sparse
kcov kcov
......
.. SPDX-License-Identifier: GPL-2.0
====================
Kernel Testing Guide
====================
There are a number of different tools for testing the Linux kernel, so knowing
when to use each of them can be a challenge. This document provides a rough
overview of their differences, and how they fit together.
Writing and Running Tests
=========================
The bulk of kernel tests are written using either the kselftest or KUnit
frameworks. These both provide infrastructure to help make running tests and
groups of tests easier, as well as providing helpers to aid in writing new
tests.
If you're looking to verify the behaviour of the Kernel — particularly specific
parts of the kernel — then you'll want to use KUnit or kselftest.
The Difference Between KUnit and kselftest
------------------------------------------
KUnit (Documentation/dev-tools/kunit/index.rst) is an entirely in-kernel system
for "white box" testing: because test code is part of the kernel, it can access
internal structures and functions which aren't exposed to userspace.
KUnit tests therefore are best written against small, self-contained parts
of the kernel, which can be tested in isolation. This aligns well with the
concept of 'unit' testing.
For example, a KUnit test might test an individual kernel function (or even a
single codepath through a function, such as an error handling case), rather
than a feature as a whole.
This also makes KUnit tests very fast to build and run, allowing them to be
run frequently as part of the development process.
There is a KUnit test style guide which may give further pointers in
Documentation/dev-tools/kunit/style.rst
kselftest (Documentation/dev-tools/kselftest.rst), on the other hand, is
largely implemented in userspace, and tests are normal userspace scripts or
programs.
This makes it easier to write more complicated tests, or tests which need to
manipulate the overall system state more (e.g., spawning processes, etc.).
However, it's not possible to call kernel functions directly from kselftest.
This means that only kernel functionality which is exposed to userspace somehow
(e.g. by a syscall, device, filesystem, etc.) can be tested with kselftest. To
work around this, some tests include a companion kernel module which exposes
more information or functionality. If a test runs mostly or entirely within the
kernel, however, KUnit may be the more appropriate tool.
kselftest is therefore suited well to tests of whole features, as these will
expose an interface to userspace, which can be tested, but not implementation
details. This aligns well with 'system' or 'end-to-end' testing.
For example, all new system calls should be accompanied by kselftest tests.
Code Coverage Tools
===================
The Linux Kernel supports two different code coverage measurement tools. These
can be used to verify that a test is executing particular functions or lines
of code. This is useful for determining how much of the kernel is being tested,
and for finding corner-cases which are not covered by the appropriate test.
:doc:`gcov` is GCC's coverage testing tool, which can be used with the kernel
to get global or per-module coverage. Unlike KCOV, it does not record per-task
coverage. Coverage data can be read from debugfs, and interpreted using the
usual gcov tooling.
:doc:`kcov` is a feature which can be built in to the kernel to allow
capturing coverage on a per-task level. It's therefore useful for fuzzing and
other situations where information about code executed during, for example, a
single syscall is useful.
Dynamic Analysis Tools
======================
The kernel also supports a number of dynamic analysis tools, which attempt to
detect classes of issues when they occur in a running kernel. These typically
each look for a different class of bugs, such as invalid memory accesses,
concurrency issues such as data races, or other undefined behaviour like
integer overflows.
Some of these tools are listed below:
* kmemleak detects possible memory leaks. See
Documentation/dev-tools/kmemleak.rst
* KASAN detects invalid memory accesses such as out-of-bounds and
use-after-free errors. See Documentation/dev-tools/kasan.rst
* UBSAN detects behaviour that is undefined by the C standard, like integer
overflows. See Documentation/dev-tools/ubsan.rst
* KCSAN detects data races. See Documentation/dev-tools/kcsan.rst
* KFENCE is a low-overhead detector of memory issues, which is much faster than
KASAN and can be used in production. See Documentation/dev-tools/kfence.rst
* lockdep is a locking correctness validator. See
Documentation/locking/lockdep-design.rst
* There are several other pieces of debug instrumentation in the kernel, many
of which can be found in lib/Kconfig.debug
These tools tend to test the kernel as a whole, and do not "pass" like
kselftest or KUnit tests. They can be combined with KUnit or kselftest by
running tests on a kernel with these tools enabled: you can then be sure
that none of these errors are occurring during the test.
Some of these tools integrate with KUnit or kselftest and will
automatically fail tests if an issue is detected.
...@@ -75,8 +75,8 @@ II. For kernel maintainers ...@@ -75,8 +75,8 @@ II. For kernel maintainers
binding, and it hasn't received an Acked-by from the devicetree binding, and it hasn't received an Acked-by from the devicetree
maintainers after a few weeks, go ahead and take it. maintainers after a few weeks, go ahead and take it.
Subsystem bindings (anything affecting more than a single device) For subsystem bindings (anything affecting more than a single device),
then getting a devicetree maintainer to review it is required. getting a devicetree maintainer to review it is required.
3) For a series going though multiple trees, the binding patch should be 3) For a series going though multiple trees, the binding patch should be
kept with the driver using the binding. kept with the driver using the binding.
......
==============
Device Classes
==============
Introduction
~~~~~~~~~~~~
A device class describes a type of device, like an audio or network
device. The following device classes have been identified:
<Insert List of Device Classes Here>
Each device class defines a set of semantics and a programming interface
that devices of that class adhere to. Device drivers are the
implementation of that programming interface for a particular device on
a particular bus.
Device classes are agnostic with respect to what bus a device resides
on.
Programming Interface
~~~~~~~~~~~~~~~~~~~~~
The device class structure looks like::
typedef int (*devclass_add)(struct device *);
typedef void (*devclass_remove)(struct device *);
See the kerneldoc for the struct class.
A typical device class definition would look like::
struct device_class input_devclass = {
.name = "input",
.add_device = input_add_device,
.remove_device = input_remove_device,
};
Each device class structure should be exported in a header file so it
can be used by drivers, extensions and interfaces.
Device classes are registered and unregistered with the core using::
int devclass_register(struct device_class * cls);
void devclass_unregister(struct device_class * cls);
Devices
~~~~~~~
As devices are bound to drivers, they are added to the device class
that the driver belongs to. Before the driver model core, this would
typically happen during the driver's probe() callback, once the device
has been initialized. It now happens after the probe() callback
finishes from the core.
The device is enumerated in the class. Each time a device is added to
the class, the class's devnum field is incremented and assigned to the
device. The field is never decremented, so if the device is removed
from the class and re-added, it will receive a different enumerated
value.
The class is allowed to create a class-specific structure for the
device and store it in the device's class_data pointer.
There is no list of devices in the device class. Each driver has a
list of devices that it supports. The device class has a list of
drivers of that particular class. To access all of the devices in the
class, iterate over the device lists of each driver in the class.
Device Drivers
~~~~~~~~~~~~~~
Device drivers are added to device classes when they are registered
with the core. A driver specifies the class it belongs to by setting
the struct device_driver::devclass field.
sysfs directory structure
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There is a top-level sysfs directory named 'class'.
Each class gets a directory in the class directory, along with two
default subdirectories::
class/
`-- input
|-- devices
`-- drivers
Drivers registered with the class get a symlink in the drivers/ directory
that points to the driver's directory (under its bus directory)::
class/
`-- input
|-- devices
`-- drivers
`-- usb:usb_mouse -> ../../../bus/drivers/usb_mouse/
Each device gets a symlink in the devices/ directory that points to the
device's directory in the physical hierarchy::
class/
`-- input
|-- devices
| `-- 1 -> ../../../root/pci0/00:1f.0/usb_bus/00:1f.2-1:0/
`-- drivers
Exporting Attributes
~~~~~~~~~~~~~~~~~~~~
::
struct devclass_attribute {
struct attribute attr;
ssize_t (*show)(struct device_class *, char * buf, size_t count, loff_t off);
ssize_t (*store)(struct device_class *, const char * buf, size_t count, loff_t off);
};
Class drivers can export attributes using the DEVCLASS_ATTR macro that works
similarly to the DEVICE_ATTR macro for devices. For example, a definition
like this::
static DEVCLASS_ATTR(debug,0644,show_debug,store_debug);
is equivalent to declaring::
static devclass_attribute devclass_attr_debug;
The bus driver can add and remove the attribute from the class's
sysfs directory using::
int devclass_create_file(struct device_class *, struct devclass_attribute *);
void devclass_remove_file(struct device_class *, struct devclass_attribute *);
In the example above, the file will be named 'debug' in placed in the
class's directory in sysfs.
Interfaces
~~~~~~~~~~
There may exist multiple mechanisms for accessing the same device of a
particular class type. Device interfaces describe these mechanisms.
When a device is added to a device class, the core attempts to add it
to every interface that is registered with the device class.
...@@ -63,8 +63,14 @@ Attributes are declared using a macro called DEVICE_ATTR:: ...@@ -63,8 +63,14 @@ Attributes are declared using a macro called DEVICE_ATTR::
Example::: Example:::
static DEVICE_ATTR(type, 0444, show_type, NULL); static DEVICE_ATTR(type, 0444, type_show, NULL);
static DEVICE_ATTR(power, 0644, show_power, store_power); static DEVICE_ATTR(power, 0644, power_show, power_store);
Helper macros are available for common values of mode, so the above examples
can be simplified to:::
static DEVICE_ATTR_RO(type);
static DEVICE_ATTR_RW(power);
This declares two structures of type struct device_attribute with respective This declares two structures of type struct device_attribute with respective
names 'dev_attr_type' and 'dev_attr_power'. These two attributes can be names 'dev_attr_type' and 'dev_attr_power'. These two attributes can be
...@@ -76,19 +82,24 @@ organized as follows into a group:: ...@@ -76,19 +82,24 @@ organized as follows into a group::
NULL, NULL,
}; };
static struct attribute_group dev_attr_group = { static struct attribute_group dev_group = {
.attrs = dev_attrs, .attrs = dev_attrs,
}; };
static const struct attribute_group *dev_attr_groups[] = { static const struct attribute_group *dev_groups[] = {
&dev_attr_group, &dev_group,
NULL, NULL,
}; };
A helper macro is available for the common case of a single group, so the
above two structures can be declared using:::
ATTRIBUTE_GROUPS(dev);
This array of groups can then be associated with a device by setting the This array of groups can then be associated with a device by setting the
group pointer in struct device before device_register() is invoked:: group pointer in struct device before device_register() is invoked::
dev->groups = dev_attr_groups; dev->groups = dev_groups;
device_register(dev); device_register(dev);
The device_register() function will use the 'groups' pointer to create the The device_register() function will use the 'groups' pointer to create the
......
...@@ -7,7 +7,6 @@ Driver Model ...@@ -7,7 +7,6 @@ Driver Model
binding binding
bus bus
class
design-patterns design-patterns
device device
devres devres
......
...@@ -27,7 +27,7 @@ What is a GPIO? ...@@ -27,7 +27,7 @@ What is a GPIO?
=============== ===============
A "General Purpose Input/Output" (GPIO) is a flexible software-controlled A "General Purpose Input/Output" (GPIO) is a flexible software-controlled
digital signal. They are provided from many kinds of chip, and are familiar digital signal. They are provided from many kinds of chips, and are familiar
to Linux developers working with embedded and custom hardware. Each GPIO to Linux developers working with embedded and custom hardware. Each GPIO
represents a bit connected to a particular pin, or "ball" on Ball Grid Array represents a bit connected to a particular pin, or "ball" on Ball Grid Array
(BGA) packages. Board schematics show which external hardware connects to (BGA) packages. Board schematics show which external hardware connects to
......
...@@ -207,9 +207,9 @@ Documentation/driver-api/console.rst. To summarize: ...@@ -207,9 +207,9 @@ Documentation/driver-api/console.rst. To summarize:
Echo a value to the bind file that represents the framebuffer console Echo a value to the bind file that represents the framebuffer console
driver. So assuming vtcon1 represents fbcon, then:: driver. So assuming vtcon1 represents fbcon, then::
echo 1 > sys/class/vtconsole/vtcon1/bind - attach framebuffer console to echo 1 > /sys/class/vtconsole/vtcon1/bind - attach framebuffer console to
console layer console layer
echo 0 > sys/class/vtconsole/vtcon1/bind - detach framebuffer console from echo 0 > /sys/class/vtconsole/vtcon1/bind - detach framebuffer console from
console layer console layer
If fbcon is detached from the console layer, your boot console driver (which is If fbcon is detached from the console layer, your boot console driver (which is
......
...@@ -8,4 +8,5 @@ The meaning of entries in the tables is: ...@@ -8,4 +8,5 @@ The meaning of entries in the tables is:
| ok | # feature supported by the architecture | ok | # feature supported by the architecture
|TODO| # feature not yet supported by the architecture |TODO| # feature not yet supported by the architecture
| .. | # feature cannot be supported by the hardware | .. | # feature cannot be supported by the hardware
| N/A| # feature doesn't apply to the architecture
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
| alpha: | TODO | | alpha: | TODO |
| arc: | TODO | | arc: | TODO |
| arm: | TODO | | arm: | TODO |
| arm64: | TODO | | arm64: | N/A |
| csky: | TODO | | csky: | TODO |
| h8300: | .. | | h8300: | .. |
| hexagon: | TODO | | hexagon: | TODO |
......
...@@ -101,6 +101,9 @@ Other Functions ...@@ -101,6 +101,9 @@ Other Functions
.. kernel-doc:: fs/xattr.c .. kernel-doc:: fs/xattr.c
:export: :export:
.. kernel-doc:: fs/namespace.c
:export:
The proc filesystem The proc filesystem
=================== ===================
...@@ -122,6 +125,12 @@ Events based on file descriptors ...@@ -122,6 +125,12 @@ Events based on file descriptors
.. kernel-doc:: fs/eventfd.c .. kernel-doc:: fs/eventfd.c
:export: :export:
eventpoll (epoll) interfaces
============================
.. kernel-doc:: fs/eventpoll.c
:internal:
The Filesystem for Exporting Kernel Objects The Filesystem for Exporting Kernel Objects
=========================================== ===========================================
......
...@@ -540,7 +540,9 @@ encoded manner. The codes are the following: ...@@ -540,7 +540,9 @@ encoded manner. The codes are the following:
ac area is accountable ac area is accountable
nr swap space is not reserved for the area nr swap space is not reserved for the area
ht area uses huge tlb pages ht area uses huge tlb pages
sf synchronous page fault
ar architecture specific flag ar architecture specific flag
wf wipe on fork
dd do not include area into core dump dd do not include area into core dump
sd soft dirty flag sd soft dirty flag
mm mixed map area mm mixed map area
...@@ -549,6 +551,8 @@ encoded manner. The codes are the following: ...@@ -549,6 +551,8 @@ encoded manner. The codes are the following:
mg mergable advise flag mg mergable advise flag
bt arm64 BTI guarded page bt arm64 BTI guarded page
mt arm64 MTE allocation tags are enabled mt arm64 MTE allocation tags are enabled
um userfaultfd missing tracking
uw userfaultfd wr-protect tracking
== ======================================= == =======================================
Note that there is no guarantee that every flag and associated mnemonic will Note that there is no guarantee that every flag and associated mnemonic will
......
...@@ -189,7 +189,7 @@ VFAT MOUNT OPTIONS ...@@ -189,7 +189,7 @@ VFAT MOUNT OPTIONS
**discard** **discard**
If set, issues discard/TRIM commands to the block If set, issues discard/TRIM commands to the block
device when blocks are freed. This is useful for SSD devices device when blocks are freed. This is useful for SSD devices
and sparse/thinly-provisoned LUNs. and sparse/thinly-provisioned LUNs.
**nfs=stale_rw|nostale_ro** **nfs=stale_rw|nostale_ro**
Enable this only if you want to export the FAT filesystem Enable this only if you want to export the FAT filesystem
......
...@@ -345,7 +345,7 @@ Documentation/ABI/testing/sysfs-bus-iio for IIO ABIs to user space. ...@@ -345,7 +345,7 @@ Documentation/ABI/testing/sysfs-bus-iio for IIO ABIs to user space.
To debug ISH, event tracing mechanism is used. To enable debug logs:: To debug ISH, event tracing mechanism is used. To enable debug logs::
echo 1 > /sys/kernel/debug/tracing/events/intel_ish/enable echo 1 > /sys/kernel/debug/tracing/events/intel_ish/enable
cat sys/kernel/debug/tracing/trace cat /sys/kernel/debug/tracing/trace
3.8 ISH IIO sysfs Example on Lenovo thinkpad Yoga 260 3.8 ISH IIO sysfs Example on Lenovo thinkpad Yoga 260
----------------------------------------------------- -----------------------------------------------------
......
...@@ -149,27 +149,11 @@ Architecture-agnostic documentation ...@@ -149,27 +149,11 @@ Architecture-agnostic documentation
Architecture-specific documentation Architecture-specific documentation
----------------------------------- -----------------------------------
These books provide programming details about architecture-specific
implementation.
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
arm/index arch
arm64/index
ia64/index
m68k/index
mips/index
nios2/index
openrisc/index
parisc/index
powerpc/index
riscv/index
s390/index
sh/index
sparc/index
x86/index
xtensa/index
Other documentation Other documentation
------------------- -------------------
......
...@@ -246,9 +246,9 @@ A few EV_ABS codes have special meanings: ...@@ -246,9 +246,9 @@ A few EV_ABS codes have special meanings:
A device should set the resolution of the axis to indicate whether the A device should set the resolution of the axis to indicate whether the
pressure is in measurable units. If the resolution is zero, the pressure is in measurable units. If the resolution is zero, the
pressure data is in arbitrary units. If the resolution is nonzero, the pressure data is in arbitrary units. If the resolution is non-zero, the
pressure data is in units/gram. For example, a value of 10 with a pressure data is in units/gram. For example, a value of 10 with a
resolution of 1 represents 10 gram, a value of 10 with a resolution on resolution of 1 represents 10 gram, a value of 10 with a resolution of
1000 represents 10 microgram. 1000 represents 10 microgram.
EV_SW EV_SW
...@@ -344,7 +344,7 @@ INPUT_PROP_BUTTONPAD ...@@ -344,7 +344,7 @@ INPUT_PROP_BUTTONPAD
For touchpads where the button is placed beneath the surface, such that For touchpads where the button is placed beneath the surface, such that
pressing down on the pad causes a button click, this property should be pressing down on the pad causes a button click, this property should be
set. Common in clickpad notebooks and macbooks from 2009 and onwards. set. Common in Clickpad notebooks and Macbooks from 2009 and onwards.
Originally, the buttonpad property was coded into the bcm5974 driver Originally, the buttonpad property was coded into the bcm5974 driver
version field under the name integrated button. For backwards version field under the name integrated button. For backwards
...@@ -356,7 +356,7 @@ INPUT_PROP_SEMI_MT ...@@ -356,7 +356,7 @@ INPUT_PROP_SEMI_MT
Some touchpads, most common between 2008 and 2011, can detect the presence Some touchpads, most common between 2008 and 2011, can detect the presence
of multiple contacts without resolving the individual positions; only the of multiple contacts without resolving the individual positions; only the
number of contacts and a rectangular shape is known. For such number of contacts and a rectangular shape is known. For such
touchpads, the semi-mt property should be set. touchpads, the SEMI_MT property should be set.
Depending on the device, the rectangle may enclose all touches, like a Depending on the device, the rectangle may enclose all touches, like a
bounding box, or just some of them, for instance the two most recent bounding box, or just some of them, for instance the two most recent
...@@ -394,7 +394,7 @@ Guidelines ...@@ -394,7 +394,7 @@ Guidelines
========== ==========
The guidelines below ensure proper single-touch and multi-finger functionality. The guidelines below ensure proper single-touch and multi-finger functionality.
For multi-touch functionality, see the multi-touch-protocol.txt document for For multi-touch functionality, see the multi-touch-protocol.rst document for
more information. more information.
Mice Mice
......
...@@ -16,8 +16,8 @@ goal is not to support these devices as if they were simple input-only devices ...@@ -16,8 +16,8 @@ goal is not to support these devices as if they were simple input-only devices
(as it is already the case), but to really enable the rendering of force (as it is already the case), but to really enable the rendering of force
effects. effects.
This document only describes the force feedback part of the Linux input This document only describes the force feedback part of the Linux input
interface. Please read joystick.txt and input.txt before reading further this interface. Please read joydev/joystick.rst and input.rst before reading further
document. this document.
Instructions to the user Instructions to the user
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
...@@ -36,7 +36,7 @@ should keep a hand on your device, in order to avoid it to break down if ...@@ -36,7 +36,7 @@ should keep a hand on your device, in order to avoid it to break down if
something goes wrong. something goes wrong.
If you have a serial iforce device, you need to start inputattach. See If you have a serial iforce device, you need to start inputattach. See
joystick.txt for details. joydev/joystick.rst for details.
Does it work ? Does it work ?
-------------- --------------
......
...@@ -21,7 +21,7 @@ choose which one to program the hardware to, starting from the more exotic ...@@ -21,7 +21,7 @@ choose which one to program the hardware to, starting from the more exotic
addresses is preferred, because the likelihood of clashing with the standard addresses is preferred, because the likelihood of clashing with the standard
0x201 address is smaller. 0x201 address is smaller.
Eg. if your driver supports addresses 0x200, 0x208, 0x210 and 0x218, then E.g. if your driver supports addresses 0x200, 0x208, 0x210 and 0x218, then
0x218 would be the address of first choice. 0x218 would be the address of first choice.
If your hardware supports a gameport address that is not mapped to ISA io If your hardware supports a gameport address that is not mapped to ISA io
...@@ -78,7 +78,7 @@ the gameport. To register a cooked gameport:: ...@@ -78,7 +78,7 @@ the gameport. To register a cooked gameport::
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
axes[i] = my_mmio[i]; axes[i] = my_mmio[i];
buttons[i] = my_mmio[4]; buttons[0] = my_mmio[4];
} }
int my_open(struct gameport *gameport, int mode) int my_open(struct gameport *gameport, int mode)
...@@ -117,25 +117,28 @@ Simple:: ...@@ -117,25 +117,28 @@ Simple::
The gameport structure The gameport structure
~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
.. note::
This section is outdated. There are several fields here that don't
match what's there at include/linux/gameport.h.
:: ::
struct gameport { struct gameport {
void *private; void *port_data;
A private pointer for free use in the gameport driver. (Not the joystick A private pointer for free use in the gameport driver. (Not the joystick
driver!) driver!)
:: ::
int number; char name[32];
Driver's name as set by driver calling gameport_set_name(). Informational
purpose only.
::
char phys[32];
Number assigned to the gameport when registered. Informational purpose only. gameport's physical name/description as set by driver calling gameport_set_phys().
Informational purpose only.
:: ::
...@@ -210,8 +213,16 @@ gameport. ...@@ -210,8 +213,16 @@ gameport.
:: ::
struct gameport_dev *dev; struct timer_list poll_timer;
struct gameport *next; unsigned int poll_interval; /* in msecs */
spinlock_t timer_lock;
unsigned int poll_cnt;
void (*poll_handler)(struct gameport *);
struct gameport *parent, *child;
struct gameport_driver *drv;
struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */
struct device dev;
struct list_head node;
For internal use by the gameport layer. For internal use by the gameport layer.
......
...@@ -120,7 +120,7 @@ Then there is the:: ...@@ -120,7 +120,7 @@ Then there is the::
call to tell those who receive the events that we've sent a complete report. call to tell those who receive the events that we've sent a complete report.
This doesn't seem important in the one button case, but is quite important This doesn't seem important in the one button case, but is quite important
for for example mouse movement, where you don't want the X and Y values for example for mouse movement, where you don't want the X and Y values
to be interpreted separately, because that'd result in a different movement. to be interpreted separately, because that'd result in a different movement.
dev->open() and dev->close() dev->open() and dev->close()
...@@ -128,7 +128,7 @@ dev->open() and dev->close() ...@@ -128,7 +128,7 @@ dev->open() and dev->close()
In case the driver has to repeatedly poll the device, because it doesn't In case the driver has to repeatedly poll the device, because it doesn't
have an interrupt coming from it and the polling is too expensive to be done have an interrupt coming from it and the polling is too expensive to be done
all the time, or if the device uses a valuable resource (eg. interrupt), it all the time, or if the device uses a valuable resource (e.g. interrupt), it
can use the open and close callback to know when it can stop polling or can use the open and close callback to know when it can stop polling or
release the interrupt and when it must resume polling or grab the interrupt release the interrupt and when it must resume polling or grab the interrupt
again. To do that, we would add this to our example driver:: again. To do that, we would add this to our example driver::
...@@ -161,7 +161,7 @@ makes sure that dev->open() is called only when the first user connects ...@@ -161,7 +161,7 @@ makes sure that dev->open() is called only when the first user connects
to the device and that dev->close() is called when the very last user to the device and that dev->close() is called when the very last user
disconnects. Calls to both callbacks are serialized. disconnects. Calls to both callbacks are serialized.
The open() callback should return a 0 in case of success or any nonzero value The open() callback should return a 0 in case of success or any non-zero value
in case of failure. The close() callback (which is void) must always succeed. in case of failure. The close() callback (which is void) must always succeed.
Inhibiting input devices Inhibiting input devices
...@@ -182,8 +182,8 @@ providing events to the input core. ...@@ -182,8 +182,8 @@ providing events to the input core.
Calling the device's close() method on inhibit (if there are users) allows the Calling the device's close() method on inhibit (if there are users) allows the
driver to save power. Either by directly powering down the device or by driver to save power. Either by directly powering down the device or by
releasing the runtime-pm reference it got in open() when the driver is using releasing the runtime-PM reference it got in open() when the driver is using
runtime-pm. runtime-PM.
Inhibiting and uninhibiting are orthogonal to opening and closing the device by Inhibiting and uninhibiting are orthogonal to opening and closing the device by
input handlers. Userspace might want to inhibit a device in anticipation before input handlers. Userspace might want to inhibit a device in anticipation before
...@@ -219,8 +219,8 @@ It's reported to the input system via:: ...@@ -219,8 +219,8 @@ It's reported to the input system via::
input_report_key(struct input_dev *dev, int code, int value) input_report_key(struct input_dev *dev, int code, int value)
See uapi/linux/input-event-codes.h for the allowable values of code (from 0 to See uapi/linux/input-event-codes.h for the allowable values of code (from 0 to
KEY_MAX). Value is interpreted as a truth value, ie any nonzero value means key KEY_MAX). Value is interpreted as a truth value, i.e. any non-zero value means
pressed, zero value means key released. The input code generates events only key pressed, zero value means key released. The input code generates events only
in case the value is different from before. in case the value is different from before.
In addition to EV_KEY, there are two more basic event types: EV_REL and In addition to EV_KEY, there are two more basic event types: EV_REL and
...@@ -231,12 +231,12 @@ because it doesn't have any absolute coordinate system to work in. Absolute ...@@ -231,12 +231,12 @@ because it doesn't have any absolute coordinate system to work in. Absolute
events are namely for joysticks and digitizers - devices that do work in an events are namely for joysticks and digitizers - devices that do work in an
absolute coordinate systems. absolute coordinate systems.
Having the device report EV_REL buttons is as simple as with EV_KEY, simply Having the device report EV_REL buttons is as simple as with EV_KEY; simply
set the corresponding bits and call the:: set the corresponding bits and call the::
input_report_rel(struct input_dev *dev, int code, int value) input_report_rel(struct input_dev *dev, int code, int value)
function. Events are generated only for nonzero value. function. Events are generated only for non-zero values.
However EV_ABS requires a little special care. Before calling However EV_ABS requires a little special care. Before calling
input_register_device, you have to fill additional fields in the input_dev input_register_device, you have to fill additional fields in the input_dev
...@@ -280,7 +280,7 @@ device driver. It's a string like 'Generic button device' containing a ...@@ -280,7 +280,7 @@ device driver. It's a string like 'Generic button device' containing a
user friendly name of the device. user friendly name of the device.
The id* fields contain the bus ID (PCI, USB, ...), vendor ID and device ID The id* fields contain the bus ID (PCI, USB, ...), vendor ID and device ID
of the device. The bus IDs are defined in input.h. The vendor and device ids of the device. The bus IDs are defined in input.h. The vendor and device IDs
are defined in pci_ids.h, usb_ids.h and similar include files. These fields are defined in pci_ids.h, usb_ids.h and similar include files. These fields
should be set by the input device driver before registering it. should be set by the input device driver before registering it.
......
...@@ -9,7 +9,7 @@ Introduction ...@@ -9,7 +9,7 @@ Introduction
Architecture Architecture
============ ============
Input subsystem a collection of drivers that is designed to support Input subsystem is a collection of drivers that is designed to support
all input devices under Linux. Most of the drivers reside in all input devices under Linux. Most of the drivers reside in
drivers/input, although quite a few live in drivers/hid and drivers/input, although quite a few live in drivers/hid and
drivers/platform. drivers/platform.
...@@ -50,7 +50,7 @@ will be available as a character device on major 13, minor 63:: ...@@ -50,7 +50,7 @@ will be available as a character device on major 13, minor 63::
crw-r--r-- 1 root root 13, 63 Mar 28 22:45 mice crw-r--r-- 1 root root 13, 63 Mar 28 22:45 mice
This device usually created automatically by the system. The commands This device is usually created automatically by the system. The commands
to create it by hand are:: to create it by hand are::
cd /dev cd /dev
...@@ -180,7 +180,7 @@ whole suite. It handles all HID devices, and because there is a very ...@@ -180,7 +180,7 @@ whole suite. It handles all HID devices, and because there is a very
wide variety of them, and because the USB HID specification isn't wide variety of them, and because the USB HID specification isn't
simple, it needs to be this big. simple, it needs to be this big.
Currently, it handles USB mice, joysticks, gamepads, steering wheels Currently, it handles USB mice, joysticks, gamepads, steering wheels,
keyboards, trackballs and digitizers. keyboards, trackballs and digitizers.
However, USB uses HID also for monitor controls, speaker controls, UPSs, However, USB uses HID also for monitor controls, speaker controls, UPSs,
...@@ -268,7 +268,7 @@ events on a read. Their layout is:: ...@@ -268,7 +268,7 @@ events on a read. Their layout is::
}; };
``time`` is the timestamp, it returns the time at which the event happened. ``time`` is the timestamp, it returns the time at which the event happened.
Type is for example EV_REL for relative moment, EV_KEY for a keypress or Type is for example EV_REL for relative movement, EV_KEY for a keypress or
release. More types are defined in include/uapi/linux/input-event-codes.h. release. More types are defined in include/uapi/linux/input-event-codes.h.
``code`` is event code, for example REL_X or KEY_BACKSPACE, again a complete ``code`` is event code, for example REL_X or KEY_BACKSPACE, again a complete
......
...@@ -261,7 +261,7 @@ ABS_MT_PRESSURE ...@@ -261,7 +261,7 @@ ABS_MT_PRESSURE
signal intensity distribution. signal intensity distribution.
If the resolution is zero, the pressure data is in arbitrary units. If the resolution is zero, the pressure data is in arbitrary units.
If the resolution is nonzero, the pressure data is in units/gram. See If the resolution is non-zero, the pressure data is in units/gram. See
:ref:`input-event-codes` for details. :ref:`input-event-codes` for details.
ABS_MT_DISTANCE ABS_MT_DISTANCE
...@@ -279,14 +279,14 @@ ABS_MT_ORIENTATION ...@@ -279,14 +279,14 @@ ABS_MT_ORIENTATION
max should be returned; when aligned with the X axis in the negative max should be returned; when aligned with the X axis in the negative
direction, the range -max should be returned. direction, the range -max should be returned.
Touch ellipsis are symmetrical by default. For devices capable of true 360 Touch ellipses are symmetrical by default. For devices capable of true 360
degree orientation, the reported orientation must exceed the range max to degree orientation, the reported orientation must exceed the range max to
indicate more than a quarter of a revolution. For an upside-down finger, indicate more than a quarter of a revolution. For an upside-down finger,
range max * 2 should be returned. range max * 2 should be returned.
Orientation can be omitted if the touch area is circular, or if the Orientation can be omitted if the touch area is circular, or if the
information is not available in the kernel driver. Partial orientation information is not available in the kernel driver. Partial orientation
support is possible if the device can distinguish between the two axis, but support is possible if the device can distinguish between the two axes, but
not (uniquely) any values in between. In such cases, the range of not (uniquely) any values in between. In such cases, the range of
ABS_MT_ORIENTATION should be [0, 1] [#f4]_. ABS_MT_ORIENTATION should be [0, 1] [#f4]_.
...@@ -356,7 +356,7 @@ The range of ABS_MT_ORIENTATION should be set to [0, 1], to indicate that ...@@ -356,7 +356,7 @@ The range of ABS_MT_ORIENTATION should be set to [0, 1], to indicate that
the device can distinguish between a finger along the Y axis (0) and a the device can distinguish between a finger along the Y axis (0) and a
finger along the X axis (1). finger along the X axis (1).
For win8 devices with both T and C coordinates, the position mapping is:: For Win8 devices with both T and C coordinates, the position mapping is::
ABS_MT_POSITION_X := T_X ABS_MT_POSITION_X := T_X
ABS_MT_POSITION_Y := T_Y ABS_MT_POSITION_Y := T_Y
......
...@@ -4,11 +4,12 @@ Keyboard notifier ...@@ -4,11 +4,12 @@ Keyboard notifier
One can use register_keyboard_notifier to get called back on keyboard One can use register_keyboard_notifier to get called back on keyboard
events (see kbd_keycode() function for details). The passed structure is events (see kbd_keycode() function for details). The passed structure is
keyboard_notifier_param: keyboard_notifier_param (see <linux/keyboard.h>):
- 'vc' always provide the VC for which the keyboard event applies; - 'vc' always provide the VC for which the keyboard event applies;
- 'down' is 1 for a key press event, 0 for a key release; - 'down' is 1 for a key press event, 0 for a key release;
- 'shift' is the current modifier state, mask bit indexes are KG_*; - 'shift' is the current modifier state, mask bit indexes are KG_*;
- 'ledstate' is the current LED state;
- 'value' depends on the type of event. - 'value' depends on the type of event.
- KBD_KEYCODE events are always sent before other events, value is the keycode. - KBD_KEYCODE events are always sent before other events, value is the keycode.
......
...@@ -179,7 +179,7 @@ uinput old interface ...@@ -179,7 +179,7 @@ uinput old interface
-------------------- --------------------
Before uinput version 5, there wasn't a dedicated ioctl to set up a virtual Before uinput version 5, there wasn't a dedicated ioctl to set up a virtual
device. Programs supportinf older versions of uinput interface need to fill device. Programs supporting older versions of uinput interface need to fill
a uinput_user_dev structure and write it to the uinput file descriptor to a uinput_user_dev structure and write it to the uinput file descriptor to
configure the new uinput device. New code should not use the old interface configure the new uinput device. New code should not use the old interface
but interact with uinput via ioctl calls, or use libevdev. but interact with uinput via ioctl calls, or use libevdev.
......
...@@ -23,7 +23,7 @@ from 93.75 mA to 1500 mA.The Flash currents are adjusted via the CURRENT ...@@ -23,7 +23,7 @@ from 93.75 mA to 1500 mA.The Flash currents are adjusted via the CURRENT
CONTROL REGISTER(0x09).Flash mode is activated by the ENABLE REGISTER(0x0A), CONTROL REGISTER(0x09).Flash mode is activated by the ENABLE REGISTER(0x0A),
or by pulling the STROBE pin HIGH. or by pulling the STROBE pin HIGH.
LM3556 Flash can be controlled through sys/class/leds/flash/brightness file LM3556 Flash can be controlled through /sys/class/leds/flash/brightness file
* if STROBE pin is enabled, below example control brightness only, and * if STROBE pin is enabled, below example control brightness only, and
ON / OFF will be controlled by STROBE pin. ON / OFF will be controlled by STROBE pin.
...@@ -32,17 +32,17 @@ Flash Example: ...@@ -32,17 +32,17 @@ Flash Example:
OFF:: OFF::
#echo 0 > sys/class/leds/flash/brightness #echo 0 > /sys/class/leds/flash/brightness
93.75 mA:: 93.75 mA::
#echo 1 > sys/class/leds/flash/brightness #echo 1 > /sys/class/leds/flash/brightness
... ...
1500 mA:: 1500 mA::
#echo 16 > sys/class/leds/flash/brightness #echo 16 > /sys/class/leds/flash/brightness
Torch Mode Torch Mode
^^^^^^^^^^ ^^^^^^^^^^
...@@ -51,7 +51,7 @@ In Torch Mode, the current source(LED) is programmed via the CURRENT CONTROL ...@@ -51,7 +51,7 @@ In Torch Mode, the current source(LED) is programmed via the CURRENT CONTROL
REGISTER(0x09).Torch Mode is activated by the ENABLE REGISTER(0x0A) or by the REGISTER(0x09).Torch Mode is activated by the ENABLE REGISTER(0x0A) or by the
hardware TORCH input. hardware TORCH input.
LM3556 torch can be controlled through sys/class/leds/torch/brightness file. LM3556 torch can be controlled through /sys/class/leds/torch/brightness file.
* if TORCH pin is enabled, below example control brightness only, * if TORCH pin is enabled, below example control brightness only,
and ON / OFF will be controlled by TORCH pin. and ON / OFF will be controlled by TORCH pin.
...@@ -59,22 +59,22 @@ Torch Example: ...@@ -59,22 +59,22 @@ Torch Example:
OFF:: OFF::
#echo 0 > sys/class/leds/torch/brightness #echo 0 > /sys/class/leds/torch/brightness
46.88 mA:: 46.88 mA::
#echo 1 > sys/class/leds/torch/brightness #echo 1 > /sys/class/leds/torch/brightness
... ...
375 mA:: 375 mA::
#echo 8 > sys/class/leds/torch/brightness #echo 8 > /sys/class/leds/torch/brightness
Indicator Mode Indicator Mode
^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
Indicator pattern can be set through sys/class/leds/indicator/pattern file, Indicator pattern can be set through /sys/class/leds/indicator/pattern file,
and 4 patterns are pre-defined in indicator_pattern array. and 4 patterns are pre-defined in indicator_pattern array.
According to N-lank, Pulse time and N Period values, different pattern wiill According to N-lank, Pulse time and N Period values, different pattern wiill
...@@ -87,13 +87,13 @@ Indicator pattern example: ...@@ -87,13 +87,13 @@ Indicator pattern example:
pattern 0:: pattern 0::
#echo 0 > sys/class/leds/indicator/pattern #echo 0 > /sys/class/leds/indicator/pattern
... ...
pattern 3:: pattern 3::
#echo 3 > sys/class/leds/indicator/pattern #echo 3 > /sys/class/leds/indicator/pattern
Indicator brightness can be controlled through Indicator brightness can be controlled through
sys/class/leds/indicator/brightness file. sys/class/leds/indicator/brightness file.
...@@ -102,17 +102,17 @@ Example: ...@@ -102,17 +102,17 @@ Example:
OFF:: OFF::
#echo 0 > sys/class/leds/indicator/brightness #echo 0 > /sys/class/leds/indicator/brightness
5.86 mA:: 5.86 mA::
#echo 1 > sys/class/leds/indicator/brightness #echo 1 > /sys/class/leds/indicator/brightness
... ...
46.875mA:: 46.875mA::
#echo 8 > sys/class/leds/indicator/brightness #echo 8 > /sys/class/leds/indicator/brightness
Notes Notes
----- -----
......
...@@ -165,8 +165,8 @@ In-flight parent objects ...@@ -165,8 +165,8 @@ In-flight parent objects
Sometimes it may not be convenient or possible to allocate shadow Sometimes it may not be convenient or possible to allocate shadow
variables alongside their parent objects. Or a livepatch fix may variables alongside their parent objects. Or a livepatch fix may
require shadow varibles to only a subset of parent object instances. In require shadow variables for only a subset of parent object instances.
these cases, the klp_shadow_get_or_alloc() call can be used to attach In these cases, the klp_shadow_get_or_alloc() call can be used to attach
shadow variables to parents already in-flight. shadow variables to parents already in-flight.
For commit 1d147bfa6429, a good spot to allocate a shadow spinlock is For commit 1d147bfa6429, a good spot to allocate a shadow spinlock is
......
...@@ -94,7 +94,7 @@ should: ...@@ -94,7 +94,7 @@ should:
a) add your platform support as a _boolean_ option in a) add your platform support as a _boolean_ option in
arch/powerpc/Kconfig, following the example of PPC_PSERIES, arch/powerpc/Kconfig, following the example of PPC_PSERIES,
PPC_PMAC and PPC_MAPLE. The later is probably a good PPC_PMAC and PPC_MAPLE. The latter is probably a good
example of a board support to start from. example of a board support to start from.
b) create your main platform file as b) create your main platform file as
......
...@@ -4,7 +4,7 @@ DAWR issues on POWER9 ...@@ -4,7 +4,7 @@ DAWR issues on POWER9
On POWER9 the Data Address Watchpoint Register (DAWR) can cause a checkstop On POWER9 the Data Address Watchpoint Register (DAWR) can cause a checkstop
if it points to cache inhibited (CI) memory. Currently Linux has no way to if it points to cache inhibited (CI) memory. Currently Linux has no way to
disinguish CI memory when configuring the DAWR, so (for now) the DAWR is distinguish CI memory when configuring the DAWR, so (for now) the DAWR is
disabled by this commit:: disabled by this commit::
commit 9654153158d3e0684a1bdb76dbababdb7111d5a0 commit 9654153158d3e0684a1bdb76dbababdb7111d5a0
......
...@@ -73,7 +73,7 @@ return all-ff's (0xff, 0xffff, 0xffffffff for 8/16/32-bit reads). ...@@ -73,7 +73,7 @@ return all-ff's (0xff, 0xffff, 0xffffffff for 8/16/32-bit reads).
This value was chosen because it is the same value you would This value was chosen because it is the same value you would
get if the device was physically unplugged from the slot. get if the device was physically unplugged from the slot.
This includes access to PCI memory, I/O space, and PCI config This includes access to PCI memory, I/O space, and PCI config
space. Interrupts; however, will continued to be delivered. space. Interrupts; however, will continue to be delivered.
Detection and recovery are performed with the aid of ppc64 Detection and recovery are performed with the aid of ppc64
firmware. The programming interfaces in the Linux kernel firmware. The programming interfaces in the Linux kernel
......
...@@ -8,7 +8,7 @@ capabilities and information which can be used by a bootloader or userland. ...@@ -8,7 +8,7 @@ capabilities and information which can be used by a bootloader or userland.
Types and Descriptors Types and Descriptors
--------------------- ---------------------
The types to be used with the "PowerPC" namesapce are defined in [#f1]_. The types to be used with the "PowerPC" namespace are defined in [#f1]_.
1) PPC_ELFNOTE_CAPABILITIES 1) PPC_ELFNOTE_CAPABILITIES
......
...@@ -171,7 +171,7 @@ that were present in CMA region:: ...@@ -171,7 +171,7 @@ that were present in CMA region::
(meta area) | (meta area) |
| |
| |
Metadata: This area holds a metadata struture whose Metadata: This area holds a metadata structure whose
address is registered with f/w and retrieved in the address is registered with f/w and retrieved in the
second kernel after crash, on platforms that support second kernel after crash, on platforms that support
tags (OPAL). Having such structure with info needed tags (OPAL). Having such structure with info needed
...@@ -207,7 +207,7 @@ Currently the dump will be copied from /proc/vmcore to a new file upon ...@@ -207,7 +207,7 @@ Currently the dump will be copied from /proc/vmcore to a new file upon
user intervention. The dump data available through /proc/vmcore will be user intervention. The dump data available through /proc/vmcore will be
in ELF format. Hence the existing kdump infrastructure (kdump scripts) in ELF format. Hence the existing kdump infrastructure (kdump scripts)
to save the dump works fine with minor modifications. KDump scripts on to save the dump works fine with minor modifications. KDump scripts on
major Distro releases have already been modified to work seemlessly (no major Distro releases have already been modified to work seamlessly (no
user intervention in saving the dump) when FADump is used, instead of user intervention in saving the dump) when FADump is used, instead of
KDump, as dump mechanism. KDump, as dump mechanism.
......
...@@ -38,5 +38,5 @@ bit of the entropy to decide the index of the 64M zone. Then we chose a ...@@ -38,5 +38,5 @@ bit of the entropy to decide the index of the 64M zone. Then we chose a
kernstart_virt_addr kernstart_virt_addr
To enable KASLR, set CONFIG_RANDOMIZE_BASE = y. If KASLR is enable and you To enable KASLR, set CONFIG_RANDOMIZE_BASE = y. If KASLR is enabled and you
want to disable it at runtime, add "nokaslr" to the kernel cmdline. want to disable it at runtime, add "nokaslr" to the kernel cmdline.
...@@ -34,7 +34,7 @@ To compile/use : ...@@ -34,7 +34,7 @@ To compile/use :
Some remarks: Some remarks:
- The port is named mpc52xxx, and config options are PPC_MPC52xx. The MGT5100 - The port is named mpc52xxx, and config options are PPC_MPC52xx. The MGT5100
is not supported, and I'm not sure anyone is interesting in working on it is not supported, and I'm not sure anyone is interested in working on it
so. I didn't took 5xxx because there's apparently a lot of 5xxx that have so. I didn't took 5xxx because there's apparently a lot of 5xxx that have
nothing to do with the MPC5200. I also included the 'MPC' for the same nothing to do with the MPC5200. I also included the 'MPC' for the same
reason. reason.
......
...@@ -40,7 +40,7 @@ and any in-arguments for the hcall are provided in registers *r4-r12*. If values ...@@ -40,7 +40,7 @@ and any in-arguments for the hcall are provided in registers *r4-r12*. If values
have to be passed through a memory buffer, the data stored in that buffer should be have to be passed through a memory buffer, the data stored in that buffer should be
in Big-endian byte order. in Big-endian byte order.
Once control is returns back to the guest after hypervisor has serviced the Once control returns back to the guest after hypervisor has serviced the
'HVCS' instruction the return value of the hcall is available in *r3* and any 'HVCS' instruction the return value of the hcall is available in *r3* and any
out values are returned in registers *r4-r12*. Again like in case of in-arguments, out values are returned in registers *r4-r12*. Again like in case of in-arguments,
any out values stored in a memory buffer will be in Big-endian byte order. any out values stored in a memory buffer will be in Big-endian byte order.
...@@ -147,7 +147,7 @@ corresponding opcode values please look into the arch specific header [4]_: ...@@ -147,7 +147,7 @@ corresponding opcode values please look into the arch specific header [4]_:
| Out: *numBytesRead* | Out: *numBytesRead*
| Return Value: *H_Success, H_Parameter, H_P2, H_P3, H_Hardware* | Return Value: *H_Success, H_Parameter, H_P2, H_P3, H_Hardware*
Given a DRC Index of an NVDIMM, read N-bytes from the the metadata area Given a DRC Index of an NVDIMM, read N-bytes from the metadata area
associated with it, at a specified offset and copy it to provided buffer. associated with it, at a specified offset and copy it to provided buffer.
The metadata area stores configuration information such as label information, The metadata area stores configuration information such as label information,
bad-blocks etc. The metadata area is located out-of-band of NVDIMM storage bad-blocks etc. The metadata area is located out-of-band of NVDIMM storage
......
...@@ -189,7 +189,7 @@ kernel aborted a transaction: ...@@ -189,7 +189,7 @@ kernel aborted a transaction:
====================== ================================ ====================== ================================
These can be checked by the user program's abort handler as TEXASR[0:7]. If These can be checked by the user program's abort handler as TEXASR[0:7]. If
bit 7 is set, it indicates that the error is consider persistent. For example bit 7 is set, it indicates that the error is considered persistent. For example
a TM_CAUSE_ALIGNMENT will be persistent while a TM_CAUSE_RESCHED will not. a TM_CAUSE_ALIGNMENT will be persistent while a TM_CAUSE_RESCHED will not.
GDB GDB
...@@ -271,4 +271,4 @@ with these lines: ...@@ -271,4 +271,4 @@ with these lines:
hrfid and mtmsrd have the same quirk. hrfid and mtmsrd have the same quirk.
The Linux kernel uses this quirk in it's early exception handling. The Linux kernel uses this quirk in its early exception handling.
...@@ -341,6 +341,16 @@ that you have sent your patches to the right place. Wait for a minimum of ...@@ -341,6 +341,16 @@ that you have sent your patches to the right place. Wait for a minimum of
one week before resubmitting or pinging reviewers - possibly longer during one week before resubmitting or pinging reviewers - possibly longer during
busy times like merge windows. busy times like merge windows.
It's also ok to resend the patch or the patch series after a couple of
weeks with the word "RESEND" added to the subject line::
[PATCH Vx RESEND] sub/sys: Condensed patch summary
Don't add "RESEND" when you are submitting a modified version of your
patch or patch series - "RESEND" only applies to resubmission of a
patch or patch series which have not been modified in any way from the
previous submission.
Include PATCH in the subject Include PATCH in the subject
----------------------------- -----------------------------
...@@ -625,16 +635,19 @@ not considered part of the summary phrase, but describe how the patch ...@@ -625,16 +635,19 @@ not considered part of the summary phrase, but describe how the patch
should be treated. Common tags might include a version descriptor if should be treated. Common tags might include a version descriptor if
the multiple versions of the patch have been sent out in response to the multiple versions of the patch have been sent out in response to
comments (i.e., "v1, v2, v3"), or "RFC" to indicate a request for comments (i.e., "v1, v2, v3"), or "RFC" to indicate a request for
comments. If there are four patches in a patch series the individual comments.
patches may be numbered like this: 1/4, 2/4, 3/4, 4/4. This assures
that developers understand the order in which the patches should be
applied and that they have reviewed or applied all of the patches in
the patch series.
A couple of example Subjects:: If there are four patches in a patch series the individual patches may
be numbered like this: 1/4, 2/4, 3/4, 4/4. This assures that developers
understand the order in which the patches should be applied and that
they have reviewed or applied all of the patches in the patch series.
Here are some good example Subjects::
Subject: [PATCH 2/5] ext2: improve scalability of bitmap searching Subject: [PATCH 2/5] ext2: improve scalability of bitmap searching
Subject: [PATCH v2 01/27] x86: fix eflags tracking Subject: [PATCH v2 01/27] x86: fix eflags tracking
Subject: [PATCH v2] sub/sys: Condensed patch summary
Subject: [PATCH v2 M/N] sub/sys: Condensed patch summary
The ``from`` line must be the very first line in the message body, The ``from`` line must be the very first line in the message body,
and has the form: and has the form:
...@@ -647,34 +660,54 @@ then the ``From:`` line from the email header will be used to determine ...@@ -647,34 +660,54 @@ then the ``From:`` line from the email header will be used to determine
the patch author in the changelog. the patch author in the changelog.
The explanation body will be committed to the permanent source The explanation body will be committed to the permanent source
changelog, so should make sense to a competent reader who has long changelog, so should make sense to a competent reader who has long since
since forgotten the immediate details of the discussion that might forgotten the immediate details of the discussion that might have led to
have led to this patch. Including symptoms of the failure which the this patch. Including symptoms of the failure which the patch addresses
patch addresses (kernel log messages, oops messages, etc.) is (kernel log messages, oops messages, etc.) are especially useful for
especially useful for people who might be searching the commit logs people who might be searching the commit logs looking for the applicable
looking for the applicable patch. If a patch fixes a compile failure, patch. The text should be written in such detail so that when read
it may not be necessary to include _all_ of the compile failures; just weeks, months or even years later, it can give the reader the needed
enough that it is likely that someone searching for the patch can find details to grasp the reasoning for **why** the patch was created.
it. As in the ``summary phrase``, it is important to be both succinct as
well as descriptive. If a patch fixes a compile failure, it may not be necessary to include
_all_ of the compile failures; just enough that it is likely that
The ``---`` marker line serves the essential purpose of marking for patch someone searching for the patch can find it. As in the ``summary
handling tools where the changelog message ends. phrase``, it is important to be both succinct as well as descriptive.
One good use for the additional comments after the ``---`` marker is for The ``---`` marker line serves the essential purpose of marking for
a ``diffstat``, to show what files have changed, and the number of patch handling tools where the changelog message ends.
One good use for the additional comments after the ``---`` marker is
for a ``diffstat``, to show what files have changed, and the number of
inserted and deleted lines per file. A ``diffstat`` is especially useful inserted and deleted lines per file. A ``diffstat`` is especially useful
on bigger patches. Other comments relevant only to the moment or the on bigger patches. If you are going to include a ``diffstat`` after the
maintainer, not suitable for the permanent changelog, should also go ``---`` marker, please use ``diffstat`` options ``-p 1 -w 70`` so that
here. A good example of such comments might be ``patch changelogs`` filenames are listed from the top of the kernel source tree and don't
which describe what has changed between the v1 and v2 version of the use too much horizontal space (easily fit in 80 columns, maybe with some
patch. indentation). (``git`` generates appropriate diffstats by default.)
If you are going to include a ``diffstat`` after the ``---`` marker, please Other comments relevant only to the moment or the maintainer, not
use ``diffstat`` options ``-p 1 -w 70`` so that filenames are listed from suitable for the permanent changelog, should also go here. A good
the top of the kernel source tree and don't use too much horizontal example of such comments might be ``patch changelogs`` which describe
space (easily fit in 80 columns, maybe with some indentation). (``git`` what has changed between the v1 and v2 version of the patch.
generates appropriate diffstats by default.)
Please put this information **after** the ``---`` line which separates
the changelog from the rest of the patch. The version information is
not part of the changelog which gets committed to the git tree. It is
additional information for the reviewers. If it's placed above the
commit tags, it needs manual interaction to remove it. If it is below
the separator line, it gets automatically stripped off when applying the
patch::
<commit message>
...
Signed-off-by: Author <author@mail>
---
V2 -> V3: Removed redundant helper function
V1 -> V2: Cleaned up coding style and addressed review comments
path/to/file | 5+++--
...
See more details on the proper patch format in the following See more details on the proper patch format in the following
references. references.
......
...@@ -220,7 +220,7 @@ Older Version : 2.20.4.5 (scsi module), 2.20.2.5 (cmm module) ...@@ -220,7 +220,7 @@ Older Version : 2.20.4.5 (scsi module), 2.20.2.5 (cmm module)
4. Use the pre defined DMA mask constants from dma-mapping.h 4. Use the pre defined DMA mask constants from dma-mapping.h
Use the DMA_{64,32}BIT_MASK constants from dma-mapping.h when calling Use the DMA_{64,32}BIT_MASK constants from dma-mapping.h when calling
pci_set_dma_mask() or pci_set_consistend_dma_mask(). See pci_set_dma_mask() or pci_set_consistent_dma_mask(). See
http://marc.theaimsgroup.com/?t=108001993000001&r=1&w=2 for more http://marc.theaimsgroup.com/?t=108001993000001&r=1&w=2 for more
details. details.
Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch> Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
......
...@@ -22,7 +22,7 @@ u""" ...@@ -22,7 +22,7 @@ u"""
* *auto span* rightmost cell of a table row over the missing cells on the * *auto span* rightmost cell of a table row over the missing cells on the
right side of that table-row. With Option ``:fill-cells:`` this behavior right side of that table-row. With Option ``:fill-cells:`` this behavior
can changed from *auto span* to *auto fill*, which automaticly inserts can be changed from *auto span* to *auto fill*, which automatically inserts
(empty) cells instead of spanning the last cell. (empty) cells instead of spanning the last cell.
Options: Options:
...@@ -161,7 +161,7 @@ class ListTableBuilder(object): ...@@ -161,7 +161,7 @@ class ListTableBuilder(object):
for colwidth in colwidths: for colwidth in colwidths:
colspec = nodes.colspec(colwidth=colwidth) colspec = nodes.colspec(colwidth=colwidth)
# FIXME: It seems, that the stub method only works well in the # FIXME: It seems, that the stub method only works well in the
# absence of rowspan (observed by the html buidler, the docutils-xml # absence of rowspan (observed by the html builder, the docutils-xml
# build seems OK). This is not extraordinary, because there exists # build seems OK). This is not extraordinary, because there exists
# no table directive (except *this* flat-table) which allows to # no table directive (except *this* flat-table) which allows to
# define coexistent of rowspan and stubs (there was no use-case # define coexistent of rowspan and stubs (there was no use-case
......
...@@ -11,7 +11,7 @@ develop firmware for this, and flash it using this adapter cable. ...@@ -11,7 +11,7 @@ develop firmware for this, and flash it using this adapter cable.
You can make this adapter from an old printer cable and solder things You can make this adapter from an old printer cable and solder things
directly to the Butterfly. Or (if you have the parts and skills) you directly to the Butterfly. Or (if you have the parts and skills) you
can come up with something fancier, providing ciruit protection to the can come up with something fancier, providing circuit protection to the
Butterfly and the printer port, or with a better power supply than two Butterfly and the printer port, or with a better power supply than two
signal pins from the printer port. Or for that matter, you can use signal pins from the printer port. Or for that matter, you can use
similar cables to talk to many AVR boards, even a breadboard. similar cables to talk to many AVR boards, even a breadboard.
......
...@@ -330,17 +330,17 @@ la lista di celle che compongono la *riga* stessa. Fanno eccezione i *commenti* ...@@ -330,17 +330,17 @@ la lista di celle che compongono la *riga* stessa. Fanno eccezione i *commenti*
- head col 3 - head col 3
- head col 4 - head col 4
* - column 1 * - row 1
- field 1.1 - field 1.1
- field 1.2 with autospan - field 1.2 with autospan
* - column 2 * - row 2
- field 2.1 - field 2.1
- :rspan:`1` :cspan:`1` field 2.2 - 3.3 - :rspan:`1` :cspan:`1` field 2.2 - 3.3
* .. _`it last row`: * .. _`it last row`:
- column 3 - row 3
Che verrà rappresentata nel seguente modo: Che verrà rappresentata nel seguente modo:
...@@ -352,37 +352,46 @@ Che verrà rappresentata nel seguente modo: ...@@ -352,37 +352,46 @@ Che verrà rappresentata nel seguente modo:
- head col 3 - head col 3
- head col 4 - head col 4
* - column 1 * - row 1
- field 1.1 - field 1.1
- field 1.2 with autospan - field 1.2 with autospan
* - column 2 * - row 2
- field 2.1 - field 2.1
- :rspan:`1` :cspan:`1` field 2.2 - 3.3 - :rspan:`1` :cspan:`1` field 2.2 - 3.3
* .. _`it last row`: * .. _`it last row`:
- column 3 - row 3
Riferimenti incrociati Riferimenti incrociati
---------------------- ----------------------
Per fare dei riferimenti incrociati da una pagina ad un'altra Aggiungere un riferimento incrociato da una pagina della
specificando il percorso a partire dalla cartella *Documentation*. documentazione ad un'altra può essere fatto scrivendo il percorso al
Per esempio, se volete aggiungere un riferimento a questa pagina file corrispondende, non serve alcuna sintassi speciale. Si possono
(l'estensione .rst è opzionale):: usare sia percorsi assoluti che relativi. Quelli assoluti iniziano con
"documentation/". Per esempio, potete fare riferimento a questo
documento in uno dei seguenti modi (da notare che l'estensione
``.rst`` è necessaria)::
See Documentation/translations/it_IT/doc-guide/sphinx.rst. Vedere Documentation/doc-guide/sphinx.rst. Questo funziona sempre
Guardate pshinx.rst, che si trova nella stessa cartella.
Leggete ../sphinx.rst, che si trova nella cartella precedente.
Se preferite usare un percorso relative allora vi serve la direttiva Se volete che il collegamento abbia un testo diverso rispetto al
Sphinx ``doc``. Per esempio, se volete aggiungere un riferimento a titolo del documento, allora dovrete usare la direttiva Sphinx
questa pagina dalla stessa cartella:: ``doc``. Per esempio::
See :doc:`sphinx`. Vedere :doc:`il mio testo per il collegamento <sphinx>`.
Per maggiori informazioni su come aggiungere riferimenti incrociati a Nella maggioranza dei casi si consiglia il primo metodo perché è più
commenti kernel-doc di funzioni o tipi, leggete pulito ed adatto a chi legge dai sorgenti. Se incontrare un ``:doc:``
Documentation/translations/it_IT/doc-guide/sphinx.rst. che non da alcun valore, sentitevi liberi di convertirlo in un
percorso al documento.
Per informazioni riguardo ai riferimenti incrociati ai commenti
kernel-doc per funzioni o tipi, consultate
.. _it_sphinx_kfigure: .. _it_sphinx_kfigure:
...@@ -391,7 +400,7 @@ Figure ed immagini ...@@ -391,7 +400,7 @@ Figure ed immagini
Se volete aggiungere un'immagine, utilizzate le direttive ``kernel-figure`` Se volete aggiungere un'immagine, utilizzate le direttive ``kernel-figure``
e ``kernel-image``. Per esempio, per inserire una figura di un'immagine in e ``kernel-image``. Per esempio, per inserire una figura di un'immagine in
formato SVG:: formato SVG (:ref:`it_svg_image_example`)::
.. kernel-figure:: ../../../doc-guide/svg_image.svg .. kernel-figure:: ../../../doc-guide/svg_image.svg
:alt: una semplice immagine SVG :alt: una semplice immagine SVG
......
...@@ -369,7 +369,7 @@ all'inizio dell'avvio del sistema è attraverso la procedura ...@@ -369,7 +369,7 @@ all'inizio dell'avvio del sistema è attraverso la procedura
Prima di inventare la vostra cache per gli oggetti più usati, considerate Prima di inventare la vostra cache per gli oggetti più usati, considerate
l'uso di una cache slab disponibile in ``include/linux/slab.h``. l'uso di una cache slab disponibile in ``include/linux/slab.h``.
:c:func:`current()` :c:macro:`current`
------------------- -------------------
Definita in ``include/asm/current.h`` Definita in ``include/asm/current.h``
......
...@@ -127,11 +127,11 @@ il vostro processo si auto-sospenderà; verrà riattivato quando il mutex ...@@ -127,11 +127,11 @@ il vostro processo si auto-sospenderà; verrà riattivato quando il mutex
verrà rilasciato. Questo significa che il processore potrà occuparsi d'altro verrà rilasciato. Questo significa che il processore potrà occuparsi d'altro
mentre il vostro processo è in attesa. Esistono molti casi in cui non potete mentre il vostro processo è in attesa. Esistono molti casi in cui non potete
permettervi di sospendere un processo (vedere permettervi di sospendere un processo (vedere
:ref:`Quali funzioni possono essere chiamate in modo sicuro dalle interruzioni? <it_sleeping-things>`) `Quali funzioni possono essere chiamate in modo sicuro dalle interruzioni?`_)
e quindi dovrete utilizzare gli spinlock. e quindi dovrete utilizzare gli spinlock.
Nessuno di questi *lock* è ricorsivo: vedere Nessuno di questi *lock* è ricorsivo: vedere
:ref:`Stallo: semplice ed avanzato <it_deadlock>` `Stallo: semplice ed avanzato`_
I *lock* e i kernel per sistemi monoprocessore I *lock* e i kernel per sistemi monoprocessore
---------------------------------------------- ----------------------------------------------
...@@ -190,7 +190,7 @@ perfetto questa funzione si chiamerebbe 'spin_lock_softirq()'). ...@@ -190,7 +190,7 @@ perfetto questa funzione si chiamerebbe 'spin_lock_softirq()').
Da notare che in questo caso potete utilizzare anche spin_lock_irq() Da notare che in questo caso potete utilizzare anche spin_lock_irq()
o spin_lock_irqsave(), queste fermano anche le interruzioni hardware: o spin_lock_irqsave(), queste fermano anche le interruzioni hardware:
vedere :ref:`Contesto di interruzione hardware <it_hardirq-context>`. vedere `Contesto di interruzione hardware`_.
Questo funziona alla perfezione anche sui sistemi monoprocessore: gli spinlock Questo funziona alla perfezione anche sui sistemi monoprocessore: gli spinlock
svaniscono e questa macro diventa semplicemente local_bh_disable() svaniscono e questa macro diventa semplicemente local_bh_disable()
...@@ -241,7 +241,7 @@ Lo stesso softirq ...@@ -241,7 +241,7 @@ Lo stesso softirq
Lo stesso softirq può essere eseguito su un diverso processore: allo scopo Lo stesso softirq può essere eseguito su un diverso processore: allo scopo
di migliorare le prestazioni potete utilizzare dati riservati ad ogni di migliorare le prestazioni potete utilizzare dati riservati ad ogni
processore (vedere :ref:`Dati per processore <it_per-cpu>`). Se siete arrivati processore (vedere `Dati per processore`_). Se siete arrivati
fino a questo punto nell'uso dei softirq, probabilmente tenete alla scalabilità fino a questo punto nell'uso dei softirq, probabilmente tenete alla scalabilità
delle prestazioni abbastanza da giustificarne la complessità aggiuntiva. delle prestazioni abbastanza da giustificarne la complessità aggiuntiva.
...@@ -896,8 +896,6 @@ leggendo solamente il codice. E come dice Alan Cox: “Lock data, not code”. ...@@ -896,8 +896,6 @@ leggendo solamente il codice. E come dice Alan Cox: “Lock data, not code”.
Problemi comuni Problemi comuni
=============== ===============
.. _`it_deadlock`:
Stallo: semplice ed avanzato Stallo: semplice ed avanzato
---------------------------- ----------------------------
...@@ -1282,7 +1280,6 @@ Il beneficio qui sta nel fatto che il contatore di riferimenti no ...@@ -1282,7 +1280,6 @@ Il beneficio qui sta nel fatto che il contatore di riferimenti no
viene scritto: l'oggetto non viene alterato in alcun modo e quindi diventa viene scritto: l'oggetto non viene alterato in alcun modo e quindi diventa
molto più veloce su sistemi molti-processore grazie alla loro memoria cache. molto più veloce su sistemi molti-processore grazie alla loro memoria cache.
.. _`it_per-cpu`:
Dati per processore Dati per processore
------------------- -------------------
...@@ -1333,7 +1330,6 @@ Naturalmente, questo è più lento della semplice chiamata ...@@ -1333,7 +1330,6 @@ Naturalmente, questo è più lento della semplice chiamata
spin_lock_irq(), quindi ha senso solo se questo genere di accesso spin_lock_irq(), quindi ha senso solo se questo genere di accesso
è estremamente raro. è estremamente raro.
.. _`it_sleeping-things`:
Quali funzioni possono essere chiamate in modo sicuro dalle interruzioni? Quali funzioni possono essere chiamate in modo sicuro dalle interruzioni?
========================================================================= =========================================================================
......
...@@ -264,11 +264,10 @@ La maggior parte di queste opzioni possono essere attivate per qualsiasi ...@@ -264,11 +264,10 @@ La maggior parte di queste opzioni possono essere attivate per qualsiasi
kernel utilizzato per lo sviluppo o a scopo di test. In particolare dovreste kernel utilizzato per lo sviluppo o a scopo di test. In particolare dovreste
attivare: attivare:
- ENABLE_MUST_CHECK e FRAME_WARN per ottenere degli - FRAME_WARN per ottenere degli avvertimenti su stack frame più
avvertimenti dedicati a problemi come l'uso di interfacce deprecate o grandi di un dato valore. Il risultato generato da questi
l'ignorare un importante valore di ritorno di una funzione. Il risultato avvertimenti può risultare verboso, ma non bisogna preoccuparsi per
generato da questi avvertimenti può risultare verboso, ma non bisogna gli avvertimenti provenienti da altre parti del kernel.
preoccuparsi per gli avvertimenti provenienti da altre parti del kernel.
- DEBUG_OBJECTS aggiungerà un codice per tracciare il ciclo di vita di - DEBUG_OBJECTS aggiungerà un codice per tracciare il ciclo di vita di
diversi oggetti creati dal kernel e avvisa quando qualcosa viene eseguito diversi oggetti creati dal kernel e avvisa quando qualcosa viene eseguito
......
...@@ -562,7 +562,7 @@ kernel. Se la nuova funzionalità è utile all'interno del kernel, per esempio ...@@ -562,7 +562,7 @@ kernel. Se la nuova funzionalità è utile all'interno del kernel, per esempio
dev'essere condivisa fra una vecchia e una nuova chiamata di sistema o dev'essere condivisa fra una vecchia e una nuova chiamata di sistema o
dev'essere utilizzata da una chiamata di sistema e la sua variante compatibile, dev'essere utilizzata da una chiamata di sistema e la sua variante compatibile,
allora dev'essere implementata come una funzione di supporto allora dev'essere implementata come una funzione di supporto
(*helper function*) (per esempio ``kern_xyzzy()``). Questa funzione potrà (*helper function*) (per esempio ``ksys_xyzzy()``). Questa funzione potrà
essere chiamata dallo *stub* (``sys_xyzzy()``), dalla variante compatibile essere chiamata dallo *stub* (``sys_xyzzy()``), dalla variante compatibile
(``compat_sys_xyzzy()``), e/o da altri parti del kernel. (``compat_sys_xyzzy()``), e/o da altri parti del kernel.
......
...@@ -75,9 +75,26 @@ stessa riga: ...@@ -75,9 +75,26 @@ stessa riga:
if (condition) do_this; if (condition) do_this;
do_something_everytime; do_something_everytime;
né mettete più assegnamenti sulla stessa riga. Lo stile del kernel Non usate le virgole per evitare le parentesi:
.. code-block:: c
if (condition)
do_this(), do_that();
Invece, usate sempre le parentesi per racchiudere più istruzioni.
.. code-block:: c
if (condition) {
do_this();
do_that();
}
Non mettete nemmeno più assegnamenti sulla stessa riga. Lo stile del kernel
è ultrasemplice. Evitate espressioni intricate. è ultrasemplice. Evitate espressioni intricate.
Al di fuori dei commenti, della documentazione ed escludendo i Kconfig, gli Al di fuori dei commenti, della documentazione ed escludendo i Kconfig, gli
spazi non vengono mai usati per l'indentazione, e l'esempio qui sopra è spazi non vengono mai usati per l'indentazione, e l'esempio qui sopra è
volutamente errato. volutamente errato.
...@@ -320,8 +337,7 @@ qualcosa di simile, **non** dovreste chiamarla ``cntusr()``. ...@@ -320,8 +337,7 @@ qualcosa di simile, **non** dovreste chiamarla ``cntusr()``.
Codificare il tipo di funzione nel suo nome (quella cosa chiamata notazione Codificare il tipo di funzione nel suo nome (quella cosa chiamata notazione
ungherese) è stupido - il compilatore conosce comunque il tipo e ungherese) è stupido - il compilatore conosce comunque il tipo e
può verificarli, e inoltre confonde i programmatori. Non c'è da può verificarli, e inoltre confonde i programmatori.
sorprendersi che MicroSoft faccia programmi bacati.
Le variabili LOCALI dovrebbero avere nomi corti, e significativi. Se avete Le variabili LOCALI dovrebbero avere nomi corti, e significativi. Se avete
un qualsiasi contatore di ciclo, probabilmente sarà chiamato ``i``. un qualsiasi contatore di ciclo, probabilmente sarà chiamato ``i``.
......
...@@ -357,17 +357,10 @@ benvenuti. ...@@ -357,17 +357,10 @@ benvenuti.
Riportare Bug Riportare Bug
------------- -------------
https://bugzilla.kernel.org è dove gli sviluppatori del kernel Linux tracciano Il file 'Documentation/admin-guide/reporting-issues.rst' nella
i bachi del kernel. Gli utenti sono incoraggiati nel riportare tutti i bachi cartella principale del kernel spiega come segnalare un baco nel
che trovano utilizzando questo strumento. kernel, e fornisce dettagli su quali informazioni sono necessarie agli
Per maggiori dettagli su come usare il bugzilla del kernel, guardare: sviluppatori del kernel per poter studiare il problema.
https://bugzilla.kernel.org/page.cgi?id=faq.html
Il file admin-guide/reporting-bugs.rst nella cartella principale del kernel
fornisce un buon modello sul come segnalare un baco nel kernel, e spiega quali
informazioni sono necessarie agli sviluppatori per poter aiutare il
rintracciamento del problema.
Gestire i rapporti sui bug Gestire i rapporti sui bug
-------------------------- --------------------------
...@@ -380,8 +373,14 @@ al corrente della vostra presenza. Riparare bachi è una delle migliori vie per ...@@ -380,8 +373,14 @@ al corrente della vostra presenza. Riparare bachi è una delle migliori vie per
acquisire meriti tra gli altri sviluppatori, perchè non a molte persone piace acquisire meriti tra gli altri sviluppatori, perchè non a molte persone piace
perdere tempo a sistemare i bachi di altri. perdere tempo a sistemare i bachi di altri.
Per lavorare sui rapporti di bachi già riportati, andate su Per lavorare sui bachi già segnalati, per prima cosa cercate il
https://bugzilla.kernel.org. sottosistema che vi interessa. Poi, verificate nel file MAINTAINERS
dove vengono collezionati solitamente i bachi per quel sottosistema;
spesso sarà una lista di discussione, raramente un bugtracker. Cercate
bachi nell'archivio e aiutate dove credete di poterlo fare. Potete
anche consultare https://bugzilla.kernel.org; però, solo una manciata di
sottosistemi lo usano attivamente, ciò nonostante i bachi che
coinvolgono l'intero kernel sono sempre riportati lì.
Liste di discussione Liste di discussione
-------------------- --------------------
......
...@@ -101,7 +101,6 @@ RFCOMM_TTY_MAGIC 0x6d02 ``net/bluetooth/ ...@@ -101,7 +101,6 @@ RFCOMM_TTY_MAGIC 0x6d02 ``net/bluetooth/
USB_SERIAL_PORT_MAGIC 0x7301 usb_serial_port ``drivers/usb/serial/usb-serial.h`` USB_SERIAL_PORT_MAGIC 0x7301 usb_serial_port ``drivers/usb/serial/usb-serial.h``
CG_MAGIC 0x00090255 ufs_cylinder_group ``include/linux/ufs_fs.h`` CG_MAGIC 0x00090255 ufs_cylinder_group ``include/linux/ufs_fs.h``
LSEMAGIC 0x05091998 lse ``drivers/fc4/fc.c`` LSEMAGIC 0x05091998 lse ``drivers/fc4/fc.c``
GDTIOCTL_MAGIC 0x06030f07 gdth_iowr_str ``drivers/scsi/gdth_ioctl.h``
RIEBL_MAGIC 0x09051990 ``drivers/net/atarilance.c`` RIEBL_MAGIC 0x09051990 ``drivers/net/atarilance.c``
NBD_REQUEST_MAGIC 0x12560953 nbd_request ``include/linux/nbd.h`` NBD_REQUEST_MAGIC 0x12560953 nbd_request ``include/linux/nbd.h``
RED_MAGIC2 0x170fc2a5 (any) ``mm/slab.c`` RED_MAGIC2 0x170fc2a5 (any) ``mm/slab.c``
...@@ -144,7 +143,6 @@ PWC_MAGIC 0x89DC10AB pwc_device ``drivers/usb/me ...@@ -144,7 +143,6 @@ PWC_MAGIC 0x89DC10AB pwc_device ``drivers/usb/me
NBD_REPLY_MAGIC 0x96744668 nbd_reply ``include/linux/nbd.h`` NBD_REPLY_MAGIC 0x96744668 nbd_reply ``include/linux/nbd.h``
ENI155_MAGIC 0xa54b872d midway_eprom ``drivers/atm/eni.h`` ENI155_MAGIC 0xa54b872d midway_eprom ``drivers/atm/eni.h``
CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h`` CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h``
DPMEM_MAGIC 0xc0ffee11 gdt_pci_sram ``drivers/scsi/gdth.h``
YAM_MAGIC 0xF10A7654 yam_port ``drivers/net/hamradio/yam.c`` YAM_MAGIC 0xF10A7654 yam_port ``drivers/net/hamradio/yam.c``
CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` 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``
......
...@@ -28,6 +28,10 @@ sottomissione delle patch, in particolare ...@@ -28,6 +28,10 @@ sottomissione delle patch, in particolare
c) quando si usa ``O=builddir`` c) quando si usa ``O=builddir``
d) Qualsiasi modifica in Documentation/ deve compilare con successo senza
avvisi o errori. Usare ``make htmldocs`` o ``make pdfdocs`` per verificare
e correggere i problemi
3) Compilare per diverse architetture di processore usando strumenti per 3) Compilare per diverse architetture di processore usando strumenti per
la cross-compilazione o altri. la cross-compilazione o altri.
...@@ -54,8 +58,7 @@ sottomissione delle patch, in particolare ...@@ -54,8 +58,7 @@ sottomissione delle patch, in particolare
9) Verificare con sparse. 9) Verificare con sparse.
10) Usare ``make checkstack`` e ``make namespacecheck`` e correggere tutti i 10) Usare ``make checkstack`` e correggere tutti i problemi rilevati.
problemi rilevati.
.. note:: .. note::
...@@ -95,31 +98,29 @@ sottomissione delle patch, in particolare ...@@ -95,31 +98,29 @@ sottomissione delle patch, in particolare
informazioni. Le patch che modificano le interfacce utente dovrebbero informazioni. Le patch che modificano le interfacce utente dovrebbero
essere inviate in copia anche a linux-api@vger.kernel.org. essere inviate in copia anche a linux-api@vger.kernel.org.
20) Verifica che il kernel passi con successo ``make headers_check`` 20) La patch è stata verificata con l'iniezione di fallimenti in slab e
21) La patch è stata verificata con l'iniezione di fallimenti in slab e
nell'allocazione di pagine. Vedere ``Documentation/fault-injection/``. nell'allocazione di pagine. Vedere ``Documentation/fault-injection/``.
Se il nuovo codice è corposo, potrebbe essere opportuno aggiungere Se il nuovo codice è corposo, potrebbe essere opportuno aggiungere
l'iniezione di fallimenti specifici per il sottosistema. l'iniezione di fallimenti specifici per il sottosistema.
22) Il nuovo codice è stato compilato con ``gcc -W`` (usate 21) Il nuovo codice è stato compilato con ``gcc -W`` (usate
``make KCFLAGS=-W``). Questo genererà molti avvisi, ma è ottimo ``make KCFLAGS=-W``). Questo genererà molti avvisi, ma è ottimo
per scovare bachi come "warning: comparison between signed and unsigned". per scovare bachi come "warning: comparison between signed and unsigned".
23) La patch è stata verificata dopo essere stata inclusa nella serie di patch 22) La patch è stata verificata dopo essere stata inclusa nella serie di patch
-mm; questo al fine di assicurarsi che continui a funzionare assieme a -mm; questo al fine di assicurarsi che continui a funzionare assieme a
tutte le altre patch in coda e i vari cambiamenti nei sottosistemi VM, VFS tutte le altre patch in coda e i vari cambiamenti nei sottosistemi VM, VFS
e altri. e altri.
24) Tutte le barriere di sincronizzazione {per esempio, ``barrier()``, 23) Tutte le barriere di sincronizzazione {per esempio, ``barrier()``,
``rmb()``, ``wmb()``} devono essere accompagnate da un commento nei ``rmb()``, ``wmb()``} devono essere accompagnate da un commento nei
sorgenti che ne spieghi la logica: cosa fanno e perché. sorgenti che ne spieghi la logica: cosa fanno e perché.
25) Se la patch aggiunge nuove chiamate ioctl, allora aggiornate 24) Se la patch aggiunge nuove chiamate ioctl, allora aggiornate
``Documentation/userspace-api/ioctl/ioctl-number.rst``. ``Documentation/userspace-api/ioctl/ioctl-number.rst``.
26) Se il codice che avete modificato dipende o usa una qualsiasi interfaccia o 25) Se il codice che avete modificato dipende o usa una qualsiasi interfaccia o
funzionalità del kernel che è associata a uno dei seguenti simboli funzionalità del kernel che è associata a uno dei seguenti simboli
``Kconfig``, allora verificate che il kernel compili con diverse ``Kconfig``, allora verificate che il kernel compili con diverse
configurazioni dove i simboli sono disabilitati e/o ``=m`` (se c'è la configurazioni dove i simboli sono disabilitati e/o ``=m`` (se c'è la
......
...@@ -433,6 +433,14 @@ Alcune persone aggiungono delle etichette alla fine. Per ora queste verranno ...@@ -433,6 +433,14 @@ Alcune persone aggiungono delle etichette alla fine. Per ora queste verranno
ignorate, ma potete farlo per meglio identificare procedure aziendali interne o ignorate, ma potete farlo per meglio identificare procedure aziendali interne o
per aggiungere dettagli circa la firma. per aggiungere dettagli circa la firma.
In seguito al SoB (Signed-off-by:) dell'autore ve ne sono altri da
parte di tutte quelle persone che si sono occupate della gestione e
del trasporto della patch. Queste però non sono state coinvolte nello
sviluppo, ma la loro sequenza d'apparizione ci racconta il percorso
**reale** che una patch a intrapreso dallo sviluppatore, fino al
manutentore, per poi giungere a Linus.
Quando utilizzare Acked-by:, Cc:, e Co-developed-by: Quando utilizzare Acked-by:, Cc:, e Co-developed-by:
---------------------------------------------------- ----------------------------------------------------
...@@ -574,6 +582,10 @@ kernel stabili al fine di capire quale kernel deve ricevere la correzione. ...@@ -574,6 +582,10 @@ kernel stabili al fine di capire quale kernel deve ricevere la correzione.
Questo è il modo suggerito per indicare che un baco è stato corretto nella Questo è il modo suggerito per indicare che un baco è stato corretto nella
patch. Per maggiori dettagli leggete :ref:`it_describe_changes` patch. Per maggiori dettagli leggete :ref:`it_describe_changes`
Da notare che aggiungere un tag "Fixes:" non esime dalle regole
previste per i kernel stabili, e nemmeno dalla necessità di aggiungere
in copia conoscenza stable@vger.kernel.org su tutte le patch per
suddetti kernel.
Il formato canonico delle patch Il formato canonico delle patch
------------------------------- -------------------------------
...@@ -642,16 +654,20 @@ Le etichette non verranno considerate come parte della frase riassuntiva, ma ...@@ -642,16 +654,20 @@ Le etichette non verranno considerate come parte della frase riassuntiva, ma
indicano come la patch dovrebbe essere trattata. Fra le etichette più comuni indicano come la patch dovrebbe essere trattata. Fra le etichette più comuni
ci sono quelle di versione che vengono usate quando una patch è stata inviata ci sono quelle di versione che vengono usate quando una patch è stata inviata
più volte (per esempio, "v1, v2, v3"); oppure "RFC" per indicare che si più volte (per esempio, "v1, v2, v3"); oppure "RFC" per indicare che si
attendono dei commenti (*Request For Comments*). Se ci sono quattro patch attendono dei commenti (*Request For Comments*).
nella serie, queste dovrebbero essere enumerate così: 1/4, 2/4, 3/4, 4/4.
Questo assicura che gli sviluppatori capiranno l'ordine in cui le patch Se ci sono quattro patch nella serie, queste dovrebbero essere
dovrebbero essere applicate, e per tracciare quelle che hanno revisionate o enumerate così: 1/4, 2/4, 3/4, 4/4. Questo assicura che gli
che hanno applicato. sviluppatori capiranno l'ordine in cui le patch dovrebbero essere
applicate, e per tracciare quelle che hanno revisionate o che hanno
applicato.
Un paio di esempi di oggetti:: Un paio di esempi di oggetti::
Subject: [PATCH 2/5] ext2: improve scalability of bitmap searching Subject: [PATCH 2/5] ext2: improve scalability of bitmap searching
Subject: [PATCH v2 01/27] x86: fix eflags tracking Subject: [PATCH v2 01/27] x86: fix eflags tracking
Subject: [PATCH v2] sub/sys: Condensed patch summary
Subject: [PATCH v2 M/N] sub/sys: Condensed patch summary
La riga ``from`` dev'essere la prima nel corpo del messaggio ed è nel La riga ``from`` dev'essere la prima nel corpo del messaggio ed è nel
formato: formato:
...@@ -668,30 +684,76 @@ deve aver senso per un lettore esperto che è ha dimenticato i dettagli della ...@@ -668,30 +684,76 @@ deve aver senso per un lettore esperto che è ha dimenticato i dettagli della
discussione che hanno portato alla patch. L'inclusione di informazioni discussione che hanno portato alla patch. L'inclusione di informazioni
sui problemi oggetto dalla patch (messaggi del kernel, messaggi di oops, sui problemi oggetto dalla patch (messaggi del kernel, messaggi di oops,
eccetera) è particolarmente utile per le persone che potrebbero cercare fra eccetera) è particolarmente utile per le persone che potrebbero cercare fra
i messaggi di log per la patch che li tratta. Se la patch corregge un errore i messaggi di log per la patch che li tratta. Il testo dovrebbe essere scritto
di compilazione, non sarà necessario includere proprio _tutto_ quello che con abbastanza dettagli da far capire al lettore **perché** quella
è uscito dal compilatore; aggiungete solo quello che è necessario per far si patch fu creata, e questo a distanza di settimane, mesi, o addirittura
che la vostra patch venga trovata. Come nella ``summary phrase``, è importante anni.
essere sia brevi che descrittivi.
Se la patch corregge un errore di compilazione, non sarà necessario
includere proprio _tutto_ quello che è uscito dal compilatore;
aggiungete solo quello che è necessario per far si che la vostra patch
venga trovata. Come nella ``summary phrase``, è importante essere sia
brevi che descrittivi.
La linea di demarcazione ``---`` serve essenzialmente a segnare dove finisce La linea di demarcazione ``---`` serve essenzialmente a segnare dove finisce
il messaggio di changelog. il messaggio di changelog.
Aggiungere il ``diffstat`` dopo ``---`` è un buon uso di questo spazio, per Aggiungere il ``diffstat`` dopo ``---`` è un buon uso di questo spazio, per
mostrare i file che sono cambiati, e il numero di file aggiunto o rimossi. mostrare i file che sono cambiati, e il numero di file aggiunto o rimossi.
Un ``diffstat`` è particolarmente utile per le patch grandi. Altri commenti Un ``diffstat`` è particolarmente utile per le patch grandi. Se
che sono importanti solo per i manutentori, quindi inadatti al changelog includete un ``diffstat`` dopo ``---``, usate le opzioni ``-p 1 -w70``
permanente, dovrebbero essere messi qui. Un buon esempio per questo tipo cosicché i nomi dei file elencati non occupino troppo spazio
di commenti potrebbe essere quello di descrivere le differenze fra le versioni (facilmente rientreranno negli 80 caratteri, magari con qualche
indentazione). (``git`` genera di base dei diffstat adatti).
I commenti che sono importanti solo per i manutentori, quindi
inadatti al changelog permanente, dovrebbero essere messi qui. Un
buon esempio per questo tipo di commenti potrebbe essere il cosiddetto
``patch changelogs`` che descrivere le differenze fra le versioni
della patch. della patch.
Se includete un ``diffstat`` dopo ``---``, usate le opzioni ``-p 1 -w70`` Queste informazioni devono andare **dopo** la linea ``---`` che separa
cosicché i nomi dei file elencati non occupino troppo spazio (facilmente il *changelog* dal resto della patch. Le informazioni riguardanti la
rientreranno negli 80 caratteri, magari con qualche indentazione). versione di una patch non sono parte del *chagelog* che viene incluso
(``git`` genera di base dei diffstat adatti). in git. Queste sono informazioni utili solo ai revisori. Se venissero
messe sopra la riga, qualcuno dovrà fare del lavoro manuale per
rimuoverle; cosa che invece viene fatta automaticamente quando vengono
messe correttamente oltre la riga.::
<commit message>
...
Signed-off-by: Author <author@mail>
---
V2 -> V3: Removed redundant helper function
V1 -> V2: Cleaned up coding style and addressed review comments
path/to/file | 5+++--
...
Maggiori dettagli sul formato delle patch nei riferimenti qui di seguito. Maggiori dettagli sul formato delle patch nei riferimenti qui di seguito.
Aggiungere i *backtrace* nei messaggi di commit
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I *backtrace* aiutano a documentare la sequenza di chiamate a funzione
che portano ad un problema. Tuttavia, non tutti i *backtrace* sono
davvero utili. Per esempio, le sequenze iniziali di avvio sono uniche
e ovvie. Copiare integralmente l'output di ``dmesg`` aggiunge tante
informazioni che distraggono dal vero problema (per esempio, i
marcatori temporali, la lista dei moduli, la lista dei registri, lo
stato dello stack).
Quindi, per rendere utile un *backtrace* dovreste eliminare le
informazioni inutili, cosicché ci si possa focalizzare sul
problema. Ecco un esempio di un *backtrace* essenziale::
unchecked MSR access error: WRMSR to 0xd51 (tried to write 0x0000000000000064)
at rIP: 0xffffffffae059994 (native_write_msr+0x4/0x20)
Call Trace:
mba_wrmsr
update_domains
rdtgroup_mkdir
.. _it_explicit_in_reply_to: .. _it_explicit_in_reply_to:
Usare esplicitamente In-Reply-To nell'intestazione Usare esplicitamente In-Reply-To nell'intestazione
......
...@@ -88,20 +88,18 @@ Linux カーネルパッチ投稿者向けチェックリスト ...@@ -88,20 +88,18 @@ Linux カーネルパッチ投稿者向けチェックリスト
18: 新しいuserspaceインタフェースを作成した場合には、Documentation/ABI/ に 18: 新しいuserspaceインタフェースを作成した場合には、Documentation/ABI/ に
Documentation/ABI/README を参考にして必ずドキュメントを追加してください。 Documentation/ABI/README を参考にして必ずドキュメントを追加してください。
19: 'make headers_check'を実行して全く問題がないことを確認してください。 19: 少なくともslabアロケーションとpageアロケーションに失敗した場合の
20: 少なくともslabアロケーションとpageアロケーションに失敗した場合の
挙動について、fault-injectionを利用して確認してください。 挙動について、fault-injectionを利用して確認してください。
Documentation/fault-injection/ を参照してください。 Documentation/fault-injection/ を参照してください。
追加したコードがかなりの量であったならば、サブシステム特有の 追加したコードがかなりの量であったならば、サブシステム特有の
fault-injectionを追加したほうが良いかもしれません。 fault-injectionを追加したほうが良いかもしれません。
21: 新たに追加したコードは、`gcc -W'でコンパイルしてください。 20: 新たに追加したコードは、`gcc -W'でコンパイルしてください。
このオプションは大量の不要なメッセージを出力しますが、 このオプションは大量の不要なメッセージを出力しますが、
"warning: comparison between signed and unsigned" のようなメッセージは、 "warning: comparison between signed and unsigned" のようなメッセージは、
バグを見つけるのに役に立ちます。 バグを見つけるのに役に立ちます。
22: 投稿したパッチが -mm パッチセットにマージされた後、全ての既存のパッチや 21: 投稿したパッチが -mm パッチセットにマージされた後、全ての既存のパッチや
VM, VFS およびその他のサブシステムに関する様々な変更と、現時点でも共存 VM, VFS およびその他のサブシステムに関する様々な変更と、現時点でも共存
できることを確認するテストを行ってください。 できることを確認するテストを行ってください。
...@@ -339,14 +339,8 @@ Andrew Morton의 글이 있다. ...@@ -339,14 +339,8 @@ Andrew Morton의 글이 있다.
버그 보고 버그 보고
--------- ---------
https://bugzilla.kernel.org 는 리눅스 커널 개발자들이 커널의 버그를 추적하는
곳이다. 사용자들은 발견한 모든 버그들을 보고하기 위하여 이 툴을 사용할 것을
권장한다. kernel bugzilla를 사용하는 자세한 방법은 다음을 참조하라.
https://bugzilla.kernel.org/page.cgi?id=faq.html
메인 커널 소스 디렉토리에 있는 'Documentation/admin-guide/reporting-issues.rst' 메인 커널 소스 디렉토리에 있는 'Documentation/admin-guide/reporting-issues.rst'
파일은 커널 버그라고 생각되는 것을 보고하는 방법에 관한 좋은 템플릿이며 문제를 파일은 커널 버그라고 생각되는 것을 어떻게 보고하면 되는지, 그리고 문제를
추적하기 위해서 커널 개발자들이 필요로 하는 정보가 무엇들인지를 상세히 설명하고 추적하기 위해서 커널 개발자들이 필요로 하는 정보가 무엇들인지를 상세히 설명하고
있다. 있다.
...@@ -362,8 +356,14 @@ https://bugzilla.kernel.org 는 리눅스 커널 개발자들이 커널의 버 ...@@ -362,8 +356,14 @@ https://bugzilla.kernel.org 는 리눅스 커널 개발자들이 커널의 버
점수를 얻을 수 있는 가장 좋은 방법중의 하나이다. 왜냐하면 많은 사람들은 점수를 얻을 수 있는 가장 좋은 방법중의 하나이다. 왜냐하면 많은 사람들은
다른 사람들의 버그들을 수정하기 위하여 시간을 낭비하지 않기 때문이다. 다른 사람들의 버그들을 수정하기 위하여 시간을 낭비하지 않기 때문이다.
이미 보고된 버그 리포트들을 가지고 작업하기 위해서 https://bugzilla.kernel.org 이미 보고된 버그 리포트들을 가지고 작업하기 위해서는 여러분이 관심있는
참조하라. 서브시스템을 찾아라. 해당 서브시스템의 버그들이 어디로 리포트 되는지
MAINTAINERS 파일을 체크하라; 그건 대부분 메일링 리스트이고, 가끔은 버그 추적
시스템이다. 그 장소에 있는 최근 버그 리포트 기록들을 검색하고 여러분이 보기에
적합하다 싶은 것을 도와라. 여러분은 버그 리포트를 위해
https://bugzilla.kernel.org 를 체크하고자 할 수도 있다; 소수의 커널
서브시스템들만이 버그 신고와 추적을 위해 해당 시스템을 실제로 사용하고 있지만,
전체 커널의 버그들이 그곳에 정리된다.
메일링 리스트들 메일링 리스트들
......
This diff is collapsed.
.. include:: ../disclaimer-zh_CN.rst
:Original: :doc:`../../../admin-guide/bug-bisect`
:译者:
吴想成 Wu XiangCheng <bobwxc@email.cn>
二分(bisect)缺陷
+++++++++++++++++++
(英文版)最后更新:2016年10月28日
引言
=====
始终尝试由来自kernel.org的源代码构建的最新内核。如果您没有信心这样做,请将
错误报告给您的发行版供应商,而不是内核开发人员。
找到缺陷(bug)并不总是那么容易,不过仍然得去找。如果你找不到它,不要放弃。
尽可能多的向相关维护人员报告您发现的信息。请参阅MAINTAINERS文件以了解您所
关注的子系统的维护人员。
在提交错误报告之前,请阅读“Documentation/admin-guide/reporting-issues.rst”。
设备未出现(Devices not appearing)
====================================
这通常是由udev/systemd引起的。在将其归咎于内核之前先检查一下。
查找导致缺陷的补丁
===================
使用 ``git`` 提供的工具可以很容易地找到缺陷,只要缺陷是可复现的。
操作步骤:
- 从git源代码构建内核
- 以此开始二分 [#f1]_::
$ git bisect start
- 标记损坏的变更集::
$ git bisect bad [commit]
- 标记正常工作的变更集::
$ git bisect good [commit]
- 重新构建内核并测试
- 使用以下任一与git bisect进行交互::
$ git bisect good
或::
$ git bisect bad
这取决于您测试的变更集上是否有缺陷
- 在一些交互之后,git bisect将给出可能导致缺陷的变更集。
- 例如,如果您知道当前版本有问题,而4.8版本是正常的,则可以执行以下操作::
$ git bisect start
$ git bisect bad # Current version is bad
$ git bisect good v4.8
.. [#f1] 您可以(可选地)在开始git bisect的时候提供good或bad参数
``git bisect start [BAD] [GOOD]``
如需进一步参考,请阅读:
- ``git-bisect`` 的手册页
- `Fighting regressions with git bisect(用git bisect解决回归)
<https://www.kernel.org/pub/software/scm/git/docs/git-bisect-lk2009.html>`_
- `Fully automated bisecting with "git bisect run"(使用git bisect run
来全自动二分) <https://lwn.net/Articles/317154>`_
- `Using Git bisect to figure out when brokenness was introduced
(使用Git二分来找出何时引入了错误) <http://webchick.net/node/99>`_
This diff is collapsed.
...@@ -13,9 +13,13 @@ Linux 内核用户和管理员指南 ...@@ -13,9 +13,13 @@ Linux 内核用户和管理员指南
这个初始部分包含总体信息,包括描述内核的README, 关于内核参数的文档等。 这个初始部分包含总体信息,包括描述内核的README, 关于内核参数的文档等。
Todolist: .. toctree::
:maxdepth: 1
README README
Todolist:
kernel-parameters kernel-parameters
devices devices
sysctl/index sysctl/index
...@@ -28,16 +32,21 @@ Todolist: ...@@ -28,16 +32,21 @@ Todolist:
下面的一组文档,针对的是试图跟踪问题和bug的用户。 下面的一组文档,针对的是试图跟踪问题和bug的用户。
Todolist: .. toctree::
:maxdepth: 1
reporting-bugs reporting-issues
security-bugs security-bugs
bug-hunting bug-hunting
bug-bisect bug-bisect
tainted-kernels tainted-kernels
init
Todolist:
reporting-bugs
ramoops ramoops
dynamic-debug-howto dynamic-debug-howto
init
kdump/index kdump/index
perf/index perf/index
...@@ -56,6 +65,7 @@ Todolist: ...@@ -56,6 +65,7 @@ Todolist:
clearing-warn-once clearing-warn-once
cpu-load cpu-load
unicode
Todolist: Todolist:
...@@ -111,7 +121,6 @@ Todolist: ...@@ -111,7 +121,6 @@ Todolist:
sysrq sysrq
thunderbolt thunderbolt
ufs ufs
unicode
vga-softcursor vga-softcursor
video-output video-output
xfs xfs
......
.. include:: ../disclaimer-zh_CN.rst
:Original: :doc:`../../../admin-guide/init`
:译者:
吴想成 Wu XiangCheng <bobwxc@email.cn>
解释“No working init found.”启动挂起消息
=========================================
:作者:
Andreas Mohr <andi at lisas period de>
Cristian Souza <cristianmsbr at gmail period com>
本文档提供了加载初始化二进制(init binary)失败的一些高层级原因(大致按执行
顺序列出)。
1) **无法挂载根文件系统Unable to mount root FS** :请设置“debug”内核参数(在
引导加载程序bootloader配置文件或CONFIG_CMDLINE)以获取更详细的内核消息。
2) **初始化二进制不存在于根文件系统上init binary doesn't exist on rootfs** :
确保您的根文件系统类型正确(并且 ``root=`` 内核参数指向正确的分区);拥有
所需的驱动程序,例如SCSI或USB等存储硬件;文件系统(ext3、jffs2等)是内建的
(或者作为模块由initrd预加载)。
3) **控制台设备损坏Broken console device** : ``console= setup`` 中可能存在
冲突 --> 初始控制台不可用(initial console unavailable)。例如,由于串行
IRQ问题(如缺少基于中断的配置)导致的某些串行控制台不可靠。尝试使用不同的
``console= device`` 或像 ``netconsole=`` 。
4) **二进制存在但依赖项不可用Binary exists but dependencies not available** :
例如初始化二进制的必需库依赖项,像 ``/lib/ld-linux.so.2`` 丢失或损坏。使用
``readelf -d <INIT>|grep NEEDED`` 找出需要哪些库。
5) **无法加载二进制Binary cannot be loaded** :请确保二进制的体系结构与您的
硬件匹配。例如i386不匹配x86_64,或者尝试在ARM硬件上加载x86。如果您尝试在
此处加载非二进制文件(shell脚本?),您应该确保脚本在其工作头(shebang
header)行 ``#!/...`` 中指定能正常工作的解释器(包括其库依赖项)。在处理
脚本之前,最好先测试一个简单的非脚本二进制文件,比如 ``/bin/sh`` ,并确认
它能成功执行。要了解更多信息,请将代码添加到 ``init/main.c`` 以显示
kernel_execve()的返回值。
当您发现新的失败原因时,请扩展本解释(毕竟加载初始化二进制是一个 **关键** 且
艰难的过渡步骤,需要尽可能无痛地进行),然后向LKML提交一个补丁。
待办事项:
- 通过一个可以存储 ``kernel_execve()`` 结果值的结构体数组实现各种
``run_init_process()`` 调用,并在失败时通过迭代 **所有** 结果来记录一切
(非常重要的可用性修复)。
- 试着使实现本身在一般情况下更有帮助,例如在受影响的地方提供额外的错误消息。
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
.. include:: ../../disclaimer-zh_CN.rst
:Original: :doc:`../../../../core-api/irq/concepts`
:Translator: Yanteng Si <siyanteng@loongson.cn>
.. _cn_concepts.rst:
===========
什么是IRQ?
===========
IRQ (Interrupt ReQuest) 指来自设备的中断请求。
目前,它们可以通过一个引脚或通过一个数据包进入。
多个设备可以连接到同一个引脚,从而共享一个IRQ。
IRQ编号是用来描述硬件中断源的内核标识符。通常它是一个到全局irq_desc数组的索引,
但是除了在linux/interrupt.h中实现的之外,其它细节是体系结构特征相关的。
IRQ编号是对机器上可能的中断源的枚举。通常枚举的是系统中所有中断控制器的输入引脚
编号。在ISA(工业标准体系结构)的情况下所枚举的是两个i8259中断控制器的16个输入引脚。
体系结构可以给IRQ号赋予额外的含义,在涉及到硬件手动配置的情况下,我们鼓励这样做。
ISA IRQ是赋予这种额外含义的一个典型例子。
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
.. note:: .. note::
如果您发现本文档与原始文件有任何不同或者有翻译问题,请联系该文件的译者, 如果您发现本文档与原始文件有任何不同或者有翻译问题,请联系该文件的译者,
或者请求时奎亮的帮助:<alex.shi@linux.alibaba.com>。 或者请求时奎亮的帮助:<alexs@kernel.org>。
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment