Merge tag 'driver-core-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / include / linux / pci.h
index 3266ac08f8ecbbe286917af7736d850477cd3c8b..81a57b498f22e636be5a0eba8637e1eee9589cfc 100644 (file)
@@ -512,7 +512,11 @@ struct pci_dev {
        u16             acs_cap;        /* ACS Capability offset */
        phys_addr_t     rom;            /* Physical address if not from BAR */
        size_t          romlen;         /* Length if not from BAR */
-       char            *driver_override; /* Driver name to force a match */
+       /*
+        * Driver name to force a match.  Do not set directly, because core
+        * frees it.  Use driver_set_override() to set or clear it.
+        */
+       const char      *driver_override;
 
        unsigned long   priv_flags;     /* Private flags for the PCI driver */
 
@@ -891,6 +895,13 @@ struct module;
  *              created once it is bound to the driver.
  * @driver:    Driver model structure.
  * @dynids:    List of dynamically added device IDs.
+ * @driver_managed_dma: Device driver doesn't use kernel DMA API for DMA.
+ *             For most device drivers, no need to care about this flag
+ *             as long as all DMAs are handled through the kernel DMA API.
+ *             For some special ones, for example VFIO drivers, they know
+ *             how to manage the DMA themselves and set this flag so that
+ *             the IOMMU layer will allow them to setup and manage their
+ *             own I/O address space.
  */
 struct pci_driver {
        struct list_head        node;
@@ -909,6 +920,7 @@ struct pci_driver {
        const struct attribute_group **dev_groups;
        struct device_driver    driver;
        struct pci_dynids       dynids;
+       bool driver_managed_dma;
 };
 
 static inline struct pci_driver *to_pci_driver(struct device_driver *drv)