From d1b8844533172cd7d8bf962f2c05064e085a4533 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 9 Jan 2006 20:09:36 +0000 Subject: [PATCH] --- yaml --- r: 19882 b: refs/heads/master c: 4f0638ba9e3825d21d41e98d04faa6b74a05c624 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Makefile | 2 +- trunk/arch/cris/Makefile | 2 +- trunk/arch/i386/kernel/apic.c | 2 +- trunk/arch/ia64/Kconfig | 4 +- trunk/arch/ia64/kernel/sal.c | 75 ------- trunk/arch/ia64/sn/Makefile | 2 + trunk/arch/ia64/sn/kernel/Makefile | 2 - trunk/arch/ia64/sn/kernel/bte.c | 17 +- trunk/arch/ia64/sn/kernel/io_init.c | 9 +- trunk/arch/ia64/sn/kernel/irq.c | 21 +- trunk/arch/ia64/sn/kernel/klconflib.c | 29 +-- trunk/arch/ia64/sn/kernel/setup.c | 19 +- trunk/arch/ia64/sn/kernel/sn2/Makefile | 2 - trunk/arch/ia64/sn/kernel/sn2/sn2_smp.c | 196 +++++++++++------- trunk/arch/ia64/sn/kernel/xpc_main.c | 19 +- trunk/arch/ia64/sn/pci/Makefile | 2 - trunk/arch/ia64/sn/pci/pcibr/Makefile | 2 - trunk/arch/mips/kernel/genex.S | 2 +- trunk/drivers/Makefile | 2 +- trunk/drivers/net/8139too.c | 38 ++-- trunk/drivers/net/Kconfig | 7 +- trunk/drivers/net/bonding/bond_main.c | 15 +- trunk/drivers/net/bonding/bond_sysfs.c | 6 +- trunk/drivers/net/e100.c | 2 + trunk/drivers/net/gianfar.c | 24 ++- trunk/drivers/net/gianfar.h | 8 +- trunk/drivers/net/gianfar_ethtool.c | 8 +- trunk/drivers/net/gianfar_mii.c | 17 +- trunk/drivers/net/r8169.c | 13 +- trunk/drivers/net/sis900.h | 1 + trunk/drivers/net/sky2.c | 186 ++++------------- trunk/drivers/net/sky2.h | 9 +- trunk/drivers/net/tulip/uli526x.c | 2 +- trunk/drivers/net/wan/dscc4.c | 2 +- trunk/include/asm-ia64/processor.h | 17 -- trunk/include/asm-ia64/sal.h | 10 +- trunk/include/asm-ia64/sn/bte.h | 23 +- trunk/include/asm-ia64/sn/intr.h | 38 ++-- trunk/include/asm-ia64/system.h | 25 +++ trunk/scripts/kconfig/lxdialog/Makefile | 7 +- .../kconfig/lxdialog/check-lxdialog.sh | 14 +- 42 files changed, 364 insertions(+), 519 deletions(-) diff --git a/[refs] b/[refs] index 7ed1b30170a6..7bf95d4523df 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e1a8e6c9b757c09249ab29fc6da12d9ab64567e1 +refs/heads/master: 4f0638ba9e3825d21d41e98d04faa6b74a05c624 diff --git a/trunk/Makefile b/trunk/Makefile index a1158d1c051e..cd5b619db9d8 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -442,7 +442,7 @@ export KBUILD_DEFCONFIG config %config: scripts_basic outputmakefile FORCE $(Q)mkdir -p include/linux $(Q)$(MAKE) $(build)=scripts/kconfig $@ - $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease + $(Q)$(MAKE) .kernelrelease else # =========================================================================== diff --git a/trunk/arch/cris/Makefile b/trunk/arch/cris/Makefile index ee114699ef8e..ea65d585cf5e 100644 --- a/trunk/arch/cris/Makefile +++ b/trunk/arch/cris/Makefile @@ -119,7 +119,7 @@ $(SRC_ARCH)/.links: @ln -sfn $(SRC_ARCH)/$(SARCH)/lib $(SRC_ARCH)/lib @ln -sfn $(SRC_ARCH)/$(SARCH) $(SRC_ARCH)/arch @ln -sfn $(SRC_ARCH)/$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S - @ln -sfn $(SRC_ARCH)/$(SARCH)/kernel/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c + @ln -sfn $(SRC_ARCH)/$(SARCH)/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c @touch $@ # Create link to sub arch includes diff --git a/trunk/arch/i386/kernel/apic.c b/trunk/arch/i386/kernel/apic.c index f39e09ef64ec..98a5c23cf3df 100644 --- a/trunk/arch/i386/kernel/apic.c +++ b/trunk/arch/i386/kernel/apic.c @@ -77,7 +77,7 @@ void ack_bad_irq(unsigned int irq) * completely. * But only ack when the APIC is enabled -AK */ - if (cpu_has_apic) + if (!cpu_has_apic) ack_APIC_irq(); } diff --git a/trunk/arch/ia64/Kconfig b/trunk/arch/ia64/Kconfig index 845cd0902a50..199eeaf0f4e3 100644 --- a/trunk/arch/ia64/Kconfig +++ b/trunk/arch/ia64/Kconfig @@ -194,6 +194,7 @@ config IA64_L1_CACHE_SHIFT default "7" if MCKINLEY default "6" if ITANIUM +# align cache-sensitive data to 64 bytes config IA64_CYCLONE bool "Cyclone (EXA) Time Source support" help @@ -373,9 +374,6 @@ config IA64_PALINFO To use this option, you have to ensure that the "/proc file system support" (CONFIG_PROC_FS) is enabled, too. -config SGI_SN - def_bool y if (IA64_SGI_SN2 || IA64_GENERIC) - source "drivers/firmware/Kconfig" source "fs/Kconfig.binfmt" diff --git a/trunk/arch/ia64/kernel/sal.c b/trunk/arch/ia64/kernel/sal.c index 056f7a6eedc7..acc0f132f86c 100644 --- a/trunk/arch/ia64/kernel/sal.c +++ b/trunk/arch/ia64/kernel/sal.c @@ -14,7 +14,6 @@ #include #include -#include #include #include #include @@ -215,78 +214,6 @@ chk_nointroute_opt(void) static void __init sal_desc_ap_wakeup(void *p) { } #endif -/* - * HP rx5670 firmware polls for interrupts during SAL_CACHE_FLUSH by reading - * cr.ivr, but it never writes cr.eoi. This leaves any interrupt marked as - * "in-service" and masks other interrupts of equal or lower priority. - * - * HP internal defect reports: F1859, F2775, F3031. - */ -static int sal_cache_flush_drops_interrupts; - -static void __init -check_sal_cache_flush (void) -{ - unsigned long flags, itv; - int cpu; - u64 vector; - - cpu = get_cpu(); - local_irq_save(flags); - - /* - * Schedule a timer interrupt, wait until it's reported, and see if - * SAL_CACHE_FLUSH drops it. - */ - itv = ia64_get_itv(); - BUG_ON((itv & (1 << 16)) == 0); - - ia64_set_itv(IA64_TIMER_VECTOR); - ia64_set_itm(ia64_get_itc() + 1000); - - while (!ia64_get_irr(IA64_TIMER_VECTOR)) - cpu_relax(); - - ia64_sal_cache_flush(3); - - if (ia64_get_irr(IA64_TIMER_VECTOR)) { - vector = ia64_get_ivr(); - ia64_eoi(); - WARN_ON(vector != IA64_TIMER_VECTOR); - } else { - sal_cache_flush_drops_interrupts = 1; - printk(KERN_ERR "SAL: SAL_CACHE_FLUSH drops interrupts; " - "PAL_CACHE_FLUSH will be used instead\n"); - ia64_eoi(); - } - - ia64_set_itv(itv); - local_irq_restore(flags); - put_cpu(); -} - -s64 -ia64_sal_cache_flush (u64 cache_type) -{ - struct ia64_sal_retval isrv; - - if (sal_cache_flush_drops_interrupts) { - unsigned long flags; - u64 progress; - s64 rc; - - progress = 0; - local_irq_save(flags); - rc = ia64_pal_cache_flush(cache_type, - PAL_CACHE_FLUSH_INVALIDATE, &progress, NULL); - local_irq_restore(flags); - return rc; - } - - SAL_CALL(isrv, SAL_CACHE_FLUSH, cache_type, 0, 0, 0, 0, 0, 0); - return isrv.status; -} - void __init ia64_sal_init (struct ia64_sal_systab *systab) { @@ -335,8 +262,6 @@ ia64_sal_init (struct ia64_sal_systab *systab) } p += SAL_DESC_SIZE(*p); } - - check_sal_cache_flush(); } int diff --git a/trunk/arch/ia64/sn/Makefile b/trunk/arch/ia64/sn/Makefile index 79a7df02e812..a269f6d84c29 100644 --- a/trunk/arch/ia64/sn/Makefile +++ b/trunk/arch/ia64/sn/Makefile @@ -9,4 +9,6 @@ # Makefile for the sn ia64 subplatform # +CPPFLAGS += -I$(srctree)/arch/ia64/sn/include + obj-y += kernel/ pci/ diff --git a/trunk/arch/ia64/sn/kernel/Makefile b/trunk/arch/ia64/sn/kernel/Makefile index 3e9b4eea7418..4351c4ff9845 100644 --- a/trunk/arch/ia64/sn/kernel/Makefile +++ b/trunk/arch/ia64/sn/kernel/Makefile @@ -7,8 +7,6 @@ # Copyright (C) 1999,2001-2005 Silicon Graphics, Inc. All Rights Reserved. # -CPPFLAGS += -I$(srctree)/arch/ia64/sn/include - obj-y += setup.o bte.o bte_error.o irq.o mca.o idle.o \ huberror.o io_init.o iomv.o klconflib.o sn2/ obj-$(CONFIG_IA64_GENERIC) += machvec.o diff --git a/trunk/arch/ia64/sn/kernel/bte.c b/trunk/arch/ia64/sn/kernel/bte.c index 1f11db470d90..dd73c0cb754b 100644 --- a/trunk/arch/ia64/sn/kernel/bte.c +++ b/trunk/arch/ia64/sn/kernel/bte.c @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. */ #include @@ -186,13 +186,18 @@ bte_result_t bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification) /* Initialize the notification to a known value. */ *bte->most_rcnt_na = BTE_WORD_BUSY; - notif_phys_addr = (u64)bte->most_rcnt_na; + notif_phys_addr = TO_PHYS(ia64_tpa((unsigned long)bte->most_rcnt_na)); + if (is_shub2()) { + src = SH2_TIO_PHYS_TO_DMA(src); + dest = SH2_TIO_PHYS_TO_DMA(dest); + notif_phys_addr = SH2_TIO_PHYS_TO_DMA(notif_phys_addr); + } /* Set the source and destination registers */ - BTE_PRINTKV(("IBSA = 0x%lx)\n", src)); - BTE_SRC_STORE(bte, src); - BTE_PRINTKV(("IBDA = 0x%lx)\n", dest)); - BTE_DEST_STORE(bte, dest); + BTE_PRINTKV(("IBSA = 0x%lx)\n", (TO_PHYS(src)))); + BTE_SRC_STORE(bte, TO_PHYS(src)); + BTE_PRINTKV(("IBDA = 0x%lx)\n", (TO_PHYS(dest)))); + BTE_DEST_STORE(bte, TO_PHYS(dest)); /* Set the notification register */ BTE_PRINTKV(("IBNA = 0x%lx)\n", notif_phys_addr)); diff --git a/trunk/arch/ia64/sn/kernel/io_init.c b/trunk/arch/ia64/sn/kernel/io_init.c index d7e4d79e16a8..a4c78152b336 100644 --- a/trunk/arch/ia64/sn/kernel/io_init.c +++ b/trunk/arch/ia64/sn/kernel/io_init.c @@ -208,7 +208,7 @@ static s64 sn_device_fixup_war(u64 nasid, u64 widget, int device, * sn_fixup_ionodes() - This routine initializes the HUB data strcuture for * each node in the system. */ -static void __init sn_fixup_ionodes(void) +static void sn_fixup_ionodes(void) { struct sn_flush_device_kernel *sn_flush_device_kernel; struct sn_flush_device_kernel *dev_entry; @@ -467,13 +467,6 @@ void sn_pci_fixup_slot(struct pci_dev *dev) pcidev_info->pdi_sn_irq_info = NULL; kfree(sn_irq_info); } - - /* - * MSI currently not supported on altix. Remove this when - * the MSI abstraction patches are integrated into the kernel - * (sometime after 2.6.16 releases) - */ - dev->no_msi = 1; } /* diff --git a/trunk/arch/ia64/sn/kernel/irq.c b/trunk/arch/ia64/sn/kernel/irq.c index 74d87d903d5d..ec37084bdc17 100644 --- a/trunk/arch/ia64/sn/kernel/irq.c +++ b/trunk/arch/ia64/sn/kernel/irq.c @@ -5,12 +5,11 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. */ #include #include -#include #include #include #include @@ -77,15 +76,17 @@ static void sn_enable_irq(unsigned int irq) static void sn_ack_irq(unsigned int irq) { - u64 event_occurred, mask; + u64 event_occurred, mask = 0; irq = irq & 0xff; - event_occurred = HUB_L((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED)); + event_occurred = + HUB_L((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED)); mask = event_occurred & SH_ALL_INT_MASK; - HUB_S((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED_ALIAS), mask); + HUB_S((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED_ALIAS), + mask); __set_bit(irq, (volatile void *)pda->sn_in_service_ivecs); - move_native_irq(irq); + move_irq(irq); } static void sn_end_irq(unsigned int irq) @@ -218,8 +219,9 @@ static void register_intr_pda(struct sn_irq_info *sn_irq_info) pdacpu(cpu)->sn_last_irq = irq; } - if (pdacpu(cpu)->sn_first_irq == 0 || pdacpu(cpu)->sn_first_irq > irq) + if (pdacpu(cpu)->sn_first_irq == 0 || pdacpu(cpu)->sn_first_irq > irq) { pdacpu(cpu)->sn_first_irq = irq; + } } static void unregister_intr_pda(struct sn_irq_info *sn_irq_info) @@ -287,7 +289,7 @@ void sn_irq_fixup(struct pci_dev *pci_dev, struct sn_irq_info *sn_irq_info) list_add_rcu(&sn_irq_info->list, sn_irq_lh[sn_irq_info->irq_irq]); spin_unlock(&sn_irq_info_lock); - register_intr_pda(sn_irq_info); + (void)register_intr_pda(sn_irq_info); } void sn_irq_unfixup(struct pci_dev *pci_dev) @@ -417,7 +419,7 @@ void sn_lb_int_war_check(void) rcu_read_unlock(); } -void __init sn_irq_lh_init(void) +void sn_irq_lh_init(void) { int i; @@ -432,4 +434,5 @@ void __init sn_irq_lh_init(void) INIT_LIST_HEAD(sn_irq_lh[i]); } + } diff --git a/trunk/arch/ia64/sn/kernel/klconflib.c b/trunk/arch/ia64/sn/kernel/klconflib.c index 87682b48ef83..0f11a3299cd2 100644 --- a/trunk/arch/ia64/sn/kernel/klconflib.c +++ b/trunk/arch/ia64/sn/kernel/klconflib.c @@ -78,30 +78,31 @@ format_module_id(char *buffer, moduleid_t m, int fmt) position = MODULE_GET_BPOS(m); if ((fmt == MODULE_FORMAT_BRIEF) || (fmt == MODULE_FORMAT_LCD)) { - /* Brief module number format, eg. 002c15 */ + /* Brief module number format, eg. 002c15 */ - /* Decompress the rack number */ - *buffer++ = '0' + RACK_GET_CLASS(rack); - *buffer++ = '0' + RACK_GET_GROUP(rack); - *buffer++ = '0' + RACK_GET_NUM(rack); + /* Decompress the rack number */ + *buffer++ = '0' + RACK_GET_CLASS(rack); + *buffer++ = '0' + RACK_GET_GROUP(rack); + *buffer++ = '0' + RACK_GET_NUM(rack); - /* Add the brick type */ - *buffer++ = brickchar; + /* Add the brick type */ + *buffer++ = brickchar; } else if (fmt == MODULE_FORMAT_LONG) { - /* Fuller hwgraph format, eg. rack/002/bay/15 */ + /* Fuller hwgraph format, eg. rack/002/bay/15 */ - strcpy(buffer, "rack" "/"); buffer += strlen(buffer); + strcpy(buffer, "rack" "/"); buffer += strlen(buffer); - *buffer++ = '0' + RACK_GET_CLASS(rack); - *buffer++ = '0' + RACK_GET_GROUP(rack); - *buffer++ = '0' + RACK_GET_NUM(rack); + *buffer++ = '0' + RACK_GET_CLASS(rack); + *buffer++ = '0' + RACK_GET_GROUP(rack); + *buffer++ = '0' + RACK_GET_NUM(rack); - strcpy(buffer, "/" "bay" "/"); buffer += strlen(buffer); + strcpy(buffer, "/" "bay" "/"); buffer += strlen(buffer); } /* Add the bay position, using at least two digits */ if (position < 10) - *buffer++ = '0'; + *buffer++ = '0'; sprintf(buffer, "%d", position); + } diff --git a/trunk/arch/ia64/sn/kernel/setup.c b/trunk/arch/ia64/sn/kernel/setup.c index ee36bff93c30..e510dce9971f 100644 --- a/trunk/arch/ia64/sn/kernel/setup.c +++ b/trunk/arch/ia64/sn/kernel/setup.c @@ -209,7 +209,7 @@ void __init early_sn_setup(void) } extern int platform_intr_list[]; -static int __initdata shub_1_1_found; +static int __initdata shub_1_1_found = 0; /* * sn_check_for_wars @@ -578,17 +578,13 @@ void __init sn_cpu_init(void) sn_prom_type = 2; else sn_prom_type = 1; - printk(KERN_INFO "Running on medusa with %s PROM\n", - (sn_prom_type == 1) ? "real" : "fake"); + printk("Running on medusa with %s PROM\n", (sn_prom_type == 1) ? "real" : "fake"); } memset(pda, 0, sizeof(pda)); - if (ia64_sn_get_sn_info(0, &sn_hub_info->shub2, - &sn_hub_info->nasid_bitmask, - &sn_hub_info->nasid_shift, - &sn_system_size, &sn_sharing_domain_size, - &sn_partition_id, &sn_coherency_id, - &sn_region_size)) + if (ia64_sn_get_sn_info(0, &sn_hub_info->shub2, &sn_hub_info->nasid_bitmask, &sn_hub_info->nasid_shift, + &sn_system_size, &sn_sharing_domain_size, &sn_partition_id, + &sn_coherency_id, &sn_region_size)) BUG(); sn_hub_info->as_shift = sn_hub_info->nasid_shift - 2; @@ -720,8 +716,7 @@ void __init build_cnode_tables(void) for_each_online_node(node) { kl_config_hdr_t *klgraph_header; nasid = cnodeid_to_nasid(node); - klgraph_header = ia64_sn_get_klconfig_addr(nasid); - if (klgraph_header == NULL) + if ((klgraph_header = ia64_sn_get_klconfig_addr(nasid)) == NULL) BUG(); brd = NODE_OFFSET_TO_LBOARD(nasid, klgraph_header->ch_board_info); while (brd) { @@ -739,7 +734,7 @@ nasid_slice_to_cpuid(int nasid, int slice) { long cpu; - for (cpu = 0; cpu < NR_CPUS; cpu++) + for (cpu=0; cpu < NR_CPUS; cpu++) if (cpuid_to_nasid(cpu) == nasid && cpuid_to_slice(cpu) == slice) return cpu; diff --git a/trunk/arch/ia64/sn/kernel/sn2/Makefile b/trunk/arch/ia64/sn/kernel/sn2/Makefile index 99e177693234..170bde4549da 100644 --- a/trunk/arch/ia64/sn/kernel/sn2/Makefile +++ b/trunk/arch/ia64/sn/kernel/sn2/Makefile @@ -9,7 +9,5 @@ # sn2 specific kernel files # -CPPFLAGS += -I$(srctree)/arch/ia64/sn/include - obj-y += cache.o io.o ptc_deadlock.o sn2_smp.o sn_proc_fs.o \ prominfo_proc.o timer.o timer_interrupt.o sn_hwperf.o diff --git a/trunk/arch/ia64/sn/kernel/sn2/sn2_smp.c b/trunk/arch/ia64/sn/kernel/sn2/sn2_smp.c index f153a4c35c70..471bbaa65d1b 100644 --- a/trunk/arch/ia64/sn/kernel/sn2/sn2_smp.c +++ b/trunk/arch/ia64/sn/kernel/sn2/sn2_smp.c @@ -5,7 +5,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2000-2006 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved. */ #include @@ -46,28 +46,104 @@ DECLARE_PER_CPU(struct ptc_stats, ptcstats); static __cacheline_aligned DEFINE_SPINLOCK(sn2_global_ptc_lock); -void sn2_ptc_deadlock_recovery(short *, short, short, int, volatile unsigned long *, unsigned long, - volatile unsigned long *, unsigned long); +void sn2_ptc_deadlock_recovery(short *, short, int, volatile unsigned long *, unsigned long data0, + volatile unsigned long *, unsigned long data1); +#ifdef DEBUG_PTC /* - * Note: some is the following is captured here to make degugging easier - * (the macros make more sense if you see the debug patch - not posted) + * ptctest: + * + * xyz - 3 digit hex number: + * x - Force PTC purges to use shub: + * 0 - no force + * 1 - force + * y - interupt enable + * 0 - disable interrupts + * 1 - leave interuupts enabled + * z - type of lock: + * 0 - global lock + * 1 - node local lock + * 2 - no lock + * + * Note: on shub1, only ptctest == 0 is supported. Don't try other values! */ + +static unsigned int sn2_ptctest = 0; + +static int __init ptc_test(char *str) +{ + get_option(&str, &sn2_ptctest); + return 1; +} +__setup("ptctest=", ptc_test); + +static inline int ptc_lock(unsigned long *flagp) +{ + unsigned long opt = sn2_ptctest & 255; + + switch (opt) { + case 0x00: + spin_lock_irqsave(&sn2_global_ptc_lock, *flagp); + break; + case 0x01: + spin_lock_irqsave(&sn_nodepda->ptc_lock, *flagp); + break; + case 0x02: + local_irq_save(*flagp); + break; + case 0x10: + spin_lock(&sn2_global_ptc_lock); + break; + case 0x11: + spin_lock(&sn_nodepda->ptc_lock); + break; + case 0x12: + break; + default: + BUG(); + } + return opt; +} + +static inline void ptc_unlock(unsigned long flags, int opt) +{ + switch (opt) { + case 0x00: + spin_unlock_irqrestore(&sn2_global_ptc_lock, flags); + break; + case 0x01: + spin_unlock_irqrestore(&sn_nodepda->ptc_lock, flags); + break; + case 0x02: + local_irq_restore(flags); + break; + case 0x10: + spin_unlock(&sn2_global_ptc_lock); + break; + case 0x11: + spin_unlock(&sn_nodepda->ptc_lock); + break; + case 0x12: + break; + default: + BUG(); + } +} +#else + #define sn2_ptctest 0 -#define local_node_uses_ptc_ga(sh1) ((sh1) ? 1 : 0) -#define max_active_pio(sh1) ((sh1) ? 32 : 7) -#define reset_max_active_on_deadlock() 1 -#define PTC_LOCK(sh1) ((sh1) ? &sn2_global_ptc_lock : &sn_nodepda->ptc_lock) -static inline void ptc_lock(int sh1, unsigned long *flagp) +static inline int ptc_lock(unsigned long *flagp) { - spin_lock_irqsave(PTC_LOCK(sh1), *flagp); + spin_lock_irqsave(&sn2_global_ptc_lock, *flagp); + return 0; } -static inline void ptc_unlock(int sh1, unsigned long flags) +static inline void ptc_unlock(unsigned long flags, int opt) { - spin_unlock_irqrestore(PTC_LOCK(sh1), flags); + spin_unlock_irqrestore(&sn2_global_ptc_lock, flags); } +#endif struct ptc_stats { unsigned long ptc_l; @@ -75,30 +151,27 @@ struct ptc_stats { unsigned long shub_ptc_flushes; unsigned long nodes_flushed; unsigned long deadlocks; - unsigned long deadlocks2; unsigned long lock_itc_clocks; unsigned long shub_itc_clocks; unsigned long shub_itc_clocks_max; - unsigned long shub_ptc_flushes_not_my_mm; }; static inline unsigned long wait_piowc(void) { - volatile unsigned long *piows; - unsigned long zeroval, ws; + volatile unsigned long *piows, zeroval; + unsigned long ws; piows = pda->pio_write_status_addr; zeroval = pda->pio_write_status_val; do { cpu_relax(); } while (((ws = *piows) & SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK) != zeroval); - return (ws & SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_MASK) != 0; + return ws; } void sn_tlb_migrate_finish(struct mm_struct *mm) { - /* flush_tlb_mm is inefficient if more than 1 users of mm */ - if (mm == current->mm && mm && atomic_read(&mm->mm_users) == 1) + if (mm == current->mm) flush_tlb_mm(mm); } @@ -128,14 +201,12 @@ void sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start, unsigned long end, unsigned long nbits) { - int i, ibegin, shub1, cnode, mynasid, cpu, lcpu = 0, nasid; - int mymm = (mm == current->active_mm && mm == current->mm); - int use_cpu_ptcga; + int i, opt, shub1, cnode, mynasid, cpu, lcpu = 0, nasid, flushed = 0; + int mymm = (mm == current->active_mm && current->mm); volatile unsigned long *ptc0, *ptc1; - unsigned long itc, itc2, flags, data0 = 0, data1 = 0, rr_value, old_rr = 0; + unsigned long itc, itc2, flags, data0 = 0, data1 = 0, rr_value; short nasids[MAX_NUMNODES], nix; nodemask_t nodes_flushed; - int active, max_active, deadlock; nodes_clear(nodes_flushed); i = 0; @@ -196,56 +267,41 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start, mynasid = get_nasid(); - use_cpu_ptcga = local_node_uses_ptc_ga(shub1); - max_active = max_active_pio(shub1); itc = ia64_get_itc(); - ptc_lock(shub1, &flags); + opt = ptc_lock(&flags); itc2 = ia64_get_itc(); - __get_cpu_var(ptcstats).lock_itc_clocks += itc2 - itc; __get_cpu_var(ptcstats).shub_ptc_flushes++; __get_cpu_var(ptcstats).nodes_flushed += nix; - if (!mymm) - __get_cpu_var(ptcstats).shub_ptc_flushes_not_my_mm++; - if (use_cpu_ptcga && !mymm) { - old_rr = ia64_get_rr(start); - ia64_set_rr(start, (old_rr & 0xff) | (rr_value << 8)); - ia64_srlz_d(); - } - - wait_piowc(); do { if (shub1) data1 = start | (1UL << SH1_PTC_1_START_SHFT); else data0 = (data0 & ~SH2_PTC_ADDR_MASK) | (start & SH2_PTC_ADDR_MASK); - deadlock = 0; - active = 0; - for (ibegin = 0, i = 0; i < nix; i++) { + for (i = 0; i < nix; i++) { nasid = nasids[i]; - if (use_cpu_ptcga && unlikely(nasid == mynasid)) { + if ((!(sn2_ptctest & 3)) && unlikely(nasid == mynasid && mymm)) { ia64_ptcga(start, nbits << 2); ia64_srlz_i(); } else { ptc0 = CHANGE_NASID(nasid, ptc0); if (ptc1) ptc1 = CHANGE_NASID(nasid, ptc1); - pio_atomic_phys_write_mmrs(ptc0, data0, ptc1, data1); - active++; - } - if (active >= max_active || i == (nix - 1)) { - if ((deadlock = wait_piowc())) { - sn2_ptc_deadlock_recovery(nasids, ibegin, i, mynasid, ptc0, data0, ptc1, data1); - if (reset_max_active_on_deadlock()) - max_active = 1; - } - active = 0; - ibegin = i + 1; + pio_atomic_phys_write_mmrs(ptc0, data0, ptc1, + data1); + flushed = 1; } } + if (flushed + && (wait_piowc() & + (SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_MASK))) { + sn2_ptc_deadlock_recovery(nasids, nix, mynasid, ptc0, data0, ptc1, data1); + } + start += (1UL << nbits); + } while (start < end); itc2 = ia64_get_itc() - itc2; @@ -253,12 +309,7 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start, if (itc2 > __get_cpu_var(ptcstats).shub_itc_clocks_max) __get_cpu_var(ptcstats).shub_itc_clocks_max = itc2; - if (old_rr) { - ia64_set_rr(start, old_rr); - ia64_srlz_d(); - } - - ptc_unlock(shub1, flags); + ptc_unlock(flags, opt); preempt_enable(); } @@ -270,30 +321,27 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start, * TLB flush transaction. The recovery sequence is somewhat tricky & is * coded in assembly language. */ -void sn2_ptc_deadlock_recovery(short *nasids, short ib, short ie, int mynasid, volatile unsigned long *ptc0, unsigned long data0, +void sn2_ptc_deadlock_recovery(short *nasids, short nix, int mynasid, volatile unsigned long *ptc0, unsigned long data0, volatile unsigned long *ptc1, unsigned long data1) { - extern unsigned long sn2_ptc_deadlock_recovery_core(volatile unsigned long *, unsigned long, + extern void sn2_ptc_deadlock_recovery_core(volatile unsigned long *, unsigned long, volatile unsigned long *, unsigned long, volatile unsigned long *, unsigned long); short nasid, i; - unsigned long *piows, zeroval, n; + unsigned long *piows, zeroval; __get_cpu_var(ptcstats).deadlocks++; piows = (unsigned long *) pda->pio_write_status_addr; zeroval = pda->pio_write_status_val; - - for (i=ib; i <= ie; i++) { + for (i=0; i < nix; i++) { nasid = nasids[i]; - if (local_node_uses_ptc_ga(is_shub1()) && nasid == mynasid) + if (!(sn2_ptctest & 3) && nasid == mynasid) continue; ptc0 = CHANGE_NASID(nasid, ptc0); if (ptc1) ptc1 = CHANGE_NASID(nasid, ptc1); - - n = sn2_ptc_deadlock_recovery_core(ptc0, data0, ptc1, data1, piows, zeroval); - __get_cpu_var(ptcstats).deadlocks2 += n; + sn2_ptc_deadlock_recovery_core(ptc0, data0, ptc1, data1, piows, zeroval); } } @@ -404,22 +452,20 @@ static int sn2_ptc_seq_show(struct seq_file *file, void *data) cpu = *(loff_t *) data; if (!cpu) { - seq_printf(file, - "# cpu ptc_l newrid ptc_flushes nodes_flushed deadlocks lock_nsec shub_nsec shub_nsec_max not_my_mm deadlock2\n"); + seq_printf(file, "# ptc_l change_rid shub_ptc_flushes shub_nodes_flushed deadlocks lock_nsec shub_nsec shub_nsec_max\n"); seq_printf(file, "# ptctest %d\n", sn2_ptctest); } if (cpu < NR_CPUS && cpu_online(cpu)) { stat = &per_cpu(ptcstats, cpu); - seq_printf(file, "cpu %d %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld\n", cpu, stat->ptc_l, + seq_printf(file, "cpu %d %ld %ld %ld %ld %ld %ld %ld %ld\n", cpu, stat->ptc_l, stat->change_rid, stat->shub_ptc_flushes, stat->nodes_flushed, stat->deadlocks, 1000 * stat->lock_itc_clocks / per_cpu(cpu_info, cpu).cyc_per_usec, 1000 * stat->shub_itc_clocks / per_cpu(cpu_info, cpu).cyc_per_usec, - 1000 * stat->shub_itc_clocks_max / per_cpu(cpu_info, cpu).cyc_per_usec, - stat->shub_ptc_flushes_not_my_mm, - stat->deadlocks2); + 1000 * stat->shub_itc_clocks_max / per_cpu(cpu_info, cpu).cyc_per_usec); } + return 0; } @@ -430,7 +476,7 @@ static struct seq_operations sn2_ptc_seq_ops = { .show = sn2_ptc_seq_show }; -static int sn2_ptc_proc_open(struct inode *inode, struct file *file) +int sn2_ptc_proc_open(struct inode *inode, struct file *file) { return seq_open(file, &sn2_ptc_seq_ops); } diff --git a/trunk/arch/ia64/sn/kernel/xpc_main.c b/trunk/arch/ia64/sn/kernel/xpc_main.c index 9cd460dfe27e..c75f8aeefc2b 100644 --- a/trunk/arch/ia64/sn/kernel/xpc_main.c +++ b/trunk/arch/ia64/sn/kernel/xpc_main.c @@ -575,21 +575,18 @@ xpc_activate_partition(struct xpc_partition *part) spin_lock_irqsave(&part->act_lock, irq_flags); - DBUG_ON(part->act_state != XPC_P_INACTIVE); - - part->act_state = XPC_P_ACTIVATION_REQ; - XPC_SET_REASON(part, xpcCloneKThread, __LINE__); - - spin_unlock_irqrestore(&part->act_lock, irq_flags); - pid = kernel_thread(xpc_activating, (void *) ((u64) partid), 0); - if (unlikely(pid <= 0)) { - spin_lock_irqsave(&part->act_lock, irq_flags); - part->act_state = XPC_P_INACTIVE; + DBUG_ON(part->act_state != XPC_P_INACTIVE); + + if (pid > 0) { + part->act_state = XPC_P_ACTIVATION_REQ; + XPC_SET_REASON(part, xpcCloneKThread, __LINE__); + } else { XPC_SET_REASON(part, xpcCloneKThreadFailed, __LINE__); - spin_unlock_irqrestore(&part->act_lock, irq_flags); } + + spin_unlock_irqrestore(&part->act_lock, irq_flags); } diff --git a/trunk/arch/ia64/sn/pci/Makefile b/trunk/arch/ia64/sn/pci/Makefile index c6946784a6a8..321576b1b425 100644 --- a/trunk/arch/ia64/sn/pci/Makefile +++ b/trunk/arch/ia64/sn/pci/Makefile @@ -7,6 +7,4 @@ # # Makefile for the sn pci general routines. -CPPFLAGS += -I$(srctree)/arch/ia64/sn/include - obj-y := pci_dma.o tioca_provider.o tioce_provider.o pcibr/ diff --git a/trunk/arch/ia64/sn/pci/pcibr/Makefile b/trunk/arch/ia64/sn/pci/pcibr/Makefile index 3b403ea456f9..1850c4a94c41 100644 --- a/trunk/arch/ia64/sn/pci/pcibr/Makefile +++ b/trunk/arch/ia64/sn/pci/pcibr/Makefile @@ -7,7 +7,5 @@ # # Makefile for the sn2 io routines. -CPPFLAGS += -I$(srctree)/arch/ia64/sn/include - obj-y += pcibr_dma.o pcibr_reg.o \ pcibr_ate.o pcibr_provider.o diff --git a/trunk/arch/mips/kernel/genex.S b/trunk/arch/mips/kernel/genex.S index aa18a8b7b380..13f22d1d0e8b 100644 --- a/trunk/arch/mips/kernel/genex.S +++ b/trunk/arch/mips/kernel/genex.S @@ -233,11 +233,11 @@ NESTED(except_vec_nmi, 0, sp) NESTED(nmi_handler, PT_SIZE, sp) .set push .set noat - .set mips3 SAVE_ALL move a0, sp jal nmi_exception_handler RESTORE_ALL + .set mips3 eret .set pop END(nmi_handler) diff --git a/trunk/drivers/Makefile b/trunk/drivers/Makefile index 5c69b86db624..619dd964c51c 100644 --- a/trunk/drivers/Makefile +++ b/trunk/drivers/Makefile @@ -69,7 +69,7 @@ obj-$(CONFIG_EISA) += eisa/ obj-$(CONFIG_CPU_FREQ) += cpufreq/ obj-$(CONFIG_MMC) += mmc/ obj-$(CONFIG_INFINIBAND) += infiniband/ -obj-$(CONFIG_SGI_SN) += sn/ +obj-$(CONFIG_SGI_IOC4) += sn/ obj-y += firmware/ obj-$(CONFIG_CRYPTO) += crypto/ obj-$(CONFIG_SUPERH) += sh/ diff --git a/trunk/drivers/net/8139too.c b/trunk/drivers/net/8139too.c index 2beac55b57d6..adfba44dac5a 100644 --- a/trunk/drivers/net/8139too.c +++ b/trunk/drivers/net/8139too.c @@ -586,7 +586,6 @@ struct rtl8139_private { dma_addr_t tx_bufs_dma; signed char phys[4]; /* MII device addresses. */ char twistie, twist_row, twist_col; /* Twister tune state. */ - unsigned int watchdog_fired : 1; unsigned int default_port : 4; /* Last dev->if_port value. */ unsigned int have_thread : 1; spinlock_t lock; @@ -639,7 +638,6 @@ static void rtl8139_set_rx_mode (struct net_device *dev); static void __set_rx_mode (struct net_device *dev); static void rtl8139_hw_start (struct net_device *dev); static void rtl8139_thread (void *_data); -static void rtl8139_tx_timeout_task(void *_data); static struct ethtool_ops rtl8139_ethtool_ops; /* write MMIO register, with flush */ @@ -1600,14 +1598,13 @@ static void rtl8139_thread (void *_data) { struct net_device *dev = _data; struct rtl8139_private *tp = netdev_priv(dev); - unsigned long thr_delay = next_tick; + unsigned long thr_delay; - if (tp->watchdog_fired) { - tp->watchdog_fired = 0; - rtl8139_tx_timeout_task(_data); - } else if (rtnl_shlock_nowait() == 0) { + if (rtnl_shlock_nowait() == 0) { rtl8139_thread_iter (dev, tp, tp->mmio_addr); rtnl_unlock (); + + thr_delay = next_tick; } else { /* unlikely race. mitigate with fast poll. */ thr_delay = HZ / 2; @@ -1634,8 +1631,7 @@ static void rtl8139_stop_thread(struct rtl8139_private *tp) if (tp->have_thread) { cancel_rearming_delayed_work(&tp->thread); tp->have_thread = 0; - } else - flush_scheduled_work(); + } } static inline void rtl8139_tx_clear (struct rtl8139_private *tp) @@ -1646,13 +1642,14 @@ static inline void rtl8139_tx_clear (struct rtl8139_private *tp) /* XXX account for unsent Tx packets in tp->stats.tx_dropped */ } -static void rtl8139_tx_timeout_task (void *_data) + +static void rtl8139_tx_timeout (struct net_device *dev) { - struct net_device *dev = _data; struct rtl8139_private *tp = netdev_priv(dev); void __iomem *ioaddr = tp->mmio_addr; int i; u8 tmp8; + unsigned long flags; printk (KERN_DEBUG "%s: Transmit timeout, status %2.2x %4.4x %4.4x " "media %2.2x.\n", dev->name, RTL_R8 (ChipCmd), @@ -1673,34 +1670,23 @@ static void rtl8139_tx_timeout_task (void *_data) if (tmp8 & CmdTxEnb) RTL_W8 (ChipCmd, CmdRxEnb); - spin_lock_bh(&tp->rx_lock); + spin_lock(&tp->rx_lock); /* Disable interrupts by clearing the interrupt mask. */ RTL_W16 (IntrMask, 0x0000); /* Stop a shared interrupt from scavenging while we are. */ - spin_lock_irq(&tp->lock); + spin_lock_irqsave (&tp->lock, flags); rtl8139_tx_clear (tp); - spin_unlock_irq(&tp->lock); + spin_unlock_irqrestore (&tp->lock, flags); /* ...and finally, reset everything */ if (netif_running(dev)) { rtl8139_hw_start (dev); netif_wake_queue (dev); } - spin_unlock_bh(&tp->rx_lock); + spin_unlock(&tp->rx_lock); } -static void rtl8139_tx_timeout (struct net_device *dev) -{ - struct rtl8139_private *tp = netdev_priv(dev); - - if (!tp->have_thread) { - INIT_WORK(&tp->thread, rtl8139_tx_timeout_task, dev); - schedule_delayed_work(&tp->thread, next_tick); - } else - tp->watchdog_fired = 1; - -} static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev) { diff --git a/trunk/drivers/net/Kconfig b/trunk/drivers/net/Kconfig index 47c72a63dfe1..6a6a08441804 100644 --- a/trunk/drivers/net/Kconfig +++ b/trunk/drivers/net/Kconfig @@ -4,9 +4,9 @@ # menu "Network device support" - depends on NET config NETDEVICES + depends on NET default y if UML bool "Network device support" ---help--- @@ -24,6 +24,9 @@ config NETDEVICES If unsure, say Y. +# All the following symbols are dependent on NETDEVICES - do not repeat +# that for each of the symbols. +if NETDEVICES config IFB tristate "Intermediate Functional Block support" @@ -2715,6 +2718,8 @@ config NETCONSOLE If you want to log kernel messages over the network, enable this. See for details. +endif #NETDEVICES + config NETPOLL def_bool NETCONSOLE diff --git a/trunk/drivers/net/bonding/bond_main.c b/trunk/drivers/net/bonding/bond_main.c index e0f51afec778..4ff006c37626 100644 --- a/trunk/drivers/net/bonding/bond_main.c +++ b/trunk/drivers/net/bonding/bond_main.c @@ -1145,8 +1145,7 @@ int bond_sethwaddr(struct net_device *bond_dev, struct net_device *slave_dev) } #define BOND_INTERSECT_FEATURES \ - (NETIF_F_SG|NETIF_F_IP_CSUM|NETIF_F_NO_CSUM|NETIF_F_HW_CSUM|\ - NETIF_F_TSO|NETIF_F_UFO) + (NETIF_F_SG|NETIF_F_IP_CSUM|NETIF_F_NO_CSUM|NETIF_F_HW_CSUM) /* * Compute the common dev->feature set available to all slaves. Some @@ -1169,16 +1168,6 @@ static int bond_compute_features(struct bonding *bond) NETIF_F_HW_CSUM))) features &= ~NETIF_F_SG; - /* - * features will include NETIF_F_TSO (NETIF_F_UFO) iff all - * slave devices support NETIF_F_TSO (NETIF_F_UFO), which - * implies that all slaves also support scatter-gather - * (NETIF_F_SG), which implies that features also includes - * NETIF_F_SG. So no need to check whether we have an - * illegal combination of NETIF_F_{TSO,UFO} and - * !NETIF_F_SG - */ - features |= (bond_dev->features & ~BOND_INTERSECT_FEATURES); bond_dev->features = features; @@ -4091,8 +4080,6 @@ static void bond_ethtool_get_drvinfo(struct net_device *bond_dev, static struct ethtool_ops bond_ethtool_ops = { .get_tx_csum = ethtool_op_get_tx_csum, - .get_tso = ethtool_op_get_tso, - .get_ufo = ethtool_op_get_ufo, .get_sg = ethtool_op_get_sg, .get_drvinfo = bond_ethtool_get_drvinfo, }; diff --git a/trunk/drivers/net/bonding/bond_sysfs.c b/trunk/drivers/net/bonding/bond_sysfs.c index 041bcc583557..32d13da43a0b 100644 --- a/trunk/drivers/net/bonding/bond_sysfs.c +++ b/trunk/drivers/net/bonding/bond_sysfs.c @@ -260,7 +260,7 @@ static ssize_t bonding_store_slaves(struct class_device *cd, const char *buffer, char *ifname; int i, res, found, ret = count; struct slave *slave; - struct net_device *dev = NULL; + struct net_device *dev = 0; struct bonding *bond = to_bond(cd); /* Quick sanity check -- is the bond interface up? */ @@ -995,7 +995,7 @@ static ssize_t bonding_store_primary(struct class_device *cd, const char *buf, s printk(KERN_INFO DRV_NAME ": %s: Setting primary slave to None.\n", bond->dev->name); - bond->primary_slave = NULL; + bond->primary_slave = 0; bond_select_active_slave(bond); } else { printk(KERN_INFO DRV_NAME @@ -1123,7 +1123,7 @@ static ssize_t bonding_store_active_slave(struct class_device *cd, const char *b printk(KERN_INFO DRV_NAME ": %s: Setting active slave to None.\n", bond->dev->name); - bond->primary_slave = NULL; + bond->primary_slave = 0; bond_select_active_slave(bond); } else { printk(KERN_INFO DRV_NAME diff --git a/trunk/drivers/net/e100.c b/trunk/drivers/net/e100.c index 24253c807e55..bf1fd2b98bf8 100644 --- a/trunk/drivers/net/e100.c +++ b/trunk/drivers/net/e100.c @@ -2752,6 +2752,8 @@ static int e100_resume(struct pci_dev *pdev) retval = pci_enable_wake(pdev, 0, 0); if (retval) DPRINTK(PROBE,ERR, "Error clearing wake events\n"); + if(e100_hw_init(nic)) + DPRINTK(HW, ERR, "e100_hw_init failed\n"); netif_device_attach(netdev); if(netif_running(netdev)) diff --git a/trunk/drivers/net/gianfar.c b/trunk/drivers/net/gianfar.c index 0e8e3fcde9ff..0c18dbd67d3b 100644 --- a/trunk/drivers/net/gianfar.c +++ b/trunk/drivers/net/gianfar.c @@ -199,7 +199,8 @@ static int gfar_probe(struct platform_device *pdev) /* get a pointer to the register memory */ r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs = ioremap(r->start, sizeof (struct gfar)); + priv->regs = (struct gfar *) + ioremap(r->start, sizeof (struct gfar)); if (NULL == priv->regs) { err = -ENOMEM; @@ -368,7 +369,7 @@ static int gfar_probe(struct platform_device *pdev) return 0; register_fail: - iounmap(priv->regs); + iounmap((void *) priv->regs); regs_fail: free_netdev(dev); return err; @@ -381,7 +382,7 @@ static int gfar_remove(struct platform_device *pdev) platform_set_drvdata(pdev, NULL); - iounmap(priv->regs); + iounmap((void *) priv->regs); free_netdev(dev); return 0; @@ -453,7 +454,8 @@ static void init_registers(struct net_device *dev) /* Zero out the rmon mib registers if it has them */ if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_RMON) { - memset_io(&(priv->regs->rmon), 0, sizeof (struct rmon_mib)); + memset((void *) &(priv->regs->rmon), 0, + sizeof (struct rmon_mib)); /* Mask off the CAM interrupts */ gfar_write(&priv->regs->rmon.cam1, 0xffffffff); @@ -475,7 +477,7 @@ static void init_registers(struct net_device *dev) void gfar_halt(struct net_device *dev) { struct gfar_private *priv = netdev_priv(dev); - struct gfar __iomem *regs = priv->regs; + struct gfar *regs = priv->regs; u32 tempval; /* Mask all interrupts */ @@ -505,7 +507,7 @@ void gfar_halt(struct net_device *dev) void stop_gfar(struct net_device *dev) { struct gfar_private *priv = netdev_priv(dev); - struct gfar __iomem *regs = priv->regs; + struct gfar *regs = priv->regs; unsigned long flags; phy_stop(priv->phydev); @@ -588,7 +590,7 @@ static void free_skb_resources(struct gfar_private *priv) void gfar_start(struct net_device *dev) { struct gfar_private *priv = netdev_priv(dev); - struct gfar __iomem *regs = priv->regs; + struct gfar *regs = priv->regs; u32 tempval; /* Enable Rx and Tx in MACCFG1 */ @@ -622,7 +624,7 @@ int startup_gfar(struct net_device *dev) unsigned long vaddr; int i; struct gfar_private *priv = netdev_priv(dev); - struct gfar __iomem *regs = priv->regs; + struct gfar *regs = priv->regs; int err = 0; u32 rctrl = 0; u32 attrs = 0; @@ -1620,7 +1622,7 @@ static irqreturn_t gfar_interrupt(int irq, void *dev_id, struct pt_regs *regs) static void adjust_link(struct net_device *dev) { struct gfar_private *priv = netdev_priv(dev); - struct gfar __iomem *regs = priv->regs; + struct gfar *regs = priv->regs; unsigned long flags; struct phy_device *phydev = priv->phydev; int new_state = 0; @@ -1701,7 +1703,7 @@ static void gfar_set_multi(struct net_device *dev) { struct dev_mc_list *mc_ptr; struct gfar_private *priv = netdev_priv(dev); - struct gfar __iomem *regs = priv->regs; + struct gfar *regs = priv->regs; u32 tempval; if(dev->flags & IFF_PROMISC) { @@ -1840,7 +1842,7 @@ static void gfar_set_mac_for_addr(struct net_device *dev, int num, u8 *addr) int idx; char tmpbuf[MAC_ADDR_LEN]; u32 tempval; - u32 __iomem *macptr = &priv->regs->macstnaddr1; + u32 *macptr = &priv->regs->macstnaddr1; macptr += num*2; diff --git a/trunk/drivers/net/gianfar.h b/trunk/drivers/net/gianfar.h index d37d5401be6e..cb9d66ac3ab9 100644 --- a/trunk/drivers/net/gianfar.h +++ b/trunk/drivers/net/gianfar.h @@ -682,8 +682,8 @@ struct gfar_private { struct rxbd8 *cur_rx; /* Next free rx ring entry */ struct txbd8 *cur_tx; /* Next free ring entry */ struct txbd8 *dirty_tx; /* The Ring entry to be freed. */ - struct gfar __iomem *regs; /* Pointer to the GFAR memory mapped Registers */ - u32 __iomem *hash_regs[16]; + struct gfar *regs; /* Pointer to the GFAR memory mapped Registers */ + u32 *hash_regs[16]; int hash_width; struct net_device_stats stats; /* linux network statistics */ struct gfar_extra_stats extra_stats; @@ -718,14 +718,14 @@ struct gfar_private { uint32_t msg_enable; }; -static inline u32 gfar_read(volatile unsigned __iomem *addr) +static inline u32 gfar_read(volatile unsigned *addr) { u32 val; val = in_be32(addr); return val; } -static inline void gfar_write(volatile unsigned __iomem *addr, u32 val) +static inline void gfar_write(volatile unsigned *addr, u32 val) { out_be32(addr, val); } diff --git a/trunk/drivers/net/gianfar_ethtool.c b/trunk/drivers/net/gianfar_ethtool.c index 5de7b2e259dc..765e810620fe 100644 --- a/trunk/drivers/net/gianfar_ethtool.c +++ b/trunk/drivers/net/gianfar_ethtool.c @@ -144,11 +144,11 @@ static void gfar_fill_stats(struct net_device *dev, struct ethtool_stats *dummy, u64 *extra = (u64 *) & priv->extra_stats; if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_RMON) { - u32 __iomem *rmon = (u32 __iomem *) & priv->regs->rmon; + u32 *rmon = (u32 *) & priv->regs->rmon; struct gfar_stats *stats = (struct gfar_stats *) buf; for (i = 0; i < GFAR_RMON_LEN; i++) - stats->rmon[i] = (u64) gfar_read(&rmon[i]); + stats->rmon[i] = (u64) (rmon[i]); for (i = 0; i < GFAR_EXTRA_STATS_LEN; i++) stats->extra[i] = extra[i]; @@ -221,11 +221,11 @@ static void gfar_get_regs(struct net_device *dev, struct ethtool_regs *regs, voi { int i; struct gfar_private *priv = netdev_priv(dev); - u32 __iomem *theregs = (u32 __iomem *) priv->regs; + u32 *theregs = (u32 *) priv->regs; u32 *buf = (u32 *) regbuf; for (i = 0; i < sizeof (struct gfar) / sizeof (u32); i++) - buf[i] = gfar_read(&theregs[i]); + buf[i] = theregs[i]; } /* Convert microseconds to ethernet clock ticks, which changes diff --git a/trunk/drivers/net/gianfar_mii.c b/trunk/drivers/net/gianfar_mii.c index c6b725529af5..74e52fcbf806 100644 --- a/trunk/drivers/net/gianfar_mii.c +++ b/trunk/drivers/net/gianfar_mii.c @@ -50,7 +50,7 @@ * All PHY configuration is done through the TSEC1 MIIM regs */ int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value) { - struct gfar_mii __iomem *regs = (void __iomem *)bus->priv; + struct gfar_mii *regs = bus->priv; /* Set the PHY address and the register address we want to write */ gfar_write(®s->miimadd, (mii_id << 8) | regnum); @@ -70,7 +70,7 @@ int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value) * configuration has to be done through the TSEC1 MIIM regs */ int gfar_mdio_read(struct mii_bus *bus, int mii_id, int regnum) { - struct gfar_mii __iomem *regs = (void __iomem *)bus->priv; + struct gfar_mii *regs = bus->priv; u16 value; /* Set the PHY address and the register address we want to read */ @@ -94,7 +94,7 @@ int gfar_mdio_read(struct mii_bus *bus, int mii_id, int regnum) /* Reset the MIIM registers, and wait for the bus to free */ int gfar_mdio_reset(struct mii_bus *bus) { - struct gfar_mii __iomem *regs = (void __iomem *)bus->priv; + struct gfar_mii *regs = bus->priv; unsigned int timeout = PHY_INIT_TIMEOUT; spin_lock_bh(&bus->mdio_lock); @@ -126,7 +126,7 @@ int gfar_mdio_probe(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct gianfar_mdio_data *pdata; - struct gfar_mii __iomem *regs; + struct gfar_mii *regs; struct mii_bus *new_bus; struct resource *r; int err = 0; @@ -155,14 +155,15 @@ int gfar_mdio_probe(struct device *dev) r = platform_get_resource(pdev, IORESOURCE_MEM, 0); /* Set the PHY base address */ - regs = ioremap(r->start, sizeof (struct gfar_mii)); + regs = (struct gfar_mii *) ioremap(r->start, + sizeof (struct gfar_mii)); if (NULL == regs) { err = -ENOMEM; goto reg_map_fail; } - new_bus->priv = (void __force *)regs; + new_bus->priv = regs; new_bus->irq = pdata->irq; @@ -180,7 +181,7 @@ int gfar_mdio_probe(struct device *dev) return 0; bus_register_fail: - iounmap(regs); + iounmap((void *) regs); reg_map_fail: kfree(new_bus); @@ -196,7 +197,7 @@ int gfar_mdio_remove(struct device *dev) dev_set_drvdata(dev, NULL); - iounmap((void __iomem *)bus->priv); + iounmap((void *) (&bus->priv)); bus->priv = NULL; kfree(bus); diff --git a/trunk/drivers/net/r8169.c b/trunk/drivers/net/r8169.c index 6e1018448eea..2e1bed153c39 100644 --- a/trunk/drivers/net/r8169.c +++ b/trunk/drivers/net/r8169.c @@ -484,12 +484,13 @@ static void mdio_write(void __iomem *ioaddr, int RegAddr, int value) int i; RTL_W32(PHYAR, 0x80000000 | (RegAddr & 0xFF) << 16 | value); + udelay(1000); - for (i = 20; i > 0; i--) { + for (i = 2000; i > 0; i--) { /* Check if the RTL8169 has completed writing to the specified MII register */ if (!(RTL_R32(PHYAR) & 0x80000000)) break; - udelay(25); + udelay(100); } } @@ -498,14 +499,15 @@ static int mdio_read(void __iomem *ioaddr, int RegAddr) int i, value = -1; RTL_W32(PHYAR, 0x0 | (RegAddr & 0xFF) << 16); + udelay(1000); - for (i = 20; i > 0; i--) { + for (i = 2000; i > 0; i--) { /* Check if the RTL8169 has completed retrieving data from the specified MII register */ if (RTL_R32(PHYAR) & 0x80000000) { value = (int) (RTL_R32(PHYAR) & 0xFFFF); break; } - udelay(25); + udelay(100); } return value; } @@ -675,9 +677,6 @@ static int rtl8169_set_speed_xmii(struct net_device *dev, if (duplex == DUPLEX_HALF) auto_nego &= ~(PHY_Cap_10_Full | PHY_Cap_100_Full); - - if (duplex == DUPLEX_FULL) - auto_nego &= ~(PHY_Cap_10_Half | PHY_Cap_100_Half); } tp->phy_auto_nego_reg = auto_nego; diff --git a/trunk/drivers/net/sis900.h b/trunk/drivers/net/sis900.h index 50323941e3c0..4233ea55670f 100644 --- a/trunk/drivers/net/sis900.h +++ b/trunk/drivers/net/sis900.h @@ -33,6 +33,7 @@ enum sis900_registers { rxcfg=0x34, //Receive Configuration Register flctrl=0x38, //Flow Control Register rxlen=0x3c, //Receive Packet Length Register + cfgpmcsr=0x44, //Configuration Power Management Control/Status Register rfcr=0x48, //Receive Filter Control Register rfdr=0x4C, //Receive Filter Data Register pmctrl=0xB0, //Power Management Control Register diff --git a/trunk/drivers/net/sky2.c b/trunk/drivers/net/sky2.c index cae2edf23004..f8b973a04b65 100644 --- a/trunk/drivers/net/sky2.c +++ b/trunk/drivers/net/sky2.c @@ -23,6 +23,12 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +/* + * TOTEST + * - speed setting + * - suspend/resume + */ + #include #include #include @@ -51,7 +57,7 @@ #include "sky2.h" #define DRV_NAME "sky2" -#define DRV_VERSION "0.15" +#define DRV_VERSION "0.13" #define PFX DRV_NAME " " /* @@ -96,10 +102,6 @@ static int copybreak __read_mostly = 256; module_param(copybreak, int, 0); MODULE_PARM_DESC(copybreak, "Receive copy threshold"); -static int disable_msi = 0; -module_param(disable_msi, int, 0); -MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)"); - static const struct pci_device_id sky2_id_table[] = { { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, @@ -196,7 +198,7 @@ static int sky2_set_power_state(struct sky2_hw *hw, pci_power_t state) sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); pci_read_config_word(hw->pdev, hw->pm_cap + PCI_PM_PMC, &power_control); - vaux = (sky2_read16(hw, B0_CTST) & Y2_VAUX_AVAIL) && + vaux = (sky2_read8(hw, B0_CTST) & Y2_VAUX_AVAIL) && (power_control & PCI_PM_CAP_PME_D3cold); pci_read_config_word(hw->pdev, hw->pm_cap + PCI_PM_CTRL, &power_control); @@ -1832,8 +1834,6 @@ static int sky2_poll(struct net_device *dev0, int *budget) u16 hwidx; u16 tx_done[2] = { TX_NO_STATUS, TX_NO_STATUS }; - sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ); - hwidx = sky2_read16(hw, STAT_PUT_IDX); BUG_ON(hwidx >= STATUS_RING_SIZE); rmb(); @@ -1913,10 +1913,12 @@ static int sky2_poll(struct net_device *dev0, int *budget) } exit_loop: + sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ); + sky2_tx_check(hw, 0, tx_done[0]); sky2_tx_check(hw, 1, tx_done[1]); - if (likely(work_done < to_do)) { + if (sky2_read16(hw, STAT_PUT_IDX) == hw->st_idx) { /* need to restart TX timer */ if (is_ec_a1(hw)) { sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP); @@ -2139,12 +2141,14 @@ static inline u32 sky2_clk2us(const struct sky2_hw *hw, u32 clk) static int sky2_reset(struct sky2_hw *hw) { + u32 ctst; u16 status; u8 t8, pmd_type; - int i, err; + int i; - sky2_write8(hw, B0_CTST, CS_RST_CLR); + ctst = sky2_read32(hw, B0_CTST); + sky2_write8(hw, B0_CTST, CS_RST_CLR); hw->chip_id = sky2_read8(hw, B2_CHIP_ID); if (hw->chip_id < CHIP_ID_YUKON_XL || hw->chip_id > CHIP_ID_YUKON_FE) { printk(KERN_ERR PFX "%s: unsupported chip type 0x%x\n", @@ -2152,6 +2156,12 @@ static int sky2_reset(struct sky2_hw *hw) return -EOPNOTSUPP; } + /* ring for status responses */ + hw->st_le = pci_alloc_consistent(hw->pdev, STATUS_LE_BYTES, + &hw->st_dma); + if (!hw->st_le) + return -ENOMEM; + /* disable ASF */ if (hw->chip_id <= CHIP_ID_YUKON_EC) { sky2_write8(hw, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); @@ -2163,24 +2173,19 @@ static int sky2_reset(struct sky2_hw *hw) sky2_write8(hw, B0_CTST, CS_RST_CLR); /* clear PCI errors, if any */ - err = pci_read_config_word(hw->pdev, PCI_STATUS, &status); - if (err) - goto pci_err; - + pci_read_config_word(hw->pdev, PCI_STATUS, &status); sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); - err = pci_write_config_word(hw->pdev, PCI_STATUS, - status | PCI_STATUS_ERROR_BITS); - if (err) - goto pci_err; + pci_write_config_word(hw->pdev, PCI_STATUS, + status | PCI_STATUS_ERROR_BITS); sky2_write8(hw, B0_CTST, CS_MRST_CLR); /* clear any PEX errors */ - if (pci_find_capability(hw->pdev, PCI_CAP_ID_EXP)) { - err = pci_write_config_dword(hw->pdev, PEX_UNC_ERR_STAT, - 0xffffffffUL); - if (err) - goto pci_err; + if (is_pciex(hw)) { + u16 lstat; + pci_write_config_dword(hw->pdev, PEX_UNC_ERR_STAT, + 0xffffffffUL); + pci_read_config_word(hw->pdev, PEX_LNK_STAT, &lstat); } pmd_type = sky2_read8(hw, B2_PMD_TYP); @@ -2292,14 +2297,6 @@ static int sky2_reset(struct sky2_hw *hw) sky2_write8(hw, STAT_ISR_TIMER_CTRL, TIM_START); return 0; - -pci_err: - /* This is to catch a BIOS bug workaround where - * mmconfig table doesn't have other buses. - */ - printk(KERN_ERR PFX "%s: can't access PCI config space\n", - pci_name(hw->pdev)); - return err; } static u32 sky2_supported_modes(const struct sky2_hw *hw) @@ -2554,24 +2551,19 @@ static struct net_device_stats *sky2_get_stats(struct net_device *dev) static int sky2_set_mac_address(struct net_device *dev, void *p) { struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; - unsigned port = sky2->port; - const struct sockaddr *addr = p; + struct sockaddr *addr = p; if (!is_valid_ether_addr(addr->sa_data)) return -EADDRNOTAVAIL; memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); - memcpy_toio(hw->regs + B2_MAC_1 + port * 8, + memcpy_toio(sky2->hw->regs + B2_MAC_1 + sky2->port * 8, dev->dev_addr, ETH_ALEN); - memcpy_toio(hw->regs + B2_MAC_2 + port * 8, + memcpy_toio(sky2->hw->regs + B2_MAC_2 + sky2->port * 8, dev->dev_addr, ETH_ALEN); - /* virtual address for data */ - gma_set_addr(hw, port, GM_SRC_ADDR_2L, dev->dev_addr); - - /* physical address: used for pause frames */ - gma_set_addr(hw, port, GM_SRC_ADDR_1L, dev->dev_addr); + if (netif_running(dev)) + sky2_phy_reinit(sky2); return 0; } @@ -2851,7 +2843,7 @@ static int sky2_set_coalesce(struct net_device *dev, if (ecmd->rx_coalesce_usecs_irq == 0) sky2_write8(hw, STAT_ISR_TIMER_CTRL, TIM_STOP); else { - sky2_write32(hw, STAT_ISR_TIMER_INI, + sky2_write32(hw, STAT_TX_TIMER_INI, sky2_us2clk(hw, ecmd->rx_coalesce_usecs_irq)); sky2_write8(hw, STAT_ISR_TIMER_CTRL, TIM_START); } @@ -3063,61 +3055,6 @@ static void __devinit sky2_show_addr(struct net_device *dev) dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); } -/* Handle software interrupt used during MSI test */ -static irqreturn_t __devinit sky2_test_intr(int irq, void *dev_id, - struct pt_regs *regs) -{ - struct sky2_hw *hw = dev_id; - u32 status = sky2_read32(hw, B0_Y2_SP_ISRC2); - - if (status == 0) - return IRQ_NONE; - - if (status & Y2_IS_IRQ_SW) { - sky2_write8(hw, B0_CTST, CS_CL_SW_IRQ); - hw->msi = 1; - } - sky2_write32(hw, B0_Y2_SP_ICR, 2); - - sky2_read32(hw, B0_IMSK); - return IRQ_HANDLED; -} - -/* Test interrupt path by forcing a a software IRQ */ -static int __devinit sky2_test_msi(struct sky2_hw *hw) -{ - struct pci_dev *pdev = hw->pdev; - int i, err; - - sky2_write32(hw, B0_IMSK, Y2_IS_IRQ_SW); - - err = request_irq(pdev->irq, sky2_test_intr, SA_SHIRQ, DRV_NAME, hw); - if (err) { - printk(KERN_ERR PFX "%s: cannot assign irq %d\n", - pci_name(pdev), pdev->irq); - return err; - } - - sky2_write8(hw, B0_CTST, CS_ST_SW_IRQ); - wmb(); - - for (i = 0; i < 10; i++) { - barrier(); - if (hw->msi) - goto found; - mdelay(1); - } - - err = -EOPNOTSUPP; - sky2_write8(hw, B0_CTST, CS_CL_SW_IRQ); - found: - sky2_write32(hw, B0_IMSK, 0); - - free_irq(pdev->irq, hw); - - return err; -} - static int __devinit sky2_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { @@ -3198,12 +3135,6 @@ static int __devinit sky2_probe(struct pci_dev *pdev, } hw->pm_cap = pm_cap; - /* ring for status responses */ - hw->st_le = pci_alloc_consistent(hw->pdev, STATUS_LE_BYTES, - &hw->st_dma); - if (!hw->st_le) - goto err_out_iounmap; - err = sky2_reset(hw); if (err) goto err_out_iounmap; @@ -3238,22 +3169,7 @@ static int __devinit sky2_probe(struct pci_dev *pdev, } } - if (!disable_msi && pci_enable_msi(pdev) == 0) { - err = sky2_test_msi(hw); - if (err == -EOPNOTSUPP) { - /* MSI test failed, go back to INTx mode */ - printk(KERN_WARNING PFX "%s: No interrupt was generated using MSI, " - "switching to INTx mode. Please report this failure to " - "the PCI maintainer and include system chipset information.\n", - pci_name(pdev)); - pci_disable_msi(pdev); - } - else if (err) - goto err_out_unregister; - } - - err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ | SA_SAMPLE_RANDOM, - DRV_NAME, hw); + err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ, DRV_NAME, hw); if (err) { printk(KERN_ERR PFX "%s: cannot assign irq %d\n", pci_name(pdev), pdev->irq); @@ -3268,8 +3184,6 @@ static int __devinit sky2_probe(struct pci_dev *pdev, return 0; err_out_unregister: - if (hw->msi) - pci_disable_msi(pdev); if (dev1) { unregister_netdev(dev1); free_netdev(dev1); @@ -3312,8 +3226,6 @@ static void __devexit sky2_remove(struct pci_dev *pdev) sky2_read8(hw, B0_CTST); free_irq(pdev->irq, hw); - if (hw->msi) - pci_disable_msi(pdev); pci_free_consistent(pdev, STATUS_LE_BYTES, hw->st_le, hw->st_dma); pci_release_regions(pdev); pci_disable_device(pdev); @@ -3351,33 +3263,25 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state) static int sky2_resume(struct pci_dev *pdev) { struct sky2_hw *hw = pci_get_drvdata(pdev); - int i, err; + int i; pci_restore_state(pdev); pci_enable_wake(pdev, PCI_D0, 0); - err = sky2_set_power_state(hw, PCI_D0); - if (err) - goto out; + sky2_set_power_state(hw, PCI_D0); - err = sky2_reset(hw); - if (err) - goto out; + sky2_reset(hw); for (i = 0; i < 2; i++) { struct net_device *dev = hw->dev[i]; - if (dev && netif_running(dev)) { - netif_device_attach(dev); - err = sky2_up(dev); - if (err) { - printk(KERN_ERR PFX "%s: could not up: %d\n", - dev->name, err); - dev_close(dev); - break; + if (dev) { + if (netif_running(dev)) { + netif_device_attach(dev); + if (sky2_up(dev)) + dev_close(dev); } } } -out: - return err; + return 0; } #endif diff --git a/trunk/drivers/net/sky2.h b/trunk/drivers/net/sky2.h index fd12c289a238..95518921001c 100644 --- a/trunk/drivers/net/sky2.h +++ b/trunk/drivers/net/sky2.h @@ -1841,7 +1841,6 @@ struct sky2_hw { struct net_device *dev[2]; int pm_cap; - int msi; u8 chip_id; u8 chip_rev; u8 copper; @@ -1868,6 +1867,14 @@ static inline u8 sky2_read8(const struct sky2_hw *hw, unsigned reg) return readb(hw->regs + reg); } +/* This should probably go away, bus based tweeks suck */ +static inline int is_pciex(const struct sky2_hw *hw) +{ + u32 status; + pci_read_config_dword(hw->pdev, PCI_DEV_STATUS, &status); + return (status & PCI_OS_PCI_X) == 0; +} + static inline void sky2_write32(const struct sky2_hw *hw, unsigned reg, u32 val) { writel(val, hw->regs + reg); diff --git a/trunk/drivers/net/tulip/uli526x.c b/trunk/drivers/net/tulip/uli526x.c index 238e9c72cb3a..983981666800 100644 --- a/trunk/drivers/net/tulip/uli526x.c +++ b/trunk/drivers/net/tulip/uli526x.c @@ -214,7 +214,7 @@ static u32 uli526x_cr6_user_set; /* For module input parameter */ static int debug; static u32 cr6set; -static int mode = 8; +static unsigned char mode = 8; /* function declaration ------------------------------------- */ static int uli526x_open(struct net_device *); diff --git a/trunk/drivers/net/wan/dscc4.c b/trunk/drivers/net/wan/dscc4.c index 1ff5de076d21..2f61a47b4716 100644 --- a/trunk/drivers/net/wan/dscc4.c +++ b/trunk/drivers/net/wan/dscc4.c @@ -1943,7 +1943,7 @@ static int dscc4_init_ring(struct net_device *dev) (++i%TX_RING_SIZE)*sizeof(*tx_fd)); } while (i < TX_RING_SIZE); - if (!dscc4_init_dummy_skb(dpriv)) + if (dscc4_init_dummy_skb(dpriv) < 0) goto err_free_dma_tx; memset(dpriv->rx_skbuff, 0, sizeof(struct sk_buff *)*RX_RING_SIZE); diff --git a/trunk/include/asm-ia64/processor.h b/trunk/include/asm-ia64/processor.h index 23c8e1be1911..09b99029ac1a 100644 --- a/trunk/include/asm-ia64/processor.h +++ b/trunk/include/asm-ia64/processor.h @@ -559,23 +559,6 @@ ia64_eoi (void) #define cpu_relax() ia64_hint(ia64_hint_pause) -static inline int -ia64_get_irr(unsigned int vector) -{ - unsigned int reg = vector / 64; - unsigned int bit = vector % 64; - u64 irr; - - switch (reg) { - case 0: irr = ia64_getreg(_IA64_REG_CR_IRR0); break; - case 1: irr = ia64_getreg(_IA64_REG_CR_IRR1); break; - case 2: irr = ia64_getreg(_IA64_REG_CR_IRR2); break; - case 3: irr = ia64_getreg(_IA64_REG_CR_IRR3); break; - } - - return test_bit(bit, &irr); -} - static inline void ia64_set_lrr0 (unsigned long val) { diff --git a/trunk/include/asm-ia64/sal.h b/trunk/include/asm-ia64/sal.h index 0b210abbe003..313cad0628d0 100644 --- a/trunk/include/asm-ia64/sal.h +++ b/trunk/include/asm-ia64/sal.h @@ -658,7 +658,15 @@ ia64_sal_freq_base (unsigned long which, unsigned long *ticks_per_second, return isrv.status; } -extern s64 ia64_sal_cache_flush (u64 cache_type); +/* Flush all the processor and platform level instruction and/or data caches */ +static inline s64 +ia64_sal_cache_flush (u64 cache_type) +{ + struct ia64_sal_retval isrv; + SAL_CALL(isrv, SAL_CACHE_FLUSH, cache_type, 0, 0, 0, 0, 0, 0); + return isrv.status; +} + /* Initialize all the processor and platform level instruction and data caches */ static inline s64 diff --git a/trunk/include/asm-ia64/sn/bte.h b/trunk/include/asm-ia64/sn/bte.h index 01e5b4103235..f50da3d91d07 100644 --- a/trunk/include/asm-ia64/sn/bte.h +++ b/trunk/include/asm-ia64/sn/bte.h @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. */ @@ -100,28 +100,13 @@ #define BTE_LNSTAT_STORE(_bte, _x) \ HUB_S(_bte->bte_base_addr, (_x)) #define BTE_SRC_STORE(_bte, _x) \ -({ \ - u64 __addr = ((_x) & ~AS_MASK); \ - if (is_shub2()) \ - __addr = SH2_TIO_PHYS_TO_DMA(__addr); \ - HUB_S(_bte->bte_source_addr, __addr); \ -}) + HUB_S(_bte->bte_source_addr, (_x)) #define BTE_DEST_STORE(_bte, _x) \ -({ \ - u64 __addr = ((_x) & ~AS_MASK); \ - if (is_shub2()) \ - __addr = SH2_TIO_PHYS_TO_DMA(__addr); \ - HUB_S(_bte->bte_destination_addr, __addr); \ -}) + HUB_S(_bte->bte_destination_addr, (_x)) #define BTE_CTRL_STORE(_bte, _x) \ HUB_S(_bte->bte_control_addr, (_x)) #define BTE_NOTIF_STORE(_bte, _x) \ -({ \ - u64 __addr = ia64_tpa((_x) & ~AS_MASK); \ - if (is_shub2()) \ - __addr = SH2_TIO_PHYS_TO_DMA(__addr); \ - HUB_S(_bte->bte_notify_addr, __addr); \ -}) + HUB_S(_bte->bte_notify_addr, (_x)) #define BTE_START_TRANSFER(_bte, _len, _mode) \ is_shub2() ? BTE_CTRL_STORE(_bte, IBLS_BUSY | (_mode << 24) | _len) \ diff --git a/trunk/include/asm-ia64/sn/intr.h b/trunk/include/asm-ia64/sn/intr.h index 60a51a406eec..a3431372c6e7 100644 --- a/trunk/include/asm-ia64/sn/intr.h +++ b/trunk/include/asm-ia64/sn/intr.h @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000-2006 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_IA64_SN_INTR_H @@ -11,26 +11,26 @@ #include -#define SGI_UART_VECTOR 0xe9 +#define SGI_UART_VECTOR (0xe9) /* Reserved IRQs : Note, not to exceed IA64_SN2_FIRST_DEVICE_VECTOR */ -#define SGI_XPC_ACTIVATE 0x30 -#define SGI_II_ERROR 0x31 -#define SGI_XBOW_ERROR 0x32 -#define SGI_PCIASIC_ERROR 0x33 -#define SGI_ACPI_SCI_INT 0x34 -#define SGI_TIOCA_ERROR 0x35 -#define SGI_TIO_ERROR 0x36 -#define SGI_TIOCX_ERROR 0x37 -#define SGI_MMTIMER_VECTOR 0x38 -#define SGI_XPC_NOTIFY 0xe7 - -#define IA64_SN2_FIRST_DEVICE_VECTOR 0x3c -#define IA64_SN2_LAST_DEVICE_VECTOR 0xe6 - -#define SN2_IRQ_RESERVED 0x1 -#define SN2_IRQ_CONNECTED 0x2 -#define SN2_IRQ_SHARED 0x4 +#define SGI_XPC_ACTIVATE (0x30) +#define SGI_II_ERROR (0x31) +#define SGI_XBOW_ERROR (0x32) +#define SGI_PCIASIC_ERROR (0x33) +#define SGI_ACPI_SCI_INT (0x34) +#define SGI_TIOCA_ERROR (0x35) +#define SGI_TIO_ERROR (0x36) +#define SGI_TIOCX_ERROR (0x37) +#define SGI_MMTIMER_VECTOR (0x38) +#define SGI_XPC_NOTIFY (0xe7) + +#define IA64_SN2_FIRST_DEVICE_VECTOR (0x3c) +#define IA64_SN2_LAST_DEVICE_VECTOR (0xe6) + +#define SN2_IRQ_RESERVED (0x1) +#define SN2_IRQ_CONNECTED (0x2) +#define SN2_IRQ_SHARED (0x4) // The SN PROM irq struct struct sn_irq_info { diff --git a/trunk/include/asm-ia64/system.h b/trunk/include/asm-ia64/system.h index 062538715623..80c5a234e259 100644 --- a/trunk/include/asm-ia64/system.h +++ b/trunk/include/asm-ia64/system.h @@ -249,7 +249,32 @@ extern void ia64_load_extra (struct task_struct *task); # define switch_to(prev,next,last) __switch_to(prev, next, last) #endif +/* + * On IA-64, we don't want to hold the runqueue's lock during the low-level context-switch, + * because that could cause a deadlock. Here is an example by Erich Focht: + * + * Example: + * CPU#0: + * schedule() + * -> spin_lock_irq(&rq->lock) + * -> context_switch() + * -> wrap_mmu_context() + * -> read_lock(&tasklist_lock) + * + * CPU#1: + * sys_wait4() or release_task() or forget_original_parent() + * -> write_lock(&tasklist_lock) + * -> do_notify_parent() + * -> wake_up_parent() + * -> try_to_wake_up() + * -> spin_lock_irq(&parent_rq->lock) + * + * If the parent's rq happens to be on CPU#0, we'll wait for the rq->lock + * of that CPU which will not be released, because there we wait for the + * tasklist_lock to become available. + */ #define __ARCH_WANT_UNLOCKED_CTXSW + #define ARCH_HAS_PREFETCH_SWITCH_STACK #define ia64_platform_is(x) (strcmp(x, platform_name) == 0) diff --git a/trunk/scripts/kconfig/lxdialog/Makefile b/trunk/scripts/kconfig/lxdialog/Makefile index bbf4887cff74..fae3e29fc924 100644 --- a/trunk/scripts/kconfig/lxdialog/Makefile +++ b/trunk/scripts/kconfig/lxdialog/Makefile @@ -2,11 +2,8 @@ # check-lxdialog := $(srctree)/$(src)/check-lxdialog.sh - -# Use reursively expanded variables so we do not call gcc unless -# we really need to do so. (Do not call gcc as part of make mrproper) -HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) -HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) +HOST_EXTRACFLAGS:= $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) +HOST_LOADLIBES := $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) HOST_EXTRACFLAGS += -DLOCALE diff --git a/trunk/scripts/kconfig/lxdialog/check-lxdialog.sh b/trunk/scripts/kconfig/lxdialog/check-lxdialog.sh index 120d624e672c..448e353923f3 100644 --- a/trunk/scripts/kconfig/lxdialog/check-lxdialog.sh +++ b/trunk/scripts/kconfig/lxdialog/check-lxdialog.sh @@ -4,17 +4,17 @@ # What library to link ldflags() { - $cc -print-file-name=libncursesw.so | grep -q / + echo "main() {}" | $cc -lncursesw -xc - -o /dev/null 2> /dev/null if [ $? -eq 0 ]; then echo '-lncursesw' exit fi - $cc -print-file-name=libncurses.so | grep -q / + echo "main() {}" | $cc -lncurses -xc - -o /dev/null 2> /dev/null if [ $? -eq 0 ]; then echo '-lncurses' exit fi - $cc -print-file-name=libcurses.so | grep -q / + echo "main() {}" | $cc -lcurses -xc - -o /dev/null 2> /dev/null if [ $? -eq 0 ]; then echo '-lcurses' exit @@ -36,13 +36,10 @@ ccflags() fi } -# Temp file, try to clean up after us -tmp=.lxdialog.tmp -trap "rm -f $tmp" 0 1 2 3 15 - +compiler="" # Check if we can link to ncurses check() { - echo "main() {}" | $cc -xc - -o $tmp 2> /dev/null + echo "main() {}" | $cc -xc - -o /dev/null 2> /dev/null if [ $? != 0 ]; then echo " *** Unable to find the ncurses libraries." 1>&2 echo " *** make menuconfig require the ncurses libraries" 1>&2 @@ -62,7 +59,6 @@ if [ $# == 0 ]; then exit 1 fi -cc="" case "$1" in "-check") shift