Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp632061iog; Mon, 13 Jun 2022 09:31:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoiGa4YlmHIrY+O4OnNQZNXNU389eySldFHLkcl4sGgoiHCoip2rd2jCa2mXEDUxXAsHfw X-Received: by 2002:a63:9c4:0:b0:401:a7b6:ad18 with SMTP id 187-20020a6309c4000000b00401a7b6ad18mr358876pgj.523.1655137884434; Mon, 13 Jun 2022 09:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655137884; cv=none; d=google.com; s=arc-20160816; b=PzhoyUcvVXny0BooccWwpj8LO/w/VMx9ZpnmSNW4CTkgaXh2gxl/8Tr/wevl1yqAFG 8At2YWsbuiDqqI92kwbe2qWXVGw/MT0+hV/MA6XCtkIuZRVkdoJa3QwUSsLAUy/qAA6r O+pTWVt+WAMPtqcKcVu9Qr+BGSeMSJ3S4gcasC7rKOymf1XupDXQlTWTEkJvmtLRMc9u 9d1tfbAt99pm0YPW5ZiXw0PNiYKs/JMNaZmgm6pcBDqcrdcqMqqA13MqGeVkFKfUQotI m01kHkX/aWsUHqOsmH2d6jhp386rnZUMI5c7epzfzZZCNPLN3F1U0OuLqo3nh4m9bM0V a4bw== 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=vpy69zsrEZP6n18xPIUBYXatosI+enQ2wG2rkRDcHeo=; b=uRRScbf6BUCAz9XuBDTVqDMo6utsC1hBdAl5FYOGLf33RvwfK11G7wbCJBCtfZR1Y4 mdnEA5RZyLvTPmEowBsXQQ5apKXmho9bhWuqXiOwX8m12otVelfION4+pTee+EdhQ0OA yTMI30nqrW4Z2V2T7YRmf+iAJhtEPwedoIaVkUA8PChcnZFa6T1eVny0seducak+32IG cfGQ0mM25rapOXoL+926Dlb6/x/J9Gc8eSaq6lTBSLjypa6PqDJ7a/eanj8DfkjGoVNU T6vpQaJ5PizCtytoC+Z4WPFFAjX9alZ0qqbB3pCK4F5hBAl8UG/QWNMWO2xdVYfzgoxA DFyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xZB70Gt5; 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 t3-20020a170902a5c300b00161ae4734d6si9950196plq.57.2022.06.13.09.31.11; Mon, 13 Jun 2022 09:31:24 -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=xZB70Gt5; 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 S1359441AbiFMMJl (ORCPT + 99 others); Mon, 13 Jun 2022 08:09:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358445AbiFMMDq (ORCPT ); Mon, 13 Jun 2022 08:03:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E965CFD0E; Mon, 13 Jun 2022 03:57:23 -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 ams.source.kernel.org (Postfix) with ESMTPS id 11EFCB80EA3; Mon, 13 Jun 2022 10:57:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7919CC3411C; Mon, 13 Jun 2022 10:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655117840; bh=h5qBBZGdIy+62MDWN8vJ6vp9pIMO7VOh3HChzw0qZJw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xZB70Gt52I1CCtfbU2PgvTAu/Y0cgYgk1obbMHGjIM0SE2ajDXXZzq//WSOtO+tQI R2dWtUyGSgoiODzhl0aRbpKapMlORBbs7Y1keV03LHwyU9089sT56z5UP5JhD0eoNb VOnoBH7SVkOcP7Ik3HRlY1SO29y0sAEttr/VofcQ= 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 4.19 139/287] iommu/amd: Increase timeout waiting for GA log enablement Date: Mon, 13 Jun 2022 12:09:23 +0200 Message-Id: <20220613094928.092312914@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094923.832156175@linuxfoundation.org> References: <20220613094923.832156175@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 76ae6968801e..1c61cd0b1d55 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c @@ -90,7 +90,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