Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3324579ybh; Mon, 5 Aug 2019 16:30:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWv7ZwI6/upFPb2T5uy0HJ7bqs6klBc3knmmIJHWS6CS3DrTPTqQhbm3WAcMojhC8quSxX X-Received: by 2002:a17:90a:1aa4:: with SMTP id p33mr192257pjp.27.1565047841698; Mon, 05 Aug 2019 16:30:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565047841; cv=none; d=google.com; s=arc-20160816; b=j6p83Y+2fPON/0RXjK8RiHOpx7cXFAoD8ACDSr166ktJdZf+j4XcBhYXLqbpjTGou7 UG957ccLSN1u0voxLWWtrQ8wzAZDAeNciV4K384xaJjtTbCaUfsJmMxySL75tUb3HlH1 36EiXY66bBYJodYYAtAELW+qJUqkxnN6BeXfLuR0FTvmly+qp3GUnBUH3BQDJr5vEUSb QbcYa0o1ayPlmsJo+IT2dW6uoxWg1W9dCONz+Rt7vEjf/w1wsPACXZh/9blLnNSQvfNb WBi6l2YUQrzSatvF3w3sk/ibXGd7Qs7UQjjUszCQEjYGPHWaXPt9ob3Pjk91bFSwzGeU fw/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:user-agent:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :message-id:dkim-signature; bh=wiloosTmjjcp4t7af0k+zFA/+KwYN5hZVuPSy0bPbrI=; b=dShai3HxTw6lGopNYV86di6QkbAgEWfmVw35DhQfv57jdyC0ed/mDYmUf4J4vNruHs pE++HA9sjbmqr4MV3wlbzmoQGipE1kRa9GWDOdjpvabM2S770tTV/YjsDQv0szhIIo8X lxdkLqqcAri2ajAMEjGbTUwlEzA4wiHvI0/+pdE2YMO5jyuoyFZcOIna7fWPu7qDCZBI 0J+nDVHJ8+xlJCXeSuUc8c1qUhSLndJHrC7Ob4kXZbo4UFmeigEsp64wwmFobICnpfkb JIbxbnLcExSQmHJnJ/HeZd9k0tUPjwq7YiKPTfL3P2aemmNpVD7ehPKMDfm70PqOc2Wi YAYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GdnnKcwe; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2si46242727pfb.206.2019.08.05.16.30.18; Mon, 05 Aug 2019 16:30:41 -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; dkim=pass header.i=@chromium.org header.s=google header.b=GdnnKcwe; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730717AbfHEX3I (ORCPT + 99 others); Mon, 5 Aug 2019 19:29:08 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:40421 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728483AbfHEX3I (ORCPT ); Mon, 5 Aug 2019 19:29:08 -0400 Received: by mail-pl1-f194.google.com with SMTP id a93so36992986pla.7 for ; Mon, 05 Aug 2019 16:29:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=message-id:mime-version:content-transfer-encoding:in-reply-to :references:subject:from:cc:to:user-agent:date; bh=wiloosTmjjcp4t7af0k+zFA/+KwYN5hZVuPSy0bPbrI=; b=GdnnKcweqVjIAEhLjUJNZNvqAep6YhW4RCIOksr4IDGFPqFlHO2IEreaXiUu3OzvL/ Ag7GsiKXIZ6ylTXI00xXEtujmVXoaUw1m6Ov7RMSt9CIx0vwd1vIrNfVGGH2rKhbOisy KwdKzXb3TioAZW2MZIzoBE0/nHalWXsEJp0D0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:mime-version :content-transfer-encoding:in-reply-to:references:subject:from:cc:to :user-agent:date; bh=wiloosTmjjcp4t7af0k+zFA/+KwYN5hZVuPSy0bPbrI=; b=LlviW94yWwty12IhcLYJAb2lS0rV+N3UyQn/k6Jk88MgIxrRhYUaw7a/qljlQ/if3c asr+ixHdcqpC3bQW7KZ4HV6avN+kGyZY+WVIm6SU9FEMQv+SvKh+HPjtU5QflXsTOgMi rwRSkqc2mSpxbwp56wTQuvWeGD+3bFGWyE7GLJrhdypJ1xAUs49YHrtdA9GTq9zGLLQD AqxBEcVu5A/I5xqEz+LLkqzanpnuh5eV30Qv2uKkkREt+0+cnh4P8b66ejFdKJLds/8Z QRBmcVDbpTdzSTW+uyZ0MUuD/y3KZQvR8nqurfNAbkZhGMQTPeOPhQhnDImCmV+mVF/d tXJA== X-Gm-Message-State: APjAAAXUKRKT7c4gYTzm0Z7R0RRfCHLBf25P0SO3G/nfF4KUIo8UdG3W QycKpEMuK7tfz+N2t8TkAqYlCw== X-Received: by 2002:a17:902:b909:: with SMTP id bf9mr204057plb.309.1565047747318; Mon, 05 Aug 2019 16:29:07 -0700 (PDT) Received: from chromium.org ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id p65sm84534701pfp.58.2019.08.05.16.29.06 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 16:29:06 -0700 (PDT) Message-ID: <5d48bbc2.1c69fb81.62114.5473@mx.google.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20190805175848.163558-4-trong@android.com> References: <20190805175848.163558-1-trong@android.com> <20190805175848.163558-4-trong@android.com> Subject: Re: [PATCH v7 3/3] PM / wakeup: Show wakeup sources stats in sysfs From: Stephen Boyd Cc: rafael@kernel.org, hridya@google.com, sspatil@google.com, kaleshsingh@google.com, ravisadineni@chromium.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, kernel-team@android.com, Tri Vo To: Tri Vo , gregkh@linuxfoundation.org, rjw@rjwysocki.net, viresh.kumar@linaro.org User-Agent: alot/0.8.1 Date: Mon, 05 Aug 2019 16:29:05 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Tri Vo (2019-08-05 10:58:48) > diff --git a/drivers/base/power/wakeup_stats.c b/drivers/base/power/wakeu= p_stats.c > new file mode 100644 > index 000000000000..3a4f55028e27 > --- /dev/null > +++ b/drivers/base/power/wakeup_stats.c > @@ -0,0 +1,161 @@ [...] > +/** > + * wakeup_source_sysfs_add - Add wakeup_source attributes to sysfs. > + * @parent: Device given wakeup source is associated with (or NULL if vi= rtual). > + * @ws: Wakeup source to be added in sysfs. > + */ > +int wakeup_source_sysfs_add(struct device *parent, struct wakeup_source = *ws) > +{ > + struct device *dev; > + > + dev =3D device_create_with_groups(wakeup_class, parent, MKDEV(0, = 0), ws, > + wakeup_source_groups, "wakeup%d", > + ws->id); > + if (IS_ERR(dev)) > + return PTR_ERR(dev); > + ws->dev =3D dev; > + pm_runtime_no_callbacks(ws->dev); Does this only avoid adding runtime PM attributes? I thought we would call device_set_pm_not_required() on the device here. Probably requiring a bit of copy/paste from device_create_with_groups() so that it can be set before the device is registered. Or another version of device_create_with_groups() that does everything besides call device_add(). > + > + return 0; > +} > +EXPORT_SYMBOL_GPL(wakeup_source_sysfs_add); > +