• Home
  • Raw
  • Download

Lines Matching refs:b

69 	struct threshold_block	*b;  member
82 static const char * const bank4_names(struct threshold_block *b) in bank4_names() argument
84 switch (b->address) { in bank4_names()
96 WARN(1, "Funny MSR: 0x%08x\n", b->address); in bank4_names()
117 static int lvt_off_valid(struct threshold_block *b, int apic, u32 lo, u32 hi) in lvt_off_valid() argument
123 "for bank %d, block %d (MSR%08X=0x%x%08x)\n", b->cpu, in lvt_off_valid()
124 b->bank, b->block, b->address, hi, lo); in lvt_off_valid()
131 b->cpu, apic, b->bank, b->block, b->address, hi, lo); in lvt_off_valid()
147 rdmsr(tr->b->address, lo, hi); in threshold_restart_bank()
149 if (tr->b->threshold_limit < (hi & THRESHOLD_MAX)) in threshold_restart_bank()
155 (THRESHOLD_MAX - tr->b->threshold_limit); in threshold_restart_bank()
158 (tr->old_limit - tr->b->threshold_limit); in threshold_restart_bank()
167 if (!tr->b->interrupt_capable) in threshold_restart_bank()
171 if (lvt_off_valid(tr->b, tr->lvt_off, lo, hi)) { in threshold_restart_bank()
178 if (tr->b->interrupt_enable) in threshold_restart_bank()
184 wrmsr(tr->b->address, lo, hi); in threshold_restart_bank()
187 static void mce_threshold_block_init(struct threshold_block *b, int offset) in mce_threshold_block_init() argument
190 .b = b, in mce_threshold_block_init()
195 b->threshold_limit = THRESHOLD_MAX; in mce_threshold_block_init()
211 struct threshold_block b; in mce_amd_feature_init() local
243 memset(&b, 0, sizeof(b)); in mce_amd_feature_init()
244 b.cpu = cpu; in mce_amd_feature_init()
245 b.bank = bank; in mce_amd_feature_init()
246 b.block = block; in mce_amd_feature_init()
247 b.address = address; in mce_amd_feature_init()
248 b.interrupt_capable = lvt_interrupt_supported(bank, high); in mce_amd_feature_init()
250 if (b.interrupt_capable) { in mce_amd_feature_init()
255 mce_threshold_block_init(&b, offset); in mce_amd_feature_init()
340 static ssize_t show_ ## name(struct threshold_block *b, char *buf) \
342 return sprintf(buf, "%lu\n", (unsigned long) b->name); \
348 store_interrupt_enable(struct threshold_block *b, const char *buf, size_t size) in SHOW_FIELDS()
353 if (!b->interrupt_capable) in SHOW_FIELDS()
359 b->interrupt_enable = !!new; in SHOW_FIELDS()
362 tr.b = b; in SHOW_FIELDS()
364 smp_call_function_single(b->cpu, threshold_restart_bank, &tr, 1); in SHOW_FIELDS()
370 store_threshold_limit(struct threshold_block *b, const char *buf, size_t size) in store_threshold_limit() argument
384 tr.old_limit = b->threshold_limit; in store_threshold_limit()
385 b->threshold_limit = new; in store_threshold_limit()
386 tr.b = b; in store_threshold_limit()
388 smp_call_function_single(b->cpu, threshold_restart_bank, &tr, 1); in store_threshold_limit()
393 static ssize_t show_error_count(struct threshold_block *b, char *buf) in show_error_count() argument
397 rdmsr_on_cpu(b->cpu, b->address, &lo, &hi); in show_error_count()
400 (THRESHOLD_MAX - b->threshold_limit))); in show_error_count()
430 struct threshold_block *b = to_block(kobj); in show() local
434 ret = a->show ? a->show(b, buf) : -EIO; in show()
442 struct threshold_block *b = to_block(kobj); in store() local
446 ret = a->store ? a->store(b, buf, count) : -EIO; in store()
466 struct threshold_block *b = NULL; in allocate_threshold_blocks() local
487 b = kzalloc(sizeof(struct threshold_block), GFP_KERNEL); in allocate_threshold_blocks()
488 if (!b) in allocate_threshold_blocks()
491 b->block = block; in allocate_threshold_blocks()
492 b->bank = bank; in allocate_threshold_blocks()
493 b->cpu = cpu; in allocate_threshold_blocks()
494 b->address = address; in allocate_threshold_blocks()
495 b->interrupt_enable = 0; in allocate_threshold_blocks()
496 b->interrupt_capable = lvt_interrupt_supported(bank, high); in allocate_threshold_blocks()
497 b->threshold_limit = THRESHOLD_MAX; in allocate_threshold_blocks()
499 if (b->interrupt_capable) in allocate_threshold_blocks()
504 INIT_LIST_HEAD(&b->miscj); in allocate_threshold_blocks()
507 list_add(&b->miscj, in allocate_threshold_blocks()
510 per_cpu(threshold_banks, cpu)[bank]->blocks = b; in allocate_threshold_blocks()
513 err = kobject_init_and_add(&b->kobj, &threshold_ktype, in allocate_threshold_blocks()
515 (bank == 4 ? bank4_names(b) : th_names[bank])); in allocate_threshold_blocks()
532 if (b) in allocate_threshold_blocks()
533 kobject_uevent(&b->kobj, KOBJ_ADD); in allocate_threshold_blocks()
538 if (b) { in allocate_threshold_blocks()
539 kobject_put(&b->kobj); in allocate_threshold_blocks()
540 list_del(&b->miscj); in allocate_threshold_blocks()
541 kfree(b); in allocate_threshold_blocks()
546 static __cpuinit int __threshold_add_blocks(struct threshold_bank *b) in __threshold_add_blocks() argument
548 struct list_head *head = &b->blocks->miscj; in __threshold_add_blocks()
553 err = kobject_add(&b->blocks->kobj, b->kobj, b->blocks->kobj.name); in __threshold_add_blocks()
559 err = kobject_add(&pos->kobj, b->kobj, pos->kobj.name); in __threshold_add_blocks()
574 struct threshold_bank *b = NULL; in threshold_create_bank() local
584 b = nb->bank4; in threshold_create_bank()
585 err = kobject_add(b->kobj, &dev->kobj, name); in threshold_create_bank()
589 per_cpu(threshold_banks, cpu)[bank] = b; in threshold_create_bank()
590 atomic_inc(&b->cpus); in threshold_create_bank()
592 err = __threshold_add_blocks(b); in threshold_create_bank()
598 b = kzalloc(sizeof(struct threshold_bank), GFP_KERNEL); in threshold_create_bank()
599 if (!b) { in threshold_create_bank()
604 b->kobj = kobject_create_and_add(name, &dev->kobj); in threshold_create_bank()
605 if (!b->kobj) { in threshold_create_bank()
610 per_cpu(threshold_banks, cpu)[bank] = b; in threshold_create_bank()
613 atomic_set(&b->cpus, 1); in threshold_create_bank()
618 nb->bank4 = b; in threshold_create_bank()
628 kfree(b); in threshold_create_bank()
679 static void __threshold_remove_blocks(struct threshold_bank *b) in __threshold_remove_blocks() argument
684 kobject_del(b->kobj); in __threshold_remove_blocks()
686 list_for_each_entry_safe(pos, tmp, &b->blocks->miscj, miscj) in __threshold_remove_blocks()
693 struct threshold_bank *b; in threshold_remove_bank() local
695 b = per_cpu(threshold_banks, cpu)[bank]; in threshold_remove_bank()
696 if (!b) in threshold_remove_bank()
699 if (!b->blocks) in threshold_remove_bank()
703 if (!atomic_dec_and_test(&b->cpus)) { in threshold_remove_bank()
704 __threshold_remove_blocks(b); in threshold_remove_bank()
720 kobject_del(b->kobj); in threshold_remove_bank()
721 kobject_put(b->kobj); in threshold_remove_bank()
722 kfree(b); in threshold_remove_bank()