From c442ef96bfe1a981d44dd09d49a1eed93b94e82a Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Tue, 28 Sep 2010 12:19:24 -0400 Subject: parisc: squelch warning when using dev_get_stats And switch to struct rtnl_link_stats64... Signed-off-by: Kyle McMartin --- drivers/parisc/led.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/parisc') diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c index c5c14dd..2350e8a 100644 --- a/drivers/parisc/led.c +++ b/drivers/parisc/led.c @@ -346,8 +346,8 @@ static __inline__ int led_get_net_activity(void) #ifndef CONFIG_NET return 0; #else - static unsigned long rx_total_last, tx_total_last; - unsigned long rx_total, tx_total; + static u64 rx_total_last, tx_total_last; + u64 rx_total, tx_total; struct net_device *dev; int retval; @@ -356,7 +356,7 @@ static __inline__ int led_get_net_activity(void) /* we are running as a workqueue task, so we can use an RCU lookup */ rcu_read_lock(); for_each_netdev_rcu(&init_net, dev) { - const struct net_device_stats *stats; + const struct rtnl_link_stats64 *stats; struct rtnl_link_stats64 temp; struct in_device *in_dev = __in_dev_get_rcu(dev); if (!in_dev || !in_dev->ifa_list) -- cgit v1.1 From ba20085c20f1c9e8af546dea6ad0efa421bdef32 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Wed, 13 Oct 2010 21:00:55 -0400 Subject: parisc: lay groundwork for killing __do_IRQ Use proper accessors and handlers for generic irq cleanups. We just call back into __do_IRQ through desc->handler now, and remove the explicit calls. Signed-off-by: Kyle McMartin --- drivers/parisc/dino.c | 8 +++----- drivers/parisc/eisa.c | 8 ++++---- drivers/parisc/gsc.c | 15 ++++++--------- drivers/parisc/iosapic.c | 15 ++++----------- drivers/parisc/superio.c | 6 ++---- 5 files changed, 19 insertions(+), 33 deletions(-) (limited to 'drivers/parisc') diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c index c542c7b..3013c57 100644 --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c @@ -298,8 +298,7 @@ static struct pci_port_ops dino_port_ops = { static void dino_disable_irq(unsigned int irq) { - struct irq_desc *desc = irq_to_desc(irq); - struct dino_device *dino_dev = desc->chip_data; + struct dino_device *dino_dev = get_irq_chip_data(irq); int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS); DBG(KERN_WARNING "%s(0x%p, %d)\n", __func__, dino_dev, irq); @@ -311,8 +310,7 @@ static void dino_disable_irq(unsigned int irq) static void dino_enable_irq(unsigned int irq) { - struct irq_desc *desc = irq_to_desc(irq); - struct dino_device *dino_dev = desc->chip_data; + struct dino_device *dino_dev = get_irq_chip_data(irq); int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS); u32 tmp; @@ -391,7 +389,7 @@ ilr_again: int irq = dino_dev->global_irq[local_irq]; DBG(KERN_DEBUG "%s(%d, %p) mask 0x%x\n", __func__, irq, intr_dev, mask); - __do_IRQ(irq); + generic_handle_irq(irq); mask &= ~(1 << local_irq); } while (mask); diff --git a/drivers/parisc/eisa.c b/drivers/parisc/eisa.c index 46f503f..5854177 100644 --- a/drivers/parisc/eisa.c +++ b/drivers/parisc/eisa.c @@ -233,7 +233,7 @@ static irqreturn_t eisa_irq(int wax_irq, void *intr_dev) } spin_unlock_irqrestore(&eisa_irq_lock, flags); - __do_IRQ(irq); + generic_handle_irq(irq); spin_lock_irqsave(&eisa_irq_lock, flags); /* unmask */ @@ -346,10 +346,10 @@ static int __init eisa_probe(struct parisc_device *dev) } /* Reserve IRQ2 */ - irq_to_desc(2)->action = &irq2_action; - + setup_irq(2, &irq2_action); for (i = 0; i < 16; i++) { - irq_to_desc(i)->chip = &eisa_interrupt_type; + set_irq_chip_and_handler(i, &eisa_interrupt_type, + parisc_do_IRQ); } EISA_bus = 1; diff --git a/drivers/parisc/gsc.c b/drivers/parisc/gsc.c index 20a1bce..68bccda 100644 --- a/drivers/parisc/gsc.c +++ b/drivers/parisc/gsc.c @@ -86,7 +86,7 @@ irqreturn_t gsc_asic_intr(int gsc_asic_irq, void *dev) do { int local_irq = __ffs(irr); unsigned int irq = gsc_asic->global_irq[local_irq]; - __do_IRQ(irq); + generic_handle_irq(irq); irr &= ~(1 << local_irq); } while (irr); @@ -107,8 +107,7 @@ int gsc_find_local_irq(unsigned int irq, int *global_irqs, int limit) static void gsc_asic_disable_irq(unsigned int irq) { - struct irq_desc *desc = irq_to_desc(irq); - struct gsc_asic *irq_dev = desc->chip_data; + struct gsc_asic *irq_dev = get_irq_chip_data(irq); int local_irq = gsc_find_local_irq(irq, irq_dev->global_irq, 32); u32 imr; @@ -123,8 +122,7 @@ static void gsc_asic_disable_irq(unsigned int irq) static void gsc_asic_enable_irq(unsigned int irq) { - struct irq_desc *desc = irq_to_desc(irq); - struct gsc_asic *irq_dev = desc->chip_data; + struct gsc_asic *irq_dev = get_irq_chip_data(irq); int local_irq = gsc_find_local_irq(irq, irq_dev->global_irq, 32); u32 imr; @@ -160,14 +158,13 @@ static struct irq_chip gsc_asic_interrupt_type = { int gsc_assign_irq(struct irq_chip *type, void *data) { static int irq = GSC_IRQ_BASE; - struct irq_desc *desc; if (irq > GSC_IRQ_MAX) return NO_IRQ; - desc = irq_to_desc(irq); - desc->chip = type; - desc->chip_data = data; + set_irq_chip_and_handler(irq, type, parisc_do_IRQ); + set_irq_chip_data(irq, data); + return irq++; } diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c index c768367..10348c9 100644 --- a/drivers/parisc/iosapic.c +++ b/drivers/parisc/iosapic.c @@ -615,17 +615,10 @@ iosapic_set_irt_data( struct vector_info *vi, u32 *dp0, u32 *dp1) } -static struct vector_info *iosapic_get_vector(unsigned int irq) -{ - struct irq_desc *desc = irq_to_desc(irq); - - return desc->chip_data; -} - static void iosapic_disable_irq(unsigned int irq) { unsigned long flags; - struct vector_info *vi = iosapic_get_vector(irq); + struct vector_info *vi = get_irq_chip_data(irq); u32 d0, d1; spin_lock_irqsave(&iosapic_lock, flags); @@ -637,7 +630,7 @@ static void iosapic_disable_irq(unsigned int irq) static void iosapic_enable_irq(unsigned int irq) { - struct vector_info *vi = iosapic_get_vector(irq); + struct vector_info *vi = get_irq_chip_data(irq); u32 d0, d1; /* data is initialized by fixup_irq */ @@ -688,7 +681,7 @@ printk("\n"); */ static void iosapic_end_irq(unsigned int irq) { - struct vector_info *vi = iosapic_get_vector(irq); + struct vector_info *vi = get_irq_chip_data(irq); DBG(KERN_DEBUG "end_irq(%d): eoi(%p, 0x%x)\n", irq, vi->eoi_addr, vi->eoi_data); iosapic_eoi(vi->eoi_addr, vi->eoi_data); @@ -705,7 +698,7 @@ static unsigned int iosapic_startup_irq(unsigned int irq) static int iosapic_set_affinity_irq(unsigned int irq, const struct cpumask *dest) { - struct vector_info *vi = iosapic_get_vector(irq); + struct vector_info *vi = get_irq_chip_data(irq); u32 d0, d1, dummy_d0; unsigned long flags; int dest_cpu; diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c index f7806d8..aceec6e 100644 --- a/drivers/parisc/superio.c +++ b/drivers/parisc/superio.c @@ -139,7 +139,7 @@ superio_interrupt(int parent_irq, void *devp) } /* Call the appropriate device's interrupt */ - __do_IRQ(local_irq); + generic_handle_irq(local_irq); /* set EOI - forces a new interrupt if a lower priority device * still needs service. @@ -363,9 +363,7 @@ int superio_fixup_irq(struct pci_dev *pcidev) #endif for (i = 0; i < 16; i++) { - struct irq_desc *desc = irq_to_desc(i); - - desc->chip = &superio_interrupt_type; + set_irq_chip_and_handler(i, &superio_interrupt_type, parisc_do_IRQ); } /* -- cgit v1.1 From 4d4f681dc43a06167763ec698f5de4f2b3119ad6 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Thu, 14 Oct 2010 00:12:23 -0400 Subject: parisc: convert cpu interrupts to proper flow handlers Only major change is renaming functions to match the conventions expected by the generic irq code. Signed-off-by: Kyle McMartin --- drivers/parisc/iosapic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/parisc') diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c index 10348c9..1302088 100644 --- a/drivers/parisc/iosapic.c +++ b/drivers/parisc/iosapic.c @@ -685,7 +685,7 @@ static void iosapic_end_irq(unsigned int irq) DBG(KERN_DEBUG "end_irq(%d): eoi(%p, 0x%x)\n", irq, vi->eoi_addr, vi->eoi_data); iosapic_eoi(vi->eoi_addr, vi->eoi_data); - cpu_end_irq(irq); + cpu_eoi_irq(irq); } static unsigned int iosapic_startup_irq(unsigned int irq) -- cgit v1.1 From f3d4605977f9f30993c670a85f75d8f3853144c5 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Thu, 14 Oct 2010 00:38:27 -0400 Subject: parisc: convert iosapic interrupts to proper flow handlers Shift the ->end call (cpu eoi) from __do_IRQ into our unmask handler. Also nuke some redundant code. Signed-off-by: Kyle McMartin --- drivers/parisc/iosapic.c | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) (limited to 'drivers/parisc') diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c index 1302088..edab294 100644 --- a/drivers/parisc/iosapic.c +++ b/drivers/parisc/iosapic.c @@ -615,7 +615,7 @@ iosapic_set_irt_data( struct vector_info *vi, u32 *dp0, u32 *dp1) } -static void iosapic_disable_irq(unsigned int irq) +static void iosapic_mask_irq(unsigned int irq) { unsigned long flags; struct vector_info *vi = get_irq_chip_data(irq); @@ -628,7 +628,7 @@ static void iosapic_disable_irq(unsigned int irq) spin_unlock_irqrestore(&iosapic_lock, flags); } -static void iosapic_enable_irq(unsigned int irq) +static void iosapic_unmask_irq(unsigned int irq) { struct vector_info *vi = get_irq_chip_data(irq); u32 d0, d1; @@ -669,31 +669,9 @@ printk("\n"); DBG(KERN_DEBUG "enable_irq(%d): eoi(%p, 0x%x)\n", irq, vi->eoi_addr, vi->eoi_data); iosapic_eoi(vi->eoi_addr, vi->eoi_data); -} - -/* - * PARISC only supports PCI devices below I/O SAPIC. - * PCI only supports level triggered in order to share IRQ lines. - * ergo I/O SAPIC must always issue EOI on parisc. - * - * i386/ia64 support ISA devices and have to deal with - * edge-triggered interrupts too. - */ -static void iosapic_end_irq(unsigned int irq) -{ - struct vector_info *vi = get_irq_chip_data(irq); - DBG(KERN_DEBUG "end_irq(%d): eoi(%p, 0x%x)\n", irq, - vi->eoi_addr, vi->eoi_data); - iosapic_eoi(vi->eoi_addr, vi->eoi_data); cpu_eoi_irq(irq); } -static unsigned int iosapic_startup_irq(unsigned int irq) -{ - iosapic_enable_irq(irq); - return 0; -} - #ifdef CONFIG_SMP static int iosapic_set_affinity_irq(unsigned int irq, const struct cpumask *dest) @@ -723,13 +701,10 @@ static int iosapic_set_affinity_irq(unsigned int irq, #endif static struct irq_chip iosapic_interrupt_type = { - .name = "IO-SAPIC-level", - .startup = iosapic_startup_irq, - .shutdown = iosapic_disable_irq, - .enable = iosapic_enable_irq, - .disable = iosapic_disable_irq, - .ack = cpu_ack_irq, - .end = iosapic_end_irq, + .name = "IO-SAPIC-level", + .unmask = iosapic_unmask_irq, + .mask = iosapic_mask_irq, + .ack = cpu_ack_irq, #ifdef CONFIG_SMP .set_affinity = iosapic_set_affinity_irq, #endif -- cgit v1.1 From 14ff626a64f1c6848b303254be00b1b2ff33a655 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Thu, 14 Oct 2010 00:53:17 -0400 Subject: parisc: convert suckyio interrupts to flow handlers No big deal, just need to convert the suckyio interrupts to be a nested handler instead of request_irq the suckyio device in the future. Signed-off-by: Kyle McMartin --- drivers/parisc/superio.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'drivers/parisc') diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c index aceec6e..0846daf 100644 --- a/drivers/parisc/superio.c +++ b/drivers/parisc/superio.c @@ -286,7 +286,7 @@ superio_init(struct pci_dev *pcidev) } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87560_LIO, superio_init); -static void superio_disable_irq(unsigned int irq) +static void superio_mask_irq(unsigned int irq) { u8 r8; @@ -303,7 +303,7 @@ static void superio_disable_irq(unsigned int irq) outb (r8,IC_PIC1+1); } -static void superio_enable_irq(unsigned int irq) +static void superio_unmask_irq(unsigned int irq) { u8 r8; @@ -319,20 +319,11 @@ static void superio_enable_irq(unsigned int irq) outb (r8,IC_PIC1+1); } -static unsigned int superio_startup_irq(unsigned int irq) -{ - superio_enable_irq(irq); - return 0; -} - static struct irq_chip superio_interrupt_type = { - .name = SUPERIO, - .startup = superio_startup_irq, - .shutdown = superio_disable_irq, - .enable = superio_enable_irq, - .disable = superio_disable_irq, + .name = SUPERIO, + .unmask = superio_unmask_irq, + .mask = superio_mask_irq, .ack = no_ack_irq, - .end = no_end_irq, }; #ifdef DEBUG_SUPERIO_INIT @@ -363,7 +354,7 @@ int superio_fixup_irq(struct pci_dev *pcidev) #endif for (i = 0; i < 16; i++) { - set_irq_chip_and_handler(i, &superio_interrupt_type, parisc_do_IRQ); + set_irq_chip_and_handler(i, &superio_interrupt_type, handle_level_irq); } /* -- cgit v1.1 From 7998b3bd156478c35de685f90d4d0dda57916c60 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Thu, 14 Oct 2010 00:58:53 -0400 Subject: parisc: convert gsc and dino pci interrupts to flow handlers Signed-off-by: Kyle McMartin --- drivers/parisc/dino.c | 21 ++++++--------------- drivers/parisc/gsc.c | 23 +++++++---------------- 2 files changed, 13 insertions(+), 31 deletions(-) (limited to 'drivers/parisc') diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c index 3013c57..d9f5148 100644 --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c @@ -296,7 +296,7 @@ static struct pci_port_ops dino_port_ops = { .outl = dino_out32 }; -static void dino_disable_irq(unsigned int irq) +static void dino_mask_irq(unsigned int irq) { struct dino_device *dino_dev = get_irq_chip_data(irq); int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS); @@ -308,7 +308,7 @@ static void dino_disable_irq(unsigned int irq) __raw_writel(dino_dev->imr, dino_dev->hba.base_addr+DINO_IMR); } -static void dino_enable_irq(unsigned int irq) +static void dino_unmask_irq(unsigned int irq) { struct dino_device *dino_dev = get_irq_chip_data(irq); int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS); @@ -345,20 +345,11 @@ static void dino_enable_irq(unsigned int irq) } } -static unsigned int dino_startup_irq(unsigned int irq) -{ - dino_enable_irq(irq); - return 0; -} - static struct irq_chip dino_interrupt_type = { - .name = "GSC-PCI", - .startup = dino_startup_irq, - .shutdown = dino_disable_irq, - .enable = dino_enable_irq, - .disable = dino_disable_irq, - .ack = no_ack_irq, - .end = no_end_irq, + .name = "GSC-PCI", + .unmask = dino_unmask_irq, + .mask = dino_mask_irq, + .ack = no_ack_irq, }; diff --git a/drivers/parisc/gsc.c b/drivers/parisc/gsc.c index 68bccda..e605298 100644 --- a/drivers/parisc/gsc.c +++ b/drivers/parisc/gsc.c @@ -105,7 +105,7 @@ int gsc_find_local_irq(unsigned int irq, int *global_irqs, int limit) return NO_IRQ; } -static void gsc_asic_disable_irq(unsigned int irq) +static void gsc_asic_mask_irq(unsigned int irq) { struct gsc_asic *irq_dev = get_irq_chip_data(irq); int local_irq = gsc_find_local_irq(irq, irq_dev->global_irq, 32); @@ -120,7 +120,7 @@ static void gsc_asic_disable_irq(unsigned int irq) gsc_writel(imr, irq_dev->hpa + OFFSET_IMR); } -static void gsc_asic_enable_irq(unsigned int irq) +static void gsc_asic_unmask_irq(unsigned int irq) { struct gsc_asic *irq_dev = get_irq_chip_data(irq); int local_irq = gsc_find_local_irq(irq, irq_dev->global_irq, 32); @@ -139,20 +139,11 @@ static void gsc_asic_enable_irq(unsigned int irq) */ } -static unsigned int gsc_asic_startup_irq(unsigned int irq) -{ - gsc_asic_enable_irq(irq); - return 0; -} - static struct irq_chip gsc_asic_interrupt_type = { - .name = "GSC-ASIC", - .startup = gsc_asic_startup_irq, - .shutdown = gsc_asic_disable_irq, - .enable = gsc_asic_enable_irq, - .disable = gsc_asic_disable_irq, - .ack = no_ack_irq, - .end = no_end_irq, + .name = "GSC-ASIC", + .unmask = gsc_asic_unmask_irq, + .mask = gsc_asic_mask_irq, + .ack = no_ack_irq, }; int gsc_assign_irq(struct irq_chip *type, void *data) @@ -162,7 +153,7 @@ int gsc_assign_irq(struct irq_chip *type, void *data) if (irq > GSC_IRQ_MAX) return NO_IRQ; - set_irq_chip_and_handler(irq, type, parisc_do_IRQ); + set_irq_chip_and_handler(irq, type, handle_level_irq); set_irq_chip_data(irq, data); return irq++; -- cgit v1.1 From 8ed5c00d7c166f505eb2e8ff47748bfa73824130 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Thu, 14 Oct 2010 01:00:51 -0400 Subject: parisc: convert eisa interrupts to flow handlers Signed-off-by: Kyle McMartin --- drivers/parisc/eisa.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'drivers/parisc') diff --git a/drivers/parisc/eisa.c b/drivers/parisc/eisa.c index 5854177..1211974 100644 --- a/drivers/parisc/eisa.c +++ b/drivers/parisc/eisa.c @@ -144,7 +144,7 @@ static unsigned int eisa_irq_level __read_mostly; /* default to edge triggered * /* called by free irq */ -static void eisa_disable_irq(unsigned int irq) +static void eisa_mask_irq(unsigned int irq) { unsigned long flags; @@ -164,7 +164,7 @@ static void eisa_disable_irq(unsigned int irq) } /* called by request irq */ -static void eisa_enable_irq(unsigned int irq) +static void eisa_unmask_irq(unsigned int irq) { unsigned long flags; EISA_DBG("enable irq %d\n", irq); @@ -182,20 +182,11 @@ static void eisa_enable_irq(unsigned int irq) EISA_DBG("pic1 mask %02x\n", eisa_in8(0xa1)); } -static unsigned int eisa_startup_irq(unsigned int irq) -{ - eisa_enable_irq(irq); - return 0; -} - static struct irq_chip eisa_interrupt_type = { - .name = "EISA", - .startup = eisa_startup_irq, - .shutdown = eisa_disable_irq, - .enable = eisa_enable_irq, - .disable = eisa_disable_irq, - .ack = no_ack_irq, - .end = no_end_irq, + .name = "EISA", + .unmask = eisa_unmask_irq, + .mask = eisa_mask_irq, + .ack = no_ack_irq, }; static irqreturn_t eisa_irq(int wax_irq, void *intr_dev) @@ -349,7 +340,7 @@ static int __init eisa_probe(struct parisc_device *dev) setup_irq(2, &irq2_action); for (i = 0; i < 16; i++) { set_irq_chip_and_handler(i, &eisa_interrupt_type, - parisc_do_IRQ); + handle_level_irq); } EISA_bus = 1; -- cgit v1.1 From f8301041d7bdca3197d718518242eeba0c75352f Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Mon, 31 May 2010 20:23:16 -0700 Subject: drivers/parisc/iosapic.c: Remove unnecessary kzalloc cast Convert kzalloc to kcalloc Signed-off-by: Joe Perches Reviewed-by: Grant Grundler Signed-off-by: Kyle McMartin --- drivers/parisc/iosapic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/parisc') diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c index edab294..a3120a0 100644 --- a/drivers/parisc/iosapic.c +++ b/drivers/parisc/iosapic.c @@ -859,8 +859,8 @@ void *iosapic_register(unsigned long hpa) isi->isi_version = iosapic_rd_version(isi); isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1; - vip = isi->isi_vector = (struct vector_info *) - kzalloc(sizeof(struct vector_info) * isi->isi_num_vectors, GFP_KERNEL); + vip = isi->isi_vector = kcalloc(isi->isi_num_vectors, + sizeof(struct vector_info), GFP_KERNEL); if (vip == NULL) { kfree(isi); return NULL; -- cgit v1.1