Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp241958ioo; Fri, 20 May 2022 20:25:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRcQuBTwc1WZ6qF2nKsQmg7/INwxltMwDpjZLnfU3fTN/6cuWUYubQhA0njOVRQqhifxcX X-Received: by 2002:a17:907:6090:b0:6fa:14ca:fba8 with SMTP id ht16-20020a170907609000b006fa14cafba8mr11315979ejc.212.1653103532711; Fri, 20 May 2022 20:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653103532; cv=none; d=google.com; s=arc-20160816; b=gWdEFTjY70pzHjtNT6WgkE995TF7gJYGhWaYCHdYM0xV6IOZlCqf1B6LWG9XrXzTql 6jU+znSKDTdWBsKObyUYz4hvkJ1xSFeW8kQpg/ZMCRZ36/5TFH1enCXfWeije4w58jJb 2exXhySGRCvzUqF6D6jLUQyOG15MOjXUpCmZdGpB9NSyEDr7Tjg7qph84Ok1ND+vi3w1 nBiHsJNQt8eRDa+aV+hY6vEhloP5LyyyVUv/dOujGHNILLYJTwLnDqR1r9SIBF3Qqigj j5itWKuTabnLBHFRS/F1s6mlwWkYAzXWOg442dL6hlgD6gxe23NzyeCceNowwy/Zde9S 5kFQ== 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 :message-id:date:subject:cc:to:from; bh=934bdiC08JGVTFY1YLaI+rYNSC5m/noRhwOp7Vt0vyg=; b=qLGoxc+fGeOj6Ung2kN8L76OBGSR5trp6HY7d4TGfWdalIrWhehJF1RpExbb/8p0MK Ii6TqdbPg+ay5/N1ZF8SXMrtF9g/LxT4YgR71tjhm9qEGdFieNRhDzUMbocU/V9BGLIr p/+yC3Ni0CZVxwMnnvuTsiXk7ES1TuRTeNQDbOdNRk0VXLQj4CU1HbLAfhXWzauqeyxQ hDI+lZ1xoNYzXgoGQpqW9jsqXT/tK9v4vBN2HfhFL/d/jodSoJ+A29Pxk+7z8PIFqyho fSiu/mwbsBU7BzIVeycKQ/vJxmFY7TmMi745ZETyB7RX42hI2RWkNE+5Niou2u7olCKW IFhw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg3-20020a1709072cc300b006f9fe47417fsi9897917ejc.623.2022.05.20.20.25.05; Fri, 20 May 2022 20:25:32 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348112AbiETKW2 (ORCPT + 99 others); Fri, 20 May 2022 06:22:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346498AbiETKW0 (ORCPT ); Fri, 20 May 2022 06:22:26 -0400 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7E7F5931B for ; Fri, 20 May 2022 03:22:25 -0700 (PDT) Received: from cap.home.8bytes.org (p5b006cf2.dip0.t-ipconnect.de [91.0.108.242]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by theia.8bytes.org (Postfix) with ESMTPSA id CC385209; Fri, 20 May 2022 12:22:23 +0200 (CEST) From: Joerg Roedel To: Joerg Roedel Cc: Suravee Suthikulpanit , Will Deacon , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Joerg Roedel , "D. Ziegfeld" , =?UTF-8?q?J=C3=B6rg-Volker=20Peetz?= Subject: [PATCH] iommu/amd: Increase timeout waiting for GA log enablement Date: Fri, 20 May 2022 12:22:14 +0200 Message-Id: <20220520102214.12563-1-joro@8bytes.org> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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 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 --- drivers/iommu/amd/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index b4a798c7b347..d8060503ba51 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -84,7 +84,7 @@ #define ACPI_DEVFLAG_LINT1 0x80 #define ACPI_DEVFLAG_ATSDIS 0x10000000 -#define LOOP_TIMEOUT 100000 +#define LOOP_TIMEOUT 2000000 /* * ACPI table definitions * -- 2.36.1