From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751700AbdFHSXu (ORCPT ); Thu, 8 Jun 2017 14:23:50 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33306 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751670AbdFHSXt (ORCPT ); Thu, 8 Jun 2017 14:23:49 -0400 Date: Thu, 8 Jun 2017 20:22:53 +0200 From: Greg KH To: Felix Schnizlein Cc: linux-kernel@vger.kernel.org, x86@vger.kernel.org, yanmin.zhang@intel.com, trenn@suse.com Subject: Re: [RFC PATCH 1/3] Add sysfs based cpuinfo structure. Message-ID: <20170608182253.GB13995@kroah.com> References: <1496940975-9164-1-git-send-email-fschnizlein@suse.com> <1496940975-9164-2-git-send-email-fschnizlein@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1496940975-9164-2-git-send-email-fschnizlein@suse.com> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 08, 2017 at 06:56:13PM +0200, Felix Schnizlein wrote: > Create a new sysfs attribute group called 'cpuinfo' for each > online cpu. The cleaned up cpuinfo shows up in a sysfs > subdirectory here: /sys/devices/system/cpu/cpu*/cpuinfo. > > Define preprocessor macros (CPUINFO_DEFINE_* and CPUINFO_ATTR) to make > defining new sysfs attributes for cpuinfo more easy. > > Signed-off-by: Thomas Renninger But not you? > --- > drivers/base/Kconfig | 7 ++++++ > drivers/base/Makefile | 1 + > drivers/base/cpuinfo.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++ > include/linux/cpuhotplug.h | 1 + > include/linux/cpuinfo.h | 47 ++++++++++++++++++++++++++++++++++++++ > 5 files changed, 113 insertions(+) > create mode 100644 drivers/base/cpuinfo.c > create mode 100644 include/linux/cpuinfo.h > > diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig > index d718ae4..7900e31 100644 > --- a/drivers/base/Kconfig > +++ b/drivers/base/Kconfig > @@ -224,6 +224,13 @@ config DEBUG_TEST_DRIVER_REMOVE > unusable. You should say N here unless you are explicitly looking to > test this functionality. > > +config CPUINFO_SYSFS > + bool "Enable sysfs based cpuinfo" > + depends on SYSFS && X86 > + default y > + help > + This option enables cpuinfo in sysfs. > + > source "drivers/base/test/Kconfig" > > config SYS_HYPERVISOR > diff --git a/drivers/base/Makefile b/drivers/base/Makefile > index f2816f6..cbbba07 100644 > --- a/drivers/base/Makefile > +++ b/drivers/base/Makefile > @@ -23,6 +23,7 @@ obj-$(CONFIG_SOC_BUS) += soc.o > obj-$(CONFIG_PINCTRL) += pinctrl.o > obj-$(CONFIG_DEV_COREDUMP) += devcoredump.o > obj-$(CONFIG_GENERIC_MSI_IRQ_DOMAIN) += platform-msi.o > +obj-$(CONFIG_CPUINFO_SYSFS) += cpuinfo.o > > obj-y += test/ > > diff --git a/drivers/base/cpuinfo.c b/drivers/base/cpuinfo.c > new file mode 100644 > index 0000000..52c21f2 > --- /dev/null > +++ b/drivers/base/cpuinfo.c > @@ -0,0 +1,57 @@ > +/* > + * Copyright (C) 2017 SUSE Linux GmbH > + * Written by: Felix Schnizlein > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License version > + * 2 as published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, but > + * WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; see the file COPYING. If not, write to > + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, > + * Boston, MA 02110-1301 USA. Did you run this through checkpatch.pl first? Please do so :) thanks, greg k-h