lkml.org 
[lkml]   [2023]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH v8 12/12] iommu: Use refcount for fault data access
    From
    On 12/11/23 11:24 PM, Jason Gunthorpe wrote:
    >> @@ -282,22 +313,15 @@ EXPORT_SYMBOL_GPL(iommu_page_response);
    >> */
    >> int iopf_queue_flush_dev(struct device *dev)
    >> {
    >> - int ret = 0;
    >> - struct iommu_fault_param *iopf_param;
    >> - struct dev_iommu *param = dev->iommu;
    >> + struct iommu_fault_param *iopf_param = iopf_get_dev_fault_param(dev);
    >>
    >> - if (!param)
    >> + if (!iopf_param)
    >> return -ENODEV;
    > And this also seems unnecessary, it is a bug to call this after
    > iopf_queue_remove_device() right? Just

    Yes. They both are called from the iommu driver. The iommu driver should
    guarantee this.

    > rcu_derefernce(param->fault_param, true) and WARN_ON NULL.

    Okay, sure.

    Best regards,
    baolu

    \
     
     \ /
      Last update: 2023-12-12 06:28    [W:2.381 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site