lkml.org 
[lkml]   [2022]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH v2 1/5] iommu: Return -EMEDIUMTYPE for incompatible domain and device/group
    From
    On 2022/6/16 08:03, Nicolin Chen wrote:
    > diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
    > index 44016594831d..0dd13330fe12 100644
    > --- a/drivers/iommu/intel/iommu.c
    > +++ b/drivers/iommu/intel/iommu.c
    > @@ -4323,7 +4323,7 @@ static int prepare_domain_attach_device(struct iommu_domain *domain,
    > return -ENODEV;
    >
    > if (dmar_domain->force_snooping && !ecap_sc_support(iommu->ecap))
    > - return -EOPNOTSUPP;
    > + return -EMEDIUMTYPE;
    >
    > /* check if this iommu agaw is sufficient for max mapped address */
    > addr_width = agaw_to_width(iommu->agaw);
    > @@ -4331,10 +4331,10 @@ static int prepare_domain_attach_device(struct iommu_domain *domain,
    > addr_width = cap_mgaw(iommu->cap);
    >
    > if (dmar_domain->max_addr > (1LL << addr_width)) {
    > - dev_err(dev, "%s: iommu width (%d) is not "
    > + dev_dbg(dev, "%s: iommu width (%d) is not "
    > "sufficient for the mapped address (%llx)\n",
    > __func__, addr_width, dmar_domain->max_addr);
    > - return -EFAULT;
    > + return -EMEDIUMTYPE;
    > }
    > dmar_domain->gaw = addr_width;

    Can we simply remove the dev_err()? As the return value has explicitly
    explained the failure reason, putting a print statement won't help much.

    Best regards,
    baolu

    \
     
     \ /
      Last update: 2022-06-16 04:12    [W:4.144 / U:0.168 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site