lkml.org 
[lkml]   [2019]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v3 2/4] iommu/dma-iommu: Handle deferred devices
    On Mon, May 06, 2019 at 07:52:04PM +0100, Tom Murphy wrote:
    > +static int handle_deferred_device(struct device *dev)
    > +{
    > + struct iommu_domain *domain;
    > + const struct iommu_ops *ops;
    > +
    > + if (!is_kdump_kernel())
    > + return 0;
    > +
    > + domain = iommu_get_domain_for_dev(dev);

    > - dma_handle =__iommu_dma_map(dev, phys, size,
    > + if (unlikely(handle_deferred_device(dev)))
    > + return DMA_MAPPING_ERROR;
    > +
    > + dma_handle = __iommu_dma_map(dev, phys, size,

    __iommu_dma_map already looks up the domain, and as far as I can
    tell all callers need the handle_deferred_device call. Should we
    just move it to there and pass the domain from the caller?

    Also shouldn't the iommu_attach_device call inside
    handle_deferred_device also get an unlikely marker?

    \
     
     \ /
      Last update: 2019-05-07 08:41    [W:3.955 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site