[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] PCI: Move pci_dev->is_busmaster into priv_flags



On Tue, Jul 14, 2026 at 09:37:07PM +0200, Maurice Hieronymus wrote:
> +++ b/include/linux/pci.h
> @@ -1446,6 +1445,8 @@ void pci_disable_device(struct pci_dev *dev);
>  extern unsigned int pcibios_max_latency;
>  void pci_set_master(struct pci_dev *dev);
>  void pci_clear_master(struct pci_dev *dev);
> +bool pci_dev_is_busmaster(const struct pci_dev *pdev);
> +void pci_dev_assign_busmaster(struct pci_dev *pdev, bool busmaster);

pci_dev_assign_busmaster() should not have public visibility.
Drivers should really use pci_set_master() / pci_clear_master()
and nothing else.

It seems Xen is the only one in the tree which needs this:

> +++ b/drivers/xen/xen-pciback/pciback_ops.c
> @@ -125,14 +125,14 @@ void xen_pcibk_reset_device(struct pci_dev *dev)
>               if (pci_is_enabled(dev))
>                       pci_disable_device(dev);
>  
> -             dev->is_busmaster = 0;
> +             pci_dev_assign_busmaster(dev, false);
>       } else {
>               pci_read_config_word(dev, PCI_COMMAND, &cmd);
>               if (cmd & (PCI_COMMAND_INVALIDATE)) {
>                       cmd &= ~(PCI_COMMAND_INVALIDATE);
>                       pci_write_config_word(dev, PCI_COMMAND, cmd);
>  
> -                     dev->is_busmaster = 0;
> +                     pci_dev_assign_busmaster(dev, false);
>               }
>       }
>  }

Please change these direct assignments to pci_clear_master(),
preferably in a separate patch to ease bisecting if anything
breaks.

Then you don't need pci_dev_assign_busmaster() and can just inline
setting/clearing the bit in __pci_set_master() and pci_disable_device().

Thanks,

Lukas



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.