mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular subsystem
This moves the 'cpu sysdev_class' over to a regular 'cpu' subsystem and converts the devices to regular devices. The sysdev drivers are implemented as subsystem interfaces now. After all sysdev classes are ported to regular driver core entities, the sysdev implementation will be entirely removed from the kernel. Userspace relies on events and generic sysfs subsystem infrastructure from sysdev devices, which are made available with this conversion. Cc: Haavard Skinnemoen <hskinnemoen@gmail.com> Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Chris Metcalf <cmetcalf@tilera.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Borislav Petkov <bp@amd64.org> Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk> Cc: Len Brown <lenb@kernel.org> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Dave Jones <davej@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
cb0c05c5fa
commit
8a25a2fd12
@@ -6,7 +6,7 @@
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include <linux/init.h>
|
||||
#include <linux/sysdev.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/module.h>
|
||||
@@ -26,16 +26,16 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices);
|
||||
* XXX: If/when a SMP-capable implementation of AVR32 will ever be
|
||||
* made, we must make sure that the code executes on the correct CPU.
|
||||
*/
|
||||
static ssize_t show_pc0event(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t show_pc0event(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
unsigned long pccr;
|
||||
|
||||
pccr = sysreg_read(PCCR);
|
||||
return sprintf(buf, "0x%lx\n", (pccr >> 12) & 0x3f);
|
||||
}
|
||||
static ssize_t store_pc0event(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, const char *buf,
|
||||
static ssize_t store_pc0event(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
unsigned long val;
|
||||
@@ -48,16 +48,16 @@ static ssize_t store_pc0event(struct sys_device *dev,
|
||||
sysreg_write(PCCR, val);
|
||||
return count;
|
||||
}
|
||||
static ssize_t show_pc0count(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t show_pc0count(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
unsigned long pcnt0;
|
||||
|
||||
pcnt0 = sysreg_read(PCNT0);
|
||||
return sprintf(buf, "%lu\n", pcnt0);
|
||||
}
|
||||
static ssize_t store_pc0count(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr,
|
||||
static ssize_t store_pc0count(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
unsigned long val;
|
||||
@@ -71,16 +71,16 @@ static ssize_t store_pc0count(struct sys_device *dev,
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t show_pc1event(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t show_pc1event(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
unsigned long pccr;
|
||||
|
||||
pccr = sysreg_read(PCCR);
|
||||
return sprintf(buf, "0x%lx\n", (pccr >> 18) & 0x3f);
|
||||
}
|
||||
static ssize_t store_pc1event(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, const char *buf,
|
||||
static ssize_t store_pc1event(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
unsigned long val;
|
||||
@@ -93,16 +93,16 @@ static ssize_t store_pc1event(struct sys_device *dev,
|
||||
sysreg_write(PCCR, val);
|
||||
return count;
|
||||
}
|
||||
static ssize_t show_pc1count(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t show_pc1count(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
unsigned long pcnt1;
|
||||
|
||||
pcnt1 = sysreg_read(PCNT1);
|
||||
return sprintf(buf, "%lu\n", pcnt1);
|
||||
}
|
||||
static ssize_t store_pc1count(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, const char *buf,
|
||||
static ssize_t store_pc1count(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
unsigned long val;
|
||||
@@ -116,16 +116,16 @@ static ssize_t store_pc1count(struct sys_device *dev,
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t show_pccycles(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t show_pccycles(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
unsigned long pccnt;
|
||||
|
||||
pccnt = sysreg_read(PCCNT);
|
||||
return sprintf(buf, "%lu\n", pccnt);
|
||||
}
|
||||
static ssize_t store_pccycles(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, const char *buf,
|
||||
static ssize_t store_pccycles(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
unsigned long val;
|
||||
@@ -139,16 +139,16 @@ static ssize_t store_pccycles(struct sys_device *dev,
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t show_pcenable(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t show_pcenable(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
unsigned long pccr;
|
||||
|
||||
pccr = sysreg_read(PCCR);
|
||||
return sprintf(buf, "%c\n", (pccr & 1)?'1':'0');
|
||||
}
|
||||
static ssize_t store_pcenable(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, const char *buf,
|
||||
static ssize_t store_pcenable(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
unsigned long pccr, val;
|
||||
@@ -167,12 +167,12 @@ static ssize_t store_pcenable(struct sys_device *dev,
|
||||
return count;
|
||||
}
|
||||
|
||||
static SYSDEV_ATTR(pc0event, 0600, show_pc0event, store_pc0event);
|
||||
static SYSDEV_ATTR(pc0count, 0600, show_pc0count, store_pc0count);
|
||||
static SYSDEV_ATTR(pc1event, 0600, show_pc1event, store_pc1event);
|
||||
static SYSDEV_ATTR(pc1count, 0600, show_pc1count, store_pc1count);
|
||||
static SYSDEV_ATTR(pccycles, 0600, show_pccycles, store_pccycles);
|
||||
static SYSDEV_ATTR(pcenable, 0600, show_pcenable, store_pcenable);
|
||||
static DEVICE_ATTR(pc0event, 0600, show_pc0event, store_pc0event);
|
||||
static DEVICE_ATTR(pc0count, 0600, show_pc0count, store_pc0count);
|
||||
static DEVICE_ATTR(pc1event, 0600, show_pc1event, store_pc1event);
|
||||
static DEVICE_ATTR(pc1count, 0600, show_pc1count, store_pc1count);
|
||||
static DEVICE_ATTR(pccycles, 0600, show_pccycles, store_pccycles);
|
||||
static DEVICE_ATTR(pcenable, 0600, show_pcenable, store_pcenable);
|
||||
|
||||
#endif /* CONFIG_PERFORMANCE_COUNTERS */
|
||||
|
||||
@@ -186,12 +186,12 @@ static int __init topology_init(void)
|
||||
register_cpu(c, cpu);
|
||||
|
||||
#ifdef CONFIG_PERFORMANCE_COUNTERS
|
||||
sysdev_create_file(&c->sysdev, &attr_pc0event);
|
||||
sysdev_create_file(&c->sysdev, &attr_pc0count);
|
||||
sysdev_create_file(&c->sysdev, &attr_pc1event);
|
||||
sysdev_create_file(&c->sysdev, &attr_pc1count);
|
||||
sysdev_create_file(&c->sysdev, &attr_pccycles);
|
||||
sysdev_create_file(&c->sysdev, &attr_pcenable);
|
||||
device_create_file(&c->dev, &dev_attr_pc0event);
|
||||
device_create_file(&c->dev, &dev_attr_pc0count);
|
||||
device_create_file(&c->dev, &dev_attr_pc1event);
|
||||
device_create_file(&c->dev, &dev_attr_pc1count);
|
||||
device_create_file(&c->dev, &dev_attr_pccycles);
|
||||
device_create_file(&c->dev, &dev_attr_pcenable);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
* Copyright (C) 2006, Intel Corp. All rights reserved.
|
||||
*
|
||||
*/
|
||||
#include <linux/sysdev.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/cpu.h>
|
||||
@@ -35,10 +35,10 @@
|
||||
#define ERR_DATA_BUFFER_SIZE 3 // Three 8-byte;
|
||||
|
||||
#define define_one_ro(name) \
|
||||
static SYSDEV_ATTR(name, 0444, show_##name, NULL)
|
||||
static DEVICE_ATTR(name, 0444, show_##name, NULL)
|
||||
|
||||
#define define_one_rw(name) \
|
||||
static SYSDEV_ATTR(name, 0644, show_##name, store_##name)
|
||||
static DEVICE_ATTR(name, 0644, show_##name, store_##name)
|
||||
|
||||
static u64 call_start[NR_CPUS];
|
||||
static u64 phys_addr[NR_CPUS];
|
||||
@@ -55,7 +55,7 @@ static u64 resources[NR_CPUS];
|
||||
|
||||
#define show(name) \
|
||||
static ssize_t \
|
||||
show_##name(struct sys_device *dev, struct sysdev_attribute *attr, \
|
||||
show_##name(struct device *dev, struct device_attribute *attr, \
|
||||
char *buf) \
|
||||
{ \
|
||||
u32 cpu=dev->id; \
|
||||
@@ -64,7 +64,7 @@ show_##name(struct sys_device *dev, struct sysdev_attribute *attr, \
|
||||
|
||||
#define store(name) \
|
||||
static ssize_t \
|
||||
store_##name(struct sys_device *dev, struct sysdev_attribute *attr, \
|
||||
store_##name(struct device *dev, struct device_attribute *attr, \
|
||||
const char *buf, size_t size) \
|
||||
{ \
|
||||
unsigned int cpu=dev->id; \
|
||||
@@ -78,7 +78,7 @@ show(call_start)
|
||||
* processor. The cpu number in driver is only used for storing data.
|
||||
*/
|
||||
static ssize_t
|
||||
store_call_start(struct sys_device *dev, struct sysdev_attribute *attr,
|
||||
store_call_start(struct device *dev, struct device_attribute *attr,
|
||||
const char *buf, size_t size)
|
||||
{
|
||||
unsigned int cpu=dev->id;
|
||||
@@ -127,7 +127,7 @@ show(err_type_info)
|
||||
store(err_type_info)
|
||||
|
||||
static ssize_t
|
||||
show_virtual_to_phys(struct sys_device *dev, struct sysdev_attribute *attr,
|
||||
show_virtual_to_phys(struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
unsigned int cpu=dev->id;
|
||||
@@ -135,7 +135,7 @@ show_virtual_to_phys(struct sys_device *dev, struct sysdev_attribute *attr,
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
store_virtual_to_phys(struct sys_device *dev, struct sysdev_attribute *attr,
|
||||
store_virtual_to_phys(struct device *dev, struct device_attribute *attr,
|
||||
const char *buf, size_t size)
|
||||
{
|
||||
unsigned int cpu=dev->id;
|
||||
@@ -159,8 +159,8 @@ show(err_struct_info)
|
||||
store(err_struct_info)
|
||||
|
||||
static ssize_t
|
||||
show_err_data_buffer(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
show_err_data_buffer(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
unsigned int cpu=dev->id;
|
||||
|
||||
@@ -171,8 +171,8 @@ show_err_data_buffer(struct sys_device *dev,
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
store_err_data_buffer(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr,
|
||||
store_err_data_buffer(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t size)
|
||||
{
|
||||
unsigned int cpu=dev->id;
|
||||
@@ -209,14 +209,14 @@ define_one_ro(capabilities);
|
||||
define_one_ro(resources);
|
||||
|
||||
static struct attribute *default_attrs[] = {
|
||||
&attr_call_start.attr,
|
||||
&attr_virtual_to_phys.attr,
|
||||
&attr_err_type_info.attr,
|
||||
&attr_err_struct_info.attr,
|
||||
&attr_err_data_buffer.attr,
|
||||
&attr_status.attr,
|
||||
&attr_capabilities.attr,
|
||||
&attr_resources.attr,
|
||||
&dev_attr_call_start.attr,
|
||||
&dev_attr_virtual_to_phys.attr,
|
||||
&dev_attr_err_type_info.attr,
|
||||
&dev_attr_err_struct_info.attr,
|
||||
&dev_attr_err_data_buffer.attr,
|
||||
&dev_attr_status.attr,
|
||||
&dev_attr_capabilities.attr,
|
||||
&dev_attr_resources.attr,
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -225,12 +225,12 @@ static struct attribute_group err_inject_attr_group = {
|
||||
.name = "err_inject"
|
||||
};
|
||||
/* Add/Remove err_inject interface for CPU device */
|
||||
static int __cpuinit err_inject_add_dev(struct sys_device * sys_dev)
|
||||
static int __cpuinit err_inject_add_dev(struct device * sys_dev)
|
||||
{
|
||||
return sysfs_create_group(&sys_dev->kobj, &err_inject_attr_group);
|
||||
}
|
||||
|
||||
static int __cpuinit err_inject_remove_dev(struct sys_device * sys_dev)
|
||||
static int __cpuinit err_inject_remove_dev(struct device * sys_dev)
|
||||
{
|
||||
sysfs_remove_group(&sys_dev->kobj, &err_inject_attr_group);
|
||||
return 0;
|
||||
@@ -239,9 +239,9 @@ static int __cpuinit err_inject_cpu_callback(struct notifier_block *nfb,
|
||||
unsigned long action, void *hcpu)
|
||||
{
|
||||
unsigned int cpu = (unsigned long)hcpu;
|
||||
struct sys_device *sys_dev;
|
||||
struct device *sys_dev;
|
||||
|
||||
sys_dev = get_cpu_sysdev(cpu);
|
||||
sys_dev = get_cpu_device(cpu);
|
||||
switch (action) {
|
||||
case CPU_ONLINE:
|
||||
case CPU_ONLINE_FROZEN:
|
||||
@@ -283,13 +283,13 @@ static void __exit
|
||||
err_inject_exit(void)
|
||||
{
|
||||
int i;
|
||||
struct sys_device *sys_dev;
|
||||
struct device *sys_dev;
|
||||
|
||||
#ifdef ERR_INJ_DEBUG
|
||||
printk(KERN_INFO "Exit error injection driver.\n");
|
||||
#endif
|
||||
for_each_online_cpu(i) {
|
||||
sys_dev = get_cpu_sysdev(i);
|
||||
sys_dev = get_cpu_device(i);
|
||||
sysfs_remove_group(&sys_dev->kobj, &err_inject_attr_group);
|
||||
}
|
||||
unregister_hotcpu_notifier(&err_inject_cpu_notifier);
|
||||
|
||||
@@ -350,7 +350,7 @@ static int __cpuinit cpu_cache_sysfs_init(unsigned int cpu)
|
||||
}
|
||||
|
||||
/* Add cache interface for CPU device */
|
||||
static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
|
||||
static int __cpuinit cache_add_dev(struct device * sys_dev)
|
||||
{
|
||||
unsigned int cpu = sys_dev->id;
|
||||
unsigned long i, j;
|
||||
@@ -400,7 +400,7 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
|
||||
}
|
||||
|
||||
/* Remove cache interface for CPU device */
|
||||
static int __cpuinit cache_remove_dev(struct sys_device * sys_dev)
|
||||
static int __cpuinit cache_remove_dev(struct device * sys_dev)
|
||||
{
|
||||
unsigned int cpu = sys_dev->id;
|
||||
unsigned long i;
|
||||
@@ -428,9 +428,9 @@ static int __cpuinit cache_cpu_callback(struct notifier_block *nfb,
|
||||
unsigned long action, void *hcpu)
|
||||
{
|
||||
unsigned int cpu = (unsigned long)hcpu;
|
||||
struct sys_device *sys_dev;
|
||||
struct device *sys_dev;
|
||||
|
||||
sys_dev = get_cpu_sysdev(cpu);
|
||||
sys_dev = get_cpu_device(cpu);
|
||||
switch (action) {
|
||||
case CPU_ONLINE:
|
||||
case CPU_ONLINE_FROZEN:
|
||||
@@ -454,7 +454,7 @@ static int __init cache_sysfs_init(void)
|
||||
int i;
|
||||
|
||||
for_each_online_cpu(i) {
|
||||
struct sys_device *sys_dev = get_cpu_sysdev((unsigned int)i);
|
||||
struct device *sys_dev = get_cpu_device((unsigned int)i);
|
||||
cache_add_dev(sys_dev);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/sysdev.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
#define LS_SIZE (256 * 1024)
|
||||
@@ -166,7 +166,7 @@ struct spu {
|
||||
/* beat only */
|
||||
u64 shadow_int_mask_RW[3];
|
||||
|
||||
struct sys_device sysdev;
|
||||
struct device dev;
|
||||
|
||||
int has_mem_affinity;
|
||||
struct list_head aff_list;
|
||||
@@ -270,11 +270,11 @@ struct spufs_calls {
|
||||
int register_spu_syscalls(struct spufs_calls *calls);
|
||||
void unregister_spu_syscalls(struct spufs_calls *calls);
|
||||
|
||||
int spu_add_sysdev_attr(struct sysdev_attribute *attr);
|
||||
void spu_remove_sysdev_attr(struct sysdev_attribute *attr);
|
||||
int spu_add_dev_attr(struct device_attribute *attr);
|
||||
void spu_remove_dev_attr(struct device_attribute *attr);
|
||||
|
||||
int spu_add_sysdev_attr_group(struct attribute_group *attrs);
|
||||
void spu_remove_sysdev_attr_group(struct attribute_group *attrs);
|
||||
int spu_add_dev_attr_group(struct attribute_group *attrs);
|
||||
void spu_remove_dev_attr_group(struct attribute_group *attrs);
|
||||
|
||||
int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
|
||||
unsigned long dsisr, unsigned *flt);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#ifdef __KERNEL__
|
||||
|
||||
|
||||
struct sys_device;
|
||||
struct device;
|
||||
struct device_node;
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
@@ -86,19 +86,19 @@ extern int __node_distance(int, int);
|
||||
|
||||
extern void __init dump_numa_cpu_topology(void);
|
||||
|
||||
extern int sysfs_add_device_to_node(struct sys_device *dev, int nid);
|
||||
extern void sysfs_remove_device_from_node(struct sys_device *dev, int nid);
|
||||
extern int sysfs_add_device_to_node(struct device *dev, int nid);
|
||||
extern void sysfs_remove_device_from_node(struct device *dev, int nid);
|
||||
|
||||
#else
|
||||
|
||||
static inline void dump_numa_cpu_topology(void) {}
|
||||
|
||||
static inline int sysfs_add_device_to_node(struct sys_device *dev, int nid)
|
||||
static inline int sysfs_add_device_to_node(struct device *dev, int nid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void sysfs_remove_device_from_node(struct sys_device *dev,
|
||||
static inline void sysfs_remove_device_from_node(struct device *dev,
|
||||
int nid)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -451,15 +451,15 @@ out:
|
||||
static struct cache_dir *__cpuinit cacheinfo_create_cache_dir(unsigned int cpu_id)
|
||||
{
|
||||
struct cache_dir *cache_dir;
|
||||
struct sys_device *sysdev;
|
||||
struct device *dev;
|
||||
struct kobject *kobj = NULL;
|
||||
|
||||
sysdev = get_cpu_sysdev(cpu_id);
|
||||
WARN_ONCE(!sysdev, "no sysdev for CPU %i\n", cpu_id);
|
||||
if (!sysdev)
|
||||
dev = get_cpu_device(cpu_id);
|
||||
WARN_ONCE(!dev, "no dev for CPU %i\n", cpu_id);
|
||||
if (!dev)
|
||||
goto err;
|
||||
|
||||
kobj = kobject_create_and_add("cache", &sysdev->kobj);
|
||||
kobj = kobject_create_and_add("cache", &dev->kobj);
|
||||
if (!kobj)
|
||||
goto err;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/cache.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/sysdev.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/topology.h>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1452,7 +1452,7 @@ int arch_update_cpu_topology(void)
|
||||
{
|
||||
int cpu, nid, old_nid;
|
||||
unsigned int associativity[VPHN_ASSOC_BUFSIZE] = {0};
|
||||
struct sys_device *sysdev;
|
||||
struct device *dev;
|
||||
|
||||
for_each_cpu(cpu,&cpu_associativity_changes_mask) {
|
||||
vphn_get_associativity(cpu, associativity);
|
||||
@@ -1473,9 +1473,9 @@ int arch_update_cpu_topology(void)
|
||||
register_cpu_under_node(cpu, nid);
|
||||
put_online_cpus();
|
||||
|
||||
sysdev = get_cpu_sysdev(cpu);
|
||||
if (sysdev)
|
||||
kobject_uevent(&sysdev->kobj, KOBJ_CHANGE);
|
||||
dev = get_cpu_device(cpu);
|
||||
if (dev)
|
||||
kobject_uevent(&dev->kobj, KOBJ_CHANGE);
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/sysdev.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <asm/spu.h>
|
||||
@@ -59,8 +59,8 @@
|
||||
#define TEMP_MIN 65
|
||||
#define TEMP_MAX 125
|
||||
|
||||
#define SYSDEV_PREFIX_ATTR(_prefix,_name,_mode) \
|
||||
struct sysdev_attribute attr_ ## _prefix ## _ ## _name = { \
|
||||
#define DEVICE_PREFIX_ATTR(_prefix,_name,_mode) \
|
||||
struct device_attribute attr_ ## _prefix ## _ ## _name = { \
|
||||
.attr = { .name = __stringify(_name), .mode = _mode }, \
|
||||
.show = _prefix ## _show_ ## _name, \
|
||||
.store = _prefix ## _store_ ## _name, \
|
||||
@@ -76,36 +76,36 @@ static inline u8 temp_to_reg(u8 temp)
|
||||
return ((temp - TEMP_MIN) >> 1) & 0x3f;
|
||||
}
|
||||
|
||||
static struct cbe_pmd_regs __iomem *get_pmd_regs(struct sys_device *sysdev)
|
||||
static struct cbe_pmd_regs __iomem *get_pmd_regs(struct device *dev)
|
||||
{
|
||||
struct spu *spu;
|
||||
|
||||
spu = container_of(sysdev, struct spu, sysdev);
|
||||
spu = container_of(dev, struct spu, dev);
|
||||
|
||||
return cbe_get_pmd_regs(spu_devnode(spu));
|
||||
}
|
||||
|
||||
/* returns the value for a given spu in a given register */
|
||||
static u8 spu_read_register_value(struct sys_device *sysdev, union spe_reg __iomem *reg)
|
||||
static u8 spu_read_register_value(struct device *dev, union spe_reg __iomem *reg)
|
||||
{
|
||||
union spe_reg value;
|
||||
struct spu *spu;
|
||||
|
||||
spu = container_of(sysdev, struct spu, sysdev);
|
||||
spu = container_of(dev, struct spu, dev);
|
||||
value.val = in_be64(®->val);
|
||||
|
||||
return value.spe[spu->spe_id];
|
||||
}
|
||||
|
||||
static ssize_t spu_show_temp(struct sys_device *sysdev, struct sysdev_attribute *attr,
|
||||
static ssize_t spu_show_temp(struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
u8 value;
|
||||
struct cbe_pmd_regs __iomem *pmd_regs;
|
||||
|
||||
pmd_regs = get_pmd_regs(sysdev);
|
||||
pmd_regs = get_pmd_regs(dev);
|
||||
|
||||
value = spu_read_register_value(sysdev, &pmd_regs->ts_ctsr1);
|
||||
value = spu_read_register_value(dev, &pmd_regs->ts_ctsr1);
|
||||
|
||||
return sprintf(buf, "%d\n", reg_to_temp(value));
|
||||
}
|
||||
@@ -147,48 +147,48 @@ static ssize_t store_throttle(struct cbe_pmd_regs __iomem *pmd_regs, const char
|
||||
return size;
|
||||
}
|
||||
|
||||
static ssize_t spu_show_throttle_end(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t spu_show_throttle_end(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return show_throttle(get_pmd_regs(sysdev), buf, 0);
|
||||
return show_throttle(get_pmd_regs(dev), buf, 0);
|
||||
}
|
||||
|
||||
static ssize_t spu_show_throttle_begin(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t spu_show_throttle_begin(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return show_throttle(get_pmd_regs(sysdev), buf, 8);
|
||||
return show_throttle(get_pmd_regs(dev), buf, 8);
|
||||
}
|
||||
|
||||
static ssize_t spu_show_throttle_full_stop(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t spu_show_throttle_full_stop(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return show_throttle(get_pmd_regs(sysdev), buf, 16);
|
||||
return show_throttle(get_pmd_regs(dev), buf, 16);
|
||||
}
|
||||
|
||||
static ssize_t spu_store_throttle_end(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, const char *buf, size_t size)
|
||||
static ssize_t spu_store_throttle_end(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t size)
|
||||
{
|
||||
return store_throttle(get_pmd_regs(sysdev), buf, size, 0);
|
||||
return store_throttle(get_pmd_regs(dev), buf, size, 0);
|
||||
}
|
||||
|
||||
static ssize_t spu_store_throttle_begin(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, const char *buf, size_t size)
|
||||
static ssize_t spu_store_throttle_begin(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t size)
|
||||
{
|
||||
return store_throttle(get_pmd_regs(sysdev), buf, size, 8);
|
||||
return store_throttle(get_pmd_regs(dev), buf, size, 8);
|
||||
}
|
||||
|
||||
static ssize_t spu_store_throttle_full_stop(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, const char *buf, size_t size)
|
||||
static ssize_t spu_store_throttle_full_stop(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t size)
|
||||
{
|
||||
return store_throttle(get_pmd_regs(sysdev), buf, size, 16);
|
||||
return store_throttle(get_pmd_regs(dev), buf, size, 16);
|
||||
}
|
||||
|
||||
static ssize_t ppe_show_temp(struct sys_device *sysdev, char *buf, int pos)
|
||||
static ssize_t ppe_show_temp(struct device *dev, char *buf, int pos)
|
||||
{
|
||||
struct cbe_pmd_regs __iomem *pmd_regs;
|
||||
u64 value;
|
||||
|
||||
pmd_regs = cbe_get_cpu_pmd_regs(sysdev->id);
|
||||
pmd_regs = cbe_get_cpu_pmd_regs(dev->id);
|
||||
value = in_be64(&pmd_regs->ts_ctsr2);
|
||||
|
||||
value = (value >> pos) & 0x3f;
|
||||
@@ -199,64 +199,64 @@ static ssize_t ppe_show_temp(struct sys_device *sysdev, char *buf, int pos)
|
||||
|
||||
/* shows the temperature of the DTS on the PPE,
|
||||
* located near the linear thermal sensor */
|
||||
static ssize_t ppe_show_temp0(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t ppe_show_temp0(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return ppe_show_temp(sysdev, buf, 32);
|
||||
return ppe_show_temp(dev, buf, 32);
|
||||
}
|
||||
|
||||
/* shows the temperature of the second DTS on the PPE */
|
||||
static ssize_t ppe_show_temp1(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t ppe_show_temp1(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return ppe_show_temp(sysdev, buf, 0);
|
||||
return ppe_show_temp(dev, buf, 0);
|
||||
}
|
||||
|
||||
static ssize_t ppe_show_throttle_end(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t ppe_show_throttle_end(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 32);
|
||||
return show_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, 32);
|
||||
}
|
||||
|
||||
static ssize_t ppe_show_throttle_begin(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t ppe_show_throttle_begin(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 40);
|
||||
return show_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, 40);
|
||||
}
|
||||
|
||||
static ssize_t ppe_show_throttle_full_stop(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t ppe_show_throttle_full_stop(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 48);
|
||||
return show_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, 48);
|
||||
}
|
||||
|
||||
static ssize_t ppe_store_throttle_end(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, const char *buf, size_t size)
|
||||
static ssize_t ppe_store_throttle_end(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t size)
|
||||
{
|
||||
return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 32);
|
||||
return store_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, size, 32);
|
||||
}
|
||||
|
||||
static ssize_t ppe_store_throttle_begin(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, const char *buf, size_t size)
|
||||
static ssize_t ppe_store_throttle_begin(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t size)
|
||||
{
|
||||
return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 40);
|
||||
return store_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, size, 40);
|
||||
}
|
||||
|
||||
static ssize_t ppe_store_throttle_full_stop(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, const char *buf, size_t size)
|
||||
static ssize_t ppe_store_throttle_full_stop(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t size)
|
||||
{
|
||||
return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 48);
|
||||
return store_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, size, 48);
|
||||
}
|
||||
|
||||
|
||||
static struct sysdev_attribute attr_spu_temperature = {
|
||||
static struct device_attribute attr_spu_temperature = {
|
||||
.attr = {.name = "temperature", .mode = 0400 },
|
||||
.show = spu_show_temp,
|
||||
};
|
||||
|
||||
static SYSDEV_PREFIX_ATTR(spu, throttle_end, 0600);
|
||||
static SYSDEV_PREFIX_ATTR(spu, throttle_begin, 0600);
|
||||
static SYSDEV_PREFIX_ATTR(spu, throttle_full_stop, 0600);
|
||||
static DEVICE_PREFIX_ATTR(spu, throttle_end, 0600);
|
||||
static DEVICE_PREFIX_ATTR(spu, throttle_begin, 0600);
|
||||
static DEVICE_PREFIX_ATTR(spu, throttle_full_stop, 0600);
|
||||
|
||||
|
||||
static struct attribute *spu_attributes[] = {
|
||||
@@ -272,19 +272,19 @@ static struct attribute_group spu_attribute_group = {
|
||||
.attrs = spu_attributes,
|
||||
};
|
||||
|
||||
static struct sysdev_attribute attr_ppe_temperature0 = {
|
||||
static struct device_attribute attr_ppe_temperature0 = {
|
||||
.attr = {.name = "temperature0", .mode = 0400 },
|
||||
.show = ppe_show_temp0,
|
||||
};
|
||||
|
||||
static struct sysdev_attribute attr_ppe_temperature1 = {
|
||||
static struct device_attribute attr_ppe_temperature1 = {
|
||||
.attr = {.name = "temperature1", .mode = 0400 },
|
||||
.show = ppe_show_temp1,
|
||||
};
|
||||
|
||||
static SYSDEV_PREFIX_ATTR(ppe, throttle_end, 0600);
|
||||
static SYSDEV_PREFIX_ATTR(ppe, throttle_begin, 0600);
|
||||
static SYSDEV_PREFIX_ATTR(ppe, throttle_full_stop, 0600);
|
||||
static DEVICE_PREFIX_ATTR(ppe, throttle_end, 0600);
|
||||
static DEVICE_PREFIX_ATTR(ppe, throttle_begin, 0600);
|
||||
static DEVICE_PREFIX_ATTR(ppe, throttle_full_stop, 0600);
|
||||
|
||||
static struct attribute *ppe_attributes[] = {
|
||||
&attr_ppe_temperature0.attr,
|
||||
@@ -307,7 +307,7 @@ static int __init init_default_values(void)
|
||||
{
|
||||
int cpu;
|
||||
struct cbe_pmd_regs __iomem *pmd_regs;
|
||||
struct sys_device *sysdev;
|
||||
struct device *dev;
|
||||
union ppe_spe_reg tpr;
|
||||
union spe_reg str1;
|
||||
u64 str2;
|
||||
@@ -349,14 +349,14 @@ static int __init init_default_values(void)
|
||||
|
||||
for_each_possible_cpu (cpu) {
|
||||
pr_debug("processing cpu %d\n", cpu);
|
||||
sysdev = get_cpu_sysdev(cpu);
|
||||
dev = get_cpu_device(cpu);
|
||||
|
||||
if (!sysdev) {
|
||||
pr_info("invalid sysdev pointer for cbe_thermal\n");
|
||||
if (!dev) {
|
||||
pr_info("invalid dev pointer for cbe_thermal\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pmd_regs = cbe_get_cpu_pmd_regs(sysdev->id);
|
||||
pmd_regs = cbe_get_cpu_pmd_regs(dev->id);
|
||||
|
||||
if (!pmd_regs) {
|
||||
pr_info("invalid CBE regs pointer for cbe_thermal\n");
|
||||
@@ -379,8 +379,8 @@ static int __init thermal_init(void)
|
||||
int rc = init_default_values();
|
||||
|
||||
if (rc == 0) {
|
||||
spu_add_sysdev_attr_group(&spu_attribute_group);
|
||||
cpu_add_sysdev_attr_group(&ppe_attribute_group);
|
||||
spu_add_dev_attr_group(&spu_attribute_group);
|
||||
cpu_add_dev_attr_group(&ppe_attribute_group);
|
||||
}
|
||||
|
||||
return rc;
|
||||
@@ -389,8 +389,8 @@ module_init(thermal_init);
|
||||
|
||||
static void __exit thermal_exit(void)
|
||||
{
|
||||
spu_remove_sysdev_attr_group(&spu_attribute_group);
|
||||
cpu_remove_sysdev_attr_group(&ppe_attribute_group);
|
||||
spu_remove_dev_attr_group(&spu_attribute_group);
|
||||
cpu_remove_dev_attr_group(&ppe_attribute_group);
|
||||
}
|
||||
module_exit(thermal_exit);
|
||||
|
||||
|
||||
@@ -522,31 +522,32 @@ void spu_init_channels(struct spu *spu)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(spu_init_channels);
|
||||
|
||||
static struct sysdev_class spu_sysdev_class = {
|
||||
static struct bus_type spu_subsys = {
|
||||
.name = "spu",
|
||||
.dev_name = "spu",
|
||||
};
|
||||
|
||||
int spu_add_sysdev_attr(struct sysdev_attribute *attr)
|
||||
int spu_add_dev_attr(struct device_attribute *attr)
|
||||
{
|
||||
struct spu *spu;
|
||||
|
||||
mutex_lock(&spu_full_list_mutex);
|
||||
list_for_each_entry(spu, &spu_full_list, full_list)
|
||||
sysdev_create_file(&spu->sysdev, attr);
|
||||
device_create_file(&spu->dev, attr);
|
||||
mutex_unlock(&spu_full_list_mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(spu_add_sysdev_attr);
|
||||
EXPORT_SYMBOL_GPL(spu_add_dev_attr);
|
||||
|
||||
int spu_add_sysdev_attr_group(struct attribute_group *attrs)
|
||||
int spu_add_dev_attr_group(struct attribute_group *attrs)
|
||||
{
|
||||
struct spu *spu;
|
||||
int rc = 0;
|
||||
|
||||
mutex_lock(&spu_full_list_mutex);
|
||||
list_for_each_entry(spu, &spu_full_list, full_list) {
|
||||
rc = sysfs_create_group(&spu->sysdev.kobj, attrs);
|
||||
rc = sysfs_create_group(&spu->dev.kobj, attrs);
|
||||
|
||||
/* we're in trouble here, but try unwinding anyway */
|
||||
if (rc) {
|
||||
@@ -555,7 +556,7 @@ int spu_add_sysdev_attr_group(struct attribute_group *attrs)
|
||||
|
||||
list_for_each_entry_continue_reverse(spu,
|
||||
&spu_full_list, full_list)
|
||||
sysfs_remove_group(&spu->sysdev.kobj, attrs);
|
||||
sysfs_remove_group(&spu->dev.kobj, attrs);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -564,45 +565,45 @@ int spu_add_sysdev_attr_group(struct attribute_group *attrs)
|
||||
|
||||
return rc;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(spu_add_sysdev_attr_group);
|
||||
EXPORT_SYMBOL_GPL(spu_add_dev_attr_group);
|
||||
|
||||
|
||||
void spu_remove_sysdev_attr(struct sysdev_attribute *attr)
|
||||
void spu_remove_dev_attr(struct device_attribute *attr)
|
||||
{
|
||||
struct spu *spu;
|
||||
|
||||
mutex_lock(&spu_full_list_mutex);
|
||||
list_for_each_entry(spu, &spu_full_list, full_list)
|
||||
sysdev_remove_file(&spu->sysdev, attr);
|
||||
device_remove_file(&spu->dev, attr);
|
||||
mutex_unlock(&spu_full_list_mutex);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(spu_remove_sysdev_attr);
|
||||
EXPORT_SYMBOL_GPL(spu_remove_dev_attr);
|
||||
|
||||
void spu_remove_sysdev_attr_group(struct attribute_group *attrs)
|
||||
void spu_remove_dev_attr_group(struct attribute_group *attrs)
|
||||
{
|
||||
struct spu *spu;
|
||||
|
||||
mutex_lock(&spu_full_list_mutex);
|
||||
list_for_each_entry(spu, &spu_full_list, full_list)
|
||||
sysfs_remove_group(&spu->sysdev.kobj, attrs);
|
||||
sysfs_remove_group(&spu->dev.kobj, attrs);
|
||||
mutex_unlock(&spu_full_list_mutex);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(spu_remove_sysdev_attr_group);
|
||||
EXPORT_SYMBOL_GPL(spu_remove_dev_attr_group);
|
||||
|
||||
static int spu_create_sysdev(struct spu *spu)
|
||||
static int spu_create_dev(struct spu *spu)
|
||||
{
|
||||
int ret;
|
||||
|
||||
spu->sysdev.id = spu->number;
|
||||
spu->sysdev.cls = &spu_sysdev_class;
|
||||
ret = sysdev_register(&spu->sysdev);
|
||||
spu->dev.id = spu->number;
|
||||
spu->dev.bus = &spu_subsys;
|
||||
ret = device_register(&spu->dev);
|
||||
if (ret) {
|
||||
printk(KERN_ERR "Can't register SPU %d with sysfs\n",
|
||||
spu->number);
|
||||
return ret;
|
||||
}
|
||||
|
||||
sysfs_add_device_to_node(&spu->sysdev, spu->node);
|
||||
sysfs_add_device_to_node(&spu->dev, spu->node);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -638,7 +639,7 @@ static int __init create_spu(void *data)
|
||||
if (ret)
|
||||
goto out_destroy;
|
||||
|
||||
ret = spu_create_sysdev(spu);
|
||||
ret = spu_create_dev(spu);
|
||||
if (ret)
|
||||
goto out_free_irqs;
|
||||
|
||||
@@ -695,10 +696,10 @@ static unsigned long long spu_acct_time(struct spu *spu,
|
||||
}
|
||||
|
||||
|
||||
static ssize_t spu_stat_show(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t spu_stat_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct spu *spu = container_of(sysdev, struct spu, sysdev);
|
||||
struct spu *spu = container_of(dev, struct spu, dev);
|
||||
|
||||
return sprintf(buf, "%s %llu %llu %llu %llu "
|
||||
"%llu %llu %llu %llu %llu %llu %llu %llu\n",
|
||||
@@ -717,7 +718,7 @@ static ssize_t spu_stat_show(struct sys_device *sysdev,
|
||||
spu->stats.libassist);
|
||||
}
|
||||
|
||||
static SYSDEV_ATTR(stat, 0644, spu_stat_show, NULL);
|
||||
static DEVICE_ATTR(stat, 0644, spu_stat_show, NULL);
|
||||
|
||||
#ifdef CONFIG_KEXEC
|
||||
|
||||
@@ -816,8 +817,8 @@ static int __init init_spu_base(void)
|
||||
if (!spu_management_ops)
|
||||
goto out;
|
||||
|
||||
/* create sysdev class for spus */
|
||||
ret = sysdev_class_register(&spu_sysdev_class);
|
||||
/* create system subsystem for spus */
|
||||
ret = subsys_system_register(&spu_subsys, NULL);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
@@ -826,7 +827,7 @@ static int __init init_spu_base(void)
|
||||
if (ret < 0) {
|
||||
printk(KERN_WARNING "%s: Error initializing spus\n",
|
||||
__func__);
|
||||
goto out_unregister_sysdev_class;
|
||||
goto out_unregister_subsys;
|
||||
}
|
||||
|
||||
if (ret > 0)
|
||||
@@ -836,15 +837,15 @@ static int __init init_spu_base(void)
|
||||
xmon_register_spus(&spu_full_list);
|
||||
crash_register_spus(&spu_full_list);
|
||||
mutex_unlock(&spu_full_list_mutex);
|
||||
spu_add_sysdev_attr(&attr_stat);
|
||||
spu_add_dev_attr(&dev_attr_stat);
|
||||
register_syscore_ops(&spu_syscore_ops);
|
||||
|
||||
spu_init_affinity();
|
||||
|
||||
return 0;
|
||||
|
||||
out_unregister_sysdev_class:
|
||||
sysdev_class_unregister(&spu_sysdev_class);
|
||||
out_unregister_subsys:
|
||||
bus_unregister(&spu_subsys);
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <linux/errno.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/sysdev.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/of.h>
|
||||
#include <asm/cputhreads.h>
|
||||
@@ -184,7 +184,7 @@ static ssize_t get_best_energy_list(char *page, int activate)
|
||||
return s-page;
|
||||
}
|
||||
|
||||
static ssize_t get_best_energy_data(struct sys_device *dev,
|
||||
static ssize_t get_best_energy_data(struct device *dev,
|
||||
char *page, int activate)
|
||||
{
|
||||
int rc;
|
||||
@@ -207,26 +207,26 @@ static ssize_t get_best_energy_data(struct sys_device *dev,
|
||||
|
||||
/* Wrapper functions */
|
||||
|
||||
static ssize_t cpu_activate_hint_list_show(struct sysdev_class *class,
|
||||
struct sysdev_class_attribute *attr, char *page)
|
||||
static ssize_t cpu_activate_hint_list_show(struct device *dev,
|
||||
struct device_attribute *attr, char *page)
|
||||
{
|
||||
return get_best_energy_list(page, 1);
|
||||
}
|
||||
|
||||
static ssize_t cpu_deactivate_hint_list_show(struct sysdev_class *class,
|
||||
struct sysdev_class_attribute *attr, char *page)
|
||||
static ssize_t cpu_deactivate_hint_list_show(struct device *dev,
|
||||
struct device_attribute *attr, char *page)
|
||||
{
|
||||
return get_best_energy_list(page, 0);
|
||||
}
|
||||
|
||||
static ssize_t percpu_activate_hint_show(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *page)
|
||||
static ssize_t percpu_activate_hint_show(struct device *dev,
|
||||
struct device_attribute *attr, char *page)
|
||||
{
|
||||
return get_best_energy_data(dev, page, 1);
|
||||
}
|
||||
|
||||
static ssize_t percpu_deactivate_hint_show(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *page)
|
||||
static ssize_t percpu_deactivate_hint_show(struct device *dev,
|
||||
struct device_attribute *attr, char *page)
|
||||
{
|
||||
return get_best_energy_data(dev, page, 0);
|
||||
}
|
||||
@@ -241,48 +241,48 @@ static ssize_t percpu_deactivate_hint_show(struct sys_device *dev,
|
||||
* Per-cpu value of the hint
|
||||
*/
|
||||
|
||||
struct sysdev_class_attribute attr_cpu_activate_hint_list =
|
||||
_SYSDEV_CLASS_ATTR(pseries_activate_hint_list, 0444,
|
||||
struct device_attribute attr_cpu_activate_hint_list =
|
||||
__ATTR(pseries_activate_hint_list, 0444,
|
||||
cpu_activate_hint_list_show, NULL);
|
||||
|
||||
struct sysdev_class_attribute attr_cpu_deactivate_hint_list =
|
||||
_SYSDEV_CLASS_ATTR(pseries_deactivate_hint_list, 0444,
|
||||
struct device_attribute attr_cpu_deactivate_hint_list =
|
||||
__ATTR(pseries_deactivate_hint_list, 0444,
|
||||
cpu_deactivate_hint_list_show, NULL);
|
||||
|
||||
struct sysdev_attribute attr_percpu_activate_hint =
|
||||
_SYSDEV_ATTR(pseries_activate_hint, 0444,
|
||||
struct device_attribute attr_percpu_activate_hint =
|
||||
__ATTR(pseries_activate_hint, 0444,
|
||||
percpu_activate_hint_show, NULL);
|
||||
|
||||
struct sysdev_attribute attr_percpu_deactivate_hint =
|
||||
_SYSDEV_ATTR(pseries_deactivate_hint, 0444,
|
||||
struct device_attribute attr_percpu_deactivate_hint =
|
||||
__ATTR(pseries_deactivate_hint, 0444,
|
||||
percpu_deactivate_hint_show, NULL);
|
||||
|
||||
static int __init pseries_energy_init(void)
|
||||
{
|
||||
int cpu, err;
|
||||
struct sys_device *cpu_sys_dev;
|
||||
struct device *cpu_dev;
|
||||
|
||||
if (!check_for_h_best_energy()) {
|
||||
printk(KERN_INFO "Hypercall H_BEST_ENERGY not supported\n");
|
||||
return 0;
|
||||
}
|
||||
/* Create the sysfs files */
|
||||
err = sysfs_create_file(&cpu_sysdev_class.kset.kobj,
|
||||
&attr_cpu_activate_hint_list.attr);
|
||||
err = device_create_file(cpu_subsys.dev_root,
|
||||
&attr_cpu_activate_hint_list);
|
||||
if (!err)
|
||||
err = sysfs_create_file(&cpu_sysdev_class.kset.kobj,
|
||||
&attr_cpu_deactivate_hint_list.attr);
|
||||
err = device_create_file(cpu_subsys.dev_root,
|
||||
&attr_cpu_deactivate_hint_list);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
for_each_possible_cpu(cpu) {
|
||||
cpu_sys_dev = get_cpu_sysdev(cpu);
|
||||
err = sysfs_create_file(&cpu_sys_dev->kobj,
|
||||
&attr_percpu_activate_hint.attr);
|
||||
cpu_dev = get_cpu_device(cpu);
|
||||
err = device_create_file(cpu_dev,
|
||||
&attr_percpu_activate_hint);
|
||||
if (err)
|
||||
break;
|
||||
err = sysfs_create_file(&cpu_sys_dev->kobj,
|
||||
&attr_percpu_deactivate_hint.attr);
|
||||
err = device_create_file(cpu_dev,
|
||||
&attr_percpu_deactivate_hint);
|
||||
if (err)
|
||||
break;
|
||||
}
|
||||
@@ -298,23 +298,20 @@ static int __init pseries_energy_init(void)
|
||||
static void __exit pseries_energy_cleanup(void)
|
||||
{
|
||||
int cpu;
|
||||
struct sys_device *cpu_sys_dev;
|
||||
struct device *cpu_dev;
|
||||
|
||||
if (!sysfs_entries)
|
||||
return;
|
||||
|
||||
/* Remove the sysfs files */
|
||||
sysfs_remove_file(&cpu_sysdev_class.kset.kobj,
|
||||
&attr_cpu_activate_hint_list.attr);
|
||||
|
||||
sysfs_remove_file(&cpu_sysdev_class.kset.kobj,
|
||||
&attr_cpu_deactivate_hint_list.attr);
|
||||
device_remove_file(cpu_subsys.dev_root, &attr_cpu_activate_hint_list);
|
||||
device_remove_file(cpu_subsys.dev_root, &attr_cpu_deactivate_hint_list);
|
||||
|
||||
for_each_possible_cpu(cpu) {
|
||||
cpu_sys_dev = get_cpu_sysdev(cpu);
|
||||
sysfs_remove_file(&cpu_sys_dev->kobj,
|
||||
cpu_dev = get_cpu_device(cpu);
|
||||
sysfs_remove_file(&cpu_dev->kobj,
|
||||
&attr_percpu_activate_hint.attr);
|
||||
sysfs_remove_file(&cpu_sys_dev->kobj,
|
||||
sysfs_remove_file(&cpu_dev->kobj,
|
||||
&attr_percpu_deactivate_hint.attr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,12 +179,12 @@ static struct kobj_attribute cpm_idle_attr =
|
||||
|
||||
static void cpm_idle_config_sysfs(void)
|
||||
{
|
||||
struct sys_device *sys_dev;
|
||||
struct device *dev;
|
||||
unsigned long ret;
|
||||
|
||||
sys_dev = get_cpu_sysdev(0);
|
||||
dev = get_cpu_device(0);
|
||||
|
||||
ret = sysfs_create_file(&sys_dev->kobj,
|
||||
ret = sysfs_create_file(&dev->kobj,
|
||||
&cpm_idle_attr.attr);
|
||||
if (ret)
|
||||
printk(KERN_WARNING
|
||||
|
||||
@@ -831,8 +831,8 @@ int setup_profiling_timer(unsigned int multiplier)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
static ssize_t cpu_configure_show(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t cpu_configure_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
ssize_t count;
|
||||
|
||||
@@ -842,8 +842,8 @@ static ssize_t cpu_configure_show(struct sys_device *dev,
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t cpu_configure_store(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr,
|
||||
static ssize_t cpu_configure_store(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
int cpu = dev->id;
|
||||
@@ -889,11 +889,11 @@ out:
|
||||
put_online_cpus();
|
||||
return rc ? rc : count;
|
||||
}
|
||||
static SYSDEV_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store);
|
||||
static DEVICE_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store);
|
||||
#endif /* CONFIG_HOTPLUG_CPU */
|
||||
|
||||
static ssize_t cpu_polarization_show(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t cpu_polarization_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
int cpu = dev->id;
|
||||
ssize_t count;
|
||||
@@ -919,22 +919,22 @@ static ssize_t cpu_polarization_show(struct sys_device *dev,
|
||||
mutex_unlock(&smp_cpu_state_mutex);
|
||||
return count;
|
||||
}
|
||||
static SYSDEV_ATTR(polarization, 0444, cpu_polarization_show, NULL);
|
||||
static DEVICE_ATTR(polarization, 0444, cpu_polarization_show, NULL);
|
||||
|
||||
static ssize_t show_cpu_address(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t show_cpu_address(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return sprintf(buf, "%d\n", __cpu_logical_map[dev->id]);
|
||||
}
|
||||
static SYSDEV_ATTR(address, 0444, show_cpu_address, NULL);
|
||||
static DEVICE_ATTR(address, 0444, show_cpu_address, NULL);
|
||||
|
||||
|
||||
static struct attribute *cpu_common_attrs[] = {
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
&attr_configure.attr,
|
||||
&dev_attr_configure.attr,
|
||||
#endif
|
||||
&attr_address.attr,
|
||||
&attr_polarization.attr,
|
||||
&dev_attr_address.attr,
|
||||
&dev_attr_polarization.attr,
|
||||
NULL,
|
||||
};
|
||||
|
||||
@@ -942,8 +942,8 @@ static struct attribute_group cpu_common_attr_group = {
|
||||
.attrs = cpu_common_attrs,
|
||||
};
|
||||
|
||||
static ssize_t show_capability(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t show_capability(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
unsigned int capability;
|
||||
int rc;
|
||||
@@ -953,10 +953,10 @@ static ssize_t show_capability(struct sys_device *dev,
|
||||
return rc;
|
||||
return sprintf(buf, "%u\n", capability);
|
||||
}
|
||||
static SYSDEV_ATTR(capability, 0444, show_capability, NULL);
|
||||
static DEVICE_ATTR(capability, 0444, show_capability, NULL);
|
||||
|
||||
static ssize_t show_idle_count(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t show_idle_count(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct s390_idle_data *idle;
|
||||
unsigned long long idle_count;
|
||||
@@ -976,10 +976,10 @@ repeat:
|
||||
goto repeat;
|
||||
return sprintf(buf, "%llu\n", idle_count);
|
||||
}
|
||||
static SYSDEV_ATTR(idle_count, 0444, show_idle_count, NULL);
|
||||
static DEVICE_ATTR(idle_count, 0444, show_idle_count, NULL);
|
||||
|
||||
static ssize_t show_idle_time(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t show_idle_time(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct s390_idle_data *idle;
|
||||
unsigned long long now, idle_time, idle_enter;
|
||||
@@ -1001,12 +1001,12 @@ repeat:
|
||||
goto repeat;
|
||||
return sprintf(buf, "%llu\n", idle_time >> 12);
|
||||
}
|
||||
static SYSDEV_ATTR(idle_time_us, 0444, show_idle_time, NULL);
|
||||
static DEVICE_ATTR(idle_time_us, 0444, show_idle_time, NULL);
|
||||
|
||||
static struct attribute *cpu_online_attrs[] = {
|
||||
&attr_capability.attr,
|
||||
&attr_idle_count.attr,
|
||||
&attr_idle_time_us.attr,
|
||||
&dev_attr_capability.attr,
|
||||
&dev_attr_idle_count.attr,
|
||||
&dev_attr_idle_time_us.attr,
|
||||
NULL,
|
||||
};
|
||||
|
||||
@@ -1019,7 +1019,7 @@ static int __cpuinit smp_cpu_notify(struct notifier_block *self,
|
||||
{
|
||||
unsigned int cpu = (unsigned int)(long)hcpu;
|
||||
struct cpu *c = &per_cpu(cpu_devices, cpu);
|
||||
struct sys_device *s = &c->sysdev;
|
||||
struct device *s = &c->dev;
|
||||
struct s390_idle_data *idle;
|
||||
int err = 0;
|
||||
|
||||
@@ -1045,7 +1045,7 @@ static struct notifier_block __cpuinitdata smp_cpu_nb = {
|
||||
static int __devinit smp_add_present_cpu(int cpu)
|
||||
{
|
||||
struct cpu *c = &per_cpu(cpu_devices, cpu);
|
||||
struct sys_device *s = &c->sysdev;
|
||||
struct device *s = &c->dev;
|
||||
int rc;
|
||||
|
||||
c->hotpluggable = 1;
|
||||
@@ -1098,8 +1098,8 @@ out:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static ssize_t __ref rescan_store(struct sysdev_class *class,
|
||||
struct sysdev_class_attribute *attr,
|
||||
static ssize_t __ref rescan_store(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
@@ -1108,11 +1108,11 @@ static ssize_t __ref rescan_store(struct sysdev_class *class,
|
||||
rc = smp_rescan_cpus();
|
||||
return rc ? rc : count;
|
||||
}
|
||||
static SYSDEV_CLASS_ATTR(rescan, 0200, NULL, rescan_store);
|
||||
static DEVICE_ATTR(rescan, 0200, NULL, rescan_store);
|
||||
#endif /* CONFIG_HOTPLUG_CPU */
|
||||
|
||||
static ssize_t dispatching_show(struct sysdev_class *class,
|
||||
struct sysdev_class_attribute *attr,
|
||||
static ssize_t dispatching_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
ssize_t count;
|
||||
@@ -1123,8 +1123,8 @@ static ssize_t dispatching_show(struct sysdev_class *class,
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t dispatching_store(struct sysdev_class *dev,
|
||||
struct sysdev_class_attribute *attr,
|
||||
static ssize_t dispatching_store(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
@@ -1148,7 +1148,7 @@ out:
|
||||
put_online_cpus();
|
||||
return rc ? rc : count;
|
||||
}
|
||||
static SYSDEV_CLASS_ATTR(dispatching, 0644, dispatching_show,
|
||||
static DEVICE_ATTR(dispatching, 0644, dispatching_show,
|
||||
dispatching_store);
|
||||
|
||||
static int __init topology_init(void)
|
||||
@@ -1159,11 +1159,11 @@ static int __init topology_init(void)
|
||||
register_cpu_notifier(&smp_cpu_nb);
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
rc = sysdev_class_create_file(&cpu_sysdev_class, &attr_rescan);
|
||||
rc = device_create_file(cpu_subsys.dev_root, &dev_attr_rescan);
|
||||
if (rc)
|
||||
return rc;
|
||||
#endif
|
||||
rc = sysdev_class_create_file(&cpu_sysdev_class, &attr_dispatching);
|
||||
rc = device_create_file(cpu_subsys.dev_root, &dev_attr_dispatching);
|
||||
if (rc)
|
||||
return rc;
|
||||
for_each_present_cpu(cpu) {
|
||||
|
||||
@@ -230,7 +230,7 @@ void store_topology(struct sysinfo_15_1_x *info)
|
||||
int arch_update_cpu_topology(void)
|
||||
{
|
||||
struct sysinfo_15_1_x *info = tl_info;
|
||||
struct sys_device *sysdev;
|
||||
struct device *dev;
|
||||
int cpu;
|
||||
|
||||
if (!MACHINE_HAS_TOPOLOGY) {
|
||||
@@ -242,8 +242,8 @@ int arch_update_cpu_topology(void)
|
||||
tl_to_cores(info);
|
||||
update_cpu_core_map();
|
||||
for_each_online_cpu(cpu) {
|
||||
sysdev = get_cpu_sysdev(cpu);
|
||||
kobject_uevent(&sysdev->kobj, KOBJ_CHANGE);
|
||||
dev = get_cpu_device(cpu);
|
||||
kobject_uevent(&dev->kobj, KOBJ_CHANGE);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/bitmap.h>
|
||||
#include <linux/sysdev.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
@@ -337,9 +337,9 @@ static struct kobj_type ktype_percpu_entry = {
|
||||
.default_attrs = sq_sysfs_attrs,
|
||||
};
|
||||
|
||||
static int __devinit sq_sysdev_add(struct sys_device *sysdev)
|
||||
static int __devinit sq_dev_add(struct device *dev)
|
||||
{
|
||||
unsigned int cpu = sysdev->id;
|
||||
unsigned int cpu = dev->id;
|
||||
struct kobject *kobj;
|
||||
int error;
|
||||
|
||||
@@ -348,25 +348,27 @@ static int __devinit sq_sysdev_add(struct sys_device *sysdev)
|
||||
return -ENOMEM;
|
||||
|
||||
kobj = sq_kobject[cpu];
|
||||
error = kobject_init_and_add(kobj, &ktype_percpu_entry, &sysdev->kobj,
|
||||
error = kobject_init_and_add(kobj, &ktype_percpu_entry, &dev->kobj,
|
||||
"%s", "sq");
|
||||
if (!error)
|
||||
kobject_uevent(kobj, KOBJ_ADD);
|
||||
return error;
|
||||
}
|
||||
|
||||
static int __devexit sq_sysdev_remove(struct sys_device *sysdev)
|
||||
static int __devexit sq_dev_remove(struct device *dev)
|
||||
{
|
||||
unsigned int cpu = sysdev->id;
|
||||
unsigned int cpu = dev->id;
|
||||
struct kobject *kobj = sq_kobject[cpu];
|
||||
|
||||
kobject_put(kobj);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct sysdev_driver sq_sysdev_driver = {
|
||||
.add = sq_sysdev_add,
|
||||
.remove = __devexit_p(sq_sysdev_remove),
|
||||
static struct subsys_interface sq_interface = {
|
||||
.name = "sq"
|
||||
.subsys = &cpu_subsys,
|
||||
.add_dev = sq_dev_add,
|
||||
.remove_dev = __devexit_p(sq_dev_remove),
|
||||
};
|
||||
|
||||
static int __init sq_api_init(void)
|
||||
@@ -386,7 +388,7 @@ static int __init sq_api_init(void)
|
||||
if (unlikely(!sq_bitmap))
|
||||
goto out;
|
||||
|
||||
ret = sysdev_driver_register(&cpu_sysdev_class, &sq_sysdev_driver);
|
||||
ret = subsys_interface_register(&sq_interface);
|
||||
if (unlikely(ret != 0))
|
||||
goto out;
|
||||
|
||||
@@ -401,7 +403,7 @@ out:
|
||||
|
||||
static void __exit sq_api_exit(void)
|
||||
{
|
||||
sysdev_driver_unregister(&cpu_sysdev_class, &sq_sysdev_driver);
|
||||
subsys_interface_unregister(&sq_interface);
|
||||
kfree(sq_bitmap);
|
||||
kmem_cache_destroy(sq_cache);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2007 David S. Miller <davem@davemloft.net>
|
||||
*/
|
||||
#include <linux/sched.h>
|
||||
#include <linux/sysdev.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/percpu.h>
|
||||
@@ -16,13 +16,13 @@
|
||||
static DEFINE_PER_CPU(struct hv_mmu_statistics, mmu_stats) __attribute__((aligned(64)));
|
||||
|
||||
#define SHOW_MMUSTAT_ULONG(NAME) \
|
||||
static ssize_t show_##NAME(struct sys_device *dev, \
|
||||
struct sysdev_attribute *attr, char *buf) \
|
||||
static ssize_t show_##NAME(struct device *dev, \
|
||||
struct device_attribute *attr, char *buf) \
|
||||
{ \
|
||||
struct hv_mmu_statistics *p = &per_cpu(mmu_stats, dev->id); \
|
||||
return sprintf(buf, "%lu\n", p->NAME); \
|
||||
} \
|
||||
static SYSDEV_ATTR(NAME, 0444, show_##NAME, NULL)
|
||||
static DEVICE_ATTR(NAME, 0444, show_##NAME, NULL)
|
||||
|
||||
SHOW_MMUSTAT_ULONG(immu_tsb_hits_ctx0_8k_tte);
|
||||
SHOW_MMUSTAT_ULONG(immu_tsb_ticks_ctx0_8k_tte);
|
||||
@@ -58,38 +58,38 @@ SHOW_MMUSTAT_ULONG(dmmu_tsb_hits_ctxnon0_256mb_tte);
|
||||
SHOW_MMUSTAT_ULONG(dmmu_tsb_ticks_ctxnon0_256mb_tte);
|
||||
|
||||
static struct attribute *mmu_stat_attrs[] = {
|
||||
&attr_immu_tsb_hits_ctx0_8k_tte.attr,
|
||||
&attr_immu_tsb_ticks_ctx0_8k_tte.attr,
|
||||
&attr_immu_tsb_hits_ctx0_64k_tte.attr,
|
||||
&attr_immu_tsb_ticks_ctx0_64k_tte.attr,
|
||||
&attr_immu_tsb_hits_ctx0_4mb_tte.attr,
|
||||
&attr_immu_tsb_ticks_ctx0_4mb_tte.attr,
|
||||
&attr_immu_tsb_hits_ctx0_256mb_tte.attr,
|
||||
&attr_immu_tsb_ticks_ctx0_256mb_tte.attr,
|
||||
&attr_immu_tsb_hits_ctxnon0_8k_tte.attr,
|
||||
&attr_immu_tsb_ticks_ctxnon0_8k_tte.attr,
|
||||
&attr_immu_tsb_hits_ctxnon0_64k_tte.attr,
|
||||
&attr_immu_tsb_ticks_ctxnon0_64k_tte.attr,
|
||||
&attr_immu_tsb_hits_ctxnon0_4mb_tte.attr,
|
||||
&attr_immu_tsb_ticks_ctxnon0_4mb_tte.attr,
|
||||
&attr_immu_tsb_hits_ctxnon0_256mb_tte.attr,
|
||||
&attr_immu_tsb_ticks_ctxnon0_256mb_tte.attr,
|
||||
&attr_dmmu_tsb_hits_ctx0_8k_tte.attr,
|
||||
&attr_dmmu_tsb_ticks_ctx0_8k_tte.attr,
|
||||
&attr_dmmu_tsb_hits_ctx0_64k_tte.attr,
|
||||
&attr_dmmu_tsb_ticks_ctx0_64k_tte.attr,
|
||||
&attr_dmmu_tsb_hits_ctx0_4mb_tte.attr,
|
||||
&attr_dmmu_tsb_ticks_ctx0_4mb_tte.attr,
|
||||
&attr_dmmu_tsb_hits_ctx0_256mb_tte.attr,
|
||||
&attr_dmmu_tsb_ticks_ctx0_256mb_tte.attr,
|
||||
&attr_dmmu_tsb_hits_ctxnon0_8k_tte.attr,
|
||||
&attr_dmmu_tsb_ticks_ctxnon0_8k_tte.attr,
|
||||
&attr_dmmu_tsb_hits_ctxnon0_64k_tte.attr,
|
||||
&attr_dmmu_tsb_ticks_ctxnon0_64k_tte.attr,
|
||||
&attr_dmmu_tsb_hits_ctxnon0_4mb_tte.attr,
|
||||
&attr_dmmu_tsb_ticks_ctxnon0_4mb_tte.attr,
|
||||
&attr_dmmu_tsb_hits_ctxnon0_256mb_tte.attr,
|
||||
&attr_dmmu_tsb_ticks_ctxnon0_256mb_tte.attr,
|
||||
&dev_attr_immu_tsb_hits_ctx0_8k_tte.attr,
|
||||
&dev_attr_immu_tsb_ticks_ctx0_8k_tte.attr,
|
||||
&dev_attr_immu_tsb_hits_ctx0_64k_tte.attr,
|
||||
&dev_attr_immu_tsb_ticks_ctx0_64k_tte.attr,
|
||||
&dev_attr_immu_tsb_hits_ctx0_4mb_tte.attr,
|
||||
&dev_attr_immu_tsb_ticks_ctx0_4mb_tte.attr,
|
||||
&dev_attr_immu_tsb_hits_ctx0_256mb_tte.attr,
|
||||
&dev_attr_immu_tsb_ticks_ctx0_256mb_tte.attr,
|
||||
&dev_attr_immu_tsb_hits_ctxnon0_8k_tte.attr,
|
||||
&dev_attr_immu_tsb_ticks_ctxnon0_8k_tte.attr,
|
||||
&dev_attr_immu_tsb_hits_ctxnon0_64k_tte.attr,
|
||||
&dev_attr_immu_tsb_ticks_ctxnon0_64k_tte.attr,
|
||||
&dev_attr_immu_tsb_hits_ctxnon0_4mb_tte.attr,
|
||||
&dev_attr_immu_tsb_ticks_ctxnon0_4mb_tte.attr,
|
||||
&dev_attr_immu_tsb_hits_ctxnon0_256mb_tte.attr,
|
||||
&dev_attr_immu_tsb_ticks_ctxnon0_256mb_tte.attr,
|
||||
&dev_attr_dmmu_tsb_hits_ctx0_8k_tte.attr,
|
||||
&dev_attr_dmmu_tsb_ticks_ctx0_8k_tte.attr,
|
||||
&dev_attr_dmmu_tsb_hits_ctx0_64k_tte.attr,
|
||||
&dev_attr_dmmu_tsb_ticks_ctx0_64k_tte.attr,
|
||||
&dev_attr_dmmu_tsb_hits_ctx0_4mb_tte.attr,
|
||||
&dev_attr_dmmu_tsb_ticks_ctx0_4mb_tte.attr,
|
||||
&dev_attr_dmmu_tsb_hits_ctx0_256mb_tte.attr,
|
||||
&dev_attr_dmmu_tsb_ticks_ctx0_256mb_tte.attr,
|
||||
&dev_attr_dmmu_tsb_hits_ctxnon0_8k_tte.attr,
|
||||
&dev_attr_dmmu_tsb_ticks_ctxnon0_8k_tte.attr,
|
||||
&dev_attr_dmmu_tsb_hits_ctxnon0_64k_tte.attr,
|
||||
&dev_attr_dmmu_tsb_ticks_ctxnon0_64k_tte.attr,
|
||||
&dev_attr_dmmu_tsb_hits_ctxnon0_4mb_tte.attr,
|
||||
&dev_attr_dmmu_tsb_ticks_ctxnon0_4mb_tte.attr,
|
||||
&dev_attr_dmmu_tsb_hits_ctxnon0_256mb_tte.attr,
|
||||
&dev_attr_dmmu_tsb_ticks_ctxnon0_256mb_tte.attr,
|
||||
NULL,
|
||||
};
|
||||
|
||||
@@ -139,15 +139,15 @@ static unsigned long write_mmustat_enable(unsigned long val)
|
||||
return sun4v_mmustat_conf(ra, &orig_ra);
|
||||
}
|
||||
|
||||
static ssize_t show_mmustat_enable(struct sys_device *s,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
static ssize_t show_mmustat_enable(struct device *s,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
unsigned long val = run_on_cpu(s->id, read_mmustat_enable, 0);
|
||||
return sprintf(buf, "%lx\n", val);
|
||||
}
|
||||
|
||||
static ssize_t store_mmustat_enable(struct sys_device *s,
|
||||
struct sysdev_attribute *attr, const char *buf,
|
||||
static ssize_t store_mmustat_enable(struct device *s,
|
||||
struct device_attribute *attr, const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
unsigned long val, err;
|
||||
@@ -163,39 +163,39 @@ static ssize_t store_mmustat_enable(struct sys_device *s,
|
||||
return count;
|
||||
}
|
||||
|
||||
static SYSDEV_ATTR(mmustat_enable, 0644, show_mmustat_enable, store_mmustat_enable);
|
||||
static DEVICE_ATTR(mmustat_enable, 0644, show_mmustat_enable, store_mmustat_enable);
|
||||
|
||||
static int mmu_stats_supported;
|
||||
|
||||
static int register_mmu_stats(struct sys_device *s)
|
||||
static int register_mmu_stats(struct device *s)
|
||||
{
|
||||
if (!mmu_stats_supported)
|
||||
return 0;
|
||||
sysdev_create_file(s, &attr_mmustat_enable);
|
||||
device_create_file(s, &dev_attr_mmustat_enable);
|
||||
return sysfs_create_group(&s->kobj, &mmu_stat_group);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
static void unregister_mmu_stats(struct sys_device *s)
|
||||
static void unregister_mmu_stats(struct device *s)
|
||||
{
|
||||
if (!mmu_stats_supported)
|
||||
return;
|
||||
sysfs_remove_group(&s->kobj, &mmu_stat_group);
|
||||
sysdev_remove_file(s, &attr_mmustat_enable);
|
||||
device_remove_file(s, &dev_attr_mmustat_enable);
|
||||
}
|
||||
#endif
|
||||
|
||||
#define SHOW_CPUDATA_ULONG_NAME(NAME, MEMBER) \
|
||||
static ssize_t show_##NAME(struct sys_device *dev, \
|
||||
struct sysdev_attribute *attr, char *buf) \
|
||||
static ssize_t show_##NAME(struct device *dev, \
|
||||
struct device_attribute *attr, char *buf) \
|
||||
{ \
|
||||
cpuinfo_sparc *c = &cpu_data(dev->id); \
|
||||
return sprintf(buf, "%lu\n", c->MEMBER); \
|
||||
}
|
||||
|
||||
#define SHOW_CPUDATA_UINT_NAME(NAME, MEMBER) \
|
||||
static ssize_t show_##NAME(struct sys_device *dev, \
|
||||
struct sysdev_attribute *attr, char *buf) \
|
||||
static ssize_t show_##NAME(struct device *dev, \
|
||||
struct device_attribute *attr, char *buf) \
|
||||
{ \
|
||||
cpuinfo_sparc *c = &cpu_data(dev->id); \
|
||||
return sprintf(buf, "%u\n", c->MEMBER); \
|
||||
@@ -209,14 +209,14 @@ SHOW_CPUDATA_UINT_NAME(l1_icache_line_size, icache_line_size);
|
||||
SHOW_CPUDATA_UINT_NAME(l2_cache_size, ecache_size);
|
||||
SHOW_CPUDATA_UINT_NAME(l2_cache_line_size, ecache_line_size);
|
||||
|
||||
static struct sysdev_attribute cpu_core_attrs[] = {
|
||||
_SYSDEV_ATTR(clock_tick, 0444, show_clock_tick, NULL),
|
||||
_SYSDEV_ATTR(l1_dcache_size, 0444, show_l1_dcache_size, NULL),
|
||||
_SYSDEV_ATTR(l1_dcache_line_size, 0444, show_l1_dcache_line_size, NULL),
|
||||
_SYSDEV_ATTR(l1_icache_size, 0444, show_l1_icache_size, NULL),
|
||||
_SYSDEV_ATTR(l1_icache_line_size, 0444, show_l1_icache_line_size, NULL),
|
||||
_SYSDEV_ATTR(l2_cache_size, 0444, show_l2_cache_size, NULL),
|
||||
_SYSDEV_ATTR(l2_cache_line_size, 0444, show_l2_cache_line_size, NULL),
|
||||
static struct device_attribute cpu_core_attrs[] = {
|
||||
__ATTR(clock_tick, 0444, show_clock_tick, NULL),
|
||||
__ATTR(l1_dcache_size, 0444, show_l1_dcache_size, NULL),
|
||||
__ATTR(l1_dcache_line_size, 0444, show_l1_dcache_line_size, NULL),
|
||||
__ATTR(l1_icache_size, 0444, show_l1_icache_size, NULL),
|
||||
__ATTR(l1_icache_line_size, 0444, show_l1_icache_line_size, NULL),
|
||||
__ATTR(l2_cache_size, 0444, show_l2_cache_size, NULL),
|
||||
__ATTR(l2_cache_line_size, 0444, show_l2_cache_line_size, NULL),
|
||||
};
|
||||
|
||||
static DEFINE_PER_CPU(struct cpu, cpu_devices);
|
||||
@@ -224,11 +224,11 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices);
|
||||
static void register_cpu_online(unsigned int cpu)
|
||||
{
|
||||
struct cpu *c = &per_cpu(cpu_devices, cpu);
|
||||
struct sys_device *s = &c->sysdev;
|
||||
struct device *s = &c->dev;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++)
|
||||
sysdev_create_file(s, &cpu_core_attrs[i]);
|
||||
device_create_file(s, &cpu_core_attrs[i]);
|
||||
|
||||
register_mmu_stats(s);
|
||||
}
|
||||
@@ -237,12 +237,12 @@ static void register_cpu_online(unsigned int cpu)
|
||||
static void unregister_cpu_online(unsigned int cpu)
|
||||
{
|
||||
struct cpu *c = &per_cpu(cpu_devices, cpu);
|
||||
struct sys_device *s = &c->sysdev;
|
||||
struct device *s = &c->dev;
|
||||
int i;
|
||||
|
||||
unregister_mmu_stats(s);
|
||||
for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++)
|
||||
sysdev_remove_file(s, &cpu_core_attrs[i]);
|
||||
device_remove_file(s, &cpu_core_attrs[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* /sys entry support.
|
||||
*/
|
||||
|
||||
#include <linux/sysdev.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/smp.h>
|
||||
@@ -31,55 +31,55 @@ static ssize_t get_hv_confstr(char *page, int query)
|
||||
return n;
|
||||
}
|
||||
|
||||
static ssize_t chip_width_show(struct sysdev_class *dev,
|
||||
struct sysdev_class_attribute *attr,
|
||||
static ssize_t chip_width_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *page)
|
||||
{
|
||||
return sprintf(page, "%u\n", smp_width);
|
||||
}
|
||||
static SYSDEV_CLASS_ATTR(chip_width, 0444, chip_width_show, NULL);
|
||||
static DEVICE_ATTR(chip_width, 0444, chip_width_show, NULL);
|
||||
|
||||
static ssize_t chip_height_show(struct sysdev_class *dev,
|
||||
struct sysdev_class_attribute *attr,
|
||||
static ssize_t chip_height_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *page)
|
||||
{
|
||||
return sprintf(page, "%u\n", smp_height);
|
||||
}
|
||||
static SYSDEV_CLASS_ATTR(chip_height, 0444, chip_height_show, NULL);
|
||||
static DEVICE_ATTR(chip_height, 0444, chip_height_show, NULL);
|
||||
|
||||
static ssize_t chip_serial_show(struct sysdev_class *dev,
|
||||
struct sysdev_class_attribute *attr,
|
||||
static ssize_t chip_serial_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *page)
|
||||
{
|
||||
return get_hv_confstr(page, HV_CONFSTR_CHIP_SERIAL_NUM);
|
||||
}
|
||||
static SYSDEV_CLASS_ATTR(chip_serial, 0444, chip_serial_show, NULL);
|
||||
static DEVICE_ATTR(chip_serial, 0444, chip_serial_show, NULL);
|
||||
|
||||
static ssize_t chip_revision_show(struct sysdev_class *dev,
|
||||
struct sysdev_class_attribute *attr,
|
||||
static ssize_t chip_revision_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *page)
|
||||
{
|
||||
return get_hv_confstr(page, HV_CONFSTR_CHIP_REV);
|
||||
}
|
||||
static SYSDEV_CLASS_ATTR(chip_revision, 0444, chip_revision_show, NULL);
|
||||
static DEVICE_ATTR(chip_revision, 0444, chip_revision_show, NULL);
|
||||
|
||||
|
||||
static ssize_t type_show(struct sysdev_class *dev,
|
||||
struct sysdev_class_attribute *attr,
|
||||
static ssize_t type_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *page)
|
||||
{
|
||||
return sprintf(page, "tilera\n");
|
||||
}
|
||||
static SYSDEV_CLASS_ATTR(type, 0444, type_show, NULL);
|
||||
static DEVICE_ATTR(type, 0444, type_show, NULL);
|
||||
|
||||
#define HV_CONF_ATTR(name, conf) \
|
||||
static ssize_t name ## _show(struct sysdev_class *dev, \
|
||||
struct sysdev_class_attribute *attr, \
|
||||
static ssize_t name ## _show(struct device *dev, \
|
||||
struct device_attribute *attr, \
|
||||
char *page) \
|
||||
{ \
|
||||
return get_hv_confstr(page, conf); \
|
||||
} \
|
||||
static SYSDEV_CLASS_ATTR(name, 0444, name ## _show, NULL);
|
||||
static DEVICE_ATTR(name, 0444, name ## _show, NULL);
|
||||
|
||||
HV_CONF_ATTR(version, HV_CONFSTR_HV_SW_VER)
|
||||
HV_CONF_ATTR(config_version, HV_CONFSTR_HV_CONFIG_VER)
|
||||
@@ -95,15 +95,15 @@ HV_CONF_ATTR(mezz_description, HV_CONFSTR_MEZZ_DESC)
|
||||
HV_CONF_ATTR(switch_control, HV_CONFSTR_SWITCH_CONTROL)
|
||||
|
||||
static struct attribute *board_attrs[] = {
|
||||
&attr_board_part.attr,
|
||||
&attr_board_serial.attr,
|
||||
&attr_board_revision.attr,
|
||||
&attr_board_description.attr,
|
||||
&attr_mezz_part.attr,
|
||||
&attr_mezz_serial.attr,
|
||||
&attr_mezz_revision.attr,
|
||||
&attr_mezz_description.attr,
|
||||
&attr_switch_control.attr,
|
||||
&dev_attr_board_part.attr,
|
||||
&dev_attr_board_serial.attr,
|
||||
&dev_attr_board_revision.attr,
|
||||
&dev_attr_board_description.attr,
|
||||
&dev_attr_mezz_part.attr,
|
||||
&dev_attr_mezz_serial.attr,
|
||||
&dev_attr_mezz_revision.attr,
|
||||
&dev_attr_mezz_description.attr,
|
||||
&dev_attr_switch_control.attr,
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -150,12 +150,11 @@ hvconfig_bin_read(struct file *filp, struct kobject *kobj,
|
||||
|
||||
static int __init create_sysfs_entries(void)
|
||||
{
|
||||
struct sysdev_class *cls = &cpu_sysdev_class;
|
||||
int err = 0;
|
||||
|
||||
#define create_cpu_attr(name) \
|
||||
if (!err) \
|
||||
err = sysfs_create_file(&cls->kset.kobj, &attr_##name.attr);
|
||||
err = device_create_file(cpu_subsys.dev_root, &dev_attr_##name);
|
||||
create_cpu_attr(chip_width);
|
||||
create_cpu_attr(chip_height);
|
||||
create_cpu_attr(chip_serial);
|
||||
@@ -163,7 +162,7 @@ static int __init create_sysfs_entries(void)
|
||||
|
||||
#define create_hv_attr(name) \
|
||||
if (!err) \
|
||||
err = sysfs_create_file(hypervisor_kobj, &attr_##name.attr);
|
||||
err = sysfs_create_file(hypervisor_kobj, &dev_attr_##name);
|
||||
create_hv_attr(type);
|
||||
create_hv_attr(version);
|
||||
create_hv_attr(config_version);
|
||||
|
||||
@@ -149,7 +149,7 @@ static inline void enable_p5_mce(void) {}
|
||||
|
||||
void mce_setup(struct mce *m);
|
||||
void mce_log(struct mce *m);
|
||||
DECLARE_PER_CPU(struct sys_device, mce_sysdev);
|
||||
DECLARE_PER_CPU(struct device, mce_device);
|
||||
|
||||
/*
|
||||
* Maximum banks number.
|
||||
|
||||
@@ -844,8 +844,7 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu)
|
||||
|
||||
#include <linux/kobject.h>
|
||||
#include <linux/sysfs.h>
|
||||
|
||||
extern struct sysdev_class cpu_sysdev_class; /* from drivers/base/cpu.c */
|
||||
#include <linux/cpu.h>
|
||||
|
||||
/* pointer to kobject for cpuX/cache */
|
||||
static DEFINE_PER_CPU(struct kobject *, ici_cache_kobject);
|
||||
@@ -1073,9 +1072,9 @@ err_out:
|
||||
static DECLARE_BITMAP(cache_dev_map, NR_CPUS);
|
||||
|
||||
/* Add/Remove cache interface for CPU device */
|
||||
static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
|
||||
static int __cpuinit cache_add_dev(struct device *dev)
|
||||
{
|
||||
unsigned int cpu = sys_dev->id;
|
||||
unsigned int cpu = dev->id;
|
||||
unsigned long i, j;
|
||||
struct _index_kobject *this_object;
|
||||
struct _cpuid4_info *this_leaf;
|
||||
@@ -1087,7 +1086,7 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
|
||||
|
||||
retval = kobject_init_and_add(per_cpu(ici_cache_kobject, cpu),
|
||||
&ktype_percpu_entry,
|
||||
&sys_dev->kobj, "%s", "cache");
|
||||
&dev->kobj, "%s", "cache");
|
||||
if (retval < 0) {
|
||||
cpuid4_cache_sysfs_exit(cpu);
|
||||
return retval;
|
||||
@@ -1124,9 +1123,9 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __cpuinit cache_remove_dev(struct sys_device * sys_dev)
|
||||
static void __cpuinit cache_remove_dev(struct device *dev)
|
||||
{
|
||||
unsigned int cpu = sys_dev->id;
|
||||
unsigned int cpu = dev->id;
|
||||
unsigned long i;
|
||||
|
||||
if (per_cpu(ici_cpuid4_info, cpu) == NULL)
|
||||
@@ -1145,17 +1144,17 @@ static int __cpuinit cacheinfo_cpu_callback(struct notifier_block *nfb,
|
||||
unsigned long action, void *hcpu)
|
||||
{
|
||||
unsigned int cpu = (unsigned long)hcpu;
|
||||
struct sys_device *sys_dev;
|
||||
struct device *dev;
|
||||
|
||||
sys_dev = get_cpu_sysdev(cpu);
|
||||
dev = get_cpu_device(cpu);
|
||||
switch (action) {
|
||||
case CPU_ONLINE:
|
||||
case CPU_ONLINE_FROZEN:
|
||||
cache_add_dev(sys_dev);
|
||||
cache_add_dev(dev);
|
||||
break;
|
||||
case CPU_DEAD:
|
||||
case CPU_DEAD_FROZEN:
|
||||
cache_remove_dev(sys_dev);
|
||||
cache_remove_dev(dev);
|
||||
break;
|
||||
}
|
||||
return NOTIFY_OK;
|
||||
@@ -1174,9 +1173,9 @@ static int __cpuinit cache_sysfs_init(void)
|
||||
|
||||
for_each_online_cpu(i) {
|
||||
int err;
|
||||
struct sys_device *sys_dev = get_cpu_sysdev(i);
|
||||
struct device *dev = get_cpu_device(i);
|
||||
|
||||
err = cache_add_dev(sys_dev);
|
||||
err = cache_add_dev(dev);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user