Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI/P2PDMA: Clean up documentation and kernel-doc

Fix typos, spellos, and grammar in p2pdma.rst and p2pdma.c.

Fix return value(s) in function pci_p2pmem_alloc_sgl().

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Logan Gunthorpe <logang@deltatee.com>
Cc: Jonathan Corbet <corbet@lwn.net>

authored by

Randy Dunlap and committed by
Bjorn Helgaas
fcf9ab35 65102238

+9 -9
+2 -2
Documentation/driver-api/pci/p2pdma.rst
··· 49 49 in that it exposes any CMB (Controller Memory Buffer) as a P2P memory 50 50 resource (provider), it accepts P2P memory pages as buffers in requests 51 51 to be used directly (client) and it can also make use of the CMB as 52 - submission queue entries (orchastrator). 52 + submission queue entries (orchestrator). 53 53 * The RDMA driver is a client in this arrangement so that an RNIC 54 54 can DMA directly to the memory exposed by the NVMe device. 55 55 * The NVMe Target driver (nvmet) can orchestrate the data from the RNIC ··· 111 111 If more than one provider is supported, the one nearest to all the clients will 112 112 be chosen first. If more than one provider is an equal distance away, the 113 113 one returned will be chosen at random (it is not an arbitrary but 114 - truely random). This function returns the PCI device to use for the provider 114 + truly random). This function returns the PCI device to use for the provider 115 115 with a reference taken and therefore when it's no longer needed it should be 116 116 returned with pci_dev_put(). 117 117
+7 -7
drivers/pci/p2pdma.c
··· 422 422 * 423 423 * Returns -1 if any of the clients are not compatible (behind the same 424 424 * root port as the provider), otherwise returns a positive number where 425 - * a lower number is the preferrable choice. (If there's one client 425 + * a lower number is the preferable choice. (If there's one client 426 426 * that's the same as the provider it will return 0, which is best choice). 427 427 * 428 428 * For now, "compatible" means the provider and the clients are all behind ··· 493 493 * @num_clients: number of client devices in the list 494 494 * 495 495 * If multiple devices are behind the same switch, the one "closest" to the 496 - * client devices in use will be chosen first. (So if one of the providers are 496 + * client devices in use will be chosen first. (So if one of the providers is 497 497 * the same as one of the clients, that provider will be used ahead of any 498 498 * other providers that are unrelated). If multiple providers are an equal 499 499 * distance away, one will be chosen at random. ··· 580 580 * pci_free_p2pmem - free peer-to-peer DMA memory 581 581 * @pdev: the device the memory was allocated from 582 582 * @addr: address of the memory that was allocated 583 - * @size: number of bytes that was allocated 583 + * @size: number of bytes that were allocated 584 584 */ 585 585 void pci_free_p2pmem(struct pci_dev *pdev, void *addr, size_t size) 586 586 { ··· 617 617 * @nents: the number of SG entries in the list 618 618 * @length: number of bytes to allocate 619 619 * 620 - * Returns 0 on success 620 + * Return: %NULL on error or &struct scatterlist pointer and @nents on success 621 621 */ 622 622 struct scatterlist *pci_p2pmem_alloc_sgl(struct pci_dev *pdev, 623 623 unsigned int *nents, u32 length) ··· 673 673 * 674 674 * Published memory can be used by other PCI device drivers for 675 675 * peer-2-peer DMA operations. Non-published memory is reserved for 676 - * exlusive use of the device driver that registers the peer-to-peer 676 + * exclusive use of the device driver that registers the peer-to-peer 677 677 * memory. 678 678 */ 679 679 void pci_p2pmem_publish(struct pci_dev *pdev, bool publish) ··· 733 733 * @use_p2pdma: returns whether to enable p2pdma or not 734 734 * 735 735 * Parses an attribute value to decide whether to enable p2pdma. 736 - * The value can select a PCI device (using it's full BDF device 736 + * The value can select a PCI device (using its full BDF device 737 737 * name) or a boolean (in any format strtobool() accepts). A false 738 738 * value disables p2pdma, a true value expects the caller 739 739 * to automatically find a compatible device and specifying a PCI device ··· 784 784 * whether p2pdma is enabled 785 785 * @page: contents of the stored value 786 786 * @p2p_dev: the selected p2p device (NULL if no device is selected) 787 - * @use_p2pdma: whether p2pdme has been enabled 787 + * @use_p2pdma: whether p2pdma has been enabled 788 788 * 789 789 * Attributes that use pci_p2pdma_enable_store() should use this function 790 790 * to show the value of the attribute.