[PATCH 02/13] iommu: Move bus setup to IOMMU device registration

Lu Baolu baolu.lu at linux.intel.com
Mon Apr 18 16:37:57 PDT 2022


On 2022/4/19 6:09, Robin Murphy wrote:
> On 2022-04-16 01:04, Lu Baolu wrote:
>> On 2022/4/14 20:42, Robin Murphy wrote:
>>> @@ -1883,27 +1900,12 @@ static int iommu_bus_init(struct bus_type *bus)
>>>    */
>>>   int bus_set_iommu(struct bus_type *bus, const struct iommu_ops *ops)
>>>   {
>>> -    int err;
>>> -
>>> -    if (ops == NULL) {
>>> -        bus->iommu_ops = NULL;
>>> -        return 0;
>>> -    }
>>> -
>>> -    if (bus->iommu_ops != NULL)
>>> +    if (bus->iommu_ops && ops && bus->iommu_ops != ops)
>>>           return -EBUSY;
>>>       bus->iommu_ops = ops;
>>
>> Do we still need to keep above lines in bus_set_iommu()?
> 
> It preserves the existing behaviour until each callsite and its 
> associated error handling are removed later on, which seems like as good 
> a thing to do as any. Since I'm already relaxing iommu_device_register() 
> to a warn-but-continue behaviour while it keeps the bus ops on 
> life-support internally, I figured not changing too much at once would 
> make it easier to bisect any potential issues arising from this first step.

Fair enough. Thank you for the explanation.

Do you have a public tree that I could pull these patches and try them
on an Intel hardware? Or perhaps you have done this? I like the whole
idea of this series, but it's better to try it with a real hardware.

Best regards,
baolu





More information about the linux-arm-kernel mailing list