From benh at kernel.crashing.org Tue Mar 1 15:29:25 2005 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Tue, 01 Mar 2005 15:29:25 +1100 Subject: [PATCH] ppc64: Fix zImage wrapper incorrect size to flush_cache() Message-ID: <1109651365.7669.21.camel@gaston> Hi ! This patch fixes a bug in the ppc64 zImage wrapper causing it to pass an incorrect size to flush_cache() when flushing the data and instruction caches prior to jumping to the kernel entry. This causes crashes on firmare environment that do strict MMU mapping only of actually allocated areas Signed-off-by: Benjamin Herrenschmidt --- dingo/2.6.10-bk5/arch/ppc64/boot/main.c 2004-12-25 08:35:50.000000000 +1100 +++ 2.6.10-bk5/arch/ppc64/boot/main.c 2005-02-16 17:10:49.194263268 +1100 @@ -200,7 +200,7 @@ vmlinux.addr += (unsigned long)elf64ph->p_offset; vmlinux.size -= (unsigned long)elf64ph->p_offset; - flush_cache((void *)vmlinux.addr, vmlinux.memsize); + flush_cache((void *)vmlinux.addr, vmlinux.size); if (a1) printf("initrd head: 0x%lx\n\r", *((u32 *)initrd.addr)); From kravetz at us.ibm.com Wed Mar 2 09:27:13 2005 From: kravetz at us.ibm.com (Mike Kravetz) Date: Tue, 1 Mar 2005 14:27:13 -0800 Subject: [PATCH] NUMA memory fixup Message-ID: <20050301222713.GB5780@w-mikek2.ibm.com> When I booted my new 720 on a kernel configured for NUMA, I received the following during bootup: WARNING: Unexpected node layout: region start 44000000 length 2000000 NUMA is disabled This is due to memory 'holes' within nodes. If such holes are encountered, then NUMA is disabled. The following patch adds support for such configurations. My 720 now boots with the following message: [boot]0012 Setup Arch Node 0 Memory: 0x0-0x8000000 0x44000000-0x12a000000 Node 1 Memory: 0x8000000-0x44000000 0x12a000000-0x1ea000000 I'd appreciate any comments on the approach taken. I'm also working on adding NUMA support on top of the SPARSEMEM implementation being pushed as part of memory hot add. However, it seems important to get the current implementation based on DISCONTIGMEM working first. This patch is against 2.6.11-rc3, but I can provide a later version if needed. -- Signed-off-by: Mike Kravetz diff -Naupr linux-2.6.11-rc3/arch/ppc64/mm/numa.c linux-2.6.11-rc3.work/arch/ppc64/mm/numa.c --- linux-2.6.11-rc3/arch/ppc64/mm/numa.c 2005-02-03 01:57:16.000000000 +0000 +++ linux-2.6.11-rc3.work/arch/ppc64/mm/numa.c 2005-03-01 19:39:21.000000000 +0000 @@ -40,7 +40,6 @@ int nr_cpus_in_node[MAX_NUMNODES] = { [0 struct pglist_data *node_data[MAX_NUMNODES]; bootmem_data_t __initdata plat_node_bdata[MAX_NUMNODES]; -static unsigned long node0_io_hole_size; static int min_common_depth; /* @@ -49,7 +48,8 @@ static int min_common_depth; */ static struct { unsigned long node_start_pfn; - unsigned long node_spanned_pages; + unsigned long node_end_pfn; + unsigned long node_present_pages; } init_node_data[MAX_NUMNODES] __initdata; EXPORT_SYMBOL(node_data); @@ -348,33 +348,28 @@ new_range: if (max_domain < numa_domain) max_domain = numa_domain; - /* - * For backwards compatibility, OF splits the first node - * into two regions (the first being 0-4GB). Check for - * this simple case and complain if there is a gap in - * memory + /* + * Initialize new node struct, or add to an existing one. */ - if (init_node_data[numa_domain].node_spanned_pages) { - unsigned long shouldstart = - init_node_data[numa_domain].node_start_pfn + - init_node_data[numa_domain].node_spanned_pages; - if (shouldstart != (start / PAGE_SIZE)) { - /* Revert to non-numa for now */ - printk(KERN_ERR - "WARNING: Unexpected node layout: " - "region start %lx length %lx\n", - start, size); - printk(KERN_ERR "NUMA is disabled\n"); - goto err; - } - init_node_data[numa_domain].node_spanned_pages += + if (init_node_data[numa_domain].node_end_pfn) { + if ((start / PAGE_SIZE) < + init_node_data[numa_domain].node_start_pfn) + init_node_data[numa_domain].node_start_pfn = + start / PAGE_SIZE; + else + init_node_data[numa_domain].node_end_pfn = + (start / PAGE_SIZE) + + (size / PAGE_SIZE); + + init_node_data[numa_domain].node_present_pages += size / PAGE_SIZE; } else { node_set_online(numa_domain); init_node_data[numa_domain].node_start_pfn = start / PAGE_SIZE; - init_node_data[numa_domain].node_spanned_pages = + init_node_data[numa_domain].node_end_pfn = + init_node_data[numa_domain].node_start_pfn + size / PAGE_SIZE; } @@ -391,14 +386,6 @@ new_range: node_set_online(i); return 0; -err: - /* Something has gone wrong; revert any setup we've done */ - for_each_node(i) { - node_set_offline(i); - init_node_data[i].node_start_pfn = 0; - init_node_data[i].node_spanned_pages = 0; - } - return -1; } static void __init setup_nonnuma(void) @@ -426,12 +413,11 @@ static void __init setup_nonnuma(void) node_set_online(0); init_node_data[0].node_start_pfn = 0; - init_node_data[0].node_spanned_pages = lmb_end_of_DRAM() / PAGE_SIZE; + init_node_data[0].node_end_pfn = lmb_end_of_DRAM() / PAGE_SIZE; + init_node_data[0].node_present_pages = total_ram / PAGE_SIZE; for (i = 0 ; i < top_of_ram; i += MEMORY_INCREMENT) numa_memory_lookup_table[i >> MEMORY_INCREMENT_SHIFT] = 0; - - node0_io_hole_size = top_of_ram - total_ram; } static void __init dump_numa_topology(void) @@ -512,6 +498,7 @@ static unsigned long careful_allocation( void __init do_init_bootmem(void) { int nid; + struct device_node *memory = NULL; static struct notifier_block ppc64_numa_nb = { .notifier_call = cpu_numa_callback, .priority = 1 /* Must run before sched domains notifier. */ @@ -535,7 +522,7 @@ void __init do_init_bootmem(void) unsigned long bootmap_pages; start_paddr = init_node_data[nid].node_start_pfn * PAGE_SIZE; - end_paddr = start_paddr + (init_node_data[nid].node_spanned_pages * PAGE_SIZE); + end_paddr = init_node_data[nid].node_end_pfn * PAGE_SIZE; /* Allocate the node structure node local if possible */ NODE_DATA(nid) = (struct pglist_data *)careful_allocation(nid, @@ -551,9 +538,9 @@ void __init do_init_bootmem(void) NODE_DATA(nid)->node_start_pfn = init_node_data[nid].node_start_pfn; NODE_DATA(nid)->node_spanned_pages = - init_node_data[nid].node_spanned_pages; + end_paddr - start_paddr; - if (init_node_data[nid].node_spanned_pages == 0) + if (NODE_DATA(nid)->node_spanned_pages == 0) continue; dbg("start_paddr = %lx\n", start_paddr); @@ -572,33 +559,48 @@ void __init do_init_bootmem(void) start_paddr >> PAGE_SHIFT, end_paddr >> PAGE_SHIFT); - for (i = 0; i < lmb.memory.cnt; i++) { - unsigned long physbase, size; - - physbase = lmb.memory.region[i].physbase; - size = lmb.memory.region[i].size; - - if (physbase < end_paddr && - (physbase+size) > start_paddr) { - /* overlaps */ - if (physbase < start_paddr) { - size -= start_paddr - physbase; - physbase = start_paddr; - } - - if (size > end_paddr - physbase) - size = end_paddr - physbase; - - dbg("free_bootmem %lx %lx\n", physbase, size); - free_bootmem_node(NODE_DATA(nid), physbase, - size); + /* + * We need to do another scan of all memory sections to + * associate memory with the correct node. + */ + memory = NULL; + while ((memory = of_find_node_by_type(memory, "memory")) != NULL) { + unsigned long mem_start, mem_size; + int numa_domain; + unsigned int *memcell_buf; + unsigned int len; + + memcell_buf = (unsigned int *)get_property(memory, "reg", &len); + if (!memcell_buf || len <= 0) + continue; + + mem_start = read_cell_ul(memory, &memcell_buf); + mem_size = read_cell_ul(memory, &memcell_buf); + numa_domain = of_node_numa_domain(memory); + + if (numa_domain != nid) + continue; + + if (mem_start < end_paddr && + (mem_start+mem_size) > start_paddr) { + /* should be no overlaps ! */ + dbg("free_bootmem %lx %lx\n", mem_start, mem_size); + free_bootmem_node(NODE_DATA(nid), mem_start, + mem_size); } } + /* + * Mark reserved regions on this node + */ for (i = 0; i < lmb.reserved.cnt; i++) { unsigned long physbase = lmb.reserved.region[i].physbase; unsigned long size = lmb.reserved.region[i].size; + if (pa_to_nid(physbase) != nid && + pa_to_nid(physbase+size-1) != nid) + continue; + if (physbase < end_paddr && (physbase+size) > start_paddr) { /* overlaps */ @@ -632,13 +634,12 @@ void __init paging_init(void) unsigned long start_pfn; unsigned long end_pfn; - start_pfn = plat_node_bdata[nid].node_boot_start >> PAGE_SHIFT; - end_pfn = plat_node_bdata[nid].node_low_pfn; + start_pfn = init_node_data[nid].node_start_pfn; + end_pfn = init_node_data[nid].node_end_pfn; zones_size[ZONE_DMA] = end_pfn - start_pfn; - zholes_size[ZONE_DMA] = 0; - if (nid == 0) - zholes_size[ZONE_DMA] = node0_io_hole_size >> PAGE_SHIFT; + zholes_size[ZONE_DMA] = zones_size[ZONE_DMA] - + init_node_data[nid].node_present_pages; dbg("free_area_init node %d %lx %lx (hole: %lx)\n", nid, zones_size[ZONE_DMA], start_pfn, zholes_size[ZONE_DMA]); From ntl at pobox.com Wed Mar 2 12:47:01 2005 From: ntl at pobox.com (Nathan Lynch) Date: Tue, 1 Mar 2005 19:47:01 -0600 Subject: [PATCH] explicitly bind idle tasks In-Reply-To: <20050227144928.6c71adaf.akpm@osdl.org> References: <20050227031655.67233bb5.akpm@osdl.org> <1109542971.14993.217.camel@gaston> <20050227144928.6c71adaf.akpm@osdl.org> Message-ID: <20050302014701.GA5897@otto> On Sun, Feb 27, 2005 at 02:49:28PM -0800, Andrew Morton wrote: > Benjamin Herrenschmidt wrote: > > > > > - if (cpu_is_offline(smp_processor_id()) && > > > + if (cpu_is_offline(_smp_processor_id()) && > > > system_state == SYSTEM_RUNNING) > > > cpu_die(); > > > } > > > _ > > > > This is the idle loop. Is that ever supposed to be preempted ? > > Nope, it's a false positive. We had to do the same in x86's idle loop and > probably others will hit it. Perhaps I'm missing something, but is there any reason we can't do the following? I've tested it on ppc64, doesn't seem to break anything. With hotplug cpu and preempt, we tend to see smp_processor_id warnings from idle loop code because it's always checking whether its cpu has gone offline. Replacing every use of smp_processor_id with _smp_processor_id in all idle loop code is one solution; another way is explicitly binding idle threads to their cpus (the smp_processor_id warning does not fire if the caller is bound only to the calling cpu). This has the (admittedly slight) advantage of letting us know if an idle thread ever runs on the wrong cpu. Signed-off-by: Nathan Lynch Index: linux-2.6.11-rc5-mm1/init/main.c =================================================================== --- linux-2.6.11-rc5-mm1.orig/init/main.c 2005-03-02 00:12:07.000000000 +0000 +++ linux-2.6.11-rc5-mm1/init/main.c 2005-03-02 00:53:04.000000000 +0000 @@ -638,6 +638,10 @@ { lock_kernel(); /* + * init can run on any cpu. + */ + set_cpus_allowed(current, CPU_MASK_ALL); + /* * Tell the world that we're going to be the grim * reaper of innocent orphaned children. * Index: linux-2.6.11-rc5-mm1/kernel/sched.c =================================================================== --- linux-2.6.11-rc5-mm1.orig/kernel/sched.c 2005-03-02 00:12:07.000000000 +0000 +++ linux-2.6.11-rc5-mm1/kernel/sched.c 2005-03-02 00:47:14.000000000 +0000 @@ -4092,6 +4092,7 @@ idle->array = NULL; idle->prio = MAX_PRIO; idle->state = TASK_RUNNING; + idle->cpus_allowed = cpumask_of_cpu(cpu); set_task_cpu(idle, cpu); spin_lock_irqsave(&rq->lock, flags); From zwane at arm.linux.org.uk Wed Mar 2 14:13:26 2005 From: zwane at arm.linux.org.uk (Zwane Mwaikambo) Date: Tue, 1 Mar 2005 20:13:26 -0700 (MST) Subject: [PATCH] explicitly bind idle tasks In-Reply-To: <20050302014701.GA5897@otto> References: <20050227031655.67233bb5.akpm@osdl.org> <1109542971.14993.217.camel@gaston> <20050227144928.6c71adaf.akpm@osdl.org> <20050302014701.GA5897@otto> Message-ID: On Tue, 1 Mar 2005, Nathan Lynch wrote: > On Sun, Feb 27, 2005 at 02:49:28PM -0800, Andrew Morton wrote: > > Benjamin Herrenschmidt wrote: > > > > > > > - if (cpu_is_offline(smp_processor_id()) && > > > > + if (cpu_is_offline(_smp_processor_id()) && > > > > system_state == SYSTEM_RUNNING) > > > > cpu_die(); > > > > } > > > > _ > > > > > > This is the idle loop. Is that ever supposed to be preempted ? > > > > Nope, it's a false positive. We had to do the same in x86's idle loop and > > probably others will hit it. > > Perhaps I'm missing something, but is there any reason we can't do > the following? I've tested it on ppc64, doesn't seem to break anything. > > With hotplug cpu and preempt, we tend to see smp_processor_id warnings > from idle loop code because it's always checking whether its cpu has > gone offline. Replacing every use of smp_processor_id with > _smp_processor_id in all idle loop code is one solution; another way > is explicitly binding idle threads to their cpus (the smp_processor_id > warning does not fire if the caller is bound only to the calling cpu). > This has the (admittedly slight) advantage of letting us know if an > idle thread ever runs on the wrong cpu. Makes sense to me, for some reason i thought the smp_processor_id() function did a cpu_rq->idle check of some sort. Thanks, Zwane From Derek.Fults at gd-ais.com Tue Mar 1 05:16:12 2005 From: Derek.Fults at gd-ais.com (Derek.Fults at gd-ais.com) Date: Mon, 28 Feb 2005 12:16:12 -0600 Subject: CPU Freq Scaling Message-ID: <1109614572.20610.41.camel@kato.gd-ais.com> Hi All, I'm looking for information on CPU frequency scaling of the 970. I've got a request to clock it down to 500 SPECINTs. Is this currently being worked on or down the pipe a ways? Thanks for any info. -- Derek L. Fults From nacc at us.ibm.com Thu Mar 3 05:12:06 2005 From: nacc at us.ibm.com (Nishanth Aravamudan) Date: Wed, 2 Mar 2005 10:12:06 -0800 Subject: eeh.h compile warnings / adbhid.c build failure Message-ID: <20050302181206.GA2741@us.ibm.com> Hi, While building 2.6.11 for a G5, I noticed the following errors being spit out (gcc 3.3.5): include/asm/eeh.h: In function `eeh_memcpy_fromio': include/asm/eeh.h:265: warning: statement with no effect include/asm/eeh.h: In function `eeh_insb': include/asm/eeh.h:353: warning: statement with no effect include/asm/eeh.h: In function `eeh_insw_ns': include/asm/eeh.h:360: warning: statement with no effect include/asm/eeh.h: In function `eeh_insl_ns': include/asm/eeh.h:367: warning: statement with no effect include/asm/eeh.h: In function `eeh_memcpy_fromio': include/asm/eeh.h:265: warning: statement with no effect include/asm/eeh.h: In function `eeh_insb': include/asm/eeh.h:353: warning: statement with no effect include/asm/eeh.h: In function `eeh_insw_ns': include/asm/eeh.h:360: warning: statement with no effect include/asm/eeh.h: In function `eeh_insl_ns': include/asm/eeh.h:367: warning: statement with no effect These warnings are emitted for pretty much every driver. It looks like it is becuase with CONFIG_EEH undefined (it's a pSeries thing? -- my interpretation from looking at the ppc64 Kconfig), eeh_check_failure() becomes #define'd to simply it's second parameter, which in the case of assignment statements ia statement with no effect. It's not a big deal, the kernels still compile (with a patch to adbhid.c which I'll mention in a second) but it's a lot of noise to be generated because I don't have a pSeries machine... Now, to the build-blocking code: In drivers/macintosh/adbhid.c::1159: static int __init adbhid_init(void) { #ifndef CONFIG_MAC if ( (_machine != _MACH_chrp) && (_machine != _MACH_Pmac) ) return 0; #endif ... I don't see CONFIG_MAC in my .config (attached below [1]), and _MACH_chrp is not defined for ppc64 (it's in asm-ppc/processor.h not in ppc64/processor.h. I just removed the _MACH_chrp conditional in my local code to get the kernel to build. I'm not sure what the actual solution is, but I thought you all should know about it. Thanks, Nish # # Automatically generated make config: don't edit # Linux kernel version: 2.6.11 # Wed Mar 2 09:27:02 2005 # CONFIG_64BIT=y CONFIG_MMU=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_GENERIC_ISA_DMA=y CONFIG_HAVE_DEC_LOCK=y CONFIG_EARLY_PRINTK=y CONFIG_COMPAT=y CONFIG_FRAME_POINTER=y CONFIG_FORCE_MAX_ZONEORDER=13 # # Code maturity level options # CONFIG_EXPERIMENTAL=y # CONFIG_CLEAN_COMPILE is not set CONFIG_BROKEN=y CONFIG_BROKEN_ON_SMP=y CONFIG_LOCK_KERNEL=y # # General setup # CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=17 CONFIG_HOTPLUG=y CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SHMEM=y CONFIG_CC_ALIGN_FUNCTIONS=0 CONFIG_CC_ALIGN_LABELS=0 CONFIG_CC_ALIGN_LOOPS=0 CONFIG_CC_ALIGN_JUMPS=0 # CONFIG_TINY_SHMEM is not set # # Loadable module support # CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set # CONFIG_MODULE_SRCVERSION_ALL is not set # CONFIG_KMOD is not set CONFIG_STOP_MACHINE=y CONFIG_SYSVIPC_COMPAT=y # # Platform support # # CONFIG_PPC_ISERIES is not set CONFIG_PPC_MULTIPLATFORM=y # CONFIG_PPC_PSERIES is not set CONFIG_PPC_PMAC=y # CONFIG_PPC_MAPLE is not set CONFIG_PPC=y CONFIG_PPC64=y CONFIG_PPC_OF=y CONFIG_ALTIVEC=y CONFIG_U3_DART=y CONFIG_PPC_PMAC64=y CONFIG_BOOTX_TEXT=y # CONFIG_POWER4_ONLY is not set # CONFIG_IOMMU_VMERGE is not set CONFIG_SMP=y CONFIG_NR_CPUS=2 CONFIG_SCHED_SMT=y CONFIG_PREEMPT=y CONFIG_PREEMPT_BKL=y CONFIG_GENERIC_HARDIRQS=y # # General setup # CONFIG_PCI=y CONFIG_PCI_DOMAINS=y CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=y CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y # # PCCARD (PCMCIA/CardBus) support # # CONFIG_PCCARD is not set # # PC-card bridges # # # PCI Hotplug Support # # CONFIG_HOTPLUG_PCI is not set CONFIG_PROC_DEVICETREE=y CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="console=ttyS0,9600 console=tty0 root=/dev/sda2" # # Device Drivers # # # Generic Driver Options # # CONFIG_STANDALONE is not set # CONFIG_PREVENT_FIRMWARE_BUILD is not set CONFIG_FW_LOADER=y # CONFIG_DEBUG_DRIVER is not set # # Memory Technology Devices (MTD) # # CONFIG_MTD is not set # # Parallel port support # # CONFIG_PARPORT is not set # # Plug and Play support # # # Block devices # # CONFIG_BLK_DEV_FD is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set # CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" # CONFIG_CDROM_PKTCDVD is not set # # IO Schedulers # CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support # CONFIG_IDE=y CONFIG_BLK_DEV_IDE=y # # Please see Documentation/ide.txt for help/info on IDE drives # # CONFIG_BLK_DEV_IDE_SATA is not set CONFIG_BLK_DEV_IDEDISK=y # CONFIG_IDEDISK_MULTI_MODE is not set CONFIG_BLK_DEV_IDECD=y # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_IDE_TASK_IOCTL is not set # # IDE chipset support/bugfixes # CONFIG_IDE_GENERIC=y CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_BLK_DEV_OFFBOARD is not set CONFIG_BLK_DEV_GENERIC=y # CONFIG_BLK_DEV_OPTI621 is not set # CONFIG_BLK_DEV_SL82C105 is not set CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set # CONFIG_BLK_DEV_AMD74XX is not set # CONFIG_BLK_DEV_CMD64X is not set # CONFIG_BLK_DEV_TRIFLEX is not set # CONFIG_BLK_DEV_CY82C693 is not set # CONFIG_BLK_DEV_CS5520 is not set # CONFIG_BLK_DEV_CS5530 is not set # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_BLK_DEV_HPT366 is not set # CONFIG_BLK_DEV_SC1200 is not set # CONFIG_BLK_DEV_PIIX is not set # CONFIG_BLK_DEV_NS87415 is not set # CONFIG_BLK_DEV_PDC202XX_OLD is not set # CONFIG_BLK_DEV_PDC202XX_NEW is not set # CONFIG_BLK_DEV_SVWKS is not set # CONFIG_BLK_DEV_SIIMAGE is not set # CONFIG_BLK_DEV_SLC90E66 is not set # CONFIG_BLK_DEV_TRM290 is not set # CONFIG_BLK_DEV_VIA82CXXX is not set CONFIG_BLK_DEV_IDE_PMAC=y CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y CONFIG_BLK_DEV_IDEDMA_PMAC=y # CONFIG_BLK_DEV_IDE_PMAC_BLINK is not set # CONFIG_IDE_ARM is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_IVB is not set CONFIG_IDEDMA_AUTO=y # CONFIG_BLK_DEV_HD is not set # # SCSI device support # CONFIG_SCSI=y CONFIG_SCSI_PROC_FS=y # # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=y # CONFIG_CHR_DEV_ST is not set # CONFIG_CHR_DEV_OSST is not set CONFIG_BLK_DEV_SR=y CONFIG_BLK_DEV_SR_VENDOR=y CONFIG_CHR_DEV_SG=y # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # CONFIG_SCSI_MULTI_LUN=y CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_LOGGING is not set # # SCSI Transport Attributes # CONFIG_SCSI_SPI_ATTRS=y CONFIG_SCSI_FC_ATTRS=y # CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers # # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_AACRAID is not set # CONFIG_SCSI_AIC7XXX is not set # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set CONFIG_SCSI_SATA=y # CONFIG_SCSI_SATA_AHCI is not set CONFIG_SCSI_SATA_SVW=y # CONFIG_SCSI_ATA_PIIX is not set # CONFIG_SCSI_SATA_NV is not set # CONFIG_SCSI_SATA_PROMISE is not set # CONFIG_SCSI_SATA_QSTOR is not set # CONFIG_SCSI_SATA_SX4 is not set # CONFIG_SCSI_SATA_SIL is not set # CONFIG_SCSI_SATA_SIS is not set # CONFIG_SCSI_SATA_ULI is not set # CONFIG_SCSI_SATA_VIA is not set # CONFIG_SCSI_SATA_VITESSE is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_CPQFCTS is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_SYM53C8XX_2 is not set # CONFIG_SCSI_IPR is not set # CONFIG_SCSI_PCI2000 is not set # CONFIG_SCSI_PCI2220I is not set # CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA21XX is not set # CONFIG_SCSI_QLA22XX is not set # CONFIG_SCSI_QLA2300 is not set # CONFIG_SCSI_QLA2322 is not set # CONFIG_SCSI_QLA6312 is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DEBUG is not set # # Multi-device support (RAID and LVM) # # CONFIG_MD is not set # # Fusion MPT device support # # CONFIG_FUSION is not set # # IEEE 1394 (FireWire) support # CONFIG_IEEE1394=y # # Subsystem Options # # CONFIG_IEEE1394_VERBOSEDEBUG is not set # CONFIG_IEEE1394_OUI_DB is not set CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y CONFIG_IEEE1394_CONFIG_ROM_IP1394=y # # Device Drivers # # CONFIG_IEEE1394_PCILYNX is not set CONFIG_IEEE1394_OHCI1394=y # # Protocol Drivers # CONFIG_IEEE1394_VIDEO1394=y CONFIG_IEEE1394_SBP2=y # CONFIG_IEEE1394_SBP2_PHYS_DMA is not set CONFIG_IEEE1394_ETH1394=y CONFIG_IEEE1394_DV1394=y CONFIG_IEEE1394_RAWIO=y CONFIG_IEEE1394_CMP=y # CONFIG_IEEE1394_AMDTP is not set # # I2O device support # CONFIG_I2O=y CONFIG_I2O_CONFIG=y CONFIG_I2O_BLOCK=y CONFIG_I2O_SCSI=y CONFIG_I2O_PROC=y # # Macintosh device drivers # CONFIG_ADB=y CONFIG_ADB_PMU=y # CONFIG_PMAC_PBOOK is not set # CONFIG_PMAC_BACKLIGHT is not set # CONFIG_MAC_SERIAL is not set CONFIG_INPUT_ADBHID=y CONFIG_MAC_EMUMOUSEBTN=y CONFIG_THERM_PM72=y # # Networking support # CONFIG_NET=y # # Networking options # CONFIG_PACKET=y # CONFIG_PACKET_MMAP is not set # CONFIG_NETLINK_DEV is not set CONFIG_UNIX=y CONFIG_NET_KEY=y CONFIG_INET=y CONFIG_IP_MULTICAST=y # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_PNP is not set CONFIG_NET_IPIP=y # CONFIG_NET_IPGRE is not set # CONFIG_IP_MROUTE is not set # CONFIG_ARPD is not set CONFIG_SYN_COOKIES=y CONFIG_INET_AH=y CONFIG_INET_ESP=y CONFIG_INET_IPCOMP=y CONFIG_INET_TUNNEL=y CONFIG_IP_TCPDIAG=y # CONFIG_IP_TCPDIAG_IPV6 is not set # # IP: Virtual Server Configuration # # CONFIG_IP_VS is not set # CONFIG_IPV6 is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set # # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=y # CONFIG_IP_NF_CT_ACCT is not set # CONFIG_IP_NF_CONNTRACK_MARK is not set # CONFIG_IP_NF_CT_PROTO_SCTP is not set CONFIG_IP_NF_FTP=y CONFIG_IP_NF_IRC=y CONFIG_IP_NF_TFTP=y CONFIG_IP_NF_AMANDA=y CONFIG_IP_NF_QUEUE=y CONFIG_IP_NF_IPTABLES=y CONFIG_IP_NF_MATCH_LIMIT=y CONFIG_IP_NF_MATCH_IPRANGE=y CONFIG_IP_NF_MATCH_MAC=y CONFIG_IP_NF_MATCH_PKTTYPE=y CONFIG_IP_NF_MATCH_MARK=y CONFIG_IP_NF_MATCH_MULTIPORT=y CONFIG_IP_NF_MATCH_TOS=y CONFIG_IP_NF_MATCH_RECENT=y CONFIG_IP_NF_MATCH_ECN=y CONFIG_IP_NF_MATCH_DSCP=y CONFIG_IP_NF_MATCH_AH_ESP=y CONFIG_IP_NF_MATCH_LENGTH=y CONFIG_IP_NF_MATCH_TTL=y CONFIG_IP_NF_MATCH_TCPMSS=y CONFIG_IP_NF_MATCH_HELPER=y CONFIG_IP_NF_MATCH_STATE=y CONFIG_IP_NF_MATCH_CONNTRACK=y CONFIG_IP_NF_MATCH_OWNER=y # CONFIG_IP_NF_MATCH_ADDRTYPE is not set # CONFIG_IP_NF_MATCH_REALM is not set # CONFIG_IP_NF_MATCH_SCTP is not set # CONFIG_IP_NF_MATCH_COMMENT is not set # CONFIG_IP_NF_MATCH_HASHLIMIT is not set CONFIG_IP_NF_FILTER=y CONFIG_IP_NF_TARGET_REJECT=y CONFIG_IP_NF_TARGET_LOG=y CONFIG_IP_NF_TARGET_ULOG=y CONFIG_IP_NF_TARGET_TCPMSS=y CONFIG_IP_NF_NAT=y CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=y CONFIG_IP_NF_TARGET_REDIRECT=y CONFIG_IP_NF_TARGET_NETMAP=y CONFIG_IP_NF_TARGET_SAME=y CONFIG_IP_NF_NAT_SNMP_BASIC=y CONFIG_IP_NF_NAT_IRC=y CONFIG_IP_NF_NAT_FTP=y CONFIG_IP_NF_NAT_TFTP=y CONFIG_IP_NF_NAT_AMANDA=y CONFIG_IP_NF_MANGLE=y CONFIG_IP_NF_TARGET_TOS=y CONFIG_IP_NF_TARGET_ECN=y CONFIG_IP_NF_TARGET_DSCP=y CONFIG_IP_NF_TARGET_MARK=y CONFIG_IP_NF_TARGET_CLASSIFY=y # CONFIG_IP_NF_RAW is not set CONFIG_IP_NF_ARPTABLES=y CONFIG_IP_NF_ARPFILTER=y CONFIG_IP_NF_ARP_MANGLE=y CONFIG_XFRM=y CONFIG_XFRM_USER=y # # SCTP Configuration (EXPERIMENTAL) # # CONFIG_IP_SCTP is not set # CONFIG_ATM is not set # CONFIG_BRIDGE is not set # CONFIG_VLAN_8021Q is not set # CONFIG_DECNET is not set # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set # CONFIG_NET_CLS_ROUTE is not set # # Network testing # # CONFIG_NET_PKTGEN is not set CONFIG_NETPOLL=y # CONFIG_NETPOLL_RX is not set # CONFIG_NETPOLL_TRAP is not set CONFIG_NET_POLL_CONTROLLER=y # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set CONFIG_NETDEVICES=y CONFIG_DUMMY=y # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set # # ARCnet devices # # CONFIG_ARCNET is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_OAKNET is not set # CONFIG_HAPPYMEAL is not set CONFIG_SUNGEM=y # CONFIG_NET_VENDOR_3COM is not set # # Tulip family network device support # # CONFIG_NET_TULIP is not set # CONFIG_HP100 is not set # CONFIG_NET_PCI is not set # # Ethernet (1000 Mbit) # # CONFIG_ACENIC is not set # CONFIG_DL2K is not set # CONFIG_E1000 is not set # CONFIG_NS83820 is not set # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set # CONFIG_TIGON3 is not set # # Ethernet (10000 Mbit) # # CONFIG_IXGB is not set # CONFIG_S2IO is not set # # Token Ring devices # # CONFIG_TR is not set # # Wireless LAN (non-hamradio) # # CONFIG_NET_RADIO is not set # # Wan interfaces # # CONFIG_WAN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set # CONFIG_PPP is not set # CONFIG_SLIP is not set # CONFIG_NET_FC is not set # CONFIG_SHAPER is not set CONFIG_NETCONSOLE=y # # ISDN subsystem # # CONFIG_ISDN is not set # # Telephony Support # # CONFIG_PHONE is not set # # Input device support # CONFIG_INPUT=y # # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y CONFIG_INPUT_MOUSEDEV_PSAUX=y CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_INPUT_JOYDEV is not set # CONFIG_INPUT_TSDEV is not set # CONFIG_INPUT_EVDEV is not set # CONFIG_INPUT_EVBUG is not set # # Input I/O drivers # # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y CONFIG_SERIO=y CONFIG_SERIO_I8042=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set CONFIG_SERIO_LIBPS2=y # CONFIG_SERIO_RAW is not set # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y # CONFIG_MOUSE_SERIAL is not set # CONFIG_MOUSE_VSXXXAA is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set # CONFIG_INPUT_MISC is not set # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_NONSTANDARD is not set # # Serial drivers # CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_NR_UARTS=4 # CONFIG_SERIAL_8250_EXTENDED is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_SERIAL_PMACZILOG=y CONFIG_SERIAL_PMACZILOG_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 # # IPMI # # CONFIG_IPMI_HANDLER is not set # # Watchdog Cards # # CONFIG_WATCHDOG is not set # CONFIG_RTC is not set # CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # CONFIG_DRM=y # CONFIG_DRM_TDFX is not set # CONFIG_DRM_GAMMA is not set # CONFIG_DRM_R128 is not set CONFIG_DRM_RADEON=y # CONFIG_RAW_DRIVER is not set # # I2C support # CONFIG_I2C=y CONFIG_I2C_CHARDEV=y # # I2C Algorithms # CONFIG_I2C_ALGOBIT=y CONFIG_I2C_ALGOPCF=y CONFIG_I2C_ALGOPCA=y # # I2C Hardware Bus support # # CONFIG_I2C_ALI1535 is not set # CONFIG_I2C_ALI1563 is not set # CONFIG_I2C_ALI15X3 is not set # CONFIG_I2C_AMD756 is not set # CONFIG_I2C_AMD8111 is not set # CONFIG_I2C_I801 is not set # CONFIG_I2C_I810 is not set # CONFIG_I2C_ISA is not set CONFIG_I2C_KEYWEST=y # CONFIG_I2C_MPC is not set # CONFIG_I2C_NFORCE2 is not set # CONFIG_I2C_PARPORT_LIGHT is not set # CONFIG_I2C_PROSAVAGE is not set # CONFIG_I2C_SAVAGE4 is not set # CONFIG_SCx200_ACB is not set # CONFIG_I2C_SIS5595 is not set # CONFIG_I2C_SIS630 is not set # CONFIG_I2C_SIS96X is not set # CONFIG_I2C_STUB is not set # CONFIG_I2C_VIA is not set # CONFIG_I2C_VIAPRO is not set # CONFIG_I2C_VOODOO3 is not set # CONFIG_I2C_PCA_ISA is not set # # Hardware Sensors Chip support # # CONFIG_I2C_SENSOR is not set # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1025 is not set # CONFIG_SENSORS_ADM1026 is not set # CONFIG_SENSORS_ADM1031 is not set # CONFIG_SENSORS_ASB100 is not set # CONFIG_SENSORS_DS1621 is not set # CONFIG_SENSORS_FSCHER is not set # CONFIG_SENSORS_GL518SM is not set # CONFIG_SENSORS_IT87 is not set # CONFIG_SENSORS_LM63 is not set # CONFIG_SENSORS_LM75 is not set # CONFIG_SENSORS_LM77 is not set # CONFIG_SENSORS_LM78 is not set # CONFIG_SENSORS_LM80 is not set # CONFIG_SENSORS_LM83 is not set # CONFIG_SENSORS_LM85 is not set # CONFIG_SENSORS_LM87 is not set # CONFIG_SENSORS_LM90 is not set # CONFIG_SENSORS_MAX1619 is not set # CONFIG_SENSORS_PC87360 is not set # CONFIG_SENSORS_SMSC47B397 is not set # CONFIG_SENSORS_SMSC47M1 is not set # CONFIG_SENSORS_VIA686A is not set # CONFIG_SENSORS_W83781D is not set # CONFIG_SENSORS_W83L785TS is not set # CONFIG_SENSORS_W83627HF is not set # # Other I2C Chip support # # CONFIG_SENSORS_EEPROM is not set # CONFIG_SENSORS_PCF8574 is not set # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_RTC8564 is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set # CONFIG_I2C_DEBUG_CHIP is not set # # Dallas's 1-wire bus # # CONFIG_W1 is not set # # Misc devices # # # Multimedia devices # # CONFIG_VIDEO_DEV is not set # # Digital Video Broadcasting Devices # # CONFIG_DVB is not set # # Graphics support # CONFIG_FB=y CONFIG_FB_MODE_HELPERS=y # CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set CONFIG_FB_OF=y # CONFIG_FB_CONTROL is not set # CONFIG_FB_PLATINUM is not set # CONFIG_FB_VALKYRIE is not set # CONFIG_FB_CT65550 is not set # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set # CONFIG_FB_S3TRIO is not set # CONFIG_FB_VGA16 is not set # CONFIG_FB_RIVA is not set # CONFIG_FB_MATROX is not set # CONFIG_FB_RADEON_OLD is not set CONFIG_FB_RADEON=y CONFIG_FB_RADEON_I2C=y # CONFIG_FB_RADEON_DEBUG is not set # CONFIG_FB_ATY128 is not set # CONFIG_FB_ATY is not set # CONFIG_FB_SAVAGE is not set # CONFIG_FB_SIS is not set # CONFIG_FB_NEOMAGIC is not set # CONFIG_FB_KYRO is not set # CONFIG_FB_3DFX is not set # CONFIG_FB_VOODOO1 is not set # CONFIG_FB_TRIDENT is not set # CONFIG_FB_PM3 is not set # CONFIG_FB_VIRTUAL is not set # # Console display driver support # CONFIG_VGA_CONSOLE=y CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y # CONFIG_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y # # Logo configuration # CONFIG_LOGO=y CONFIG_LOGO_LINUX_MONO=y CONFIG_LOGO_LINUX_VGA16=y CONFIG_LOGO_LINUX_CLUT224=y # CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound # # CONFIG_SOUND is not set # # USB support # CONFIG_USB=y # CONFIG_USB_DEBUG is not set # # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_OTG is not set CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # # USB Host Controller Drivers # CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_SPLIT_ISO=y CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_OHCI_HCD=y # CONFIG_USB_UHCI_HCD is not set # CONFIG_USB_SL811_HCD is not set # # USB Device Class drivers # # CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # # CONFIG_USB_STORAGE is not set # # USB Input Devices # CONFIG_USB_HID=y CONFIG_USB_HIDINPUT=y # CONFIG_HID_FF is not set CONFIG_USB_HIDDEV=y # CONFIG_USB_AIPTEK is not set # CONFIG_USB_WACOM is not set # CONFIG_USB_KBTAB is not set # CONFIG_USB_POWERMATE is not set # CONFIG_USB_MTOUCH is not set # CONFIG_USB_EGALAX is not set # CONFIG_USB_XPAD is not set # CONFIG_USB_ATI_REMOTE is not set # # USB Imaging devices # # CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set # CONFIG_USB_HPUSBSCSI is not set # # USB Multimedia devices # # CONFIG_USB_DABUSB is not set # # Video4Linux support is needed for USB Multimedia device support # # # USB Network Adapters # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set # CONFIG_USB_PEGASUS is not set # CONFIG_USB_RTL8150 is not set # CONFIG_USB_USBNET is not set # # USB port drivers # # # USB Serial Converter support # # CONFIG_USB_SERIAL is not set # # USB Miscellaneous drivers # # CONFIG_USB_EMI62 is not set # CONFIG_USB_EMI26 is not set # CONFIG_USB_AUERSWALD is not set # CONFIG_USB_RIO500 is not set # CONFIG_USB_LEGOTOWER is not set # CONFIG_USB_LCD is not set # CONFIG_USB_LED is not set # CONFIG_USB_CYTHERM is not set # CONFIG_USB_PHIDGETKIT is not set # CONFIG_USB_PHIDGETSERVO is not set # CONFIG_USB_IDMOUSE is not set # CONFIG_USB_TEST is not set # # USB ATM/DSL drivers # # # USB Gadget Support # # CONFIG_USB_GADGET is not set # # MMC/SD Card support # # CONFIG_MMC is not set # # InfiniBand support # # CONFIG_INFINIBAND is not set # # File systems # # CONFIG_EXT2_FS is not set CONFIG_EXT3_FS=y CONFIG_EXT3_FS_XATTR=y CONFIG_EXT3_FS_POSIX_ACL=y # CONFIG_EXT3_FS_SECURITY is not set CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set CONFIG_FS_POSIX_ACL=y # # XFS support # # CONFIG_XFS_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set CONFIG_AUTOFS4_FS=y # # CD-ROM/DVD Filesystems # CONFIG_ISO9660_FS=y # CONFIG_JOLIET is not set # CONFIG_ZISOFS is not set CONFIG_UDF_FS=y CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems # # CONFIG_MSDOS_FS is not set # CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # # Pseudo filesystems # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set CONFIG_DEVPTS_FS_XATTR=y # CONFIG_DEVPTS_FS_SECURITY is not set CONFIG_TMPFS=y # CONFIG_TMPFS_XATTR is not set CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y # # Miscellaneous filesystems # # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set CONFIG_HFS_FS=y CONFIG_HFSPLUS_FS=y # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set CONFIG_CRAMFS=y # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set # # Network File Systems # CONFIG_NFS_FS=y CONFIG_NFS_V3=y CONFIG_NFS_V4=y CONFIG_NFS_DIRECTIO=y # CONFIG_NFSD is not set CONFIG_LOCKD=y CONFIG_LOCKD_V4=y CONFIG_SUNRPC=y CONFIG_SUNRPC_GSS=y CONFIG_RPCSEC_GSS_KRB5=y # CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set # # Partition Types # CONFIG_PARTITION_ADVANCED=y # CONFIG_ACORN_PARTITION is not set # CONFIG_OSF_PARTITION is not set # CONFIG_AMIGA_PARTITION is not set # CONFIG_ATARI_PARTITION is not set CONFIG_MAC_PARTITION=y CONFIG_MSDOS_PARTITION=y # CONFIG_BSD_DISKLABEL is not set # CONFIG_MINIX_SUBPARTITION is not set # CONFIG_SOLARIS_X86_PARTITION is not set # CONFIG_UNIXWARE_DISKLABEL is not set # CONFIG_LDM_PARTITION is not set # CONFIG_SGI_PARTITION is not set # CONFIG_ULTRIX_PARTITION is not set # CONFIG_SUN_PARTITION is not set # CONFIG_EFI_PARTITION is not set # # Native Language Support # CONFIG_NLS=y CONFIG_NLS_DEFAULT="iso8859-1" CONFIG_NLS_CODEPAGE_437=y # CONFIG_NLS_CODEPAGE_737 is not set # CONFIG_NLS_CODEPAGE_775 is not set # CONFIG_NLS_CODEPAGE_850 is not set # CONFIG_NLS_CODEPAGE_852 is not set # CONFIG_NLS_CODEPAGE_855 is not set # CONFIG_NLS_CODEPAGE_857 is not set # CONFIG_NLS_CODEPAGE_860 is not set # CONFIG_NLS_CODEPAGE_861 is not set # CONFIG_NLS_CODEPAGE_862 is not set # CONFIG_NLS_CODEPAGE_863 is not set # CONFIG_NLS_CODEPAGE_864 is not set # CONFIG_NLS_CODEPAGE_865 is not set # CONFIG_NLS_CODEPAGE_866 is not set # CONFIG_NLS_CODEPAGE_869 is not set # CONFIG_NLS_CODEPAGE_936 is not set # CONFIG_NLS_CODEPAGE_950 is not set # CONFIG_NLS_CODEPAGE_932 is not set # CONFIG_NLS_CODEPAGE_949 is not set # CONFIG_NLS_CODEPAGE_874 is not set # CONFIG_NLS_ISO8859_8 is not set # CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set CONFIG_NLS_ASCII=y CONFIG_NLS_ISO8859_1=y # CONFIG_NLS_ISO8859_2 is not set # CONFIG_NLS_ISO8859_3 is not set # CONFIG_NLS_ISO8859_4 is not set # CONFIG_NLS_ISO8859_5 is not set # CONFIG_NLS_ISO8859_6 is not set # CONFIG_NLS_ISO8859_7 is not set # CONFIG_NLS_ISO8859_9 is not set # CONFIG_NLS_ISO8859_13 is not set # CONFIG_NLS_ISO8859_14 is not set CONFIG_NLS_ISO8859_15=y # CONFIG_NLS_KOI8_R is not set # CONFIG_NLS_KOI8_U is not set CONFIG_NLS_UTF8=y # # Profiling support # # CONFIG_PROFILING is not set # # Kernel hacking # CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y # CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set CONFIG_DEBUG_PREEMPT=y CONFIG_DEBUG_SPINLOCK_SLEEP=y # CONFIG_DEBUG_KOBJECT is not set CONFIG_DEBUG_INFO=y # CONFIG_DEBUG_FS is not set # CONFIG_DEBUG_STACKOVERFLOW is not set # CONFIG_KPROBES is not set # CONFIG_DEBUG_STACK_USAGE is not set CONFIG_DEBUGGER=y # CONFIG_XMON is not set CONFIG_PPCDBG=y # CONFIG_IRQSTACKS is not set # # Security options # # CONFIG_KEYS is not set # CONFIG_SECURITY is not set # # Cryptographic options # CONFIG_CRYPTO=y CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_NULL=y CONFIG_CRYPTO_MD4=y CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_SHA1=y CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=y # CONFIG_CRYPTO_WP512 is not set CONFIG_CRYPTO_DES=y CONFIG_CRYPTO_BLOWFISH=y CONFIG_CRYPTO_TWOFISH=y CONFIG_CRYPTO_SERPENT=y CONFIG_CRYPTO_AES=y CONFIG_CRYPTO_CAST5=y CONFIG_CRYPTO_CAST6=y # CONFIG_CRYPTO_TEA is not set CONFIG_CRYPTO_ARC4=y # CONFIG_CRYPTO_KHAZAD is not set # CONFIG_CRYPTO_ANUBIS is not set CONFIG_CRYPTO_DEFLATE=y # CONFIG_CRYPTO_MICHAEL_MIC is not set # CONFIG_CRYPTO_CRC32C is not set CONFIG_CRYPTO_TEST=y # # Hardware crypto devices # # # Library routines # CONFIG_CRC_CCITT=y CONFIG_CRC32=y CONFIG_LIBCRC32C=y CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y From nacc at us.ibm.com Thu Mar 3 06:28:11 2005 From: nacc at us.ibm.com (Nishanth Aravamudan) Date: Wed, 2 Mar 2005 11:28:11 -0800 Subject: eeh.h compile warnings / adbhid.c build failure In-Reply-To: <20050302192005.GA21615@pants.nu> References: <20050302181206.GA2741@us.ibm.com> <20050302192005.GA21615@pants.nu> Message-ID: <20050302192811.GD2741@us.ibm.com> On Wed, Mar 02, 2005 at 11:20:06AM -0800, Brad Boyer wrote: > On Wed, Mar 02, 2005 at 10:12:06AM -0800, Nishanth Aravamudan wrote: > > Now, to the build-blocking code: > > > > In drivers/macintosh/adbhid.c::1159: > > > > static int __init adbhid_init(void) > > { > > #ifndef CONFIG_MAC > > if ( (_machine != _MACH_chrp) && (_machine != _MACH_Pmac) ) > > return 0; > > #endif > > ... > > > > I don't see CONFIG_MAC in my .config (attached below [1]), and _MACH_chrp is > > not defined for ppc64 (it's in asm-ppc/processor.h not in > > ppc64/processor.h. I just removed the _MACH_chrp conditional in my local > > code to get the kernel to build. I'm not sure what the actual solution > > is, but I thought you all should know about it. > > The CONFIG_MAC symbol is defined for mac68k support. The m68k arch has a > different way of telling the various machines apart, although I notice > that there isn't an equivalent block here for that. I guess no other 68k > people cared enough to make sure the ADB layer doesn't load on their boxes. > > In my opinion, the machine selectors should be reconciled between ppc and > ppc64 due to the amount of code that expects them to act the same. So > even though you wouldn't have a CHRP ppc64 box, the define will be there. I definitely think this is the ideal solution. I did notice, though, that hte _MACH_Pmac #define varies between ppc and ppc64, so I'm not sure how that would work for _MACH_chrp. I am more than happy to test code, generate patches (if you tell me what you'd like me to change), etc. Thanks, Nish From flar at allandria.com Thu Mar 3 06:20:06 2005 From: flar at allandria.com (Brad Boyer) Date: Wed, 2 Mar 2005 11:20:06 -0800 Subject: eeh.h compile warnings / adbhid.c build failure In-Reply-To: <20050302181206.GA2741@us.ibm.com> References: <20050302181206.GA2741@us.ibm.com> Message-ID: <20050302192005.GA21615@pants.nu> On Wed, Mar 02, 2005 at 10:12:06AM -0800, Nishanth Aravamudan wrote: > Now, to the build-blocking code: > > In drivers/macintosh/adbhid.c::1159: > > static int __init adbhid_init(void) > { > #ifndef CONFIG_MAC > if ( (_machine != _MACH_chrp) && (_machine != _MACH_Pmac) ) > return 0; > #endif > ... > > I don't see CONFIG_MAC in my .config (attached below [1]), and _MACH_chrp is > not defined for ppc64 (it's in asm-ppc/processor.h not in > ppc64/processor.h. I just removed the _MACH_chrp conditional in my local > code to get the kernel to build. I'm not sure what the actual solution > is, but I thought you all should know about it. The CONFIG_MAC symbol is defined for mac68k support. The m68k arch has a different way of telling the various machines apart, although I notice that there isn't an equivalent block here for that. I guess no other 68k people cared enough to make sure the ADB layer doesn't load on their boxes. In my opinion, the machine selectors should be reconciled between ppc and ppc64 due to the amount of code that expects them to act the same. So even though you wouldn't have a CHRP ppc64 box, the define will be there. Brad Boyer flar at allandria.com From johnrose at austin.ibm.com Thu Mar 3 08:10:37 2005 From: johnrose at austin.ibm.com (John Rose) Date: Wed, 02 Mar 2005 15:10:37 -0600 Subject: [PATCH] error code cleanups for rtas wrappers Message-ID: <1109797837.9434.2.camel@sinatra.austin.ibm.com> This patch changes the rtas wrapper functions in rtas.c to map RTAS failures to conventional error values. The goal is to make failure conditions obvious in the wrapper functions and in the caller code. Flame away :) John Signed-off-by: John Rose diff -puN arch/ppc64/kernel/pSeries_smp.c~01_rtas_rcs arch/ppc64/kernel/pSeries_smp.c --- 2_6_linus_3/arch/ppc64/kernel/pSeries_smp.c~01_rtas_rcs 2005-03-02 14:50:33.000000000 -0600 +++ 2_6_linus_3-johnrose/arch/ppc64/kernel/pSeries_smp.c 2005-03-02 14:50:33.000000000 -0600 @@ -151,7 +151,7 @@ static unsigned int find_physical_cpu_to if (index) { int state; int rc = rtas_get_sensor(9003, *index, &state); - if (rc != 0 || state != 1) + if (rc < 0 || state != 1) continue; } diff -puN arch/ppc64/kernel/rtas.c~01_rtas_rcs arch/ppc64/kernel/rtas.c --- 2_6_linus_3/arch/ppc64/kernel/rtas.c~01_rtas_rcs 2005-03-02 14:50:33.000000000 -0600 +++ 2_6_linus_3-johnrose/arch/ppc64/kernel/rtas.c 2005-03-02 14:50:33.000000000 -0600 @@ -255,29 +255,59 @@ rtas_extended_busy_delay_time(int status return ms; } -int -rtas_get_power_level(int powerdomain, int *level) +int rtas_error_rc(int rtas_rc) +{ + int rc; + + switch (rtas_rc) { + case -1: /* Hardware Error */ + rc = -EIO; + break; + case -3: /* Bad indicator/domain/etc */ + rc = -EINVAL; + break; + case -9000: /* Isolation error */ + rc = -EFAULT; + break; + case -9001: /* Outstanding TCE/PTE */ + rc = -EEXIST; + break; + case -9002: /* No usable slot */ + rc = -ENODEV; + break; + default: + printk(KERN_ERR "%s: unexpected RTAS error %d\n", + __FUNCTION__, rtas_rc); + rc = -ERANGE; + break; + } + return rc; +} + +int rtas_get_power_level(int powerdomain, int *level) { int token = rtas_token("get-power-level"); int rc; if (token == RTAS_UNKNOWN_SERVICE) - return RTAS_UNKNOWN_OP; + return -ENOENT; while ((rc = rtas_call(token, 1, 2, level, powerdomain)) == RTAS_BUSY) udelay(1); + + if (rc < 0) + return rtas_error_rc(rc); return rc; } -int -rtas_set_power_level(int powerdomain, int level, int *setlevel) +int rtas_set_power_level(int powerdomain, int level, int *setlevel) { int token = rtas_token("set-power-level"); unsigned int wait_time; int rc; if (token == RTAS_UNKNOWN_SERVICE) - return RTAS_UNKNOWN_OP; + return -ENOENT; while (1) { rc = rtas_call(token, 2, 2, setlevel, powerdomain, level); @@ -289,18 +319,20 @@ rtas_set_power_level(int powerdomain, in } else break; } + + if (rc < 0) + return rtas_error_rc(rc); return rc; } -int -rtas_get_sensor(int sensor, int index, int *state) +int rtas_get_sensor(int sensor, int index, int *state) { int token = rtas_token("get-sensor-state"); unsigned int wait_time; int rc; if (token == RTAS_UNKNOWN_SERVICE) - return RTAS_UNKNOWN_OP; + return -ENOENT; while (1) { rc = rtas_call(token, 2, 2, state, sensor, index); @@ -312,18 +344,20 @@ rtas_get_sensor(int sensor, int index, i } else break; } + + if (rc < 0) + return rtas_error_rc(rc); return rc; } -int -rtas_set_indicator(int indicator, int index, int new_value) +int rtas_set_indicator(int indicator, int index, int new_value) { int token = rtas_token("set-indicator"); unsigned int wait_time; int rc; if (token == RTAS_UNKNOWN_SERVICE) - return RTAS_UNKNOWN_OP; + return -ENOENT; while (1) { rc = rtas_call(token, 3, 1, NULL, indicator, index, new_value); @@ -337,6 +371,8 @@ rtas_set_indicator(int indicator, int in break; } + if (rc < 0) + return rtas_error_rc(rc); return rc; } diff -puN arch/ppc64/kernel/rtasd.c~01_rtas_rcs arch/ppc64/kernel/rtasd.c --- 2_6_linus_3/arch/ppc64/kernel/rtasd.c~01_rtas_rcs 2005-03-02 14:50:33.000000000 -0600 +++ 2_6_linus_3-johnrose/arch/ppc64/kernel/rtasd.c 2005-03-02 14:50:33.000000000 -0600 @@ -347,7 +347,7 @@ static int enable_surveillance(int timeo if (error == 0) return 0; - if (error == RTAS_NO_SUCH_INDICATOR) { + if (error == -EINVAL) { printk(KERN_INFO "rtasd: surveillance not supported\n"); return 0; } diff -puN arch/ppc64/kernel/xics.c~01_rtas_rcs arch/ppc64/kernel/xics.c --- 2_6_linus_3/arch/ppc64/kernel/xics.c~01_rtas_rcs 2005-03-02 14:50:33.000000000 -0600 +++ 2_6_linus_3-johnrose/arch/ppc64/kernel/xics.c 2005-03-02 14:50:33.000000000 -0600 @@ -654,7 +654,7 @@ void xics_migrate_irqs_away(void) /* remove ourselves from the global interrupt queue */ status = rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, (1UL << interrupt_server_size) - 1 - default_distrib_server, 0); - WARN_ON(status != 0); + WARN_ON(status < 0); /* Allow IPIs again... */ ops->cppr_info(cpu, DEFAULT_PRIORITY); diff -puN include/asm-ppc64/rtas.h~01_rtas_rcs include/asm-ppc64/rtas.h --- 2_6_linus_3/include/asm-ppc64/rtas.h~01_rtas_rcs 2005-03-02 14:50:33.000000000 -0600 +++ 2_6_linus_3-johnrose/include/asm-ppc64/rtas.h 2005-03-02 14:50:33.000000000 -0600 @@ -24,12 +24,9 @@ /* RTAS return status codes */ #define RTAS_BUSY -2 /* RTAS Busy */ -#define RTAS_NO_SUCH_INDICATOR -3 /* No such indicator implemented */ #define RTAS_EXTENDED_DELAY_MIN 9900 #define RTAS_EXTENDED_DELAY_MAX 9905 -#define RTAS_UNKNOWN_OP -1099 /* Unknown RTAS Token */ - /* * In general to call RTAS use rtas_token("string") to lookup * an RTAS token for the given string (e.g. "event-scan"). _ From moilanen at austin.ibm.com Thu Mar 3 09:34:12 2005 From: moilanen at austin.ibm.com (Jake Moilanen) Date: Wed, 2 Mar 2005 16:34:12 -0600 Subject: [PATCH][RFC] unlikely spinlocks Message-ID: <20050302163412.0fa52c4b.moilanen@austin.ibm.com> On our raw spinlocks, we currently have an attempt at the lock, and if we do not get it we enter a spin loop. This spinloop will likely continue for awhile, and we pridict likely. Shouldn't we predict that we will get out of the loop so our next instructions are already prefetched. Even when we miss because the lock is still held, it won't matter since we are waiting anyways. I did a couple quick benchmarks, but the results are inconclusive. 16-way 690 running specjbb with original code # ./specjbb 3000 16 1 1 19 30 120 ... Valid run, Score is 59282 16-way 690 running specjbb with unlikely code # ./specjbb 3000 16 1 1 19 30 120 ... Valid run, Score is 59541 I saw a smaller increase on a JS20 (~1.6%) JS20 specjbb w/ original code # ./specjbb 400 2 1 1 19 30 120 ... Valid run, Score is 20460 JS20 specjbb w/ unlikely code # ./specjbb 400 2 1 1 19 30 120 ... Valid run, Score is 20803 Jake Signed-off-by: Jake Moilanen --- diff -puN include/asm-ppc64/spinlock.h~unlikely-spinlocks include/asm-ppc64/spinlock.h --- linux-2.6-bk/include/asm-ppc64/spinlock.h~unlikely-spinlocks Wed Mar 2 13:55:39 2005 +++ linux-2.6-bk-moilanen/include/asm-ppc64/spinlock.h Wed Mar 2 13:55:40 2005 @@ -110,7 +110,7 @@ static void __inline__ _raw_spin_lock(sp HMT_low(); if (SHARED_PROCESSOR) __spin_yield(lock); - } while (likely(lock->lock != 0)); + } while (unlikely(lock->lock != 0)); HMT_medium(); } } @@ -128,7 +128,7 @@ static void __inline__ _raw_spin_lock_fl HMT_low(); if (SHARED_PROCESSOR) __spin_yield(lock); - } while (likely(lock->lock != 0)); + } while (unlikely(lock->lock != 0)); HMT_medium(); local_irq_restore(flags_dis); } @@ -194,7 +194,7 @@ static void __inline__ _raw_read_lock(rw HMT_low(); if (SHARED_PROCESSOR) __rw_yield(rw); - } while (likely(rw->lock < 0)); + } while (unlikely(rw->lock < 0)); HMT_medium(); } } @@ -251,7 +251,7 @@ static void __inline__ _raw_write_lock(r HMT_low(); if (SHARED_PROCESSOR) __rw_yield(rw); - } while (likely(rw->lock != 0)); + } while (unlikely(rw->lock != 0)); HMT_medium(); } } _ From benh at kernel.crashing.org Thu Mar 3 10:39:16 2005 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 03 Mar 2005 10:39:16 +1100 Subject: eeh.h compile warnings / adbhid.c build failure In-Reply-To: <20050302181206.GA2741@us.ibm.com> References: <20050302181206.GA2741@us.ibm.com> Message-ID: <1109806756.5680.127.camel@gaston> On Wed, 2005-03-02 at 10:12 -0800, Nishanth Aravamudan wrote: > > These warnings are emitted for pretty much every driver. It looks like > it is becuase with CONFIG_EEH undefined (it's a pSeries thing? -- my > interpretation from looking at the ppc64 Kconfig), eeh_check_failure() > becomes #define'd to simply it's second parameter, which in the case of > assignment statements ia statement with no effect. It's not a big deal, > the kernels still compile (with a patch to adbhid.c which I'll mention > in a second) but it's a lot of noise to be generated because I don't > have a pSeries machine... Stupid gcc :) > Now, to the build-blocking code: > > In drivers/macintosh/adbhid.c::1159: > > static int __init adbhid_init(void) > { > #ifndef CONFIG_MAC > if ( (_machine != _MACH_chrp) && (_machine != _MACH_Pmac) ) > return 0; > #endif > ... > > I don't see CONFIG_MAC in my .config (attached below [1]), and _MACH_chrp is > not defined for ppc64 (it's in asm-ppc/processor.h not in > ppc64/processor.h. I just removed the _MACH_chrp conditional in my local > code to get the kernel to build. I'm not sure what the actual solution > is, but I thought you all should know about it. There is no ADB bus on a G5, so the driver isn't useful anyway. Currently, ppc64 allows you to enable pmac drivers that won't build, but they also are useless on G5s. I'll fix that over time though. Ben. From nacc at us.ibm.com Thu Mar 3 11:23:08 2005 From: nacc at us.ibm.com (Nishanth Aravamudan) Date: Wed, 2 Mar 2005 16:23:08 -0800 Subject: eeh.h compile warnings / adbhid.c build failure In-Reply-To: <1109806756.5680.127.camel@gaston> References: <20050302181206.GA2741@us.ibm.com> <1109806756.5680.127.camel@gaston> Message-ID: <20050303002308.GO2741@us.ibm.com> On Thu, Mar 03, 2005 at 10:39:16AM +1100, Benjamin Herrenschmidt wrote: > On Wed, 2005-03-02 at 10:12 -0800, Nishanth Aravamudan wrote: > > > > These warnings are emitted for pretty much every driver. It looks like > > it is becuase with CONFIG_EEH undefined (it's a pSeries thing? -- my > > interpretation from looking at the ppc64 Kconfig), eeh_check_failure() > > becomes #define'd to simply it's second parameter, which in the case of > > assignment statements ia statement with no effect. It's not a big deal, > > the kernels still compile (with a patch to adbhid.c which I'll mention > > in a second) but it's a lot of noise to be generated because I don't > > have a pSeries machine... > > Stupid gcc :) > > > Now, to the build-blocking code: > > > > In drivers/macintosh/adbhid.c::1159: > > > > static int __init adbhid_init(void) > > { > > #ifndef CONFIG_MAC > > if ( (_machine != _MACH_chrp) && (_machine != _MACH_Pmac) ) > > return 0; > > #endif > > ... > > > > I don't see CONFIG_MAC in my .config (attached below [1]), and _MACH_chrp is > > not defined for ppc64 (it's in asm-ppc/processor.h not in > > ppc64/processor.h. I just removed the _MACH_chrp conditional in my local > > code to get the kernel to build. I'm not sure what the actual solution > > is, but I thought you all should know about it. > > There is no ADB bus on a G5, so the driver isn't useful anyway. > Currently, ppc64 allows you to enable pmac drivers that won't build, but > they also are useless on G5s. I'll fix that over time though. Ok, I'll take it out of the config. Thanks! -Nish From jschopp at austin.ibm.com Thu Mar 3 11:55:47 2005 From: jschopp at austin.ibm.com (Joel Schopp) Date: Wed, 02 Mar 2005 18:55:47 -0600 Subject: [PATCH][RFC] unlikely spinlocks In-Reply-To: <20050302163412.0fa52c4b.moilanen@austin.ibm.com> References: <20050302163412.0fa52c4b.moilanen@austin.ibm.com> Message-ID: <42266093.5080101@austin.ibm.com> Jake Moilanen wrote: > On our raw spinlocks, we currently have an attempt at the lock, and if > we do not get it we enter a spin loop. This spinloop will likely > continue for awhile, and we pridict likely. > > Shouldn't we predict that we will get out of the loop so our next > instructions are already prefetched. Even when we miss because the lock > is still held, it won't matter since we are waiting anyways. I agree with you in principle. It would be nice to have some better supporting measurements as well though. > > I did a couple quick benchmarks, but the results are inconclusive. > > 16-way 690 running specjbb with original code > # ./specjbb 3000 16 1 1 19 30 120 > ... > Valid run, Score is 59282 > > 16-way 690 running specjbb with unlikely code > # ./specjbb 3000 16 1 1 19 30 120 > ... > Valid run, Score is 59541 > > I saw a smaller increase on a JS20 (~1.6%) Percentage wise the 690 increase was smaller > > JS20 specjbb w/ original code > # ./specjbb 400 2 1 1 19 30 120 > ... > Valid run, Score is 20460 > > > JS20 specjbb w/ unlikely code > # ./specjbb 400 2 1 1 19 30 120 > ... > Valid run, Score is 20803 > > Jake My guess is there is some variance in specjbb runs. The variance might be greater than the amount of improvement. It is still possible to use statistics to show the amount of the increase. If you could get me the results of say 12 runs on each kernel I could do the analysis for you. On a side note. Do you have the assembly generated by _raw_spin_lock() and brethren? They always get inlined so I doubt a simple objdump would do it. I'm curious how good the compiler is at optimizing away things. From xma at us.ibm.com Thu Mar 3 12:58:58 2005 From: xma at us.ibm.com (Shirley Ma) Date: Thu, 3 Mar 2005 01:58:58 +0000 Subject: PCI: Unable to reserve mem region Message-ID: When I loaded Mellanox device driver on P615, I hit below problem: Mar 2 14:31:39 elm3b5 kernel: ib_mthca: Initializing (0000:62:00.0) Mar 2 14:31:39 elm3b5 kernel: PCI: Enabling device: (0000:62:00.0), cmd 142 Mar 2 14:31:39 elm3b5 kernel: PCI: Unable to reserve mem region #5:8000000 at 3fcc 0000000 for device 0000:62:00.0 Mar 2 14:31:39 elm3b5 kernel: ib_mthca 0000:62:00.0: Cannot obtain PCI resource s, aborting. Mar 2 14:31:39 elm3b5 kernel: ib_mchca: probe of 0000:62:00.0 failed with error -16 Anybody has any idea to fix this problem? Thanks Shirley Ma IBM Linux Technology Center 15300 SW Koll Parkway Beaverton, OR 97006-6063 Phone(Fax): (503) 578-7638 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20050303/96bbec81/attachment.htm From ntl at pobox.com Thu Mar 3 14:37:57 2005 From: ntl at pobox.com (Nathan Lynch) Date: Wed, 2 Mar 2005 21:37:57 -0600 Subject: [PATCH] fix eeh.h compile warnings In-Reply-To: <20050302181206.GA2741@us.ibm.com> References: <20050302181206.GA2741@us.ibm.com> Message-ID: <20050303033757.GD5897@otto> On Wed, Mar 02, 2005 at 07:41:13PM -0600, Nishanth Aravamudan wrote: > > While building 2.6.11 for a G5, I noticed the following errors being > spit out (gcc 3.3.5): > > include/asm/eeh.h: In function `eeh_memcpy_fromio': > include/asm/eeh.h:265: warning: statement with no effect > include/asm/eeh.h: In function `eeh_insb': > include/asm/eeh.h:353: warning: statement with no effect > include/asm/eeh.h: In function `eeh_insw_ns': > include/asm/eeh.h:360: warning: statement with no effect > include/asm/eeh.h: In function `eeh_insl_ns': > include/asm/eeh.h:367: warning: statement with no effect > include/asm/eeh.h: In function `eeh_memcpy_fromio': > include/asm/eeh.h:265: warning: statement with no effect > include/asm/eeh.h: In function `eeh_insb': > include/asm/eeh.h:353: warning: statement with no effect > include/asm/eeh.h: In function `eeh_insw_ns': > include/asm/eeh.h:360: warning: statement with no effect > include/asm/eeh.h: In function `eeh_insl_ns': > include/asm/eeh.h:367: warning: statement with no effect > > These warnings are emitted for pretty much every driver. It looks like > it is becuase with CONFIG_EEH undefined (it's a pSeries thing? -- my > interpretation from looking at the ppc64 Kconfig), eeh_check_failure() > becomes #define'd to simply it's second parameter, which in the case of > assignment statements ia statement with no effect I don't have a toolchain readily available which gives these warnings, but does this fix them? Use static inlines instead of #defines for stub functions when CONFIG_EEH=n. Signed-off-by: Nathan Lynch Index: linux-2.6.11/include/asm-ppc64/eeh.h =================================================================== --- linux-2.6.11.orig/include/asm-ppc64/eeh.h 2005-03-02 07:38:38.000000000 +0000 +++ linux-2.6.11/include/asm-ppc64/eeh.h 2005-03-03 01:39:25.000000000 +0000 @@ -104,17 +104,30 @@ int eeh_unregister_notifier(struct notif */ #define EEH_IO_ERROR_VALUE(size) (~0U >> ((4 - (size)) * 8)) -#else -#define eeh_init() -#define eeh_check_failure(token, val) (val) -#define eeh_dn_check_failure(dn, dev) (0) -#define pci_addr_cache_build() -#define eeh_add_device_early(dn) -#define eeh_add_device_late(dev) -#define eeh_remove_device(dev) +#else /* !CONFIG_EEH */ +static inline void eeh_init(void) { } + +static inline unsigned long eeh_check_failure(const volatile void __iomem *token, unsigned long val) +{ + return val; +} + +static inline int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev) +{ + return 0; +} + +static inline void pci_addr_cache_build(void) { } + +static inline void eeh_add_device_early(struct device_node *dn) { } + +static inline void eeh_add_device_late(struct pci_dev *dev) { } + +static inline void eeh_remove_device(struct pci_dev *dev) { } + #define EEH_POSSIBLE_ERROR(val, type) (0) #define EEH_IO_ERROR_VALUE(size) (-1UL) -#endif +#endif /* CONFIG_EEH */ /* * MMIO read/write operations with EEH support. From apw at us.ibm.com Thu Mar 3 11:59:48 2005 From: apw at us.ibm.com (Amos Waterland) Date: Wed, 2 Mar 2005 19:59:48 -0500 Subject: [patch] init_boot_display link error Message-ID: <20050303005948.GA691@kvasir.austin.ibm.com> In pmac_setup.c, the function init_boot_display as currently written only makes sense with CONFIG_BOOTX_TEXT enabled, and causes a link error if it is not enabled. Signed-off-by: Amos Waterland ===== arch/ppc64/kernel/pmac_setup.c 1.15 vs edited ===== --- 1.15/arch/ppc64/kernel/pmac_setup.c 2005-01-08 00:43:52 -05:00 +++ edited/arch/ppc64/kernel/pmac_setup.c 2005-03-02 19:37:31 -05:00 @@ -244,7 +244,6 @@ { btext_drawchar(c); } -#endif /* CONFIG_BOOTX_TEXT */ static void __init init_boot_display(void) { @@ -280,6 +279,7 @@ return; } } +#endif /* CONFIG_BOOTX_TEXT */ /* * Early initialization. From benh at kernel.crashing.org Thu Mar 3 16:08:14 2005 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 03 Mar 2005 16:08:14 +1100 Subject: PCI: Unable to reserve mem region In-Reply-To: References: Message-ID: <1109826494.5679.174.camel@gaston> On Thu, 2005-03-03 at 01:58 +0000, Shirley Ma wrote: > > When I loaded Mellanox device driver on P615, I hit below problem: > > Mar 2 14:31:39 elm3b5 kernel: ib_mthca: Initializing (0000:62:00.0) > Mar 2 14:31:39 elm3b5 kernel: PCI: Enabling device: (0000:62:00.0), > cmd 142 > Mar 2 14:31:39 elm3b5 kernel: PCI: Unable to reserve mem region > #5:8000000 at 3fcc > 0000000 for device 0000:62:00.0 > Mar 2 14:31:39 elm3b5 kernel: ib_mthca 0000:62:00.0: Cannot obtain > PCI resource > s, aborting. > Mar 2 14:31:39 elm3b5 kernel: ib_mchca: probe of 0000:62:00.0 failed > with error > -16 Is it possible to have remote access to the machine & HMC ? Ben. From xma at us.ibm.com Thu Mar 3 17:24:54 2005 From: xma at us.ibm.com (Shirley Ma) Date: Wed, 2 Mar 2005 22:24:54 -0800 Subject: PCI: Unable to reserve mem region In-Reply-To: <1109826494.5679.174.camel@gaston> Message-ID: > Is it possible to have remote access to the machine & HMC ? Sorry. It can't be reachable. If you have any suggestion to debug this problem, I can try it out. I installed 2.6.10 kernel with openib.org Gen2 mthca driver. This driver works OK on both ia64 and ia32. Thanks Shirley Ma IBM Linux Technology Center 15300 SW Koll Parkway Beaverton, OR 97006-6063 Phone(Fax): (503) 578-7638 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20050302/006f38f1/attachment.htm From benh at kernel.crashing.org Thu Mar 3 17:24:33 2005 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 03 Mar 2005 17:24:33 +1100 Subject: PCI: Unable to reserve mem region In-Reply-To: References: Message-ID: <1109831073.5610.185.camel@gaston> On Wed, 2005-03-02 at 22:24 -0800, Shirley Ma wrote: > > Is it possible to have remote access to the machine & HMC ? > Sorry. It can't be reachable. > If you have any suggestion to debug this problem, I can try it out. I > installed 2.6.10 kernel with openib.org Gen2 mthca driver. This driver > works OK on both ia64 and ia32. The problem is a core kernel PCI allocation issue it seems, it will require quite a bit of debugging to figure out what's wrong I'm afraid... Ben. From anton at samba.org Thu Mar 3 17:20:05 2005 From: anton at samba.org (Anton Blanchard) Date: Thu, 3 Mar 2005 17:20:05 +1100 Subject: PCI: Unable to reserve mem region In-Reply-To: References: <1109826494.5679.174.camel@gaston> Message-ID: <20050303062005.GA16915@krispykreme.ozlabs.ibm.com> > Sorry. It can't be reachable. > If you have any suggestion to debug this problem, I can try it out. I > installed 2.6.10 kernel with openib.org Gen2 mthca driver. This driver > works OK on both ia64 and ia32. How big is the PCI MMIO window on this card? lspci -v should give us this information. Anton From sonny at burdell.org Thu Mar 3 18:02:22 2005 From: sonny at burdell.org (Sonny Rao) Date: Thu, 3 Mar 2005 02:02:22 -0500 Subject: [PATCH][RFC] unlikely spinlocks In-Reply-To: <20050302163412.0fa52c4b.moilanen@austin.ibm.com> References: <20050302163412.0fa52c4b.moilanen@austin.ibm.com> Message-ID: <20050303070222.GA26059@kevlar.burdell.org> On Wed, Mar 02, 2005 at 04:34:12PM -0600, Jake Moilanen wrote: > On our raw spinlocks, we currently have an attempt at the lock, and if > we do not get it we enter a spin loop. This spinloop will likely > continue for awhile, and we pridict likely. > > Shouldn't we predict that we will get out of the loop so our next > instructions are already prefetched. Even when we miss because the lock > is still held, it won't matter since we are waiting anyways. > > I did a couple quick benchmarks, but the results are inconclusive. > > 16-way 690 running specjbb with original code > # ./specjbb 3000 16 1 1 19 30 120 > ... > Valid run, Score is 59282 > > 16-way 690 running specjbb with unlikely code > # ./specjbb 3000 16 1 1 19 30 120 > ... > Valid run, Score is 59541 > > I saw a smaller increase on a JS20 (~1.6%) > > JS20 specjbb w/ original code > # ./specjbb 400 2 1 1 19 30 120 > ... > Valid run, Score is 20460 > > > JS20 specjbb w/ unlikely code > # ./specjbb 400 2 1 1 19 30 120 > ... > Valid run, Score is 20803 Hmm, I doubt you want to use specjbb to show spin-lock contention. Unless I'm missing something, jbb scales really well in terms of the kernel, most of the benchmark runs in userspace and the JVM's own locking strategies probably have a bigger impact on performance than the kernel's _raw_spin_lock() implementation. I should probably have Java Perf. guys get oprofile data for jbb to confirm this conclusively. If you use FFSB with enough threads doing lots of file-descriptor activity, you'll see tons of lock contention on the fget_light function. This is a pretty well known scalability problem, and I've been able to drive my 16-way LPAR to > 40% spin_lock time doing things like this with FFSB and tons of threads. Sonny From moilanen at austin.ibm.com Fri Mar 4 06:40:34 2005 From: moilanen at austin.ibm.com (Jake Moilanen) Date: Thu, 3 Mar 2005 13:40:34 -0600 Subject: [PATCH] PCI address getting truncated to 32-bits Message-ID: <20050303134034.779c79e0.moilanen@austin.ibm.com> While looking at another problem, I ran across this. It looks like we are truncated our pci addresses coming out of "assigned-addresses" to 32-bits. Signed-off-by: Jake Moilanen -- diff -puN arch/ppc64/kernel/prom.c~offb_dsi arch/ppc64/kernel/prom.c --- linux-2.6.11/arch/ppc64/kernel/prom.c~offb_dsi Thu Mar 3 10:23:22 2005 +++ linux-2.6.11-moilanen/arch/ppc64/kernel/prom.c Thu Mar 3 13:25:54 2005 @@ -333,7 +333,7 @@ static unsigned long __init interpret_pc while ((l -= sizeof(struct pci_reg_property)) >= 0) { if (!measure_only) { adr[i].space = pci_addrs[i].addr.a_hi; - adr[i].address = pci_addrs[i].addr.a_lo; + adr[i].address = ((unsigned long)pci_addrs[i].addr.a_mid << 32) | pci_addrs[i].addr.a_lo; adr[i].size = pci_addrs[i].size_lo; } ++i; From markus at unixforces.net Fri Mar 4 06:54:32 2005 From: markus at unixforces.net (Markus Rothe) Date: Thu, 3 Mar 2005 19:54:32 +0000 Subject: Display problems with kernel > 2.6.9 Message-ID: <20050303195432.GA9010@unixforces.net> Hi, I have a problem with my Apple Cinema Display, if I use kernel versions above 2.6.9. The display is connected through the Apple Display Connector (ADC) to my G5 and it's ATI Radeon 9600 graphics card. The problem is that there are many "blue lightnings" all over the display. With blue lightning I mean a small set of pixels which turn into light blue for about half a second. This happens both in console mode and if I run Xorg. I've taken tree screenshots available at [1], [2] and [3]. The screenshots have been taken while runnig kernel-2.6.11, but this problem occured with all kernels after 2.6.9. Markus [1] http://www.unixforces.net/downloads/blue_lightning_1.png (~1.9 MB) [2] http://www.unixforces.net/downloads/blue_lightning_2.png (~2.0 MB) [3] http://www.unixforces.net/downloads/blue_lightning_3.png (~1.9 MB) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20050303/f8d2ebd3/attachment.pgp From moilanen at austin.ibm.com Fri Mar 4 09:02:08 2005 From: moilanen at austin.ibm.com (Jake Moilanen) Date: Thu, 3 Mar 2005 16:02:08 -0600 Subject: [PATCH] PCI address getting truncated to 32-bits In-Reply-To: <20050303134034.779c79e0.moilanen@austin.ibm.com> References: <20050303134034.779c79e0.moilanen@austin.ibm.com> Message-ID: <20050303160208.242e29a9.moilanen@austin.ibm.com> On Thu, 3 Mar 2005 13:40:34 -0600 Jake Moilanen wrote: > While looking at another problem, I ran across this. It looks like we > are truncated our pci addresses coming out of "assigned-addresses" to > 32-bits. Probably need it for of_finish_dynamic_node() too. Signed-off-by: Jake Moilanen --- diff -puN arch/ppc64/kernel/prom.c~offb_dsi arch/ppc64/kernel/prom.c --- linux-2.6.11/arch/ppc64/kernel/prom.c~offb_dsi Thu Mar 3 10:23:22 2005 +++ linux-2.6.11-moilanen/arch/ppc64/kernel/prom.c Thu Mar 3 16:09:02 2005 @@ -333,7 +333,8 @@ static unsigned long __init interpret_pc while ((l -= sizeof(struct pci_reg_property)) >= 0) { if (!measure_only) { adr[i].space = pci_addrs[i].addr.a_hi; - adr[i].address = pci_addrs[i].addr.a_lo; + adr[i].address = ((unsigned long)pci_addrs[i].addr.a_mid << 32) + | pci_addrs[i].addr.a_lo; adr[i].size = pci_addrs[i].size_lo; } ++i; @@ -1712,7 +1713,8 @@ static int of_finish_dynamic_node(struct } while ((l -= sizeof(struct pci_reg_property)) >= 0) { adr[i].space = pci_addrs[i].addr.a_hi; - adr[i].address = pci_addrs[i].addr.a_lo; + adr[i].address = ((unsigned long)pci_addrs[i].addr.a_mid << 32) + | pci_addrs[i].addr.a_lo; adr[i].size = pci_addrs[i].size_lo; ++i; } From paulus at samba.org Fri Mar 4 20:18:39 2005 From: paulus at samba.org (Paul Mackerras) Date: Fri, 4 Mar 2005 20:18:39 +1100 Subject: RFC/Patch more xmon additions In-Reply-To: <421E3BE3.90301@vnet.ibm.com> References: <421E3BE3.90301@vnet.ibm.com> Message-ID: <16936.10223.704710.234312@cargo.ozlabs.ibm.com> will schmidt writes: > Am looking for comments on this additional function i've added to xmon > on the side.. > > the bulk of my intent was to make it easier for me to poke at memory > within a particular user process. The main problem I have with it is that we seem to be accessing a lot of kernel data structures without checking any pointers or using mread() to read the memory safely. One of the goals of xmon is that it should be as reliable as possible even if kernel data structures are corrupted, and I think your patch would reduce that reliability. Also, I'm not sure that there is any point doing a spin_trylock(), since all cpus are supposed to be in xmon by the time you get to a command prompt. By all means bail out if spin_is_locked() returns true, but I don't see the need to actually take the lock. Regards, Paul. From linas at austin.ibm.com Sat Mar 5 03:42:36 2005 From: linas at austin.ibm.com (Linas Vepstas) Date: Fri, 4 Mar 2005 10:42:36 -0600 Subject: [PATCH] fix eeh.h compile warnings In-Reply-To: <20050303033757.GD5897@otto> References: <20050302181206.GA2741@us.ibm.com> <20050303033757.GD5897@otto> Message-ID: <20050304164236.GT1220@austin.ibm.com> On Wed, Mar 02, 2005 at 09:37:57PM -0600, Nathan Lynch was heard to remark: > > I don't have a toolchain readily available which gives these warnings, > but does this fix them? I think it should > Use static inlines instead of #defines for stub functions when > CONFIG_EEH=n. Its more elegant your way anyway ... > Signed-off-by: Nathan Lynch From olof at austin.ibm.com Sat Mar 5 03:57:17 2005 From: olof at austin.ibm.com (Olof Johansson) Date: Fri, 4 Mar 2005 10:57:17 -0600 Subject: [PATCH] fix eeh.h compile warnings In-Reply-To: <20050303033757.GD5897@otto> References: <20050302181206.GA2741@us.ibm.com> <20050303033757.GD5897@otto> Message-ID: <20050304165717.GA5789@austin.ibm.com> On Wed, Mar 02, 2005 at 09:37:57PM -0600, Nathan Lynch wrote: > I don't have a toolchain readily available which gives these warnings, > but does this fix them? Yep, it does here. > Use static inlines instead of #defines for stub functions when > CONFIG_EEH=n. > > Signed-off-by: Nathan Lynch Acked-by: Olof Johansson From nacc at us.ibm.com Sat Mar 5 05:13:32 2005 From: nacc at us.ibm.com (Nishanth Aravamudan) Date: Fri, 4 Mar 2005 10:13:32 -0800 Subject: [PATCH] fix eeh.h compile warnings In-Reply-To: <20050304165717.GA5789@austin.ibm.com> References: <20050302181206.GA2741@us.ibm.com> <20050303033757.GD5897@otto> <20050304165717.GA5789@austin.ibm.com> Message-ID: <20050304181332.GA2689@us.ibm.com> On Fri, Mar 04, 2005 at 10:57:17AM -0600, Olof Johansson wrote: > On Wed, Mar 02, 2005 at 09:37:57PM -0600, Nathan Lynch wrote: > > > I don't have a toolchain readily available which gives these warnings, > > but does this fix them? > > Yep, it does here. Here as well, sorry for the delayed response. > > Use static inlines instead of #defines for stub functions when > > CONFIG_EEH=n. > > > > Signed-off-by: Nathan Lynch > > Acked-by: Olof Johansson Acked-by: Nishanth Aravamudan From paulus at samba.org Sat Mar 5 23:13:02 2005 From: paulus at samba.org (Paul Mackerras) Date: Sat, 5 Mar 2005 23:13:02 +1100 Subject: [PATCH] Updated U3 AGP patch Message-ID: <16937.41550.251010.982065@cargo.ozlabs.ibm.com> This patch is based on Jerome Glisse's work with some extra bits that I found in Darwin. It adds support for the U3 AGP bridge for both ppc32 and ppc64 kernels. It also includes the suspend/resume support that I need for my 1.5GHz powerbook to be able to sleep when AGP is active. This doesn't solve the potential cache problems, but so far I haven't seen them in practice... Signed-off-by: Paul Mackerras diff -urN linux-2.5/drivers/char/agp/Kconfig g5-ppc64/drivers/char/agp/Kconfig --- linux-2.5/drivers/char/agp/Kconfig 2005-01-21 08:40:04.000000000 +1100 +++ g5-ppc64/drivers/char/agp/Kconfig 2005-02-21 18:29:10.000000000 +1100 @@ -1,6 +1,6 @@ config AGP tristate "/dev/agpgart (AGP Support)" if !GART_IOMMU - depends on ALPHA || IA64 || PPC32 || X86 + depends on ALPHA || IA64 || PPC32 || PPC64 || X86 default y if GART_IOMMU ---help--- AGP (Accelerated Graphics Port) is a bus system mainly used to @@ -156,11 +156,11 @@ default AGP config AGP_UNINORTH - tristate "Apple UniNorth AGP support" + tristate "Apple UniNorth & U3 AGP support" depends on AGP && PPC_PMAC help This option gives you AGP support for Apple machines with a - UniNorth bridge. + UniNorth or U3 (Apple G5) bridge. config AGP_EFFICEON tristate "Transmeta Efficeon support" diff -urN linux-2.5/drivers/char/agp/uninorth-agp.c g5-ppc64/drivers/char/agp/uninorth-agp.c --- linux-2.5/drivers/char/agp/uninorth-agp.c 2004-12-28 10:24:26.000000000 +1100 +++ g5-ppc64/drivers/char/agp/uninorth-agp.c 2005-03-05 23:09:40.000000000 +1100 @@ -6,10 +6,26 @@ #include #include #include +#include #include #include +#include #include "agp.h" +/* + * NOTES for uninorth3 (G5 AGP) supports : + * + * There maybe also possibility to have bigger cache line size for + * agp (see pmac_pci.c and look for cache line). Need to be investigated + * by someone. + * + * PAGE size are hardcoded but this may change, see asm/page.h. + * + * Jerome Glisse + */ +static int uninorth_rev; +static int is_u3; + static int uninorth_fetch_size(void) { int i; @@ -39,26 +55,39 @@ static void uninorth_tlbflush(struct agp_memory *mem) { + u32 ctrl = UNI_N_CFG_GART_ENABLE; + + if (is_u3) + ctrl |= U3_N_CFG_GART_PERFRD; pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, - UNI_N_CFG_GART_ENABLE | UNI_N_CFG_GART_INVAL); - pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, - UNI_N_CFG_GART_ENABLE); - pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, - UNI_N_CFG_GART_ENABLE | UNI_N_CFG_GART_2xRESET); - pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, - UNI_N_CFG_GART_ENABLE); + ctrl | UNI_N_CFG_GART_INVAL); + pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, ctrl); + + if (uninorth_rev <= 0x30) { + pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, + ctrl | UNI_N_CFG_GART_2xRESET); + pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, + ctrl); + } } static void uninorth_cleanup(void) { - pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, - UNI_N_CFG_GART_ENABLE | UNI_N_CFG_GART_INVAL); - pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, - 0); - pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, - UNI_N_CFG_GART_2xRESET); - pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, - 0); + u32 tmp; + + pci_read_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, &tmp); + if (!(tmp & UNI_N_CFG_GART_ENABLE)) + return; + tmp |= UNI_N_CFG_GART_INVAL; + pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, tmp); + pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, 0); + + if (uninorth_rev <= 0x30) { + pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, + UNI_N_CFG_GART_2xRESET); + pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, + 0); + } } static int uninorth_configure(void) @@ -81,8 +110,21 @@ * the AGP aperture isn't mapped at bus physical address 0 */ agp_bridge->gart_bus_addr = 0; +#ifdef CONFIG_PPC64 + /* Assume U3 or later on PPC64 systems */ + /* high 4 bits of GART physical address go in UNI_N_CFG_AGP_BASE */ + pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_AGP_BASE, + (agp_bridge->gatt_bus_addr >> 32) & 0xf); +#else pci_write_config_dword(agp_bridge->dev, - UNI_N_CFG_AGP_BASE, agp_bridge->gart_bus_addr); + UNI_N_CFG_AGP_BASE, agp_bridge->gart_bus_addr); +#endif + + if (is_u3) { + pci_write_config_dword(agp_bridge->dev, + UNI_N_CFG_GART_DUMMY_PAGE, + agp_bridge->scratch_page_real >> 12); + } return 0; } @@ -111,14 +153,54 @@ } for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { - agp_bridge->gatt_table[j] = cpu_to_le32((mem->memory[i] & 0xfffff000) | 0x00000001UL); + agp_bridge->gatt_table[j] = + cpu_to_le32((mem->memory[i] & 0xFFFFF000UL) | 0x1UL); + flush_dcache_range((unsigned long)__va(mem->memory[i]), + (unsigned long)__va(mem->memory[i])+0x1000); + } + (void)in_le32((volatile u32*)&agp_bridge->gatt_table[pg_start]); + mb(); + flush_dcache_range((unsigned long)&agp_bridge->gatt_table[pg_start], + (unsigned long)&agp_bridge->gatt_table[pg_start + + mem->page_count]); + + uninorth_tlbflush(mem); + return 0; +} + +static int u3_insert_memory(struct agp_memory *mem, off_t pg_start, int type) +{ + int i, j, num_entries; + void *temp; + + temp = agp_bridge->current_size; + num_entries = A_SIZE_32(temp)->num_entries; + + if (type != 0 || mem->type != 0) + /* We know nothing of memory types */ + return -EINVAL; + if ((pg_start + mem->page_count) > num_entries) + return -EINVAL; + + j = pg_start; + + while (j < (pg_start + mem->page_count)) { + if (!PGE_EMPTY(agp_bridge, agp_bridge->gatt_table[j])) + return -EBUSY; + j++; + } + + for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { + agp_bridge->gatt_table[j] = ((mem->memory[i] >> PAGE_SHIFT) | + 0x80000000UL); flush_dcache_range((unsigned long)__va(mem->memory[i]), (unsigned long)__va(mem->memory[i])+0x1000); } (void)in_le32((volatile u32*)&agp_bridge->gatt_table[pg_start]); mb(); flush_dcache_range((unsigned long)&agp_bridge->gatt_table[pg_start], - (unsigned long)&agp_bridge->gatt_table[pg_start + mem->page_count]); + (unsigned long)&agp_bridge->gatt_table[pg_start + + mem->page_count]); uninorth_tlbflush(mem); return 0; @@ -126,15 +208,31 @@ static void uninorth_agp_enable(u32 mode) { - u32 command, scratch; + u32 command, scratch, status; int timeout; pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx + PCI_AGP_STATUS, - &command); + &status); + + command = agp_collect_device_status(mode, status); + command |= PCI_AGP_COMMAND_AGP; + + if (uninorth_rev == 0x21) { + /* + * Darwin disable AGP 4x on this revision, thus we + * may assume it's broken. This is an AGP2 controller. + */ + command &= ~AGPSTAT2_4X; + } - command = agp_collect_device_status(mode, command); - command |= 0x100; + if ((uninorth_rev >= 0x30) && (uninorth_rev <= 0x33)) { + /* + * We need to to set REQ_DEPTH to 7 for U3 versions 1.0, 2.1, + * 2.2 and 2.3, Darwin do so. + */ + command |= (7 << AGPSTAT_RQ_DEPTH_SHIFT); + } uninorth_tlbflush(NULL); @@ -146,15 +244,74 @@ pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx + PCI_AGP_COMMAND, &scratch); - } while ((scratch & 0x100) == 0 && ++timeout < 1000); - if ((scratch & 0x100) == 0) + } while ((scratch & PCI_AGP_COMMAND_AGP) == 0 && ++timeout < 1000); + if ((scratch & PCI_AGP_COMMAND_AGP) == 0) printk(KERN_ERR PFX "failed to write UniNorth AGP command reg\n"); - agp_device_command(command, 0); + if (uninorth_rev >= 0x30) { + /* This is an AGP V3 */ + agp_device_command(command, (status & 0x8)); + } else { + /* AGP V2 */ + agp_device_command(command, 0); + } uninorth_tlbflush(NULL); } +#ifdef CONFIG_PM +static int agp_uninorth_suspend(struct pci_dev *pdev, pm_message_t state) +{ + u32 cmd; + u8 agp; + struct pci_dev *device = NULL; + + if (state != PMSG_SUSPEND) + return 0; + + /* turn off AGP on the video chip, if it was enabled */ + for_each_pci_dev(device) { + /* Don't touch the bridge yet, device first */ + if (device == pdev) + continue; + /* Only deal with devices on the same bus here, no Mac has a P2P + * bridge on the AGP port, and mucking around the entire PCI tree + * is source of problems on some machines because of a bug in + * some versions of pci_find_capability() when hitting a dead device + */ + if (device->bus != pdev->bus) + continue; + agp = pci_find_capability(device, PCI_CAP_ID_AGP); + if (!agp) + continue; + pci_read_config_dword(device, agp + PCI_AGP_COMMAND, &cmd); + if (!(cmd & PCI_AGP_COMMAND_AGP)) + continue; + printk("uninorth-agp: disabling AGP on device %s\n", pci_name(device)); + cmd &= ~PCI_AGP_COMMAND_AGP; + pci_write_config_dword(device, agp + PCI_AGP_COMMAND, cmd); + } + + /* turn off AGP on the bridge */ + agp = pci_find_capability(pdev, PCI_CAP_ID_AGP); + pci_read_config_dword(pdev, agp + PCI_AGP_COMMAND, &cmd); + if (cmd & PCI_AGP_COMMAND_AGP) { + printk("uninorth-agp: disabling AGP on bridge %s\n", pci_name(pdev)); + cmd &= ~PCI_AGP_COMMAND_AGP; + pci_write_config_dword(pdev, agp + PCI_AGP_COMMAND, cmd); + } + /* turn off the GART */ + uninorth_cleanup(); + + return 0; +} + +static int agp_uninorth_resume(struct pci_dev *pdev) +{ + return 0; +} +#endif + static int uninorth_create_gatt_table(void) { char *table; @@ -202,10 +359,8 @@ agp_bridge->gatt_table = (u32 *)table; agp_bridge->gatt_bus_addr = virt_to_phys(table); - for (i = 0; i < num_entries; i++) { - agp_bridge->gatt_table[i] = - (unsigned long) agp_bridge->scratch_page; - } + for (i = 0; i < num_entries; i++) + agp_bridge->gatt_table[i] = 0; flush_dcache_range((unsigned long)table, (unsigned long)table_end); @@ -258,6 +413,22 @@ {4, 1024, 0, 1} }; +/* + * Not sure that u3 supports that high aperture sizes but it + * would strange if it did not :) + */ +static struct aper_size_info_32 u3_sizes[8] = +{ + {512, 131072, 7, 128}, + {256, 65536, 6, 64}, + {128, 32768, 5, 32}, + {64, 16384, 4, 16}, + {32, 8192, 3, 8}, + {16, 4096, 2, 4}, + {8, 2048, 1, 2}, + {4, 1024, 0, 1} +}; + struct agp_bridge_driver uninorth_agp_driver = { .owner = THIS_MODULE, .aperture_sizes = (void *)uninorth_sizes, @@ -282,6 +453,31 @@ .cant_use_aperture = 1, }; +struct agp_bridge_driver u3_agp_driver = { + .owner = THIS_MODULE, + .aperture_sizes = (void *)u3_sizes, + .size_type = U32_APER_SIZE, + .num_aperture_sizes = 8, + .configure = uninorth_configure, + .fetch_size = uninorth_fetch_size, + .cleanup = uninorth_cleanup, + .tlb_flush = uninorth_tlbflush, + .mask_memory = agp_generic_mask_memory, + .masks = NULL, + .cache_flush = null_cache_flush, + .agp_enable = uninorth_agp_enable, + .create_gatt_table = uninorth_create_gatt_table, + .free_gatt_table = uninorth_free_gatt_table, + .insert_memory = u3_insert_memory, + .remove_memory = agp_generic_remove_memory, + .alloc_by_type = agp_generic_alloc_by_type, + .free_by_type = agp_generic_free_by_type, + .agp_alloc_page = agp_generic_alloc_page, + .agp_destroy_page = agp_generic_destroy_page, + .cant_use_aperture = 1, + .needs_scratch_page = 1, +}; + static struct agp_device_ids uninorth_agp_device_ids[] __devinitdata = { { .device_id = PCI_DEVICE_ID_APPLE_UNI_N_AGP, @@ -299,6 +495,18 @@ .device_id = PCI_DEVICE_ID_APPLE_UNI_N_AGP2, .chipset_name = "UniNorth 2", }, + { + .device_id = PCI_DEVICE_ID_APPLE_U3_AGP, + .chipset_name = "U3", + }, + { + .device_id = PCI_DEVICE_ID_APPLE_U3L_AGP, + .chipset_name = "U3L", + }, + { + .device_id = PCI_DEVICE_ID_APPLE_U3H_AGP, + .chipset_name = "U3H", + }, }; static int __devinit agp_uninorth_probe(struct pci_dev *pdev, @@ -306,6 +514,7 @@ { struct agp_device_ids *devs = uninorth_agp_device_ids; struct agp_bridge_data *bridge; + struct device_node *uninorth_node; u8 cap_ptr; int j; @@ -327,11 +536,33 @@ return -ENODEV; found: + /* Set revision to 0 if we could not read it. */ + uninorth_rev = 0; + is_u3 = 0; + /* Locate core99 Uni-N */ + uninorth_node = of_find_node_by_name(NULL, "uni-n"); + /* Locate G5 u3 */ + if (uninorth_node == NULL) { + is_u3 = 1; + uninorth_node = of_find_node_by_name(NULL, "u3"); + } + if (uninorth_node) { + int *revprop = (int *) + get_property(uninorth_node, "device-rev", NULL); + if (revprop != NULL) + uninorth_rev = *revprop & 0x3f; + of_node_put(uninorth_node); + } + bridge = agp_alloc_bridge(); if (!bridge) return -ENOMEM; - bridge->driver = &uninorth_agp_driver; + if (is_u3) + bridge->driver = &u3_agp_driver; + else + bridge->driver = &uninorth_agp_driver; + bridge->dev = pdev; bridge->capndx = cap_ptr; @@ -369,6 +600,10 @@ .id_table = agp_uninorth_pci_table, .probe = agp_uninorth_probe, .remove = agp_uninorth_remove, +#ifdef CONFIG_PM + .suspend = agp_uninorth_suspend, + .resume = agp_uninorth_resume, +#endif }; static int __init agp_uninorth_init(void) diff -urN linux-2.5/include/asm-ppc/uninorth.h g5-ppc64/include/asm-ppc/uninorth.h --- linux-2.5/include/asm-ppc/uninorth.h 2005-02-03 18:00:28.000000000 +1100 +++ g5-ppc64/include/asm-ppc/uninorth.h 2005-03-05 17:28:33.000000000 +1100 @@ -27,13 +27,18 @@ #define UNI_N_CFG_AGP_BASE 0x90 #define UNI_N_CFG_GART_CTRL 0x94 #define UNI_N_CFG_INTERNAL_STATUS 0x98 +#define UNI_N_CFG_GART_DUMMY_PAGE 0xa4 /* UNI_N_CFG_GART_CTRL bits definitions */ -/* Not U3 */ #define UNI_N_CFG_GART_INVAL 0x00000001 #define UNI_N_CFG_GART_ENABLE 0x00000100 #define UNI_N_CFG_GART_2xRESET 0x00010000 #define UNI_N_CFG_GART_DISSBADET 0x00020000 +/* The following seems to only be used only on U3 */ +#define U3_N_CFG_GART_SYNCMODE 0x00040000 +#define U3_N_CFG_GART_PERFRD 0x00080000 +#define U3_N_CFG_GART_B2BGNT 0x00200000 +#define U3_N_CFG_GART_FASTDDR 0x00400000 /* My understanding of UniNorth AGP as of UniNorth rev 1.0x, * revision 1.5 (x4 AGP) may need further changes. diff -urN linux-2.5/include/asm-ppc64/agp.h g5-ppc64/include/asm-ppc64/agp.h --- /dev/null 2005-02-22 20:41:05.000000000 +1100 +++ g5-ppc64/include/asm-ppc64/agp.h 2005-02-21 18:30:02.000000000 +1100 @@ -0,0 +1,13 @@ +#ifndef AGP_H +#define AGP_H 1 + +#include + +/* nothing much needed here */ + +#define map_page_into_agp(page) +#define unmap_page_from_agp(page) +#define flush_agp_mappings() +#define flush_agp_cache() mb() + +#endif From stefan at nocrew.org Sun Mar 6 08:01:27 2005 From: stefan at nocrew.org (Stefan Berndtsson) Date: Sat, 05 Mar 2005 22:01:27 +0100 Subject: BTTV in linux/ppc64. Message-ID: <87mzth24ew.fsf@hades.nocrew.org> I'm having trouble getting bttv working in linux/ppc64. The same kernel works fine with linux/ppc on the same hardware. Kernel used is 2.6.11 (from kernel.org) Machine is a 1.8GHz G5 (single cpu). BTTV-card is a PCTV Rave with a bt878 chipset. It compiles nicely, but when the module is loaded, the modprobe process hangs and never returns. The rest of the system keeps working as it should. As far as I've been able to figure out, it calls driver_register(), but never returns from this. Another issue, where I get an oops, is the loading of the sound alsa module for the Vortex card in the machine. It's a Vortex au8820. Like the bttv issue, the card and driver works fine with a 32bit kernel. The oops looks like this: PCI: Enabling device: (0001:06:03.0), cmd 7 Vortex: init.... Oops: Kernel access of bad area, sig: 11 [#1] POWERMAC Modules linked in: snd_au8820 snd_ac97_codec snd_pcm_oss snd_mixer_oss snd_pcm snd_page_alloc snd_timer snd_mpu401_uart snd_rawmidi snd soundco ic5 kernel: NIP: D0000000000FF8EC XER: 00000000 LR: D0000000000FF8D8 CTR: C00000000018F188 REGS: c000000001c6f450 TRAP: 0300 Not tainted (2.6.11-ppc64) MSR: 9000000000009032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11 CR: 24008422 DAR: e000000083f30018 DSISR: 0000000042000000 TASK: c00000000fbd77a0[1228] 'modprobe' THREAD: c000000001c6c000 GPR00: E000000083F30018 C000000001C6F6D0 D00000000010CE20 0000000000000014 GPR04: C0000000004916A0 C00000001F788990 0000000000000008 C000000000481B88 GPR08: 00000000FFFBF3FE E000000083F2B000 C000000000481578 FFFFFFFFFFFFFFFF GPR12: 0000000044008428 C000000000399C00 0000000000000000 000000000000000A GPR16: D0000000000F2112 D0000000000F2210 D000000000104600 0000000000000124 GPR20: 0000000000000000 D000000000104650 C00000000044F448 D0000000000E9000 GPR24: 0000000000000000 C000000001813C00 C00000001F79E000 C000000001E2C000 GPR28: C00000001F79E000 0000000000000000 D00000000010C880 C000000001C6F6D0 NIP [d0000000000ff8ec] .snd_vortex_probe+0x194/0x1028 [snd_au8820] LR [d0000000000ff8d8] .snd_vortex_probe+0x180/0x1028 [snd_au8820] Call Trace: [c000000001c6f6d0] [d0000000000ff8d8] .snd_vortex_probe+0x180/0x1028 [snd_au8820] (unreliable) [c000000001c6f7e0] [c00000000016c990] .pci_device_probe+0xec/0x20c [c000000001c6f880] [c0000000001c1dcc] .driver_probe_device+0x80/0x11c [c000000001c6f910] [c0000000001c2010] .driver_attach+0x84/0xfc [c000000001c6f9b0] [c0000000001c2568] .bus_add_driver+0xc4/0x1ec [c000000001c6fa60] [c0000000001c2e1c] .driver_register+0x38/0x50 [c000000001c6faf0] [c00000000016c49c] .pci_register_driver+0x80/0xf0 [c000000001c6fb80] [d0000000001007f8] .alsa_card_vortex_init+0x24/0x40 [snd_au8820] [c000000001c6fc00] [c000000000062c98] .sys_init_module+0x3d4/0x1918 [c000000001c6fe30] [c00000000000d400] syscall_exit+0x0/0x18 Instruction dump: 4800150d e8410028 2fa30000 f87b1500 419e0b78 e87e8200 48000fb5 e8410028 e93b1500 3960ffff 3d290002 38095018 <7d60052c> 7c0004ac 38600005 48001051 Any ideas? /Stefan Berndtsson From paulus at samba.org Sun Mar 6 10:42:17 2005 From: paulus at samba.org (Paul Mackerras) Date: Sun, 6 Mar 2005 10:42:17 +1100 Subject: [PATCH] Updated U3 AGP patch In-Reply-To: References: <16937.41550.251010.982065@cargo.ozlabs.ibm.com> Message-ID: <16938.17369.373338.88220@cargo.ozlabs.ibm.com> Andreas Schwab writes: > I can't find these ids being defined anywhere in 2.6.11. Oops, my mistake, you need this bit too. Paul. diff -urN linux-2.5/include/linux/pci_ids.h g5-ppc64/include/linux/pci_ids.h --- linux-2.5/include/linux/pci_ids.h 2005-03-03 08:14:30.000000000 +1100 +++ g5-ppc64/include/linux/pci_ids.h 2005-03-03 09:36:03.000000000 +1100 @@ -861,7 +861,10 @@ #define PCI_DEVICE_ID_APPLE_IPID_ATA100 0x003b #define PCI_DEVICE_ID_APPLE_KEYLARGO_I 0x003e #define PCI_DEVICE_ID_APPLE_K2_ATA100 0x0043 +#define PCI_DEVICE_ID_APPLE_U3_AGP 0x004b #define PCI_DEVICE_ID_APPLE_K2_GMAC 0x004c +#define PCI_DEVICE_ID_APPLE_U3L_AGP 0x0058 +#define PCI_DEVICE_ID_APPLE_U3H_AGP 0x0059 #define PCI_DEVICE_ID_APPLE_TIGON3 0x1645 #define PCI_VENDOR_ID_YAMAHA 0x1073 From service at paypal.com Mon Mar 7 06:36:14 2005 From: service at paypal.com (PayPal) Date: Sun, 06 Mar 05 19:36:14 GMT Subject: PayPal Account Security Measures Message-ID: <442k$k4j$nhu6eit@1uar.yv> An HTML attachment was scrubbed... URL: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20050306/8379e45c/attachment.htm From domen at coderock.org Mon Mar 7 09:23:30 2005 From: domen at coderock.org (domen at coderock.org) Date: Sun, 06 Mar 2005 23:23:30 +0100 Subject: [patch 2/2] delete unused file include_asm_ppc64_iSeries_iSeries_fixup.h Message-ID: <20050306222330.D06231ED3D@trashy.coderock.org> Remove nowhere referenced file. (egrep "filename\." didn't find anything) Signed-off-by: Domen Puncer --- kj/include/asm-ppc64/iSeries/iSeries_fixup.h | 25 ------------------------- 1 files changed, 25 deletions(-) diff -L include/asm-ppc64/iSeries/iSeries_fixup.h -puN include/asm-ppc64/iSeries/iSeries_fixup.h~remove_file-include_asm_ppc64_iSeries_iSeries_fixup.h /dev/null --- kj/include/asm-ppc64/iSeries/iSeries_fixup.h +++ /dev/null 2005-03-02 11:34:59.000000000 +0100 @@ -1,25 +0,0 @@ - -#ifndef __ISERIES_FIXUP_H__ -#define __ISERIES_FIXUP_H__ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -void iSeries_fixup (void); -void iSeries_fixup_bus (struct pci_bus*); -unsigned int iSeries_scan_slot (struct pci_dev*, u16, u8, u8); - - -/* Need to store information related to the PHB bucc and make it accessible to the hose */ -struct iSeries_hose_arch_data { - u32 hvBusNumber; -}; - - -#ifdef __cplusplus -} -#endif - -#endif /* __ISERIES_FIXUP_H__ */ _ From domen at coderock.org Mon Mar 7 09:23:27 2005 From: domen at coderock.org (domen at coderock.org) Date: Sun, 06 Mar 2005 23:23:27 +0100 Subject: [patch 1/2] delete unused file arch_ppc64_boot_no_initrd.c Message-ID: <20050306222327.CD55F1EC90@trashy.coderock.org> Remove nowhere referenced file. (egrep "filename\." didn't find anything) Signed-off-by: Domen Puncer --- kj/arch/ppc64/boot/no_initrd.c | 2 -- 1 files changed, 2 deletions(-) diff -L arch/ppc64/boot/no_initrd.c -puN arch/ppc64/boot/no_initrd.c~remove_file-arch_ppc64_boot_no_initrd.c /dev/null --- kj/arch/ppc64/boot/no_initrd.c +++ /dev/null 2005-03-02 11:34:59.000000000 +0100 @@ -1,2 +0,0 @@ -char initrd_data[1]; -int initrd_len = 0; _ From sfr at canb.auug.org.au Mon Mar 7 11:36:00 2005 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Mon, 7 Mar 2005 11:36:00 +1100 Subject: [patch 2/2] delete unused file include_asm_ppc64_iSeries_iSeries_fixup.h In-Reply-To: <20050306222330.D06231ED3D@trashy.coderock.org> References: <20050306222330.D06231ED3D@trashy.coderock.org> Message-ID: <20050307113600.2c1d52b5.sfr@canb.auug.org.au> On Sun, 06 Mar 2005 23:23:30 +0100 domen at coderock.org wrote: > > > Remove nowhere referenced file. (egrep "filename\." didn't find anything) And, in fact, none of the things declared here exist any more. And iSeries build happily without it. > Signed-off-by: Domen Puncer Acked-by: Stephen Rothwell -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20050307/785b7cea/attachment.pgp From paulus at samba.org Mon Mar 7 19:57:50 2005 From: paulus at samba.org (Paul Mackerras) Date: Mon, 7 Mar 2005 19:57:50 +1100 Subject: [PATCH] PPC64 Addresses from OF getting truncated to 32-bits Message-ID: <16940.6030.778567.924954@cargo.ozlabs.ibm.com> This patch is from Jake Moilanen , reformatted by me. Signed-off-by: Jake Moilanen Signed-off-by: Paul Mackerras The `assigned-addresses' property in the Open Firmware device tree nodes for PCI devices has 64 bits of PCI bus address, but we were only using 32. This patch fixes it so we use all 64. diff -urN linux-2.5/arch/ppc64/kernel/prom.c test/arch/ppc64/kernel/prom.c --- linux-2.5/arch/ppc64/kernel/prom.c 2005-03-07 08:21:53.000000000 +1100 +++ test/arch/ppc64/kernel/prom.c 2005-03-07 19:49:13.000000000 +1100 @@ -335,7 +335,8 @@ while ((l -= sizeof(struct pci_reg_property)) >= 0) { if (!measure_only) { adr[i].space = pci_addrs[i].addr.a_hi; - adr[i].address = pci_addrs[i].addr.a_lo; + adr[i].address = pci_addrs[i].addr.a_lo | + ((u64)pci_addrs[i].addr.a_mid << 32); adr[i].size = pci_addrs[i].size_lo; } ++i; @@ -1721,7 +1722,8 @@ } while ((l -= sizeof(struct pci_reg_property)) >= 0) { adr[i].space = pci_addrs[i].addr.a_hi; - adr[i].address = pci_addrs[i].addr.a_lo; + adr[i].address = pci_addrs[i].addr.a_lo | + ((u64)pci_addrs[i].addr.a_mid << 32); adr[i].size = pci_addrs[i].size_lo; ++i; } From paulus at samba.org Mon Mar 7 21:33:20 2005 From: paulus at samba.org (Paul Mackerras) Date: Mon, 7 Mar 2005 21:33:20 +1100 Subject: [PATCH] error code cleanups for rtas wrappers In-Reply-To: <1109797837.9434.2.camel@sinatra.austin.ibm.com> References: <1109797837.9434.2.camel@sinatra.austin.ibm.com> Message-ID: <16940.11760.291422.528712@cargo.ozlabs.ibm.com> John Rose writes: > This patch changes the rtas wrapper functions in rtas.c to map RTAS failures > to conventional error values. The goal is to make failure conditions > obvious in the wrapper functions and in the caller code. Looks good, got a patch to change all the callers? Paul. From johnrose at austin.ibm.com Tue Mar 8 03:11:52 2005 From: johnrose at austin.ibm.com (John Rose) Date: Mon, 07 Mar 2005 10:11:52 -0600 Subject: [PATCH] error code cleanups for rtas wrappers In-Reply-To: <16940.11760.291422.528712@cargo.ozlabs.ibm.com> References: <1109797837.9434.2.camel@sinatra.austin.ibm.com> <16940.11760.291422.528712@cargo.ozlabs.ibm.com> Message-ID: <1110211912.2538.15.camel@sinatra.austin.ibm.com> > Looks good, got a patch to change all the callers? I do, but the patch only affects RPA PCI Hotplug/DLPAR. I figured I'd wait for acceptance on this end before submitting those changes. Callers within PPC64 "base" were either changed by the patch above, or already had sufficient checks (rc == 0, etc). Thanks- John From paulus at samba.org Tue Mar 8 10:02:18 2005 From: paulus at samba.org (Paul Mackerras) Date: Tue, 8 Mar 2005 10:02:18 +1100 Subject: [PATCH] error code cleanups for rtas wrappers In-Reply-To: <1110211912.2538.15.camel@sinatra.austin.ibm.com> References: <1109797837.9434.2.camel@sinatra.austin.ibm.com> <16940.11760.291422.528712@cargo.ozlabs.ibm.com> <1110211912.2538.15.camel@sinatra.austin.ibm.com> Message-ID: <16940.56698.707687.831617@cargo.ozlabs.ibm.com> John Rose writes: > I do, but the patch only affects RPA PCI Hotplug/DLPAR. I figured I'd > wait for acceptance on this end before submitting those changes. > Callers within PPC64 "base" were either changed by the patch above, or > already had sufficient checks (rc == 0, etc). Yes, it was the callers in drivers/pci/hotplug/rpa* that I was concerned about. Some of them were testing for specific return values. If you have a patch to fix them too I'll forward both patches to Andrew. Paul. From jschopp at austin.ibm.com Tue Mar 8 10:01:28 2005 From: jschopp at austin.ibm.com (Joel Schopp) Date: Mon, 07 Mar 2005 17:01:28 -0600 Subject: [PATCH] explicitly bind idle tasks In-Reply-To: <20050302014701.GA5897@otto> References: <20050227031655.67233bb5.akpm@osdl.org> <1109542971.14993.217.camel@gaston> <20050227144928.6c71adaf.akpm@osdl.org> <20050302014701.GA5897@otto> Message-ID: <422CDD48.10006@austin.ibm.com> Nathan Lynch wrote: > With hotplug cpu and preempt, we tend to see smp_processor_id warnings > from idle loop code because it's always checking whether its cpu has > gone offline. Replacing every use of smp_processor_id with > _smp_processor_id in all idle loop code is one solution; another way > is explicitly binding idle threads to their cpus (the smp_processor_id > warning does not fire if the caller is bound only to the calling cpu). > This has the (admittedly slight) advantage of letting us know if an > idle thread ever runs on the wrong cpu. I also prefer explicitly binding idle threads to their cpus instead of replacing use of smp_processor_id with _smp_processor_id. > > > Signed-off-by: Nathan Lynch Acked-by: Joel Schopp > > Index: linux-2.6.11-rc5-mm1/init/main.c > =================================================================== > --- linux-2.6.11-rc5-mm1.orig/init/main.c 2005-03-02 00:12:07.000000000 +0000 > +++ linux-2.6.11-rc5-mm1/init/main.c 2005-03-02 00:53:04.000000000 +0000 > @@ -638,6 +638,10 @@ > { > lock_kernel(); > /* > + * init can run on any cpu. > + */ > + set_cpus_allowed(current, CPU_MASK_ALL); > + /* > * Tell the world that we're going to be the grim > * reaper of innocent orphaned children. > * > Index: linux-2.6.11-rc5-mm1/kernel/sched.c > =================================================================== > --- linux-2.6.11-rc5-mm1.orig/kernel/sched.c 2005-03-02 00:12:07.000000000 +0000 > +++ linux-2.6.11-rc5-mm1/kernel/sched.c 2005-03-02 00:47:14.000000000 +0000 > @@ -4092,6 +4092,7 @@ > idle->array = NULL; > idle->prio = MAX_PRIO; > idle->state = TASK_RUNNING; > + idle->cpus_allowed = cpumask_of_cpu(cpu); > set_task_cpu(idle, cpu); > > spin_lock_irqsave(&rq->lock, flags); > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo at vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > From johnrose at austin.ibm.com Tue Mar 8 10:54:54 2005 From: johnrose at austin.ibm.com (John Rose) Date: Mon, 07 Mar 2005 17:54:54 -0600 Subject: [PATCH] error code cleanups rpa[php,dlpar] In-Reply-To: <16940.56698.707687.831617@cargo.ozlabs.ibm.com> References: <1109797837.9434.2.camel@sinatra.austin.ibm.com> <16940.11760.291422.528712@cargo.ozlabs.ibm.com> <1110211912.2538.15.camel@sinatra.austin.ibm.com> <16940.56698.707687.831617@cargo.ozlabs.ibm.com> Message-ID: <1110239693.2538.26.camel@sinatra.austin.ibm.com> > Yes, it was the callers in drivers/pci/hotplug/rpa* that I was > concerned about. Some of them were testing for specific return > values. If you have a patch to fix them too I'll forward both patches > to Andrew. This patch changes the RPA PCI Hotplug and DLPAR modules to use more conventional error values for return codes. The goal is to make failure conditions obvious in the wrapper functions and in the caller code. Thanks Paul. Signed-off-by: John Rose diff -puN drivers/pci/hotplug/rpaphp.h~02_rpaphp_rcs drivers/pci/hotplug/rpaphp.h --- 2_6_linus_3/drivers/pci/hotplug/rpaphp.h~02_rpaphp_rcs 2005-03-07 17:52:20.000000000 -0600 +++ 2_6_linus_3-johnrose/drivers/pci/hotplug/rpaphp.h 2005-03-07 17:52:20.000000000 -0600 @@ -45,11 +45,6 @@ #define LED_ID 2 /* slow blinking */ #define LED_ACTION 3 /* fast blinking */ -/* Error status from rtas_get-sensor */ -#define NEED_POWER -9000 /* slot must be power up and unisolated to get state */ -#define PWR_ONLY -9001 /* slot must be powerd up to get state, leave isolated */ -#define ERR_SENSE_USE -9002 /* No DR operation will succeed, slot is unusable */ - /* Sensor values from rtas_get-sensor */ #define EMPTY 0 /* No card in slot */ #define PRESENT 1 /* Card in slot */ diff -puN drivers/pci/hotplug/rpaphp_core.c~02_rpaphp_rcs drivers/pci/hotplug/rpaphp_core.c --- 2_6_linus_3/drivers/pci/hotplug/rpaphp_core.c~02_rpaphp_rcs 2005-03-07 17:52:20.000000000 -0600 +++ 2_6_linus_3-johnrose/drivers/pci/hotplug/rpaphp_core.c 2005-03-07 17:52:20.000000000 -0600 @@ -256,12 +256,12 @@ int rpaphp_get_drc_props(struct device_n my_index = (int *) get_property(dn, "ibm,my-drc-index", NULL); if (!my_index) { /* Node isn't DLPAR/hotplug capable */ - return 1; + return -EINVAL; } rc = get_children_props(dn->parent, &indexes, &names, &types, &domains); if (rc < 0) { - return 1; + return -EINVAL; } name_tmp = (char *) &names[1]; @@ -284,7 +284,7 @@ int rpaphp_get_drc_props(struct device_n type_tmp += (strlen(type_tmp) + 1); } - return 1; + return -EINVAL; } static int is_php_type(char *drc_type) diff -puN drivers/pci/hotplug/rpaphp_pci.c~02_rpaphp_rcs drivers/pci/hotplug/rpaphp_pci.c --- 2_6_linus_3/drivers/pci/hotplug/rpaphp_pci.c~02_rpaphp_rcs 2005-03-07 17:52:20.000000000 -0600 +++ 2_6_linus_3-johnrose/drivers/pci/hotplug/rpaphp_pci.c 2005-03-07 17:52:20.000000000 -0600 @@ -81,8 +81,8 @@ static int rpaphp_get_sensor_state(struc rc = rtas_get_sensor(DR_ENTITY_SENSE, slot->index, state); - if (rc) { - if (rc == NEED_POWER || rc == PWR_ONLY) { + if (rc < 0) { + if (rc == -EFAULT || rc == -EEXIST) { dbg("%s: slot must be power up to get sensor-state\n", __FUNCTION__); @@ -91,14 +91,14 @@ static int rpaphp_get_sensor_state(struc */ rc = rtas_set_power_level(slot->power_domain, POWER_ON, &setlevel); - if (rc) { + if (rc < 0) { dbg("%s: power on slot[%s] failed rc=%d.\n", __FUNCTION__, slot->name, rc); } else { rc = rtas_get_sensor(DR_ENTITY_SENSE, slot->index, state); } - } else if (rc == ERR_SENSE_USE) + } else if (rc == -ENODEV) info("%s: slot is unusable\n", __FUNCTION__); else err("%s failed to get sensor state\n", __FUNCTION__); @@ -413,7 +413,7 @@ static int setup_pci_hotplug_slot_info(s if (slot->hotplug_slot->info->adapter_status == NOT_VALID) { err("%s: NOT_VALID: skip dn->full_name=%s\n", __FUNCTION__, slot->dn->full_name); - return -1; + return -EINVAL; } return 0; } @@ -426,15 +426,15 @@ static int set_phb_slot_name(struct slot dn = slot->dn; if (!dn) { - return 1; + return -EINVAL; } phb = dn->phb; if (!phb) { - return 1; + return -EINVAL; } bus = phb->bus; if (!bus) { - return 1; + return -EINVAL; } sprintf(slot->name, "%04x:%02x:%02x.%x", pci_domain_nr(bus), @@ -448,7 +448,7 @@ static int setup_pci_slot(struct slot *s if (slot->type == PHB) { rc = set_phb_slot_name(slot); - if (rc) { + if (rc < 0) { err("%s: failed to set phb slot name\n", __FUNCTION__); goto exit_rc; } @@ -509,12 +509,12 @@ static int setup_pci_slot(struct slot *s return 0; exit_rc: dealloc_slot_struct(slot); - return 1; + return -EINVAL; } int register_pci_slot(struct slot *slot) { - int rc = 1; + int rc = -EINVAL; slot->dev_type = PCI_DEV; if ((slot->type == EMBEDDED) || (slot->type == PHB)) diff -puN drivers/pci/hotplug/rpaphp_slot.c~02_rpaphp_rcs drivers/pci/hotplug/rpaphp_slot.c --- 2_6_linus_3/drivers/pci/hotplug/rpaphp_slot.c~02_rpaphp_rcs 2005-03-07 17:52:20.000000000 -0600 +++ 2_6_linus_3-johnrose/drivers/pci/hotplug/rpaphp_slot.c 2005-03-07 17:52:20.000000000 -0600 @@ -211,7 +211,7 @@ int register_slot(struct slot *slot) if (is_registered(slot)) { /* should't be here */ err("register_slot: slot[%s] is already registered\n", slot->name); rpaphp_release_slot(slot->hotplug_slot); - return 1; + return -EAGAIN; } retval = pci_hp_register(slot->hotplug_slot); if (retval) { @@ -270,7 +270,7 @@ int rpaphp_set_attention_status(struct s /* status: LED_OFF or LED_ON */ rc = rtas_set_indicator(DR_INDICATOR, slot->index, status); - if (rc) + if (rc < 0) err("slot(name=%s location=%s index=0x%x) set attention-status(%d) failed! rc=0x%x\n", slot->name, slot->location, slot->index, status, rc); diff -puN drivers/pci/hotplug/rpaphp_vio.c~02_rpaphp_rcs drivers/pci/hotplug/rpaphp_vio.c --- 2_6_linus_3/drivers/pci/hotplug/rpaphp_vio.c~02_rpaphp_rcs 2005-03-07 17:52:20.000000000 -0600 +++ 2_6_linus_3-johnrose/drivers/pci/hotplug/rpaphp_vio.c 2005-03-07 17:52:20.000000000 -0600 @@ -71,11 +71,11 @@ int register_vio_slot(struct device_node { u32 *index; char *name; - int rc = 1; + int rc = -EINVAL; struct slot *slot = NULL; rc = rpaphp_get_drc_props(dn, NULL, &name, NULL, NULL); - if (rc) + if (rc < 0) goto exit_rc; index = (u32 *) get_property(dn, "ibm,my-drc-index", NULL); if (!index) diff -puN drivers/pci/hotplug/rpadlpar_core.c~02_rpaphp_rcs drivers/pci/hotplug/rpadlpar_core.c --- 2_6_linus_3/drivers/pci/hotplug/rpadlpar_core.c~02_rpaphp_rcs 2005-03-07 17:52:51.000000000 -0600 +++ 2_6_linus_3-johnrose/drivers/pci/hotplug/rpadlpar_core.c 2005-03-07 17:53:02.000000000 -0600 @@ -142,7 +142,7 @@ static int pci_add_secondary_bus(struct child = pci_add_new_bus(bridge_dev->bus, bridge_dev, sec_busno); if (!child) { printk(KERN_ERR "%s: could not add secondary bus\n", __FUNCTION__); - return 1; + return -ENOMEM; } sprintf(child->name, "PCI Bus #%02x", child->number); @@ -204,7 +204,7 @@ static int dlpar_pci_remove_bus(struct p if (!bridge_dev) { printk(KERN_ERR "%s: unexpected null device\n", __FUNCTION__); - return 1; + return -EINVAL; } secondary_bus = bridge_dev->subordinate; @@ -212,7 +212,7 @@ static int dlpar_pci_remove_bus(struct p if (unmap_bus_range(secondary_bus)) { printk(KERN_ERR "%s: failed to unmap bus range\n", __FUNCTION__); - return 1; + return -ERANGE; } pci_remove_bus_device(bridge_dev); @@ -282,7 +282,7 @@ static int dlpar_remove_phb(struct slot } rc = dlpar_remove_root_bus(phb); - if (rc) + if (rc < 0) return rc; return 0; @@ -294,7 +294,7 @@ static int dlpar_add_phb(struct device_n phb = init_phb_dynamic(dn); if (!phb) - return 1; + return -EINVAL; return 0; } _ From ntl at pobox.com Tue Mar 8 12:56:38 2005 From: ntl at pobox.com (Nathan Lynch) Date: Mon, 7 Mar 2005 19:56:38 -0600 Subject: [PATCH] call idle_task_exit with irqs disabled Message-ID: <20050308015638.GA21853@otto> Seeing this very occasionally during cpu hotplug testing: Badness in slb_flush_and_rebolt at arch/ppc64/mm/slb.c:52 Call Trace: [c0000000ef0efbe0] [c0000000000127a0] .__switch_to+0xa4/0xf0 (unreliable) [c0000000ef0efc80] [c000000000050178] .idle_task_exit+0xbc/0x15c [c0000000ef0efd10] [c00000000000d108] .cpu_die+0x18/0x68 [c0000000ef0efd90] [c00000000001023c] .dedicated_idle+0x1fc/0x254 [c0000000ef0efe80] [c00000000000fc80] .cpu_idle+0x3c/0x54 [c0000000ef0eff00] [c00000000003aa90] .start_secondary+0x108/0x148 [c0000000ef0eff90] [c00000000000bd28] .enable_64b_mode+0x0/0x28 idle_task_exit can result in a call to slb_flush_and_rebolt, which must not be called with interrupts enabled. Make the call with interrupts disabled. Signed-off-by: Nathan Lynch pSeries_setup.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6.11-bk2/arch/ppc64/kernel/pSeries_setup.c =================================================================== --- linux-2.6.11-bk2.orig/arch/ppc64/kernel/pSeries_setup.c 2005-03-07 04:09:29.000000000 +0000 +++ linux-2.6.11-bk2/arch/ppc64/kernel/pSeries_setup.c 2005-03-07 04:15:22.000000000 +0000 @@ -322,8 +322,8 @@ static void __init pSeries_discover_pic static void pSeries_mach_cpu_die(void) { - idle_task_exit(); local_irq_disable(); + idle_task_exit(); /* Some hardware requires clearing the CPPR, while other hardware does not * it is safe either way */ From ntl at pobox.com Tue Mar 8 13:00:17 2005 From: ntl at pobox.com (Nathan Lynch) Date: Mon, 7 Mar 2005 20:00:17 -0600 Subject: [PATCH] update irq affinity mask when migrating irqs Message-ID: <20050308020017.GB21853@otto> When offlining a cpu, any device interrupts which are bound to the cpu have their affinity forcibly reset to all cpus (the default). However, the value in /proc/irq/XXX/smp_affinity remains unchanged. Since we're doing this while all the other cpus are stopped, it should be safe to just call desc->handler->set_affinity and manually update the irq_affinity array. Signed-off-by: Nathan Lynch xics.c | 11 ++--------- 1 files changed, 2 insertions(+), 9 deletions(-) Index: linux-2.6.11-bk2/arch/ppc64/kernel/xics.c =================================================================== --- linux-2.6.11-bk2.orig/arch/ppc64/kernel/xics.c 2005-03-02 07:38:10.000000000 +0000 +++ linux-2.6.11-bk2/arch/ppc64/kernel/xics.c 2005-03-07 03:52:08.000000000 +0000 @@ -704,15 +704,8 @@ void xics_migrate_irqs_away(void) virq, cpu); /* Reset affinity to all cpus */ - xics_status[0] = default_distrib_server; - - status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, - xics_status[0], xics_status[1]); - if (status) - printk(KERN_ERR "migrate_irqs_away: irq=%d " - "ibm,set-xive returns %d\n", - virq, status); - + desc->handler->set_affinity(virq, CPU_MASK_ALL); + irq_affinity[virq] = CPU_MASK_ALL; unlock: spin_unlock_irqrestore(&desc->lock, flags); } From sfr at canb.auug.org.au Tue Mar 8 17:54:22 2005 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Tue, 8 Mar 2005 17:54:22 +1100 Subject: [PATCH] PPC64: "invert" dma mapping routines Message-ID: <20050308175422.47ff6e85.sfr@canb.auug.org.au> Hi Andrew, Linus, This patch "inverts" the PPC64 dma mapping routines so that the pci_ and vio_ ... routines are implemented in terms of the dma_ ... routines (the vio_ routines disappear anyway as noone uses them directly any more). The most noticable change after this patch is applied will be that the flags passed to dma_alloc_coherent will now be honoured (whereas they were previously silently ignored since we used to just call pci_alloc_consistent). Signed-off-by: Stephen Rothwell diffstat looks like this: arch/ppc64/kernel/dma.c | 100 +++++++++++++-------------- arch/ppc64/kernel/iommu.c | 8 +- arch/ppc64/kernel/pci.c | 2 arch/ppc64/kernel/pci_direct_iommu.c | 34 +++++---- arch/ppc64/kernel/pci_iommu.c | 55 ++++++++------- arch/ppc64/kernel/vio.c | 55 +++++++++------ include/asm-ppc64/dma-mapping.h | 20 +++++ include/asm-ppc64/iommu.h | 6 - include/asm-ppc64/pci.h | 126 +---------------------------------- include/asm-ppc64/vio.h | 27 ------- 10 files changed, 166 insertions(+), 267 deletions(-) This has been compiled for iSeries, pSeries and g5 (default configs) and booted on iSeries. -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ diff -ruNp linus/arch/ppc64/kernel/dma.c linus-dma.4/arch/ppc64/kernel/dma.c --- linus/arch/ppc64/kernel/dma.c 2004-10-26 16:06:41.000000000 +1000 +++ linus-dma.4/arch/ppc64/kernel/dma.c 2005-02-07 17:47:41.000000000 +1100 @@ -13,14 +13,23 @@ #include #include -int dma_supported(struct device *dev, u64 mask) +static struct dma_mapping_ops *get_dma_ops(struct device *dev) { if (dev->bus == &pci_bus_type) - return pci_dma_supported(to_pci_dev(dev), mask); + return &pci_dma_ops; #ifdef CONFIG_IBMVIO if (dev->bus == &vio_bus_type) - return vio_dma_supported(to_vio_dev(dev), mask); -#endif /* CONFIG_IBMVIO */ + return &vio_dma_ops; +#endif + return NULL; +} + +int dma_supported(struct device *dev, u64 mask) +{ + struct dma_mapping_ops *dma_ops = get_dma_ops(dev); + + if (dma_ops) + return dma_ops->dma_supported(dev, mask); BUG(); return 0; } @@ -32,7 +41,7 @@ int dma_set_mask(struct device *dev, u64 return pci_set_dma_mask(to_pci_dev(dev), dma_mask); #ifdef CONFIG_IBMVIO if (dev->bus == &vio_bus_type) - return vio_set_dma_mask(to_vio_dev(dev), dma_mask); + return -EIO; #endif /* CONFIG_IBMVIO */ BUG(); return 0; @@ -42,12 +51,10 @@ EXPORT_SYMBOL(dma_set_mask); void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, int flag) { - if (dev->bus == &pci_bus_type) - return pci_alloc_consistent(to_pci_dev(dev), size, dma_handle); -#ifdef CONFIG_IBMVIO - if (dev->bus == &vio_bus_type) - return vio_alloc_consistent(to_vio_dev(dev), size, dma_handle); -#endif /* CONFIG_IBMVIO */ + struct dma_mapping_ops *dma_ops = get_dma_ops(dev); + + if (dma_ops) + return dma_ops->alloc_coherent(dev, size, dma_handle, flag); BUG(); return NULL; } @@ -56,12 +63,10 @@ EXPORT_SYMBOL(dma_alloc_coherent); void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t dma_handle) { - if (dev->bus == &pci_bus_type) - pci_free_consistent(to_pci_dev(dev), size, cpu_addr, dma_handle); -#ifdef CONFIG_IBMVIO - else if (dev->bus == &vio_bus_type) - vio_free_consistent(to_vio_dev(dev), size, cpu_addr, dma_handle); -#endif /* CONFIG_IBMVIO */ + struct dma_mapping_ops *dma_ops = get_dma_ops(dev); + + if (dma_ops) + dma_ops->free_coherent(dev, size, cpu_addr, dma_handle); else BUG(); } @@ -70,12 +75,10 @@ EXPORT_SYMBOL(dma_free_coherent); dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, size_t size, enum dma_data_direction direction) { - if (dev->bus == &pci_bus_type) - return pci_map_single(to_pci_dev(dev), cpu_addr, size, (int)direction); -#ifdef CONFIG_IBMVIO - if (dev->bus == &vio_bus_type) - return vio_map_single(to_vio_dev(dev), cpu_addr, size, direction); -#endif /* CONFIG_IBMVIO */ + struct dma_mapping_ops *dma_ops = get_dma_ops(dev); + + if (dma_ops) + return dma_ops->map_single(dev, cpu_addr, size, direction); BUG(); return (dma_addr_t)0; } @@ -84,12 +87,10 @@ EXPORT_SYMBOL(dma_map_single); void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction direction) { - if (dev->bus == &pci_bus_type) - pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction); -#ifdef CONFIG_IBMVIO - else if (dev->bus == &vio_bus_type) - vio_unmap_single(to_vio_dev(dev), dma_addr, size, direction); -#endif /* CONFIG_IBMVIO */ + struct dma_mapping_ops *dma_ops = get_dma_ops(dev); + + if (dma_ops) + dma_ops->unmap_single(dev, dma_addr, size, direction); else BUG(); } @@ -99,12 +100,11 @@ dma_addr_t dma_map_page(struct device *d unsigned long offset, size_t size, enum dma_data_direction direction) { - if (dev->bus == &pci_bus_type) - return pci_map_page(to_pci_dev(dev), page, offset, size, (int)direction); -#ifdef CONFIG_IBMVIO - if (dev->bus == &vio_bus_type) - return vio_map_page(to_vio_dev(dev), page, offset, size, direction); -#endif /* CONFIG_IBMVIO */ + struct dma_mapping_ops *dma_ops = get_dma_ops(dev); + + if (dma_ops) + return dma_ops->map_single(dev, + (page_address(page) + offset), size, direction); BUG(); return (dma_addr_t)0; } @@ -113,12 +113,10 @@ EXPORT_SYMBOL(dma_map_page); void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, enum dma_data_direction direction) { - if (dev->bus == &pci_bus_type) - pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction); -#ifdef CONFIG_IBMVIO - else if (dev->bus == &vio_bus_type) - vio_unmap_page(to_vio_dev(dev), dma_address, size, direction); -#endif /* CONFIG_IBMVIO */ + struct dma_mapping_ops *dma_ops = get_dma_ops(dev); + + if (dma_ops) + dma_ops->unmap_single(dev, dma_address, size, direction); else BUG(); } @@ -127,12 +125,10 @@ EXPORT_SYMBOL(dma_unmap_page); int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction direction) { - if (dev->bus == &pci_bus_type) - return pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction); -#ifdef CONFIG_IBMVIO - if (dev->bus == &vio_bus_type) - return vio_map_sg(to_vio_dev(dev), sg, nents, direction); -#endif /* CONFIG_IBMVIO */ + struct dma_mapping_ops *dma_ops = get_dma_ops(dev); + + if (dma_ops) + return dma_ops->map_sg(dev, sg, nents, direction); BUG(); return 0; } @@ -141,12 +137,10 @@ EXPORT_SYMBOL(dma_map_sg); void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, enum dma_data_direction direction) { - if (dev->bus == &pci_bus_type) - pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction); -#ifdef CONFIG_IBMVIO - else if (dev->bus == &vio_bus_type) - vio_unmap_sg(to_vio_dev(dev), sg, nhwentries, direction); -#endif /* CONFIG_IBMVIO */ + struct dma_mapping_ops *dma_ops = get_dma_ops(dev); + + if (dma_ops) + dma_ops->unmap_sg(dev, sg, nhwentries, direction); else BUG(); } diff -ruNp linus/arch/ppc64/kernel/iommu.c linus-dma.4/arch/ppc64/kernel/iommu.c --- linus/arch/ppc64/kernel/iommu.c 2005-01-09 10:05:39.000000000 +1100 +++ linus-dma.4/arch/ppc64/kernel/iommu.c 2005-02-07 15:00:06.000000000 +1100 @@ -513,8 +513,8 @@ void iommu_unmap_single(struct iommu_tab * Returns the virtual address of the buffer and sets dma_handle * to the dma address (mapping) of the first page. */ -void *iommu_alloc_consistent(struct iommu_table *tbl, size_t size, - dma_addr_t *dma_handle) +void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size, + dma_addr_t *dma_handle, int flag) { void *ret = NULL; dma_addr_t mapping; @@ -538,7 +538,7 @@ void *iommu_alloc_consistent(struct iomm return NULL; /* Alloc enough pages (and possibly more) */ - ret = (void *)__get_free_pages(GFP_ATOMIC, order); + ret = (void *)__get_free_pages(flag, order); if (!ret) return NULL; memset(ret, 0, size); @@ -553,7 +553,7 @@ void *iommu_alloc_consistent(struct iomm return ret; } -void iommu_free_consistent(struct iommu_table *tbl, size_t size, +void iommu_free_coherent(struct iommu_table *tbl, size_t size, void *vaddr, dma_addr_t dma_handle) { unsigned int npages; diff -ruNp linus/arch/ppc64/kernel/pci.c linus-dma.4/arch/ppc64/kernel/pci.c --- linus/arch/ppc64/kernel/pci.c 2005-03-06 07:08:24.000000000 +1100 +++ linus-dma.4/arch/ppc64/kernel/pci.c 2005-03-07 10:23:14.000000000 +1100 @@ -71,7 +71,7 @@ void iSeries_pcibios_init(void); LIST_HEAD(hose_list); -struct pci_dma_ops pci_dma_ops; +struct dma_mapping_ops pci_dma_ops; EXPORT_SYMBOL(pci_dma_ops); int global_phb_number; /* Global phb counter */ diff -ruNp linus/arch/ppc64/kernel/pci_direct_iommu.c linus-dma.4/arch/ppc64/kernel/pci_direct_iommu.c --- linus/arch/ppc64/kernel/pci_direct_iommu.c 2005-01-09 10:05:39.000000000 +1100 +++ linus-dma.4/arch/ppc64/kernel/pci_direct_iommu.c 2005-02-07 16:00:47.000000000 +1100 @@ -30,12 +30,12 @@ #include "pci.h" -static void *pci_direct_alloc_consistent(struct pci_dev *hwdev, size_t size, - dma_addr_t *dma_handle) +static void *pci_direct_alloc_coherent(struct device *hwdev, size_t size, + dma_addr_t *dma_handle, int flag) { void *ret; - ret = (void *)__get_free_pages(GFP_ATOMIC, get_order(size)); + ret = (void *)__get_free_pages(flag, get_order(size)); if (ret != NULL) { memset(ret, 0, size); *dma_handle = virt_to_abs(ret); @@ -43,24 +43,24 @@ static void *pci_direct_alloc_consistent return ret; } -static void pci_direct_free_consistent(struct pci_dev *hwdev, size_t size, +static void pci_direct_free_coherent(struct device *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle) { free_pages((unsigned long)vaddr, get_order(size)); } -static dma_addr_t pci_direct_map_single(struct pci_dev *hwdev, void *ptr, +static dma_addr_t pci_direct_map_single(struct device *hwdev, void *ptr, size_t size, enum dma_data_direction direction) { return virt_to_abs(ptr); } -static void pci_direct_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, +static void pci_direct_unmap_single(struct device *hwdev, dma_addr_t dma_addr, size_t size, enum dma_data_direction direction) { } -static int pci_direct_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, +static int pci_direct_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, enum dma_data_direction direction) { int i; @@ -73,17 +73,23 @@ static int pci_direct_map_sg(struct pci_ return nents; } -static void pci_direct_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, +static void pci_direct_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, enum dma_data_direction direction) { } +static int pci_direct_dma_suppo