Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3492618pxb; Mon, 4 Apr 2022 18:43:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZOmDwX77JS2n1bGFAYPBM9njOyvpEAYKbLvud0sIEMuStJX6/wC96+iFUuPMW0fXqwQmv X-Received: by 2002:a17:90b:60c:b0:1c6:a684:25b2 with SMTP id gb12-20020a17090b060c00b001c6a68425b2mr1240526pjb.14.1649123031860; Mon, 04 Apr 2022 18:43:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649123031; cv=none; d=google.com; s=arc-20160816; b=rL5VVc0/vfusXYT/p2iZqjU4Zc3wwjudB0EeTvgO9wZduxH7ZDqVQPRFvgNIIi4eAw hvBl/EQ/nMpvy7OBpz1m4Dd31pYzHpTQoJViHSDLSTVTS1+d7bl/9Yc6PIfKci3eIh7p /3VIuLfLCtLDljyqiIZG2bLiZvA06v5hNjdimNk2kKxrIpyz9P+rEr9JZ1SNI+c4gMsp pPyqMd+REIG8QLKI8Z7avc4hJFAgWBzyqMgExpl9GgOPnziIMa4qesQdOQTVyPW4a1Po v4ggRTUUwFnhGAQJKiY313tEKGt8TJ4cKvkXX3MdkuZ8fRbqsFntLbHR2i0m7mY0MuXk ipjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=VwHSUD6VUk1+NHBKnrS20gEcYVbH13xq7tQUR/JhwtI=; b=wSt+AnD0k2zRAGOyMxe2+ACIw4Cnd8I2Yb7k68CA7uoyOcyoAgfDzxD8BiOI0oA5e1 CIE4XKCBsXyca3WPaRFfZvxsDN5Y0j9avdFhWYCLKJh3OOgj0l5BfKQyp0+PdjW7kbDz LwgLEdGU+0l202iH/264wYNA5WGMyXSquEr6h7uiAcS0/yfTvqUdW8cdn8yAwirHl7aV 7MYOJHWOkq+wHRPM4cF2PRxY7mYKQnENzph5RPWZBxnIZwK4RCh6iCv5DLLomOd+T1Vk bSjdn8C7xLrSvYNzu6TQGJVNTIogu2Jaw8JfZ+isww0BSsffxzEFwKEEJ/lXGYCez+2w 8zKQ== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t28-20020a63445c000000b003816043ee39si11361085pgk.46.2022.04.04.18.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 18:43:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 909119AE6B; Mon, 4 Apr 2022 17:42:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381345AbiDDWIL (ORCPT + 99 others); Mon, 4 Apr 2022 18:08:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379837AbiDDSQA (ORCPT ); Mon, 4 Apr 2022 14:16:00 -0400 Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FF8A3EA8F; Mon, 4 Apr 2022 11:14:03 -0700 (PDT) Received: by mail-yb1-f180.google.com with SMTP id j2so19249419ybu.0; Mon, 04 Apr 2022 11:14:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VwHSUD6VUk1+NHBKnrS20gEcYVbH13xq7tQUR/JhwtI=; b=uxXwz462nDHL9H4S23fQk4nA3pYOvJipgRNUZsONr35hK4E95Q2rW+3X5POPFTvpS8 k+p6Kgi2UCdEDTNfH/ULwhTZnDlLPXLy0/DvBgl2XzqeSBJxzT1OmF2s/23QyQ3MC9WJ E9iEb1pFeH3vW/DpD5RYzcxZpuybdCl+6/TWs3A5YoJRijl7To+t9DvscqnG+7mP2Fmh kVC7myK1V6YJmnb/LpNRTZDT2m66UxnuZIm3Ua9FypIPCXoFhRtWj7L5YsZVRv3jgwpb 9gIPc1vSq53oyx8uUvObKBvUTSsWHYvVWZ2kcOxHKzwZp6PdKP1DRukX1bdJEK2lIb/a GTOg== X-Gm-Message-State: AOAM530lU7IorsfAxetoDgAlO0ZQ/yIkG9NJS0eKzKYINDhWAmOHPSk2 c8Ufu8yPjaZoxmc2AoU+ywWtKncbfLzvvVegnZmmiC/5IuM= X-Received: by 2002:a05:6902:352:b0:63e:94c:883c with SMTP id e18-20020a056902035200b0063e094c883cmr929660ybs.365.1649096042539; Mon, 04 Apr 2022 11:14:02 -0700 (PDT) MIME-Version: 1.0 References: <20220403062322.3168-1-akihiko.odaki@gmail.com> In-Reply-To: <20220403062322.3168-1-akihiko.odaki@gmail.com> From: "Rafael J. Wysocki" Date: Mon, 4 Apr 2022 20:13:51 +0200 Message-ID: Subject: Re: [PATCH] Revert "ACPI: processor: idle: Only flush cache on entering C3" To: Akihiko Odaki Cc: "Kirill A . Shutemov" , "Rafael J . Wysocki" , Andi Kleen , Borislav Petkov , Dan Williams , Dave Hansen , "H. Peter Anvin" , Kuppuswamy Sathyanarayanan , ACPI Devel Maling List , Linux Kernel Mailing List , Ingo Molnar , "Rafael J. Wysocki" , Kuppuswamy Sathyanarayanan , Thomas Gleixner , Tony Luck , "the arch/x86 maintainers" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Sun, Apr 3, 2022 at 8:25 AM Akihiko Odaki wrote: > > This reverts commit 87ebbb8c612b1214f227ebb8f25442c6d163e802. > > ACPI processor power states can be transitioned in two distinct > situations: 1. when CPU goes idle and 2. before CPU goes offline > ("playing dead") to suspend or hibernate. Case 1 is handled by > acpi_idle_enter or acpi_idle_enter_s2idle. Case 2 is handled by > acpi_idle_play_dead. > > It is necessary to flush CPU caches in case 2 even if it is not > required to transit ACPI processor power states as CPU will go > offline soon. However, the reverted commit incorrectly removed CPU > cache flushing in such a condition. I think what you mean is that the CPU cache must always be flushed in acpi_idle_play_dead(), regardless of the target C-state that is going to be requested, because this is likely to be part of a CPU offline procedure or preparation for entering a system-wide sleep state and the stale cache contents may lead to problems going forward, for example when the CPU is taken back online. If so, I will put the above information into the patch changelog. > In fact, it made resuming from > suspend-to-RAM occasionally fail on Lenovo ThinkPad C13 Yoga. So this probably means that resume from suspend-to-RAM occasionally fails on Lenovo ThinkPad C13 Yoga and reverting the commit in question fixes this problem. Is that correct? > Signed-off-by: Akihiko Odaki > --- > drivers/acpi/processor_idle.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c > index f8e9fa82cb9b..05b3985a1984 100644 > --- a/drivers/acpi/processor_idle.c > +++ b/drivers/acpi/processor_idle.c > @@ -570,8 +570,7 @@ static int acpi_idle_play_dead(struct cpuidle_device *dev, int index) > { > struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu); > > - if (cx->type == ACPI_STATE_C3) > - ACPI_FLUSH_CPU_CACHE(); > + ACPI_FLUSH_CPU_CACHE(); > > while (1) { > > -- > 2.35.1 >