Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp189438ybp; Thu, 3 Oct 2019 12:04:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqztgJfcbmFg+8O53EROTkqPrLyAzKJr6/c9aTkD7e5v7q0uE1wEMSyQFgmGBTfDHiOHExoA X-Received: by 2002:aa7:c2ce:: with SMTP id m14mr11288579edp.191.1570129495182; Thu, 03 Oct 2019 12:04:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570129495; cv=none; d=google.com; s=arc-20160816; b=V2puRwtowWRSVTek6fQ4boNdfiXxWZ8SX+NO9+Jn5dheg76qkN3//rdOde/oODGjsq H4oX7pin+bpC1A2Zk2kn+d4/vktb1K8BOmYxCgtmU0gd8AOAIhwdOXEM7nF3dpIMh+e3 GjGxJ5L3Xu4IwnQEeuN2nviVzBu6U0oWfn18s/sl2eHg+D3f1kDwjSM3BhXDRhe63Row 0zkW2ZxFNb/iyYfZCMOcLJ1sKhd5dmmujr/0HYr5xcPgX+t2hwtELwwakWtjv62FGCWt NV6iB5nFvwaFKT4GelSrqqcRSWf2/fBolzB4L+RcVnV8k2AX8dEPbn8QuLTy5RBXrYbh sjYQ== 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:dkim-signature; bh=EEFi8KuQPmsvuVSvMhQGmLgca9P8uZqFjJ3+x93ifJk=; b=uHjGcUTaPctYG/bkRcClYJWAGav/U/0JKW8XL9JLaP7VqEtt6xfV7MHmwmifQ7ApZS IDK6I4lQIDKEIlgrw13rxK15AmZOdD+kCXxUCgHOyu+3lgbwgDx74qxh4lK+YUrP93x5 pwYhCEqz0y/7EKNvD3Q+BGHyZJqoRXekySxO1oMnYNwTKL7PXlKJIsuyK6WnvhdvgDgI gjK5dyCcj2DROucIN9/mX1Z0Fs8nDZVqX4xrkX60ft0T23q03FgxFLrSitV11lFRBFn0 0rBMVxXBqnZcVtSJ19mapPNmXjtGAcxl8M12cHqYxEUP7xICeYkCKhPioHGj/f5hnoBV uKRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WcgyBnoZ; 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 gl26si1767971ejb.17.2019.10.03.12.04.30; Thu, 03 Oct 2019 12:04:55 -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=@kernel.org header.s=default header.b=WcgyBnoZ; 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 S2387970AbfJCS2g (ORCPT + 99 others); Thu, 3 Oct 2019 14:28:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:43172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730777AbfJCS2g (ORCPT ); Thu, 3 Oct 2019 14:28:36 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9E09F20867; Thu, 3 Oct 2019 18:28:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570127315; bh=qWk4KL6IyNbqywj/uje+OIlaPyHD8QGpGwTbJRVklwE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WcgyBnoZyTyLNZOz6eCaddr2qnZYTEmT87GxGsWbv3DYmCYVaNTKJUPJvqWu6G54E QzbO4Tn1rK4yGqXbPheOYQcrWMtDuM1TeCIJ3CojBMYbz1j3cm+KPSJILJAZHlVQfr UEjWfb9msH4XqwES2fLv6msgYEbgtCvnoHrmrHKE= Date: Thu, 3 Oct 2019 20:28:32 +0200 From: Greg KH To: mnalajal@codeaurora.org Cc: rafael@kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org Subject: Re: [PATCH] base: soc: Handle custom soc information sysfs entries Message-ID: <20191003182832.GA3579521@kroah.com> References: <1570061174-4918-1-git-send-email-mnalajal@codeaurora.org> <20191003070502.GB1814133@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 03, 2019 at 11:17:39AM -0700, mnalajal@codeaurora.org wrote: > On 2019-10-03 00:05, Greg KH wrote: > > On Wed, Oct 02, 2019 at 05:06:14PM -0700, Murali Nalajala wrote: > > > Soc framework exposed sysfs entries are not sufficient for some > > > of the h/w platforms. Currently there is no interface where soc > > > drivers can expose further information about their SoCs via soc > > > framework. This change address this limitation where clients can > > > pass their custom entries as attribute group and soc framework > > > would expose them as sysfs properties. > > > > > > Signed-off-by: Murali Nalajala > > > --- > > > drivers/base/soc.c | 26 ++++++++++++++++++-------- > > > include/linux/sys_soc.h | 1 + > > > 2 files changed, 19 insertions(+), 8 deletions(-) > > > > Can you change a soc driver to use this? I don't think that this patch > > works because: > > > > > > > > diff --git a/drivers/base/soc.c b/drivers/base/soc.c > > > index 7c0c5ca..ec70a58 100644 > > > --- a/drivers/base/soc.c > > > +++ b/drivers/base/soc.c > > > @@ -15,6 +15,8 @@ > > > #include > > > #include > > > > > > +#define NUM_ATTR_GROUPS 3 > > > + > > > static DEFINE_IDA(soc_ida); > > > > > > static ssize_t soc_info_get(struct device *dev, > > > @@ -104,11 +106,6 @@ static ssize_t soc_info_get(struct device *dev, > > > .is_visible = soc_attribute_mode, > > > }; > > > > > > -static const struct attribute_group *soc_attr_groups[] = { > > > - &soc_attr_group, > > > - NULL, > > > -}; > > > - > > > static void soc_release(struct device *dev) > > > { > > > struct soc_device *soc_dev = container_of(dev, struct soc_device, > > > dev); > > > @@ -121,6 +118,7 @@ static void soc_release(struct device *dev) > > > struct soc_device *soc_device_register(struct soc_device_attribute > > > *soc_dev_attr) > > > { > > > struct soc_device *soc_dev; > > > + const struct attribute_group **soc_attr_groups = NULL; > > > int ret; > > > > > > if (!soc_bus_type.p) { > > > @@ -136,10 +134,20 @@ struct soc_device *soc_device_register(struct > > > soc_device_attribute *soc_dev_attr > > > goto out1; > > > } > > > > > > + soc_attr_groups = kzalloc(sizeof(*soc_attr_groups) * > > > + NUM_ATTR_GROUPS, GFP_KERNEL); > > > + if (!soc_attr_groups) { > > > + ret = -ENOMEM; > > > + goto out2; > > > + } > > > + soc_attr_groups[0] = &soc_attr_group; > > > + soc_attr_groups[1] = soc_dev_attr->custom_attr_group; > > > + soc_attr_groups[2] = NULL; > > > > You set this, but never do anything with it that I can see. What am I > > missing? > no, since i am using the "soc_attr_groups" name as it here you do not see > the assignment below. > It is something like this soc_dev->dev.groups = soc_attr_groups; Ah, I see that now. Tricky :) nice work, greg k-h