Skip to contentSkip to conversation

Include linux PCI docs into Sphinx TOC tree

PATCH Superseded Changbin Du 3 participants 20 messages Mar 29, 2019 – Apr 3, 2019

Subsystems (5)

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

cover Include linux PCI docs into Sphinx TOC tree

Hi Corbet,
I also did the conversion for PCI documentation. Please check, Thanks!

The kernel now uses Sphinx to generate intelligent and beautiful documentation from reStructuredText files. I converted most of the Linux PCI docs to rst format in this serias.

For you to preview, please visit below url:
http://104.238.181.70:8080/kernel-doc/PCI/index.html

Thank you!

Changbin Du (12):
Documentation: add Linux PCI to Sphinx TOC tree
pci doc: convert PCI/pci.txt to rst format
pci doc: convert PCI/PCIEBUS-HOWTO.txt to rst format pci doc: convert PCI/pci-iov-howto.txt to rst format pci doc: convert PCI/MSI-HOWTO.txt to rst format
pci doc: convert PCI/acpi-info.txt to rst format
pci doc: convert PCI/pci-error-recovery.txt to rst format pci doc: convert PCI/pcieaer-howto.txt to rst format pci doc: convert PCI/endpoint/pci-endpoint.txt to rst format pci doc: convert PCI/endpoint/pci-endpoint-cfs.txt to rst format pci doc: convert PCI/endpoint/pci-test-function.txt to rst format pci doc: convert PCI/endpoint/pci-test-howto.txt to rst format

 .../PCI/{MSI-HOWTO.txt => MSI-HOWTO.rst}      |  56 +++--
 .../{PCIEBUS-HOWTO.txt => PCIEBUS-HOWTO.rst}  | 112 +++++----
 .../PCI/{acpi-info.txt => acpi-info.rst}      |  11 +-
 Documentation/PCI/endpoint/index.rst          |  13 ++
 ...-endpoint-cfs.txt => pci-endpoint-cfs.rst} |  99 ++++----
 .../{pci-endpoint.txt => pci-endpoint.rst}    |  74 +++---
 ...est-function.txt => pci-test-function.rst} |  32 +--
 ...{pci-test-howto.txt => pci-test-howto.rst} |  51 ++--
 Documentation/PCI/index.rst                   |  17 ++
 ...or-recovery.txt => pci-error-recovery.rst} | 180 ++++++++-------
 .../{pci-iov-howto.txt => pci-iov-howto.rst}  | 144 +++++++-----
 Documentation/PCI/{pci.txt => pci.rst}        | 218 +++++++++---------
 .../{pcieaer-howto.txt => pcieaer-howto.rst}  |  67 ++++--
 Documentation/index.rst                       |   1 +
 MAINTAINERS                                   |   2 +-
 15 files changed, 641 insertions(+), 436 deletions(-)
 rename Documentation/PCI/{MSI-HOWTO.txt => MSI-HOWTO.rst} (89%)
 rename Documentation/PCI/{PCIEBUS-HOWTO.txt => PCIEBUS-HOWTO.rst} (75%)
 rename Documentation/PCI/{acpi-info.txt => acpi-info.rst} (97%)
 create mode 100644 Documentation/PCI/endpoint/index.rst
 rename Documentation/PCI/endpoint/{pci-endpoint-cfs.txt => pci-endpoint-cfs.rst} (64%)
 rename Documentation/PCI/endpoint/{pci-endpoint.txt => pci-endpoint.rst} (86%)
 rename Documentation/PCI/endpoint/{pci-test-function.txt => pci-test-function.rst} (84%)
 rename Documentation/PCI/endpoint/{pci-test-howto.txt => pci-test-howto.rst} (83%)
 create mode 100644 Documentation/PCI/index.rst
 rename Documentation/PCI/{pci-error-recovery.txt => pci-error-recovery.rst} (80%)
 rename Documentation/PCI/{pci-iov-howto.txt => pci-iov-howto.rst} (65%)
 rename Documentation/PCI/{pci.txt => pci.rst} (80%)
 rename Documentation/PCI/{pcieaer-howto.txt => pcieaer-howto.rst} (83%)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/12 Documentation: add Linux PCI to Sphinx TOC tree

Add a index.rst for PCI subsystem. More docs will be added later.

---
 Documentation/PCI/index.rst | 8 ++++++++
 Documentation/index.rst     | 1 +
 2 files changed, 9 insertions(+)
 create mode 100644 Documentation/PCI/index.rst
Documentation/PCI/index.rst new file +8 -0
new file mode 100644
index 000000000000..11096447f535
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+=======================
+Linux PCI Bus Subsystem
+=======================
+
+.. toctree::
+   :maxdepth: 2
Documentation/index.rst +1 -0
index e3aa28275894..35fc03526b3b 100644
@@ -91,6 +91,7 @@ needed).
    vm/index
    bpf/index
    acpi/index
+   PCI/index
    misc-devices/index
 
 Architecture-specific documentation
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/12 pci doc: convert PCI/pci.txt to rst format

In reply to Changbin Du

This converts the plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change.

---
 Documentation/PCI/index.rst            |   2 +
 Documentation/PCI/{pci.txt => pci.rst} | 218 +++++++++++++------------
 2 files changed, 116 insertions(+), 104 deletions(-)
 rename Documentation/PCI/{pci.txt => pci.rst} (80%)
Documentation/PCI/index.rst +2 -0
index 11096447f535..06fce3d3c7da 100644
@@ -6,3 +6,5 @@ Linux PCI Bus Subsystem
 
 .. toctree::
    :maxdepth: 2
+
+   pci
Documentation/PCI/pci.rst renamed from Documentation/PCI/pci.txt +114 -104

476 lines not on this page · raw message

Signature · 1 line
2.20.1
#3 lore raw

PATCH 3/12 pci doc: convert PCI/PCIEBUS-HOWTO.txt to rst format

In reply to Changbin Du

This converts the plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change.

---
 .../{PCIEBUS-HOWTO.txt => PCIEBUS-HOWTO.rst}  | 112 +++++++++++-------
 Documentation/PCI/index.rst                   |   1 +
 2 files changed, 68 insertions(+), 45 deletions(-)
 rename Documentation/PCI/{PCIEBUS-HOWTO.txt => PCIEBUS-HOWTO.rst} (75%)
Documentation/PCI/PCIEBUS-HOWTO.rst renamed from Documentation/PCI/PCIEBUS-HOWTO.txt +67 -45
similarity index 75%
rename from Documentation/PCI/PCIEBUS-HOWTO.txt
rename to Documentation/PCI/PCIEBUS-HOWTO.rst
index 15f0bb3b5045..bde6530689a6 100644
@@ -1,16 +1,23 @@
-		The PCI Express Port Bus Driver Guide HOWTO
-	Tom L Nguyen [email protected]
-			11/03/2004
+.. SPDX-License-Identifier: GPL-2.0
+
+===========================================
+The PCI Express Port Bus Driver Guide HOWTO
+===========================================
+
+:Author: Tom L Nguyen [email protected] 11/03/2004
 
 1. About this guide
+===================
 
 This guide describes the basics of the PCI Express Port Bus driver
 and provides information on how to enable the service drivers to
 register/unregister with the PCI Express Port Bus Driver.
 
 2. Copyright 2004 Intel Corporation
+===================================
 
 3. What is the PCI Express Port Bus Driver
+==========================================
 
 A PCI Express Port is a logical PCI-PCI Bridge structure. There
 are two types of PCI Express Port: the Root Port and the Switch
@@ -31,6 +38,7 @@ be handled by a single complex driver or be individually distributed
 and handled by corresponding service drivers.
 
 4. Why use the PCI Express Port Bus Driver?
+===========================================
 
 In existing Linux kernels, the Linux Device Driver Model allows a
 physical device to be handled by only a single driver. The PCI
@@ -51,21 +59,23 @@ PCI Express Ports and distributes all provided service requests
 to the corresponding service drivers as required. Some key
 advantages of using the PCI Express Port Bus driver are listed below:
 
-	- Allow multiple service drivers to run simultaneously on
-	  a PCI-PCI Bridge Port device.
+  - Allow multiple service drivers to run simultaneously on
+    a PCI-PCI Bridge Port device.
 
-	- Allow service drivers implemented in an independent
-	  staged approach.
+  - Allow service drivers implemented in an independent
+    staged approach.
 
-	- Allow one service driver to run on multiple PCI-PCI Bridge
-	  Port devices.
+  - Allow one service driver to run on multiple PCI-PCI Bridge
+    Port devices.
 
-	- Manage and distribute resources of a PCI-PCI Bridge Port
-	  device to requested service drivers.
+  - Manage and distribute resources of a PCI-PCI Bridge Port
+    device to requested service drivers.
 
 5. Configuring the PCI Express Port Bus Driver vs. Service Drivers
+==================================================================
 
 5.1 Including the PCI Express Port Bus Driver Support into the Kernel
+---------------------------------------------------------------------
 
 Including the PCI Express Port Bus driver depends on whether the PCI
 Express support is included in the kernel config. The kernel will
@@ -73,6 +83,7 @@ automatically include the PCI Express Port Bus driver as a kernel
 driver when the PCI Express support is enabled in the kernel.
 
 5.2 Enabling Service Driver Support
+-----------------------------------
 
 PCI device drivers are implemented based on Linux Device Driver Model.
 All service drivers are PCI device drivers. As discussed above, it is
@@ -90,8 +101,10 @@ Failure to do so will result an identity mismatch, which prevents
 the PCI Express Port Bus driver from loading a service driver.
 
 5.2.1 pcie_port_service_register
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+::
 
-int pcie_port_service_register(struct pcie_port_service_driver *new)
+  int pcie_port_service_register(struct pcie_port_service_driver *new)
 
 This API replaces the Linux Driver Model's pci_register_driver API. A
 service driver should always calls pcie_port_service_register at
@@ -100,68 +113,75 @@ such as pci_enable_device(dev) and pci_set_master(dev) are no longer
 necessary since these calls are executed by the PCI Port Bus driver.
 
 5.2.2 pcie_port_service_unregister
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+::
 
-void pcie_port_service_unregister(struct pcie_port_service_driver *new)
+  void pcie_port_service_unregister(struct pcie_port_service_driver *new)
 
 pcie_port_service_unregister replaces the Linux Driver Model's
 pci_unregister_driver. It's always called by service driver when a
 module exits.
 
 5.2.3 Sample Code
+~~~~~~~~~~~~~~~~~
 
 Below is sample service driver code to initialize the port service
 driver data structure.
+::
 
-static struct pcie_port_service_id service_id[] = { {
-	.vendor = PCI_ANY_ID,
-	.device = PCI_ANY_ID,
-	.port_type = PCIE_RC_PORT,
-	.service_type = PCIE_PORT_SERVICE_AER,
-	}, { /* end: all zeroes */ }
-};
+  static struct pcie_port_service_id service_id[] = { {
+    .vendor = PCI_ANY_ID,
+    .device = PCI_ANY_ID,
+    .port_type = PCIE_RC_PORT,
+    .service_type = PCIE_PORT_SERVICE_AER,
+    }, { /* end: all zeroes */ }
+  };
 
-static struct pcie_port_service_driver root_aerdrv = {
-	.name		= (char *)device_name,
-	.id_table	= &service_id[0],
+  static struct pcie_port_service_driver root_aerdrv = {
+    .name		= (char *)device_name,
+    .id_table	= &service_id[0],
 
-	.probe		= aerdrv_load,
-	.remove		= aerdrv_unload,
+    .probe		= aerdrv_load,
+    .remove		= aerdrv_unload,
 
-	.suspend	= aerdrv_suspend,
-	.resume		= aerdrv_resume,
-};
+    .suspend	= aerdrv_suspend,
+    .resume		= aerdrv_resume,
+  };
 
 Below is a sample code for registering/unregistering a service
 driver.
+::
 
-static int __init aerdrv_service_init(void)
-{
-	int retval = 0;
+  static int __init aerdrv_service_init(void)
+  {
+    int retval = 0;
 
-	retval = pcie_port_service_register(&root_aerdrv);
-	if (!retval) {
-		/*
-		 * FIX ME
-		 */
-	}
-	return retval;
-}
+    retval = pcie_port_service_register(&root_aerdrv);
+    if (!retval) {
+      /*
+      * FIX ME
+      */
+    }
+    return retval;
+  }
 
-static void __exit aerdrv_service_exit(void)
-{
-	pcie_port_service_unregister(&root_aerdrv);
-}
+  static void __exit aerdrv_service_exit(void)
+  {
+    pcie_port_service_unregister(&root_aerdrv);
+  }
 
-module_init(aerdrv_service_init);
-module_exit(aerdrv_service_exit);
+  module_init(aerdrv_service_init);
+  module_exit(aerdrv_service_exit);
 
 6. Possible Resource Conflicts
+==============================
 
 Since all service drivers of a PCI-PCI Bridge Port device are
 allowed to run simultaneously, below lists a few of possible resource
 conflicts with proposed solutions.
 
 6.1 MSI and MSI-X Vector Resource
+---------------------------------
 
 Once MSI or MSI-X interrupts are enabled on a device, it stays in this
 mode until they are disabled again.  Since service drivers of the same
@@ -180,6 +200,7 @@ call request_irq/free_irq. In addition, the interrupt mode is stored
 in the field interrupt_mode of struct pcie_device.
 
 6.3 PCI Memory/IO Mapped Regions
+--------------------------------
 
 Service drivers for PCI Express Power Management (PME), Advanced
 Error Reporting (AER), Hot-Plug (HP) and Virtual Channel (VC) access
@@ -189,6 +210,7 @@ that all service drivers will be well behaved and not overwrite
 other service driver's configuration settings.
 
 6.4 PCI Config Registers
+------------------------
 
 Each service driver runs its PCI config operations on its own
 capability structure except the PCI Express capability structure, in
Documentation/PCI/index.rst +1 -0
index 06fce3d3c7da..58ce08f14f33 100644
@@ -8,3 +8,4 @@ Linux PCI Bus Subsystem
    :maxdepth: 2
 
    pci
+   PCIEBUS-HOWTO
Signature · 1 line
2.20.1
#4 lore raw

PATCH 4/12 pci doc: convert PCI/pci-iov-howto.txt to rst format

In reply to Changbin Du

This converts the plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change.

---
 Documentation/PCI/index.rst                   |   1 +
 .../{pci-iov-howto.txt => pci-iov-howto.rst}  | 144 ++++++++++--------
 2 files changed, 85 insertions(+), 60 deletions(-)
 rename Documentation/PCI/{pci-iov-howto.txt => pci-iov-howto.rst} (65%)
Documentation/PCI/index.rst +1 -0
index 58ce08f14f33..751cd8f23c62 100644
@@ -9,3 +9,4 @@ Linux PCI Bus Subsystem
 
    pci
    PCIEBUS-HOWTO
+   pci-iov-howto
Documentation/PCI/pci-iov-howto.rst renamed from Documentation/PCI/pci-iov-howto.txt +84 -60

210 lines not on this page · raw message

Signature · 1 line
2.20.1
#5 lore raw

PATCH 5/12 pci doc: convert PCI/MSI-HOWTO.txt to rst format

In reply to Changbin Du

This converts the plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change.

---
 .../PCI/{MSI-HOWTO.txt => MSI-HOWTO.rst}      | 56 ++++++++++++-------
 Documentation/PCI/index.rst                   |  1 +
 2 files changed, 38 insertions(+), 19 deletions(-)
 rename Documentation/PCI/{MSI-HOWTO.txt => MSI-HOWTO.rst} (89%)
Documentation/PCI/MSI-HOWTO.rst renamed from Documentation/PCI/MSI-HOWTO.txt +37 -19
similarity index 89%
rename from Documentation/PCI/MSI-HOWTO.txt
rename to Documentation/PCI/MSI-HOWTO.rst
index 618e13d5e276..33f382632fdd 100644
@@ -1,13 +1,18 @@
-		The MSI Driver Guide HOWTO
-	Tom L Nguyen [email protected]
-			10/03/2003
-	Revised Feb 12, 2004 by Martine Silbermann
-		email: [email protected]
-	Revised Jun 25, 2004 by Tom L Nguyen
-	Revised Jul  9, 2008 by Matthew Wilcox <[email protected]>
-		Copyright 2003, 2008 Intel Corporation
+.. SPDX-License-Identifier: GPL-2.0
+.. include:: <isonum.txt>
+
+==========================
+The MSI Driver Guide HOWTO
+==========================
+
+:Authors: - Tom L Nguyen <[email protected]> 10/03/2003
+          - Revised Feb 12, 2004 by Martine Silbermann <[email protected]>
+	  - Revised Jun 25, 2004 by Tom L Nguyen
+	  - Revised Jul  9, 2008 by Matthew Wilcox <[email protected]>
+	    Copyright 2003, 2008 Intel Corporation
 
 1. About this guide
+===================
 
 This guide describes the basics of Message Signaled Interrupts (MSIs),
 the advantages of using MSI over traditional interrupt mechanisms, how
@@ -16,6 +21,7 @@ try if a device doesn't support MSIs.
 
 
 2. What are MSIs?
+=================
 
 A Message Signaled Interrupt is a write from the device to a special
 address which causes an interrupt to be received by the CPU.
@@ -30,6 +36,7 @@ a time.
 
 
 3. Why use MSIs?
+================
 
 There are three reasons why using MSIs can give an advantage over
 traditional pin-based interrupts.
@@ -62,6 +69,7 @@ in a network card or each port in a storage controller.
 
 
 4. How to use MSIs
+==================
 
 PCI devices are initialised to use pin-based interrupts.  The device
 driver has to set up the device to use MSI or MSI-X.  Not all machines
@@ -69,6 +77,7 @@ support MSIs correctly, and for those machines, the APIs described below
 will simply fail and the device will continue to use pin-based interrupts.
 
 4.1 Include kernel support for MSIs
+-----------------------------------
 
 To support MSI or MSI-X, the kernel must be built with the CONFIG_PCI_MSI
 option enabled.  This option is only available on some architectures,
@@ -77,13 +86,14 @@ on x86, you must also enable X86_UP_APIC or SMP in order to see the
 CONFIG_PCI_MSI option.
 
 4.2 Using MSI
+-------------
 
 Most of the hard work is done for the driver in the PCI layer.  The driver
 simply has to request that the PCI layer set up the MSI capability for this
 device.
 
 To automatically use MSI or MSI-X interrupt vectors, use the following
-function:
+function::
 
   int pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
 		unsigned int max_vecs, unsigned int flags);
@@ -101,12 +111,12 @@ any possible kind of interrupt.  If the PCI_IRQ_AFFINITY flag is set,
 pci_alloc_irq_vectors() will spread the interrupts around the available CPUs.
 
 To get the Linux IRQ numbers passed to request_irq() and free_irq() and the
-vectors, use the following function:
+vectors, use the following function::
 
   int pci_irq_vector(struct pci_dev *dev, unsigned int nr);
 
 Any allocated resources should be freed before removing the device using
-the following function:
+the following function::
 
   void pci_free_irq_vectors(struct pci_dev *dev);
 
@@ -126,7 +136,7 @@ The typical usage of MSI or MSI-X interrupts is to allocate as many vectors
 as possible, likely up to the limit supported by the device.  If nvec is
 larger than the number supported by the device it will automatically be
 capped to the supported limit, so there is no need to query the number of
-vectors supported beforehand:
+vectors supported beforehand::
 
 	nvec = pci_alloc_irq_vectors(pdev, 1, nvec, PCI_IRQ_ALL_TYPES)
 	if (nvec < 0)
@@ -135,7 +145,7 @@ vectors supported beforehand:
 If a driver is unable or unwilling to deal with a variable number of MSI
 interrupts it can request a particular number of interrupts by passing that
 number to pci_alloc_irq_vectors() function as both 'min_vecs' and
-'max_vecs' parameters:
+'max_vecs' parameters::
 
 	ret = pci_alloc_irq_vectors(pdev, nvec, nvec, PCI_IRQ_ALL_TYPES);
 	if (ret < 0)
@@ -143,14 +153,14 @@ number to pci_alloc_irq_vectors() function as both 'min_vecs' and
 
 The most notorious example of the request type described above is enabling
 the single MSI mode for a device.  It could be done by passing two 1s as
-'min_vecs' and 'max_vecs':
+'min_vecs' and 'max_vecs'::
 
 	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
 	if (ret < 0)
 		goto out_err;
 
 Some devices might not support using legacy line interrupts, in which case
-the driver can specify that only MSI or MSI-X is acceptable:
+the driver can specify that only MSI or MSI-X is acceptable::
 
 	nvec = pci_alloc_irq_vectors(pdev, 1, nvec, PCI_IRQ_MSI | PCI_IRQ_MSIX);
 	if (nvec < 0)
@@ -159,7 +169,7 @@ the driver can specify that only MSI or MSI-X is acceptable:
 4.3 Legacy APIs
 
 The following old APIs to enable and disable MSI or MSI-X interrupts should
-not be used in new code:
+not be used in new code::
 
   pci_enable_msi()		/* deprecated */
   pci_disable_msi()		/* deprecated */
@@ -175,8 +185,10 @@ of vectors we might have to revisit that decision and add a
 pci_nr_irq_vectors() helper that handles MSI and MSI-X transparently.
 
 4.4 Considerations when using MSIs
+----------------------------------
 
 4.4.1 Spinlocks
+~~~~~~~~~~~~~~~
 
 Most device drivers have a per-device spinlock which is taken in the
 interrupt handler.  With pin-based interrupts or a single MSI, it is not
@@ -189,6 +201,7 @@ spin_lock_irqsave() or spin_lock_irq() which disable local interrupts
 and acquire the lock (see Documentation/kernel-hacking/locking.rst).
 
 4.5 How to tell whether MSI/MSI-X is enabled on a device
+--------------------------------------------------------
 
 Using 'lspci -v' (as root) may show some devices with "MSI", "Message
 Signalled Interrupts" or "MSI-X" capabilities.  Each of these capabilities
@@ -197,6 +210,7 @@ or "-" (disabled).
 
 
 5. MSI quirks
+=============
 
 Several PCI chipsets or devices are known not to support MSIs.
 The PCI stack provides three ways to disable MSIs:
@@ -206,6 +220,7 @@ The PCI stack provides three ways to disable MSIs:
 3. on a single device
 
 5.1. Disabling MSIs globally
+----------------------------
 
 Some host chipsets simply don't support MSIs properly.  If we're
 lucky, the manufacturer knows this and has indicated it in the ACPI
@@ -220,6 +235,7 @@ in your best interests to report the problem to [email protected]
 including a full 'lspci -v' so we can add the quirks to the kernel.
 
 5.2. Disabling MSIs below a bridge
+----------------------------------
 
 Some PCI bridges are not able to route MSIs between busses properly.
 In this case, MSIs must be disabled on all devices behind the bridge.
@@ -230,7 +246,7 @@ as the nVidia nForce and Serverworks HT2000).  As with host chipsets,
 Linux mostly knows about them and automatically enables MSIs if it can.
 If you have a bridge unknown to Linux, you can enable
 MSIs in configuration space using whatever method you know works, then
-enable MSIs on that bridge by doing:
+enable MSIs on that bridge by doing::
 
        echo 1 > /sys/bus/pci/devices/$bridge/msi_bus
 
@@ -245,6 +261,7 @@ Again, please notify [email protected] of any bridges that need
 special handling.
 
 5.3. Disabling MSIs on a single device
+--------------------------------------
 
 Some devices are known to have faulty MSI implementations.  Usually this
 is handled in the individual device driver, but occasionally it's necessary
@@ -253,6 +270,7 @@ of MSI.  While this is a convenient workaround for the driver author,
 it is not good practice, and should not be emulated.
 
 5.4. Finding why MSIs are disabled on a device
+----------------------------------------------
 
 From the above three sections, you can see that there are many reasons
 why MSIs may not be enabled for a given device.  Your first step should
@@ -260,8 +278,8 @@ be to examine your dmesg carefully to determine whether MSIs are enabled
 for your machine.  You should also check your .config to be sure you
 have enabled CONFIG_PCI_MSI.
 
-Then, 'lspci -t' gives the list of bridges above a device.  Reading
-/sys/bus/pci/devices/*/msi_bus will tell you whether MSIs are enabled (1)
+Then, 'lspci -t' gives the list of bridges above a device. Reading
+`/sys/bus/pci/devices/*/msi_bus` will tell you whether MSIs are enabled (1)
 or disabled (0).  If 0 is found in any of the msi_bus files belonging
 to bridges between the PCI root and the device, MSIs are disabled.
 
Documentation/PCI/index.rst +1 -0
index 751cd8f23c62..8ed57b9ecfe4 100644
@@ -10,3 +10,4 @@ Linux PCI Bus Subsystem
    pci
    PCIEBUS-HOWTO
    pci-iov-howto
+   MSI-HOWTO
Signature · 1 line
2.20.1
#6 lore raw

Re: [PATCH 05/12] pci doc: convert PCI/MSI-HOWTO.txt to rst format

Quoted 11 lines · Changbin Du
Documentation/PCI/MSI-HOWTO.rst renamed from Documentation/PCI/MSI-HOWTO.txt +2 -8
@@ -1,13 +1,18 @@
-		The MSI Driver Guide HOWTO
-	Tom L Nguyen [email protected]
-			10/03/2003
-	Revised Feb 12, 2004 by Martine Silbermann
-		email: [email protected]
-	Revised Jun 25, 2004 by Tom L Nguyen
-	Revised Jul  9, 2008 by Matthew Wilcox <[email protected]>
-		Copyright 2003, 2008 Intel Corporation
+.. SPDX-License-Identifier: GPL-2.0
+.. include:: <isonum.txt>

Documentation/PCI/MSI-HOWTO.rst line 12

Quoted 10 lines
Documentation/PCI/MSI-HOWTO.rst renamed from Documentation/PCI/MSI-HOWTO.txt +10 -0
+
+==========================
+The MSI Driver Guide HOWTO
+==========================
+
+:Authors: - Tom L Nguyen <[email protected]> 10/03/2003
+          - Revised Feb 12, 2004 by Martine Silbermann <[email protected]>
+	  - Revised Jun 25, 2004 by Tom L Nguyen
+	  - Revised Jul  9, 2008 by Matthew Wilcox <[email protected]>
+	    Copyright 2003, 2008 Intel Corporation

The copyright line doesn't work quite the way it should in the rendered HTML.

It seems to me it should be:

:Copyright: 2003, 2008 Intel Corporation

Tom has used an ambiguous date format; given it appeared in the tree in December 2003, I suspect he's used middle-endian format. It doesn't really seem relevant to have the dates here any more, so we could skip including them. Also, none of these email addresses work, so perhaps just drop those too.

:Authors: Tom L Nguyen; Martine Silbermann; Matthew Wilcox

Documentation/PCI/MSI-HOWTO.rst line 15

Quoted 2 lines
Documentation/PCI/MSI-HOWTO.rst renamed from Documentation/PCI/MSI-HOWTO.txt +1 -0
 1. About this guide
+===================

Should we drop the numbering of sections as part of this conversion? I'd be inclined to.

Documentation/PCI/MSI-HOWTO.rst on x86, you must also enable X86_UP_APIC or SMP in order to see the · line 99

Quoted 13 lines
Documentation/PCI/MSI-HOWTO.rst renamed from Documentation/PCI/MSI-HOWTO.txt +2 -1
 4.2 Using MSI
+-------------
 
 Most of the hard work is done for the driver in the PCI layer.  The driver
 simply has to request that the PCI layer set up the MSI capability for this
 device.
 
 To automatically use MSI or MSI-X interrupt vectors, use the following
-function:
+function::
 
   int pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
 		unsigned int max_vecs, unsigned int flags);

This should really be turned into kernel-doc and moved to pci.h, but that seems like an awfully large amount of work to ask you to do when you're already doing so much to improve the situation.

This is also a really bad document. It has three audiences; people configuring their kernel, people writing device drivers and people trying to debug why their kernel doesn't work. Again, that's not on you to fix, but it's pretty frustrating to see so much good information so badly organised.

#7 lore raw

Re: [PATCH 05/12] pci doc: convert PCI/MSI-HOWTO.txt to rst format

Quoted 29 lines · Matthew Wilcox
Quoted 11 lines · Changbin Du
Documentation/PCI/MSI-HOWTO.rst renamed from Documentation/PCI/MSI-HOWTO.txt +2 -8
@@ -1,13 +1,18 @@
-		The MSI Driver Guide HOWTO
-	Tom L Nguyen [email protected]
-			10/03/2003
-	Revised Feb 12, 2004 by Martine Silbermann
-		email: [email protected]
-	Revised Jun 25, 2004 by Tom L Nguyen
-	Revised Jul  9, 2008 by Matthew Wilcox <[email protected]>
-		Copyright 2003, 2008 Intel Corporation
+.. SPDX-License-Identifier: GPL-2.0
+.. include:: <isonum.txt>

Documentation/PCI/MSI-HOWTO.rst line 12

Quoted 10 lines
Documentation/PCI/MSI-HOWTO.rst renamed from Documentation/PCI/MSI-HOWTO.txt +10 -0
+
+==========================
+The MSI Driver Guide HOWTO
+==========================
+
+:Authors: - Tom L Nguyen <[email protected]> 10/03/2003
+          - Revised Feb 12, 2004 by Martine Silbermann <[email protected]>
+	  - Revised Jun 25, 2004 by Tom L Nguyen
+	  - Revised Jul  9, 2008 by Matthew Wilcox <[email protected]>
+	    Copyright 2003, 2008 Intel Corporation

The copyright line doesn't work quite the way it should in the rendered HTML.

It seems to me it should be:

:Copyright: 2003, 2008 Intel Corporation

Quoted 8 lines

Tom has used an ambiguous date format; given it appeared in the tree in December 2003, I suspect he's used middle-endian format. It doesn't really seem relevant to have the dates here any more, so we could skip including them. Also, none of these email addresses work, so perhaps just drop those too.

:Authors: Tom L Nguyen; Martine Silbermann; Matthew Wilcox

yeah, looks better. Thanks.

Quoted 6 lines

Documentation/PCI/MSI-HOWTO.rst line 15

Quoted 2 lines
Documentation/PCI/MSI-HOWTO.rst renamed from Documentation/PCI/MSI-HOWTO.txt +1 -0
 1. About this guide
+===================

Should we drop the numbering of sections as part of this conversion? I'd be inclined to.

yes, sphix can generate the numbering.

Quoted 18 lines

Documentation/PCI/MSI-HOWTO.rst on x86, you must also enable X86_UP_APIC or SMP in order to see the · line 99

Quoted 13 lines
Documentation/PCI/MSI-HOWTO.rst renamed from Documentation/PCI/MSI-HOWTO.txt +2 -1
 4.2 Using MSI
+-------------
 
 Most of the hard work is done for the driver in the PCI layer.  The driver
 simply has to request that the PCI layer set up the MSI capability for this
 device.
 
 To automatically use MSI or MSI-X interrupt vectors, use the following
-function:
+function::
 
   int pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
 		unsigned int max_vecs, unsigned int flags);

This should really be turned into kernel-doc and moved to pci.h, but that seems like an awfully large amount of work to ask you to do when you're already doing so much to improve the situation.

Quoted 5 lines

This is also a really bad document. It has three audiences; people configuring their kernel, people writing device drivers and people trying to debug why their kernel doesn't work. Again, that's not on you to fix, but it's pretty frustrating to see so much good information so badly organised.

I agree. But content improvment is out of this topic. So I will just do the conversion in this serias.

Signature · 2 lines
Cheers,
Changbin Du
#8 lore raw

Re: [PATCH 05/12] pci doc: convert PCI/MSI-HOWTO.txt to rst format

In reply to Changbin Du

Hi Corbet,
I also plant to convert x86 arch specific docs. And I will merge them into one big serias for reviewing. Please wait for new revison. Thanks!

On Sat, Mar 30, 2019 at 12:04:06AM +0800, Changbin Du wrote

Quoted 242 lines

This converts the plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change.

---
 .../PCI/{MSI-HOWTO.txt => MSI-HOWTO.rst}      | 56 ++++++++++++-------
 Documentation/PCI/index.rst                   |  1 +
 2 files changed, 38 insertions(+), 19 deletions(-)
 rename Documentation/PCI/{MSI-HOWTO.txt => MSI-HOWTO.rst} (89%)
Documentation/PCI/MSI-HOWTO.rst renamed from Documentation/PCI/MSI-HOWTO.txt +37 -19
similarity index 89%
rename from Documentation/PCI/MSI-HOWTO.txt
rename to Documentation/PCI/MSI-HOWTO.rst
index 618e13d5e276..33f382632fdd 100644
@@ -1,13 +1,18 @@
-		The MSI Driver Guide HOWTO
-	Tom L Nguyen [email protected]
-			10/03/2003
-	Revised Feb 12, 2004 by Martine Silbermann
-		email: [email protected]
-	Revised Jun 25, 2004 by Tom L Nguyen
-	Revised Jul  9, 2008 by Matthew Wilcox <[email protected]>
-		Copyright 2003, 2008 Intel Corporation
+.. SPDX-License-Identifier: GPL-2.0
+.. include:: <isonum.txt>
+
+==========================
+The MSI Driver Guide HOWTO
+==========================
+
+:Authors: - Tom L Nguyen <[email protected]> 10/03/2003
+          - Revised Feb 12, 2004 by Martine Silbermann <[email protected]>
+	  - Revised Jun 25, 2004 by Tom L Nguyen
+	  - Revised Jul  9, 2008 by Matthew Wilcox <[email protected]>
+	    Copyright 2003, 2008 Intel Corporation
 
 1. About this guide
+===================
 
 This guide describes the basics of Message Signaled Interrupts (MSIs),
 the advantages of using MSI over traditional interrupt mechanisms, how
@@ -16,6 +21,7 @@ try if a device doesn't support MSIs.
 
 
 2. What are MSIs?
+=================
 
 A Message Signaled Interrupt is a write from the device to a special
 address which causes an interrupt to be received by the CPU.
@@ -30,6 +36,7 @@ a time.
 
 
 3. Why use MSIs?
+================
 
 There are three reasons why using MSIs can give an advantage over
 traditional pin-based interrupts.
@@ -62,6 +69,7 @@ in a network card or each port in a storage controller.
 
 
 4. How to use MSIs
+==================
 
 PCI devices are initialised to use pin-based interrupts.  The device
 driver has to set up the device to use MSI or MSI-X.  Not all machines
@@ -69,6 +77,7 @@ support MSIs correctly, and for those machines, the APIs described below
 will simply fail and the device will continue to use pin-based interrupts.
 
 4.1 Include kernel support for MSIs
+-----------------------------------
 
 To support MSI or MSI-X, the kernel must be built with the CONFIG_PCI_MSI
 option enabled.  This option is only available on some architectures,
@@ -77,13 +86,14 @@ on x86, you must also enable X86_UP_APIC or SMP in order to see the
 CONFIG_PCI_MSI option.
 
 4.2 Using MSI
+-------------
 
 Most of the hard work is done for the driver in the PCI layer.  The driver
 simply has to request that the PCI layer set up the MSI capability for this
 device.
 
 To automatically use MSI or MSI-X interrupt vectors, use the following
-function:
+function::
 
   int pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
 		unsigned int max_vecs, unsigned int flags);
@@ -101,12 +111,12 @@ any possible kind of interrupt.  If the PCI_IRQ_AFFINITY flag is set,
 pci_alloc_irq_vectors() will spread the interrupts around the available CPUs.
 
 To get the Linux IRQ numbers passed to request_irq() and free_irq() and the
-vectors, use the following function:
+vectors, use the following function::
 
   int pci_irq_vector(struct pci_dev *dev, unsigned int nr);
 
 Any allocated resources should be freed before removing the device using
-the following function:
+the following function::
 
   void pci_free_irq_vectors(struct pci_dev *dev);
 
@@ -126,7 +136,7 @@ The typical usage of MSI or MSI-X interrupts is to allocate as many vectors
 as possible, likely up to the limit supported by the device.  If nvec is
 larger than the number supported by the device it will automatically be
 capped to the supported limit, so there is no need to query the number of
-vectors supported beforehand:
+vectors supported beforehand::
 
 	nvec = pci_alloc_irq_vectors(pdev, 1, nvec, PCI_IRQ_ALL_TYPES)
 	if (nvec < 0)
@@ -135,7 +145,7 @@ vectors supported beforehand:
 If a driver is unable or unwilling to deal with a variable number of MSI
 interrupts it can request a particular number of interrupts by passing that
 number to pci_alloc_irq_vectors() function as both 'min_vecs' and
-'max_vecs' parameters:
+'max_vecs' parameters::
 
 	ret = pci_alloc_irq_vectors(pdev, nvec, nvec, PCI_IRQ_ALL_TYPES);
 	if (ret < 0)
@@ -143,14 +153,14 @@ number to pci_alloc_irq_vectors() function as both 'min_vecs' and
 
 The most notorious example of the request type described above is enabling
 the single MSI mode for a device.  It could be done by passing two 1s as
-'min_vecs' and 'max_vecs':
+'min_vecs' and 'max_vecs'::
 
 	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
 	if (ret < 0)
 		goto out_err;
 
 Some devices might not support using legacy line interrupts, in which case
-the driver can specify that only MSI or MSI-X is acceptable:
+the driver can specify that only MSI or MSI-X is acceptable::
 
 	nvec = pci_alloc_irq_vectors(pdev, 1, nvec, PCI_IRQ_MSI | PCI_IRQ_MSIX);
 	if (nvec < 0)
@@ -159,7 +169,7 @@ the driver can specify that only MSI or MSI-X is acceptable:
 4.3 Legacy APIs
 
 The following old APIs to enable and disable MSI or MSI-X interrupts should
-not be used in new code:
+not be used in new code::
 
   pci_enable_msi()		/* deprecated */
   pci_disable_msi()		/* deprecated */
@@ -175,8 +185,10 @@ of vectors we might have to revisit that decision and add a
 pci_nr_irq_vectors() helper that handles MSI and MSI-X transparently.
 
 4.4 Considerations when using MSIs
+----------------------------------
 
 4.4.1 Spinlocks
+~~~~~~~~~~~~~~~
 
 Most device drivers have a per-device spinlock which is taken in the
 interrupt handler.  With pin-based interrupts or a single MSI, it is not
@@ -189,6 +201,7 @@ spin_lock_irqsave() or spin_lock_irq() which disable local interrupts
 and acquire the lock (see Documentation/kernel-hacking/locking.rst).
 
 4.5 How to tell whether MSI/MSI-X is enabled on a device
+--------------------------------------------------------
 
 Using 'lspci -v' (as root) may show some devices with "MSI", "Message
 Signalled Interrupts" or "MSI-X" capabilities.  Each of these capabilities
@@ -197,6 +210,7 @@ or "-" (disabled).
 
 
 5. MSI quirks
+=============
 
 Several PCI chipsets or devices are known not to support MSIs.
 The PCI stack provides three ways to disable MSIs:
@@ -206,6 +220,7 @@ The PCI stack provides three ways to disable MSIs:
 3. on a single device
 
 5.1. Disabling MSIs globally
+----------------------------
 
 Some host chipsets simply don't support MSIs properly.  If we're
 lucky, the manufacturer knows this and has indicated it in the ACPI
@@ -220,6 +235,7 @@ in your best interests to report the problem to [email protected]
 including a full 'lspci -v' so we can add the quirks to the kernel.
 
 5.2. Disabling MSIs below a bridge
+----------------------------------
 
 Some PCI bridges are not able to route MSIs between busses properly.
 In this case, MSIs must be disabled on all devices behind the bridge.
@@ -230,7 +246,7 @@ as the nVidia nForce and Serverworks HT2000).  As with host chipsets,
 Linux mostly knows about them and automatically enables MSIs if it can.
 If you have a bridge unknown to Linux, you can enable
 MSIs in configuration space using whatever method you know works, then
-enable MSIs on that bridge by doing:
+enable MSIs on that bridge by doing::
 
        echo 1 > /sys/bus/pci/devices/$bridge/msi_bus
 
@@ -245,6 +261,7 @@ Again, please notify [email protected] of any bridges that need
 special handling.
 
 5.3. Disabling MSIs on a single device
+--------------------------------------
 
 Some devices are known to have faulty MSI implementations.  Usually this
 is handled in the individual device driver, but occasionally it's necessary
@@ -253,6 +270,7 @@ of MSI.  While this is a convenient workaround for the driver author,
 it is not good practice, and should not be emulated.
 
 5.4. Finding why MSIs are disabled on a device
+----------------------------------------------
 
 From the above three sections, you can see that there are many reasons
 why MSIs may not be enabled for a given device.  Your first step should
@@ -260,8 +278,8 @@ be to examine your dmesg carefully to determine whether MSIs are enabled
 for your machine.  You should also check your .config to be sure you
 have enabled CONFIG_PCI_MSI.
 
-Then, 'lspci -t' gives the list of bridges above a device.  Reading
-/sys/bus/pci/devices/*/msi_bus will tell you whether MSIs are enabled (1)
+Then, 'lspci -t' gives the list of bridges above a device. Reading
+`/sys/bus/pci/devices/*/msi_bus` will tell you whether MSIs are enabled (1)
 or disabled (0).  If 0 is found in any of the msi_bus files belonging
 to bridges between the PCI root and the device, MSIs are disabled.
 
Documentation/PCI/index.rst +1 -0
index 751cd8f23c62..8ed57b9ecfe4 100644
@@ -10,3 +10,4 @@ Linux PCI Bus Subsystem
    pci
    PCIEBUS-HOWTO
    pci-iov-howto
+   MSI-HOWTO
Signature · 1 line
2.20.1
Signature · 2 lines
Cheers,
Changbin Du
#9 lore raw

PATCH 6/12 pci doc: convert PCI/acpi-info.txt to rst format

In reply to Changbin Du

This converts the plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change.

---
 Documentation/PCI/{acpi-info.txt => acpi-info.rst} | 11 ++++++++---
 Documentation/PCI/index.rst                        |  1 +
 2 files changed, 9 insertions(+), 3 deletions(-)
 rename Documentation/PCI/{acpi-info.txt => acpi-info.rst} (97%)
Documentation/PCI/acpi-info.rst renamed from Documentation/PCI/acpi-info.txt +8 -3
similarity index 97%
rename from Documentation/PCI/acpi-info.txt
rename to Documentation/PCI/acpi-info.rst
index 3ffa3b03970e..f7dabb7ca255 100644
@@ -1,4 +1,8 @@
-		ACPI considerations for PCI host bridges
+.. SPDX-License-Identifier: GPL-2.0
+
+========================================
+ACPI considerations for PCI host bridges
+========================================
 
 The general rule is that the ACPI namespace should describe everything the
 OS might use unless there's another way for the OS to find it [1, 2].
@@ -135,8 +139,9 @@ address always corresponds to bus 0, even if the bus range below the bridge
 
     Extended Address Space Descriptor (.4)
     General Flags: Bit [0] Consumer/Producer:
-	1–This device consumes this resource
-	0–This device produces and consumes this resource
+
+        * 1 – This device consumes this resource
+        * 0 – This device produces and consumes this resource
 
 [5] ACPI 6.2, sec 19.6.43:
     ResourceUsage specifies whether the Memory range is consumed by
Documentation/PCI/index.rst +1 -0
index 8ed57b9ecfe4..6e608afa55c1 100644
@@ -11,3 +11,4 @@ Linux PCI Bus Subsystem
    PCIEBUS-HOWTO
    pci-iov-howto
    MSI-HOWTO
+   acpi-info
Signature · 1 line
2.20.1
#10 lore raw

PATCH 7/12 pci doc: convert PCI/pci-error-recovery.txt to rst format

In reply to Changbin Du

This converts the plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change.

---
 Documentation/PCI/index.rst                   |   1 +
 ...or-recovery.txt => pci-error-recovery.rst} | 180 +++++++++---------
 MAINTAINERS                                   |   2 +-
 3 files changed, 96 insertions(+), 87 deletions(-)
 rename Documentation/PCI/{pci-error-recovery.txt => pci-error-recovery.rst} (80%)
Documentation/PCI/index.rst +1 -0
index 6e608afa55c1..e545460f5b3b 100644
@@ -12,3 +12,4 @@ Linux PCI Bus Subsystem
    pci-iov-howto
    MSI-HOWTO
    acpi-info
+   pci-error-recovery
Documentation/PCI/pci-error-recovery.rst renamed from Documentation/PCI/pci-error-recovery.txt +94 -86

236 lines not on this page · raw message

MAINTAINERS +1 -1
index 718890f348d4..994e849d56ef 100644
@@ -11966,7 +11966,7 @@ M:	Sam Bobroff <[email protected]>
 M:	Oliver O'Halloran <[email protected]>
 L:	[email protected]
 S:	Supported
-F:	Documentation/PCI/pci-error-recovery.txt
+F:	Documentation/PCI/pci-error-recovery.rst
 F:	drivers/pci/pcie/aer.c
 F:	drivers/pci/pcie/dpc.c
 F:	drivers/pci/pcie/err.c
Signature · 1 line
2.20.1
#11 lore raw

PATCH 8/12 pci doc: convert PCI/pcieaer-howto.txt to rst format

In reply to Changbin Du

This converts the plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change.

---
 Documentation/PCI/index.rst                   |  1 +
 .../{pcieaer-howto.txt => pcieaer-howto.rst}  | 67 ++++++++++++++-----
 2 files changed, 50 insertions(+), 18 deletions(-)
 rename Documentation/PCI/{pcieaer-howto.txt => pcieaer-howto.rst} (83%)
Documentation/PCI/index.rst +1 -0
index e545460f5b3b..44b7f9ca039e 100644
@@ -13,3 +13,4 @@ Linux PCI Bus Subsystem
    MSI-HOWTO
    acpi-info
    pci-error-recovery
+   pcieaer-howto
Documentation/PCI/pcieaer-howto.rst renamed from Documentation/PCI/pcieaer-howto.txt +49 -18

200 lines not on this page · raw message

Signature · 1 line
2.20.1
#12 lore raw

PATCH 9/12 pci doc: convert PCI/endpoint/pci-endpoint.txt to rst format

In reply to Changbin Du

This converts the plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change.

---
 Documentation/PCI/endpoint/index.rst          | 10 +++
 .../{pci-endpoint.txt => pci-endpoint.rst}    | 74 +++++++++++--------
 Documentation/PCI/index.rst                   |  1 +
 3 files changed, 56 insertions(+), 29 deletions(-)
 create mode 100644 Documentation/PCI/endpoint/index.rst
 rename Documentation/PCI/endpoint/{pci-endpoint.txt => pci-endpoint.rst} (86%)
Documentation/PCI/endpoint/index.rst new file +10 -0
new file mode 100644
index 000000000000..0db4f2fcd7f0
@@ -0,0 +1,10 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+======================
+PCI Endpoint Framework
+======================
+
+.. toctree::
+   :maxdepth: 2
+
+   pci-endpoint
Documentation/PCI/endpoint/pci-endpoint.rst renamed from Documentation/PCI/endpoint/pci-endpoint.txt +45 -29

237 lines not on this page · raw message

Documentation/PCI/index.rst +1 -0
index 44b7f9ca039e..72a0668ccfc4 100644
@@ -14,3 +14,4 @@ Linux PCI Bus Subsystem
    acpi-info
    pci-error-recovery
    pcieaer-howto
+   endpoint/index
Signature · 1 line
2.20.1
#13 lore raw

PATCH 10/12 pci doc: convert PCI/endpoint/pci-endpoint-cfs.txt to rst format

In reply to Changbin Du

This converts the plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change.

---
 Documentation/PCI/endpoint/index.rst          |  1 +
 ...-endpoint-cfs.txt => pci-endpoint-cfs.rst} | 99 +++++++++++--------
 2 files changed, 57 insertions(+), 43 deletions(-)
 rename Documentation/PCI/endpoint/{pci-endpoint-cfs.txt => pci-endpoint-cfs.rst} (64%)
Documentation/PCI/endpoint/index.rst +1 -0
index 0db4f2fcd7f0..3951de9f923c 100644
@@ -8,3 +8,4 @@ PCI Endpoint Framework
    :maxdepth: 2
 
    pci-endpoint
+   pci-endpoint-cfs
Documentation/PCI/endpoint/pci-endpoint-cfs.rst renamed from Documentation/PCI/endpoint/pci-endpoint-cfs.txt +56 -43

142 lines not on this page · raw message

Signature · 1 line
2.20.1
#14 lore raw

PATCH 11/12 pci doc: convert PCI/endpoint/pci-test-function.txt to rst format

In reply to Changbin Du

This converts the plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change.

---
 Documentation/PCI/endpoint/index.rst          |  1 +
 ...est-function.txt => pci-test-function.rst} | 32 +++++++++++--------
 2 files changed, 20 insertions(+), 13 deletions(-)
 rename Documentation/PCI/endpoint/{pci-test-function.txt => pci-test-function.rst} (84%)
Documentation/PCI/endpoint/index.rst +1 -0
index 3951de9f923c..b680a3fc4fec 100644
@@ -9,3 +9,4 @@ PCI Endpoint Framework
 
    pci-endpoint
    pci-endpoint-cfs
+   pci-test-function
Documentation/PCI/endpoint/pci-test-function.rst renamed from Documentation/PCI/endpoint/pci-test-function.txt +19 -13
similarity index 84%
rename from Documentation/PCI/endpoint/pci-test-function.txt
rename to Documentation/PCI/endpoint/pci-test-function.rst
index 5916f1f592bb..be18ec3d1da0 100644
@@ -1,5 +1,10 @@
-				PCI TEST
-		    Kishon Vijay Abraham I <[email protected]>
+.. SPDX-License-Identifier: GPL-2.0
+
+=================
+PCI TEST FUNCTION
+=================
+
+:Author: Kishon Vijay Abraham I <[email protected]>
 
 Traditionally PCI RC has always been validated by using standard
 PCI cards like ethernet PCI cards or USB PCI cards or SATA PCI cards.
@@ -23,30 +28,31 @@ The PCI endpoint test device has the following registers:
 	8) PCI_ENDPOINT_TEST_IRQ_TYPE
 	9) PCI_ENDPOINT_TEST_IRQ_NUMBER
 
-*) PCI_ENDPOINT_TEST_MAGIC
+* PCI_ENDPOINT_TEST_MAGIC
 
 This register will be used to test BAR0. A known pattern will be written
 and read back from MAGIC register to verify BAR0.
 
-*) PCI_ENDPOINT_TEST_COMMAND:
+* PCI_ENDPOINT_TEST_COMMAND:
 
 This register will be used by the host driver to indicate the function
 that the endpoint device must perform.
 
-Bitfield Description:
+Bitfield Description::
+
   Bit 0		: raise legacy IRQ
   Bit 1		: raise MSI IRQ
   Bit 2		: raise MSI-X IRQ
   Bit 3		: read command (read data from RC buffer)
   Bit 4		: write command (write data to RC buffer)
-  Bit 5		: copy command (copy data from one RC buffer to another
-		  RC buffer)
+  Bit 5		: copy command (copy data from one RC buffer to another RC buffer)
 
-*) PCI_ENDPOINT_TEST_STATUS
+* PCI_ENDPOINT_TEST_STATUS
 
 This register reflects the status of the PCI endpoint device.
 
-Bitfield Description:
+Bitfield Description::
+
   Bit 0		: read success
   Bit 1		: read fail
   Bit 2		: write success
@@ -57,17 +63,17 @@ Bitfield Description:
   Bit 7		: source address is invalid
   Bit 8		: destination address is invalid
 
-*) PCI_ENDPOINT_TEST_SRC_ADDR
+* PCI_ENDPOINT_TEST_SRC_ADDR
 
 This register contains the source address (RC buffer address) for the
 COPY/READ command.
 
-*) PCI_ENDPOINT_TEST_DST_ADDR
+* PCI_ENDPOINT_TEST_DST_ADDR
 
 This register contains the destination address (RC buffer address) for
 the COPY/WRITE command.
 
-*) PCI_ENDPOINT_TEST_IRQ_TYPE
+* PCI_ENDPOINT_TEST_IRQ_TYPE
 
 This register contains the interrupt type (Legacy/MSI) triggered
 for the READ/WRITE/COPY and raise IRQ (Legacy/MSI) commands.
@@ -77,7 +83,7 @@ Possible types:
  - MSI		: 1
  - MSI-X	: 2
 
-*) PCI_ENDPOINT_TEST_IRQ_NUMBER
+* PCI_ENDPOINT_TEST_IRQ_NUMBER
 
 This register contains the triggered ID interrupt.
 
Signature · 1 line
2.20.1
#15 lore raw

PATCH 12/12 pci doc: convert PCI/endpoint/pci-test-howto.txt to rst format

In reply to Changbin Du

This converts the plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change.

---
 Documentation/PCI/endpoint/index.rst          |  1 +
 ...{pci-test-howto.txt => pci-test-howto.rst} | 51 +++++++++++++------
 2 files changed, 37 insertions(+), 15 deletions(-)
 rename Documentation/PCI/endpoint/{pci-test-howto.txt => pci-test-howto.rst} (83%)
Documentation/PCI/endpoint/index.rst +1 -0
index b680a3fc4fec..d114ea74b444 100644
@@ -10,3 +10,4 @@ PCI Endpoint Framework
    pci-endpoint
    pci-endpoint-cfs
    pci-test-function
+   pci-test-howto
Documentation/PCI/endpoint/pci-test-howto.rst renamed from Documentation/PCI/endpoint/pci-test-howto.txt +36 -15

144 lines not on this page · raw message

Signature · 1 line
2.20.1
Acked-by on the v1 series
#16 lore raw
In reply to Changbin Du
Quoted 1 line · Changbin Du

Hi Corbet,

Conventional address would be "Hi Jonathan", just FYI.

Quoted 11 lines

I also did the conversion for PCI documentation. Please check, Thanks!

The kernel now uses Sphinx to generate intelligent and beautiful documentation from reStructuredText files. I converted most of the Linux PCI docs to rst format in this serias.

For you to preview, please visit below url:
http://104.238.181.70:8080/kernel-doc/PCI/index.html

Thank you!

Quoted 13 lines

Changbin Du (12):
Documentation: add Linux PCI to Sphinx TOC tree
pci doc: convert PCI/pci.txt to rst format
pci doc: convert PCI/PCIEBUS-HOWTO.txt to rst format pci doc: convert PCI/pci-iov-howto.txt to rst format pci doc: convert PCI/MSI-HOWTO.txt to rst format
pci doc: convert PCI/acpi-info.txt to rst format
pci doc: convert PCI/pci-error-recovery.txt to rst format pci doc: convert PCI/pcieaer-howto.txt to rst format pci doc: convert PCI/endpoint/pci-endpoint.txt to rst format pci doc: convert PCI/endpoint/pci-endpoint-cfs.txt to rst format pci doc: convert PCI/endpoint/pci-test-function.txt to rst format pci doc: convert PCI/endpoint/pci-test-howto.txt to rst format

Thanks for doing all this work!

There's not a real convention yet for subject lines in Documentation/, but I would propose:

Documentation: PCI: Convert pci.txt to reST
Documentation: PCI: Convert endpoint/pci-endpoint.txt to reST

because that at least goes with some recent Documentation/PCI changes and it identifies "reST" as something other than a plain English word (RST or ReST would also work for me).

Quoted 33 lines
 .../PCI/{MSI-HOWTO.txt => MSI-HOWTO.rst}      |  56 +++--
 .../{PCIEBUS-HOWTO.txt => PCIEBUS-HOWTO.rst}  | 112 +++++----
 .../PCI/{acpi-info.txt => acpi-info.rst}      |  11 +-
 Documentation/PCI/endpoint/index.rst          |  13 ++
 ...-endpoint-cfs.txt => pci-endpoint-cfs.rst} |  99 ++++----
 .../{pci-endpoint.txt => pci-endpoint.rst}    |  74 +++---
 ...est-function.txt => pci-test-function.rst} |  32 +--
 ...{pci-test-howto.txt => pci-test-howto.rst} |  51 ++--
 Documentation/PCI/index.rst                   |  17 ++
 ...or-recovery.txt => pci-error-recovery.rst} | 180 ++++++++-------
 .../{pci-iov-howto.txt => pci-iov-howto.rst}  | 144 +++++++-----
 Documentation/PCI/{pci.txt => pci.rst}        | 218 +++++++++---------
 .../{pcieaer-howto.txt => pcieaer-howto.rst}  |  67 ++++--
 Documentation/index.rst                       |   1 +
 MAINTAINERS                                   |   2 +-
 15 files changed, 641 insertions(+), 436 deletions(-)
 rename Documentation/PCI/{MSI-HOWTO.txt => MSI-HOWTO.rst} (89%)
 rename Documentation/PCI/{PCIEBUS-HOWTO.txt => PCIEBUS-HOWTO.rst} (75%)
 rename Documentation/PCI/{acpi-info.txt => acpi-info.rst} (97%)
 create mode 100644 Documentation/PCI/endpoint/index.rst
 rename Documentation/PCI/endpoint/{pci-endpoint-cfs.txt => pci-endpoint-cfs.rst} (64%)
 rename Documentation/PCI/endpoint/{pci-endpoint.txt => pci-endpoint.rst} (86%)
 rename Documentation/PCI/endpoint/{pci-test-function.txt => pci-test-function.rst} (84%)
 rename Documentation/PCI/endpoint/{pci-test-howto.txt => pci-test-howto.rst} (83%)
 create mode 100644 Documentation/PCI/index.rst
 rename Documentation/PCI/{pci-error-recovery.txt => pci-error-recovery.rst} (80%)
 rename Documentation/PCI/{pci-iov-howto.txt => pci-iov-howto.rst} (65%)
 rename Documentation/PCI/{pci.txt => pci.rst} (80%)
 rename Documentation/PCI/{pcieaer-howto.txt => pcieaer-howto.rst} (83%)
Signature · 1 line
2.20.1
#17 lore raw
Quoted 5 lines · Bjorn Helgaas
Quoted 1 line · Changbin Du

Hi Corbet,

Conventional address would be "Hi Jonathan", just FYI.

I know this convention. I said 'Hi Corbet' because I saw the name of email address. Sorry if this is not the case. :)

Quoted 32 lines
Quoted 11 lines

I also did the conversion for PCI documentation. Please check, Thanks!

The kernel now uses Sphinx to generate intelligent and beautiful documentation from reStructuredText files. I converted most of the Linux PCI docs to rst format in this serias.

For you to preview, please visit below url:
http://104.238.181.70:8080/kernel-doc/PCI/index.html

Thank you!

Quoted 13 lines

Changbin Du (12):
Documentation: add Linux PCI to Sphinx TOC tree
pci doc: convert PCI/pci.txt to rst format
pci doc: convert PCI/PCIEBUS-HOWTO.txt to rst format pci doc: convert PCI/pci-iov-howto.txt to rst format pci doc: convert PCI/MSI-HOWTO.txt to rst format
pci doc: convert PCI/acpi-info.txt to rst format
pci doc: convert PCI/pci-error-recovery.txt to rst format pci doc: convert PCI/pcieaer-howto.txt to rst format pci doc: convert PCI/endpoint/pci-endpoint.txt to rst format pci doc: convert PCI/endpoint/pci-endpoint-cfs.txt to rst format pci doc: convert PCI/endpoint/pci-test-function.txt to rst format pci doc: convert PCI/endpoint/pci-test-howto.txt to rst format

Thanks for doing all this work!

There's not a real convention yet for subject lines in Documentation/, but I would propose:

Quoted 7 lines

Documentation: PCI: Convert pci.txt to reST
Documentation: PCI: Convert endpoint/pci-endpoint.txt to reST

because that at least goes with some recent Documentation/PCI changes and it identifies "reST" as something other than a plain English word (RST or ReST would also work for me).

I agree. I am just a little lazy to update all of them this time :) Thanks for your ACK!

Quoted 33 lines
Quoted 33 lines
 .../PCI/{MSI-HOWTO.txt => MSI-HOWTO.rst}      |  56 +++--
 .../{PCIEBUS-HOWTO.txt => PCIEBUS-HOWTO.rst}  | 112 +++++----
 .../PCI/{acpi-info.txt => acpi-info.rst}      |  11 +-
 Documentation/PCI/endpoint/index.rst          |  13 ++
 ...-endpoint-cfs.txt => pci-endpoint-cfs.rst} |  99 ++++----
 .../{pci-endpoint.txt => pci-endpoint.rst}    |  74 +++---
 ...est-function.txt => pci-test-function.rst} |  32 +--
 ...{pci-test-howto.txt => pci-test-howto.rst} |  51 ++--
 Documentation/PCI/index.rst                   |  17 ++
 ...or-recovery.txt => pci-error-recovery.rst} | 180 ++++++++-------
 .../{pci-iov-howto.txt => pci-iov-howto.rst}  | 144 +++++++-----
 Documentation/PCI/{pci.txt => pci.rst}        | 218 +++++++++---------
 .../{pcieaer-howto.txt => pcieaer-howto.rst}  |  67 ++++--
 Documentation/index.rst                       |   1 +
 MAINTAINERS                                   |   2 +-
 15 files changed, 641 insertions(+), 436 deletions(-)
 rename Documentation/PCI/{MSI-HOWTO.txt => MSI-HOWTO.rst} (89%)
 rename Documentation/PCI/{PCIEBUS-HOWTO.txt => PCIEBUS-HOWTO.rst} (75%)
 rename Documentation/PCI/{acpi-info.txt => acpi-info.rst} (97%)
 create mode 100644 Documentation/PCI/endpoint/index.rst
 rename Documentation/PCI/endpoint/{pci-endpoint-cfs.txt => pci-endpoint-cfs.rst} (64%)
 rename Documentation/PCI/endpoint/{pci-endpoint.txt => pci-endpoint.rst} (86%)
 rename Documentation/PCI/endpoint/{pci-test-function.txt => pci-test-function.rst} (84%)
 rename Documentation/PCI/endpoint/{pci-test-howto.txt => pci-test-howto.rst} (83%)
 create mode 100644 Documentation/PCI/index.rst
 rename Documentation/PCI/{pci-error-recovery.txt => pci-error-recovery.rst} (80%)
 rename Documentation/PCI/{pci-iov-howto.txt => pci-iov-howto.rst} (65%)
 rename Documentation/PCI/{pci.txt => pci.rst} (80%)
 rename Documentation/PCI/{pcieaer-howto.txt => pcieaer-howto.rst} (83%)
Signature · 1 line
2.20.1
Signature · 2 lines
Cheers,
Changbin Du
#18 lore raw
Quoted 26 lines · Changbin Du
Quoted 25 lines · Bjorn Helgaas
Quoted 5 lines · Changbin Du

Changbin Du (12):
Documentation: add Linux PCI to Sphinx TOC tree pci doc: convert PCI/pci.txt to rst format pci doc: convert PCI/PCIEBUS-HOWTO.txt to rst format pci doc: convert PCI/pci-iov-howto.txt to rst format

Quoted 8 lines

pci doc: convert PCI/MSI-HOWTO.txt to rst format
pci doc: convert PCI/acpi-info.txt to rst format
pci doc: convert PCI/pci-error-recovery.txt to rst format pci doc: convert PCI/pcieaer-howto.txt to rst format pci doc: convert PCI/endpoint/pci-endpoint.txt to rst format pci doc: convert PCI/endpoint/pci-endpoint-cfs.txt to rst format pci doc: convert PCI/endpoint/pci-test-function.txt to rst format pci doc: convert PCI/endpoint/pci-test-howto.txt to rst format

Thanks for doing all this work!

There's not a real convention yet for subject lines in Documentation/, but I would propose:

Documentation: PCI: Convert pci.txt to reST
Documentation: PCI: Convert endpoint/pci-endpoint.txt to reST

Quoted 6 lines
Quoted 4 lines

because that at least goes with some recent Documentation/PCI changes and it identifies "reST" as something other than a plain English word (RST or ReST would also work for me).

I agree. I am just a little lazy to update all of them this time :) Thanks for your ACK!

Well, I guess I'm too lazy to fix them all for you, so I personally wouldn't apply these. But maybe Jonathan will be more accommodating.

Bjorn

#19 lore raw
Quoted 31 lines · Bjorn Helgaas
Quoted 30 lines · Changbin Du
Quoted 29 lines · Bjorn Helgaas
Quoted 5 lines · Changbin Du

Changbin Du (12):
Documentation: add Linux PCI to Sphinx TOC tree pci doc: convert PCI/pci.txt to rst format pci doc: convert PCI/PCIEBUS-HOWTO.txt to rst format pci doc: convert PCI/pci-iov-howto.txt to rst format

Quoted 8 lines

pci doc: convert PCI/MSI-HOWTO.txt to rst format
pci doc: convert PCI/acpi-info.txt to rst format
pci doc: convert PCI/pci-error-recovery.txt to rst format pci doc: convert PCI/pcieaer-howto.txt to rst format pci doc: convert PCI/endpoint/pci-endpoint.txt to rst format pci doc: convert PCI/endpoint/pci-endpoint-cfs.txt to rst format pci doc: convert PCI/endpoint/pci-test-function.txt to rst format pci doc: convert PCI/endpoint/pci-test-howto.txt to rst format

Thanks for doing all this work!

There's not a real convention yet for subject lines in Documentation/, but I would propose:

Documentation: PCI: Convert pci.txt to reST
Documentation: PCI: Convert endpoint/pci-endpoint.txt to reST

because that at least goes with some recent Documentation/PCI changes and it identifies "reST" as something other than a plain English word (RST or ReST would also work for me).

Quoted 6 lines
Quoted 2 lines

I agree. I am just a little lazy to update all of them this time :) Thanks for your ACK!

Well, I guess I'm too lazy to fix them all for you, so I personally wouldn't apply these. But maybe Jonathan will be more accommodating.

ok, I will fix this serias since they do matter.

Quoted 1 line

Bjorn

Signature · 2 lines
Cheers,
Changbin Du