public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <Sudeep.Holla@arm.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Sudeep.Holla@arm.com,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Rob Herring <robh@kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>
Subject: Re: [PATCH RFC/RFT v2 1/8] drivers: base: support cpu cache information interface to userspace via sysfs
Date: Wed, 19 Feb 2014 16:04:32 +0000	[thread overview]
Message-ID: <5304D610.1060504@arm.com> (raw)
In-Reply-To: <20140218215344.GC20495@kroah.com>

Hi Greg,

On 18/02/14 21:53, Greg Kroah-Hartman wrote:
> On Thu, Feb 13, 2014 at 03:55:47PM +0000, Sudeep Holla wrote:
>> Hi Greg,
>> On 11/02/14 00:13, Greg Kroah-Hartman wrote:
[...]
>>> Make the cpu devices be part of a class?
>>
>> I was able to convert these to use struct device instead of raw kobjects. But it
>> requires some changes in order to retain the existing sysfs path mainly due to
>> the fact that cpus are using legacy subsys_system_register and introducing
>> cpu_class conflicts with cpu bus. The base changes in the driver core is as
>> below. Is this acceptable ? or any other alternate suggestions ?
>>
>> --->8
>>  drivers/base/bus.c  | 2 ++
>>  drivers/base/core.c | 8 ++++++++
>>  drivers/base/cpu.c  | 7 +++++++
>>  include/linux/cpu.h | 2 ++
>>  4 files changed, 19 insertions(+)
>>
>> diff --git a/drivers/base/bus.c b/drivers/base/bus.c
>> index 59dc808..c33bfdb 100644
>> --- a/drivers/base/bus.c
>> +++ b/drivers/base/bus.c
>> @@ -518,10 +518,12 @@ int bus_add_device(struct device *dev)
>>  						&dev->kobj, dev_name(dev));
>>  		if (error)
>>  			goto out_id;
>> +		if (!dev->class) {
>>  			error = sysfs_create_link(&dev->kobj,
>>  				&dev->bus->p->subsys.kobj, "subsystem");
>>  			if (error)
>>  				goto out_subsys;
>> +		}
>>  		klist_add_tail(&dev->p->knode_bus, &bus->p->klist_devices);
>>  	}
>>  	return 0;
> 
> This change worries me, does it cause anything else to happen in sysfs
> that looks differently from what it does today?
> 
Yes, I found that out 2 days back and have now fixed it, the above change is
removed. It's now handled in device_{add,remove}_class_symlinks correctly.

>> diff --git a/drivers/base/core.c b/drivers/base/core.c
>> index 2b56717..ef81984 100644
>> --- a/drivers/base/core.c
>> +++ b/drivers/base/core.c
>> @@ -10,6 +10,7 @@
>>   *
>>   */
>>
>> +#include <linux/cpu.h>
>>  #include <linux/device.h>
>>  #include <linux/err.h>
>>  #include <linux/init.h>
>> @@ -759,6 +760,8 @@ static struct kobject *get_device_parent(struct device *dev,
>>  			return &block_class.p->subsys.kobj;
>>  		}
>>  #endif
>> +		if (dev->class == cpu_class)
>> +			return &parent->kobj;
> 
> I don't think this is ok :)
> 
> Oh wait, we do this for disk classes today, ick, ok, nevermind, but
> comment it really well please.
> 

Yes I was initially worried but I don't see any other way to retain the sysfs
paths as is. I have commented it well enough now in the patch IMO. I will send
v3 series soon.

Regards,
Sudeep


  reply	other threads:[~2014-02-19 16:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07 16:49 [PATCH RFC/RFT v2 0/8] drivers: cacheinfo support Sudeep Holla
2014-02-07 16:49 ` [PATCH RFC/RFT v2 1/8] drivers: base: support cpu cache information interface to userspace via sysfs Sudeep Holla
2014-02-07 19:29   ` Greg Kroah-Hartman
2014-02-10 18:09     ` Sudeep Holla
2014-02-11  0:13       ` Greg Kroah-Hartman
2014-02-13 15:55         ` Sudeep Holla
2014-02-17 18:26           ` Sudeep Holla
2014-02-18 21:53           ` Greg Kroah-Hartman
2014-02-19 16:04             ` Sudeep Holla [this message]
2014-02-07 16:49 ` [PATCH RFC/RFT v2 2/8] ia64: move cacheinfo sysfs to generic cacheinfo infrastructure Sudeep Holla
2014-02-07 16:49 ` [PATCH RFC/RFT v2 3/8] s390: " Sudeep Holla
2014-02-10  9:50   ` Heiko Carstens
2014-02-10 11:34     ` Sudeep Holla
2014-02-10 11:59       ` Heiko Carstens
2014-02-10 11:30   ` Heiko Carstens
2014-02-10 11:36     ` Sudeep Holla
2014-02-17 18:36     ` Sudeep Holla
2014-02-18  9:45       ` Heiko Carstens
2014-02-07 16:49 ` [PATCH RFC/RFT v2 4/8] x86: " Sudeep Holla
2014-02-07 16:49 ` [PATCH RFC/RFT v2 5/8] powerpc: " Sudeep Holla
2014-02-07 16:49 ` [PATCH RFC/RFT v2 6/8] ARM64: kernel: add support for cpu cache information Sudeep Holla
2014-02-07 16:49 ` [PATCH RFC/RFT v2 7/8] ARM: " Sudeep Holla
2014-02-07 16:49 ` [PATCH RFC/RFT v2 8/8] ARM: kernel: add outer cache support for cacheinfo implementation Sudeep Holla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5304D610.1060504@arm.com \
    --to=sudeep.holla@arm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox