Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3669070pxb; Mon, 24 Jan 2022 14:57:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwdf1Lj43/Cwg+nmOv+v0q1qKqQ4h1udnRAdX/rTNhfbr2ze06p7d8V6T4Kq4sjXh+uTGHP X-Received: by 2002:a63:120b:: with SMTP id h11mr13051678pgl.611.1643065021208; Mon, 24 Jan 2022 14:57:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643065021; cv=none; d=google.com; s=arc-20160816; b=mOk3Rh5XZNJCD62JTVWfrAzWWeBwCGYDQ+zkOSJSefXS4osVTITOquOyk7Nvk6Vigz B8X6+EzLKocI+ehlvBT6vEZt2krYYV9/xSeaBfccTCy1Wgh/iApz8Fe3t2njS0gywENI kHs2TG5ytGQ/NWlOiDXhzWAbILlzffIQGH22YqiVIQPjxE0YdHiaO62SLx27TLbwdHpu YgDH3i/OpWYYH0Zww9neJrPUXhEfLHhoxzjJRCbEGXLm27FBNI1Ab7Nz4I0ogIZPn38n mWRPa+JiblqC4uSdh8NdCn8WGzMqCqf5I2TlGjZ6LDdmaO8bYiJ3YL0Mm4lelmlECUUz cvRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kVx3kZUKobNIJrzyhuLCSpWOaWcuvBeqA3fUcSOp6Rg=; b=XV86Il8kCN/Zy7vubCEZ7S1y/9WZ6DwN23IfosmCSeAdOJgxsXlMul+8243zeCAmyJ uOUJz7OjJDHDMXF0Nq3EfFhPUKYb++e1/XJvuWWoLcd7tHe9qXPppCerGvtkUz1URTsi oBNJSPCROP/5nSK7poBIaVuIPUuhOO1CfBi5W5JQh/D5S7SccEGcUMZN2fZ6TRmNHKrK 6JIE61l0b4ov/1NWyNTHqGix0fl6dmlX48BdWMsxj84uocVvzJeB7icgaX7NndyfUomp 80Sl069QhpRZ3pK20OT7pBamZvoO1FZTX76ncyqdOW9WU/Q4nDUXRQ88dWf8TOVnkudY 6q0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rfx2Wup2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si539576pjk.113.2022.01.24.14.56.47; Mon, 24 Jan 2022 14:57:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rfx2Wup2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1839996AbiAXWwY (ORCPT + 99 others); Mon, 24 Jan 2022 17:52:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1458145AbiAXVmr (ORCPT ); Mon, 24 Jan 2022 16:42:47 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 458E7C07A954; Mon, 24 Jan 2022 12:30:50 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 01A85B8122A; Mon, 24 Jan 2022 20:30:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 399A8C340E5; Mon, 24 Jan 2022 20:30:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056247; bh=lk34w8WMdUL6l4PL5XdnwhuS4losa8tnQTL3Rj/ZblM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rfx2Wup2blfcMAFl5LZcVIRSCNWBB/yVGcpZiob3MdpLsFeqjnXs76MDhmXuVrrCg LQJMqZL8CCtO8YQdpHKmPAuYfXMtgyephYfawLXlkfLQtN33F2RKYeRUGBGCK68ZDB zwH1Z2rftyeZrCeOYhRwivruYWeakT8IYKLDvrcM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxim Levitsky , Joerg Roedel , Sasha Levin Subject: [PATCH 5.15 420/846] iommu/amd: X2apic mode: re-enable after resume Date: Mon, 24 Jan 2022 19:38:57 +0100 Message-Id: <20220124184115.468706093@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maxim Levitsky [ Upstream commit 01b297a48a26bcb96769505ac948db4603b72bd1 ] Otherwise it is guaranteed to not work after the resume... Fixes: 66929812955bb ("iommu/amd: Add support for X2APIC IOMMU interrupts") Signed-off-by: Maxim Levitsky Link: https://lore.kernel.org/r/20211123161038.48009-3-mlevitsk@redhat.com Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/amd/init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index 9b12a2f7548ac..c1d4e66d2747b 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -2169,7 +2169,6 @@ static int iommu_setup_intcapxt(struct amd_iommu *iommu) return ret; } - iommu_feature_enable(iommu, CONTROL_INTCAPXT_EN); return 0; } @@ -2192,6 +2191,10 @@ static int iommu_init_irq(struct amd_iommu *iommu) iommu->int_enabled = true; enable_faults: + + if (amd_iommu_xt_mode == IRQ_REMAP_X2APIC_MODE) + iommu_feature_enable(iommu, CONTROL_INTCAPXT_EN); + iommu_feature_enable(iommu, CONTROL_EVT_INT_EN); if (iommu->ppr_log != NULL) -- 2.34.1