Re: [PATCH] pci, dmar: Update dmar units devices list during hotplug

From: David Woodhouse
Date: Sat May 28 2011 - 18:12:05 EST


On Wed, 2011-05-25 at 06:43 -0600, Alex Williamson wrote:
>
> Ugh, that's going to make it pretty difficult to use a dynamic lookup
> approach. Maybe we're stuck with caching the scope->pdev translation
> somewhere.

Can't you handle it on BUS_NOTIFY_ADD_DEVICE notification, and store it
in pdev->dev.archdata? Might as well do the ATSR the same way, so it
matches.

Hm, why the hell do we have device_to_iommu(), which seems to duplicate
the dmar_find_matched_drhd_unit() function? Introduced by Weidong in
commit c7151a8d in 2008... Weidong?

I have a *vague* recollection that we cannot assume that there will be a
matching extant pci_dev for every call to device_to_iommu(), which is
why it takes domai^H^H^H^H^Hsegment/bus/devfn arguments as it does. And
that would be a reasonable excuse for adding it in the first place, I
suppose. I note your patch will break if that's true...

--
dwmw2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/