From d01c738d46c186bd58b9314d348e5897ef1fd344 Mon Sep 17 00:00:00 2001 From: Nikita Yushchenko Date: Sun, 24 Jun 2018 17:56:22 +0300 Subject: [PATCH 005/122] Revert "PCI: rcar-pcie: Add bus notifier so we can limit the dma range" This reverts commit 56c039c504f32e68e2e8decbf01ea34d7f7ee03e. Resetting dma_mask this way is racy. If driver configures 64-bit dma_mask in it's probe method and then immediately issues I/O, this will be handled with dma_mask set to 64-bit. Thus different workaround is needed, and this workaround must be reverted. Signed-off-by: Nikita Yushchenko --- drivers/pci/host/pcie-rcar.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c index 3679e8e..46b2622 100644 --- a/drivers/pci/host/pcie-rcar.c +++ b/drivers/pci/host/pcie-rcar.c @@ -1377,31 +1377,3 @@ static struct platform_driver rcar_pcie_driver = { .probe = rcar_pcie_probe, }; builtin_platform_driver(rcar_pcie_driver); - -static int rcar_pcie_pci_notifier(struct notifier_block *nb, - unsigned long action, void *data) -{ - struct device *dev = data; - - switch (action) { - case BUS_NOTIFY_BOUND_DRIVER: - /* Force the DMA mask to lower 32-bits */ - dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32)); - break; - default: - return NOTIFY_DONE; - } - - return NOTIFY_OK; -} - -static struct notifier_block device_nb = { - .notifier_call = rcar_pcie_pci_notifier, -}; - -static int __init register_rcar_pcie_pci_notifier(void) -{ - return bus_register_notifier(&pci_bus_type, &device_nb); -} - -arch_initcall(register_rcar_pcie_pci_notifier); -- 2.7.4