History

drivers/iommu: Take a ref to the IOMMU driver prior to ->add_device()

To avoid accidental removal of an active IOMMU driver module, take a reference to the driver module in 'iommu_probe_device()' immediately prior to invoking the '->add_device()' callback and hold it until the after the device has been removed by '->remove_device()'.

Will Deacon committed 6 years ago

Commit 25f003d1 parent 1a373a72 files · +20 −3Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/iommu.h+3−1
@@ -246,9 +246,10 @@ struct iommu_iotlb_gather { · 245 unmodified lines
246246 * @sva_get_pasid: Get PASID associated to a SVA handle
247247 * @page_response: handle page request response
248248 * @cache_invalidate: invalidate translation caches
249− * @pgsize_bitmap: bitmap of all possible supported page sizes
250249 * @sva_bind_gpasid: bind guest pasid and mm
251250 * @sva_unbind_gpasid: unbind guest pasid and mm
251+ * @pgsize_bitmap: bitmap of all possible supported page sizes
252+ * @owner: Driver module providing these ops
252253 */
253254 struct iommu_ops {
254255 bool (*capable)(enum iommu_cap);
@@ -318,6 +319,7 @@ struct iommu_ops { · 63 unmodified lines
318319 int (*sva_unbind_gpasid)(struct device *dev, int pasid);
319320
320321 unsigned long pgsize_bitmap;
322+ struct module *owner;
321323 };
322324
323325 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t