Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp918007ybm; Fri, 29 May 2020 15:40:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZ4ZkB7vyJwva+t8WwUrMWLR02h2eM+j9aiB4bCFE2nem9ar4bCxHsQFjXipP5/+mQphMj X-Received: by 2002:a17:906:48ce:: with SMTP id d14mr10656689ejt.468.1590792028144; Fri, 29 May 2020 15:40:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590792028; cv=none; d=google.com; s=arc-20160816; b=mHUALwVQ9e1wc+j9mPh+Uoo9LuSsgQS1PX1vtZ/v0kpi8W93qLguHCOdcm+zYhBUco MM/zRLli1YWSx9GflGtNH+kWI3JahkG24aQvHjhtyjImpsXbsZx+tQatHSDOJw+BmtpI dEuuiGVN9Ca8QCILC0b1bYElVFJUGo58AmY9kSkXpJwuwARIVMmsdLsP7hF0erULAMfu srVnD6+V0goLnQd0BN/MFvv2qbP6fH4Ycna0qDOZXhQzeKFJRyoo2jRwg3z2tGElDcI4 7FT+2tlDfwsnQNDSNTEtAwzFBreNlGlhspwbfY6H0tqt4niqWeWTbulH542BI/MRHzVx z5Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject:dkim-signature; bh=VBP4zrYI8cxFNCADidmKvfGF55YJTILHwDw7fuOAJhE=; b=CxLqy5NW8bJSACBJaEiT/6AAT9tl8owv1Skt8XqI5vV0a0jnf3ZIhMfkxk1stUPXNi wUugoZ0JaC4RjfWda1n9fk/6pqyfZH7W7rv9UAPpKTZEmhI80VI/17zSK23t536jGMVj L9ui3EsEqrDDFGmaE7y4G030uQa8OajskRXwB72ePJXdfvcIay0DmxQGPtnL11MC1Dp/ 6NP91rAxfMgDc6NqaJOP608Rc+xHj6QhYIGG/SYstK8Y59FgUNR4PtekJ0yTMWvGF4Wo tR7f+X+vEY1BTxc+BpfvL4tj1KjNaWGsW9omTMJ39rOdtXJB65+p+UEotoAXnsAkXDuL WUng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="aWuTg/9k"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si5811906edr.224.2020.05.29.15.40.04; Fri, 29 May 2020 15:40:28 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="aWuTg/9k"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728467AbgE2WhM (ORCPT + 99 others); Fri, 29 May 2020 18:37:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726555AbgE2WhL (ORCPT ); Fri, 29 May 2020 18:37:11 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A532FC03E969 for ; Fri, 29 May 2020 15:37:11 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id h95so1157228pje.4 for ; Fri, 29 May 2020 15:37:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:autocrypt:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=VBP4zrYI8cxFNCADidmKvfGF55YJTILHwDw7fuOAJhE=; b=aWuTg/9k2zwlRdGsM7QfZ9PHLbA4oQnw67lM0qgRCV9vl99oahFdkPpXDcmL5EYLsY 5J+aj5M6DcM4j0ZDbPzQGxrut8T6LZv5EFZsBLisi5P3E2ZVPIv6wT1CHkkPk3L871Yv fKxFiDT5lwALGa///pHGe6Tvwyn4oZk+5EkNuwl53k16+qB7lfCRDP/utMcAhToG1WaI 2Br5K9BfbcRbN08RWguHy6aPIMHE2tyMSYMOj1dSZsGhDr2tJ1djkGh1sbo2t87AesBS dvRKXSFEWpNMOTOTFiLgXqJJFkzsI6fyYMLn8SochgZjnbwm2z2qxhqMzLItnBTZXnqR EnQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=VBP4zrYI8cxFNCADidmKvfGF55YJTILHwDw7fuOAJhE=; b=lXGFlV6l30Y0XImMZezL3nzw8aTz7v6oUVNWWWw+KXAsKHJy88zh673cV9WDawk72B B8KMaBbaKEzTO/Rursira3HwzxiCXBXM2EkZbmxzANpQ6hg/fB38dYlaABQDLfjiR4t7 59j+67mqkiBuRZa3rMNCLYPkKViHRQyidXSkXk8FC1mU70yC5Q0p+62q45Dwya0J0vHr PRG3/rXLprPPCjwsTunl6yVJNFJwjDs5Zf/jlx5giBZRTVudNqdCmWD6iFHfsa6p1swP uZneB1/BqV3Jb+u+8f7a+kqx8Nj/dJMuwm7nrKdTP5P6RpAnmA4aqjXfIwMFswDO97Ii 3Gaw== X-Gm-Message-State: AOAM531BZI3eutKAGiNDDJf8nRUMYrkFlRQVEBN486IO/VLCOgf2Nl+U BL+YE08PpGwBXTewgVNOoXY= X-Received: by 2002:a17:902:b618:: with SMTP id b24mr10785687pls.155.1590791831080; Fri, 29 May 2020 15:37:11 -0700 (PDT) Received: from [10.67.49.116] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id q44sm464464pja.2.2020.05.29.15.37.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 May 2020 15:37:10 -0700 (PDT) Subject: Re: Regression with PM / wakeup: Show wakeup sources stats in sysfs" To: Tri Vo Cc: "linux-kernel@vger.kernel.org" , "Rafael J. Wysocki" , Greg KH , Stephen Boyd References: <11459cde-7f57-c95b-8cac-4301f0a2390e@gmail.com> <9d75a67b-87f0-161c-02d7-c9fc4efe97e7@intel.com> From: Florian Fainelli Autocrypt: addr=f.fainelli@gmail.com; prefer-encrypt=mutual; keydata= xsDiBEjPuBIRBACW9MxSJU9fvEOCTnRNqG/13rAGsj+vJqontvoDSNxRgmafP8d3nesnqPyR xGlkaOSDuu09rxuW+69Y2f1TzjFuGpBk4ysWOR85O2Nx8AJ6fYGCoeTbovrNlGT1M9obSFGQ X3IzRnWoqlfudjTO5TKoqkbOgpYqIo5n1QbEjCCwCwCg3DOH/4ug2AUUlcIT9/l3pGvoRJ0E AICDzi3l7pmC5IWn2n1mvP5247urtHFs/uusE827DDj3K8Upn2vYiOFMBhGsxAk6YKV6IP0d ZdWX6fqkJJlu9cSDvWtO1hXeHIfQIE/xcqvlRH783KrihLcsmnBqOiS6rJDO2x1eAgC8meAX SAgsrBhcgGl2Rl5gh/jkeA5ykwbxA/9u1eEuL70Qzt5APJmqVXR+kWvrqdBVPoUNy/tQ8mYc nzJJ63ng3tHhnwHXZOu8hL4nqwlYHRa9eeglXYhBqja4ZvIvCEqSmEukfivk+DlIgVoOAJbh qIWgvr3SIEuR6ayY3f5j0f2ejUMYlYYnKdiHXFlF9uXm1ELrb0YX4GMHz80nRmxvcmlhbiBG YWluZWxsaSA8Zi5mYWluZWxsaUBnbWFpbC5jb20+wmYEExECACYCGyMGCwkI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YhN+aVpMHNCmJuISQORhX5lkjeg54oplt6Zn QyIsOCH3MfG95ha0TgWwyFtdxOdY/UY2zv5wGivZ3WeS0TtQf/BcGre2y85rAohFziWOzTaS BKZKDaBFHwnGcJi61Pnjkz82hena8OmsnsBIucsz4N0wE+hVd6AbDYN8ZcFNIDyt7+oGD1+c PfqLz2df6qjXzq27BBUboklbGUObNwADBQ//V45Z51Q4fRl/6/+oY5q+FPbRLDPlUF2lV6mb hymkpqIzi1Aj/2FUKOyImGjbLAkuBQj3uMqy+BSSXyQLG3sg8pDDe8AJwXDpG2fQTyTzQm6l OnaMCzosvALk2EOPJryMkOCI52+hk67cSFA0HjgTbkAv4Mssd52y/5VZR28a+LW+mJIZDurI Y14UIe50G99xYxjuD1lNdTa/Yv6qFfEAqNdjEBKNuOEUQOlTLndOsvxOOPa1mRUk8Bqm9BUt LHk3GDb8bfDwdos1/h2QPEi+eI+O/bm8YX7qE7uZ13bRWBY+S4+cd+Cyj8ezKYAJo9B+0g4a RVhdhc3AtW44lvZo1h2iml9twMLfewKkGV3oG35CcF9mOd7n6vDad3teeNpYd/5qYhkopQrG k2oRBqxyvpSLrJepsyaIpfrt5NNaH7yTCtGXcxlGf2jzGdei6H4xQPjDcVq2Ra5GJohnb/ix uOc0pWciL80ohtpSspLlWoPiIowiKJu/D/Y0bQdatUOZcGadkywCZc/dg5hcAYNYchc8AwA4 2dp6w8SlIsm1yIGafWlNnfvqbRBglSTnxFuKqVggiz2zk+1wa/oP+B96lm7N4/3Aw6uy7lWC HvsHIcv4lxCWkFXkwsuWqzEKK6kxVpRDoEQPDj+Oy/ZJ5fYuMbkdHrlegwoQ64LrqdmiVVPC TwQYEQIADwIbDAUCVF/S8QUJHlwd3wAKCRBhV5kVtWN2Do+FAJ956xSz2XpDHql+Wg/2qv3b G10n8gCguORqNGMsVRxrlLs7/himep7MrCc= Message-ID: <78faec4a-bf98-a731-b505-a1ccfb6e4557@gmail.com> Date: Fri, 29 May 2020 15:37:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/29/20 3:28 PM, Tri Vo wrote: > On Fri, May 29, 2020 at 9:51 AM Rafael J. Wysocki > wrote: >> >> On 5/28/2020 10:46 PM, Florian Fainelli wrote: >>> Hi, >>> >>> Commit c8377adfa78103be5380200eb9dab764d7ca890e ("PM / wakeup: Show >>> wakeup sources stats in sysfs") is causing some of our tests to fail >>> because /sys/class/net/*/device/power/wakeup_count is now 0, despite >>> /sys/kernel/debug/wakeup_sources clearly indicating that the Ethernet >>> device was responsible for system wake-up. >>> >>> What's more in looking at /sys/class/wakekup/wakeup2/event_count, we >>> have the number of Wake-on-LAN wakeups recorded properly, but >>> wakeup_count is desperately 0, why is that? >> >> I need to look at that commit in detail to find out what is going on. > > It would be helpful to see the contents of > /sys/kernel/debug/wakeup_sources, /sys/class/net/*/device/power/*, and > /sys/class/wakekup/* corresponding to the device in question. The > values in these files are queried from the same struct wakeup_source. > So it's odd if wakeup_count diverges. Most certainly, below is the information you want, the two cat /s/k/d/wakeup_sources were done before Wake-on-LAN and after waking-up from LAN. /sys/class/wakeup/wakeup2 maps to the Ethernet device. The Ethernet device calls pm_wakeup_event() against the struct device that is embedded in the platform_device that it was probed with. I will try to debug this myself over the weekend, time permitting. # ethtool -s eth0 wol g # cat /sys/kernel/debug/wakeup_sources name active_count event_count wakeup_count expire_count active_since total_time max_time last_changep revent_suspend_time 47d580000.ethernet 0 0 0 0 0 0 0 0 0 alarmtimer 0 0 0 0 0 0 0 0 0 47c408400.waketimer 2 2 0 0 0 0 0 6144 1 0 # pml -w20 [ 3449.937142] brcm-waketimer 47c408400.waketimer: Using sysfs attributes, consider using 'rtcwake' Pass 1 out of 1, mode=none, tp_al[ 3449.952654] PM: suspend entry (shallow) l=1, cycle_tp=, sleep=, [ 3449.959004] Filesystems sync: 0.000 seconds wakeup_time=20 [ 3449.965984] Freezing user space processes ... (elapsed 0.001 seconds) done. [ 3449.974087] OOM killer disabled. [ 3449.977316] Freezing remaining freezable tasks ... (elapsed 0.006 seconds) done. [ 3449.991114] printk: Suspending console(s) (use no_console_suspend to debug) AMS: System is entering S2... [ 3450.022381] bcmgenet 47d580000.ethernet eth0: Link is Down [ 3450.048340] Disabling non-boot CPUs ... [ 3450.049344] CPU1: shutdown [ 3450.050393] psci: CPU1 killed (polled 1 ms) [ 3450.051332] Enabling non-boot CPUs ... [ 3450.051712] Detected PIPT I-cache on CPU1 [ 3450.051812] CPU1: Booted secondary processor 0x0000000001 [0x410fd083] [ 3450.052435] CPU1 is up [ 3450.683588] bcmgenet 47d580000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx [ 3450.729677] OOM killer enabled. [ 3450.732908] Restarting tasks ... done. [ 3450.738539] PM: suspend exit ------------------------------ [ 3450.744239] brcm-waketimer 47c408400.waketimer: Using sysfs attributes, consider using 'rtcwake' # cat /sys/kernel/debug/wakeup_sources name active_count event_count wakeup_count expire_count active_since total_time max_time last_changep revent_suspend_time 47d580000.ethernet 1 1 0 0 0 0 0 3450 054 0 alarmtimer 0 0 0 0 0 0 0 0 0 47c408400.waketimer 2 2 0 0 0 0 0 6144 1 0 # cat /sys/class/net/*/device/power/* cat: read error: Input/output error auto 0 unsupported 0 enabled 0 0 1 0 0 3450054 0 0 # ls -l /sys/class/net/eth0/device/ driver/ net/ subsystem/ wakeup/ driver_override of_node/ uevent modalias power/ unimac-mdio.0/ # ls -l /sys/class/net/eth0/device/power/wakeup wakeup wakeup_active_count wakeup_last_time_ms wakeup_abort_count wakeup_count wakeup_max_time_ms wakeup_active wakeup_expire_count wakeup_total_time_ms # ls -l /sys/class/net/eth0/device/power/wakeup^C # ls -l /sys/class/wakeup/wakeup wakeup0/ wakeup1/ wakeup2/ # ls -l /sys/class/wakeup/wakeup2/ total 0 -r--r--r-- 1 root root 4096 Jan 1 00:59 active_count -r--r--r-- 1 root root 4096 Jan 1 00:59 active_time_ms lrwxrwxrwx 1 root root 0 Jan 1 00:59 device -> ../../../47d580000.ethernet -r--r--r-- 1 root root 4096 Jan 1 00:59 event_count -r--r--r-- 1 root root 4096 Jan 1 00:59 expire_count -r--r--r-- 1 root root 4096 Jan 1 00:59 last_change_ms -r--r--r-- 1 root root 4096 Jan 1 00:59 max_time_ms -r--r--r-- 1 root root 4096 Jan 1 00:59 name -r--r--r-- 1 root root 4096 Jan 1 00:59 prevent_suspend_time_ms lrwxrwxrwx 1 root root 0 Jan 1 00:59 subsystem -> ../../../../../../class/wakeup -r--r--r-- 1 root root 4096 Jan 1 00:59 total_time_ms -rw-r--r-- 1 root root 4096 Jan 1 00:59 uevent -r--r--r-- 1 root root 4096 Jan 1 00:59 wakeup_count # cat /sys/class/wakeup/wakeup2/* 1 0 cat: read error: Is a directory 1 0 3450054 0 47d580000.ethernet 0 cat: read error: Is a directory 0 0 # -- Florian