iommu/amd: Introduce protection_domain_init() function
iommu/amd: Introduce protection_domain_init() function

This function contains the common parts between the
initialization of dma_ops_domains and usual protection
domains. This also fixes a long-standing bug which was
uncovered by recent changes, in which the api_lock was not
initialized for dma_ops_domains.

Reported-by: George Wang <2d2bb7cc684837bcf8bbbc57919ffb2f6dd68355@gmail.com>
Tested-by: George Wang <2d2bb7cc684837bcf8bbbc57919ffb2f6dd68355@gmail.com>
Signed-off-by: Joerg Roedel <61aff96566804ea1da8a65de5bcc892ce07caceb@suse.de>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs