Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp597845iog; Mon, 13 Jun 2022 08:51:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwetwcyeRs+dAUWls1wtLry2n/2lKp35Toxx6oNAHAIppRnqXUKtw4Ky4WWaHIq/yY4lBP7 X-Received: by 2002:a05:6402:4415:b0:434:fe11:742e with SMTP id y21-20020a056402441500b00434fe11742emr385572eda.239.1655135513543; Mon, 13 Jun 2022 08:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655135513; cv=none; d=google.com; s=arc-20160816; b=aInKnDVHvwEj+nxa7s8IZv00OAr+Pr/28Cq2V+OvVZ/x8lEOYSMxTGQHcoBYx5SI/C XF3bEXH4q4Ci2QaQUoJUgr2bzrDebvqp8b//ThIj2Vd+lqsF1nQXM14sMe262Yg5UpbP DeMRX1b3iv3OOt3tgTjBNz3hK36coJ3wJDfObTgHGameFLu9VjcuU279UqoEX5Iaz/1m ZTT7h+RNwnWzhVtdHp2ypDjaeGYIc5kQst1hBUTU9YiSjZQzHgYy8hifCN+mQUm0nfnt HTuX9DZh+j2VVT3UDwRj98EL6JwYjIE+C+qb3yXjH9I6PrjR1YRf2XX/i7ypRBWDderr Nm9w== 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=v9S1e991fjS6pjfbibbbhTlCSDQ1VQ+lNo9mysrOmWw=; b=BY/bvZzB89kEP5EvCRFxpSJrDegvRMfRwNoQaPqPjcz1gBGh0EccZHtOYwUmAsxdwO WmIeCWS9I0Fs8YnC+4fptlbLU1CUaNYWYupSnVht56rhRNcLlsCNHP8A5YYn4gcTj+HE 4R8sqCgiFiXPbX+XVutetbnT7KusRj6XEuD0X2souW1CKeTPEyiALxmZjEiN1jSerNPq oDppSwUCFmSdekrf61h2z1v0b+sDVRik6hIJf0i+O3+D9VCbYFosovwYUbsLL2jzpKbZ Y68shJGakJ5nUWfYjYCJaYO102LPG0313q5H74os6nklvScmOZhbKaUd/LUD8L2H2kF5 QzYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Xr4Mfh3R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f22-20020a0564021e9600b0042be3591e27si9268200edf.509.2022.06.13.08.51.28; Mon, 13 Jun 2022 08:51:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Xr4Mfh3R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1354038AbiFML1W (ORCPT + 99 others); Mon, 13 Jun 2022 07:27:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352896AbiFMLTB (ORCPT ); Mon, 13 Jun 2022 07:19:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF77C39833; Mon, 13 Jun 2022 03:40:47 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id CDD98610A0; Mon, 13 Jun 2022 10:40:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDEBBC34114; Mon, 13 Jun 2022 10:40:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655116846; bh=YxJ7oQOItiFqndzNT7SS3Vf+Ghx4qKzyaMSvq5xiiC4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xr4Mfh3RoqG1JDIHXoPPi8dUU0WlCDpfkOy6ANfwypQMNb5QOyB5oO4FjWPAieJ6o Mhe5/WSl//3i83cKg7/i1E56/n9bOyR1xvZA3YVGwfqGV6e9sW592R+ZbDQSAhX2Zv RkMIUnsRrUAzRkrvMenaqAGEjDtcQqCiZFkKExrA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "D. Ziegfeld" , =?UTF-8?q?J=C3=B6rg-Volker=20Peetz?= , Joerg Roedel , Sasha Levin Subject: [PATCH 5.4 206/411] iommu/amd: Increase timeout waiting for GA log enablement Date: Mon, 13 Jun 2022 12:07:59 +0200 Message-Id: <20220613094934.834339349@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joerg Roedel [ Upstream commit 42bb5aa043382f09bef2cc33b8431be867c70f8e ] On some systems it can take a long time for the hardware to enable the GA log of the AMD IOMMU. The current wait time is only 0.1ms, but testing showed that it can take up to 14ms for the GA log to enter running state after it has been enabled. Sometimes the long delay happens when booting the system, sometimes only on resume. Adjust the timeout accordingly to not print a warning when hardware takes a longer than usual. There has already been an attempt to fix this with commit 9b45a7738eec ("iommu/amd: Fix loop timeout issue in iommu_ga_log_enable()") But that commit was based on some wrong math and did not fix the issue in all cases. Cc: "D. Ziegfeld" Cc: Jörg-Volker Peetz Fixes: 8bda0cfbdc1a ("iommu/amd: Detect and initialize guest vAPIC log") Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20220520102214.12563-1-joro@8bytes.org Signed-off-by: Sasha Levin --- drivers/iommu/amd_iommu_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index 7502fa84e253..82d008310418 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c @@ -83,7 +83,7 @@ #define ACPI_DEVFLAG_LINT1 0x80 #define ACPI_DEVFLAG_ATSDIS 0x10000000 -#define LOOP_TIMEOUT 100000 +#define LOOP_TIMEOUT 2000000 /* * ACPI table definitions * -- 2.35.1