Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1334083ybd; Wed, 26 Jun 2019 15:49:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqznZ5C9Nl2Uk7iadYzEyXxs3zrdADWLQnRQmNM8u7PeUGo5VKQmWL/OPGFZpGBNC9dRk2eP X-Received: by 2002:a63:9548:: with SMTP id t8mr395393pgn.256.1561589390544; Wed, 26 Jun 2019 15:49:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561589390; cv=none; d=google.com; s=arc-20160816; b=dumfxXK7NHuhOkYGSfTcaVKAGX9osN4xk2vwvSG5bUGQGiB68d5OAZC28/utLm3xxU yeppPSbkPwZnW+0AXZktOaFPm+Tqj3OABynJ8GF9B8Y5guWtE0Rp5QKAopkYecMYwWG9 +KqpaYHnZyfkrRbgLm7oLHhbKAwihNrzy9U3DBpX5z8gsa83lyx5Rnk78z/hu79ix8+h Xw5DLgDH/c5XGpAtCnmeTeaSVfTECvfE/3CmhXVoqUh/tpX7OnWlzVWY8ligmLK89HOw 3HkgeoxQdB6NbTdRhQKp+vP2RXMOsnyCl9nZM7d3PwWX8YLanttildV6Re9j0P7b0add SmgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=c0kP6eyZ5Tl3qjozgE4k99bkRxQJ3H09e9k9c5FyUWQ=; b=ns5HakVDhhOx+odqYFZkNE6Y0WHQp/G4ulmZ1SPcK/d3apeRqs+PPjAVflnoqLXbWa 5BVSdKAAUEIgv6f0Ztv+A7JEUZfdq7ZM3LkYTIRSQ4DaPSyvLJ5OM0+If5HbSD7Z7+Su HCjsN+l/V+QVOLnbScFVuzTzgTPU94fN3oZznzxrgJTqq7pS+oG3l9fNM+c2Gt2wJhZD FzEPuIOJUcQ5PSSM4lZD+uiv3CmSINzbNDqgcI3YowTgpsf9xmqKKacVpyJbi8C5JLQe TI3wsNvGOKFHc5+CRNOJO+S78dnUHcpQwe1AMuu6i89UL9V2yR7iQuvAjf6y4gm1Po02 plHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b="Tw/gev90"; 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=REJECT sp=REJECT dis=NONE) header.from=android.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d18si354367pls.423.2019.06.26.15.49.34; Wed, 26 Jun 2019 15:49:50 -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=@android.com header.s=20161025 header.b="Tw/gev90"; 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=REJECT sp=REJECT dis=NONE) header.from=android.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726487AbfFZWtK (ORCPT + 99 others); Wed, 26 Jun 2019 18:49:10 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:37286 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726472AbfFZWtK (ORCPT ); Wed, 26 Jun 2019 18:49:10 -0400 Received: by mail-oi1-f195.google.com with SMTP id t76so96767oih.4 for ; Wed, 26 Jun 2019 15:49:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=c0kP6eyZ5Tl3qjozgE4k99bkRxQJ3H09e9k9c5FyUWQ=; b=Tw/gev90iyMsc/dD5bpBpfe6EbDeuQxWxztgIG1Tb0wvkgNK5zj66ER2rhFYtEbxiO ShXF7vBXsz61cy5UGxfGLTeF/jDqCW2uf2qhX4bW0mK7ocWgq5Y9Fs1RCDllx5yiLKP9 xc411xHAStEVucb+J3FgI1sIEsS66my+EwH/qJIyasK57+GBEKfJYp7I8IOMy03vMelw PgMBwf3I6nAVD4Jfq6Igz6lM0TzZAwMU0KU6ROsQqd8kCaC/xO0ndSkm7hpG5/MjIfKb yvUrNFU/uaK4p25k85X9Fzce/IY57/WjHzzKten4XsXBCYpFdGmhTIP3Cm0PM7i4CS73 iKdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=c0kP6eyZ5Tl3qjozgE4k99bkRxQJ3H09e9k9c5FyUWQ=; b=fPWDfNhE83S0rFCRXhuuRB4DG2NLYYSF5b8S99X4tYxSJSHexM14iujLNgYN6cxmuk OQbZRf2+koAsijgFDgVXNci1C47CXUs9RpNHgDVoSUBN/AVRtBDrLmC6u/b/289RIg/z YNK4BMDBZgxtC0XlFL3ymBX+Bb415G1fRFGCT3rFICgxZ9w02+ZrLfiuxQ7pY1ijtLm+ gEWWXaniWS+GSN+j4YYl697kUmG1ST0aPy50xiUcJkcv4eZ9NvbdkVh74ASM+eHcWkVz 3mdHDr9SdJoiiR8LKdzgwB3NzXWDz59E9DOBA6B4nM2iAlN0ZEgK7vw6EjeRwEnfsp/N gU6g== X-Gm-Message-State: APjAAAVwCY32MGXKZ8K6AwLjz26j2uzLOtJFWV/vD0Z6eE8XDcu0/LH3 pLQQSB1oQXKjXMWxUCqux4LyVfilBiPTV0sytEnupA== X-Received: by 2002:aca:af55:: with SMTP id y82mr463012oie.172.1561589349384; Wed, 26 Jun 2019 15:49:09 -0700 (PDT) MIME-Version: 1.0 References: <20190626005449.225796-1-trong@android.com> <20190626011221.GB22454@kroah.com> In-Reply-To: From: Tri Vo Date: Wed, 26 Jun 2019 15:48:58 -0700 Message-ID: Subject: Re: [PATCH] PM / wakeup: show wakeup sources stats in sysfs To: Greg KH Cc: "Rafael J. Wysocki" , Viresh Kumar , "Rafael J. Wysocki" , Hridya Valsaraju , Sandeep Patil , LKML , Linux PM , "Cc: Android Kernel" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 25, 2019 at 6:33 PM Tri Vo wrote: > > On Tue, Jun 25, 2019 at 6:12 PM Greg KH wrote: > > > > On Tue, Jun 25, 2019 at 05:54:49PM -0700, Tri Vo wrote: > > > Embedding a struct kobject into struct wakeup_source changes lifetime > > > requirements on the latter. To that end, change deallocation of struct > > > wakeup_source using kfree to kobject_put(). > > > > Ick, are you sure you need a new kobject here? Why wouldn't a named > > attribute group work instead? That should keep this patch much smaller > > and simpler. > > Yeah, named attribute groups might be a much cleaner way to do this. > Let me investigate. Say, we read /sys/power/wakeup_sources/foo/active_count. This attribute's show function needs to find wakeup_source struct of "foo". I'm not sure how to do that without embedding a kobject inside of wakeup_source.