Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2615787ybd; Thu, 27 Jun 2019 15:58:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgBrmoQiX+875wo5vni1mG/T8vE/qbLTDaorf44PSyQuifx7NM+SHACx7PTJKfbkjjhrQN X-Received: by 2002:a65:64d3:: with SMTP id t19mr89192pgv.112.1561676333326; Thu, 27 Jun 2019 15:58:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561676333; cv=none; d=google.com; s=arc-20160816; b=HaPi31b5vnlv/lihqJv6DhxAme7O8cX/P6XTp7GC7Q+DWgelcVcvIr0rX1D8SrxxZT mnNq3EW+5qp+rBGXHq6GGHMQZz7w7tqtXauDf7V17RAgRNHzuR9E+MBOQ64ao1jQ3GHq abQXsWvDlisFSb8FraqyY1/UL6CLPv6UOABQbUC9xr/kYCo8b/0mguVCE+TxNzO9aw37 FdUeJpwglylwvWm4p0/KUjz4J5kzt9KMqqzsOu/QPWI9ADioQSfeE1wKl9tv7GzDk9r9 8jCaSCLrd62N2bAGuY03Z40koV087aaksKTQkgrWRQWkx+1wlNYDlUNeUX6DlPlByz3b 2zDg== 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=scI9xH5QTIptTJudFoOALtkbeV4cljG3jybWqqwH29M=; b=EkkLmojtNwEMbV25X6I9S6vFFDDBkdCbZWqj8S/3Gm1xDV0pRInVyeeY+o2KwwxpQf fTxeH/6qdw0BSo+QotDRzbNQ61r2RjSW4tLe02Br1tnT3EBYrtVss7y0HAZdA7c+vBY2 8dK+RHlYfNc+fgx8qiLVP9CUTdQxKWJZfGBNkOo7ZGB3r+f3ACc59k3xxtt9IEEVDsbf TaZrV7OOkDRzaGdbGrasA28+iH2BUEHJHx49Ty16I0Ja8D5WrNBG7onNjf5nnVxKTuBh gOul4M0HXUFDoYhZq9i7Wb4AxQm/jwbSBXr5eGEWo+wMHrRdGR9sSASKa6yM23R2AHKv h8Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=lzNeIxjh; 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 j14si374361pgj.519.2019.06.27.15.58.35; Thu, 27 Jun 2019 15:58:53 -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=lzNeIxjh; 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 S1726596AbfF0W5S (ORCPT + 99 others); Thu, 27 Jun 2019 18:57:18 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:41008 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726567AbfF0W5S (ORCPT ); Thu, 27 Jun 2019 18:57:18 -0400 Received: by mail-oi1-f193.google.com with SMTP id g7so2830789oia.8 for ; Thu, 27 Jun 2019 15:57:18 -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=scI9xH5QTIptTJudFoOALtkbeV4cljG3jybWqqwH29M=; b=lzNeIxjhGX5LiRIdNnCz242+TWgFtnYUcwfRc66LhW+zqc2cWbPYRyv9JLV7LLz2L8 a7GMdfELV4pXkrVqRQ20l7nuoIr4S+GFQaHtfw9glxPJ9RWhI0W4G9FBPo8mlqQk3wqu u5mZVfHTVbUokMdQZLqAqeNklj9ZNOcj613+6njKSKX0pBADLToDIKB+gq/8p02uUt/7 ouv8vDuhLw17mG4tjvvRhIZ3jXZPNc3aePVsSLW218VBzp4hwt/YjwRajPd/t3ySeryo NnmwR9zT6JwqTGZRGcdpgSSQP9/8FDI2ci5AlXXucZb8CGXA+4MoHBNPVgnMbVRNdwfd T9Vg== 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=scI9xH5QTIptTJudFoOALtkbeV4cljG3jybWqqwH29M=; b=OCMGCA01oTxveX/w5tuBoERb5nm3ontwHW+VOUAkOuHb0NR053ujX90Qm1JxmCHPSW iduuZcoEYAdV/agTVIMXwrqx87wMBr76R/rH21DgF9ACYLLkwbomVB4U73sWZcv+EeS0 pgPbDyKIZopl9KFYAe6yRC+4AYwGdkW6a5V6rqEUZmwdqH3newiAk98BXA4VLfa9D+xI ZR+rokwueQX9OFdb5E7cO2kCnOzEoAVVyEnq9siMrAOGpBcAyT4DtKendvbvASsq8x+4 HY9Rcze1QrTkXXC534Mzhluu+QNdIltyEHTPKx0dqJxyD3VWgo5NkyZY04/Ox5Wjlu+b 49kA== X-Gm-Message-State: APjAAAVhbti0ohbxca9/1abMHOoQ4wbPM05qP9oBYRXt2I8K9u3lGPN0 Zbbt2RC9+jdQx1J7PW2UT6hU+RoGiI3QHdNC4irycw== X-Received: by 2002:aca:af55:: with SMTP id y82mr4917oie.172.1561676237533; Thu, 27 Jun 2019 15:57:17 -0700 (PDT) MIME-Version: 1.0 References: <20190626005449.225796-1-trong@android.com> <20190626011221.GB22454@kroah.com> <20190627000412.GA527@kroah.com> In-Reply-To: <20190627000412.GA527@kroah.com> From: Tri Vo Date: Thu, 27 Jun 2019 15:57:06 -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 Wed, Jun 26, 2019 at 5:04 PM Greg KH wrote: > > On Wed, Jun 26, 2019 at 03:48:58PM -0700, Tri Vo wrote: > > 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. > > What is "foo" here? You didn't include Documentation of the sysfs > files so it was pretty impossible to say what exactly your heirachy was > going to be in order to determine this :) Sorry about that. I sent out a new version of the patch with updated documentation.