Commit 6a3e3dbe authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'iommu-fixes-v3.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

Pull IOMMU fixes from Joerg Roedel:
 "Two small patches:

	* One patch to fix the function declarations for
	  !CONFIG_IOMMU_API. This is causing build errors
	  in linux-next and should be fixed for v3.6.

	* Another patch to fix an IOMMU group related NULL pointer
	  dereference."

* tag 'iommu-fixes-v3.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  iommu/amd: Fix wrong assumption in iommu-group specific code
  iommu: static inline iommu group stub functions
parents 21e98932 0774e392
...@@ -266,7 +266,7 @@ static void swap_pci_ref(struct pci_dev **from, struct pci_dev *to) ...@@ -266,7 +266,7 @@ static void swap_pci_ref(struct pci_dev **from, struct pci_dev *to)
static int iommu_init_device(struct device *dev) static int iommu_init_device(struct device *dev)
{ {
struct pci_dev *dma_pdev, *pdev = to_pci_dev(dev); struct pci_dev *dma_pdev = NULL, *pdev = to_pci_dev(dev);
struct iommu_dev_data *dev_data; struct iommu_dev_data *dev_data;
struct iommu_group *group; struct iommu_group *group;
u16 alias; u16 alias;
...@@ -293,7 +293,9 @@ static int iommu_init_device(struct device *dev) ...@@ -293,7 +293,9 @@ static int iommu_init_device(struct device *dev)
dev_data->alias_data = alias_data; dev_data->alias_data = alias_data;
dma_pdev = pci_get_bus_and_slot(alias >> 8, alias & 0xff); dma_pdev = pci_get_bus_and_slot(alias >> 8, alias & 0xff);
} else }
if (dma_pdev == NULL)
dma_pdev = pci_dev_get(pdev); dma_pdev = pci_dev_get(pdev);
/* Account for quirked devices */ /* Account for quirked devices */
......
...@@ -256,72 +256,78 @@ static inline void iommu_set_fault_handler(struct iommu_domain *domain, ...@@ -256,72 +256,78 @@ static inline void iommu_set_fault_handler(struct iommu_domain *domain,
{ {
} }
int iommu_attach_group(struct iommu_domain *domain, struct iommu_group *group) static inline int iommu_attach_group(struct iommu_domain *domain,
struct iommu_group *group)
{ {
return -ENODEV; return -ENODEV;
} }
void iommu_detach_group(struct iommu_domain *domain, struct iommu_group *group) static inline void iommu_detach_group(struct iommu_domain *domain,
struct iommu_group *group)
{ {
} }
struct iommu_group *iommu_group_alloc(void) static inline struct iommu_group *iommu_group_alloc(void)
{ {
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
} }
void *iommu_group_get_iommudata(struct iommu_group *group) static inline void *iommu_group_get_iommudata(struct iommu_group *group)
{ {
return NULL; return NULL;
} }
void iommu_group_set_iommudata(struct iommu_group *group, void *iommu_data, static inline void iommu_group_set_iommudata(struct iommu_group *group,
void (*release)(void *iommu_data)) void *iommu_data,
void (*release)(void *iommu_data))
{ {
} }
int iommu_group_set_name(struct iommu_group *group, const char *name) static inline int iommu_group_set_name(struct iommu_group *group,
const char *name)
{ {
return -ENODEV; return -ENODEV;
} }
int iommu_group_add_device(struct iommu_group *group, struct device *dev) static inline int iommu_group_add_device(struct iommu_group *group,
struct device *dev)
{ {
return -ENODEV; return -ENODEV;
} }
void iommu_group_remove_device(struct device *dev) static inline void iommu_group_remove_device(struct device *dev)
{ {
} }
int iommu_group_for_each_dev(struct iommu_group *group, void *data, static inline int iommu_group_for_each_dev(struct iommu_group *group,
int (*fn)(struct device *, void *)) void *data,
int (*fn)(struct device *, void *))
{ {
return -ENODEV; return -ENODEV;
} }
struct iommu_group *iommu_group_get(struct device *dev) static inline struct iommu_group *iommu_group_get(struct device *dev)
{ {
return NULL; return NULL;
} }
void iommu_group_put(struct iommu_group *group) static inline void iommu_group_put(struct iommu_group *group)
{ {
} }
int iommu_group_register_notifier(struct iommu_group *group, static inline int iommu_group_register_notifier(struct iommu_group *group,
struct notifier_block *nb) struct notifier_block *nb)
{ {
return -ENODEV; return -ENODEV;
} }
int iommu_group_unregister_notifier(struct iommu_group *group, static inline int iommu_group_unregister_notifier(struct iommu_group *group,
struct notifier_block *nb) struct notifier_block *nb)
{ {
return 0; return 0;
} }
int iommu_group_id(struct iommu_group *group) static inline int iommu_group_id(struct iommu_group *group)
{ {
return -ENODEV; return -ENODEV;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment