Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1524297pxb; Wed, 20 Oct 2021 06:51:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAfgQIuWSTEDAv7VtiRFSW/8JKIw2Jq4gD2hwg5XLfOZzyp06qVcHETKCCzyJUNesp1aAK X-Received: by 2002:a63:2acc:: with SMTP id q195mr86174pgq.45.1634737862850; Wed, 20 Oct 2021 06:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634737862; cv=none; d=google.com; s=arc-20160816; b=MSKtZEDLVvRBLDZx3ZMZ2EgETagNY1Nyk12HrWLp7qmxIBhwsQoCN6hIU3BvC+RHYs w1q/PF/Po1XLqVc6AM/cv9ku70ZQx8Q+hCcNEThCcGee5+Zw79RlsE+eyoz+9gZj++l5 D7fZNrVWmakZatJ1fLeIG1sk00YziofqbY0a+2yLt2eF0H2JOt/DjTQVPPm9cOzm8wHy 0p2RDE1jPTEiOblBJ9Q8a1IlKqsffqOTGXkQDsIOOmE19oGIXx1Pl0ab874bJE4yHBRQ 2qZMiEZfyCPmOZICtm1x63G6dxDj/gJvY2SIXjJlGCcQtIWzJp7ZcWOV6KAr7h+BAIYe +BIg== 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=O5SM7nz52G6r6F/j6nBMR15lNFGtJZYmywBZSEd7ZW0=; b=QFYTdG/7X2verHJqb+SIGv0TEdpDwx2LsSAhDXh49zSVApxx5NfGPQm5jBbOp1k64T HDCZGJQQvQYoYWsFNCaDkcSqWvGE6d8OD74pSWaeAl8hKFA5zoVN+Rry246/3uTGbmTN ISuXr+BnQ1E+IZL+5D4bZl5ko73J5l/lNDGjz8bR/aM1qclMQI2RigTHR1qkUdUQ27kn e9xPmBMStVXtcUdJFqcj7gRctAdBSWbBCZ91zNWQC9y8hv/0bUbhE+0iju7IEzdMfNvp qnnrQN5JryG40erWnR8rqzm+Un018u+Dbhcnmj1NWsDEh6OfZAC8wLkQgtknzaB62c9V /isQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k4si2834073plt.314.2021.10.20.06.50.48; Wed, 20 Oct 2021 06:51:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230031AbhJTNvv (ORCPT + 99 others); Wed, 20 Oct 2021 09:51:51 -0400 Received: from mail-ot1-f41.google.com ([209.85.210.41]:35563 "EHLO mail-ot1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229570AbhJTNvv (ORCPT ); Wed, 20 Oct 2021 09:51:51 -0400 Received: by mail-ot1-f41.google.com with SMTP id w12-20020a056830410c00b0054e7ceecd88so6486061ott.2; Wed, 20 Oct 2021 06:49:37 -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=O5SM7nz52G6r6F/j6nBMR15lNFGtJZYmywBZSEd7ZW0=; b=Y9QJgbeqmCpoUpx21beuohv6QzLG/zhPpOUi48lcp3IfCi2m4b8yk7v1Mz7cdAvYij uSOTQnQvPv6nep3uCQJDEmmnW6cRJFKvh2N8bsMwNHCqJ75l1e72CQAwI6S+T/NRytwS eWLSZy9uPOR2yvqXJEl/xdXV5GBdL00akX0Mw5FbkOKtL3uFIpNagHXw/4ZcOcMV+g2E pcKrjs8p/pA/JwvCc19zqYMpyGaxnw4aq0vsiDHGnjLsZhIZ1SCYD8kqcl7L2giBM963 7VntbogyAsYhAt+cpd6UNGwA5ZSfdPpSDWvdxGA4iXoQp4y+efBivBMit3mMd3KuqthJ zg1Q== X-Gm-Message-State: AOAM533DzR82J7IGDM45NqSJ3T7llxEjMtp0EX+RSzDq8pi8ukJ65hyP e9CAQjFD5RyCbY5KnyU6o8B4emRzznv5dXQZPV0= X-Received: by 2002:a05:6830:1af0:: with SMTP id c16mr10268otd.16.1634737776720; Wed, 20 Oct 2021 06:49:36 -0700 (PDT) MIME-Version: 1.0 References: <20211014075731.GB18719@xsang-OptiPlex-9020> <51c0a15f-1941-f161-dcec-a7a9acc726f2@gmail.com> <6755cf07-fa5a-cbb7-c076-57c162a08c99@gmail.com> <20aedfba-14e3-3677-d21a-b87610095445@gmail.com> <4300a3d4-76de-70c5-2a7b-c4d066ef5bc6@gmail.com> In-Reply-To: <4300a3d4-76de-70c5-2a7b-c4d066ef5bc6@gmail.com> From: "Rafael J. Wysocki" Date: Wed, 20 Oct 2021 15:49:25 +0200 Message-ID: Subject: Re: [PM] bfcc1e67ff: kernel-selftests.breakpoints.step_after_suspend_test.fail To: Florian Fainelli Cc: "Rafael J. Wysocki" , LKML , Linux Memory Management List , lkp@lists.01.org, kbuild test robot , kernel test robot , Linux PM Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 19, 2021 at 9:04 PM Florian Fainelli wrote: > > On 10/19/21 11:53 AM, Rafael J. Wysocki wrote: > > On 10/15/2021 9:40 PM, Florian Fainelli wrote: > >> On 10/15/21 11:45 AM, Rafael J. Wysocki wrote: > >>> On 10/14/2021 11:55 PM, Florian Fainelli wrote: > >>>> On 10/14/21 12:23 PM, Rafael J. Wysocki wrote: > >>>>> On 10/14/2021 6:26 PM, Florian Fainelli wrote: > >>>>>> On 10/14/21 12:57 AM, kernel test robot wrote: > >>>>>>> Greeting, > >>>>>>> > >>>>>>> FYI, we noticed the following commit (built with gcc-9): > >>>>>>> > >>>>>>> commit: bfcc1e67ff1e4aa8bfe2ca57f99390fc284c799d ("PM: sleep: Do not > >>>>>>> assume that "mem" is always present") > >>>>>>> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git > >>>>>>> master > >>>>>>> > >>>>>>> > >>>>>>> in testcase: kernel-selftests > >>>>>>> version: kernel-selftests-x86_64-c8c9111a-1_20210929 > >>>>>>> with following parameters: > >>>>>>> > >>>>>>> group: group-00 > >>>>>>> ucode: 0x11 > >>>>>>> > >>>>>>> test-description: The kernel contains a set of "self tests" under > >>>>>>> the > >>>>>>> tools/testing/selftests/ directory. These are intended to be small > >>>>>>> unit tests to exercise individual code paths in the kernel. > >>>>>>> test-url: https://www.kernel.org/doc/Documentation/kselftest.txt > >>>>>>> > >>>>>>> > >>>>>>> on test machine: 288 threads 2 sockets Intel(R) Xeon Phi(TM) CPU > >>>>>>> 7295 > >>>>>>> @ 1.50GHz with 80G memory > >>>>>>> > >>>>>>> caused below changes (please refer to attached dmesg/kmsg for entire > >>>>>>> log/backtrace): > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> If you fix the issue, kindly add following tag > >>>>>>> Reported-by: kernel test robot > >>>>>> Thanks for your report. Assuming that the code responsible for > >>>>>> registering the suspend operations is drivers/acpi/sleep.c for your > >>>>>> platform, and that acpi_sleep_suspend_setup() iterated over all > >>>>>> possible > >>>>>> sleep states, your platform must somehow be returning that > >>>>>> ACPI_STATE_S3 > >>>>>> is not a supported state somehow? > >>>>>> > >>>>>> Rafael have you ever encountered something like that? > >>>>> Yes, there are systems with ACPI that don't support S3. > >>>> OK and do you know what happens when we enter suspend with "mem" in > >>>> those cases? Do we immediately return because ultimately the firmware > >>>> does not support ACPI S3? > >>> "mem" should not be present in the list of available strings then, so it > >>> should be rejected right away. > >> Well yes, that was the purpose of the patch I submitted, but assuming > >> that we did provide "mem" as one of the possible standby modes even > >> though that was wrong (before patch), and the test was trying to enter > >> ACPI S3 standby, what would have happened, would the ACPI firmware honor > >> the request but return an error, or would it actually enter ACPI S3? > >> > >> In any case, I will change the test to check that this is a supported > >> standby mode before trying it. > > > > Unfortunately, I will need to revert bfcc1e67ff1e4aa8bfe2, because it > > breaks user space compatibility and that's got caught properly by the test. > > Reverting my commit will break powerpc and other ARM/ARM64 platforms > where mem is not supported (via PSCI), It won't break anything, although the things that didn't work before will still not work after it. And "mem" is always supported even if there are no suspend_ops at all, in which case it becomes an alternative way to trigger s2idle. So, on the affected systems, what's there in /sys/power/? Is mem_sleep present? If so, what's in it? > I have a change pending for PSCI > that will actually check that SYSTEM_SUSPEND is supported before > unconditionally making use of it. > > > > > What happens is that "mem" is a "pointer" to a secondary list of > > possible states and that generally is "s2idle shallow deep" and if > > s2idle is the only available option, it will be just "s2idle". > > > > This list is there in /sys/power/mem_sleep. > > > > It was done this way, because some variants of user space expect "mem" > > to be always present and don't recognize "freeze" properly. > > > > Sorry for the confusion. > > So how do we all get our cookie here? Should we just slap an #ifndef > CONFIG_ACPI in order to allow platforms that do not have "mem" to not > have it? Certainly not. I've just hacked my test-bed system with ACPI so it does not register any suspend_ops at all and I have "freeze mem disk" in /sys/power/state and "s2idle" in /sys/power/mem_sleep. Writing "mem" to /sys/power/state causes s2idle to be carried out. Since this is the expected behavior, I'm not sure what the problem is.