int __init early_irq_init(void)
{
	int i, initcnt, node = first_online_node;
	struct irq_desc *desc;

	init_irq_default_affinity();

	/* Let arch update nr_irqs and return the nr of preallocated irqs */
	initcnt = arch_probe_nr_irqs();
	printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d %d\n", NR_IRQS, nr_irqs, initcnt);

	if (WARN_ON(nr_irqs > IRQ_BITMAP_BITS))
		nr_irqs = IRQ_BITMAP_BITS;

	if (WARN_ON(initcnt > IRQ_BITMAP_BITS))
		initcnt = IRQ_BITMAP_BITS;

	if (initcnt > nr_irqs)
		nr_irqs = initcnt;

	for (i = 0; i < initcnt; i++) {
		desc = alloc_desc(i, node, NULL);
		set_bit(i, allocated_irqs);
		irq_insert_desc(i, desc);
	}
	return arch_early_irq_init();
}
Beispiel #2
0
int __init early_irq_init(void)
{
	struct irq_desc *desc;
	int legacy_count;
	int node;
	int i;

	init_irq_default_affinity();

	 /* initialize nr_irqs based on nr_cpu_ids */
	arch_probe_nr_irqs();
	printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d\n", NR_IRQS, nr_irqs);

	desc = irq_desc_legacy;
	legacy_count = ARRAY_SIZE(irq_desc_legacy);
	node = first_online_node;

	/* allocate based on nr_cpu_ids */
	kstat_irqs_legacy = kzalloc_node(NR_IRQS_LEGACY * nr_cpu_ids *
					  sizeof(int), GFP_NOWAIT, node);

	for (i = 0; i < legacy_count; i++) {
		desc[i].irq = i;
#ifdef CONFIG_SMP
		desc[i].node = node;
#endif
		desc[i].kstat_irqs = kstat_irqs_legacy + i * nr_cpu_ids;
		lockdep_set_class(&desc[i].lock, &irq_desc_lock_class);
		alloc_desc_masks(&desc[i], node, true);
		init_desc_masks(&desc[i]);
		set_irq_desc(i, &desc[i]);
	}

	return arch_early_irq_init();
}
Beispiel #3
0
int __init early_irq_init(void)
{
	int count, i, node = first_online_node;
	struct irq_desc *desc;

	init_irq_default_affinity();

#ifdef CONFIG_DEBUG_PRINTK
	printk(KERN_INFO "NR_IRQS:%d\n", NR_IRQS);
#else
	;
#endif

	desc = irq_desc;
	count = ARRAY_SIZE(irq_desc);

	for (i = 0; i < count; i++) {
		desc[i].kstat_irqs = alloc_percpu(unsigned int);
		alloc_masks(&desc[i], GFP_KERNEL, node);
		raw_spin_lock_init(&desc[i].lock);
		lockdep_set_class(&desc[i].lock, &irq_desc_lock_class);
		desc_set_defaults(i, &desc[i], node);
	}
	return arch_early_irq_init();
}
Beispiel #4
0
int __init early_irq_init(void)
{
	struct irq_desc *desc;
	int count;
	int i;

	init_irq_default_affinity();

	printk(KERN_INFO "NR_IRQS:%d\n", NR_IRQS);

	desc = irq_desc;
	count = ARRAY_SIZE(irq_desc);

	for (i = 0; i < count; i++) {
		desc[i].irq = i;
		init_alloc_desc_masks(&desc[i], 0, true);
		desc[i].kstat_irqs = kstat_irqs_all[i];
	}
	return arch_early_irq_init();
}
Beispiel #5
0
int __init early_irq_init(void)
{
	int count, i, node = first_online_node;
	struct irq_desc *desc;

	init_irq_default_affinity();

	printk(KERN_INFO "NR_IRQS: %d\n", NR_IRQS);

	desc = irq_desc;
	count = ARRAY_SIZE(irq_desc);

	for (i = 0; i < count; i++) {
		desc[i].kstat_irqs = alloc_percpu(unsigned int);
		alloc_masks(&desc[i], node);
		raw_spin_lock_init(&desc[i].lock);
		lockdep_set_class(&desc[i].lock, &irq_desc_lock_class);
		mutex_init(&desc[i].request_mutex);
		desc_set_defaults(i, &desc[i], node, NULL, NULL);
	}
	return arch_early_irq_init();
}
Beispiel #6
0
int __init early_irq_init(void)
{
	int count, i, node = first_online_node;
	struct irq_desc *desc;

	init_irq_default_affinity();

	printk(KERN_INFO "NR_IRQS:%d\n", NR_IRQS);

	desc = irq_desc;
	count = ARRAY_SIZE(irq_desc);

	for (i = 0; i < count; i++) {
		desc[i].irq_data.irq = i;
		desc[i].irq_data.chip = &no_irq_chip;
		desc[i].kstat_irqs = kstat_irqs_all[i];
		alloc_masks(desc + i, GFP_KERNEL, node);
		desc_smp_init(desc + i, node);
		lockdep_set_class(&desc[i].lock, &irq_desc_lock_class);
	}
	return arch_early_irq_init();
}
Beispiel #7
0
int __init early_irq_init(void)
{
	struct irq_desc *desc;
	int legacy_count;
	int node;
	int i;

	init_irq_default_affinity();

	 /* initialize nr_irqs based on nr_cpu_ids */
	arch_probe_nr_irqs();
	printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d\n", NR_IRQS, nr_irqs);

	desc = irq_desc_legacy;
	legacy_count = ARRAY_SIZE(irq_desc_legacy);
 	node = first_online_node;

	/* allocate irq_desc_ptrs array based on nr_irqs */
	irq_desc_ptrs = kcalloc(nr_irqs, sizeof(void *), GFP_NOWAIT);

	/* allocate based on nr_cpu_ids */
	kstat_irqs_legacy = kzalloc_node(NR_IRQS_LEGACY * nr_cpu_ids *
					  sizeof(int), GFP_NOWAIT, node);

	for (i = 0; i < legacy_count; i++) {
		desc[i].irq = i;
		desc[i].kstat_irqs = kstat_irqs_legacy + i * nr_cpu_ids;
		lockdep_set_class(&desc[i].lock, &irq_desc_lock_class);
		alloc_desc_masks(&desc[i], node, true);
		init_desc_masks(&desc[i]);
		irq_desc_ptrs[i] = desc + i;
	}

	for (i = legacy_count; i < nr_irqs; i++)
		irq_desc_ptrs[i] = NULL;

	return arch_early_irq_init();
}
Beispiel #8
0
int __init early_irq_init(void)
{
	struct irq_desc *desc;
	int count;
	int i;

	init_irq_default_affinity();

	printk(KERN_INFO "NR_IRQS:%d\n", NR_IRQS);

	desc = irq_desc;
	count = ARRAY_SIZE(irq_desc);

	for (i = 0; i < count; i++) {
		desc[i].irq = i;
		init_alloc_desc_masks(&desc[i], 0, true);
		desc[i].kstat_irqs = kstat_irqs_all[i];
		#if defined(CONFIG_RTL_819X)
		memset(kstat_irqs_all, 0, NR_IRQS*NR_CPUS*sizeof(unsigned int));
		#endif
	}
	
	return arch_early_irq_init();
}
Beispiel #9
0
int __init early_irq_init(void)
{
	struct irq_desc *desc;
	int legacy_count;
	int i;

	init_irq_default_affinity();

	 /* initialize nr_irqs based on nr_cpu_ids */
	arch_probe_nr_irqs();
	printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d\n", NR_IRQS, nr_irqs);

	desc = irq_desc_legacy;
	legacy_count = ARRAY_SIZE(irq_desc_legacy);

	/* allocate irq_desc_ptrs array based on nr_irqs */
	irq_desc_ptrs = alloc_bootmem(nr_irqs * sizeof(void *));

	/* allocate based on nr_cpu_ids */
	/* FIXME: invert kstat_irgs, and it'd be a per_cpu_alloc'd thing */
	kstat_irqs_legacy = alloc_bootmem(NR_IRQS_LEGACY * nr_cpu_ids *
					  sizeof(int));

	for (i = 0; i < legacy_count; i++) {
		desc[i].irq = i;
		desc[i].kstat_irqs = kstat_irqs_legacy + i * nr_cpu_ids;
		lockdep_set_class(&desc[i].lock, &irq_desc_lock_class);
		init_alloc_desc_masks(&desc[i], 0, true);
		irq_desc_ptrs[i] = desc + i;
	}

	for (i = legacy_count; i < nr_irqs; i++)
		irq_desc_ptrs[i] = NULL;

	return arch_early_irq_init();
}
Beispiel #10
0
// ARM10C 20141004
int __init early_irq_init(void)
{
	// first_online_node: 0
	int i, initcnt, node = first_online_node;
	// node: 0
	struct irq_desc *desc;

	init_irq_default_affinity();
	// init_irq_default_affinity에서 한일:
	// irq_default_affinity->bits[0]: 0xF

	/* Let arch update nr_irqs and return the nr of preallocated irqs */
	// arch_probe_nr_irqs(): 16
	initcnt = arch_probe_nr_irqs();
	// initcnt: 16

	// NR_IRQS: 16, nr_irqs: 16, initcnt: 16
	printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d %d\n", NR_IRQS, nr_irqs, initcnt);
	// "NR_IRQS:16 nr_irqs:16 16"

	// nr_irqs: 16, IRQ_BITMAP_BITS: 8212
	if (WARN_ON(nr_irqs > IRQ_BITMAP_BITS))
		nr_irqs = IRQ_BITMAP_BITS;

	// initcnt: 16, IRQ_BITMAP_BITS: 8212
	if (WARN_ON(initcnt > IRQ_BITMAP_BITS))
		initcnt = IRQ_BITMAP_BITS;

	// initcnt: 16, nr_irqs: 16
	if (initcnt > nr_irqs)
		nr_irqs = initcnt;

	// initcnt: 16
	for (i = 0; i < initcnt; i++) {
		// i: 0, node: 0
		// alloc_desc(0, 0, NULL): kmem_cache#28-o0
		desc = alloc_desc(i, node, NULL);
		// desc: kmem_cache#28-o0

		// alloc_desc(0)에서 한일:
		// (kmem_cache#28-o0)->kstat_irqs: pcp 4 byte 공간
		// (kmem_cache#28-o0)->lock 을 이용한 spinlock 초기화 수행
		// (kmem_cache#28-o0)->irq_data.irq: 0
		// (kmem_cache#28-o0)->irq_data.chip: &no_irq_chip
		// (kmem_cache#28-o0)->irq_data.chip_data: NULL
		// (kmem_cache#28-o0)->irq_data.handler_data: NULL
		// (kmem_cache#28-o0)->irq_data.msi_desc: NULL
		// (kmem_cache#28-o0)->status_use_accessors: 0xc00
		// (&(kmem_cache#28-o0)->irq_data)->state_use_accessors: 0x10000
		// (kmem_cache#28-o0)->handle_irq: handle_bad_irq
		// (kmem_cache#28-o0)->depth: 1
		// (kmem_cache#28-o0)->irq_count: 0
		// (kmem_cache#28-o0)->irqs_unhandled: 0
		// (kmem_cache#28-o0)->name: NULL
		// (kmem_cache#28-o0)->owner: null
		// [pcp0...3] (kmem_cache#28-o0)->kstat_irqs: 0
		// (kmem_cache#28-o0)->irq_data.node: 0
		// (kmem_cache#28-o0)->irq_data.affinity.bits[0]: 0xF

		// i: 0
		set_bit(i, allocated_irqs);
		// allocated_irqs[0]: 0x1

		// i: 0, desc: kmem_cache#28-o0
		irq_insert_desc(i, desc);
		// radix tree에 kmem_cache#28-o0를 노드로 추가

		// irq_insert_desc(0)에서 한일:
		// ((&irq_desc_tree)->rnode) = (typeof(*kmem_cache#28-o0) __force rcu *)(kmem_cache#28-o0);
		//
		// irq_insert_desc(1)에서 한일:
		// radix_tree_node_cachep를 사용한 struct radix_tree_node 용 메모리 할당: kmem_cache#20-o0
		// (kmem_cache#20-o0)->height: 1
		// (kmem_cache#20-o0)->count: 1
		// (kmem_cache#20-o0)->parent: NULL
		// (kmem_cache#20-o0)->slots[0]: kmem_cache#28-o0 (irq 0)
		// (kmem_cache#20-o0)->slots[1]: kmem_cache#28-o1 (irq 1)
		// radix tree의 root node: &irq_desc_tree 값을 변경
		// (&irq_desc_tree)->rnode: kmem_cache#20-o0 (RADIX_LSB: 1)
		// (&irq_desc_tree)->height: 1
		//
		// irq_insert_desc(2)에서 한일:
		// (kmem_cache#20-o0)->count: 2
		// (kmem_cache#20-o0)->slots[2]: kmem_cache#28-o2 (irq 2)

		// i: 1 ... 15 수행
	}

	// arch_early_irq_init(): 0
	return arch_early_irq_init();
	// return 0
}