Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp524699ybl; Wed, 14 Aug 2019 01:41:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzn6HfCrqa4WedTjGyRbGuo3aS+BdDAJ8wFvj5bsm2dF2b48Hi8s8OvEamk4+Pzj2coiEq5 X-Received: by 2002:aa7:9254:: with SMTP id 20mr46731290pfp.212.1565772116938; Wed, 14 Aug 2019 01:41:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565772116; cv=none; d=google.com; s=arc-20160816; b=sTrhZ7NoFJIfxdHdrnAY9/g2m3IC3UZ+RzdLQHJdrgGQCMluMYgH5Ef9C+u4ygIP8j d0FDc5vg/XtdJAZOy/Q0ZWas9ivLW6TBDXXR1ZOJHKGFY1P3pTcfBgCLVQ9nyU7+jv3y COeqzfyStDrwqv7VFHsl16TVc9jJPO694AqcP3zPy1oW1b3r+6pXhBD2qouIcfWqZhvG /IA1xEAocodgXbGZl6ZYqURHV9hIjX1K5LmuwsWjLQ29zIwLYyOIEjM2aj1bsG5c4Iac Gdc70Pr8gUl2l/MxkyCLzydWpAP8CXks6Zllot97TN+xBxSZLERFMSiccFd/AyJuSaNq 7wJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Jutf1FLa9HJkm0tS7RVVA1pUn2YKCxQwBFQbk5iS30c=; b=N2tKi4Rj8FrsytGDVzrgrkjV74XjdFKBQUqGcvMgZLaDJcQVKUcgNkILkVshDq3hwj fZ0sCP3rgpdEoZCS+tzQacgj0BGKUAiRf4khfbovI5XpVcd3P2Adn+FZLsO6qkdWNWjN /vHRcWO7OpS75DOMx3IkNxTtwFemDbCO506IwkA2TV3auoWdD/iyA7BMA+EQ/9+NC0SZ EpadZ9XWm7HGvJZiGP1/SYOusA/MAQz3EX34aKKOmSnAy5G3AAt8DScLPAnYNyl6V1R/ 7jgHQqGj1ZedPCL4kybNfpBBUmHm90XG6AHJsEx2JDRWErVC1Cbo5egEA8edvakVKRom 0r9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r8si2484571pjq.62.2019.08.14.01.41.40; Wed, 14 Aug 2019 01:41:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726760AbfHNIkT (ORCPT + 99 others); Wed, 14 Aug 2019 04:40:19 -0400 Received: from muru.com ([72.249.23.125]:57480 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725928AbfHNIkS (ORCPT ); Wed, 14 Aug 2019 04:40:18 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 9F1CE80C8; Wed, 14 Aug 2019 08:40:45 +0000 (UTC) Date: Wed, 14 Aug 2019 01:40:14 -0700 From: Tony Lindgren To: Stephen Boyd Cc: Qian Cai , Tri Vo , Dmitry Torokhov , Peter Zijlstra , Greg Kroah-Hartman , rafael@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: "PM / wakeup: Show wakeup sources stats in sysfs" causes boot warnings Message-ID: <20190814084014.GB52127@atomide.com> References: <1565731976.8572.16.camel@lca.pw> <5d53b238.1c69fb81.d3cd3.cd53@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5d53b238.1c69fb81.d3cd3.cd53@mx.google.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Stephen Boyd [691231 23:00]: > I also notice that device_set_wakeup_capable() has a check to see if the > device is registered yet and it skips creating sysfs entries for the > device if it isn't created in sysfs yet. Why? Just so it can be called > before the device is created? I guess the same logic is handled by > dpm_sysfs_add() if the device is registered after calling > device_set_wakeup_*(). Hmm just guessing.. It's maybe because drivers can enable and disable the wakeup capability at any point for example like driver/net drivers do based on WOL etc? > There's two approaches I see: > > 1) Do a similar check for device_set_wakeup_enable() and skip > adding the wakeup class until dpm_sysfs_add(). > > 2) Find each case where this happens and only call wakeup APIs > on the device after the device is added. > > I guess it's better to let devices have wakeup modified on them before > they're registered with the device core? I think we should at least initially handle case #1 above as multiple places otherwise seem to break. Then maybe we could add a warning to help fix all the #2 cases if needed? Regards, Tony