Thread (44 messages) 44 messages, 5 authors, 2022-07-21

Re: [PATCH v3 03/15] iommu: Always register bus notifiers

From: Robin Murphy <robin.murphy@arm.com>
Date: 2022-07-06 13:43:52
Also in: linux-iommu, linux-s390, lkml

On 2022-07-06 02:53, Baolu Lu wrote:
On 2022/7/6 01:08, Robin Murphy wrote:
quoted
  /*
   * Use a function instead of an array here because the domain-type is a
   * bit-field, so an array would waste memory.
@@ -152,6 +172,10 @@ static int __init iommu_subsys_init(void)
              (iommu_cmd_line & IOMMU_CMD_LINE_STRICT) ?
                  "(set via kernel command line)" : "");
+    /* If the system is so broken that this fails, it will WARN 
anyway */
Can you please elaborate a bit on this? iommu_bus_init() still return
errors.
Indeed, it's commenting on the fact that we don't try to clean up or 
propagate an error value further even if it did ever manage to return 
one. I feared that if I strip the error handling out of iommu_bus_init() 
itself on the same reasoning, we'll just get constant patches from the 
static checker brigade trying to add it back, so it seemed like the 
neatest compromise to keep that decision where it's obviously in an 
early initcall, rather than in the helper function which can be viewed 
out of context. However, I'm happy to either expand this comment or go 
the whole way and make iommu_bus_init() return void if you think it's 
worthwhile.

Cheers,
Robin.
quoted
+    for (int i = 0; i < ARRAY_SIZE(iommu_buses); i++)
+        iommu_bus_init(iommu_buses[i]);
+
      return 0;
Best regards,
baolu
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help