Commit e7032779 authored by Xu Yiwei's avatar Xu Yiwei Committed by guzitao
Browse files

sw64: irqchip: improve intx implementation

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IB73UR



--------------------------------

Improve INTx implementation by applying the following modifications:

- Replace number with macros in irq-sunway-pci-intx.c.
- Rename some ambiguous functions.

Signed-off-by: default avatarXu Yiwei <xuyiwei@wxiat.com>
Reviewed-by: default avatarHe Sheng <hesheng@wxiat.com>
Signed-off-by: default avatarGu Zitao <guzitao@wxiat.com>
parent 119581e5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ extern struct irqaction timer_irqaction;
extern void init_rtc_irq(irq_handler_t handler);
extern void handle_irq(int irq);
extern void handle_ipi(struct pt_regs *regs);
extern void __init sw64_init_irq(void);
extern void __init sunway_init_pci_intx(void);
extern irqreturn_t timer_interrupt(int irq, void *dev);

#endif /* _ASM_SW64_IRQ_IMPL_H */
+1 −1
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ struct pci_controller {
extern void __init sw64_init_pci(void);
extern void __init sw64_device_interrupt(unsigned long vector);
extern void setup_intx_irqs(struct pci_controller *hose);
extern void __init sw64_init_irq(void);
extern void __init sunway_init_pci_intx(void);
extern void __init sw64_init_arch(void);
extern int sw64_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
extern struct pci_controller *hose_head;
+1 −1
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ void __init init_IRQ(void)
		set_nmi(INT_PC);
	}

	sw64_init_irq();
	sunway_init_pci_intx();
	irqchip_init();
}

+1 −1
Original line number Diff line number Diff line
@@ -135,4 +135,4 @@ void __init common_init_pci(void)
}

void __init sw64_init_arch(void) { }
void __init sw64_init_irq(void) { }
void __init sunway_init_pci_intx(void) { }
+4 −4
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@

struct fwnode_handle *cintc_handle;

static void handle_device_interrupt(unsigned long irq_info)
static void handle_pci_intx_interrupt(unsigned long irq_info)
{
	unsigned int i;

@@ -48,7 +48,7 @@ static void handle_device_interrupt(unsigned long irq_info)
		return;
	}

	for (i = 0; i < 4; i++) {
	for (i = 0; i < PCI_NUM_INTX; i++) {
		if ((irq_info >> i) & 0x1)
			handle_intx(i);
	}
@@ -99,7 +99,7 @@ asmlinkage void do_entInt(unsigned long type, unsigned long vector,
		}

		if (pme_state == PME_PENDING) {
			handle_device_interrupt(vector);
			handle_pci_intx_interrupt(vector);
			pme_state = PME_CLEAR;
		}
	}
@@ -123,7 +123,7 @@ asmlinkage void do_entInt(unsigned long type, unsigned long vector,
			handle_pci_msi_interrupt(type, vector, irq_arg);
		goto out;
	case INT_INTx:
		handle_device_interrupt(vector);
		handle_pci_intx_interrupt(vector);
		goto out;

	case INT_IPI:
Loading