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

Configure Feed

Select the types of activity you want to include in your feed.

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

+35 -27
+4 -2
drivers/iommu/amd_iommu.c
··· 266 266 267 267 static int iommu_init_device(struct device *dev) 268 268 { 269 - struct pci_dev *dma_pdev, *pdev = to_pci_dev(dev); 269 + struct pci_dev *dma_pdev = NULL, *pdev = to_pci_dev(dev); 270 270 struct iommu_dev_data *dev_data; 271 271 struct iommu_group *group; 272 272 u16 alias; ··· 293 293 dev_data->alias_data = alias_data; 294 294 295 295 dma_pdev = pci_get_bus_and_slot(alias >> 8, alias & 0xff); 296 - } else 296 + } 297 + 298 + if (dma_pdev == NULL) 297 299 dma_pdev = pci_dev_get(pdev); 298 300 299 301 /* Account for quirked devices */
+31 -25
include/linux/iommu.h
··· 256 256 { 257 257 } 258 258 259 - int iommu_attach_group(struct iommu_domain *domain, struct iommu_group *group) 259 + static inline int iommu_attach_group(struct iommu_domain *domain, 260 + struct iommu_group *group) 260 261 { 261 262 return -ENODEV; 262 263 } 263 264 264 - void iommu_detach_group(struct iommu_domain *domain, struct iommu_group *group) 265 + static inline void iommu_detach_group(struct iommu_domain *domain, 266 + struct iommu_group *group) 265 267 { 266 268 } 267 269 268 - struct iommu_group *iommu_group_alloc(void) 270 + static inline struct iommu_group *iommu_group_alloc(void) 269 271 { 270 272 return ERR_PTR(-ENODEV); 271 273 } 272 274 273 - void *iommu_group_get_iommudata(struct iommu_group *group) 275 + static inline void *iommu_group_get_iommudata(struct iommu_group *group) 274 276 { 275 277 return NULL; 276 278 } 277 279 278 - void iommu_group_set_iommudata(struct iommu_group *group, void *iommu_data, 279 - void (*release)(void *iommu_data)) 280 + static inline void iommu_group_set_iommudata(struct iommu_group *group, 281 + void *iommu_data, 282 + void (*release)(void *iommu_data)) 280 283 { 281 284 } 282 285 283 - int iommu_group_set_name(struct iommu_group *group, const char *name) 284 - { 285 - return -ENODEV; 286 - } 287 - 288 - int iommu_group_add_device(struct iommu_group *group, struct device *dev) 286 + static inline int iommu_group_set_name(struct iommu_group *group, 287 + const char *name) 289 288 { 290 289 return -ENODEV; 291 290 } 292 291 293 - void iommu_group_remove_device(struct device *dev) 294 - { 295 - } 296 - 297 - int iommu_group_for_each_dev(struct iommu_group *group, void *data, 298 - int (*fn)(struct device *, void *)) 292 + static inline int iommu_group_add_device(struct iommu_group *group, 293 + struct device *dev) 299 294 { 300 295 return -ENODEV; 301 296 } 302 297 303 - struct iommu_group *iommu_group_get(struct device *dev) 298 + static inline void iommu_group_remove_device(struct device *dev) 299 + { 300 + } 301 + 302 + static inline int iommu_group_for_each_dev(struct iommu_group *group, 303 + void *data, 304 + int (*fn)(struct device *, void *)) 305 + { 306 + return -ENODEV; 307 + } 308 + 309 + static inline struct iommu_group *iommu_group_get(struct device *dev) 304 310 { 305 311 return NULL; 306 312 } 307 313 308 - void iommu_group_put(struct iommu_group *group) 314 + static inline void iommu_group_put(struct iommu_group *group) 309 315 { 310 316 } 311 317 312 - int iommu_group_register_notifier(struct iommu_group *group, 313 - struct notifier_block *nb) 318 + static inline int iommu_group_register_notifier(struct iommu_group *group, 319 + struct notifier_block *nb) 314 320 { 315 321 return -ENODEV; 316 322 } 317 323 318 - int iommu_group_unregister_notifier(struct iommu_group *group, 319 - struct notifier_block *nb) 324 + static inline int iommu_group_unregister_notifier(struct iommu_group *group, 325 + struct notifier_block *nb) 320 326 { 321 327 return 0; 322 328 } 323 329 324 - int iommu_group_id(struct iommu_group *group) 330 + static inline int iommu_group_id(struct iommu_group *group) 325 331 { 326 332 return -ENODEV; 327 333 }