Convert DocBook documents to ReST
Subsystems (15)
cover Convert DocBook documents to ReST
This patch series convert the following books from DocBook to ReST:
- filesystems
- kernel-hacking
- kernel-locking
- kgdb
- libata
- networking
- rapidio
- s390-drivers
- scsi
- w1
- z8530book
It also adjusts some Sphinx-pedantic errors/warnings on some kernel-doc markups.
I also added some patches here to add PDF output for all existing ReST books.
I did my best to check if what's there is not too outdated, but the best is if the subsystem maintainers could check it.
After this series, there are only 4 DocBook remaining conversion:
- librs
- lsm
- mtdnand
- sh
I'll likely convert those remaining ones during this weekend.
-
This patch series is based on docs tree (next branch). The full patch series is on this tree:
https://git.linuxtv.org//mchehab/experimental.git/log/?h=docbook
And the HTML output at:
http://www.infradead.org/~mchehab/kernel_docs/
https://mchehab.fedorapeople.org/kernel_docs/
Mauro Carvalho Chehab (36):
docs-rst: convert kernel-hacking to ReST
kernel-hacking: update document
docs-rst: convert kernel-locking to ReST
mutex, futex: adjust kernel-doc markups to generate ReST locking.rst: reformat locking table
locking.rst: add captions to two tables locking.rst: Update some ReST markups
docs-rst: convert kgdb DocBook to ReST
kgdb.rst: Adjust ReST markups
conf.py: define a color for important markup on PDF output
docs-rst: conf.py: sort LaTeX documents in alphabetical order
docs-rst: conf.py: remove kernel-documentation from LaTeX
docs-rst: add crypto API book to pdf output
docs-rst: add dev-tools book to pdf output
docs-rst: add sound book to pdf output
docs-rst: add userspace API book to pdf output
docs-rst: convert filesystems book to ReST
docs-rst: filesystems: use c domain references where needed
fs: jbd2: make jbd2_journal_start() kernel-doc parseable
docs-rst: don't ignore internal functions for jbd2 docs
fs: locks: Fix some troubles at kernel-doc comments
fs: add a blank lines on some kernel-doc comments
fs: eventfd: fix identation on kernel-doc
fs: jbd2: escape a string with special chars on a kernel-doc
docs-rst: convert libata book to ReST
libata.rst: add c function and struct cross-references
libata: fix identation on a kernel-doc markup
docs-rst: convert s390-drivers DocBook to ReST
docs-rst: convert networking book to ReST
net: skbuff.h: properly escape a macro name on kernel-doc
net: fix some identation issues at kernel-doc markups
docs-rst: convert z8530book DocBook to ReST
docs-rst: convert scsi DocBook to ReST
scsi: fix some kernel-doc markups
docs-rst: convert w1 book to ReST
docs-rst: convert rapidio book to ReST
Documentation/DocBook/Makefile | 11 +- Documentation/DocBook/filesystems.tmpl | 381 ----- Documentation/DocBook/kernel-hacking.tmpl | 1312 ------------------ Documentation/DocBook/kernel-locking.tmpl | 2151 ----------------------------- Documentation/DocBook/kgdb.tmpl | 918 ------------ Documentation/DocBook/libata.tmpl | 1625 ---------------------- Documentation/DocBook/networking.tmpl | 111 -- Documentation/DocBook/rapidio.tmpl | 155 --- Documentation/DocBook/s390-drivers.tmpl | 161 --- Documentation/DocBook/scsi.tmpl | 409 ------ Documentation/DocBook/w1.tmpl | 101 -- Documentation/DocBook/z8530book.tmpl | 371 ----- Documentation/conf.py | 35 +- Documentation/crypto/conf.py | 10 + Documentation/dev-tools/index.rst | 1 + Documentation/dev-tools/kgdb.rst | 907 ++++++++++++ Documentation/driver-api/index.rst | 5 + Documentation/driver-api/libata.rst | 1031 ++++++++++++++ Documentation/driver-api/rapidio.rst | 107 ++ Documentation/driver-api/s390-drivers.rst | 111 ++ Documentation/driver-api/scsi.rst | 344 +++++ Documentation/driver-api/w1.rst | 70 + Documentation/filesystems/conf.py | 10 + Documentation/filesystems/index.rst | 317 +++++ Documentation/index.rst | 3 + Documentation/kernel-hacking/conf.py | 10 + Documentation/kernel-hacking/hacking.rst | 811 +++++++++++ Documentation/kernel-hacking/index.rst | 5 + Documentation/kernel-hacking/locking.rst | 1446 +++++++++++++++++++ Documentation/networking/conf.py | 10 + Documentation/networking/index.rst | 18 + Documentation/networking/kapi.rst | 147 ++ Documentation/networking/z8530book.rst | 256 ++++ Documentation/sound/conf.py | 10 + drivers/ata/libata-scsi.c | 7 +- drivers/net/phy/phy.c | 1 + drivers/scsi/scsi_scan.c | 7 +- drivers/scsi/scsi_transport_fc.c | 18 +- drivers/scsi/scsicam.c | 4 +- fs/eventfd.c | 4 +- fs/fs-writeback.c | 12 +- fs/jbd2/transaction.c | 42 +- fs/locks.c | 18 +- fs/mpage.c | 1 + fs/namei.c | 1 + include/linux/mutex.h | 6 +- include/linux/netdevice.h | 9 +- include/linux/skbuff.h | 2 +- include/net/sock.h | 9 +- kernel/futex.c | 40 +- kernel/locking/mutex.c | 6 +- net/core/datagram.c | 2 +- net/core/sock.c | 7 +- 53 files changed, 5764 insertions(+), 7802 deletions(-) delete mode 100644 Documentation/DocBook/filesystems.tmpl delete mode 100644 Documentation/DocBook/kernel-hacking.tmpl delete mode 100644 Documentation/DocBook/kernel-locking.tmpl delete mode 100644 Documentation/DocBook/kgdb.tmpl delete mode 100644 Documentation/DocBook/libata.tmpl delete mode 100644 Documentation/DocBook/networking.tmpl delete mode 100644 Documentation/DocBook/rapidio.tmpl delete mode 100644 Documentation/DocBook/s390-drivers.tmpl delete mode 100644 Documentation/DocBook/scsi.tmpl delete mode 100644 Documentation/DocBook/w1.tmpl delete mode 100644 Documentation/DocBook/z8530book.tmpl create mode 100644 Documentation/crypto/conf.py create mode 100644 Documentation/dev-tools/kgdb.rst create mode 100644 Documentation/driver-api/libata.rst create mode 100644 Documentation/driver-api/rapidio.rst create mode 100644 Documentation/driver-api/s390-drivers.rst create mode 100644 Documentation/driver-api/scsi.rst create mode 100644 Documentation/driver-api/w1.rst create mode 100644 Documentation/filesystems/conf.py create mode 100644 Documentation/filesystems/index.rst create mode 100644 Documentation/kernel-hacking/conf.py create mode 100644 Documentation/kernel-hacking/hacking.rst create mode 100644 Documentation/kernel-hacking/index.rst create mode 100644 Documentation/kernel-hacking/locking.rst create mode 100644 Documentation/networking/conf.py create mode 100644 Documentation/networking/index.rst create mode 100644 Documentation/networking/kapi.rst create mode 100644 Documentation/networking/z8530book.rst create mode 100644 Documentation/sound/conf.py
Signature · 1 line
2.9.3
PATCH 13/36 docs-rst: add crypto API book to pdf output
The crypto API book was added without the bits required to generate PDF output. Add them.
--- Documentation/conf.py | 2 ++ Documentation/crypto/conf.py | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 Documentation/crypto/conf.py
Documentation/conf.py +2 -0
@@ -351,6 +351,8 @@ latex_documents = [ 'The kernel development community', 'manual'), ('core-api/index', 'core-api.tex', 'The kernel core API manual', 'The kernel development community', 'manual'), + ('crypto/index', 'crypto-api.tex', 'Linux Kernel Crypto API manual', + 'The kernel development community', 'manual'), ('doc-guide/index', 'kernel-doc-guide.tex', 'Linux Kernel Documentation Guide', 'The kernel development community', 'manual'), ('driver-api/index', 'driver-api.tex', 'The kernel driver API manual',
Documentation/crypto/conf.py new file +10 -0
@@ -0,0 +1,10 @@ +# -*- coding: utf-8; mode: python -*- + +project = 'Linux Kernel Crypto API' + +tags.add("subproject") + +latex_documents = [ + ('index', 'crypto-api.tex', 'Linux Kernel Crypto API manual', + 'The kernel development community', 'manual'), +]
Signature · 1 line
2.9.3
PATCH 21/36 fs: locks: Fix some troubles at kernel-doc comments
In reply to Mauro Carvalho ChehabThere are a few syntax violations that cause outputs of a few comments to not be properly parsed in ReST format.
No functional changes.
--- fs/locks.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)
fs/locks.c +8 -10
@@ -1858,8 +1858,8 @@ EXPORT_SYMBOL(generic_setlease);* * Call this to establish a lease on the file. The "lease" argument is not * used for F_UNLCK requests and may be NULL. For commands that set or alter -* an existing lease, the (*lease)->fl_lmops->lm_break operation must be set; -* if not, this function will return -ENOLCK (and generate a scary-looking +* an existing lease, the ``(*lease)->fl_lmops->lm_break`` operation must be +* set; if not, this function will return -ENOLCK (and generate a scary-looking * stack trace). * * The "priv" pointer is passed directly to the lm_setup function as-is. It
@@ -1972,15 +1972,13 @@ EXPORT_SYMBOL(locks_lock_inode_wait);* @cmd: the type of lock to apply. * * Apply a %FL_FLOCK style lock to an open file descriptor. -* The @cmd can be one of +* The @cmd can be one of: * -* %LOCK_SH -- a shared lock. -* -* %LOCK_EX -- an exclusive lock. -* -* %LOCK_UN -- remove an existing lock. -* -* %LOCK_MAND -- a `mandatory' flock. This exists to emulate Windows Share Modes. +* - %LOCK_SH -- a shared lock. +* - %LOCK_EX -- an exclusive lock. +* - %LOCK_UN -- remove an existing lock. +* - %LOCK_MAND -- a 'mandatory' flock. +* This exists to emulate Windows Share Modes. * * %LOCK_MAND can be combined with %LOCK_READ or %LOCK_WRITE to allow other * processes read and write access respectively.
Signature · 1 line
2.9.3
PATCH 22/36 fs: add a blank lines on some kernel-doc comments
In reply to Mauro Carvalho ChehabSphinx gets confused when it finds identation without a good reason for it and without a preceding blank line:
./fs/mpage.c:347: ERROR: Unexpected indentation. ./fs/namei.c:4303: ERROR: Unexpected indentation. ./fs/fs-writeback.c:2060: ERROR: Unexpected indentation.
No functional changes.
--- fs/fs-writeback.c | 12 +++++++----- fs/mpage.c | 1 + fs/namei.c | 1 + 3 files changed, 9 insertions(+), 5 deletions(-)
fs/fs-writeback.c +7 -5
@@ -2052,11 +2052,13 @@ static noinline void block_dump___mark_inode_dirty(struct inode *inode) }/** -* __mark_inode_dirty - internal function -* @inode: inode to mark -* @flags: what kind of dirty (i.e. I_DIRTY_SYNC) -* Mark an inode as dirty. Callers should use mark_inode_dirty or -* mark_inode_dirty_sync. +* __mark_inode_dirty - internal function +* +* @inode: inode to mark +* @flags: what kind of dirty (i.e. I_DIRTY_SYNC) +* +* Mark an inode as dirty. Callers should use mark_inode_dirty or +* mark_inode_dirty_sync. * * Put the inode on the super block's dirty list. *
fs/mpage.c +1 -0
@@ -344,6 +344,7 @@ do_mpage_readpage(struct bio *bio, struct page *page, unsigned nr_pages,* * So an mpage read of the first 16 blocks of an ext2 file will cause I/O to be * submitted in the following order: +* * 12 0 1 2 3 4 5 6 7 8 9 10 11 13 14 15 16 * * because the indirect block has to be read to get the mappings of blocks
fs/namei.c +1 -0
@@ -4300,6 +4300,7 @@ SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname* The worst of all namespace operations - renaming directory. "Perverted" * doesn't even start to describe it. Somebody in UCB had a heck of a trip... * Problems: +* * a) we can get into loop creation. * b) race potential - two innocent renames can create a loop together. * That's where 4.4 screws up. Current fix: serialization on
Signature · 1 line
2.9.3
PATCH 23/36 fs: eventfd: fix identation on kernel-doc
In reply to Mauro Carvalho ChehabSphinx require explicit tags in order to use a list of possible values, otherwise it produces this error:
./fs/eventfd.c:219: WARNING: Option list ends without a blank line; unexpected unindent.
--- fs/eventfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/eventfd.c +2 -2
@@ -215,8 +215,8 @@ EXPORT_SYMBOL_GPL(eventfd_ctx_remove_wait_queue);* * Returns %0 if successful, or the following error codes: * -* -EAGAIN : The operation would have blocked but @no_wait was non-zero. -* -ERESTARTSYS : A signal interrupted the wait operation. +* - -EAGAIN : The operation would have blocked but @no_wait was non-zero. +* - -ERESTARTSYS : A signal interrupted the wait operation. * * If @no_wait is zero, the function might sleep until the eventfd internal * counter becomes greater than zero.
Signature · 1 line
2.9.3
PATCH 24/36 fs: jbd2: escape a string with special chars on a kernel-doc
In reply to Mauro Carvalho Chehabkernel-doc will try to interpret a foo() string, except if properly escaped.
--- fs/jbd2/transaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/jbd2/transaction.c +2 -2
@@ -1066,10 +1066,10 @@ static bool jbd2_write_access_granted(handle_t *handle, struct buffer_head *bh,* @handle: transaction to add buffer modifications to * @bh: bh to be used for metadata writes * -* Returns an error code or 0 on success. +* Returns: error code or 0 on success. * * In full data journalling mode the buffer may be of type BJ_AsyncData, -* because we're write()ing a buffer which is also part of a shared mapping. +* because we're ``write()ing`` a buffer which is also part of a shared mapping. */ int jbd2_journal_get_write_access (handle_t *handle,struct buffer_head *bh)
Signature · 1 line
2.9.3
PATCH 27/36 libata: fix identation on a kernel-doc markup
In reply to Mauro Carvalho ChehabSphinx got confused with the markup identation:
./drivers/ata/libata-scsi.c:3402: ERROR: Unexpected indentation.
No functional changes.
--- drivers/ata/libata-scsi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/ata/libata-scsi.c +4 -3
@@ -3398,9 +3398,10 @@ static size_t ata_format_dsm_trim_descr(struct scsi_cmnd *cmd, u32 trmax,* * Translate a SCSI WRITE SAME command to be either a DSM TRIM command or * an SCT Write Same command. -* Based on WRITE SAME has the UNMAP flag -* When set translate to DSM TRIM -* When clear translate to SCT Write Same +* Based on WRITE SAME has the UNMAP flag: +* +* - When set translate to DSM TRIM +* - When clear translate to SCT Write Same */ static unsigned int ata_scsi_write_same_xlat (struct ata_queued_cmd *qc) {
Signature · 1 line
2.9.3
PATCH 28/36 docs-rst: convert s390-drivers DocBook to ReST
In reply to Mauro Carvalho ChehabUse pandoc to convert documentation to ReST by calling Documentation/sphinx/tmplcvt script.
--- Documentation/DocBook/Makefile | 2 +- Documentation/DocBook/s390-drivers.tmpl | 161 ------------------------------ Documentation/driver-api/index.rst | 1 + Documentation/driver-api/s390-drivers.rst | 111 ++++++++++++++++++++ 4 files changed, 113 insertions(+), 162 deletions(-) delete mode 100644 Documentation/DocBook/s390-drivers.tmpl create mode 100644 Documentation/driver-api/s390-drivers.rst
Documentation/DocBook/Makefile +1 -1
@@ -10,7 +10,7 @@ DOCBOOKS := z8530book.xml \ networking.xml \ lsm.xml \ mtdnand.xml librs.xml rapidio.xml \ - s390-drivers.xml scsi.xml \ + scsi.xml \ sh.xml w1.xml ifeq ($(DOCBOOKS),)
Documentation/DocBook/s390-drivers.tmpl deleted +0 -161
161 lines not on this page · raw message
Documentation/driver-api/index.rst +1 -0
@@ -34,6 +34,7 @@ available subsections can be seen below. edac libata miscellaneous + s390-drivers vme 80211/index uio-howto
Documentation/driver-api/s390-drivers.rst new file +111 -0
111 lines not on this page · raw message
Signature · 1 line
2.9.3
PATCH 31/36 net: fix some identation issues at kernel-doc markups
In reply to Mauro Carvalho ChehabSphinx is very pedantic with regards to identation and escape sequences:
./include/net/sock.h:1967: ERROR: Unexpected indentation. ./include/net/sock.h:1969: ERROR: Unexpected indentation. ./include/net/sock.h:1970: WARNING: Block quote ends without a blank line; unexpected unindent. ./include/net/sock.h:1971: WARNING: Block quote ends without a blank line; unexpected unindent. ./include/net/sock.h:2268: WARNING: Inline emphasis start-string without end-string. ./net/core/sock.c:2686: ERROR: Unexpected indentation.
./net/core/sock.c:2687: WARNING: Block quote ends without a blank line; unexpected unindent. ./net/core/datagram.c:182: WARNING: Inline emphasis start-string without end-string. ./include/linux/netdevice.h:1444: ERROR: Unexpected indentation. ./drivers/net/phy/phy.c:381: ERROR: Unexpected indentation. ./drivers/net/phy/phy.c:382: WARNING: Block quote ends without a blank line; unexpected unindent.
- Fix spacing where needed;
- Properly escape constants;
- Use a literal block for a race description.
No functional changes.
--- drivers/net/phy/phy.c | 1 + include/linux/netdevice.h | 9 +++++---- include/net/sock.h | 9 ++++----- net/core/datagram.c | 2 +- net/core/sock.c | 7 +++++-- 5 files changed, 16 insertions(+), 12 deletions(-)
drivers/net/phy/phy.c +1 -0
@@ -377,6 +377,7 @@ static void phy_sanitize_settings(struct phy_device *phydev)* @cmd: ethtool_cmd * * A few notes about parameter checking: +* * - We don't set port or transceiver, so we don't care what they * were set to. * - phy_start_aneg() will make sure forced settings are sane, and
include/linux/netdevice.h +5 -4
@@ -1433,13 +1433,14 @@ enum netdev_priv_flags {/** * struct net_device - The DEVICE structure. -* Actually, this whole structure is a big mistake. It mixes I/O -* data with strictly "high-level" data, and it has to know about -* almost every data structure used in the INET module. +* +* Actually, this whole structure is a big mistake. It mixes I/O +* data with strictly "high-level" data, and it has to know about +* almost every data structure used in the INET module. * * @name: This is the first field of the "visible" part of this structure * (i.e. as seen by users in the "Space.c" file). It is the name -* of the interface. +* of the interface. * * @name_hlist: Device name hash chain, please keep it close to name[] * @ifalias: SNMP alias
include/net/sock.h +4 -5
@@ -1953,11 +1953,10 @@ static inline bool sk_has_allocations(const struct sock *sk)* The purpose of the skwq_has_sleeper and sock_poll_wait is to wrap the memory * barrier call. They were added due to the race found within the tcp code. * -* Consider following tcp code paths: +* Consider following tcp code paths:: * -* CPU1 CPU2 -* -* sys_select receive packet +* CPU1 CPU2 +* sys_select receive packet * ... ... * __add_wait_queue update tp->rcv_nxt * ... ...
@@ -2264,7 +2263,7 @@ void __sock_tx_timestamp(__u16 tsflags, __u8 *tx_flags);* @tsflags: timestamping flags to use * @tx_flags: completed with instructions for time stamping * -* Note : callers should take care of initial *tx_flags value (usually 0) +* Note: callers should take care of initial ``*tx_flags`` value (usually 0) */ static inline void sock_tx_timestamp (const struct sock *sk,__u16 tsflags,__u8 *tx_flags)
net/core/datagram.c +1 -1
@@ -181,7 +181,7 @@ static struct sk_buff *skb_set_peeked(struct sk_buff *skb)* * This function will lock the socket if a skb is returned, so * the caller needs to unlock the socket in that case (usually by -* calling skb_free_datagram). Returns NULL with *err set to +* calling skb_free_datagram). Returns NULL with @err set to * -EAGAIN if no data was available or to some other value if an * error was detected. *
net/core/sock.c +5 -2
@@ -2682,9 +2682,12 @@ EXPORT_SYMBOL(release_sock);* @sk: socket * * This version should be used for very small section, where process wont block -* return false if fast path is taken +* return false if fast path is taken: +* * sk_lock.slock locked, owned = 0, BH disabled -* return true if slow path is taken +* +* return true if slow path is taken: +* * sk_lock.slock unlocked, owned = 1, BH enabled */ bool lock_sock_fast (struct sock *sk)
Signature · 1 line
2.9.3
PATCH 34/36 scsi: fix some kernel-doc markups
In reply to Mauro Carvalho ChehabSphinx is very pedantic with regards to ident/spacing. Fix some kernel-doc markups in order to solve those errors/warnings:
./drivers/scsi/scsicam.c:121: WARNING: Inline emphasis start-string without end-string. ./drivers/scsi/scsicam.c:121: WARNING: Inline emphasis start-string without end-string. ./drivers/scsi/scsicam.c:121: WARNING: Inline emphasis start-string without end-string. ./drivers/scsi/scsi_scan.c:1056: ERROR: Unexpected indentation. ./drivers/scsi/scsi_scan.c:1057: WARNING: Block quote ends without a blank line; unexpected unindent. ./drivers/scsi/scsi_transport_fc.c:2918: ERROR: Unexpected indentation. ./drivers/scsi/scsi_transport_fc.c:2921: WARNING: Block quote ends without a blank line; unexpected unindent. ./drivers/scsi/scsi_transport_fc.c:2922: WARNING: Enumerated list ends without a blank line; unexpected unindent.
No functional changes.
--- drivers/scsi/scsi_scan.c | 7 ++++--- drivers/scsi/scsi_transport_fc.c | 18 ++++++++++-------- drivers/scsi/scsicam.c | 4 ++-- 3 files changed, 16 insertions(+), 13 deletions(-)
drivers/scsi/scsi_scan.c +4 -3
@@ -1051,10 +1051,11 @@ static unsigned char *scsi_inq_str(unsigned char *buf, unsigned char *inq,* allocate and set it up by calling scsi_add_lun. * * Return: -* SCSI_SCAN_NO_RESPONSE: could not allocate or setup a scsi_device -* SCSI_SCAN_TARGET_PRESENT: target responded, but no device is +* +* - SCSI_SCAN_NO_RESPONSE: could not allocate or setup a scsi_device +* - SCSI_SCAN_TARGET_PRESENT: target responded, but no device is * attached at the LUN -* SCSI_SCAN_LUN_PRESENT: a new scsi_device was allocated and initialized +* - SCSI_SCAN_LUN_PRESENT: a new scsi_device was allocated and initialized **/ static int scsi_probe_and_add_lun(struct scsi_target *starget, u64 lun, int *bflagsp,
drivers/scsi/scsi_transport_fc.c +10 -8
@@ -2914,16 +2914,18 @@ EXPORT_SYMBOL(fc_remote_port_add);* port is no longer part of the topology. Note: Although a port * may no longer be part of the topology, it may persist in the remote * ports displayed by the fc_host. We do this under 2 conditions: +* * 1) If the port was a scsi target, we delay its deletion by "blocking" it. -* This allows the port to temporarily disappear, then reappear without -* disrupting the SCSI device tree attached to it. During the "blocked" -* period the port will still exist. +* This allows the port to temporarily disappear, then reappear without +* disrupting the SCSI device tree attached to it. During the "blocked" +* period the port will still exist. +* * 2) If the port was a scsi target and disappears for longer than we -* expect, we'll delete the port and the tear down the SCSI device tree -* attached to it. However, we want to semi-persist the target id assigned -* to that port if it eventually does exist. The port structure will -* remain (although with minimal information) so that the target id -* bindings remails. +* expect, we'll delete the port and the tear down the SCSI device tree +* attached to it. However, we want to semi-persist the target id assigned +* to that port if it eventually does exist. The port structure will +* remain (although with minimal information) so that the target id +* bindings remails. * * If the remote port is not an FCP Target, it will be fully torn down * and deallocated, including the fc_remote_port class device.
drivers/scsi/scsicam.c +2 -2
@@ -116,8 +116,8 @@ EXPORT_SYMBOL(scsicam_bios_param);* @hds: put heads here * @secs: put sectors here * -* Description: determine the BIOS mapping/geometry used to create the partition -* table, storing the results in *cyls, *hds, and *secs +* Determine the BIOS mapping/geometry used to create the partition +* table, storing the results in @cyls, @hds, and @secs * * Returns: -1 on failure, 0 on success. */
Signature · 1 line
2.9.3
PATCH 15/36 docs-rst: add sound book to pdf output
In reply to Mauro Carvalho ChehabThe sound subsystem book was added without the bits required to generate PDF output. Add them.
--- Documentation/conf.py | 2 ++ Documentation/sound/conf.py | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 Documentation/sound/conf.py
Documentation/conf.py +2 -0
@@ -371,6 +371,8 @@ latex_documents = [ 'The kernel development community', 'manual'), ('security/index', 'security.tex', 'The kernel security subsystem manual', 'The kernel development community', 'manual'), + ('sound/index', 'sound.tex', 'Linux Sound Subsystem Documentation', + 'The kernel development community', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of
Documentation/sound/conf.py new file +10 -0
@@ -0,0 +1,10 @@ +# -*- coding: utf-8; mode: python -*- + +project = "Linux Sound Subsystem Documentation" + +tags.add("subproject") + +latex_documents = [ + ('index', 'sound.tex', project, + 'The kernel development community', 'manual'), +]
Signature · 1 line
2.9.3
PATCH 19/36 fs: jbd2: make jbd2_journal_start() kernel-doc parseable
In reply to Mauro Carvalho Chehabkernel-doc script expects that a function documentation to be just before the function, otherwise it will be ignored.
So, move the kernel-doc markup to the right place.
--- fs/jbd2/transaction.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-)
fs/jbd2/transaction.c +19 -19
@@ -409,25 +409,6 @@ static handle_t *new_handle(int nblocks)return handle; } -/** -* handle_t *jbd2_journal_start() - Obtain a new handle. -* @journal: Journal to start transaction on. -* @nblocks: number of block buffer we might modify -* -* We make sure that the transaction can guarantee at least nblocks of -* modified buffers in the log. We block until the log can guarantee -* that much space. Additionally, if rsv_blocks > 0, we also create another -* handle with rsv_blocks reserved blocks in the journal. This handle is -* is stored in h_rsv_handle. It is not attached to any particular transaction -* and thus doesn't block transaction commit. If the caller uses this reserved -* handle, it has to set h_rsv_handle to NULL as otherwise jbd2_journal_stop() -* on the parent handle will dispose the reserved one. Reserved handle has to -* be converted to a normal handle using jbd2_journal_start_reserved() before -* it can be used. -* -* Return a pointer to a newly allocated handle, or an ERR_PTR() value -* on failure. -*/ handle_t *jbd2__journal_start (journal_t *journal,int nblocks,int rsv_blocks,gfp_t gfp_mask,unsigned int type,unsigned int line_no)
@@ -478,6 +459,25 @@ handle_t *jbd2__journal_start(journal_t *journal, int nblocks, int rsv_blocks,EXPORT_SYMBOL (jbd2__journal_start); +/** +* handle_t *jbd2_journal_start() - Obtain a new handle. +* @journal: Journal to start transaction on. +* @nblocks: number of block buffer we might modify +* +* We make sure that the transaction can guarantee at least nblocks of +* modified buffers in the log. We block until the log can guarantee +* that much space. Additionally, if rsv_blocks > 0, we also create another +* handle with rsv_blocks reserved blocks in the journal. This handle is +* is stored in h_rsv_handle. It is not attached to any particular transaction +* and thus doesn't block transaction commit. If the caller uses this reserved +* handle, it has to set h_rsv_handle to NULL as otherwise jbd2_journal_stop() +* on the parent handle will dispose the reserved one. Reserved handle has to +* be converted to a normal handle using jbd2_journal_start_reserved() before +* it can be used. +* +* Return a pointer to a newly allocated handle, or an ERR_PTR() value +* on failure. +*/ handle_t *jbd2_journal_start (journal_t *journal,int nblocks) {return jbd2__journal_start (journal, nblocks,0 ,GFP_NOFS ,0 ,0 );
Signature · 1 line
2.9.3
PATCH 30/36 net: skbuff.h: properly escape a macro name on kernel-doc
In reply to Mauro Carvalho ChehabThe "%" escape code of kernel-doc only handle letters. It doesn't handle special chars. So, use the ``literal`` notation. That fixes this warning:
./include/linux/skbuff.h:2695: WARNING: Inline literal start-string without end-string.
No functional changes.
--- include/linux/skbuff.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/skbuff.h +1 -1
@@ -2691,7 +2691,7 @@ bool skb_page_frag_refill(unsigned int sz, struct page_frag *pfrag, gfp_t prio);* @offset: the offset within the fragment (starting at the * fragment's own offset) * @size: the number of bytes to map -* @dir: the direction of the mapping (%PCI_DMA_*) +* @dir: the direction of the mapping (``PCI_DMA_*``) * * Maps the page associated with @frag to @device. */
Signature · 1 line
2.9.3
PATCH 5/36 locking.rst: reformat locking table
In reply to Mauro Carvalho ChehabUse a different markup for this table, in order to make it smaller when seeing in text mode.
--- Documentation/kernel-hacking/locking.rst | 37 ++++++++++++-------------------- 1 file changed, 14 insertions(+), 23 deletions(-)
Documentation/kernel-hacking/locking.rst +14 -23
@@ -319,29 +319,20 @@ Remember the advice above: you can always use :c:func:`spin_lock_irqsave()`, which is a superset of all other spinlock primitives. -+------------------+-----------------+-----------------+-------------+-------------+-------------+-------------+-----------+-----------+------------------+------------------+ -| | IRQ Handler A | IRQ Handler B | Softirq A | Softirq B | Tasklet A | Tasklet B | Timer A | Timer B | User Context A | User Context B | -+------------------+-----------------+-----------------+-------------+-------------+-------------+-------------+-----------+-----------+------------------+------------------+ -| IRQ Handler A | None | | | | | | | | | | -+------------------+-----------------+-----------------+-------------+-------------+-------------+-------------+-----------+-----------+------------------+------------------+ -| IRQ Handler B | SLIS | None | | | | | | | | | -+------------------+-----------------+-----------------+-------------+-------------+-------------+-------------+-----------+-----------+------------------+------------------+ -| Softirq A | SLI | SLI | SL | | | | | | | | -+------------------+-----------------+-----------------+-------------+-------------+-------------+-------------+-----------+-----------+------------------+------------------+ -| Softirq B | SLI | SLI | SL | SL | | | | | | | -+------------------+-----------------+-----------------+-------------+-------------+-------------+-------------+-----------+-----------+------------------+------------------+ -| Tasklet A | SLI | SLI | SL | SL | None | | | | | | -+------------------+-----------------+-----------------+-------------+-------------+-------------+-------------+-----------+-----------+------------------+------------------+ -| Tasklet B | SLI | SLI | SL | SL | SL | None | | | | | -+------------------+-----------------+-----------------+-------------+-------------+-------------+-------------+-----------+-----------+------------------+------------------+ -| Timer A | SLI | SLI | SL | SL | SL | SL | None | | | | -+------------------+-----------------+-----------------+-------------+-------------+-------------+-------------+-----------+-----------+------------------+------------------+ -| Timer B | SLI | SLI | SL | SL | SL | SL | SL | None | | | -+------------------+-----------------+-----------------+-------------+-------------+-------------+-------------+-----------+-----------+------------------+------------------+ -| User Context A | SLI | SLI | SLBH | SLBH | SLBH | SLBH | SLBH | SLBH | None | | -+------------------+-----------------+-----------------+-------------+-------------+-------------+-------------+-----------+-----------+------------------+------------------+ -| User Context B | SLI | SLI | SLBH | SLBH | SLBH | SLBH | SLBH | SLBH | MLI | None | -+------------------+-----------------+-----------------+-------------+-------------+-------------+-------------+-----------+-----------+------------------+------------------+ +============== ============= ============= ========= ========= ========= ========= ======= ======= ============== ============== +. IRQ Handler A IRQ Handler B Softirq A Softirq B Tasklet A Tasklet B Timer A Timer B User Context A User Context B +============== ============= ============= ========= ========= ========= ========= ======= ======= ============== ============== +IRQ Handler A None +IRQ Handler B SLIS None +Softirq A SLI SLI SL +Softirq B SLI SLI SL SL +Tasklet A SLI SLI SL SL None +Tasklet B SLI SLI SL SL SL None +Timer A SLI SLI SL SL SL SL None +Timer B SLI SLI SL SL SL SL SL None +User Context A SLI SLI SLBH SLBH SLBH SLBH SLBH SLBH None +User Context B SLI SLI SLBH SLBH SLBH SLBH SLBH SLBH MLI None +============== ============= ============= ========= ========= ========= ========= ======= ======= ============== ============== Table: Table of Locking Requirements
Signature · 1 line
2.9.3
PATCH 7/36 locking.rst: Update some ReST markups
In reply to Mauro Carvalho ChehabCorrect a few minor issues with ReST notation used on this file (produced by an automatic tool).
--- Documentation/kernel-hacking/locking.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
Documentation/kernel-hacking/locking.rst +8 -8
@@ -93,13 +93,13 @@ Locking in the Linux Kernel =========================== If I could give you one piece of advice: never sleep with anyone crazier -than yourself. But if I had to give you advice on locking: *keep it -simple*. +than yourself. But if I had to give you advice on locking: **keep it +simple**. Be reluctant to introduce new locks. Strangely enough, this last one is the exact reverse of my advice when -you *have* slept with someone crazier than yourself. And you should +you **have** slept with someone crazier than yourself. And you should think about getting a big dog. Two Main Types of Kernel Locks: Spinlocks and Mutexes
@@ -311,7 +311,7 @@ Pete Zaitcev gives the following summary: Table of Minimum Requirements ----------------------------- -The following table lists the *minimum* locking requirements between +The following table lists the **minimum** locking requirements between various contexts. In some cases, the same context can only be running on one CPU at a time, so no locking is required for that context (eg. a particular thread can only run on one CPU at a time, but if it needs
@@ -703,7 +703,7 @@ reference count, but they are more complicated. Using Atomic Operations For The Reference Count ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In practice, ``atomic_t`` would usually be used for refcnt. There are a +In practice, :c:type:`atomic_t` would usually be used for refcnt. There are a number of atomic operations defined in ``include/asm/atomic.h``: these are guaranteed to be seen atomically from all CPUs in the system, so no lock is required. In this case, it is simpler than using spinlocks,
@@ -1321,7 +1321,7 @@ from user context, and can sleep. - :c:func:`put_user()` -- ``kmalloc(GFP_KERNEL)`` +- :c:func:`kmalloc(GFP_KERNEL) <kmalloc>` - :c:func:`mutex_lock_interruptible()` and :c:func:`mutex_lock()`
@@ -1431,10 +1431,10 @@ tasklet timer A dynamically-registrable software interrupt, which is run at (or close to) a given time. When running, it is just like a tasklet (in fact, they - are called from the TIMER_SOFTIRQ). + are called from the ``TIMER_SOFTIRQ``). UP - Uni-Processor: Non-SMP. (CONFIG_SMP=n). + Uni-Processor: Non-SMP. (``CONFIG_SMP=n``). User Context The kernel executing on behalf of a particular process (ie. a system
Signature · 1 line
2.9.3
PATCH 12/36 docs-rst: conf.py: remove kernel-documentation from LaTeX
In reply to Mauro Carvalho ChehabThere's no kernel-documentation.rst file at Documentation/ anymore. So, remove it from the list of LaTeX-generated documents.
--- Documentation/conf.py | 2 -- 1 file changed, 2 deletions(-)
Documentation/conf.py +0 -2
@@ -359,8 +359,6 @@ latex_documents = [ 'The kernel development community', 'manual'), ('input/index', 'linux-input.tex', 'The Linux input driver subsystem', 'The kernel development community', 'manual'), - ('kernel-documentation', 'kernel-documentation.tex', 'The Linux Kernel Documentation', - 'The kernel development community', 'manual'), ('kernel-hacking/index', 'kernel-hacking.tex', 'Unreliable Guide To Hacking The Linux Kernel', 'The kernel development community', 'manual'), ('media/index', 'media.tex', 'Linux Media Subsystem Documentation',
Signature · 1 line
2.9.3
PATCH 1/36 docs-rst: convert kernel-hacking to ReST
In reply to Mauro Carvalho ChehabUse pandoc to convert documentation to ReST by calling Documentation/sphinx/tmplcvt script.
- Manually adjusted to use ..note and ..warning
- Minor fixes for it to be parsed without errors
- Use **bold** for emphasis.
--- Documentation/DocBook/Makefile | 2 +- Documentation/DocBook/kernel-hacking.tmpl | 1312 ----------------------------- Documentation/conf.py | 2 + Documentation/index.rst | 1 + Documentation/kernel-hacking/conf.py | 10 + Documentation/kernel-hacking/index.rst | 794 +++++++++++++++++ 6 files changed, 808 insertions(+), 1313 deletions(-) delete mode 100644 Documentation/DocBook/kernel-hacking.tmpl create mode 100644 Documentation/kernel-hacking/conf.py create mode 100644 Documentation/kernel-hacking/index.rst
Documentation/DocBook/Makefile +1 -1
@@ -7,7 +7,7 @@ # list of DOCBOOKS. DOCBOOKS := z8530book.xml \ - kernel-hacking.xml kernel-locking.xml \ + kernel-locking.xml \ networking.xml \ filesystems.xml lsm.xml kgdb.xml \ libata.xml mtdnand.xml librs.xml rapidio.xml \
Documentation/DocBook/kernel-hacking.tmpl deleted +0 -1312
1,312 lines not on this page · raw message
Documentation/conf.py +2 -0
@@ -352,6 +352,8 @@ latex_documents = [ 'The kernel development community', 'manual'), ('kernel-documentation', 'kernel-documentation.tex', 'The Linux Kernel Documentation', 'The kernel development community', 'manual'), + ('kernel-hacking/index', 'kernel-hacking.tex', 'Unreliable Guide To Hacking The Linux Kernel', + 'The kernel development community', 'manual'), ('process/index', 'development-process.tex', 'Linux Kernel Development Documentation', 'The kernel development community', 'manual'), ('gpu/index', 'gpu.tex', 'Linux GPU Driver Developer\'s Guide',
Documentation/index.rst +1 -0
@@ -51,6 +51,7 @@ merged much easier. process/index dev-tools/index doc-guide/index + kernel-hacking/index Kernel API documentation ------------------------
Documentation/kernel-hacking/conf.py new file +10 -0
@@ -0,0 +1,10 @@ +# -*- coding: utf-8; mode: python -*- + +project = "Unreliable Guide To Hacking The Linux Kernel" + +tags.add("subproject") + +latex_documents = [ + ('index', 'kernel-hacking.tex', project, + 'The kernel development community', 'manual'), +]
Documentation/kernel-hacking/index.rst new file +794 -0
794 lines not on this page · raw message
Signature · 1 line
2.9.3
PATCH 3/36 docs-rst: convert kernel-locking to ReST
In reply to Mauro Carvalho ChehabUse pandoc to convert documentation to ReST by calling Documentation/sphinx/tmplcvt script.
- Manually adjust tables with got broken by conversion
--- Documentation/DocBook/Makefile | 1 - Documentation/DocBook/kernel-locking.tmpl | 2151 ----------------------------- Documentation/kernel-hacking/hacking.rst | 811 +++++++++++ Documentation/kernel-hacking/index.rst | 814 +---------- Documentation/kernel-hacking/locking.rst | 1453 +++++++++++++++++++ 5 files changed, 2268 insertions(+), 2962 deletions(-) delete mode 100644 Documentation/DocBook/kernel-locking.tmpl create mode 100644 Documentation/kernel-hacking/hacking.rst create mode 100644 Documentation/kernel-hacking/locking.rst
Documentation/DocBook/Makefile +0 -1
@@ -7,7 +7,6 @@ # list of DOCBOOKS. DOCBOOKS := z8530book.xml \ - kernel-locking.xml \ networking.xml \ filesystems.xml lsm.xml kgdb.xml \ libata.xml mtdnand.xml librs.xml rapidio.xml \
Documentation/DocBook/kernel-locking.tmpl deleted +0 -2151
2,151 lines not on this page · raw message
Documentation/kernel-hacking/hacking.rst new file +811 -0
811 lines not on this page · raw message
Documentation/kernel-hacking/index.rst +4 -810
31 lines not on this page · raw message
Documentation/kernel-hacking/locking.rst new file +1453 -0
1,453 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.9.3
Part of the diff is not shown here. View the raw message.
PATCH 8/36 docs-rst: convert kgdb DocBook to ReST
In reply to Mauro Carvalho ChehabUse pandoc to convert documentation to ReST by calling Documentation/sphinx/tmplcvt script.
--- Documentation/DocBook/Makefile | 2 +- Documentation/DocBook/kgdb.tmpl | 918 ------------------------------------- Documentation/dev-tools/index.rst | 1 + Documentation/dev-tools/kgdb.rst | 930 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 932 insertions(+), 919 deletions(-) delete mode 100644 Documentation/DocBook/kgdb.tmpl create mode 100644 Documentation/dev-tools/kgdb.rst
Documentation/DocBook/Makefile +1 -1
@@ -8,7 +8,7 @@ DOCBOOKS := z8530book.xml \ networking.xml \ - filesystems.xml lsm.xml kgdb.xml \ + filesystems.xml lsm.xml \ libata.xml mtdnand.xml librs.xml rapidio.xml \ s390-drivers.xml scsi.xml \ sh.xml w1.xml
Documentation/DocBook/kgdb.tmpl deleted +0 -918
918 lines not on this page · raw message
Documentation/dev-tools/index.rst +1 -0
@@ -23,6 +23,7 @@ whole; patches welcome! kmemleak kmemcheck gdb-kernel-debugging + kgdb .. only:: subproject and html
Documentation/dev-tools/kgdb.rst new file +930 -0
930 lines not on this page · raw message
Signature · 1 line
2.9.3
PATCH 18/36 docs-rst: filesystems: use c domain references where needed
In reply to Mauro Carvalho ChehabInstead of just mention the function names, use cross-references to the kernel-doc tags where pertinent.
While not all function documentation is included here, I double-checked that all functions mentioned there still exists.
--- Documentation/filesystems/index.rst | 76 +++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 36 deletions(-)
Documentation/filesystems/index.rst +40 -36
@@ -125,27 +125,27 @@ Details The journalling layer is easy to use. You need to first of all create a journal_t data structure. There are two calls to do this dependent on how you decide to allocate the physical media on which the journal -resides. The jbd2_journal_init_inode() call is for journals stored in -filesystem inodes, or the jbd2_journal_init_dev() call can be used +resides. The :c:func:`jbd2_journal_init_inode` call is for journals stored in +filesystem inodes, or the :c:func:`jbd2_journal_init_dev` call can be used for journal stored on a raw device (in a continuous range of blocks). A journal_t is a typedef for a struct pointer, so when you are finally -finished make sure you call jbd2_journal_destroy() on it to free up +finished make sure you call :c:func:`jbd2_journal_destroy` on it to free up any used kernel memory. Once you have got your journal_t object you need to 'mount' or load the journal file. The journalling layer expects the space for the journal was already allocated and initialized properly by the userspace tools. -When loading the journal you must call jbd2_journal_load() to process +When loading the journal you must call :c:func:`jbd2_journal_load` to process journal contents. If the client file system detects the journal contents does not need to be processed (or even need not have valid contents), it -may call jbd2_journal_wipe() to clear the journal contents before -calling jbd2_journal_load(). +may call :c:func:`jbd2_journal_wipe` to clear the journal contents before +calling :c:func:`jbd2_journal_load`. Note that jbd2_journal_wipe(..,0) calls -jbd2_journal_skip_recovery() for you if it detects any outstanding -transactions in the journal and similarly jbd2_journal_load() will -call jbd2_journal_recover() if necessary. I would advise reading -ext4_load_journal() in fs/ext4/super.c for examples on this stage. +:c:func:`jbd2_journal_skip_recovery` for you if it detects any outstanding +transactions in the journal and similarly :c:func:`jbd2_journal_load` will +call :c:func:`jbd2_journal_recover` if necessary. I would advise reading +:c:func:`ext4_load_journal` in fs/ext4/super.c for examples on this stage. Now you can go ahead and start modifying the underlying filesystem. Almost.
@@ -154,54 +154,57 @@ You still need to actually journal your filesystem changes, this is done by wrapping them into transactions. Additionally you also need to wrap the modification of each of the buffers with calls to the journal layer, so it knows what the modifications you are actually making are. To do -this use jbd2_journal_start() which returns a transaction handle. +this use :c:func:`jbd2_journal_start` which returns a transaction handle. -jbd2_journal_start() and its counterpart jbd2_journal_stop(), which -indicates the end of a transaction are nestable calls, so you can +:c:func:`jbd2_journal_start` and its counterpart :c:func:`jbd2_journal_stop`, +which indicates the end of a transaction are nestable calls, so you can reenter a transaction if necessary, but remember you must call -jbd2_journal_stop() the same number of times as jbd2_journal_start() -before the transaction is completed (or more accurately leaves the -update phase). Ext4/VFS makes use of this feature to simplify handling -of inode dirtying, quota support, etc. +:c:func:`jbd2_journal_stop` the same number of times as +:c:func:`jbd2_journal_start` before the transaction is completed (or more +accurately leaves the update phase). Ext4/VFS makes use of this feature to +simplify handling of inode dirtying, quota support, etc. Inside each transaction you need to wrap the modifications to the individual buffers (blocks). Before you start to modify a buffer you -need to call jbd2_journal_get_{create,write,undo}_access() as -appropriate, this allows the journalling layer to copy the unmodified +need to call :c:func:`jbd2_journal_get_create_access()` / +:c:func:`jbd2_journal_get_write_access()` / +:c:func:`jbd2_journal_get_undo_access()` as appropriate, this allows the +journalling layer to copy the unmodified data if it needs to. After all the buffer may be part of a previously uncommitted transaction. At this point you are at last ready to modify a buffer, and once you are have done so you need to call -jbd2_journal_dirty_{meta,}data(). Or if you've asked for access to a +:c:func:`jbd2_journal_dirty_metadata`. Or if you've asked for access to a buffer you now know is now longer required to be pushed back on the -device you can call jbd2_journal_forget() in much the same way as you -might have used bforget() in the past. +device you can call :c:func:`jbd2_journal_forget` in much the same way as you +might have used :c:func:`bforget` in the past. -A jbd2_journal_flush() may be called at any time to commit and +A :c:func:`jbd2_journal_flush` may be called at any time to commit and checkpoint all your transactions. -Then at umount time , in your put_super() you can then call -jbd2_journal_destroy() to clean up your in-core journal object. +Then at umount time , in your :c:func:`put_super` you can then call +:c:func:`jbd2_journal_destroy` to clean up your in-core journal object. Unfortunately there a couple of ways the journal layer can cause a deadlock. The first thing to note is that each task can only have a single outstanding transaction at any one time, remember nothing commits -until the outermost jbd2_journal_stop(). This means you must complete +until the outermost :c:func:`jbd2_journal_stop`. This means you must complete the transaction at the end of each file/inode/address etc. operation you perform, so that the journalling system isn't re-entered on another journal. Since transactions can't be nested/batched across differing journals, and another filesystem other than yours (say ext4) may be modified in a later syscall. -The second case to bear in mind is that jbd2_journal_start() can block +The second case to bear in mind is that :c:func:`jbd2_journal_start` can block if there isn't enough space in the journal for your transaction (based on the passed nblocks param) - when it blocks it merely(!) needs to wait for transactions to complete and be committed from other tasks, so -essentially we are waiting for jbd2_journal_stop(). So to avoid -deadlocks you must treat jbd2_journal_start/stop() as if they were -semaphores and include them in your semaphore ordering rules to prevent -deadlocks. Note that jbd2_journal_extend() has similar blocking -behaviour to jbd2_journal_start() so you can deadlock here just as -easily as on jbd2_journal_start(). +essentially we are waiting for :c:func:`jbd2_journal_stop`. So to avoid +deadlocks you must treat :c:func:`jbd2_journal_start` / +:c:func:`jbd2_journal_stop` as if they were semaphores and include them in +your semaphore ordering rules to prevent +deadlocks. Note that :c:func:`jbd2_journal_extend` has similar blocking +behaviour to :c:func:`jbd2_journal_start` so you can deadlock here just as +easily as on :c:func:`jbd2_journal_start`. Try to reserve the right number of blocks the first time. ;-). This will be the maximum number of blocks you are going to touch in this
@@ -222,13 +225,14 @@ With journal commit callbacks you can ask the journalling layer to call a callback function when the transaction is finally committed to disk, so that you can do some of your own management. You ask the journalling layer for calling the callback by simply setting -journal->j_commit_callback function pointer and that function is +``journal->j_commit_callback`` function pointer and that function is called after each transaction commit. You can also use -transaction->t_private_list for attaching entries to a transaction +``transaction->t_private_list`` for attaching entries to a transaction that need processing when the transaction commits. JBD2 also provides a way to block all transaction updates via -jbd2_journal_{un,}lock_updates(). Ext4 uses this when it wants a +:c:func:`jbd2_journal_lock_updates()` / +:c:func:`jbd2_journal_unlock_updates()`. Ext4 uses this when it wants a window with a clean and stable fs for a moment. E.g. ::
Signature · 1 line
2.9.3
PATCH 17/36 docs-rst: convert filesystems book to ReST
In reply to Mauro Carvalho ChehabUse pandoc to convert documentation to ReST by calling Documentation/sphinx/tmplcvt script.
--- Documentation/DocBook/Makefile | 2 +- Documentation/DocBook/filesystems.tmpl | 381 --------------------------------- Documentation/conf.py | 2 + Documentation/filesystems/conf.py | 10 + Documentation/filesystems/index.rst | 314 +++++++++++++++++++++++++++ Documentation/index.rst | 1 + 6 files changed, 328 insertions(+), 382 deletions(-) delete mode 100644 Documentation/DocBook/filesystems.tmpl create mode 100644 Documentation/filesystems/conf.py create mode 100644 Documentation/filesystems/index.rst
Documentation/DocBook/Makefile +1 -1
@@ -8,7 +8,7 @@ DOCBOOKS := z8530book.xml \ networking.xml \ - filesystems.xml lsm.xml \ + lsm.xml \ libata.xml mtdnand.xml librs.xml rapidio.xml \ s390-drivers.xml scsi.xml \ sh.xml w1.xml
Documentation/DocBook/filesystems.tmpl deleted +0 -381
381 lines not on this page · raw message
Documentation/conf.py +2 -0
@@ -359,6 +359,8 @@ latex_documents = [ 'The kernel development community', 'manual'), ('driver-api/index', 'driver-api.tex', 'The kernel driver API manual', 'The kernel development community', 'manual'), + ('filesystems/index', 'filesystems.tex', 'Linux Filesystems API', + 'The kernel development community', 'manual'), ('gpu/index', 'gpu.tex', 'Linux GPU Driver Developer\'s Guide', 'The kernel development community', 'manual'), ('input/index', 'linux-input.tex', 'The Linux input driver subsystem',
Documentation/filesystems/conf.py new file +10 -0
@@ -0,0 +1,10 @@ +# -*- coding: utf-8; mode: python -*- + +project = "Linux Filesystems API" + +tags.add("subproject") + +latex_documents = [ + ('index', 'filesystems.tex', project, + 'The kernel development community', 'manual'), +]
Documentation/filesystems/index.rst new file +314 -0
314 lines not on this page · raw message
Documentation/index.rst +1 -0
@@ -73,6 +73,7 @@ needed). security/index sound/index crypto/index + filesystems/index Korean translations -------------------
Signature · 1 line
2.9.3
PATCH 4/36 mutex, futex: adjust kernel-doc markups to generate ReST
In reply to Mauro Carvalho ChehabThere are a few issues on some kernel-doc markups that was causing troubles with kernel-doc output on ReST format. Fix them.
No functional changes.
--- include/linux/mutex.h | 6 +++--- kernel/futex.c | 40 ++++++++++++++++++++-------------------- kernel/locking/mutex.c | 6 ++++-- 3 files changed, 27 insertions(+), 25 deletions(-)
include/linux/mutex.h +3 -3
@@ -214,9 +214,9 @@ enum mutex_trylock_recursive_enum {* raisins, and once those are gone this will be removed. * * Returns: -* MUTEX_TRYLOCK_FAILED - trylock failed, -* MUTEX_TRYLOCK_SUCCESS - lock acquired, -* MUTEX_TRYLOCK_RECURSIVE - we already owned the lock. +* - MUTEX_TRYLOCK_FAILED - trylock failed, +* - MUTEX_TRYLOCK_SUCCESS - lock acquired, +* - MUTEX_TRYLOCK_RECURSIVE - we already owned the lock. */ static inline /* __deprecated */ __must_check enum mutex_trylock_recursive_enummutex_trylock_recursive (struct mutex *lock)
kernel/futex.c +20 -20
@@ -488,7 +488,7 @@ static void drop_futex_key_refs(union futex_key *key)* * Return: a negative error code or 0 * -* The key words are stored in *key on success. +* The key words are stored in @key on success. * * For shared mappings, it's (page->index, file_inode(vma->vm_file), * offset_within_page). For private mappings, it's (uaddr, current->mm).
@@ -1259,9 +1259,9 @@ static int lock_pi_update_atomic(u32 __user *uaddr, u32 uval, u32 newval)* @set_waiters: force setting the FUTEX_WAITERS bit (1) or not (0) * * Return: -* 0 - ready to wait; -* 1 - acquired the lock; -* <0 - error +* - 0 - ready to wait; +* - 1 - acquired the lock; +* - <0 - error * * The hb->lock and futex_key refs shall be held by the caller. */
@@ -1717,9 +1717,9 @@ void requeue_pi_wake_futex(struct futex_q *q, union futex_key *key,* hb1 and hb2 must be held by the caller. * * Return: -* 0 - failed to acquire the lock atomically; -* >0 - acquired the lock, return value is vpid of the top_waiter -* <0 - error +* - 0 - failed to acquire the lock atomically; +* - >0 - acquired the lock, return value is vpid of the top_waiter +* - <0 - error */ static int futex_proxy_trylock_atomic(u32 __user *pifutex, struct futex_hash_bucket *hb1,
@@ -1785,8 +1785,8 @@ static int futex_proxy_trylock_atomic(u32 __user *pifutex,* uaddr2 atomically on behalf of the top waiter. * * Return: -* >=0 - on success, the number of tasks requeued or woken; -* <0 - on error +* - >=0 - on success, the number of tasks requeued or woken; +* - <0 - on error */ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, u32 __user *uaddr2, int nr_wake, int nr_requeue,
@@ -2142,8 +2142,8 @@ static inline void queue_me(struct futex_q *q, struct futex_hash_bucket *hb)* be paired with exactly one earlier call to queue_me(). * * Return: -* 1 - if the futex_q was still queued (and we removed unqueued it); -* 0 - if the futex_q was already removed by the waking thread +* - 1 - if the futex_q was still queued (and we removed unqueued it); +* - 0 - if the futex_q was already removed by the waking thread */ static int unqueue_me (struct futex_q *q) {
@@ -2333,9 +2333,9 @@ static long futex_wait_restart(struct restart_block *restart);* acquire the lock. Must be called with the hb lock held. * * Return: -* 1 - success, lock taken; -* 0 - success, lock not taken; -* <0 - on error (-EFAULT) +* - 1 - success, lock taken; +* - 0 - success, lock not taken; +* - <0 - on error (-EFAULT) */ static int fixup_owner (u32 __user *uaddr,struct futex_q *q,int locked) {
@@ -2422,8 +2422,8 @@ static void futex_wait_queue_me(struct futex_hash_bucket *hb, struct futex_q *q,* with no q.key reference on failure. * * Return: -* 0 - uaddr contains val and hb has been locked; -* <1 - -EFAULT or -EWOULDBLOCK (uaddr does not contain val) and hb is unlocked +* - 0 - uaddr contains val and hb has been locked; +* - <1 - -EFAULT or -EWOULDBLOCK (uaddr does not contain val) and hb is unlocked */ static int futex_wait_setup (u32 __user *uaddr,u32 val,unsigned int flags,struct futex_q *q,struct futex_hash_bucket **hb)
@@ -2895,8 +2895,8 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags)* called with the hb lock held. * * Return: -* 0 = no early wakeup detected; -* <0 = -ETIMEDOUT or -ERESTARTNOINTR +* - 0 = no early wakeup detected; +* - <0 = -ETIMEDOUT or -ERESTARTNOINTR */ static inline int handle_early_requeue_pi_wakeup(struct futex_hash_bucket *hb,
@@ -2968,8 +2968,8 @@ int handle_early_requeue_pi_wakeup(struct futex_hash_bucket *hb,* If 4 or 7, we cleanup and return with -ETIMEDOUT. * * Return: -* 0 - On success; -* <0 - On error +* - 0 - On success; +* - <0 - On error */ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, u32 val, ktime_t *abs_time, u32 bitset,
kernel/locking/mutex.c +4 -2
@@ -227,9 +227,11 @@ static void __sched __mutex_lock_slowpath(struct mutex *lock);* (or statically defined) before it can be locked. memset()-ing * the mutex to 0 is not allowed. * -* ( The CONFIG_DEBUG_MUTEXES .config option turns on debugging +* .. note:: +* +* The CONFIG_DEBUG_MUTEXES .config option turns on debugging * checks that will enforce the restrictions and will also do -* deadlock debugging. ) +* deadlock debugging. * * This function is similar to (but not equivalent to) down(). */
Signature · 1 line
2.9.3
PATCH 36/36 docs-rst: convert rapidio book to ReST
In reply to Mauro Carvalho ChehabUse pandoc to convert documentation to ReST by calling Documentation/sphinx/tmplcvt script.
--- Documentation/DocBook/Makefile | 4 +- Documentation/DocBook/rapidio.tmpl | 155 ----------------------------------- Documentation/driver-api/index.rst | 1 + Documentation/driver-api/rapidio.rst | 107 ++++++++++++++++++++++++ 4 files changed, 110 insertions(+), 157 deletions(-) delete mode 100644 Documentation/DocBook/rapidio.tmpl create mode 100644 Documentation/driver-api/rapidio.rst
Documentation/DocBook/Makefile +2 -2
@@ -8,8 +8,8 @@ DOCBOOKS := \ lsm.xml \ - mtdnand.xml librs.xml rapidio.xml \ - sh.xml w1.xml + mtdnand.xml librs.xml \ + sh.xml ifeq ($(DOCBOOKS),)
Documentation/DocBook/rapidio.tmpl deleted +0 -155
155 lines not on this page · raw message
Documentation/driver-api/index.rst +1 -0
@@ -36,6 +36,7 @@ available subsections can be seen below. libata miscellaneous w1 + rapidio s390-drivers vme 80211/index
Documentation/driver-api/rapidio.rst new file +107 -0
107 lines not on this page · raw message
Signature · 1 line
2.9.3
PATCH 14/36 docs-rst: add dev-tools book to pdf output
In reply to Mauro Carvalho ChehabThe dev-tools API book was added without the bits required to generate PDF output at the main conf.py. Add them.
--- Documentation/conf.py | 2 ++ 1 file changed, 2 insertions(+)
Documentation/conf.py +2 -0
@@ -353,6 +353,8 @@ latex_documents = [ 'The kernel development community', 'manual'), ('crypto/index', 'crypto-api.tex', 'Linux Kernel Crypto API manual', 'The kernel development community', 'manual'), + ('dev-tools/index', 'dev-tools.tex', 'Development tools for the Kernel', + 'The kernel development community', 'manual'), ('doc-guide/index', 'kernel-doc-guide.tex', 'Linux Kernel Documentation Guide', 'The kernel development community', 'manual'), ('driver-api/index', 'driver-api.tex', 'The kernel driver API manual',
Signature · 1 line
2.9.3
Re: [PATCH 21/36] fs: locks: Fix some troubles at kernel-doc comments
In reply to Mauro Carvalho ChehabQuoted 37 lines · Mauro Carvalho Chehab
There are a few syntax violations that cause outputs of a few comments to not be properly parsed in ReST format.
No functional changes.
Signed-off-by Mauro Carvalho Chehab <[email protected]>--- fs/locks.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)fs/locks.c +3
-8@@ -1858,8 +1858,8 @@ EXPORT_SYMBOL(generic_setlease);* * Call this to establish a lease on the file. The "lease" argument is not * used for F_UNLCK requests and may be NULL. For commands that set or alter -* an existing lease, the (*lease)->fl_lmops->lm_break operation must be set; -* if not, this function will return -ENOLCK (and generate a scary-looking +* an existing lease, the ``(*lease)->fl_lmops->lm_break`` operation must be +* set; if not, this function will return -ENOLCK (and generate a scary-looking * stack trace). * * The "priv" pointer is passed directly to the lm_setup function as-is. It @@ -1972,15 +1972,13 @@ EXPORT_SYMBOL(locks_lock_inode_wait);* @cmd: the type of lock to apply. * * Apply a %FL_FLOCK style lock to an open file descriptor. -* The @cmd can be one of +* The @cmd can be one of: * -* %LOCK_SH -- a shared lock. -* -* %LOCK_EX -- an exclusive lock. -* -* %LOCK_UN -- remove an existing lock.
fs/locks.c EXPORT_SYMBOL(locks_lock_inode_wait); · line 1984
Quoted 10 lines
fs/locks.c +5
-2-* -* %LOCK_MAND -- a `mandatory' flock. This exists to emulate Windows Share Modes. +* - %LOCK_SH -- a shared lock. +* - %LOCK_EX -- an exclusive lock. +* - %LOCK_UN -- remove an existing lock. +* - %LOCK_MAND -- a 'mandatory' flock. +* This exists to emulate Windows Share Modes. * * %LOCK_MAND can be combined with %LOCK_READ or %LOCK_WRITE to allow other * processes read and write access respectively.
LGTM. Do you need me or Bruce to pick this one up?
PATCH 25/36 docs-rst: convert libata book to ReST
In reply to Mauro Carvalho ChehabUse pandoc to convert documentation to ReST by calling Documentation/sphinx/tmplcvt script.
--- Documentation/DocBook/Makefile | 2 +- Documentation/DocBook/libata.tmpl | 1625 ----------------------------------- Documentation/driver-api/index.rst | 1 + Documentation/driver-api/libata.rst | 1027 ++++++++++++++++++++++ 4 files changed, 1029 insertions(+), 1626 deletions(-) delete mode 100644 Documentation/DocBook/libata.tmpl create mode 100644 Documentation/driver-api/libata.rst
Documentation/DocBook/Makefile +1 -1
@@ -9,7 +9,7 @@ DOCBOOKS := z8530book.xml \ networking.xml \ lsm.xml \ - libata.xml mtdnand.xml librs.xml rapidio.xml \ + mtdnand.xml librs.xml rapidio.xml \ s390-drivers.xml scsi.xml \ sh.xml w1.xml
Documentation/DocBook/libata.tmpl deleted +0 -1625
1,625 lines not on this page · raw message
Documentation/driver-api/index.rst +1 -0
@@ -32,6 +32,7 @@ available subsections can be seen below. i2c hsi edac + libata miscellaneous vme 80211/index
Documentation/driver-api/libata.rst new file +1027 -0
1,027 lines not on this page · raw message
Signature · 1 line
2.9.3
PATCH 2/36 kernel-hacking: update document
In reply to Mauro Carvalho ChehabThis document is fairly updated. Yet, some stuff moved to other kernel headers. So, update to point to the right places.
While here, adjust some minor ReST markups.
--- Documentation/kernel-hacking/index.rst | 179 ++++++++++++++++++--------------- 1 file changed, 98 insertions(+), 81 deletions(-)
Documentation/kernel-hacking/index.rst +98 -81
@@ -56,7 +56,7 @@ interrupts. You can sleep, by calling :c:func:`schedule()`. In user context, the ``current`` pointer (indicating the task we are currently executing) is valid, and :c:func:`in_interrupt()` -(``include/linux/interrupt.h``) is false. +(``include/linux/preempt.h``) is false. .. warning::
@@ -114,12 +114,12 @@ time, although different tasklets can run simultaneously. Kuznetsov had at the time. You can tell you are in a softirq (or tasklet) using the -:c:func:`in_softirq()` macro (``include/linux/interrupt.h``). +:c:func:`in_softirq()` macro (``include/linux/preempt.h``). .. warning:: - Beware that this will return a false positive if a bh lock (see - below) is held. + Beware that this will return a false positive if a + :ref:`botton half lock <local_bh_disable>` is held. Some Basic Rules ================
@@ -154,9 +154,7 @@ The Linux kernel is portable ioctls: Not writing a new system call ===================================== -A system call generally looks like this - -:: +A system call generally looks like this:: asmlinkage long sys_mycall(int arg) {
@@ -175,7 +173,9 @@ If all your routine does is read or write some parameter, consider implementing a :c:func:`sysfs()` interface instead. Inside the ioctl you're in user context to a process. When a error -occurs you return a negated errno (see ``include/linux/errno.h``), +occurs you return a negated errno (see +``include/uapi/asm-generic/errno-base.h``, +``include/uapi/asm-generic/errno.h`` and ``include/linux/errno.h``), otherwise you return 0. After you slept you should check if a signal occurred: the Unix/Linux
@@ -195,9 +195,7 @@ some data structure. If you're doing longer computations: first think userspace. If you **really** want to do it in kernel you should regularly check if you need to give up the CPU (remember there is cooperative multitasking per CPU). -Idiom: - -:: +Idiom:: cond_resched(); /* Will sleep */
@@ -231,26 +229,24 @@ Really. Common Routines =============== -:c:func:`printk()` ``include/linux/kernel.h`` ---------------------------------------------- +:c:func:`printk()` +------------------ + +Defined in ``include/linux/printk.h`` :c:func:`printk()` feeds kernel messages to the console, dmesg, and the syslog daemon. It is useful for debugging and reporting errors, and can be used inside interrupt context, but use with caution: a machine which has its console flooded with printk messages is unusable. It uses a format string mostly compatible with ANSI C printf, and C string -concatenation to give it a first "priority" argument: - -:: +concatenation to give it a first "priority" argument:: printk(KERN_INFO "i = %u\n", i); -See ``include/linux/kernel.h``; for other ``KERN_`` values; these are +See ``include/linux/kern_levels.h``; for other ``KERN_`` values; these are interpreted by syslog as the level. Special case: for printing an IP -address use - -:: +address use:: __be32 ipaddress; printk(KERN_INFO "my ip: %pI4\n", &ipaddress);
@@ -270,8 +266,10 @@ overruns. Make sure that will be enough. on top of its printf function: "Printf should not be used for chit-chat". You should follow that advice. -:c:func:`copy_[to/from]_user()` / :c:func:`get_user()` / :c:func:`put_user()` ``include/linux/uaccess.h`` ---------------------------------------------------------------------------------------------------------- +:c:func:`copy_to_user()` / :c:func:`copy_from_user()` / :c:func:`get_user()` / :c:func:`put_user()` +--------------------------------------------------------------------------------------------------- + +Defined in ``include/linux/uaccess.h`` / ``asm/uaccess.h`` **[SLEEPS]**
@@ -297,8 +295,10 @@ The functions may sleep implicitly. This should never be called outside user context (it makes no sense), with interrupts disabled, or a spinlock held. -:c:func:`kmalloc()`/:c:func:`kfree()` ``include/linux/slab.h`` --------------------------------------------------------------- +:c:func:`kmalloc()`/:c:func:`kfree()` +------------------------------------- + +Defined in ``include/linux/slab.h`` **[MAY SLEEP: SEE BELOW]**
@@ -324,9 +324,9 @@ message, then maybe you called a sleeping allocation function from interrupt context without ``GFP_ATOMIC``. You should really fix that. Run, don't walk. -If you are allocating at least ``PAGE_SIZE`` (``include/asm/page.h``) -bytes, consider using :c:func:`__get_free_pages()` -(``include/linux/mm.h``). It takes an order argument (0 for page sized, +If you are allocating at least ``PAGE_SIZE`` (``asm/page.h`` or +``asm/page_types.h``) bytes, consider using :c:func:`__get_free_pages()` +(``include/linux/gfp.h``). It takes an order argument (0 for page sized, 1 for double page, 2 for four pages etc.) and the same memory priority flag word as above.
@@ -344,24 +344,30 @@ routine. Before inventing your own cache of often-used objects consider using a slab cache in ``include/linux/slab.h`` -:c:func:`current()` ``include/asm/current.h`` ---------------------------------------------- +:c:func:`current()` +------------------- + +Defined in ``include/asm/current.h`` This global variable (really a macro) contains a pointer to the current task structure, so is only valid in user context. For example, when a process makes a system call, this will point to the task structure of the calling process. It is **not NULL** in interrupt context. -:c:func:`mdelay()`/:c:func:`udelay()` ``include/asm/delay.h`` ``include/linux/delay.h`` ---------------------------------------------------------------------------------------- +:c:func:`mdelay()`/:c:func:`udelay()` +------------------------------------- + +Defined in ``include/asm/delay.h`` / ``include/linux/delay.h`` The :c:func:`udelay()` and :c:func:`ndelay()` functions can be used for small pauses. Do not use large values with them as you risk overflow - the helper function :c:func:`mdelay()` is useful here, or consider :c:func:`msleep()`. -:c:func:`cpu_to_be32()`/:c:func:`be32_to_cpu()`/:c:func:`cpu_to_le32()`/:c:func:`le32_to_cpu()` ``include/asm/byteorder.h`` ---------------------------------------------------------------------------------------------------------------------------- +:c:func:`cpu_to_be32()`/:c:func:`be32_to_cpu()`/:c:func:`cpu_to_le32()`/:c:func:`le32_to_cpu()` +----------------------------------------------------------------------------------------------- + +Defined in ``include/asm/byteorder.h`` The :c:func:`cpu_to_be32()` family (where the "32" can be replaced by 64 or 16, and the "be" can be replaced by "le") are the general way
@@ -375,8 +381,10 @@ to the given type, and return the converted value. The other variation is the "in-situ" family, such as :c:func:`cpu_to_be32s()`, which convert value referred to by the pointer, and return void. -:c:func:`local_irq_save()`/:c:func:`local_irq_restore()` ``include/linux/irqflags.h`` -------------------------------------------------------------------------------------- +:c:func:`local_irq_save()`/:c:func:`local_irq_restore()` +-------------------------------------------------------- + +Defined in ``include/linux/irqflags.h`` These routines disable hard interrupts on the local CPU, and restore them. They are reentrant; saving the previous state in their one
@@ -384,16 +392,23 @@ them. They are reentrant; saving the previous state in their one enabled, you can simply use :c:func:`local_irq_disable()` and :c:func:`local_irq_enable()`. -:c:func:`local_bh_disable()`/:c:func:`local_bh_enable()` ``include/linux/interrupt.h`` --------------------------------------------------------------------------------------- +.. _local_bh_disable: + +:c:func:`local_bh_disable()`/:c:func:`local_bh_enable()` +-------------------------------------------------------- + +Defined in ``include/linux/bottom_half.h`` + These routines disable soft interrupts on the local CPU, and restore them. They are reentrant; if soft interrupts were disabled before, they will still be disabled after this pair of functions has been called. They prevent softirqs and tasklets from running on the current CPU. -:c:func:`smp_processor_id()`() ``include/asm/smp.h`` ----------------------------------------------------- +:c:func:`smp_processor_id()` +---------------------------- + +Defined in ``include/linux/smp.h`` :c:func:`get_cpu()` disables preemption (so you won't suddenly get moved to another CPU) and returns the current processor number, between
@@ -405,8 +420,10 @@ If you know you cannot be preempted by another task (ie. you are in interrupt context, or have preemption disabled) you can use smp_processor_id(). -``__init``/``__exit``/``__initdata`` ``include/linux/init.h`` -------------------------------------------------------------- +``__init``/``__exit``/``__initdata`` +------------------------------------ + +Defined in ``include/linux/init.h`` After boot, the kernel frees up a special section; functions marked with ``__init`` and data structures marked with ``__initdata`` are dropped
@@ -415,10 +432,13 @@ initialization. ``__exit`` is used to declare a function which is only required on exit: the function will be dropped if this file is not compiled as a module. See the header file for use. Note that it makes no sense for a function marked with ``__init`` to be exported to modules -with :c:func:`EXPORT_SYMBOL()` - this will break. +with :c:func:`EXPORT_SYMBOL()` or :c:func:`EXPORT_SYMBOL_GPL()`- this +will break. -:c:func:`__initcall()`/:c:func:`module_init()` ``include/linux/init.h`` ------------------------------------------------------------------------ +:c:func:`__initcall()`/:c:func:`module_init()` +---------------------------------------------- + +Defined in ``include/linux/init.h`` / ``include/linux/module.h`` Many parts of the kernel are well served as a module (dynamically-loadable parts of the kernel). Using the
@@ -438,8 +458,11 @@ to fail (unfortunately, this has no effect if the module is compiled into the kernel). This function is called in user context with interrupts enabled, so it can sleep. -:c:func:`module_exit()` ``include/linux/init.h`` ------------------------------------------------- +:c:func:`module_exit()` +----------------------- + + +Defined in ``include/linux/module.h`` This macro defines the function to be called at module removal time (or never, in the case of the file compiled into the kernel). It will only
@@ -450,8 +473,10 @@ it returns. Note that this macro is optional: if it is not present, your module will not be removable (except for 'rmmod -f'). -:c:func:`try_module_get()`/:c:func:`module_put()` ``include/linux/module.h`` ----------------------------------------------------------------------------- +:c:func:`try_module_get()`/:c:func:`module_put()` +------------------------------------------------- + +Defined in ``include/linux/module.h`` These manipulate the module usage count, to protect against removal (a module also can't be removed if another module uses one of its exported
@@ -472,8 +497,8 @@ Wait Queues ``include/linux/wait.h`` A wait queue is used to wait for someone to wake you up when a certain condition is true. They must be used carefully to ensure there is no -race condition. You declare a ``wait_queue_head_t``, and then processes -which want to wait for that condition declare a ``wait_queue_t`` +race condition. You declare a :c:type:`wait_queue_head_t`, and then processes +which want to wait for that condition declare a :c:type:`wait_queue_t` referring to themselves, and place that in the queue. Declaring
@@ -490,15 +515,15 @@ Queuing Placing yourself in the waitqueue is fairly complex, because you must put yourself in the queue before checking the condition. There is a macro to do this: :c:func:`wait_event_interruptible()` -``include/linux/wait.h`` The first argument is the wait queue head, and +(``include/linux/wait.h``) The first argument is the wait queue head, and the second is an expression which is evaluated; the macro returns 0 when -this expression is true, or -ERESTARTSYS if a signal is received. The +this expression is true, or ``-ERESTARTSYS`` if a signal is received. The :c:func:`wait_event()` version ignores signals. Waking Up Queued Tasks ---------------------- -Call :c:func:`wake_up()` ``include/linux/wait.h``;, which will wake +Call :c:func:`wake_up()` (``include/linux/wait.h``);, which will wake up every process in the queue. The exception is if one has ``TASK_EXCLUSIVE`` set, in which case the remainder of the queue will not be woken. There are other variants of this basic function available
@@ -508,9 +533,9 @@ Atomic Operations ================= Certain operations are guaranteed atomic on all platforms. The first -class of operations work on ``atomic_t`` ``include/asm/atomic.h``; this -contains a signed integer (at least 32 bits long), and you must use -these functions to manipulate or read atomic_t variables. +class of operations work on :c:type:`atomic_t` (``include/asm/atomic.h``); +this contains a signed integer (at least 32 bits long), and you must use +these functions to manipulate or read :c:type:`atomic_t` variables. :c:func:`atomic_read()` and :c:func:`atomic_set()` get and set the counter, :c:func:`atomic_add()`, :c:func:`atomic_sub()`, :c:func:`atomic_inc()`, :c:func:`atomic_dec()`, and
@@ -534,7 +559,7 @@ true if the bit was previously set; these are particularly useful for atomically setting flags. It is possible to call these operations with bit indices greater than -BITS_PER_LONG. The resulting behavior is strange on big-endian +``BITS_PER_LONG``. The resulting behavior is strange on big-endian platforms though so it is a good idea not to do this. Symbols
@@ -546,14 +571,18 @@ be used anywhere in the kernel). However, for modules, a special exported symbol table is kept which limits the entry points to the kernel proper. Modules can also export symbols. -:c:func:`EXPORT_SYMBOL()` ``include/linux/export.h`` ----------------------------------------------------- +:c:func:`EXPORT_SYMBOL()` +------------------------- + +Defined in ``include/linux/export.h`` This is the classic method of exporting a symbol: dynamically loaded modules will be able to use the symbol as normal. -:c:func:`EXPORT_SYMBOL_GPL()` ``include/linux/export.h`` --------------------------------------------------------- +:c:func:`EXPORT_SYMBOL_GPL()` +----------------------------- + +Defined in ``include/linux/export.h`` Similar to :c:func:`EXPORT_SYMBOL()` except that the symbols exported by :c:func:`EXPORT_SYMBOL_GPL()` can only be seen by
@@ -579,11 +608,11 @@ Return Conventions ------------------ For code called in user context, it's very common to defy C convention, -and return 0 for success, and a negative error number (eg. -EFAULT) for +and return 0 for success, and a negative error number (eg. ``-EFAULT``) for failure. This can be unintuitive at first, but it's fairly widespread in the kernel. -Using :c:func:`ERR_PTR()` ``include/linux/err.h``; to encode a +Using :c:func:`ERR_PTR()` (``include/linux/err.h``) to encode a negative error number into a pointer, and :c:func:`IS_ERR()` and :c:func:`PTR_ERR()` to get it back out again: avoids a separate pointer parameter for the error number. Icky, but in a good way.
@@ -603,9 +632,7 @@ Initializing structure members ------------------------------ The preferred method of initializing structures is to use designated -initialisers, as defined by ISO C99, eg: - -:: +initialisers, as defined by ISO C99, eg:: static struct block_device_operations opt_fops = { .open = opt_open,
@@ -716,18 +743,14 @@ Kernel Cantrips Some favorites from browsing the source. Feel free to add to this list. -``arch/x86/include/asm/delay.h:`` - -:: +``arch/x86/include/asm/delay.h``:: #define ndelay(n) (__builtin_constant_p(n) ? \ ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \ __ndelay(n)) -``include/linux/fs.h``: - -:: +``include/linux/fs.h``:: /* * Kernel pointers have redundant information, so we can use a
@@ -741,9 +764,7 @@ Some favorites from browsing the source. Feel free to add to this list. #define PTR_ERR(ptr) ((long)(ptr)) #define IS_ERR(ptr) ((unsigned long)(ptr) > (unsigned long)(-1000)) -``arch/x86/include/asm/uaccess_32.h:`` - -:: +``arch/x86/include/asm/uaccess_32.h:``:: #define copy_to_user(to,from,n) \ (__builtin_constant_p(n) ? \
@@ -751,9 +772,7 @@ Some favorites from browsing the source. Feel free to add to this list. __generic_copy_to_user((to),(from),(n))) -``arch/sparc/kernel/head.S:`` - -:: +``arch/sparc/kernel/head.S:``:: /* * Sun people can't spell worth damn. "compatability" indeed.
@@ -772,9 +791,7 @@ Some favorites from browsing the source. Feel free to add to this list. .asciz "compatible" -``arch/sparc/lib/checksum.S:`` - -:: +``arch/sparc/lib/checksum.S:``:: /* Sun, you just can't beat me, you just can't. Stop trying, * give up. I'm serious, I am going to kick the living shit
Signature · 1 line
2.9.3
PATCH 33/36 docs-rst: convert scsi DocBook to ReST
In reply to Mauro Carvalho ChehabUse pandoc to convert documentation to ReST by calling Documentation/sphinx/tmplcvt script.
--- Documentation/DocBook/Makefile | 1 - Documentation/DocBook/scsi.tmpl | 409 --------------------------------- Documentation/driver-api/index.rst | 1 + Documentation/driver-api/scsi.rst | 344 +++++++++++++++++++++++++++ Documentation/networking/z8530book.rst | 15 +- 5 files changed, 352 insertions(+), 418 deletions(-) delete mode 100644 Documentation/DocBook/scsi.tmpl create mode 100644 Documentation/driver-api/scsi.rst
Documentation/DocBook/Makefile +0 -1
@@ -9,7 +9,6 @@ DOCBOOKS := \ lsm.xml \ mtdnand.xml librs.xml rapidio.xml \ - scsi.xml \ sh.xml w1.xml ifeq ($(DOCBOOKS),)
Documentation/DocBook/scsi.tmpl deleted +0 -409
409 lines not on this page · raw message
Documentation/driver-api/index.rst +1 -0
@@ -32,6 +32,7 @@ available subsections can be seen below. i2c hsi edac + scsi libata miscellaneous s390-drivers
Documentation/driver-api/scsi.rst new file +344 -0
344 lines not on this page · raw message
Documentation/networking/z8530book.rst +7 -8
@@ -170,10 +170,10 @@ This function is very timing critical. When you wish to simply discard data the support code provides the function :c:func:`z8530_null_rx()` to discard the data. -To active PIO mode sending and receiving the `` - z8530_sync_open`` is called. This expects to be passed the network -device and the channel. Typically this is called from your network -device open callback. On a failure a non zero error status is returned. +To active PIO mode sending and receiving the ``z8530_sync_open`` is called. +This expects to be passed the network device and the channel. Typically +this is called from your network device open callback. On a failure a +non zero error status is returned. The :c:func:`z8530_sync_close()` function shuts down a PIO channel. This must be done before the channel is opened again and before the driver shuts down and unloads.
@@ -190,8 +190,7 @@ the close function matching the open mode you used. The final supported mode uses a single DMA channel to drive the transmit side. As the Z85C30 has a larger FIFO on the receive channel this tends to increase the maximum speed a little. This is activated by calling the -``z8530_sync_txdma_open - ``. This returns a non zero error code on failure. The +``z8530_sync_txdma_open``. This returns a non zero error code on failure. The :c:func:`z8530_sync_txdma_close()` function closes down the Z8530 interface from this mode.
@@ -228,8 +227,8 @@ Should you need to retarget the Z8530 driver to another architecture the only code that should need changing are the port I/O functions. At the moment these assume PC I/O port accesses. This may not be appropriate for all platforms. Replacing :c:func:`z8530_read_port()` and -``z8530_write_port - `` is intended to be all that is required to port this driver layer. +``z8530_write_port`` is intended to be all that is required to port +this driver layer. Known Bugs And Assumptions ==========================
Signature · 1 line
2.9.3
PATCH 32/36 docs-rst: convert z8530book DocBook to ReST
In reply to Mauro Carvalho ChehabUse pandoc to convert documentation to ReST by calling Documentation/sphinx/tmplcvt script.
Some manual adjustments were required due to some
conversion error on some literals.
--- Documentation/DocBook/Makefile | 2 +- Documentation/DocBook/z8530book.tmpl | 371 --------------------------------- Documentation/networking/index.rst | 1 + Documentation/networking/z8530book.rst | 257 +++++++++++++++++++++++ 4 files changed, 259 insertions(+), 372 deletions(-) delete mode 100644 Documentation/DocBook/z8530book.tmpl create mode 100644 Documentation/networking/z8530book.rst
Documentation/DocBook/Makefile +1 -1
@@ -6,7 +6,7 @@ # To add a new book the only step required is to add the book to the # list of DOCBOOKS. -DOCBOOKS := z8530book.xml \ +DOCBOOKS := \ lsm.xml \ mtdnand.xml librs.xml rapidio.xml \ scsi.xml \
Documentation/DocBook/z8530book.tmpl deleted +0 -371
371 lines not on this page · raw message
Documentation/networking/index.rst +1 -0
@@ -7,6 +7,7 @@ Contents: :maxdepth: 2 kapi + z8530book .. only:: subproject
Documentation/networking/z8530book.rst new file +257 -0
257 lines not on this page · raw message
Signature · 1 line
2.9.3
PATCH 9/36 kgdb.rst: Adjust ReST markups
In reply to Mauro Carvalho ChehabThe automatic conversion didn't work too well for this file. It added weird html blocks inside it, and did some weird things for literals. Manually fix it, in order to present a nice display at html/pdf outputs.
--- Documentation/dev-tools/kgdb.rst | 489 +++++++++++++++++++-------------------- 1 file changed, 233 insertions(+), 256 deletions(-)
Documentation/dev-tools/kgdb.rst +233 -256
@@ -51,28 +51,29 @@ Compiling a kernel Kernel config options for kgdb ------------------------------ -To enable ``CONFIG_KGDB`` you should look under "Kernel hacking" / -"Kernel debugging" and select "KGDB: kernel debugger". +To enable ``CONFIG_KGDB`` you should look under +:menuselection:`Kernel hacking --> Kernel debugging` and select +:menuselection:`KGDB: kernel debugger`. While it is not a hard requirement that you have symbols in your vmlinux file, gdb tends not to be very useful without the symbolic data, so you -will want to turn on ``CONFIG_DEBUG_INFO`` which is called "Compile the -kernel with debug info" in the config menu. +will want to turn on ``CONFIG_DEBUG_INFO`` which is called +:menuselection:`Compile the kernel with debug info` in the config menu. It is advised, but not required, that you turn on the -``CONFIG_FRAME_POINTER`` kernel option which is called "Compile the -kernel with frame pointers" in the config menu. This option inserts code +``CONFIG_FRAME_POINTER`` kernel option which is called :menuselection:`Compile +the kernel with frame pointers` in the config menu. This option inserts code to into the compiled executable which saves the frame information in registers or on the stack at different points which allows a debugger such as gdb to more accurately construct stack back traces while debugging the kernel. If the architecture that you are using supports the kernel option -CONFIG_STRICT_KERNEL_RWX, you should consider turning it off. This +``CONFIG_STRICT_KERNEL_RWX``, you should consider turning it off. This option will prevent the use of software breakpoints because it marks certain regions of the kernel's memory space as read-only. If kgdb supports it for the architecture you are using, you can use hardware -breakpoints if you desire to run with the CONFIG_STRICT_KERNEL_RWX +breakpoints if you desire to run with the ``CONFIG_STRICT_KERNEL_RWX`` option turned on, else you need to turn off this option. Next you should choose one of more I/O drivers to interconnect debugging
@@ -80,17 +81,14 @@ host and debugged target. Early boot debugging requires a KGDB I/O driver that supports early debugging and the driver must be built into the kernel directly. Kgdb I/O driver configuration takes place via kernel or module parameters which you can learn more about in the in the -section that describes the parameter "kgdboc". +section that describes the parameter kgdboc. -Here is an example set of .config symbols to enable or disable for kgdb: +Here is an example set of ``.config`` symbols to enable or disable for kgdb:: -- # CONFIG_STRICT_KERNEL_RWX is not set - -- CONFIG_FRAME_POINTER=y - -- CONFIG_KGDB=y - -- CONFIG_KGDB_SERIAL_CONSOLE=y + # CONFIG_STRICT_KERNEL_RWX is not set + CONFIG_FRAME_POINTER=y + CONFIG_KGDB=y + CONFIG_KGDB_SERIAL_CONSOLE=y Kernel config options for kdb -----------------------------
@@ -99,34 +97,29 @@ Kdb is quite a bit more complex than the simple gdbstub sitting on top of the kernel's debug core. Kdb must implement a shell, and also adds some helper functions in other parts of the kernel, responsible for printing out interesting data such as what you would see if you ran -"lsmod", or "ps". In order to build kdb into the kernel you follow the +``lsmod``, or ``ps``. In order to build kdb into the kernel you follow the same steps as you would for kgdb. The main config option for kdb is ``CONFIG_KGDB_KDB`` which is called -"KGDB_KDB: include kdb frontend for kgdb" in the config menu. In theory -you would have already also selected an I/O driver such as the -CONFIG_KGDB_SERIAL_CONSOLE interface if you plan on using kdb on a +:menuselection:`KGDB_KDB: include kdb frontend for kgdb` in the config menu. +In theory you would have already also selected an I/O driver such as the +``CONFIG_KGDB_SERIAL_CONSOLE`` interface if you plan on using kdb on a serial port, when you were configuring kgdb. If you want to use a PS/2-style keyboard with kdb, you would select -CONFIG_KDB_KEYBOARD which is called "KGDB_KDB: keyboard as input -device" in the config menu. The CONFIG_KDB_KEYBOARD option is not used -for anything in the gdb interface to kgdb. The CONFIG_KDB_KEYBOARD +``CONFIG_KDB_KEYBOARD`` which is called :menuselection:`KGDB_KDB: keyboard as +input device` in the config menu. The ``CONFIG_KDB_KEYBOARD`` option is not +used for anything in the gdb interface to kgdb. The ``CONFIG_KDB_KEYBOARD`` option only works with kdb. -Here is an example set of .config symbols to enable/disable kdb: - -- # CONFIG_STRICT_KERNEL_RWX is not set - -- CONFIG_FRAME_POINTER=y - -- CONFIG_KGDB=y - -- CONFIG_KGDB_SERIAL_CONSOLE=y - -- CONFIG_KGDB_KDB=y - -- CONFIG_KDB_KEYBOARD=y +Here is an example set of ``.config`` symbols to enable/disable kdb:: + + # CONFIG_STRICT_KERNEL_RWX is not set + CONFIG_FRAME_POINTER=y + CONFIG_KGDB=y + CONFIG_KGDB_SERIAL_CONSOLE=y + CONFIG_KGDB_KDB=y + CONFIG_KDB_KEYBOARD=y Kernel Debugger Boot Arguments ==============================
@@ -164,7 +157,9 @@ with kdb while allowing the full graphics console applications to run. kgdboc arguments ~~~~~~~~~~~~~~~~ -Usage: ``kgdboc=[kms][[,]kbd][[,]serial_device][,baud]`` +Usage:: + + kgdboc=[kms][[,]kbd][[,]serial_device][,baud] The order listed above must be observed if you use any of the optional configurations together.
@@ -186,11 +181,15 @@ Using loadable module or built-in 1. As a kernel built-in: - Use the kernel boot argument: ``kgdboc=<tty-device>,[baud]`` + Use the kernel boot argument:: + + kgdboc=<tty-device>,[baud] 2. As a kernel loadable module: - Use the command: ``modprobe kgdboc kgdboc=<tty-device>,[baud]`` + Use the command:: + + modprobe kgdboc kgdboc=<tty-device>,[baud] Here are two examples of how you might format the kgdboc string. The first is for an x86 target using the first serial port. The second
@@ -206,16 +205,18 @@ Configure kgdboc at runtime with sysfs At run time you can enable or disable kgdboc by echoing a parameters into the sysfs. Here are two examples: -1. Enable kgdboc on ttyS0 +1. Enable kgdboc on ttyS0:: - ``echo ttyS0 > /sys/module/kgdboc/parameters/kgdboc`` + echo ttyS0 > /sys/module/kgdboc/parameters/kgdboc -2. Disable kgdboc +2. Disable kgdboc:: - ``echo "" > /sys/module/kgdboc/parameters/kgdboc`` + echo "" > /sys/module/kgdboc/parameters/kgdboc -NOTE: You do not need to specify the baud if you are configuring the -console on tty which is already configured or open. +.. note:: + + You do not need to specify the baud if you are configuring the + console on tty which is already configured or open. More examples ^^^^^^^^^^^^^
@@ -224,35 +225,42 @@ You can configure kgdboc to use the keyboard, and/or a serial device depending on if you are using kdb and/or kgdb, in one of the following scenarios. -1. kdb and kgdb over only a serial port +1. kdb and kgdb over only a serial port:: - ``kgdboc=<serial_device>[,baud]`` + kgdboc=<serial_device>[,baud] - Example: ``kgdboc=ttyS0,115200`` + Example:: -2. kdb and kgdb with keyboard and a serial port + kgdboc=ttyS0,115200 - ``kgdboc=kbd,<serial_device>[,baud]`` +2. kdb and kgdb with keyboard and a serial port:: - Example: ``kgdboc=kbd,ttyS0,115200`` + kgdboc=kbd,<serial_device>[,baud] -3. kdb with a keyboard + Example:: - ``kgdboc=kbd`` + kgdboc=kbd,ttyS0,115200 -4. kdb with kernel mode setting +3. kdb with a keyboard:: - ``kgdboc=kms,kbd`` + kgdboc=kbd -5. kdb with kernel mode setting and kgdb over a serial port +4. kdb with kernel mode setting:: - ``kgdboc=kms,kbd,ttyS0,115200`` + kgdboc=kms,kbd -NOTE: Kgdboc does not support interrupting the target via the gdb remote -protocol. You must manually send a sysrq-g unless you have a proxy that -splits console output to a terminal program. A console proxy has a -separate TCP port for the debugger and a separate TCP port for the -"human" console. The proxy can take care of sending the sysrq-g for you. +5. kdb with kernel mode setting and kgdb over a serial port:: + + kgdboc=kms,kbd,ttyS0,115200 + +.. note:: + + Kgdboc does not support interrupting the target via the gdb remote + protocol. You must manually send a :kbd:`SysRq-G` unless you have a proxy + that splits console output to a terminal program. A console proxy has a + separate TCP port for the debugger and a separate TCP port for the + "human" console. The proxy can take care of sending the :kbd:`SysRq-G` + for you. When using kgdboc with no debugger proxy, you can end up connecting the debugger at one of two entry points. If an exception occurs after you
@@ -260,14 +268,14 @@ have loaded kgdboc, a message should print on the console stating it is waiting for the debugger. In this case you disconnect your terminal program and then connect the debugger in its place. If you want to interrupt the target system and forcibly enter a debug session you have -to issue a Sysrq sequence and then type the letter ``g``. Then you +to issue a :kbd:`Sysrq` sequence and then type the letter :kbd:`g`. Then you disconnect the terminal session and connect gdb. Your options if you -don't like this are to hack gdb to send the sysrq-g for you as well as +don't like this are to hack gdb to send the :kbd:`SysRq-G` for you as well as on the initial connect, or to use a debugger proxy that allows an unmodified gdb to do the debugging. -Kernel parameter: kgdbwait --------------------------- +Kernel parameter: ``kgdbwait`` +------------------------------ The Kernel command line option ``kgdbwait`` makes kgdb wait for a debugger connection during booting of a kernel. You can only use this
@@ -281,54 +289,64 @@ The kernel will stop and wait as early as the I/O driver and architecture allows when you use this option. If you build the kgdb I/O driver as a loadable kernel module kgdbwait will not do anything. -Kernel parameter: kgdbcon -------------------------- +Kernel parameter: ``kgdbcon`` +----------------------------- -The kgdbcon feature allows you to see printk() messages inside gdb while -gdb is connected to the kernel. Kdb does not make use of the kgdbcon +The ``kgdbcon`` feature allows you to see :c:func:`printk` messages inside gdb +while gdb is connected to the kernel. Kdb does not make use of the kgdbcon feature. Kgdb supports using the gdb serial protocol to send console messages to the debugger when the debugger is connected and running. There are two ways to activate this feature. -1. Activate with the kernel command line option: +1. Activate with the kernel command line option:: - ``kgdbcon`` + kgdbcon -2. Use sysfs before configuring an I/O driver +2. Use sysfs before configuring an I/O driver:: - ``echo 1 > /sys/module/kgdb/parameters/kgdb_use_con`` + echo 1 > /sys/module/kgdb/parameters/kgdb_use_con - NOTE: If you do this after you configure the kgdb I/O driver, the +.. note:: + + If you do this after you configure the kgdb I/O driver, the setting will not take effect until the next point the I/O is reconfigured. -IMPORTANT NOTE: You cannot use kgdboc + kgdbcon on a tty that is an -active system console. An example of incorrect usage is -``console=ttyS0,115200 kgdboc=ttyS0 kgdbcon`` +.. important:: + + You cannot use kgdboc + kgdbcon on a tty that is an + active system console. An example of incorrect usage is:: + + console=ttyS0,115200 kgdboc=ttyS0 kgdbcon It is possible to use this option with kgdboc on a tty that is not a system console. -Run time parameter: kgdbreboot ------------------------------- +Run time parameter: ``kgdbreboot`` +---------------------------------- The kgdbreboot feature allows you to change how the debugger deals with the reboot notification. You have 3 choices for the behavior. The default behavior is always set to 0. -1. echo -1 > /sys/module/debug_core/parameters/kgdbreboot +.. tabularcolumns:: |p{0.4cm}|p{11.5cm}|p{5.6cm}| - Ignore the reboot notification entirely. +.. flat-table:: + :widths: 1 10 8 -2. echo 0 > /sys/module/debug_core/parameters/kgdbreboot + * - 1 + - ``echo -1 > /sys/module/debug_core/parameters/kgdbreboot`` + - Ignore the reboot notification entirely. - Send the detach message to any attached debugger client. + * - 2 + - ``echo 0 > /sys/module/debug_core/parameters/kgdbreboot`` + - Send the detach message to any attached debugger client. -3. echo 1 > /sys/module/debug_core/parameters/kgdbreboot - - Enter the debugger on reboot notify. + * - 3 + - ``echo 1 > /sys/module/debug_core/parameters/kgdbreboot`` + - Enter the debugger on reboot notify. Using kdb =========
@@ -338,66 +356,56 @@ Quick start for kdb on a serial port This is a quick example of how to use kdb. -1. Configure kgdboc at boot using kernel parameters: +1. Configure kgdboc at boot using kernel parameters:: - - ``console=ttyS0,115200 kgdboc=ttyS0,115200`` + console=ttyS0,115200 kgdboc=ttyS0,115200 OR Configure kgdboc after the kernel has booted; assuming you are using - a serial port console: + a serial port console:: - - ``echo ttyS0 > /sys/module/kgdboc/parameters/kgdboc`` + echo ttyS0 > /sys/module/kgdboc/parameters/kgdboc 2. Enter the kernel debugger manually or by waiting for an oops or fault. There are several ways you can enter the kernel debugger - manually; all involve using the sysrq-g, which means you must have - enabled CONFIG_MAGIC_SYSRQ=y in your kernel config. + manually; all involve using the :kbd:`SysRq-G`, which means you must have + enabled ``CONFIG_MAGIC_SysRq=y`` in your kernel config. - - When logged in as root or with a super user session you can run: + - When logged in as root or with a super user session you can run:: - ``echo g > /proc/sysrq-trigger`` + echo g > /proc/sysrq-trigger - Example using minicom 2.2 - Press: ``Control-a`` - - Press: ``f`` - - Press: ``g`` + Press: :kbd:`CTRL-A` :kbd:`f` :kbd:`g` - When you have telneted to a terminal server that supports sending a remote break - Press: ``Control-]`` + Press: :kbd:`CTRL-]` - Type in:\ ``send break`` + Type in: ``send break`` - Press: ``Enter`` + Press: :kbd:`Enter` :kbd:`g` - Press: ``g`` - -3. From the kdb prompt you can run the "help" command to see a complete +3. From the kdb prompt you can run the ``help`` command to see a complete list of the commands that are available. Some useful commands in kdb include: - - lsmod -- Shows where kernel modules are loaded - - - ps -- Displays only the active processes - - - ps A -- Shows all the processes - - - summary -- Shows kernel version info and memory usage - - - bt -- Get a backtrace of the current process using dump_stack() - - - dmesg -- View the kernel syslog buffer - - - go -- Continue the system + =========== ================================================================= + ``lsmod`` Shows where kernel modules are loaded + ``ps`` Displays only the active processes + ``ps A`` Shows all the processes + ``summary`` Shows kernel version info and memory usage + ``bt`` Get a backtrace of the current process using :c:func:`dump_stack` + ``dmesg`` View the kernel syslog buffer + ``go`` Continue the system + =========== ================================================================= 4. When you are done using kdb you need to consider rebooting the system - or using the "go" command to resuming normal kernel execution. If you + or using the ``go`` command to resuming normal kernel execution. If you have paused the kernel for a lengthy period of time, applications that rely on timely networking or anything to do with real wall clock time could be adversely affected, so you should take this into
@@ -408,50 +416,50 @@ Quick start for kdb using a keyboard connected console This is a quick example of how to use kdb with a keyboard. -1. Configure kgdboc at boot using kernel parameters: +1. Configure kgdboc at boot using kernel parameters:: - - ``kgdboc=kbd`` + kgdboc=kbd OR - Configure kgdboc after the kernel has booted: + Configure kgdboc after the kernel has booted:: - - ``echo kbd > /sys/module/kgdboc/parameters/kgdboc`` + echo kbd > /sys/module/kgdboc/parameters/kgdboc 2. Enter the kernel debugger manually or by waiting for an oops or fault. There are several ways you can enter the kernel debugger - manually; all involve using the sysrq-g, which means you must have - enabled CONFIG_MAGIC_SYSRQ=y in your kernel config. + manually; all involve using the :kbd:`SysRq-G`, which means you must have + enabled ``CONFIG_MAGIC_SysRq=y`` in your kernel config. - - When logged in as root or with a super user session you can run: + - When logged in as root or with a super user session you can run:: - ``echo g > /proc/sysrq-trigger`` + echo g > /proc/sysrq-trigger - - Example using a laptop keyboard + - Example using a laptop keyboard: - Press and hold down: ``Alt`` + Press and hold down: :kbd:`Alt` - Press and hold down: ``Fn`` + Press and hold down: :kbd:`Fn` - Press and release the key with the label: ``SysRq`` + Press and release the key with the label: :kbd:`SysRq` - Release: ``Fn`` + Release: :kbd:`Fn` - Press and release: ``g`` + Press and release: :kbd:`g` - Release: ``Alt`` + Release: :kbd:`Alt` - Example using a PS/2 101-key keyboard - Press and hold down: ``Alt`` + Press and hold down: :kbd:`Alt` - Press and release the key with the label: ``SysRq`` + Press and release the key with the label: :kbd:`SysRq` - Press and release: ``g`` + Press and release: :kbd:`g` - Release: ``Alt`` + Release: :kbd:`Alt` -3. Now type in a kdb command such as "help", "dmesg", "bt" or "go" to +3. Now type in a kdb command such as ``help``, ``dmesg``, ``bt`` or ``go`` to continue kernel execution. Using kgdb / gdb
@@ -477,61 +485,51 @@ Connecting with gdb to a serial port 1. Configure kgdboc - Configure kgdboc at boot using kernel parameters: + Configure kgdboc at boot using kernel parameters:: - - ``kgdboc=ttyS0,115200`` + kgdboc=ttyS0,115200 OR - Configure kgdboc after the kernel has booted: + Configure kgdboc after the kernel has booted:: - - ``echo ttyS0 > /sys/module/kgdboc/parameters/kgdboc`` + echo ttyS0 > /sys/module/kgdboc/parameters/kgdboc 2. Stop kernel execution (break into the debugger) In order to connect to gdb via kgdboc, the kernel must first be stopped. There are several ways to stop the kernel which include - using kgdbwait as a boot argument, via a sysrq-g, or running the + using kgdbwait as a boot argument, via a :kbd:`SysRq-G`, or running the kernel until it takes an exception where it waits for the debugger to attach. - - When logged in as root or with a super user session you can run: + - When logged in as root or with a super user session you can run:: - ``echo g > /proc/sysrq-trigger`` + echo g > /proc/sysrq-trigger - Example using minicom 2.2 - Press: ``Control-a`` - - Press: ``f`` - - Press: ``g`` + Press: :kbd:`CTRL-A` :kbd:`f` :kbd:`g` - When you have telneted to a terminal server that supports sending a remote break - Press: ``Control-]`` + Press: :kbd:`CTRL-]` - Type in:\ ``send break`` + Type in: ``send break`` - Press: ``Enter`` - - Press: ``g`` + Press: :kbd:`Enter` :kbd:`g` 3. Connect from gdb - Example (using a directly connected port): - - :: + Example (using a directly connected port):: % gdb ./vmlinux (gdb) set remotebaud 115200 (gdb) target remote /dev/ttyS0 - Example (kgdb to a terminal server on TCP port 2012): - - :: + Example (kgdb to a terminal server on TCP port 2012):: % gdb ./vmlinux (gdb) target remote 192.168.2.2:2012
@@ -543,12 +541,13 @@ Connecting with gdb to a serial port If you are having problems connecting or something is going seriously wrong while debugging, it will most often be the case that you want to enable gdb to be verbose about its target communications. You do - this prior to issuing the ``target - remote`` command by typing in: ``set debug remote 1`` + this prior to issuing the ``target remote`` command by typing in:: + + set debug remote 1 Remember if you continue in gdb, and need to "break in" again, you need -to issue an other sysrq-g. It is easy to create a simple entry point by -putting a breakpoint at ``sys_sync`` and then you can run "sync" from a +to issue an other :kbd:`SysRq-G`. It is easy to create a simple entry point by +putting a breakpoint at ``sys_sync`` and then you can run ``sync`` from a shell or script to break into the debugger. kgdb and kdb interoperability
@@ -565,22 +564,26 @@ Switching from kgdb to kdb ~~~~~~~~~~~~~~~~~~~~~~~~~~ There are two ways to switch from kgdb to kdb: you can use gdb to issue -a maintenance packet, or you can blindly type the command $3#33. +a maintenance packet, or you can blindly type the command ``$3#33``. Whenever the kernel debugger stops in kgdb mode it will print the message ``KGDB or $3#33 for KDB``. It is important to note that you have to type the sequence correctly in one pass. You cannot type a backspace or delete because kgdb will interpret that as part of the debug stream. -1. Change from kgdb to kdb by blindly typing: +1. Change from kgdb to kdb by blindly typing:: - ``$3#33`` + $3#33 -2. Change from kgdb to kdb with gdb +2. Change from kgdb to kdb with gdb:: - ``maintenance packet 3`` + maintenance packet 3 - NOTE: Now you must kill gdb. Typically you press control-z and issue - the command: kill -9 % + .. note:: + + Now you must kill gdb. Typically you press :kbd:`CTRL-Z` and issue + the command:: + + kill -9 % Change from kdb to kgdb ~~~~~~~~~~~~~~~~~~~~~~~
@@ -592,9 +595,9 @@ shell looks for the typical first commands that gdb would issue with the gdb remote protocol and if it sees one of those commands it automatically changes into kgdb mode. -1. From kdb issue the command: +1. From kdb issue the command:: - ``kgdb`` + kgdb Now disconnect your terminal program and connect gdb in its place
@@ -613,13 +616,7 @@ are things like lsmod, dmesg, ps or possibly some of the memory information commands. To see all the kdb commands you can run ``monitor help``. -Example: - -.. raw:: html - - <div class="informalexample"> - -:: +Example:: (gdb) monitor ps 1 idle process (state I) and
@@ -632,30 +629,25 @@ Example: 0xc78789c0 944 1 0 0 S 0xc7878bf4 sh (gdb) - -.. raw:: html - - </div> - kgdb Test Suite =============== When kgdb is enabled in the kernel config you can also elect to enable -the config parameter KGDB_TESTS. Turning this on will enable a special +the config parameter ``KGDB_TESTS``. Turning this on will enable a special kgdb I/O module which is designed to test the kgdb internal functions. The kgdb tests are mainly intended for developers to test the kgdb internals as well as a tool for developing a new kgdb architecture specific implementation. These tests are not really for end users of the Linux kernel. The primary source of documentation would be to look in -the drivers/misc/kgdbts.c file. +the ``drivers/misc/kgdbts.c`` file. The kgdb test suite can also be configured at compile time to run the core set of tests by setting the kernel config parameter -KGDB_TESTS_ON_BOOT. This particular option is aimed at automated +``KGDB_TESTS_ON_BOOT``. This particular option is aimed at automated regression testing and does not require modifying the kernel boot config arguments. If this is turned on, the kgdb test suite can be disabled by -specifying "kgdbts=" as a kernel boot argument. +specifying ``kgdbts=`` as a kernel boot argument. Kernel Debugger Internals =========================
@@ -667,7 +659,7 @@ The kernel debugger is organized into a number of components: 1. The debug core - The debug core is found in kernel/debugger/debug_core.c. It + The debug core is found in ``kernel/debugger/debug_core.c``. It contains: - A generic OS exception handler which includes sync'ing the
@@ -688,20 +680,20 @@ The kernel debugger is organized into a number of components: - The structures and callback API for atomic kernel mode setting. - NOTE: kgdboc is where the kms callbacks are invoked. + .. note:: kgdboc is where the kms callbacks are invoked. 2. kgdb arch-specific implementation - This implementation is generally found in arch/\*/kernel/kgdb.c. As - an example, arch/x86/kernel/kgdb.c contains the specifics to + This implementation is generally found in ``arch/*/kernel/kgdb.c``. As + an example, ``arch/x86/kernel/kgdb.c`` contains the specifics to implement HW breakpoint as well as the initialization to dynamically register and unregister for the trap handlers on this architecture. The arch-specific portion implements: - contains an arch-specific trap catcher which invokes - kgdb_handle_exception() to start kgdb about doing its work + :c:func:`kgdb_handle_exception` to start kgdb about doing its work - - translation to and from gdb specific packet format to pt_regs + - translation to and from gdb specific packet format to :c:type:`pt_regs` - Registration and unregistration of architecture specific trap hooks
@@ -714,7 +706,7 @@ The kernel debugger is organized into a number of components: 3. gdbstub frontend (aka kgdb) - The gdbstub is located in kernel/debug/gdbstub.c. It contains: + The gdbstub is located in ``kernel/debug/gdbstub.c``. It contains: - All the logic to implement the gdb serial protocol
@@ -733,18 +725,18 @@ The kernel debugger is organized into a number of components: - A registration API to register additional kdb shell commands. - - A good example of a self-contained kdb module is the "ftdump" + - A good example of a self-contained kdb module is the ``ftdump`` command for dumping the ftrace buffer. See: - kernel/trace/trace_kdb.c + ``kernel/trace/trace_kdb.c`` - For an example of how to dynamically register a new kdb command you can build the kdb_hello.ko kernel module from - samples/kdb/kdb_hello.c. To build this example you can set - CONFIG_SAMPLES=y and CONFIG_SAMPLE_KDB=m in your kernel - config. Later run "modprobe kdb_hello" and the next time you - enter the kdb shell, you can run the "hello" command. + ``samples/kdb/kdb_hello.c``. To build this example you can set + ``CONFIG_SAMPLES=y`` and ``CONFIG_SAMPLE_KDB=m`` in your kernel + config. Later run ``modprobe kdb_hello`` and the next time you + enter the kdb shell, you can run the ``hello`` command. - - The implementation for kdb_printf() which emits messages directly + - The implementation for :c:func:`kdb_printf` which emits messages directly to I/O drivers, bypassing the kernel log. - SW / HW breakpoint management for the kdb shell
@@ -780,21 +772,24 @@ architecture, and at that point you must create an architecture specific kgdb implementation. There are a few flags which must be set on every architecture in their -<asm/kgdb.h> file. These are: +``asm/kgdb.h`` file. These are: -- NUMREGBYTES: The size in bytes of all of the registers, so that we - can ensure they will all fit into a packet. +- ``NUMREGBYTES``: + The size in bytes of all of the registers, so that we + can ensure they will all fit into a packet. -- BUFMAX: The size in bytes of the buffer GDB will read into. This must - be larger than NUMREGBYTES. +- ``BUFMAX``: + The size in bytes of the buffer GDB will read into. This must + be larger than NUMREGBYTES. -- CACHE_FLUSH_IS_SAFE: Set to 1 if it is always safe to call - flush_cache_range or flush_icache_range. On some architectures, - these functions may not be safe to call on SMP since we keep other - CPUs in a holding pattern. +- ``CACHE_FLUSH_IS_SAFE``: + Set to 1 if it is always safe to call + flush_cache_range or flush_icache_range. On some architectures, + these functions may not be safe to call on SMP since we keep other + CPUs in a holding pattern. There are also the following functions for the common backend, found in -kernel/kgdb.c, that must be supplied by the architecture-specific +``kernel/kgdb.c``, that must be supplied by the architecture-specific backend unless marked as (optional), in which case a default function maybe used if the architecture does not need to provide a specific implementation.
@@ -818,9 +813,9 @@ invokes a callback in the serial core which in turn uses the callback in the UART driver. When using kgdboc with a UART, the UART driver must implement two -callbacks in the ``struct uart_ops``. Example from drivers/8250.c: +callbacks in the :c:type:`struct uart_ops <uart_ops>`. +Example from ``drivers/8250.c``:: -:: #ifdef CONFIG_CONSOLE_POLL .poll_get_char = serial8250_get_poll_char,
@@ -838,46 +833,41 @@ consider, because failing here is most likely going to mean pressing the reset button. kgdboc and keyboards -~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~ The kgdboc driver contains logic to configure communications with an attached keyboard. The keyboard infrastructure is only compiled into the -kernel when CONFIG_KDB_KEYBOARD=y is set in the kernel configuration. +kernel when ``CONFIG_KDB_KEYBOARD=y`` is set in the kernel configuration. The core polled keyboard driver driver for PS/2 type keyboards is in -drivers/char/kdb_keyboard.c. This driver is hooked into the debug core +``drivers/char/kdb_keyboard.c``. This driver is hooked into the debug core when kgdboc populates the callback in the array called -``kdb_poll_funcs[]``. The kdb_get_kbd_char() is the top-level +:c:type:`kdb_poll_funcs[]`. The :c:func:`kdb_get_kbd_char` is the top-level function which polls hardware for single character input. kgdboc and kms -~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~ The kgdboc driver contains logic to request the graphics display to -switch to a text context when you are using "kgdboc=kms,kbd", provided +switch to a text context when you are using ``kgdboc=kms,kbd``, provided that you have a video driver which has a frame buffer console and atomic kernel mode setting support. Every time the kernel debugger is entered it calls -kgdboc_pre_exp_handler() which in turn calls con_debug_enter() in -the virtual console layer. On resuming kernel execution, the kernel -debugger calls kgdboc_post_exp_handler() which in turn calls -con_debug_leave(). +:c:func:`kgdboc_pre_exp_handler` which in turn calls :c:func:`con_debug_enter` +in the virtual console layer. On resuming kernel execution, the kernel +debugger calls :c:func:`kgdboc_post_exp_handler` which in turn calls +:c:func:`con_debug_leave`. Any video driver that wants to be compatible with the kernel debugger -and the atomic kms callbacks must implement the mode_set_base_atomic, -fb_debug_enter and fb_debug_leave operations. For the -fb_debug_enter and fb_debug_leave the option exists to use the +and the atomic kms callbacks must implement the ``mode_set_base_atomic``, +``fb_debug_enter`` and ``fb_debug_leave operations``. For the +``fb_debug_enter`` and ``fb_debug_leave`` the option exists to use the generic drm fb helper functions or implement something custom for the hardware. The following example shows the initialization of the .mode_set_base_atomic operation in -drivers/gpu/drm/i915/intel_display.c: +drivers/gpu/drm/i915/intel_display.c:: -.. raw:: html - - <div class="informalexample"> - -:: static const struct drm_crtc_helper_funcs intel_helper_funcs = { [...]
@@ -886,19 +876,10 @@ drivers/gpu/drm/i915/intel_display.c: }; -.. raw:: html - - </div> - Here is an example of how the i915 driver initializes the fb_debug_enter and fb_debug_leave functions to use the generic drm -helpers in drivers/gpu/drm/i915/intel_fb.c: +helpers in ``drivers/gpu/drm/i915/intel_fb.c``:: -.. raw:: html - - <div class="informalexample"> - -:: static struct fb_ops intelfb_ops = { [...]
@@ -908,23 +889,19 @@ helpers in drivers/gpu/drm/i915/intel_fb.c: }; -.. raw:: html - - </div> - Credits ======= The following people have contributed to this document: -1. Amit Kale\ [email protected] +1. Amit Kale <[email protected]> -2. Tom Rini\ [email protected] +2. Tom Rini <[email protected]> In March 2008 this document was completely rewritten by: -- Jason Wessel\ [email protected] +- Jason Wessel <[email protected]> In Jan 2010 this document was updated to include kdb. -- Jason Wessel\ [email protected] +- Jason Wessel <[email protected]>
Signature · 1 line
2.9.3
PATCH 29/36 docs-rst: convert networking book to ReST
In reply to Mauro Carvalho ChehabUse pandoc to convert documentation to ReST by calling Documentation/sphinx/tmplcvt script.
--- Documentation/DocBook/Makefile | 1 - Documentation/DocBook/networking.tmpl | 111 ------------------------- Documentation/conf.py | 2 + Documentation/index.rst | 1 + Documentation/networking/conf.py | 10 +++ Documentation/networking/index.rst | 17 ++++ Documentation/networking/kapi.rst | 147 ++++++++++++++++++++++++++++++++++ 7 files changed, 177 insertions(+), 112 deletions(-) delete mode 100644 Documentation/DocBook/networking.tmpl create mode 100644 Documentation/networking/conf.py create mode 100644 Documentation/networking/index.rst create mode 100644 Documentation/networking/kapi.rst
Documentation/DocBook/Makefile +0 -1
@@ -7,7 +7,6 @@ # list of DOCBOOKS. DOCBOOKS := z8530book.xml \ - networking.xml \ lsm.xml \ mtdnand.xml librs.xml rapidio.xml \ scsi.xml \
Documentation/DocBook/networking.tmpl deleted +0 -111
111 lines not on this page · raw message
Documentation/conf.py +2 -0
@@ -369,6 +369,8 @@ latex_documents = [ 'The kernel development community', 'manual'), ('media/index', 'media.tex', 'Linux Media Subsystem Documentation', 'The kernel development community', 'manual'), + ('networking/index', 'networking.tex', 'Linux Networking Documentation', + 'The kernel development community', 'manual'), ('process/index', 'development-process.tex', 'Linux Kernel Development Documentation', 'The kernel development community', 'manual'), ('security/index', 'security.tex', 'The kernel security subsystem manual',
Documentation/index.rst +1 -0
@@ -68,6 +68,7 @@ needed). driver-api/index core-api/index media/index + networking/index input/index gpu/index security/index
Documentation/networking/conf.py new file +10 -0
@@ -0,0 +1,10 @@ +# -*- coding: utf-8; mode: python -*- + +project = "Linux Networking Documentation" + +tags.add("subproject") + +latex_documents = [ + ('index', 'networking.tex', project, + 'The kernel development community', 'manual'), +]
Documentation/networking/index.rst new file +17 -0
@@ -0,0 +1,17 @@ +Linux Networking Documentation +============================== + +Contents: + +.. toctree:: + :maxdepth: 2 + + kapi + +.. only:: subproject + + Indices + ======= + + * :ref:`genindex` +
Documentation/networking/kapi.rst new file +147 -0
147 lines not on this page · raw message
Signature · 1 line
2.9.3
PATCH 26/36 libata.rst: add c function and struct cross-references
In reply to Mauro Carvalho ChehabInstead of just using text for functions and structs, use the C domain tags, in order to allow cross-referencing with the kernel-doc markups.
--- Documentation/driver-api/libata.rst | 244 ++++++++++++++++++------------------ 1 file changed, 124 insertions(+), 120 deletions(-)
Documentation/driver-api/libata.rst +124 -120
@@ -18,18 +18,19 @@ internals, and a couple sample ATA low-level drivers. libata Driver API ================= -struct ata_port_operations is defined for every low-level libata +:c:type:`struct ata_port_operations <ata_port_operations>` +is defined for every low-level libata hardware driver, and it controls how the low-level driver interfaces with the ATA and SCSI layers. -FIS-based drivers will hook into the system with ->qc_prep() and -->qc_issue() high-level hooks. Hardware which behaves in a manner +FIS-based drivers will hook into the system with ``->qc_prep()`` and +``->qc_issue()`` high-level hooks. Hardware which behaves in a manner similar to PCI IDE hardware may utilize several generic helpers, defining at a bare minimum the bus I/O addresses of the ATA shadow register blocks. -struct ata_port_operations ----------------------------- +:c:type:`struct ata_port_operations <ata_port_operations>` +---------------------------------------------------------- Disable ATA port ~~~~~~~~~~~~~~~~
@@ -39,13 +40,13 @@ Disable ATA port void (*port_disable) (struct ata_port *); -Called from ata_bus_probe() error path, as well as when unregistering +Called from :c:func:`ata_bus_probe` error path, as well as when unregistering from the SCSI module (rmmod, hot unplug). This function should do whatever needs to be done to take the port out of use. In most cases, -ata_port_disable() can be used as this hook. +:c:func:`ata_port_disable` can be used as this hook. -Called from ata_bus_probe() on a failed probe. Called from -ata_scsi_release(). +Called from :c:func:`ata_bus_probe` on a failed probe. Called from +:c:func:`ata_scsi_release`. Post-IDENTIFY device configuration ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -73,22 +74,22 @@ Set PIO/DMA mode Hooks called prior to the issue of SET FEATURES - XFER MODE command. The -optional ->mode_filter() hook is called when libata has built a mask of -the possible modes. This is passed to the ->mode_filter() function +optional ``->mode_filter()`` hook is called when libata has built a mask of +the possible modes. This is passed to the ``->mode_filter()`` function which should return a mask of valid modes after filtering those unsuitable due to hardware limits. It is not valid to use this interface to add modes. -dev->pio_mode and dev->dma_mode are guaranteed to be valid when -->set_piomode() and when ->set_dmamode() is called. The timings for +``dev->pio_mode`` and ``dev->dma_mode`` are guaranteed to be valid when +``->set_piomode()`` and when ``->set_dmamode()`` is called. The timings for any other drive sharing the cable will also be valid at this point. That is the library records the decisions for the modes of each drive on a channel before it attempts to set any of them. -->post_set_mode() is called unconditionally, after the SET FEATURES - +``->post_set_mode()`` is called unconditionally, after the SET FEATURES - XFER MODE command completes successfully. -->set_piomode() is always called (if present), but ->set_dma_mode() +``->set_piomode()`` is always called (if present), but ``->set_dma_mode()`` is only called if DMA is possible. Taskfile read/write
@@ -100,11 +101,11 @@ Taskfile read/write void (*sff_tf_read) (struct ata_port *ap, struct ata_taskfile *tf); -->tf_load() is called to load the given taskfile into hardware -registers / DMA buffers. ->tf_read() is called to read the hardware +``->tf_load()`` is called to load the given taskfile into hardware +registers / DMA buffers. ``->tf_read()`` is called to read the hardware registers / DMA buffers, to obtain the current set of taskfile register values. Most drivers for taskfile-based hardware (PIO or MMIO) use -ata_sff_tf_load() and ata_sff_tf_read() for these hooks. +:c:func:`ata_sff_tf_load` and :c:func:`ata_sff_tf_read` for these hooks. PIO data read/write ~~~~~~~~~~~~~~~~~~~
@@ -117,8 +118,8 @@ PIO data read/write All bmdma-style drivers must implement this hook. This is the low-level operation that actually copies the data bytes during a PIO data transfer. Typically the driver will choose one of -ata_sff_data_xfer_noirq(), ata_sff_data_xfer(), or -ata_sff_data_xfer32(). +:c:func:`ata_sff_data_xfer_noirq`, :c:func:`ata_sff_data_xfer`, or +:c:func:`ata_sff_data_xfer32`. ATA command execute ~~~~~~~~~~~~~~~~~~~
@@ -128,9 +129,9 @@ ATA command execute void (*sff_exec_command)(struct ata_port *ap, struct ata_taskfile *tf); -causes an ATA command, previously loaded with ->tf_load(), to be +causes an ATA command, previously loaded with ``->tf_load()``, to be initiated in hardware. Most drivers for taskfile-based hardware use -ata_sff_exec_command() for this hook. +:c:func:`ata_sff_exec_command` for this hook. Per-cmd ATAPI DMA capabilities filter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -159,7 +160,7 @@ Read specific ATA shadow registers Reads the Status/AltStatus ATA shadow register from hardware. On some hardware, reading the Status register has the side effect of clearing the interrupt condition. Most drivers for taskfile-based hardware use -ata_sff_check_status() for this hook. +:c:func:`ata_sff_check_status` for this hook. Write specific ATA shadow register ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -184,7 +185,7 @@ Issues the low-level hardware command(s) that causes one of N hardware devices to be considered 'selected' (active and available for use) on the ATA bus. This generally has no meaning on FIS-based devices. -Most drivers for taskfile-based hardware use ata_sff_dev_select() for +Most drivers for taskfile-based hardware use :c:func:`ata_sff_dev_select` for this hook. Private tuning method
@@ -222,28 +223,28 @@ Control PCI IDE BMDMA engine When setting up an IDE BMDMA transaction, these hooks arm -(->bmdma_setup), fire (->bmdma_start), and halt (->bmdma_stop) the -hardware's DMA engine. ->bmdma_status is used to read the standard PCI +(``->bmdma_setup``), fire (``->bmdma_start``), and halt (``->bmdma_stop``) the +hardware's DMA engine. ``->bmdma_status`` is used to read the standard PCI IDE DMA Status register. These hooks are typically either no-ops, or simply not implemented, in FIS-based drivers. -Most legacy IDE drivers use ata_bmdma_setup() for the bmdma_setup() -hook. ata_bmdma_setup() will write the pointer to the PRD table to the -IDE PRD Table Address register, enable DMA in the DMA Command register, -and call exec_command() to begin the transfer. +Most legacy IDE drivers use :c:func:`ata_bmdma_setup` for the +:c:func:`bmdma_setup` hook. :c:func:`ata_bmdma_setup` will write the pointer +to the PRD table to the IDE PRD Table Address register, enable DMA in the DMA +Command register, and call :c:func:`exec_command` to begin the transfer. -Most legacy IDE drivers use ata_bmdma_start() for the bmdma_start() -hook. ata_bmdma_start() will write the ATA_DMA_START flag to the DMA -Command register. +Most legacy IDE drivers use :c:func:`ata_bmdma_start` for the +:c:func:`bmdma_start` hook. :c:func:`ata_bmdma_start` will write the +ATA_DMA_START flag to the DMA Command register. -Many legacy IDE drivers use ata_bmdma_stop() for the bmdma_stop() -hook. ata_bmdma_stop() clears the ATA_DMA_START flag in the DMA -command register. +Many legacy IDE drivers use :c:func:`ata_bmdma_stop` for the +:c:func:`bmdma_stop` hook. :c:func:`ata_bmdma_stop` clears the ATA_DMA_START +flag in the DMA command register. -Many legacy IDE drivers use ata_bmdma_status() as the bmdma_status() -hook. +Many legacy IDE drivers use :c:func:`ata_bmdma_status` as the +:c:func:`bmdma_status` hook. High-level taskfile hooks ~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -255,19 +256,19 @@ High-level taskfile hooks Higher-level hooks, these two hooks can potentially supercede several of -the above taskfile/DMA engine hooks. ->qc_prep is called after the +the above taskfile/DMA engine hooks. ``->qc_prep`` is called after the buffers have been DMA-mapped, and is typically used to populate the hardware's DMA scatter-gather table. Most drivers use the standard -ata_qc_prep() helper function, but more advanced drivers roll their +:c:func:`ata_qc_prep` helper function, but more advanced drivers roll their own. -->qc_issue is used to make a command active, once the hardware and S/G +``->qc_issue`` is used to make a command active, once the hardware and S/G tables have been prepared. IDE BMDMA drivers use the helper function -ata_qc_issue_prot() for taskfile protocol-based dispatch. More -advanced drivers implement their own ->qc_issue. +:c:func:`ata_qc_issue_prot` for taskfile protocol-based dispatch. More +advanced drivers implement their own ``->qc_issue``. -ata_qc_issue_prot() calls ->tf_load(), ->bmdma_setup(), and -->bmdma_start() as necessary to initiate a transfer. +:c:func:`ata_qc_issue_prot` calls ``->tf_load()``, ``->bmdma_setup()``, and +``->bmdma_start()`` as necessary to initiate a transfer. Exception and probe handling (EH) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -278,7 +279,7 @@ Exception and probe handling (EH) void (*phy_reset) (struct ata_port *ap); -Deprecated. Use ->error_handler() instead. +Deprecated. Use ``->error_handler()`` instead. ::
@@ -286,18 +287,18 @@ Deprecated. Use ->error_handler() instead. void (*thaw) (struct ata_port *ap); -ata_port_freeze() is called when HSM violations or some other +:c:func:`ata_port_freeze` is called when HSM violations or some other condition disrupts normal operation of the port. A frozen port is not allowed to perform any operation until the port is thawed, which usually follows a successful reset. -The optional ->freeze() callback can be used for freezing the port +The optional ``->freeze()`` callback can be used for freezing the port hardware-wise (e.g. mask interrupt and stop DMA engine). If a port cannot be frozen hardware-wise, the interrupt handler must ack and clear interrupts unconditionally while the port is frozen. -The optional ->thaw() callback is called to perform the opposite of -->freeze(): prepare the port for normal operation once again. Unmask +The optional ``->thaw()`` callback is called to perform the opposite of +``->freeze()``: prepare the port for normal operation once again. Unmask interrupts, start DMA engine, etc. ::
@@ -305,10 +306,10 @@ interrupts, start DMA engine, etc. void (*error_handler) (struct ata_port *ap); -->error_handler() is a driver's hook into probe, hotplug, and recovery +``->error_handler()`` is a driver's hook into probe, hotplug, and recovery and other exceptional conditions. The primary responsibility of an -implementation is to call ata_do_eh() or ata_bmdma_drive_eh() with -a set of EH hooks as arguments: +implementation is to call :c:func:`ata_do_eh` or :c:func:`ata_bmdma_drive_eh` +with a set of EH hooks as arguments: 'prereset' hook (may be NULL) is called during an EH reset, before any other actions are taken.
@@ -327,7 +328,7 @@ called to perform the low-level EH reset. Perform any hardware-specific actions necessary to finish processing after executing a probe-time or EH-time command via -ata_exec_internal(). +:c:func:`ata_exec_internal`. Hardware interrupt handling ~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -338,20 +339,20 @@ Hardware interrupt handling void (*irq_clear) (struct ata_port *); -->irq_handler is the interrupt handling routine registered with the -system, by libata. ->irq_clear is called during probe just before the +``->irq_handler`` is the interrupt handling routine registered with the +system, by libata. ``->irq_clear`` is called during probe just before the interrupt handler is registered, to be sure hardware is quiet. The second argument, dev_instance, should be cast to a pointer to -struct ata_host_set. +:c:type:`struct ata_host_set <ata_host_set>`. -Most legacy IDE drivers use ata_sff_interrupt() for the irq_handler +Most legacy IDE drivers use :c:func:`ata_sff_interrupt` for the irq_handler hook, which scans all ports in the host_set, determines which queued command was active (if any), and calls ata_sff_host_intr(ap,qc). -Most legacy IDE drivers use ata_sff_irq_clear() for the irq_clear() -hook, which simply clears the interrupt and error flags in the DMA -status register. +Most legacy IDE drivers use :c:func:`ata_sff_irq_clear` for the +:c:func:`irq_clear` hook, which simply clears the interrupt and error flags +in the DMA status register. SATA phy read/write ~~~~~~~~~~~~~~~~~~~
@@ -365,8 +366,8 @@ SATA phy read/write Read and write standard SATA phy registers. Currently only used if -->phy_reset hook called the sata_phy_reset() helper function. sc_reg -is one of SCR_STATUS, SCR_CONTROL, SCR_ERROR, or SCR_ACTIVE. +``->phy_reset`` hook called the :c:func:`sata_phy_reset` helper function. +sc_reg is one of SCR_STATUS, SCR_CONTROL, SCR_ERROR, or SCR_ACTIVE. Init and shutdown ~~~~~~~~~~~~~~~~~
@@ -378,21 +379,21 @@ Init and shutdown void (*host_stop) (struct ata_host_set *host_set); -->port_start() is called just after the data structures for each port +``->port_start()`` is called just after the data structures for each port are initialized. Typically this is used to alloc per-port DMA buffers / tables / rings, enable DMA engines, and similar tasks. Some drivers also use this entry point as a chance to allocate driver-private memory for -ap->private_data. +``ap->private_data``. -Many drivers use ata_port_start() as this hook or call it from their -own port_start() hooks. ata_port_start() allocates space for a legacy -IDE PRD table and returns. +Many drivers use :c:func:`ata_port_start` as this hook or call it from their +own :c:func:`port_start` hooks. :c:func:`ata_port_start` allocates space for +a legacy IDE PRD table and returns. -->port_stop() is called after ->host_stop(). Its sole function is to +``->port_stop()`` is called after ``->host_stop()``. Its sole function is to release DMA/memory resources, now that they are no longer actively being used. Many drivers also free driver-private data from port at this time. -->host_stop() is called after all ->port_stop() calls have completed. +``->host_stop()`` is called after all ``->port_stop()`` calls have completed. The hook must finalize hardware shutdown, release DMA and other resources, etc. This hook may be specified as NULL, in which case it is not called.
@@ -407,7 +408,8 @@ exceptions doc first. Origins of commands ------------------- -In libata, a command is represented with struct ata_queued_cmd or qc. +In libata, a command is represented with +:c:type:`struct ata_queued_cmd <ata_queued_cmd>` or qc. qc's are preallocated during port initialization and repetitively used for command executions. Currently only one qc is allocated per port but yet-to-be-merged NCQ branch allocates one for each tag and maps each qc
@@ -423,17 +425,17 @@ How commands are issued ----------------------- Internal commands - First, qc is allocated and initialized using ata_qc_new_init(). - Although ata_qc_new_init() doesn't implement any wait or retry + First, qc is allocated and initialized using :c:func:`ata_qc_new_init`. + Although :c:func:`ata_qc_new_init` doesn't implement any wait or retry mechanism when qc is not available, internal commands are currently issued only during initialization and error recovery, so no other command is active and allocation is guaranteed to succeed. Once allocated qc's taskfile is initialized for the command to be executed. qc currently has two mechanisms to notify completion. One - is via qc->complete_fn() callback and the other is completion - qc->waiting. qc->complete_fn() callback is the asynchronous path - used by normal SCSI translated commands and qc->waiting is the + is via ``qc->complete_fn()`` callback and the other is completion + ``qc->waiting``. ``qc->complete_fn()`` callback is the asynchronous path + used by normal SCSI translated commands and ``qc->waiting`` is the synchronous (issuer sleeps in process context) path used by internal commands.
@@ -441,21 +443,21 @@ Internal commands qc is issued. SCSI commands - All libata drivers use ata_scsi_queuecmd() as hostt->queuecommand - callback. scmds can either be simulated or translated. No qc is - involved in processing a simulated scmd. The result is computed - right away and the scmd is completed. + All libata drivers use :c:func:`ata_scsi_queuecmd` as + ``hostt->queuecommand`` callback. scmds can either be simulated or + translated. No qc is involved in processing a simulated scmd. The + result is computed right away and the scmd is completed. - For a translated scmd, ata_qc_new_init() is invoked to allocate a + For a translated scmd, :c:func:`ata_qc_new_init` is invoked to allocate a qc and the scmd is translated into the qc. SCSI midlayer's completion notification function pointer is stored into - qc->scsidone. + ``qc->scsidone``. - qc->complete_fn() callback is used for completion notification. ATA - commands use ata_scsi_qc_complete() while ATAPI commands use - atapi_qc_complete(). Both functions end up calling qc->scsidone to - notify upper layer when the qc is finished. After translation is - completed, the qc is issued with ata_qc_issue(). + ``qc->complete_fn()`` callback is used for completion notification. ATA + commands use :c:func:`ata_scsi_qc_complete` while ATAPI commands use + :c:func:`atapi_qc_complete`. Both functions end up calling ``qc->scsidone`` + to notify upper layer when the qc is finished. After translation is + completed, the qc is issued with :c:func:`ata_qc_issue`. Note that SCSI midlayer invokes hostt->queuecommand while holding host_set lock, so all above occur while holding host_set lock.
@@ -495,34 +497,34 @@ ATAPI PIO How commands are completed -------------------------- -Once issued, all qc's are either completed with ata_qc_complete() or +Once issued, all qc's are either completed with :c:func:`ata_qc_complete` or time out. For commands which are handled by interrupts, -ata_host_intr() invokes ata_qc_complete(), and, for PIO tasks, -pio_task invokes ata_qc_complete(). In error cases, packet_task may +:c:func:`ata_host_intr` invokes :c:func:`ata_qc_complete`, and, for PIO tasks, +pio_task invokes :c:func:`ata_qc_complete`. In error cases, packet_task may also complete commands. -ata_qc_complete() does the following. +:c:func:`ata_qc_complete` does the following. 1. DMA memory is unmapped. 2. ATA_QCFLAG_ACTIVE is cleared from qc->flags. -3. qc->complete_fn() callback is invoked. If the return value of the +3. :c:func:`qc->complete_fn` callback is invoked. If the return value of the callback is not zero. Completion is short circuited and - ata_qc_complete() returns. + :c:func:`ata_qc_complete` returns. -4. __ata_qc_complete() is called, which does +4. :c:func:`__ata_qc_complete` is called, which does - 1. qc->flags is cleared to zero. + 1. ``qc->flags`` is cleared to zero. - 2. ap->active_tag and qc->tag are poisoned. + 2. ``ap->active_tag`` and ``qc->tag`` are poisoned. - 3. qc->waiting is cleared & completed (in that order). + 3. ``qc->waiting`` is cleared & completed (in that order). - 4. qc is deallocated by clearing appropriate bit in ap->qactive. + 4. qc is deallocated by clearing appropriate bit in ``ap->qactive``. So, it basically notifies upper layer and deallocates qc. One exception -is short-circuit path in #3 which is used by atapi_qc_complete(). +is short-circuit path in #3 which is used by :c:func:`atapi_qc_complete`. For all non-ATAPI commands, whether it fails or not, almost the same code path is taken and very little error handling takes place. A qc is
@@ -531,33 +533,33 @@ otherwise. However, failed ATAPI commands require more handling as REQUEST SENSE is needed to acquire sense data. If an ATAPI command fails, -ata_qc_complete() is invoked with error status, which in turn invokes -atapi_qc_complete() via qc->complete_fn() callback. +:c:func:`ata_qc_complete` is invoked with error status, which in turn invokes +:c:func:`atapi_qc_complete` via ``qc->complete_fn()`` callback. -This makes atapi_qc_complete() set scmd->result to +This makes :c:func:`atapi_qc_complete` set ``scmd->result`` to SAM_STAT_CHECK_CONDITION, complete the scmd and return 1. As the -sense data is empty but scmd->result is CHECK CONDITION, SCSI midlayer -will invoke EH for the scmd, and returning 1 makes ata_qc_complete() +sense data is empty but ``scmd->result`` is CHECK CONDITION, SCSI midlayer +will invoke EH for the scmd, and returning 1 makes :c:func:`ata_qc_complete` to return without deallocating the qc. This leads us to -ata_scsi_error() with partially completed qc. +:c:func:`ata_scsi_error` with partially completed qc. -ata_scsi_error() ------------------- +:c:func:`ata_scsi_error` +------------------------ -ata_scsi_error() is the current transportt->eh_strategy_handler() +:c:func:`ata_scsi_error` is the current ``transportt->eh_strategy_handler()`` for libata. As discussed above, this will be entered in two cases - timeout and ATAPI error completion. This function calls low level libata -driver's eng_timeout() callback, the standard callback for which is -ata_eng_timeout(). It checks if a qc is active and calls -ata_qc_timeout() on the qc if so. Actual error handling occurs in -ata_qc_timeout(). +driver's :c:func:`eng_timeout` callback, the standard callback for which is +:c:func:`ata_eng_timeout`. It checks if a qc is active and calls +:c:func:`ata_qc_timeout` on the qc if so. Actual error handling occurs in +:c:func:`ata_qc_timeout`. -If EH is invoked for timeout, ata_qc_timeout() stops BMDMA and +If EH is invoked for timeout, :c:func:`ata_qc_timeout` stops BMDMA and completes the qc. Note that as we're currently in EH, we cannot call scsi_done. As described in SCSI EH doc, a recovered scmd should be -either retried with scsi_queue_insert() or finished with -scsi_finish_command(). Here, we override qc->scsidone with -scsi_finish_command() and calls ata_qc_complete(). +either retried with :c:func:`scsi_queue_insert` or finished with +:c:func:`scsi_finish_command`. Here, we override ``qc->scsidone`` with +:c:func:`scsi_finish_command` and calls :c:func:`ata_qc_complete`. If EH is invoked due to a failed ATAPI qc, the qc here is completed but not deallocated. The purpose of this half-completion is to use the qc as
@@ -565,11 +567,11 @@ place holder to make EH code reach this place. This is a bit hackish, but it works. Once control reaches here, the qc is deallocated by invoking -__ata_qc_complete() explicitly. Then, internal qc for REQUEST SENSE +:c:func:`__ata_qc_complete` explicitly. Then, internal qc for REQUEST SENSE is issued. Once sense data is acquired, scmd is finished by directly -invoking scsi_finish_command() on the scmd. Note that as we already +invoking :c:func:`scsi_finish_command` on the scmd. Note that as we already have completed and deallocated the qc which was associated with the -scmd, we don't need to/cannot call ata_qc_complete() again. +scmd, we don't need to/cannot call :c:func:`ata_qc_complete` again. Problems with the current EH ----------------------------
@@ -583,7 +585,7 @@ Problems with the current EH - When handling timeouts, no action is taken to make device forget about the timed out command and ready for new commands. -- EH handling via ata_scsi_error() is not properly protected from +- EH handling via :c:func:`ata_scsi_error` is not properly protected from usual command processing. On EH entrance, the device is not in quiescent state. Timed out commands may succeed or fail any time. pio_task and atapi_task may still be running.
@@ -622,6 +624,8 @@ libata Core Internals .. kernel-doc:: drivers/ata/libata-core.c :internal: +.. kernel-doc:: drivers/ata/libata-eh.c + libata SCSI translation/emulation =================================
Signature · 1 line
2.9.3
PATCH 35/36 docs-rst: convert w1 book to ReST
In reply to Mauro Carvalho ChehabUse pandoc to convert documentation to ReST by calling Documentation/sphinx/tmplcvt script.
--- Documentation/DocBook/w1.tmpl | 101 ------------------------------------- Documentation/driver-api/index.rst | 1 + Documentation/driver-api/w1.rst | 70 +++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 101 deletions(-) delete mode 100644 Documentation/DocBook/w1.tmpl create mode 100644 Documentation/driver-api/w1.rst
Documentation/DocBook/w1.tmpl deleted +0 -101
@@ -1,101 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" - "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []> - -<book id="w1id"> - <bookinfo> - <title>W1: Dallas' 1-wire bus</title> - - <authorgroup> - <author> - <firstname>David</firstname> - <surname>Fries</surname> - <affiliation> - <address> - <email>[email protected]</email> - </address> - </affiliation> - </author> - - </authorgroup> - - <copyright> - <year>2013</year> - <!-- - <holder></holder> - --> - </copyright> - - <legalnotice> - <para> - This documentation is free software; you can redistribute - it and/or modify it under the terms of the GNU General Public - License version 2. - </para> - - <para> - This program is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied - warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - For more details see the file COPYING in the source - distribution of Linux. - </para> - </legalnotice> - </bookinfo> - - <toc></toc> - - <chapter id="w1_internal"> - <title>W1 API internal to the kernel</title> - - <sect1 id="w1_internal_api"> - <title>W1 API internal to the kernel</title> - <sect2 id="w1.h"> - <title>drivers/w1/w1.h</title> - <para>W1 core functions.</para> -!Idrivers/w1/w1.h - </sect2> - - <sect2 id="w1.c"> - <title>drivers/w1/w1.c</title> - <para>W1 core functions.</para> -!Idrivers/w1/w1.c - </sect2> - - <sect2 id="w1_family.h"> - <title>drivers/w1/w1_family.h</title> - <para>Allows registering device family operations.</para> -!Idrivers/w1/w1_family.h - </sect2> - - <sect2 id="w1_family.c"> - <title>drivers/w1/w1_family.c</title> - <para>Allows registering device family operations.</para> -!Edrivers/w1/w1_family.c - </sect2> - - <sect2 id="w1_int.c"> - <title>drivers/w1/w1_int.c</title> - <para>W1 internal initialization for master devices.</para> -!Edrivers/w1/w1_int.c - </sect2> - - <sect2 id="w1_netlink.h"> - <title>drivers/w1/w1_netlink.h</title> - <para>W1 external netlink API structures and commands.</para> -!Idrivers/w1/w1_netlink.h - </sect2> - - <sect2 id="w1_io.c"> - <title>drivers/w1/w1_io.c</title> - <para>W1 input/output.</para> -!Edrivers/w1/w1_io.c -!Idrivers/w1/w1_io.c - </sect2> - - </sect1> - - - </chapter> - -</book>
Documentation/driver-api/index.rst +1 -0
@@ -35,6 +35,7 @@ available subsections can be seen below. scsi libata miscellaneous + w1 s390-drivers vme 80211/index
Documentation/driver-api/w1.rst new file +70 -0
70 lines not on this page · raw message
Signature · 1 line
2.9.3
PATCH 6/36 locking.rst: add captions to two tables
In reply to Mauro Carvalho ChehabThose tables have a "caption" at the end, but ReST actually expects it on a different way.
--- Documentation/kernel-hacking/locking.rst | 66 ++++++++++++++++---------------- 1 file changed, 34 insertions(+), 32 deletions(-)
Documentation/kernel-hacking/locking.rst +34 -32
@@ -29,43 +29,45 @@ In a normal program, you can increment a counter like so: This is what they would expect to happen: -+------------------------------------+------------------------------------+ -| Instance 1 | Instance 2 | -+====================================+====================================+ -| read very_important_count (5) | | -+------------------------------------+------------------------------------+ -| add 1 (6) | | -+------------------------------------+------------------------------------+ -| write very_important_count (6) | | -+------------------------------------+------------------------------------+ -| | read very_important_count (6) | -+------------------------------------+------------------------------------+ -| | add 1 (7) | -+------------------------------------+------------------------------------+ -| | write very_important_count (7) | -+------------------------------------+------------------------------------+ -Table: Expected Results +.. table:: Expected Results + + +------------------------------------+------------------------------------+ + | Instance 1 | Instance 2 | + +====================================+====================================+ + | read very_important_count (5) | | + +------------------------------------+------------------------------------+ + | add 1 (6) | | + +------------------------------------+------------------------------------+ + | write very_important_count (6) | | + +------------------------------------+------------------------------------+ + | | read very_important_count (6) | + +------------------------------------+------------------------------------+ + | | add 1 (7) | + +------------------------------------+------------------------------------+ + | | write very_important_count (7) | + +------------------------------------+------------------------------------+ This is what might happen: -+------------------------------------+------------------------------------+ -| Instance 1 | Instance 2 | -+====================================+====================================+ -| read very_important_count (5) | | -+------------------------------------+------------------------------------+ -| | read very_important_count (5) | -+------------------------------------+------------------------------------+ -| add 1 (6) | | -+------------------------------------+------------------------------------+ -| | add 1 (6) | -+------------------------------------+------------------------------------+ -| write very_important_count (6) | | -+------------------------------------+------------------------------------+ -| | write very_important_count (6) | -+------------------------------------+------------------------------------+ +.. table:: Possible Results + + +------------------------------------+------------------------------------+ + | Instance 1 | Instance 2 | + +====================================+====================================+ + | read very_important_count (5) | | + +------------------------------------+------------------------------------+ + | | read very_important_count (5) | + +------------------------------------+------------------------------------+ + | add 1 (6) | | + +------------------------------------+------------------------------------+ + | | add 1 (6) | + +------------------------------------+------------------------------------+ + | write very_important_count (6) | | + +------------------------------------+------------------------------------+ + | | write very_important_count (6) | + +------------------------------------+------------------------------------+ -Table: Possible Results Race Conditions and Critical Regions ------------------------------------
Signature · 1 line
2.9.3
PATCH 20/36 docs-rst: don't ignore internal functions for jbd2 docs
In reply to Mauro Carvalho ChehabThose functions are currently ignored, causing references at the documentation to be lost. Don't ignore it.
--- Documentation/filesystems/index.rst | 1 - 1 file changed, 1 deletion(-)
Documentation/filesystems/index.rst +0 -1
@@ -287,7 +287,6 @@ Transasction Level ~~~~~~~~~~~~~~~~~~ .. kernel-doc:: fs/jbd2/transaction.c - :export: See also --------
Signature · 1 line
2.9.3
PATCH 10/36 conf.py: define a color for important markup on PDF output
In reply to Mauro Carvalho ChehabAs kdbg.rst uses the ".. important::" annotation, let's define a color for PDF output.
--- Documentation/conf.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
Documentation/conf.py +7 -1
@@ -281,6 +281,7 @@ latex_elements = { \\definecolor{NoteColor}{RGB}{204,255,255} \\definecolor{WarningColor}{RGB}{255,204,204} \\definecolor{AttentionColor}{RGB}{255,255,204} + \\definecolor{ImportantColor}{RGB}{192,255,204} \\definecolor{OtherColor}{RGB}{204,204,204} \\newlength{\\mynoticelength} \\makeatletter\\newenvironment{coloredbox}[1]{%
@@ -301,7 +302,12 @@ latex_elements = { \\ifthenelse% {\\equal{\\py@noticetype}{attention}}% {\\colorbox{AttentionColor}{\\usebox{\\@tempboxa}}}% - {\\colorbox{OtherColor}{\\usebox{\\@tempboxa}}}% + {% + \\ifthenelse% + {\\equal{\\py@noticetype}{important}}% + {\\colorbox{ImportantColor}{\\usebox{\\@tempboxa}}}% + {\\colorbox{OtherColor}{\\usebox{\\@tempboxa}}}% + }% }% }% }\\makeatother
Signature · 1 line
2.9.3
PATCH 16/36 docs-rst: add userspace API book to pdf output
In reply to Mauro Carvalho ChehabThe userspace API book was added without the bits required to generate PDF output. Add them.
--- Documentation/conf.py | 2 ++ 1 file changed, 2 insertions(+)
Documentation/conf.py +2 -0
@@ -373,6 +373,8 @@ latex_documents = [ 'The kernel development community', 'manual'), ('sound/index', 'sound.tex', 'Linux Sound Subsystem Documentation', 'The kernel development community', 'manual'), + ('userspace-api/index', 'userspace-api.tex', 'The Linux kernel user-space API guide', + 'The kernel development community', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of
Signature · 1 line
2.9.3
PATCH 11/36 docs-rst: conf.py: sort LaTeX documents in alphabetical order
In reply to Mauro Carvalho ChehabAs we add more documents, it makes more sense to sort the entries there in alphabetical order, as it makes easier to check if something is not there.
--- Documentation/conf.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
Documentation/conf.py +7 -6
@@ -345,27 +345,28 @@ if major == 1 and minor > 3: # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). +# Sorted in alphabetical order latex_documents = [ - ('doc-guide/index', 'kernel-doc-guide.tex', 'Linux Kernel Documentation Guide', - 'The kernel development community', 'manual'), ('admin-guide/index', 'linux-user.tex', 'Linux Kernel User Documentation', 'The kernel development community', 'manual'), ('core-api/index', 'core-api.tex', 'The kernel core API manual', 'The kernel development community', 'manual'), + ('doc-guide/index', 'kernel-doc-guide.tex', 'Linux Kernel Documentation Guide', + 'The kernel development community', 'manual'), ('driver-api/index', 'driver-api.tex', 'The kernel driver API manual', 'The kernel development community', 'manual'), + ('gpu/index', 'gpu.tex', 'Linux GPU Driver Developer\'s Guide', + 'The kernel development community', 'manual'), ('input/index', 'linux-input.tex', 'The Linux input driver subsystem', 'The kernel development community', 'manual'), ('kernel-documentation', 'kernel-documentation.tex', 'The Linux Kernel Documentation', 'The kernel development community', 'manual'), ('kernel-hacking/index', 'kernel-hacking.tex', 'Unreliable Guide To Hacking The Linux Kernel', 'The kernel development community', 'manual'), - ('process/index', 'development-process.tex', 'Linux Kernel Development Documentation', - 'The kernel development community', 'manual'), - ('gpu/index', 'gpu.tex', 'Linux GPU Driver Developer\'s Guide', - 'The kernel development community', 'manual'), ('media/index', 'media.tex', 'Linux Media Subsystem Documentation', 'The kernel development community', 'manual'), + ('process/index', 'development-process.tex', 'Linux Kernel Development Documentation', + 'The kernel development community', 'manual'), ('security/index', 'security.tex', 'The kernel security subsystem manual', 'The kernel development community', 'manual'), ]
Signature · 1 line
2.9.3
Re: [PATCH 01/36] docs-rst: convert kernel-hacking to ReST
In reply to Mauro Carvalho ChehabAm 12.05.2017 um 15:59 schrieb Mauro Carvalho Chehab <[email protected]>:
Quoted 21 lines
Use pandoc to convert documentation to ReST by calling
Documentation/sphinx/tmplcvtscript.- Manually adjusted to use ..note and ..warning
- Minor fixes for it to be parsed without errors
- Use **bold** for emphasis.Signed-off-by Mauro Carvalho Chehab <[email protected]>---
Documentation/DocBook/Makefile | 2 +- Documentation/DocBook/kernel-hacking.tmpl | 1312 ----------------------------- Documentation/conf.py | 2 + Documentation/index.rst | 1 + Documentation/kernel-hacking/conf.py | 10 + Documentation/kernel-hacking/index.rst | 794 +++++++++++++++++ 6 files changed, 808 insertions(+), 1313 deletions(-)delete mode 100644
Documentation/DocBook/kernel-hacking.tmplcreate mode 100644Documentation/kernel-hacking/conf.pycreate mode 100644Documentation/kernel-hacking/index.rst
....
Quoted 3 lines
+:c:func:
cpu_to_be32()/:c:func:be32_to_cpu()/:c:func:cpu_to_le32()/:c:func:le32_to_cpu()``include/asm/byteorder.h``
+---------------------------------------------------------------------------------------------------------------------------
+
Hi Mauro, just my bikeshedding:
what do you think, do we really need to refer functions in titles? As far as I know, there is no use-case where we can get any benefit from. So I recommend to write titles more simple, e.g.:
cpu_to_be32()/be32_to_cpu()/cpu_to_le32()/le32_to_cpu() include/asm/byteorder.h
.. which is long enough ;)
-- Markus --
Re: [PATCH 04/36] mutex, futex: adjust kernel-doc markups to generate ReST
In reply to Mauro Carvalho ChehabQuoted 7 lines · Mauro Carvalho Chehab
There are a few issues on some kernel-doc markups that was causing troubles with kernel-doc output on ReST format. Fix them.
No functional changes.
Signed-off-by Mauro Carvalho Chehab <[email protected]>
No objection. One question, rather than prefixing the bulleted list of return codes with a "-" which has no ReST meaning I could find, should we use "*" instead which would be converted to a bullet it formatted documentation?
kernel/futex.c static int lock_pi_update_atomic(u32 __user *uaddr, u32 uval, u32 newval) · line 1265
Quoted 11 lines
kernel/futex.c +3
-3@@ -1259,9 +1259,9 @@ static int lock_pi_update_atomic(u32 __user *uaddr, u32 uval, u32 newval)* @set_waiters: force setting the FUTEX_WAITERS bit (1) or not (0) * * Return: -* 0 - ready to wait; -* 1 - acquired the lock; -* <0 - error +* - 0 - ready to wait; +* - 1 - acquired the lock; +* - <0 - error *
e.g.
* Return:
* * 0 - ready to wait * * 1 - acquired the lock * * <0 - error
I'm fine with either though, just curious if this would be an improvement, or if we have an established policy (which I didn't find in the docs on docs...).
Signature · 2 lines
Darren Hart VMware Open Source Technology Center
Re: [PATCH 03/36] docs-rst: convert kernel-locking to ReST
In reply to Mauro Carvalho ChehabAm 12.05.2017 um 15:59 schrieb Mauro Carvalho Chehab <[email protected]>:
Quoted 13 lines
Use pandoc to convert documentation to ReST by calling
Documentation/sphinx/tmplcvtscript.- Manually adjust tables with got broken by conversion
Signed-off-by Mauro Carvalho Chehab <[email protected]>---
Documentation/DocBook/Makefile | 1 - Documentation/DocBook/kernel-locking.tmpl | 2151 ----------------------------- Documentation/kernel-hacking/hacking.rst | 811 +++++++++++ Documentation/kernel-hacking/index.rst | 814 +---------- Documentation/kernel-hacking/locking.rst | 1453 +++++++++++++++++++ 5 files changed, 2268 insertions(+), 2962 deletions(-)
Quoted 3 lines
delete mode 100644
Documentation/DocBook/kernel-locking.tmplcreate mode 100644Documentation/kernel-hacking/hacking.rstcreate mode 100644Documentation/kernel-hacking/locking.rst
...
There are some misplaced colons at the end of the filenames ...
Quoted 7 lines
+``arch/x86/include/asm/uaccess_32.h:``::
Documentation/kernel-hacking/hacking.rst new file +6
-0+ + #define copy_to_user(to,from,n) \ + (__builtin_constant_p(n) ? \ + __constant_copy_to_user((to),(from),(n)) : \ + __generic_copy_to_user((to),(from),(n))) +
...
Quoted 8 lines
Documentation/kernel-hacking/hacking.rst new file +8
-0+ +``arch/sparc/kernel/head.S:``:: + + /* + * Sun people can't spell worth damn. "compatability" indeed. + * At least we *know* we can't spell, and use a spell-checker. + */ +
...
Documentation/kernel-hacking/hacking.rst line 799
Quoted 7 lines
Documentation/kernel-hacking/hacking.rst new file +7
-0+ +``arch/sparc/lib/checksum.S:``:: + + /* Sun, you just can't beat me, you just can't. Stop trying, + * give up. I'm serious, I am going to kick the living shit + * out of you, game over, lights out. + */
-- Markus--
Re: [PATCH 03/36] docs-rst: convert kernel-locking to ReST
In reply to Mauro Carvalho ChehabAm 12.05.2017 um 15:59 schrieb Mauro Carvalho Chehab <[email protected]>:
Quoted 24 lines
Use pandoc to convert documentation to ReST by calling
Documentation/sphinx/tmplcvtscript.- Manually adjust tables with got broken by conversion
Signed-off-by Mauro Carvalho Chehab <[email protected]>---
Documentation/DocBook/Makefile | 1 - Documentation/DocBook/kernel-locking.tmpl | 2151 ----------------------------- Documentation/kernel-hacking/hacking.rst | 811 +++++++++++ Documentation/kernel-hacking/index.rst | 814 +---------- Documentation/kernel-hacking/locking.rst | 1453 +++++++++++++++++++ 5 files changed, 2268 insertions(+), 2962 deletions(-)delete mode 100644
Documentation/DocBook/kernel-locking.tmplcreate mode 100644Documentation/kernel-hacking/hacking.rstcreate mode 100644Documentation/kernel-hacking/locking.rst...
Documentation/kernel-hacking/index.rst +0
-0
Documentation/kernel-hacking/index.rst line 2
Quoted 5 lines
Documentation/kernel-hacking/index.rst +2
-3@@ -1,811 +1,5 @@ -============================================ -Unreliable Guide To Hacking The Linux Kernel -============================================ +.. toctree:: + :maxdepth: 2
Every .rst file needs a title, otherwise <no title> is inserted, see breadcrumb at the top :
https://mchehab.fedorapeople.org/kernel_docs/kernel-hacking/index.html
-- Markus --
Re: [PATCH 04/36] mutex, futex: adjust kernel-doc markups to generate ReST
In reply to Darren HartEm Fri, 12 May 2017 09:41:22 -0700
Darren Hart <[email protected]> escreveu:
Quoted 5 lines · Mauro Carvalho Chehab
Quoted 4 lines
There are a few issues on some kernel-doc markups that was causing troubles with kernel-doc output on ReST format. Fix them.
Quoted 7 lines
Quoted 3 lines
No functional changes.
Signed-off-by Mauro Carvalho Chehab <[email protected]>No objection. One question, rather than prefixing the bulleted list of return codes with a "-" which has no ReST meaning I could find, should we use "*" instead which would be converted to a bullet it formatted documentation?
At least on Sphinx[1]:
"A text block which begins with a "*", "+", "-", "•", "‣", or "⁃", followed by whitespace, is a bullet list item"
I never tried "+", but both "-" and "*" produce the same visual.
[1] http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#bullet-lists
Quoted 15 lines
kernel/futex.c static int lock_pi_update_atomic(u32 __user *uaddr, u32 uval, u32 newval) · line 1265
Quoted 12 lines
kernel/futex.c +3
-3@@ -1259,9 +1259,9 @@ static int lock_pi_update_atomic(u32 __user *uaddr, u32 uval, u32 newval)* @set_waiters: force setting the FUTEX_WAITERS bit (1) or not (0) * * Return: -* 0 - ready to wait; -* 1 - acquired the lock; -* <0 - error +* - 0 - ready to wait; +* - 1 - acquired the lock; +* - <0 - error * e.g.
Quoted 7 lines
* Return:
* * 0 - ready to wait * * 1 - acquired the lock * * <0 - errorI'm fine with either though, just curious if this would be an improvement, or if we have an established policy (which I didn't find in the docs on docs...).
I prefer myself to use "-". IMHO, a dash is visually less polluted than an asterisk, when reading text files, but I guess this is a matter of taste.
Quoted 1 line
Thanks,
Mauro
Re: [PATCH 04/36] mutex, futex: adjust kernel-doc markups to generate ReST
Quoted 16 lines · Mauro Carvalho Chehab
Em Fri, 12 May 2017 09:41:22 -0700
Darren Hart <[email protected]> escreveu:Quoted 5 lines · Mauro Carvalho Chehab
Quoted 4 lines
There are a few issues on some kernel-doc markups that was causing troubles with kernel-doc output on ReST format. Fix them.
Quoted 7 lines
Quoted 3 lines
No functional changes.
Signed-off-by Mauro Carvalho Chehab <[email protected]>No objection. One question, rather than prefixing the bulleted list of return codes with a "-" which has no ReST meaning I could find, should we use "*" instead which would be converted to a bullet it formatted documentation?
Quoted 8 lines
At least on Sphinx[1]:
"A text block which begins with a "*", "+", "-", "•", "‣", or "⁃", followed by whitespace, is a bullet list item"I never tried "+", but both "-" and "*" produce the same visual.
[1] http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#bullet-lists
Thanks, my search turned up a much shorter list of "list" special characters.
Quoted 20 lines
Quoted 20 lines
kernel/futex.c static int lock_pi_update_atomic(u32 __user *uaddr, u32 uval, u32 newval) · line 1265
Quoted 12 lines
kernel/futex.c +3
-3@@ -1259,9 +1259,9 @@ static int lock_pi_update_atomic(u32 __user *uaddr, u32 uval, u32 newval)* @set_waiters: force setting the FUTEX_WAITERS bit (1) or not (0) * * Return: -* 0 - ready to wait; -* 1 - acquired the lock; -* <0 - error +* - 0 - ready to wait; +* - 1 - acquired the lock; +* - <0 - error * e.g.
* Return:
* * 0 - ready to wait * * 1 - acquired the lock * * <0 - error
Quoted 6 lines
Quoted 2 lines
I'm fine with either though, just curious if this would be an improvement, or if we have an established policy (which I didn't find in the docs on docs...).
I prefer myself to use "-". IMHO, a dash is visually less polluted than an asterisk, when reading text files, but I guess this is a matter of taste.
Definitely agreed. - is preferable if it renders the same.
Thanks,
Signature · 2 lines
Darren Hart VMware Open Source Technology Center
Peter Zijlstra
maintainerRe: [PATCH 04/36] mutex, futex: adjust kernel-doc markups to generate ReST
In reply to Mauro Carvalho ChehabQuoted 11 lines · Mauro Carvalho Chehab
Quoted 7 lines
* Return:
* * 0 - ready to wait * * 1 - acquired the lock * * <0 - errorI'm fine with either though, just curious if this would be an improvement, or if we have an established policy (which I didn't find in the docs on docs...).
I prefer myself to use "-". IMHO, a dash is visually less polluted than an asterisk, when reading text files, but I guess this is a matter of taste.
Not to mention it just reads very awkward in a comment. I don't much care about it in any other context.
And I really _really_ hate to see that rest crap spread here. Can't we just delete all that nonsense and go back to 80 column 7bit ASCII ?
It is an incentive not to use kerneldoc..
Re: [PATCH 04/36] mutex, futex: adjust kernel-doc markups to generate ReST
Quoted 9 lines · Peter Zijlstra
Quoted 8 lines · Mauro Carvalho Chehab
Quoted 7 lines
* Return:
* * 0 - ready to wait * * 1 - acquired the lock * * <0 - errorI'm fine with either though, just curious if this would be an improvement, or if we have an established policy (which I didn't find in the docs on docs...).
Quoted 6 lines
Quoted 3 lines
I prefer myself to use "-". IMHO, a dash is visually less polluted than an asterisk, when reading text files, but I guess this is a matter of taste.
Not to mention it just reads very awkward in a comment. I don't much care about it in any other context.
Agreed, the - is better (and equally functional - so yay).
Quoted 4 lines
And I really _really_ hate to see that rest crap spread here. Can't we just delete all that nonsense and go back to 80 column 7bit ASCII ?
Depending on the source this could be a genuine appeal or satire.... :-D
In this case, I don't think the ReST changes (with -) make the comment block any less readable in the C files.
Quoted 2 lines
It is an incentive not to use kerneldoc..
I like the kerneldoc if for no other reason that it helps keeps formatting consistent. I would object if I started seeing XML or some other horrible formatting style showing up in the code, but this honestly seems like a fairly minimal imposition... but that's me.
Signature · 2 lines
Darren Hart VMware Open Source Technology Center
kbuild test robot
build botRe: [PATCH 26/36] libata.rst: add c function and struct cross-references
In reply to Mauro Carvalho Chehaburl: https://github.com/0day-ci/linux/commits/Mauro-Carvalho-Chehab/docs-rst-convert-kernel-hacking-to-ReST/20170513-131229 reproduce: make htmldocs
Hi Mauro,
[auto build test WARNING on linus/master]
[also build test WARNING on next-20170512]
[cannot apply to v4.11]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Mauro-Carvalho-Chehab/docs-rst-convert-kernel-hacking-to-ReST/20170513-131229
reproduce: make htmldocs
All warnings (new ones prefixed by >>):
WARNING: convert(1) not found, for SVG to PDF conversion install ImageMagick (https://www.imagemagick.org)
arch/x86/include/asm/uaccess_32.h:1: warning: no structured comments found
include/linux/init.h:1: warning: no structured comments found
include/linux/mod_devicetable.h:686: warning: Excess struct/union/enum/typedef member 'ver_major' description in 'fsl_mc_device_id' include/linux/mod_devicetable.h:686: warning: Excess struct/union/enum/typedef member 'ver_minor' description in 'fsl_mc_device_id' kernel/sched/core.c:2088: warning: No description found for parameter 'rf'
kernel/sched/core.c:2088: warning: Excess function parameter 'cookie' description in 'try_to_wake_up_local' include/linux/kthread.h:26: warning: Excess function parameter '...' description in 'kthread_create' kernel/sys.c:1: warning: no structured comments found
include/linux/device.h:969: warning: No description found for parameter 'dma_ops' drivers/dma-buf/seqno-fence.c:1: warning: no structured comments found
include/linux/iio/iio.h:597: warning: No description found for parameter 'trig_readonly' include/linux/iio/trigger.h:151: warning: No description found for parameter 'indio_dev' include/linux/iio/trigger.h:151: warning: No description found for parameter 'trig' include/linux/device.h:970: warning: No description found for parameter 'dma_ops'
>> drivers/ata/libata-eh.c:1449: warning: No description found for parameter 'link' >> drivers/ata/libata-eh.c:1449: warning: Excess function parameter 'ap' description in 'ata_eh_done' >> drivers/ata/libata-eh.c:1654: warning: No description found for parameter 'qc' >> drivers/ata/libata-eh.c:1654: warning: Excess function parameter 'dev' description in 'ata_eh_request_sense'
include/linux/usb/gadget.h:230: warning: No description found for parameter 'claimed' include/linux/usb/gadget.h:230: warning: No description found for parameter 'enabled' include/linux/usb/gadget.h:408: warning: No description found for parameter 'quirk_altset_not_supp' include/linux/usb/gadget.h:408: warning: No description found for parameter 'quirk_stall_not_supp' include/linux/usb/gadget.h:408: warning: No description found for parameter 'quirk_zlp_not_supp' fs/inode.c:1665: warning: No description found for parameter 'rcu'
include/linux/jbd2.h:443: warning: No description found for parameter 'i_transaction' include/linux/jbd2.h:443: warning: No description found for parameter 'i_next_transaction' include/linux/jbd2.h:443: warning: No description found for parameter 'i_list' include/linux/jbd2.h:443: warning: No description found for parameter 'i_vfs_inode' include/linux/jbd2.h:443: warning: No description found for parameter 'i_flags' include/linux/jbd2.h:497: warning: No description found for parameter 'h_rsv_handle' include/linux/jbd2.h:497: warning: No description found for parameter 'h_reserved' include/linux/jbd2.h:497: warning: No description found for parameter 'h_type' include/linux/jbd2.h:497: warning: No description found for parameter 'h_line_no' include/linux/jbd2.h:497: warning: No description found for parameter 'h_start_jiffies' include/linux/jbd2.h:497: warning: No description found for parameter 'h_requested_credits' include/linux/jbd2.h:497: warning: No description found for parameter 'saved_alloc_context' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_chkpt_bhs' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_devname' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_average_commit_time' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_min_batch_time' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_max_batch_time' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_commit_callback' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_failed_commit' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_chksum_driver' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_csum_seed' fs/jbd2/transaction.c:511: warning: No description found for parameter 'type' fs/jbd2/transaction.c:511: warning: No description found for parameter 'line_no' fs/jbd2/transaction.c:641: warning: No description found for parameter 'gfp_mask' include/drm/drm_drv.h:524: warning: No description found for parameter 'set_busid' include/drm/drm_drv.h:524: warning: No description found for parameter 'irq_handler' include/drm/drm_drv.h:524: warning: No description found for parameter 'irq_preinstall' include/drm/drm_drv.h:524: warning: No description found for parameter 'irq_postinstall' include/drm/drm_drv.h:524: warning: No description found for parameter 'irq_uninstall' include/drm/drm_drv.h:524: warning: No description found for parameter 'debugfs_init' include/drm/drm_drv.h:524: warning: No description found for parameter 'gem_open_object' include/drm/drm_drv.h:524: warning: No description found for parameter 'gem_close_object' include/drm/drm_drv.h:524: warning: No description found for parameter 'prime_handle_to_fd' include/drm/drm_drv.h:524: warning: No description found for parameter 'prime_fd_to_handle' include/drm/drm_drv.h:524: warning: No description found for parameter 'gem_prime_export' include/drm/drm_drv.h:524: warning: No description found for parameter 'gem_prime_import' include/drm/drm_drv.h:524: warning: No description found for parameter 'gem_prime_pin' include/drm/drm_drv.h:524: warning: No description found for parameter 'gem_prime_unpin' include/drm/drm_drv.h:524: warning: No description found for parameter 'gem_prime_res_obj' include/drm/drm_drv.h:524: warning: No description found for parameter 'gem_prime_get_sg_table' include/drm/drm_drv.h:524: warning: No description found for parameter 'gem_prime_import_sg_table' include/drm/drm_drv.h:524: warning: No description found for parameter 'gem_prime_vmap' include/drm/drm_drv.h:524: warning: No description found for parameter 'gem_prime_vunmap' include/drm/drm_drv.h:524: warning: No description found for parameter 'gem_prime_mmap' include/drm/drm_drv.h:524: warning: No description found for parameter 'gem_vm_ops' include/drm/drm_drv.h:524: warning: No description found for parameter 'major' include/drm/drm_drv.h:524: warning: No description found for parameter 'minor' include/drm/drm_drv.h:524: warning: No description found for parameter 'patchlevel' include/drm/drm_drv.h:524: warning: No description found for parameter 'name' include/drm/drm_drv.h:524: warning: No description found for parameter 'desc' include/drm/drm_drv.h:524: warning: No description found for parameter 'date' include/drm/drm_drv.h:524: warning: No description found for parameter 'driver_features' include/drm/drm_drv.h:524: warning: No description found for parameter 'ioctls' include/drm/drm_drv.h:524: warning: No description found for parameter 'num_ioctls' include/drm/drm_drv.h:524: warning: No description found for parameter 'fops' include/drm/drm_color_mgmt.h:1: warning: no structured comments found drivers/gpu/drm/drm_plane_helper.c:403: warning: No description found for parameter 'ctx' drivers/gpu/drm/drm_plane_helper.c:404: warning: No description found for parameter 'ctx' drivers/gpu/drm/i915/intel_lpe_audio.c:350: warning: No description found for parameter 'dp_output' drivers/gpu/drm/i915/intel_lpe_audio.c:350: warning: No description found for parameter 'link_rate' drivers/gpu/drm/i915/intel_lpe_audio.c:351: warning: No description found for parameter 'dp_output' drivers/gpu/drm/i915/intel_lpe_audio.c:351: warning: No description found for parameter 'link_rate' Documentation/core-api/assoc_array.rst:13: WARNING: Enumerated list ends without a blank line; unexpected unindent. Documentation/doc-guide/sphinx.rst:126: ERROR: Unknown target name: "sphinx c domain". kernel/sched/fair.c:7650: WARNING: Inline emphasis start-string without end-string. kernel/time/timer.c:1200: ERROR: Unexpected indentation.
kernel/time/timer.c:1202: ERROR: Unexpected indentation.
kernel/time/timer.c:1203: WARNING: Block quote ends without a blank line; unexpected unindent. include/linux/wait.h:122: WARNING: Block quote ends without a blank line; unexpected unindent. include/linux/wait.h:125: ERROR: Unexpected indentation.
include/linux/wait.h:127: WARNING: Block quote ends without a blank line; unexpected unindent. kernel/time/hrtimer.c:990: WARNING: Block quote ends without a blank line; unexpected unindent. kernel/signal.c:322: WARNING: Inline literal start-string without end-string. include/linux/iio/iio.h:219: ERROR: Unexpected indentation.
include/linux/iio/iio.h:220: WARNING: Block quote ends without a blank line; unexpected unindent. include/linux/iio/iio.h:226: WARNING: Definition list ends without a blank line; unexpected unindent. drivers/iio/industrialio-core.c:638: ERROR: Unknown target name: "iio_val". drivers/iio/industrialio-core.c:645: ERROR: Unknown target name: "iio_val". drivers/ata/libata-scsi.c:3402: ERROR: Unexpected indentation.
drivers/ata/libata-core.c:5832: ERROR: Unknown target name: "hw". drivers/message/fusion/mptbase.c:5051: WARNING: Definition list ends without a blank line; unexpected unindent. drivers/tty/serial/serial_core.c:1898: WARNING: Definition list ends without a blank line; unexpected unindent. drivers/pci/pci.c:3456: ERROR: Unexpected indentation.
include/linux/regulator/driver.h:271: ERROR: Unknown target name: "regulator_regmap_x_voltage". include/linux/spi/spi.h:370: ERROR: Unexpected indentation.
block/bio.c:399: ERROR: Unknown target name: "gfp".
drivers/gpu/drm/drm_scdc_helper.c:203: ERROR: Unexpected indentation. drivers/gpu/drm/drm_scdc_helper.c:204: WARNING: Block quote ends without a blank line; unexpected unindent. drivers/gpu/drm/drm_ioctl.c:690: WARNING: Definition list ends without a blank line; unexpected unindent. Documentation/gpu/todo.rst:111: ERROR: Unknown target name: "drm_fb".
sound/soc/soc-core.c:2670: ERROR: Unknown target name: "snd_soc_daifmt".
sound/core/jack.c:312: ERROR: Unknown target name: "snd_jack_btn". Documentation/usb/typec.rst:116: ERROR: Error in "kernel-doc" directive:
invalid option block.
vim +/link +1449 drivers/ata/libata-eh.c
022bdb07 drivers/scsi/libata-eh.c Tejun Heo 2006-05-15 1433 }
022bdb07 drivers/scsi/libata-eh.c Tejun Heo 2006-05-15 1434
022bdb07 drivers/scsi/libata-eh.c Tejun Heo 2006-05-15 1435 /**
47005f25 drivers/scsi/libata-eh.c Tejun Heo 2006-06-19 1436 * ata_eh_done - EH action complete
47005f25 drivers/scsi/libata-eh.c Tejun Heo 2006-06-19 1437 * @ap: target ATA port
47005f25 drivers/scsi/libata-eh.c Tejun Heo 2006-06-19 1438 * @dev: target ATA dev for per-dev action (can be NULL)
47005f25 drivers/scsi/libata-eh.c Tejun Heo 2006-06-19 1439 * @action: action just completed
47005f25 drivers/scsi/libata-eh.c Tejun Heo 2006-06-19 1440 *
47005f25 drivers/scsi/libata-eh.c Tejun Heo 2006-06-19 1441 * Called right after performing EH actions to clear related bits
955e57df drivers/ata/libata-eh.c Tejun Heo 2007-08-06 1442 * in @link->eh_context.
47005f25 drivers/scsi/libata-eh.c Tejun Heo 2006-06-19 1443 *
47005f25 drivers/scsi/libata-eh.c Tejun Heo 2006-06-19 1444 * LOCKING:
47005f25 drivers/scsi/libata-eh.c Tejun Heo 2006-06-19 1445 * None.
47005f25 drivers/scsi/libata-eh.c Tejun Heo 2006-06-19 1446 */
fb7fd614 drivers/ata/libata-eh.c Tejun Heo 2007-09-23 1447 void ata_eh_done(struct ata_link *link, struct ata_device *dev,
47005f25 drivers/scsi/libata-eh.c Tejun Heo 2006-06-19 1448 unsigned int action)
47005f25 drivers/scsi/libata-eh.c Tejun Heo 2006-06-19 @1449 {
955e57df drivers/ata/libata-eh.c Tejun Heo 2007-08-06 1450 struct ata_eh_context *ehc = &link->eh_context;
9af5c9c9 drivers/ata/libata-eh.c Tejun Heo 2007-08-06 1451
955e57df drivers/ata/libata-eh.c Tejun Heo 2007-08-06 1452 ata_eh_clear_action(link, dev, &ehc->i, action);
47005f25 drivers/scsi/libata-eh.c Tejun Heo 2006-06-19 1453 }
47005f25 drivers/scsi/libata-eh.c Tejun Heo 2006-06-19 1454
47005f25 drivers/scsi/libata-eh.c Tejun Heo 2006-06-19 1455 /**
022bdb07 drivers/scsi/libata-eh.c Tejun Heo 2006-05-15 1456 * ata_err_string - convert err_mask to descriptive string
022bdb07 drivers/scsi/libata-eh.c Tejun Heo 2006-05-15 1457 * @err_mask: error mask to convert to string:::::: The code at line 1449 was first introduced by commit
:::::: 47005f255ed126a4b48a1a2f63164fb1d83bcb0a [PATCH] libata: implement per-dev EH action mask eh_info->dev_action[]
:::::: TO: Tejun Heo <[email protected]>
:::::: CC: Jeff Garzik <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Re: [PATCH 21/36] fs: locks: Fix some troubles at kernel-doc comments
In reply to Jeff LaytonHi Jeff,
Em Fri, 12 May 2017 10:02:56 -0400
Jeff Layton <[email protected]> escreveu:
Quoted 42 lines · Mauro Carvalho Chehab
Quoted 41 lines
There are a few syntax violations that cause outputs of a few comments to not be properly parsed in ReST format.
No functional changes.
Signed-off-by Mauro Carvalho Chehab <[email protected]>--- fs/locks.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)fs/locks.c +5
-10@@ -1858,8 +1858,8 @@ EXPORT_SYMBOL(generic_setlease);* * Call this to establish a lease on the file. The "lease" argument is not * used for F_UNLCK requests and may be NULL. For commands that set or alter -* an existing lease, the (*lease)->fl_lmops->lm_break operation must be set; -* if not, this function will return -ENOLCK (and generate a scary-looking +* an existing lease, the ``(*lease)->fl_lmops->lm_break`` operation must be +* set; if not, this function will return -ENOLCK (and generate a scary-looking * stack trace). * * The "priv" pointer is passed directly to the lm_setup function as-is. It @@ -1972,15 +1972,13 @@ EXPORT_SYMBOL(locks_lock_inode_wait);* @cmd: the type of lock to apply. * * Apply a %FL_FLOCK style lock to an open file descriptor. -* The @cmd can be one of +* The @cmd can be one of: * -* %LOCK_SH -- a shared lock. -* -* %LOCK_EX -- an exclusive lock. -* -* %LOCK_UN -- remove an existing lock. -* -* %LOCK_MAND -- a `mandatory' flock. This exists to emulate Windows Share Modes. +* - %LOCK_SH -- a shared lock. +* - %LOCK_EX -- an exclusive lock.
Quoted 8 lines
fs/locks.c EXPORT_SYMBOL(locks_lock_inode_wait); · line 1984
Quoted 6 lines
fs/locks.c +3
-0+* - %LOCK_UN -- remove an existing lock. +* - %LOCK_MAND -- a 'mandatory' flock. +* This exists to emulate Windows Share Modes. * * %LOCK_MAND can be combined with %LOCK_READ or %LOCK_WRITE to allow other * processes read and write access respectively. LGTM. Do you need me or Bruce to pick this one up?
Feel free to pick it, if it works best for you.
Quoted 1 line
Reviewed-by Jeff Layton <[email protected]>
Thanks,
Mauro
Re: [PATCH 03/36] docs-rst: convert kernel-locking to ReST
In reply to Markus HeiserEm Fri, 12 May 2017 18:57:13 +0200
Markus Heiser <[email protected]> escreveu:
Quoted 35 lines
Am 12.05.2017 um 15:59 schrieb Mauro Carvalho Chehab <[email protected]>:
Quoted 24 lines
Use pandoc to convert documentation to ReST by calling
Documentation/sphinx/tmplcvtscript.- Manually adjust tables with got broken by conversion
Signed-off-by Mauro Carvalho Chehab <[email protected]>---
Documentation/DocBook/Makefile | 1 - Documentation/DocBook/kernel-locking.tmpl | 2151 ----------------------------- Documentation/kernel-hacking/hacking.rst | 811 +++++++++++ Documentation/kernel-hacking/index.rst | 814 +---------- Documentation/kernel-hacking/locking.rst | 1453 +++++++++++++++++++ 5 files changed, 2268 insertions(+), 2962 deletions(-)delete mode 100644
Documentation/DocBook/kernel-locking.tmplcreate mode 100644Documentation/kernel-hacking/hacking.rstcreate mode 100644Documentation/kernel-hacking/locking.rst...
Documentation/kernel-hacking/index.rst +0
-0Documentation/kernel-hacking/index.rst line 2
Quoted 5 lines
Documentation/kernel-hacking/index.rst +2
-3@@ -1,811 +1,5 @@ -============================================ -Unreliable Guide To Hacking The Linux Kernel -============================================ +.. toctree:: + :maxdepth: 2Every .rst file needs a title, otherwise <no title> is inserted, see breadcrumb at the top :
Thanks for review!
I'll fold it with the enclosed path.
Documentation/conf.py +1 -1
@@ -352,7 +352,7 @@ latex_documents = [ 'The kernel development community', 'manual'), ('kernel-documentation', 'kernel-documentation.tex', 'The Linux Kernel Documentation', 'The kernel development community', 'manual'), - ('kernel-hacking/index', 'kernel-hacking.tex', 'Unreliable Guide To Hacking The Linux Kernel', + ('kernel-hacking/index', 'kernel-hacking.tex', 'Kernel Hacking Guides', 'The kernel development community', 'manual'), ('process/index', 'development-process.tex', 'Linux Kernel Development Documentation', 'The kernel development community', 'manual'),
Documentation/kernel-hacking/conf.py +1 -1
@@ -1,6 +1,6 @@ # -*- coding: utf-8; mode: python -*- -project = "Unreliable Guide To Hacking The Linux Kernel" +project = "Kernel Hacking Guides" tags.add("subproject")
Documentation/kernel-hacking/index.rst +4 -0
@@ -1,3 +1,7 @@ +===================== +Kernel Hacking Guides +===================== + .. toctree:: :maxdepth: 2
Documentation/kernel-hacking/hacking.rst +3 -3
@@ -764,7 +764,7 @@ Some favorites from browsing the source. Feel free to add to this list. #define PTR_ERR(ptr) ((long)(ptr)) #define IS_ERR(ptr) ((unsigned long)(ptr) > (unsigned long)(-1000)) -``arch/x86/include/asm/uaccess_32.h:``:: +``arch/x86/include/asm/uaccess_32.h``:: #define copy_to_user(to,from,n) \ (__builtin_constant_p(n) ? \
@@ -772,7 +772,7 @@ Some favorites from browsing the source. Feel free to add to this list. __generic_copy_to_user((to),(from),(n))) -``arch/sparc/kernel/head.S:``:: +``arch/sparc/kernel/head.S``:: /* * Sun people can't spell worth damn. "compatability" indeed.
@@ -791,7 +791,7 @@ Some favorites from browsing the source. Feel free to add to this list. .asciz "compatible" -``arch/sparc/lib/checksum.S:``:: +``arch/sparc/lib/checksum.S``:: /* Sun, you just can't beat me, you just can't. Stop trying, * give up. I'm serious, I am going to kick the living shit
Thanks,
Mauro
Re: [PATCH 04/36] mutex, futex: adjust kernel-doc markups to generate ReST
In reply to Darren HartEm Fri, 12 May 2017 15:19:17 -0700
Darren Hart <[email protected]> escreveu:
Quoted 20 lines · Peter Zijlstra
Quoted 9 lines · Mauro Carvalho Chehab
Quoted 8 lines
Quoted 7 lines
* Return:
* * 0 - ready to wait * * 1 - acquired the lock * * <0 - errorI'm fine with either though, just curious if this would be an improvement, or if we have an established policy (which I didn't find in the docs on docs...).
Quoted 6 lines
Quoted 3 lines
I prefer myself to use "-". IMHO, a dash is visually less polluted than an asterisk, when reading text files, but I guess this is a matter of taste.
Not to mention it just reads very awkward in a comment. I don't much care about it in any other context.
Agreed, the - is better (and equally functional - so yay).
Quoted 1 line
Quoted 10 lines
Quoted 3 lines
And I really _really_ hate to see that rest crap spread here. Can't we just delete all that nonsense and go back to 80 column 7bit ASCII ?
Depending on the source this could be a genuine appeal or satire.... :-D
In this case, I don't think the ReST changes (with -) make the comment block any less readable in the C files.
Quoted 1 line
It is an incentive not to use kerneldoc..
Very few kerneldoc markups need changes due to ReST introduction, and usually is just whitespace/blank lines adjustment. Ok, someone could try to improve the script to make it smarter[1], but, on my experiences addressing it, usually doing the required changes make it visually better on both C file and on PDF/LaTeX/HTML outputs.
[1] probably rewriting the entire script to work more like a lexical interpreter than a bunch of rejex expressions.
Quoted 4 lines
I like the kerneldoc if for no other reason that it helps keeps formatting consistent. I would object if I started seeing XML or some other horrible formatting style showing up in the code, but this honestly seems like a fairly minimal imposition... but that's me.
IMHO, the best thing with kerneldoc is that it helps to keep the documentation updated, as it warns when someone change the function arguments without updating the comments.
Thanks,
Mauro
Re: [PATCH 01/36] docs-rst: convert kernel-hacking to ReST
In reply to Markus HeiserEm Fri, 12 May 2017 18:35:29 +0200
Markus Heiser <[email protected]> escreveu:
Quoted 31 lines
Am 12.05.2017 um 15:59 schrieb Mauro Carvalho Chehab <[email protected]>:
Quoted 21 lines
Use pandoc to convert documentation to ReST by calling
Documentation/sphinx/tmplcvtscript.- Manually adjusted to use ..note and ..warning
- Minor fixes for it to be parsed without errors
- Use **bold** for emphasis.Signed-off-by Mauro Carvalho Chehab <[email protected]>---
Documentation/DocBook/Makefile | 2 +- Documentation/DocBook/kernel-hacking.tmpl | 1312 ----------------------------- Documentation/conf.py | 2 + Documentation/index.rst | 1 + Documentation/kernel-hacking/conf.py | 10 + Documentation/kernel-hacking/index.rst | 794 +++++++++++++++++ 6 files changed, 808 insertions(+), 1313 deletions(-)delete mode 100644
Documentation/DocBook/kernel-hacking.tmplcreate mode 100644Documentation/kernel-hacking/conf.pycreate mode 100644Documentation/kernel-hacking/index.rst....
Quoted 3 lines
+:c:func:
cpu_to_be32()/:c:func:be32_to_cpu()/:c:func:cpu_to_le32()/:c:func:le32_to_cpu()``include/asm/byteorder.h``+--------------------------------------------------------------------------------------------------------------------------- +Hi Mauro, just my bikeshedding:
Quoted 7 lines
what do you think, do we really need to refer functions in titles? As far as I know, there is no use-case where we can get any benefit from. So I recommend to write titles more simple, e.g.:
cpu_to_be32()/be32_to_cpu()/cpu_to_le32()/le32_to_cpu()
include/asm/byteorder.h.. which is long enough ;)
There are some functions there that are only mentioned at the title,
like: local_bh_disable().
IMHO, it is a good idea to add a cross-reference to those, as it helps the reader to get further information if needed. So, except if this would cause Sphinx to crash, I prefer to keep the references.
What I did, instead, on patch 02/36 is to move all header references to be outside the title:
+:c:func:cpu_to_be32()/:c:func:be32_to_cpu()/:c:func:cpu_to_le32()/:c:func:le32_to_cpu()
+-----------------------------------------------------------------------------------------------
+
+Defined in ``include/asm/byteorder.h``
With reduces the displayed title to something reasonable.
Thanks,
Mauro
Peter Zijlstra
maintainerRe: [PATCH 04/36] mutex, futex: adjust kernel-doc markups to generate ReST
In reply to Darren HartQuoted 7 lines · Darren Hart
Quoted 3 lines · Peter Zijlstra
And I really _really_ hate to see that rest crap spread here. Can't we just delete all that nonsense and go back to 80 column 7bit ASCII ?
Depending on the source this could be a genuine appeal or satire.... :-D
A bit of both of course ;-)
Quoted 10 lines
In this case, I don't think the ReST changes (with -) make the comment block any less readable in the C files.
Quoted 2 lines
It is an incentive not to use kerneldoc..
I like the kerneldoc if for no other reason that it helps keeps formatting consistent. I would object if I started seeing XML or some other horrible formatting style showing up in the code, but this honestly seems like a fairly minimal imposition... but that's me.
Well, I don't mind the '-' thing before return values too much, but the below chunk is just pure drivel. It makes a perfectly good comment worse.
kernel/locking/mutex.c +4 -2
@@ -227,9 +227,11 @@ static void __sched __mutex_lock_slowpath(struct mutex *lock);* (or statically defined) before it can be locked. memset()-ing * the mutex to 0 is not allowed. * -* ( The CONFIG_DEBUG_MUTEXES .config option turns on debugging +* .. note:: +* +* The CONFIG_DEBUG_MUTEXES .config option turns on debugging * checks that will enforce the restrictions and will also do -* deadlock debugging. ) +* deadlock debugging. * * This function is similar to (but not equivalent to) down(). */
Re: [PATCH 28/36] docs-rst: convert s390-drivers DocBook to ReST
In reply to Mauro Carvalho ChehabQuoted 4 lines · On Fri, 12 May 2017 11:00:11 -0300 Mauro Carvalho Chehab…
Use pandoc to convert documentation to ReST by calling
Documentation/sphinx/tmplcvtscript.Signed-off-by Mauro Carvalho Chehab <[email protected]>
Quoted 8 lines
--- Documentation/DocBook/Makefile | 2 +- Documentation/DocBook/s390-drivers.tmpl | 161 ------------------------------ Documentation/driver-api/index.rst | 1 + Documentation/driver-api/s390-drivers.rst | 111 ++++++++++++++++++++ 4 files changed, 113 insertions(+), 162 deletions(-) delete mode 100644 Documentation/DocBook/s390-drivers.tmpl create mode 100644 Documentation/driver-api/s390-drivers.rst
...but I wonder how good the information in there still is, given that I haven't touched it in ages...
Re: [PATCH 04/36] mutex, futex: adjust kernel-doc markups to generate ReST
In reply to Peter ZijlstraEm Mon, 15 May 2017 09:03:48 +0200
Peter Zijlstra <[email protected]> escreveu:
Quoted 32 lines · Darren Hart
Quoted 7 lines · Peter Zijlstra
Quoted 4 lines
And I really _really_ hate to see that rest crap spread here. Can't we just delete all that nonsense and go back to 80 column 7bit ASCII ?
Depending on the source this could be a genuine appeal or satire.... :-D
A bit of both of course ;-)
Quoted 10 lines
In this case, I don't think the ReST changes (with -) make the comment block any less readable in the C files.
Quoted 2 lines
It is an incentive not to use kerneldoc..
I like the kerneldoc if for no other reason that it helps keeps formatting consistent. I would object if I started seeing XML or some other horrible formatting style showing up in the code, but this honestly seems like a fairly minimal imposition... but that's me.
Well, I don't mind the '-' thing before return values too much, but the below chunk is just pure drivel. It makes a perfectly good comment worse.
kernel/locking/mutex.c +0
-0@@ -227,9 +227,11 @@ static void __sched __mutex_lock_slowpath(struct mutex *lock);* (or statically defined) before it can be locked. memset()-ing * the mutex to 0 is not allowed. *
kernel/locking/mutex.c static void __sched __mutex_lock_slowpath(struct mutex *lock); · line 237
Quoted 10 lines
kernel/locking/mutex.c +4
-2-* ( The CONFIG_DEBUG_MUTEXES .config option turns on debugging +* .. note:: +* +* The CONFIG_DEBUG_MUTEXES .config option turns on debugging * checks that will enforce the restrictions and will also do -* deadlock debugging. ) +* deadlock debugging. * * This function is similar to (but not equivalent to) down(). */
What caused problems with the orignal markup is that Sphinx is highly oriented by indentation: different indentation levels on it cause troubles. A minimal change for it to be parsed would as expected would be to remove the extra spaces that caused Sphinx to misinterpret the paragraph, e. g.:
* ( The CONFIG_DEBUG_MUTEXES .config option turns on debugging
* checks that will enforce the restrictions and will also do
* deadlock debugging. )
But, if the intention of that spaces were to highlight the content inside the parenthesis (with is what I assumed), then the .. note markup will do the job.
That's said, I guess it shouldn't be hard to add something at kernel-doc script to convert some specially-crafted tag (like "Note:") to avoid having ReST notation for this specific case, e. g.:
* Note:
*
* The CONFIG_DEBUG_MUTEXES .config option turns on debugging
* checks that will enforce the restrictions and will also do
* deadlock debugging.
Yet, IMHO, we should take some care to avoid adding much translations to it, as, otherwise, we'll end by having two markup languages instead of just one.
Thanks,
Mauro
Peter Zijlstra
maintainerRe: [PATCH 04/36] mutex, futex: adjust kernel-doc markups to generate ReST
Quoted 27 lines · Mauro Carvalho Chehab
Quoted 10 lines
Well, I don't mind the '-' thing before return values too much, but the below chunk is just pure drivel. It makes a perfectly good comment worse.
kernel/locking/mutex.c +0
-0@@ -227,9 +227,11 @@ static void __sched __mutex_lock_slowpath(struct mutex *lock);* (or statically defined) before it can be locked. memset()-ing * the mutex to 0 is not allowed. * kernel/locking/mutex.c static void __sched __mutex_lock_slowpath(struct mutex *lock); · line 237
Quoted 10 lines
kernel/locking/mutex.c +4
-2-* ( The CONFIG_DEBUG_MUTEXES .config option turns on debugging +* .. note:: +* +* The CONFIG_DEBUG_MUTEXES .config option turns on debugging * checks that will enforce the restrictions and will also do -* deadlock debugging. ) +* deadlock debugging. * * This function is similar to (but not equivalent to) down(). */ What caused problems with the orignal markup is that Sphinx is highly oriented by indentation: different indentation levels on it cause troubles. A minimal change for it to be parsed would as expected would be to remove the extra spaces that caused Sphinx to misinterpret the paragraph, e. g.:
Quoted 3 lines
* ( The
CONFIG_DEBUG_MUTEXES.config option turns on debugging
* checks that will enforce the restrictions and will also do
* deadlock debugging. )
That's ugly and doesn't read right either. Also C isn't whitespace sensitive, so I don't feel we should add such brain damaged constraints to our comments.
Quoted 3 lines
But, if the intention of that spaces were to highlight the content inside the parenthesis (with is what I assumed), then the .. note markup will do the job.
The intention is to aid readability. Making comments worse so that some retarded script can generate better html or whatnot is just that, retarded.
Code matters, generated documentation not so much. I'll take a comment that reads well over one that generates pretty html any day.
Quoted 10 lines
That's said, I guess it shouldn't be hard to add something at kernel-doc script to convert some specially-crafted tag (like "Note:") to avoid having ReST notation for this specific case, e. g.:
* Note:
*
* TheCONFIG_DEBUG_MUTEXES.config option turns on debugging
* checks that will enforce the restrictions and will also do
* deadlock debugging.
Quoted 3 lines
Yet, IMHO, we should take some care to avoid adding much translations to it, as, otherwise, we'll end by having two markup languages instead of just one.
I'm all for _no_ markup language.
Re: [PATCH 04/36] mutex, futex: adjust kernel-doc markups to generate ReST
Quoted 6 lines · Peter Zijlstra
The intention is to aid readability. Making comments worse so that some retarded script can generate better html or whatnot is just that, retarded.
Code matters, generated documentation not so much. I'll take a comment that reads well over one that generates pretty html any day.
The deal is that if you start your comments with "/**" they'll be processed with the retarded script to produce pretty html.
For the most part the comments that generate pretty html also read well, and we don't expect or want anyone to go overboard with markup. I don't think it's unreasonable to make small concessions to improve generated documentation for people who care about it even if you don't.
BR,
Jani.
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
Peter Zijlstra
maintainerRe: [PATCH 04/36] mutex, futex: adjust kernel-doc markups to generate ReST
Quoted 8 lines · Jani Nikula
Quoted 6 lines · Peter Zijlstra
The intention is to aid readability. Making comments worse so that some retarded script can generate better html or whatnot is just that, retarded.
Code matters, generated documentation not so much. I'll take a comment that reads well over one that generates pretty html any day.
Quoted 7 lines
The deal is that if you start your comments with "/**" they'll be processed with the retarded script to produce pretty html.
For the most part the comments that generate pretty html also read well, and we don't expect or want anyone to go overboard with markup. I don't think it's unreasonable to make small concessions to improve generated documentation for people who care about it even if you don't.
No. Such a concession has pure negative value. It opens the door to more patches converting this or that comment to be prettier or whatnot. And before you know it there's a Markus like idiot spamming you with dozens of crap patches to prettify the generated crud.
Not to mention that this would mean having to learn this rest crud in order to write these comments.
All things I'm not prepared to do.
I'm all for useful comments, but I see no value _at_all_ in this generated nonsense. The only reason I sometimes use the docbook comment style is because its fairly uniform and the build bot gets you a warning when your function signature no longer matches with the comment. But if you make this painful I'll simply stop using them.
Re: [PATCH 04/36] mutex, futex: adjust kernel-doc markups to generate ReST
Quoted 25 lines · Peter Zijlstra
Quoted 8 lines · Jani Nikula
Quoted 6 lines · Peter Zijlstra
The intention is to aid readability. Making comments worse so that some retarded script can generate better html or whatnot is just that, retarded.
Code matters, generated documentation not so much. I'll take a comment that reads well over one that generates pretty html any day.
Quoted 7 lines
The deal is that if you start your comments with "/**" they'll be processed with the retarded script to produce pretty html.
For the most part the comments that generate pretty html also read well, and we don't expect or want anyone to go overboard with markup. I don't think it's unreasonable to make small concessions to improve generated documentation for people who care about it even if you don't.
No. Such a concession has pure negative value. It opens the door to more patches converting this or that comment to be prettier or whatnot. And before you know it there's a Markus like idiot spamming you with dozens of crap patches to prettify the generated crud.
Not to mention that this would mean having to learn this rest crud in order to write these comments.
Quoted 7 lines
All things I'm not prepared to do.
I'm all for useful comments, but I see no value _at_all_ in this generated nonsense. The only reason I sometimes use the docbook comment style is because its fairly uniform and the build bot gets you a warning when your function signature no longer matches with the comment. But if you make this painful I'll simply stop using them.
I see plenty of value in the generated documentation, but I see zero return on investment in spending any time trying to convince you about any of it.
BR,
Jani.
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
Re: [PATCH 24/36] fs: jbd2: escape a string with special chars on a kernel-doc
In reply to Mauro Carvalho ChehabQuoted 4 lines · Mauro Carvalho Chehab
kernel-doc will try to interpret a
foo()string, except if properly escaped.Signed-off-by Mauro Carvalho Chehab <[email protected]>
Looks good. You can add:
Honza
Quoted 25 lines
--- fs/jbd2/transaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/jbd2/transaction.c +2
-2@@ -1066,10 +1066,10 @@ static bool jbd2_write_access_granted(handle_t *handle, struct buffer_head *bh,* @handle: transaction to add buffer modifications to * @bh: bh to be used for metadata writes * -* Returns an error code or 0 on success. +* Returns: error code or 0 on success. * * In full data journalling mode the buffer may be of type BJ_AsyncData, -* because we're write()ing a buffer which is also part of a shared mapping. +* because we're ``write()ing`` a buffer which is also part of a shared mapping. */ int jbd2_journal_get_write_access (handle_t *handle,struct buffer_head *bh)Signature · 1 line
2.9.3
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Re: [PATCH 19/36] fs: jbd2: make jbd2_journal_start() kernel-doc parseable
In reply to Mauro Carvalho ChehabQuoted 6 lines · Mauro Carvalho Chehab
kernel-doc script expects that a function documentation to be just before the function, otherwise it will be ignored.
So, move the kernel-doc markup to the right place.
Signed-off-by Mauro Carvalho Chehab <[email protected]>
Looks good. You can add:
Honza
Quoted 64 lines
--- fs/jbd2/transaction.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-)fs/jbd2/transaction.c +19
-19@@ -409,25 +409,6 @@ static handle_t *new_handle(int nblocks)return handle; } -/** -* handle_t *jbd2_journal_start() - Obtain a new handle. -* @journal: Journal to start transaction on. -* @nblocks: number of block buffer we might modify -* -* We make sure that the transaction can guarantee at least nblocks of -* modified buffers in the log. We block until the log can guarantee -* that much space. Additionally, if rsv_blocks > 0, we also create another -* handle with rsv_blocks reserved blocks in the journal. This handle is -* is stored in h_rsv_handle. It is not attached to any particular transaction -* and thus doesn't block transaction commit. If the caller uses this reserved -* handle, it has to set h_rsv_handle to NULL as otherwise jbd2_journal_stop() -* on the parent handle will dispose the reserved one. Reserved handle has to -* be converted to a normal handle using jbd2_journal_start_reserved() before -* it can be used. -* -* Return a pointer to a newly allocated handle, or an ERR_PTR() value -* on failure. -*/ handle_t *jbd2__journal_start (journal_t *journal,int nblocks,int rsv_blocks,gfp_t gfp_mask,unsigned int type,unsigned int line_no)@@ -478,6 +459,25 @@ handle_t *jbd2__journal_start(journal_t *journal, int nblocks, int rsv_blocks,EXPORT_SYMBOL (jbd2__journal_start); +/** +* handle_t *jbd2_journal_start() - Obtain a new handle. +* @journal: Journal to start transaction on. +* @nblocks: number of block buffer we might modify +* +* We make sure that the transaction can guarantee at least nblocks of +* modified buffers in the log. We block until the log can guarantee +* that much space. Additionally, if rsv_blocks > 0, we also create another +* handle with rsv_blocks reserved blocks in the journal. This handle is +* is stored in h_rsv_handle. It is not attached to any particular transaction +* and thus doesn't block transaction commit. If the caller uses this reserved +* handle, it has to set h_rsv_handle to NULL as otherwise jbd2_journal_stop() +* on the parent handle will dispose the reserved one. Reserved handle has to +* be converted to a normal handle using jbd2_journal_start_reserved() before +* it can be used. +* +* Return a pointer to a newly allocated handle, or an ERR_PTR() value +* on failure. +*/ handle_t *jbd2_journal_start (journal_t *journal,int nblocks) {return jbd2__journal_start (journal, nblocks,0 ,GFP_NOFS ,0 ,0 );Signature · 1 line
2.9.3
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Re: [PATCH 21/36] fs: locks: Fix some troubles at kernel-doc comments
In reply to Mauro Carvalho ChehabQuoted 56 lines · Mauro Carvalho Chehab
Hi Jeff,
Em Fri, 12 May 2017 10:02:56 -0400
Jeff Layton <[email protected]> escreveu:Quoted 42 lines · Mauro Carvalho Chehab
Quoted 41 lines
There are a few syntax violations that cause outputs of a few comments to not be properly parsed in ReST format.
No functional changes.
Signed-off-by Mauro Carvalho Chehab <[email protected]>--- fs/locks.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)fs/locks.c +5
-10@@ -1858,8 +1858,8 @@ EXPORT_SYMBOL(generic_setlease);* * Call this to establish a lease on the file. The "lease" argument is not * used for F_UNLCK requests and may be NULL. For commands that set or alter -* an existing lease, the (*lease)->fl_lmops->lm_break operation must be set; -* if not, this function will return -ENOLCK (and generate a scary-looking +* an existing lease, the ``(*lease)->fl_lmops->lm_break`` operation must be +* set; if not, this function will return -ENOLCK (and generate a scary-looking * stack trace). * * The "priv" pointer is passed directly to the lm_setup function as-is. It @@ -1972,15 +1972,13 @@ EXPORT_SYMBOL(locks_lock_inode_wait);* @cmd: the type of lock to apply. * * Apply a %FL_FLOCK style lock to an open file descriptor. -* The @cmd can be one of +* The @cmd can be one of: * -* %LOCK_SH -- a shared lock. -* -* %LOCK_EX -- an exclusive lock. -* -* %LOCK_UN -- remove an existing lock. -* -* %LOCK_MAND -- a `mandatory' flock. This exists to emulate Windows Share Modes. +* - %LOCK_SH -- a shared lock. +* - %LOCK_EX -- an exclusive lock. Quoted 8 lines
fs/locks.c EXPORT_SYMBOL(locks_lock_inode_wait); · line 1984
Quoted 6 lines
fs/locks.c +3
-0+* - %LOCK_UN -- remove an existing lock. +* - %LOCK_MAND -- a 'mandatory' flock. +* This exists to emulate Windows Share Modes. * * %LOCK_MAND can be combined with %LOCK_READ or %LOCK_WRITE to allow other * processes read and write access respectively. LGTM. Do you need me or Bruce to pick this one up?
Quoted 3 lines
Feel free to pick it, if it works best for you.
Quoted 1 line
Reviewed-by Jeff Layton <[email protected]>
I'll take it for 4.13. Thanks!
--b.
Re: [PATCH 04/36] mutex, futex: adjust kernel-doc markups to generate ReST
In reply to Peter ZijlstraQuoted 17 lines · Peter Zijlstra
Quoted 8 lines · Jani Nikula
Quoted 6 lines · Peter Zijlstra
The intention is to aid readability. Making comments worse so that some retarded script can generate better html or whatnot is just that, retarded.
Code matters, generated documentation not so much. I'll take a comment that reads well over one that generates pretty html any day.
Quoted 7 lines
The deal is that if you start your comments with "/**" they'll be processed with the retarded script to produce pretty html.
For the most part the comments that generate pretty html also read well, and we don't expect or want anyone to go overboard with markup. I don't think it's unreasonable to make small concessions to improve generated documentation for people who care about it even if you don't.
Quoted 4 lines
No. Such a concession has pure negative value. It opens the door to more patches converting this or that comment to be prettier or whatnot. And before you know it there's a Markus like idiot spamming you with dozens of crap patches to prettify the generated crud.
Well that I can certainly understand.
Quoted 3 lines
Not to mention that this would mean having to learn this rest crud in order to write these comments.
I have complete confidence in you here Peter :-b
Quoted 10 lines
All things I'm not prepared to do.
I'm all for useful comments, but I see no value _at_all_ in this generated nonsense. The only reason I sometimes use the docbook comment style is because its fairly uniform and the build bot gets you a warning when your function signature no longer matches with the comment. But if you make this painful I'll simply stop using them.
Making documentation more accessible to people is a good thing. This type of automated publication reduces the barrier to access. The lack of this kind of tooling, honestly, also discourages participation among some groups of of capable contributors.
That said, I support the direction both Mauro and Peter have voiced to minimize the impact to comment blocks. What does rest do with this formatting it doesn't understand - does it fail gracefully? Falling back to <verbatim> or something like that?
Signature · 2 lines
Darren Hart VMware Open Source Technology Center
Jonathan Corbet
maintainerRe: [PATCH 01/36] docs-rst: convert kernel-hacking to ReST
In reply to Mauro Carvalho ChehabQuoted 6 lines · On Fri, 12 May 2017 10:59:44 -0300 Mauro Carvalho Chehab…
Documentation/DocBook/Makefile | 2 +- Documentation/DocBook/kernel-hacking.tmpl | 1312 ----------------------------- Documentation/conf.py | 2 + Documentation/index.rst | 1 + Documentation/kernel-hacking/conf.py | 10 + Documentation/kernel-hacking/index.rst | 794 +++++++++++++++++
So I was looking at part 3, wondering why I was seeing this material again. If you redo the series, it might be nice to just land it in hacking.rst to begin with and reduce the subsequent churn a little bit.
jon
Jonathan Corbet
maintainerQuoted 15 lines · On Fri, 12 May 2017 10:59:43 -0300 Mauro Carvalho Chehab…
This patch series convert the following books from DocBook to ReST:
- filesystems
- kernel-hacking
- kernel-locking
- kgdb
- libata
- networking
- rapidio
- s390-drivers
- scsi
- w1
- z8530book
Quoted 5 lines
It also adjusts some Sphinx-pedantic errors/warnings on some kernel-doc markups.
I also added some patches here to add PDF output for all existing ReST books.
So I've been through the series (including digging out the parts that weren't sent to me).
Quoted 2 lines
I did my best to check if what's there is not too outdated, but the best is if the subsystem maintainers could check it.
That has been my real concern with those remaining books; many of them have not been touched in any significant way in at least ten years. Just shoveling a bunch of stuff into RST doesn't really solve the problem that Documentation/ is an unorganized jumble of sometimes highly outdated documentation.
But, then, I guess there's value in having a disorganized jumble that depends on only one fragile toolchain rather than two :) So maybe we should just do this.
I only had one real comment with the series beyond the general stuff here. I see Markus had a few. When the tweaks are done, can you send me a series for the stuff I can apply, and I'll do it?
Thanks,
jon
Re: [PATCH 04/36] mutex, futex: adjust kernel-doc markups to generate ReST
In reply to Peter ZijlstraEm Mon, 15 May 2017 13:49:19 +0200
Peter Zijlstra <[email protected]> escreveu:
Quoted 17 lines · Jani Nikula
Quoted 8 lines · Peter Zijlstra
Quoted 6 lines
The intention is to aid readability. Making comments worse so that some retarded script can generate better html or whatnot is just that, retarded.
Code matters, generated documentation not so much. I'll take a comment that reads well over one that generates pretty html any day.
Quoted 7 lines
The deal is that if you start your comments with "/**" they'll be processed with the retarded script to produce pretty html.
For the most part the comments that generate pretty html also read well, and we don't expect or want anyone to go overboard with markup. I don't think it's unreasonable to make small concessions to improve generated documentation for people who care about it even if you don't.
Quoted 4 lines
No. Such a concession has pure negative value. It opens the door to more patches converting this or that comment to be prettier or whatnot. And before you know it there's a Markus like idiot spamming you with dozens of crap patches to prettify the generated crud.
I see your point. Nobody wants a pile of senseless random prettify patches on their queue. Yet, on the other hand, nobody wants lots of warnings/errors produced when building the Kernel or the documentation, as it can ride important things that would require fixes. So, subsystem maintainers need to find what works best for the subsystems they care of. That's not different than accepting/rejecting a random patch.
That's said, from my side, I don't like the way ReST handle indentation. I would have preferred some markup dialect that would be less sensitive to it. My personal preference were to use docutils or doxygen (but I'm pretty sure they would have other limitations).
Yet, ReST is not a bad choice, as it allows extending its syntax by writing Python scripts and adding to our tree, with has been an interesting feature to extend it to our needs.
Yet, every parser/dialect have limitations. We have to deal with it somehow.
Currently, kernel-doc avoids some indentation issues. For example, in the code code below:
/** *<tab>@v:<tab>foo *<tab><tab>bar ... */
The position of '@v' output, in ReST, would mangle indentation, depending on the way it is converted. Yet, kernel-doc handles it well. So, at least on some cases, kernel-doc works fine with indentation differences, making it transparent to the user. The above produces the following ReST output:
**Parameters** ``v`` foo bar
Both "Parameters" and "v" will be bold; "v" will use a monospaced font[1].
So, at least for most parameter/description indentation, kernel-doc does the right thing.
[1 ] Btw, the *only* way I found on ReST notation to produce a bold
monotonic font is to use:
``foo``
bar
As doing **``foo``** or ``**foo**`` won't work - at least with Sphinx up to version 1.4.
At least on media, some vars are enums, and we want to describe the possible values used at enums, like on this kernel-doc comment snippet:
* Entities have flags that describe the entity capabilities and state:
*
* %MEDIA_ENT_FL_DEFAULT
* indicates the default entity for a given type. * This can be used to report the default audio and video devices or the * default camera sensor.
*
For it to work, kernel-doc should not mangle with whitespaces, passing the indentation to Sphinx.
So, I fail to see a way to avoid fixing the few cases where the indentation doesn't follow what's expected by ReST.
Yet, if you prefer a minimalist change, I can remove the ReST-specific dialect, as in the enclosed patch.
Quoted 11 lines
Not to mention that this would mean having to learn this rest crud in order to write these comments.
All things I'm not prepared to do.
I'm all for useful comments, but I see no value _at_all_ in this generated nonsense. The only reason I sometimes use the docbook comment style is because its fairly uniform and the build bot gets you a warning when your function signature no longer matches with the comment. But if you make this painful I'll simply stop using them.
Thanks,
Mauro
[PATCH v2] mutex, futex: adjust kernel-doc markups to generate ReST
There are a few issues on some kernel-doc markups that was causing troubles with kernel-doc output on ReST format. Fix them.
No functional changes.
include/linux/mutex.h +3 -3
@@ -214,9 +214,9 @@ enum mutex_trylock_recursive_enum {* raisins, and once those are gone this will be removed. * * Returns: -* MUTEX_TRYLOCK_FAILED - trylock failed, -* MUTEX_TRYLOCK_SUCCESS - lock acquired, -* MUTEX_TRYLOCK_RECURSIVE - we already owned the lock. +* - MUTEX_TRYLOCK_FAILED - trylock failed, +* - MUTEX_TRYLOCK_SUCCESS - lock acquired, +* - MUTEX_TRYLOCK_RECURSIVE - we already owned the lock. */ static inline /* __deprecated */ __must_check enum mutex_trylock_recursive_enummutex_trylock_recursive (struct mutex *lock)
kernel/futex.c +20 -20
@@ -488,7 +488,7 @@ static void drop_futex_key_refs(union futex_key *key)* * Return: a negative error code or 0 * -* The key words are stored in *key on success. +* The key words are stored in @key on success. * * For shared mappings, it's (page->index, file_inode(vma->vm_file), * offset_within_page). For private mappings, it's (uaddr, current->mm).
@@ -1259,9 +1259,9 @@ static int lock_pi_update_atomic(u32 __user *uaddr, u32 uval, u32 newval)* @set_waiters: force setting the FUTEX_WAITERS bit (1) or not (0) * * Return: -* 0 - ready to wait; -* 1 - acquired the lock; -* <0 - error +* - 0 - ready to wait; +* - 1 - acquired the lock; +* - <0 - error * * The hb->lock and futex_key refs shall be held by the caller. */
@@ -1717,9 +1717,9 @@ void requeue_pi_wake_futex(struct futex_q *q, union futex_key *key,* hb1 and hb2 must be held by the caller. * * Return: -* 0 - failed to acquire the lock atomically; -* >0 - acquired the lock, return value is vpid of the top_waiter -* <0 - error +* - 0 - failed to acquire the lock atomically; +* - >0 - acquired the lock, return value is vpid of the top_waiter +* - <0 - error */ static int futex_proxy_trylock_atomic(u32 __user *pifutex, struct futex_hash_bucket *hb1,
@@ -1785,8 +1785,8 @@ static int futex_proxy_trylock_atomic(u32 __user *pifutex,* uaddr2 atomically on behalf of the top waiter. * * Return: -* >=0 - on success, the number of tasks requeued or woken; -* <0 - on error +* - >=0 - on success, the number of tasks requeued or woken; +* - <0 - on error */ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, u32 __user *uaddr2, int nr_wake, int nr_requeue,
@@ -2142,8 +2142,8 @@ static inline void queue_me(struct futex_q *q, struct futex_hash_bucket *hb)* be paired with exactly one earlier call to queue_me(). * * Return: -* 1 - if the futex_q was still queued (and we removed unqueued it); -* 0 - if the futex_q was already removed by the waking thread +* - 1 - if the futex_q was still queued (and we removed unqueued it); +* - 0 - if the futex_q was already removed by the waking thread */ static int unqueue_me (struct futex_q *q) {
@@ -2333,9 +2333,9 @@ static long futex_wait_restart(struct restart_block *restart);* acquire the lock. Must be called with the hb lock held. * * Return: -* 1 - success, lock taken; -* 0 - success, lock not taken; -* <0 - on error (-EFAULT) +* - 1 - success, lock taken; +* - 0 - success, lock not taken; +* - <0 - on error (-EFAULT) */ static int fixup_owner (u32 __user *uaddr,struct futex_q *q,int locked) {
@@ -2422,8 +2422,8 @@ static void futex_wait_queue_me(struct futex_hash_bucket *hb, struct futex_q *q,* with no q.key reference on failure. * * Return: -* 0 - uaddr contains val and hb has been locked; -* <1 - -EFAULT or -EWOULDBLOCK (uaddr does not contain val) and hb is unlocked +* - 0 - uaddr contains val and hb has been locked; +* - <1 - -EFAULT or -EWOULDBLOCK (uaddr does not contain val) and hb is unlocked */ static int futex_wait_setup (u32 __user *uaddr,u32 val,unsigned int flags,struct futex_q *q,struct futex_hash_bucket **hb)
@@ -2895,8 +2895,8 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags)* called with the hb lock held. * * Return: -* 0 = no early wakeup detected; -* <0 = -ETIMEDOUT or -ERESTARTNOINTR +* - 0 = no early wakeup detected; +* - <0 = -ETIMEDOUT or -ERESTARTNOINTR */ static inline int handle_early_requeue_pi_wakeup(struct futex_hash_bucket *hb,
@@ -2968,8 +2968,8 @@ int handle_early_requeue_pi_wakeup(struct futex_hash_bucket *hb,* If 4 or 7, we cleanup and return with -ETIMEDOUT. * * Return: -* 0 - On success; -* <0 - On error +* - 0 - On success; +* - <0 - On error */ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, u32 val, ktime_t *abs_time, u32 bitset,
kernel/locking/mutex.c +3 -3
@@ -227,9 +227,9 @@ static void __sched __mutex_lock_slowpath(struct mutex *lock);* (or statically defined) before it can be locked. memset()-ing * the mutex to 0 is not allowed. * -* ( The CONFIG_DEBUG_MUTEXES .config option turns on debugging -* checks that will enforce the restrictions and will also do -* deadlock debugging. ) +* (The CONFIG_DEBUG_MUTEXES .config option turns on debugging +* checks that will enforce the restrictions and will also do +* deadlock debugging) * * This function is similar to (but not equivalent to) down(). */
Em Mon, 15 May 2017 11:11:41 -0600
Jonathan Corbet <[email protected]> escreveu:
Quoted 27 lines
Quoted 15 lines · On Fri, 12 May 2017 10:59:43 -0300 Mauro Carvalho Chehab…
This patch series convert the following books from DocBook to ReST:
- filesystems
- kernel-hacking
- kernel-locking
- kgdb
- libata
- networking
- rapidio
- s390-drivers
- scsi
- w1
- z8530bookQuoted 5 lines
It also adjusts some Sphinx-pedantic errors/warnings on some kernel-doc markups.
I also added some patches here to add PDF output for all existing ReST books.
So I've been through the series (including digging out the parts that weren't sent to me).
Quoted 8 lines
Quoted 2 lines
I did my best to check if what's there is not too outdated, but the best is if the subsystem maintainers could check it.
That has been my real concern with those remaining books; many of them have not been touched in any significant way in at least ten years. Just shoveling a bunch of stuff into RST doesn't really solve the problem that
Documentation/is an unorganized jumble of sometimes highly outdated documentation.
True. Yet, on the checks I did, on the books that have API descriptions, the C domain references still exist. On the books that just have kernel-doc tags, I wouldn't expect any changes there, as the API changes should be, instead, at the C code.
So, I guess that it is not that bad, and, by having them in ReST will make them easier to be updated, as ReST is basically ascii with benefits.
Quoted 7 lines
But, then, I guess there's value in having a disorganized jumble that depends on only one fragile toolchain rather than two :) So maybe we should just do this.
I only had one real comment with the series beyond the general stuff here. I see Markus had a few. When the tweaks are done, can you send me a series for the stuff I can apply, and I'll do it?
Sure, I'm addressing the comments and will send you a new series.
Thanks,
Mauro
Re: [PATCH 28/36] docs-rst: convert s390-drivers DocBook to ReST
In reply to Cornelia HuckEm Mon, 15 May 2017 10:09:40 +0200 Cornelia Huck <[email protected]> escreveu:
Quoted 16 lines
Quoted 4 lines · On Fri, 12 May 2017 11:00:11 -0300 Mauro Carvalho Chehab…
Use pandoc to convert documentation to ReST by calling
Documentation/sphinx/tmplcvtscript.Signed-off-by Mauro Carvalho Chehab <[email protected]>Quoted 8 lines
--- Documentation/DocBook/Makefile | 2 +- Documentation/DocBook/s390-drivers.tmpl | 161 ------------------------------ Documentation/driver-api/index.rst | 1 + Documentation/driver-api/s390-drivers.rst | 111 ++++++++++++++++++++ 4 files changed, 113 insertions(+), 162 deletions(-) delete mode 100644 Documentation/DocBook/s390-drivers.tmpl create mode 100644 Documentation/driver-api/s390-drivers.rst
Quoted 1 line
Acked-by Cornelia Huck <[email protected]>
Thanks!
Quoted 3 lines
...but I wonder how good the information in there still is, given that I haven't touched it in ages...
The text inside it is just a brief description of s390 specifics, but the real API descriptions are inside those files:
.. kernel-doc:: arch/s390/include/asm/cio.h
.. kernel-doc:: arch/s390/include/asm/ccwdev.h
.. kernel-doc:: drivers/s390/cio/device.c
.. kernel-doc:: drivers/s390/cio/device_ops.c
.. kernel-doc:: arch/s390/include/asm/cmb.h
.. kernel-doc:: drivers/s390/cio/cmf.c
.. kernel-doc:: arch/s390/include/asm/ccwgroup.h
.. kernel-doc:: drivers/s390/cio/ccwgroup.c
.. kernel-doc:: drivers/s390/cio/airq.c
Those 9 files seem to have been updated lately:
$ git log arch/s390/include/asm/cio.h arch/s390/include/asm/ccwdev.h drivers/s390/cio/device.c drivers/s390/cio/device_ops.c arch/s390/include/asm/cmb.h drivers/s390/cio/cmf.c arch/s390/include/asm/ccwgroup.h drivers/s390/cio/ccwgroup.c drivers/s390/cio/airq.c|grep Date Date: Fri Mar 17 04:17:42 2017 +0100 Date: Thu Feb 2 19:15:33 2017 +0100 Date: Thu Jan 12 18:53:56 2017 +0100 Date: Sun Oct 30 16:37:24 2016 -0400 Date: Fri Jul 29 10:43:53 2016 +0200 Date: Thu Jun 23 11:09:26 2016 +0200 Date: Tue Jul 12 19:57:57 2016 +0200 Date: Mon Jun 20 14:03:38 2016 +0200 Date: Tue May 31 09:09:57 2016 +0200 Date: Thu Mar 3 20:49:57 2016 -0800 Date: Fri Dec 18 12:59:36 2015 +0100 Date: Mon Jun 29 18:39:54 2015 +0200 Date: Mon Oct 26 12:38:13 2015 +0100 Date: Mon Oct 26 12:35:06 2015 +0100 Date: Mon Sep 21 18:40:33 2015 +0200 ...
So, I guess that what's there is still valid.
Yet, on a quick grep:
$ git grep -l "/\*\*" drivers/s390/|wc -l 91
So, it seems that only 10% of the kernel-doc markups are actually documented :-)
Perhaps you could add the missing files there after this patch ;-)
Thanks,
Mauro
Re: [PATCH 04/36] mutex, futex: adjust kernel-doc markups to generate ReST
In reply to Darren HartEm Mon, 15 May 2017 09:40:44 -0700
Darren Hart <[email protected]> escreveu:
Quoted 47 lines · Peter Zijlstra
Quoted 17 lines · Jani Nikula
Quoted 8 lines · Peter Zijlstra
Quoted 6 lines
The intention is to aid readability. Making comments worse so that some retarded script can generate better html or whatnot is just that, retarded.
Code matters, generated documentation not so much. I'll take a comment that reads well over one that generates pretty html any day.
Quoted 7 lines
The deal is that if you start your comments with "/**" they'll be processed with the retarded script to produce pretty html.
For the most part the comments that generate pretty html also read well, and we don't expect or want anyone to go overboard with markup. I don't think it's unreasonable to make small concessions to improve generated documentation for people who care about it even if you don't.
Quoted 4 lines
No. Such a concession has pure negative value. It opens the door to more patches converting this or that comment to be prettier or whatnot. And before you know it there's a Markus like idiot spamming you with dozens of crap patches to prettify the generated crud.
Well that I can certainly understand.
Quoted 3 lines
Not to mention that this would mean having to learn this rest crud in order to write these comments.
I have complete confidence in you here Peter :-b
Quoted 10 lines
All things I'm not prepared to do.
I'm all for useful comments, but I see no value _at_all_ in this generated nonsense. The only reason I sometimes use the docbook comment style is because its fairly uniform and the build bot gets you a warning when your function signature no longer matches with the comment. But if you make this painful I'll simply stop using them.
Making documentation more accessible to people is a good thing. This type of automated publication reduces the barrier to access. The lack of this kind of tooling, honestly, also discourages participation among some groups of of capable contributors.
Quoted 4 lines
That said, I support the direction both Mauro and Peter have voiced to minimize the impact to comment blocks. What does rest do with this formatting it doesn't understand - does it fail gracefully? Falling back to <verbatim> or something like that?
ReST produces a warning or error if it finds something it can't parse, but it usually doesn't crash. The result of its output usually is not what you would expect on such cases, though.
So, IMHO, the bare minimum to do is to make sure that it won't produce errors/warnings.
PS.: kernel-doc itself also produce errors/warnings, if the vars at the kernel-doc block don't match the ones at the function or if a documented function was added or removed.
-
That's said, on the subsystems I maintain, I'm not satisfied with the bare minimum ;) I usually build the html output and look into it to be sure that the output from kernel-doc also looks nice.
In the case of the media subsystem, we have a big book describing the userspace API. Non-eventual media developers read the uAPI docs in html or pdf for API docs before coding.
So, on media subsysem, we ended by adding a few ReST specific markups[1] where added, in order to improve its readability in html/pdf, but the main documentation just use what's specified at Documentation/doc-guide/kernel-doc.rst.
[1] There aren't much such markups used there. As far as I remember, we use:
- bulleted lists like:
return:
- value 1
- value 2
...
- **bold** when we need to bold something;
- ``literal`` for complex literal strings that %FOO won't handle (e. g. when it contains space and/or special chars);
- ".. note::" or ".. attention::" in order to bold important notes, when some function have special requirements to be called (for example, the need to lock or unlock some mutex or spin lock before calling it).
For example, the description for "v4l2_ctrl_handler_init_class" at:
http://www.infradead.org/~mchehab/kernel_docs/media/kapi/v4l2-controls.html
uses an attention markup that bolds that such function should not be called directly by API clients.
Thanks,
Mauro
Peter Zijlstra
maintainerRe: [PATCH 04/36] mutex, futex: adjust kernel-doc markups to generate ReST
In reply to Mauro Carvalho ChehabQuoted 3 lines · Mauro Carvalho Chehab
Yet, on the other hand, nobody wants lots of warnings/errors
produced when building the Kernel or the documentation, as it can ride important things that would require fixes.
So would that actually generate a warn/error? Or just generate weird output?
Because I'm perfectly fine with weird output.
Our primary interface to the code is a text editor, and things should be readable in that form. Anything that detracts from that is a fail.
If people like to use web browsers (I don't) then I won't stop them, but they have to realize they're the odd ducks out for viewing things outside its native form.
Quoted 20 lines
kernel/locking/mutex.c +3
-3@@ -227,9 +227,9 @@ static void __sched __mutex_lock_slowpath(struct mutex *lock);* (or statically defined) before it can be locked. memset()-ing * the mutex to 0 is not allowed. * -* ( The CONFIG_DEBUG_MUTEXES .config option turns on debugging -* checks that will enforce the restrictions and will also do -* deadlock debugging. ) +* (The CONFIG_DEBUG_MUTEXES .config option turns on debugging +* checks that will enforce the restrictions and will also do +* deadlock debugging) * * This function is similar to (but not equivalent to) down(). */
Re: [PATCH 04/36] mutex, futex: adjust kernel-doc markups to generate ReST
Em Tue, 16 May 2017 13:16:56 +0200
Peter Zijlstra <[email protected]> escreveu:
Quoted 7 lines · Mauro Carvalho Chehab
Quoted 3 lines
Yet, on the other hand, nobody wants lots of warnings/errors
produced when building the Kernel or the documentation, as it can ride important things that would require fixes.So would that actually generate a warn/error? Or just generate weird output?
Both warn/error and weird output. From my side, the only reason for writing this patch is to fix the warnings that would otherwise be produced without it:
./kernel/futex.c:492: WARNING: Inline emphasis start-string without end-string. ./kernel/futex.c:1264: WARNING: Block quote ends without a blank line; unexpected unindent. ./kernel/futex.c:1721: WARNING: Block quote ends without a blank line; unexpected unindent. ./kernel/futex.c:2338: WARNING: Block quote ends without a blank line; unexpected unindent. ./kernel/futex.c:2426: WARNING: Block quote ends without a blank line; unexpected unindent. ./kernel/futex.c:2899: WARNING: Block quote ends without a blank line; unexpected unindent. ./kernel/futex.c:2972: WARNING: Block quote ends without a blank line; unexpected unindent.
Quoted 22 lines
Because I'm perfectly fine with weird output.
Our primary interface to the code is a text editor, and things should be readable in that form. Anything that detracts from that is a fail.
If people like to use web browsers (I don't) then I won't stop them, but they have to realize they're the odd ducks out for viewing things outside its native form.
Quoted 12 lines
kernel/locking/mutex.c +1
-3@@ -227,9 +227,9 @@ static void __sched __mutex_lock_slowpath(struct mutex *lock);* (or statically defined) before it can be locked. memset()-ing * the mutex to 0 is not allowed. * -* ( The CONFIG_DEBUG_MUTEXES .config option turns on debugging -* checks that will enforce the restrictions and will also do -* deadlock debugging. ) +* (The CONFIG_DEBUG_MUTEXES .config option turns on debugging
Quoted 8 lines
kernel/locking/mutex.c static void __sched __mutex_lock_slowpath(struct mutex *lock); · line 235
Quoted 8 lines
kernel/locking/mutex.c +2
-0+* checks that will enforce the restrictions and will also do +* deadlock debugging) * * This function is similar to (but not equivalent to) down(). */
Thanks,
Mauro