/* General queuing function for commands. Takes iommu->lock and calls __iommu_queue_command().  */
static int iommu_queue_command(struct amd_iommu *iommu, struct iommu_cmd *cmd)
/* General queuing function for commands. Takes iommu->lock and calls __iommu_queue_command().  */
static int iommu_queue_command(struct amd_iommu *iommu, struct iommu_cmd *cmd)
{
	unsigned long flags;
	int ret;
	spin_lock_irqsave(&iommu->lock, flags);
	ret = __iommu_queue_command(iommu, cmd);
	if (!ret)
		iommu->need_sync = true;
	spin_unlock_irqrestore(&iommu->lock, flags);
	return ret;
}