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:
> Also iopf_queue_remove_device() is messed up - it returns an error
> code but nothing ever does anything with it 🙁 Remove functions like
> this should never fail.

Yes, agreed.

>
> Removal should be like I explained earlier:
> - Disable new PRI reception

This could be done by

rcu_assign_pointer(param->fault_param, NULL);

?

> - Ack all outstanding PRQ to the device

All outstanding page requests are responded with
IOMMU_PAGE_RESP_INVALID, indicating that device should not attempt any
retry.

> - Disable PRI on the device
> - Tear down the iopf infrastructure
>
> So under this model if the iopf_queue_remove_device() has been called
> it should be sort of a 'disassociate' action where fault_param is
> still floating out there but iommu_page_response() does nothing.

Yes. All pending requests have been auto-responded.

> IOW pass the refcount from the iommu_report_device_fault() down into
> the fault handler, into the work and then into iommu_page_response()
> which will ultimately put it back.

Yes.

Best regards,
baolu

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