Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3638762pxb; Mon, 24 Jan 2022 14:08:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJwaPvBV49qMk2s4O9ndzeRCn2GgSBgHb4jLptU4UdRYuypNkdp+i+ri/j8CfZ7wnOLepvSX X-Received: by 2002:a62:be09:0:b0:4c6:1af8:e547 with SMTP id l9-20020a62be09000000b004c61af8e547mr15892380pff.3.1643061999301; Mon, 24 Jan 2022 14:06:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643061999; cv=none; d=google.com; s=arc-20160816; b=wIG6L2unn14kWAYJ8QCeg3XegEajW55VU2zS8QMcla2b6gcf/CXXENMXB1UeU4UZlu 8ZaghlntzwkD4+ninWCHkHfR+gmRPpNCjWmu9wvqCQPhq8Pqq+MZHk7W0Mm5hW08n6io EsuTD+gek6usSgaC72PB7/Nz55acU9zBh19e7cY0cTAw9nhfrgut2o5I/lHziJ1omvyH 3S1pqMK2BvrMaV1GcRH9w0XiaNQbcsh/idVURv6K1pb+6OrFnVH0mrb2QzMbImb89FtZ 2fEG8UecvEF7Y2z25ZED4kl5XqxwGBuklGzFgZaW8CISRg0hcIw9Zn6dnfYhIgzPgYQQ 9IZQ== 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=2PSt2PB45UF4Lf+pGZZ3hY3SA7FftK0ESFkZJGSk/FA=; b=F9i4y8AJ6H7EVBWq1QaPyxjQUr3qfyAi85x/AKiE3hULDi0EA/571b2uvcXyHOve7B VkbjNTMYs/pi0PZXpJfBUBWsbzBjAheISZ0Kz0X6ikMXVGXxWW1sAxHxMIVUKIMY1ovN oCmMrSc+qLn3Dn30uABRhXjDfnA7CV7T88JX6SpOXFU+h+jJCtSNYx6Yx4cJJYVl708G VeULJ4es3h/UI7wh7VY+ZPGthbhZTFubOvz6PUbCtzs9ouqxtXqcGsifCkQv0U9pMRiq svsPVHad2OfSsZ3m+cEG7QpHuGO8c8PeU1BnoMbymKUMBqwYzO5qtBgRokakQBdH2IrH aaLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gPN70eBB; 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 q132si14149311pgq.489.2022.01.24.14.06.25; Mon, 24 Jan 2022 14:06:39 -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=gPN70eBB; 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 S1350936AbiAXVyB (ORCPT + 99 others); Mon, 24 Jan 2022 16:54:01 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:37420 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1446189AbiAXVRz (ORCPT ); Mon, 24 Jan 2022 16:17:55 -0500 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 B7BCCB812A4; Mon, 24 Jan 2022 21:17:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED44AC340E4; Mon, 24 Jan 2022 21:17:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059069; bh=nGSKyNwHqxYnvZTzIEn47sHUm0MNCLWPaVZ1C6/ULmk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gPN70eBBQAoIg1orgSrU44tYdApWzduoPNyBVRhUowUTagEaw/nYlQKuTed+Ftg0Q SLE3ZuScGAc/txBMBWo5KKDJGZu6nErdQ3pCS/0joFqZGG0i8C2WsEqE4cd0wu1bfM eGCgMltzUEOc5DDsckiOo7ds9YiUYQO7LCkLr+/Y= 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.16 0494/1039] iommu/amd: X2apic mode: re-enable after resume Date: Mon, 24 Jan 2022 19:38:03 +0100 Message-Id: <20220124184141.859316718@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 8dae85fcfc2eb..b905604f434e1 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -2172,7 +2172,6 @@ static int iommu_setup_intcapxt(struct amd_iommu *iommu) return ret; } - iommu_feature_enable(iommu, CONTROL_INTCAPXT_EN); return 0; } @@ -2195,6 +2194,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