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

ntb: intel: Remove redundant pci_clear_master

Remove pci_clear_master to simplify the code,
the bus-mastering is also cleared in do_pci_disable_device,
like this:
./drivers/pci/pci.c:2197
static void do_pci_disable_device(struct pci_dev *dev)
{
u16 pci_command;

pci_read_config_word(dev, PCI_COMMAND, &pci_command);
if (pci_command & PCI_COMMAND_MASTER) {
pci_command &= ~PCI_COMMAND_MASTER;
pci_write_config_word(dev, PCI_COMMAND, pci_command);
}

pcibios_disable_device(dev);
}.
And dev->is_busmaster is set to 0 in pci_disable_device.

Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>

authored by

Cai Huoqing and committed by
Jon Mason
d353fb4b f2748c6d

-2
-2
drivers/ntb/hw/intel/ntb_hw_gen1.c
··· 1791 1791 1792 1792 err_mmio: 1793 1793 err_dma_mask: 1794 - pci_clear_master(pdev); 1795 1794 pci_release_regions(pdev); 1796 1795 err_pci_regions: 1797 1796 pci_disable_device(pdev); ··· 1807 1808 pci_iounmap(pdev, ndev->peer_mmio); 1808 1809 pci_iounmap(pdev, ndev->self_mmio); 1809 1810 1810 - pci_clear_master(pdev); 1811 1811 pci_release_regions(pdev); 1812 1812 pci_disable_device(pdev); 1813 1813 pci_set_drvdata(pdev, NULL);