From patchwork Sun Jun 14 14:36:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grzegorz Uriasz X-Patchwork-Id: 11603325 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5581913 for ; Sun, 14 Jun 2020 14:38:31 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 908F7206D7 for ; Sun, 14 Jun 2020 14:38:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gJQq1FDm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 908F7206D7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jkTlA-0004Yp-VL; Sun, 14 Jun 2020 14:37:20 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jkTl9-0004YZ-Na for xen-devel@lists.xenproject.org; Sun, 14 Jun 2020 14:37:19 +0000 X-Inumbo-ID: 8c810dbc-ae4c-11ea-8496-bc764e2007e4 Received: from mail-ej1-x641.google.com (unknown [2a00:1450:4864:20::641]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8c810dbc-ae4c-11ea-8496-bc764e2007e4; Sun, 14 Jun 2020 14:37:19 +0000 (UTC) Received: by mail-ej1-x641.google.com with SMTP id l27so14724301ejc.1 for ; Sun, 14 Jun 2020 07:37:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CedW14TZMrLJXwa4+9NGmni6qCAFSImofjSKJjmOefU=; b=gJQq1FDmHMLUhXCfeJ9EaXnakb1HIsoBaM/XtOYTk8lagU6V50luI9Wlhl+uu6KBl5 hLyw6rIprV2KPFLzGrBSvCLCQam1asQ4oLOwQ0zqUyvvljqKksTKa+sNJ7zQIUZUsDs2 PEP66Fsn+ntqXgnDt1w15ZTuXAfIKZMDElfj7qVtpfnVbFcJqrtrmaJ0g9DSRZSVU741 5LMBc8sWzWcmf0YeVG4RiZCJjGv8g8JWNYlFFSmAjDFe4B7i6PZ9Nq3izmOaEX0hLNPP lfVsoorjpSkQJPx7JNDdBpL3xXj+wOu/BmFR3wBmu79rwaxsrU7IcQrw2BT2SrGUt1nV 4xlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CedW14TZMrLJXwa4+9NGmni6qCAFSImofjSKJjmOefU=; b=G8woINkKRJIqncihWB27G19N7EpQt7YJ+U6/nn40jU/WYlO6x0S50ORbWOpJrxCmDg d2nFvBfXhbd7F227bRvmCH3EahugKiYlfQGMGr5OPmEaA+tPAPNAZvoYsc359DaDKHbB CuyfwOhz1ActdWk8YP/CPeVepvgFViU1RA6iZXp23SUL9mzRuitarhOSw8EedLOJpf/p dZZxWm9hmFDwLhJyeJcY4MYCShxCvTlv1cBoAoRueegmp2PcP/qWS+hAQq7XnlWA6Oqd MCwbZk/Vl70xGlazqnOXF8Mvfc1sfKi+uPcaSt+h6E8Pe+snxblHCDBBp0AJoBaHUDJL q0sA== X-Gm-Message-State: AOAM533c+mBS91BihmBj+KjdlcpCVZocDFe3yvPSPRvyw6VjS2vcS90Q 4629SCoR8bktpU6ngIaNKL1VC7xHwW7ZhA== X-Google-Smtp-Source: ABdhPJz0eyvA2OIgEU9X+Hg7Ah43Y42zZY+0qhsOZ53d3nnb1vpl798Adk67xG2sumjh0f9KqhCRgA== X-Received: by 2002:a17:906:d933:: with SMTP id rn19mr22297701ejb.158.1592145437986; Sun, 14 Jun 2020 07:37:17 -0700 (PDT) Received: from localhost.localdomain (public-gprs354212.centertel.pl. [37.47.14.229]) by smtp.gmail.com with ESMTPSA id l18sm6753823eds.46.2020.06.14.07.37.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jun 2020 07:37:17 -0700 (PDT) From: Grzegorz Uriasz To: xen-devel@lists.xenproject.org Subject: [PATCH 1/1] x86/acpi: Use FADT flags to determine the PMTMR width Date: Sun, 14 Jun 2020 14:36:28 +0000 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: artur@puzio.waw.pl, Wei Liu , jakub@bartmin.ski, Andrew Cooper , marmarek@invisiblethingslab.com, Grzegorz Uriasz , Jan Beulich , j.nowak26@student.uw.edu.pl, =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On some computers the bit width of the PM Timer as reported by ACPI is 32 bits when in fact the FADT flags report correctly that the timer is 24 bits wide. On affected machines such as the ASUS FX504GM and never gaming laptops this results in the inability to resume the machine from suspend. Without this patch suspend is broken on affected machines and even if a machine manages to resume correctly then the kernel time and xen timers are trashed. Signed-off-by: Grzegorz Uriasz Tested-by: Grzegorz Uriasz --- xen/arch/x86/acpi/boot.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c index bcba52e232..2ad3eb4abc 100644 --- a/xen/arch/x86/acpi/boot.c +++ b/xen/arch/x86/acpi/boot.c @@ -480,7 +480,10 @@ static int __init acpi_parse_fadt(struct acpi_table_header *table) if (fadt->xpm_timer_block.space_id == ACPI_ADR_SPACE_SYSTEM_IO) { pmtmr_ioport = fadt->xpm_timer_block.address; - pmtmr_width = fadt->xpm_timer_block.bit_width; + if (fadt->flags & ACPI_FADT_32BIT_TIMER) + pmtmr_width = 32; + else + pmtmr_width = 24; } } /*