]> git.baikalelectronics.ru Git - kernel.git/commit
PCI/P2PDMA: Finish RCU conversion of pdev->p2pdma
authorEric Dumazet <edumazet@google.com>
Thu, 1 Jul 2021 21:48:23 +0000 (16:48 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 6 Jul 2021 15:56:02 +0000 (10:56 -0500)
commit535bc366f7239915a8e05a50cf5dbb6ee8e830e2
tree5115df95af0c579a2d0e2053fa8243088360cb8e
parent28c5ee20b3e93d959493d1f33fb2f4ca842981f0
PCI/P2PDMA: Finish RCU conversion of pdev->p2pdma

While looking at pci_alloc_p2pmem() I found RCU protection was not properly
applied there, as pdev->p2pdma was potentially read multiple times.

Fix pci_alloc_p2pmem(), add __rcu qualifier to p2pdma field of struct
pci_dev, and fix all other accesses to this field with proper RCU verbs.

Link: https://lore.kernel.org/r/20210701095621.3129283-1-eric.dumazet@gmail.com
Fixes: 33d90695b467 ("PCI/P2PDMA: track pgmap references per resource, not globally")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Jérôme Glisse" <jglisse@redhat.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
drivers/pci/p2pdma.c
include/linux/pci.h