ia64/xen-unstable

changeset 13476:730e24a1594a

[IA64] Set IRQ_PER_CPU status on percpu IRQs

This is necessary to prevent percpu IRQs from being triggered
when CPUs are offlined. Also remove some extraneous printks and
rename variables.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author awilliam@xenbuild2.aw
date Thu Jan 25 14:40:45 2007 -0700 (2007-01-25)
parents b4df7de0cbf7
children 6745b7274eff
files linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c	Wed Jan 24 12:28:05 2007 -0700
     1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c	Thu Jan 25 14:40:45 2007 -0700
     1.3 @@ -303,81 +303,85 @@ static struct irqaction resched_irqactio
     1.4   * required.
     1.5   */
     1.6  static void
     1.7 -xen_register_percpu_irq (unsigned int irq, struct irqaction *action, int save)
     1.8 +xen_register_percpu_irq (unsigned int vec, struct irqaction *action, int save)
     1.9  {
    1.10  	unsigned int cpu = smp_processor_id();
    1.11 -	int ret = 0;
    1.12 +	irq_desc_t *desc;
    1.13 +	int irq = 0;
    1.14  
    1.15  	if (xen_slab_ready) {
    1.16 -		switch (irq) {
    1.17 +		switch (vec) {
    1.18  		case IA64_TIMER_VECTOR:
    1.19  			sprintf(timer_name[cpu], "%s%d", action->name, cpu);
    1.20 -			ret = bind_virq_to_irqhandler(VIRQ_ITC, cpu,
    1.21 +			irq = bind_virq_to_irqhandler(VIRQ_ITC, cpu,
    1.22  				action->handler, action->flags,
    1.23  				timer_name[cpu], action->dev_id);
    1.24 -			per_cpu(timer_irq,cpu) = ret;
    1.25 -			printk(KERN_INFO "register VIRQ_ITC (%s) to xen irq (%d)\n", timer_name[cpu], ret);
    1.26 +			per_cpu(timer_irq,cpu) = irq;
    1.27  			break;
    1.28  		case IA64_IPI_RESCHEDULE:
    1.29  			sprintf(resched_name[cpu], "%s%d", action->name, cpu);
    1.30 -			ret = bind_ipi_to_irqhandler(RESCHEDULE_VECTOR, cpu,
    1.31 +			irq = bind_ipi_to_irqhandler(RESCHEDULE_VECTOR, cpu,
    1.32  				action->handler, action->flags,
    1.33  				resched_name[cpu], action->dev_id);
    1.34 -			per_cpu(resched_irq,cpu) = ret;
    1.35 -			printk(KERN_INFO "register RESCHEDULE_VECTOR (%s) to xen irq (%d)\n", resched_name[cpu], ret);
    1.36 +			per_cpu(resched_irq,cpu) = irq;
    1.37  			break;
    1.38  		case IA64_IPI_VECTOR:
    1.39  			sprintf(ipi_name[cpu], "%s%d", action->name, cpu);
    1.40 -			ret = bind_ipi_to_irqhandler(IPI_VECTOR, cpu,
    1.41 +			irq = bind_ipi_to_irqhandler(IPI_VECTOR, cpu,
    1.42  				action->handler, action->flags,
    1.43  				ipi_name[cpu], action->dev_id);
    1.44 -			per_cpu(ipi_irq,cpu) = ret;
    1.45 -			printk(KERN_INFO "register IPI_VECTOR (%s) to xen irq (%d)\n", ipi_name[cpu], ret);
    1.46 -			break;
    1.47 -		case IA64_SPURIOUS_INT_VECTOR:
    1.48 +			per_cpu(ipi_irq,cpu) = irq;
    1.49  			break;
    1.50  		case IA64_CMC_VECTOR:
    1.51  			sprintf(cmc_name[cpu], "%s%d", action->name, cpu);
    1.52 -			ret = bind_virq_to_irqhandler(VIRQ_MCA_CMC, cpu,
    1.53 +			irq = bind_virq_to_irqhandler(VIRQ_MCA_CMC, cpu,
    1.54  			                              action->handler,
    1.55  			                              action->flags,
    1.56  			                              cmc_name[cpu],
    1.57  			                              action->dev_id);
    1.58 -			per_cpu(cmc_irq,cpu) = ret;
    1.59 -			printk(KERN_INFO "register VIRQ_MCA_CMC (%s) to xen "
    1.60 -			       "irq (%d)\n", cmc_name[cpu], ret);
    1.61 +			per_cpu(cmc_irq,cpu) = irq;
    1.62  			break;
    1.63  		case IA64_CMCP_VECTOR:
    1.64  			sprintf(cmcp_name[cpu], "%s%d", action->name, cpu);
    1.65 -			ret = bind_ipi_to_irqhandler(CMCP_VECTOR, cpu,
    1.66 +			irq = bind_ipi_to_irqhandler(CMCP_VECTOR, cpu,
    1.67  			                             action->handler,
    1.68  			                             action->flags,
    1.69  			                             cmcp_name[cpu],
    1.70  			                             action->dev_id);
    1.71 -			per_cpu(cmcp_irq,cpu) = ret;
    1.72 -			printk(KERN_INFO "register CMCP_VECTOR (%s) to xen "
    1.73 -			       "irq (%d)\n", cmcp_name[cpu], ret);
    1.74 +			per_cpu(cmcp_irq,cpu) = irq;
    1.75  			break;
    1.76  		case IA64_CPEP_VECTOR:
    1.77  			sprintf(cpep_name[cpu], "%s%d", action->name, cpu);
    1.78 -			ret = bind_ipi_to_irqhandler(CPEP_VECTOR, cpu,
    1.79 +			irq = bind_ipi_to_irqhandler(CPEP_VECTOR, cpu,
    1.80  			                             action->handler,
    1.81  			                             action->flags,
    1.82  			                             cpep_name[cpu],
    1.83  			                             action->dev_id);
    1.84 -			per_cpu(cpep_irq,cpu) = ret;
    1.85 -			printk(KERN_INFO "register CPEP_VECTOR (%s) to xen "
    1.86 -			       "irq (%d)\n", cpep_name[cpu], ret);
    1.87 +			per_cpu(cpep_irq,cpu) = irq;
    1.88  			break;
    1.89  		case IA64_CPE_VECTOR:
    1.90 -			printk(KERN_WARNING "register IA64_CPE_VECTOR "
    1.91 -			       "IGNORED\n");
    1.92 +		case IA64_MCA_RENDEZ_VECTOR:
    1.93 +		case IA64_PERFMON_VECTOR:
    1.94 +		case IA64_MCA_WAKEUP_VECTOR:
    1.95 +		case IA64_SPURIOUS_INT_VECTOR:
    1.96 +			/* No need to complain, these aren't supported. */
    1.97  			break;
    1.98  		default:
    1.99 -			printk(KERN_WARNING "Percpu irq %d is unsupported by xen!\n", irq);
   1.100 +			printk(KERN_WARNING "Percpu irq %d is unsupported "
   1.101 +			       "by xen!\n", vec);
   1.102  			break;
   1.103  		}
   1.104 -		BUG_ON(ret < 0);
   1.105 +		BUG_ON(irq < 0);
   1.106 +
   1.107 +		if (irq > 0) {
   1.108 +			/*
   1.109 +			 * Mark percpu.  Without this, migrate_irqs() will
   1.110 +			 * mark the interrupt for migrations and trigger it
   1.111 +			 * on cpu hotplug.
   1.112 +			 */
   1.113 +			desc = irq_descp(irq);
   1.114 +			desc->status |= IRQ_PER_CPU;
   1.115 +		}
   1.116  	} 
   1.117  
   1.118  	/* For BSP, we cache registered percpu irqs, and then re-walk
   1.119 @@ -385,7 +389,7 @@ xen_register_percpu_irq (unsigned int ir
   1.120  	 */
   1.121  	if (!cpu && save) {
   1.122  		BUG_ON(saved_irq_cnt == MAX_LATE_IRQ);
   1.123 -		saved_percpu_irqs[saved_irq_cnt].irq = irq;
   1.124 +		saved_percpu_irqs[saved_irq_cnt].irq = vec;
   1.125  		saved_percpu_irqs[saved_irq_cnt].action = action;
   1.126  		saved_irq_cnt++;
   1.127  		if (!xen_slab_ready)
   1.128 @@ -572,7 +576,8 @@ ia64_send_ipi (int cpu, int vector, int 
   1.129  			irq = per_cpu(ipi_to_irq, cpu)[CPEP_VECTOR];
   1.130  			break;
   1.131  		default:
   1.132 -			printk(KERN_WARNING"Unsupported IPI type 0x%x\n", vector);
   1.133 +			printk(KERN_WARNING "Unsupported IPI type 0x%x\n",
   1.134 +			       vector);
   1.135  			irq = 0;
   1.136  			break;
   1.137  		}