[PATCH] powerpc: Fix typo in Ebony default dts
Signed-off-by: Li Yang <[EMAIL PROTECTED]> --- diff --git a/arch/powerpc/boot/dts/ebony.dts b/arch/powerpc/boot/dts/ebony.dts index 0ec02f4..59bbae2 100644 --- a/arch/powerpc/boot/dts/ebony.dts +++ b/arch/powerpc/boot/dts/ebony.dts @@ -31,8 +31,8 @@ reg = <0>; clock-frequency = <0>; // Filled in by zImage timebase-frequency = <0>; // Filled in by zImage - i-cache-line-size = <32>; - d-cache-line-size = <32>; + i-cache-line-size = <20>; + d-cache-line-size = <20>; i-cache-size = <8000>; /* 32 kB */ d-cache-size = <8000>; /* 32 kB */ dcr-controller; ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] Fix the PCI-Ex link training bug on MPC8641HPCN board.
If the PCI-Ex hose link training is failed, the kernel will halt at the PCI scan process on MPC8641HPCN board. This patch will remove and free the hose from PCI host list if the PCI hose link training is failed. Signed-off-by: Zhang Wei <[EMAIL PROTECTED]> --- arch/powerpc/platforms/86xx/pci.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/platforms/86xx/pci.c b/arch/powerpc/platforms/86xx/pci.c index 73cd5b0..0b7835c 100644 --- a/arch/powerpc/platforms/86xx/pci.c +++ b/arch/powerpc/platforms/86xx/pci.c @@ -210,8 +210,10 @@ int __init mpc86xx_add_bridge(struct device_node *dev) /* Probe the hose link training status */ early_read_config_word(hose, 0, 0, PCIE_LTSSM, &val); - if (val < PCIE_LTSSM_L0) + if (val < PCIE_LTSSM_L0) { + pcibios_free_controller(hose); return -ENXIO; + } /* Setup the PCIE host controller. */ mpc86xx_setup_pcie(hose, rsrc.start, rsrc.end - rsrc.start + 1); -- 1.5.1 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Please pull from 'for_paulus' branch
Please pull from 'for_paulus' branch of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git for_paulus to receive the following updates: Documentation/powerpc/booting-without-of.txt | 32 ++ arch/powerpc/boot/dts/mpc8272ads.dts | 42 +-- arch/powerpc/boot/dts/mpc832x_mds.dts| 16 + arch/powerpc/boot/dts/mpc832x_rdb.dts| 16 + arch/powerpc/boot/dts/mpc8349emitx.dts | 10 arch/powerpc/boot/dts/mpc834x_mds.dts| 10 arch/powerpc/boot/dts/mpc836x_mds.dts| 16 + arch/powerpc/boot/dts/mpc8540ads.dts | 147 ++- arch/powerpc/boot/dts/mpc8541cds.dts | 90 +++--- arch/powerpc/boot/dts/mpc8544ds.dts | 18 - arch/powerpc/boot/dts/mpc8548cds.dts | 108 arch/powerpc/boot/dts/mpc8555cds.dts | 90 +++--- arch/powerpc/boot/dts/mpc8560ads.dts | 148 ++- arch/powerpc/boot/dts/mpc8568mds.dts | 66 +++-- arch/powerpc/boot/dts/mpc8641_hpcn.dts | 50 ++- arch/powerpc/boot/dts/mpc866ads.dts | 31 -- arch/powerpc/boot/dts/mpc885ads.dts | 54 ++-- arch/powerpc/kernel/io.c | 12 arch/powerpc/kernel/pci_32.c | 34 -- arch/powerpc/kernel/pci_64.c |9 arch/powerpc/mm/hash_native_64.c |2 arch/powerpc/mm/stab.c |4 arch/powerpc/platforms/52xx/efika.c |4 arch/powerpc/platforms/52xx/lite5200.c |2 arch/powerpc/platforms/52xx/mpc52xx_pm.c |8 arch/powerpc/platforms/83xx/Makefile |2 arch/powerpc/platforms/83xx/mpc8313_rdb.c|1 arch/powerpc/platforms/83xx/mpc834x_itx.c|2 arch/powerpc/platforms/83xx/mpc834x_mds.c| 49 --- arch/powerpc/platforms/83xx/mpc83xx.h| 28 +- arch/powerpc/platforms/83xx/usb.c| 181 + arch/powerpc/platforms/85xx/misc.c | 32 ++ arch/powerpc/platforms/85xx/mpc8544_ds.c | 15 - arch/powerpc/platforms/85xx/mpc85xx_ads.c| 22 - arch/powerpc/platforms/85xx/mpc85xx_cds.c| 99 ++- arch/powerpc/platforms/85xx/mpc85xx_mds.c| 21 - arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 15 - arch/powerpc/platforms/8xx/m8xx_setup.c |5 arch/powerpc/platforms/8xx/mpc885ads_setup.c | 71 + arch/powerpc/sysdev/fsl_soc.c| 13 + arch/powerpc/sysdev/mpc8xx_pic.h | 11 arch/powerpc/sysdev/qe_lib/ucc.c |2 arch/powerpc/sysdev/qe_lib/ucc_fast.c|8 arch/ppc/mm/tlb.c|1 drivers/pcmcia/Kconfig | 17 - drivers/pcmcia/m8xx_pcmcia.c | 351 --- drivers/serial/cpm_uart/cpm_uart_core.c |2 include/asm-powerpc/mmu-8xx.h| 147 +++ include/asm-powerpc/mmu-fsl-booke.h | 88 ++ include/asm-powerpc/mmu.h| 10 include/asm-powerpc/mmu_context.h| 202 +++ include/asm-powerpc/mpc8xx.h |4 include/asm-powerpc/system.h |2 include/linux/fsl_devices.h |5 54 files changed, 1591 insertions(+), 834 deletions(-) David Gibson (2): [POWERPC] Split out asm-ppc/mmu.h portions for Freescale Book-E [POWERPC] Split out asm-ppc/mmu.h portions for PowerPC 8xx Domen Puncer (1): [POWERPC] 52xx: sparse fixes Grant Likely (1): [POWERPC] 83xx: Add USB support to mpc8349-mitx board port Jon Loeliger (1): [POWERPC] Replace use of GET_64BIT(prop, i) with of_read_number(). Kumar Gala (6): [POWERPC] Reworked interrupt numbers for OpenPIC based Freescale chips [POWERPC] Kill pcibios_enable_resources() [POWERPC] Fix up interrupt senses for MPC85xx boards [POWERPC] Merge asm-ppc/mmu_context.h into asm-power/mmu_context.h [POWERPC] Move inline asm eieio to using eieio inline function [POWERPC] CPM_UART: Use inline function form of eieio Laurent Pinchart (1): [PPC] Add linux/pagemap.h to arch/ppc/mm/tlb.c Li Yang (2): [POWERPC] qe_lib: export symbols for QE driver to compile as module [POWERPC] 83xx: USB platform code rework Roy Zang (4): [POWERPC] Document the global utilities node define and example [POWERPC] Fix the node index confusion for SOC [POWERPC] 85xx: Fix 8548CDS reset bug [POWERPC] Remove redundant pci_read_irq_line() function for 85xx platform Timur Tabi (1): [POWERPC] Fix MAC address entries for 83xx, 85xx, and 86xx device trees Vitaly Bordug (2): [POWERPC] 8xx: mpc885ads pcmcia support [POWERPC] dts: kill hardcoded phandles ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: Patches added to 2.6.23 branch
Christoph Hellwig writes: > On Tue, Jul 03, 2007 at 03:36:09PM +1000, Paul Mackerras wrote: > > The following patches have been added to the for-2.6.23 branch on > > powerpc.git. In addition, the master branch has the merge of the > > for-2.6.23 and merge branches, which means that it is up-to-date with > > Linus' 2.6.22-rc7 plus the patches I recently asked Linus to pull for > > inclusion in 2.6.22. > > What happened to Ben's and my signal and ptrace patches? They are in already; they were in the first lot (see my post to linuxppc-dev of 15 June, "for-2.6.23 branch in powerpc.git created". Paul. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] ide: Use inline function for eieio
Move to using inline function variant of eieio instead of inline assmebly. Signed-off-by: Kumar Gala <[EMAIL PROTECTED]> --- commit ff6ce6329e19cb82ee12447fe16c76c3dae7c1f4 tree ef830cd02624a79d7fa8c33b41f7229ff25a7d77 parent b30083183bf4987c8f7e9a8f753002a7ca5dc084 author Kumar Gala <[EMAIL PROTECTED]> Tue, 10 Jul 2007 00:13:54 -0500 committer Kumar Gala <[EMAIL PROTECTED]> Tue, 10 Jul 2007 00:13:54 -0500 drivers/ide/pci/scc_pata.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c index 55bc0a3..b9fd2ac 100644 --- a/drivers/ide/pci/scc_pata.c +++ b/drivers/ide/pci/scc_pata.c @@ -165,9 +165,9 @@ scc_ide_outbsync(ide_drive_t * drive, u8 addr, unsigned long port) ide_hwif_t *hwif = HWIF(drive); out_be32((void*)port, addr); - __asm__ __volatile__("eieio":::"memory"); + eieio(); in_be32((void*)(hwif->dma_base + 0x01c)); - __asm__ __volatile__("eieio":::"memory"); + eieio(); } static void ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 1/1] libata: pata_pdc2027x PLL input clock fix
Mikael Pettersson wrote: > (cc:ing linuxppc-dev) > > On Tue, 26 Jun 2007 13:43:15 +0800, Albert Lee wrote: > >>Recently the PLL input clock of pata_pdc2027x is sometimes detected >>higer than expected (e.g. 20.027 MHz compared to 16.714 MHz). >>It seems sometimes the mdelay() function is not as precise as it >>used to be. Per Alan's advice, HT or power management might affect >>the precision of mdelay(). >> >>This patch calls gettimeofday() to mesure the time elapsed and >>calculate the PLL input clock accordingly. > > > Unfortunately this breaks pata_pdc2027x on my PowerMac G3: > > > In fairness, this is a slightly non-standard PowerMac G3, in that it > has a G4 upgrade processor. The firmware doesn't recognise the CPU > and gives some CPU core frequency-related properties too low values. > However, the bus frequency property _is_ correct, which is what > most or all timing stuff should be based on. > > Looks like a platform bug. > According to the document, do_gettimeofday() has microsecond resolution. Since the driver calls mdelay(100) (10 microseconds), it won't affect the PLL input clock calculation much if somehow do_gettimeofday() drifts several (say 100) microseconds. Could you please apply the attached debug patch and collect more info on the PowerMac G3. Hopefully we can have more clue. Thanks. -- albert (BTW, maybe opening a bug in bugzilla.kernel.org would help the debugging.) --- 00_libata-dev/drivers/ata/pata_pdc2027x.c 2007-07-07 09:58:55.0 +0800 +++ 01_debug/drivers/ata/pata_pdc2027x.c2007-07-10 11:18:38.0 +0800 @@ -722,6 +722,15 @@ static long pdc_detect_pll_input_clock(s pll_clock = (start_count - end_count) / 100 * (1 / usec_elapsed); + do_gettimeofday(&start_time); + mdelay(37); + do_gettimeofday(&end_time); + usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 100 + + (end_time.tv_usec - start_time.tv_usec); + printk(KERN_ERR "usec_elapsed for mdelay(37) [%ld]\n", usec_elapsed); + printk(KERN_ERR "start time: [%ld]s [%ld]us \n", start_time.tv_sec, start_time.tv_usec); + printk(KERN_ERR "end time: [%ld]s [%ld]us \n", end_time.tv_sec, end_time.tv_usec); + PDPRINTK("start[%ld] end[%ld] \n", start_count, end_count); PDPRINTK("PLL input clock[%ld]Hz\n", pll_clock); ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH v2] Allow exec on 32-bit from readable, non-exec pages, with a warning.
Scott Wood writes: > In older versions of glibc (through 2.3), the dynamic linker executes a > small amount of code from the data segment, which is not marked as > executable. A recent change (commit 9ba4ace39fdfe22268daca9f28c5df384ae462cf) > stops this from working; there should be a deprecation period before > older glibc versions stop working. Actually I see no good reason to enforce no-exec at all if we can't do it consistently. And if we're not going to enforce it then there is no point whinging about it. When I applied Segher's original patch I thought that we had the read-implies-exec stuff enabled for the affected CPUs, but it turns out we don't. (We only have that stuff turned on for 32-bit processes on 64-bit cpus - see elf_read_implies_exec in include/asm-powerpc/elf.h.) Paul. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] Infinite loop/always true check possible with unsigned counter.
Paul Mackerras wrote: >> Fix to correct a possible infinite loop or an always true check when the >> unsigned long counter "i" is used in >> lmb_add_region() in the following for loop: >> for (i = rgn->cnt-1; i >= 0; i--) > Unfortunately this won't fix the bug. Since rgn->cnt is unsigned > long, the comparison will be done as an unsigned comparison even if i > is signed. > Instead, change the loop to go from rgn->cnt down to 1, and in the > loop body, change all instances of "i+1" to "i", and "i" to "i-1". What's about i = rgn->cnt; while (i--) ... ? (or for (i=rgn->cnt; i--; ), if you want a for-loop) Felix ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] Infinite loop/always true check possible with unsigned counter.
Manish Ahuja writes: > Repost to fix my email id. > > Fix to correct a possible infinite loop or an always true check when the > unsigned long counter "i" is used in > lmb_add_region() in the following for loop: > > for (i = rgn->cnt-1; i >= 0; i--) Unfortunately this won't fix the bug. Since rgn->cnt is unsigned long, the comparison will be done as an unsigned comparison even if i is signed. Instead, change the loop to go from rgn->cnt down to 1, and in the loop body, change all instances of "i+1" to "i", and "i" to "i-1". Paul. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[2.6 patch] drivers/video/macmodes.c:mac_find_mode() mustn't be __devinit
On Tue, Jul 10, 2007 at 01:47:14AM +0200, Mikael Pettersson wrote: > A vanilla 2.6.22 built for ppc32 and configured with CONFIG_FB_MACMODES=y, > CONFIG_HOTPLUG=n, > and CONFIG_MODULES=y, triggers the following warning from modpost: > > WARNING: drivers/built-in.o(__ksymtab+0x3b0): Section mismatch: reference to > .init.text:mac_find_mode (between '__ksymtab_mac_find_mode' and > '__ksymtab_mac_map_monitor_sense') > > There's an EXPORT_SYMBOL(mac_find_mode), but mac_find_mode() is __devinit > and thus __init in this kernel. So let's fix it. ;-) > /Mikael cu Adrian <-- snip --> If it's EXPORT_SYMBOL'ed it can't be __devinit. Reported by Mikael Pettersson. Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]> --- @stable: Fixes a real bug on ppc. drivers/video/macmodes.c |5 ++--- drivers/video/macmodes.h |8 2 files changed, 6 insertions(+), 7 deletions(-) --- linux-2.6.22-rc6-mm1/drivers/video/macmodes.h.old 2007-07-10 01:55:14.0 +0200 +++ linux-2.6.22-rc6-mm1/drivers/video/macmodes.h 2007-07-10 01:55:29.0 +0200 @@ -55,10 +55,10 @@ extern int mac_var_to_vmode(const struct fb_var_screeninfo *var, int *vmode, int *cmode); extern int mac_map_monitor_sense(int sense); -extern int __devinit mac_find_mode(struct fb_var_screeninfo *var, - struct fb_info *info, - const char *mode_option, - unsigned int default_bpp); +extern int mac_find_mode(struct fb_var_screeninfo *var, +struct fb_info *info, +const char *mode_option, +unsigned int default_bpp); /* --- linux-2.6.22-rc6-mm1/drivers/video/macmodes.c.old 2007-07-10 01:54:36.0 +0200 +++ linux-2.6.22-rc6-mm1/drivers/video/macmodes.c 2007-07-10 01:55:04.0 +0200 @@ -369,9 +369,8 @@ * */ -int __devinit mac_find_mode(struct fb_var_screeninfo *var, - struct fb_info *info, const char *mode_option, - unsigned int default_bpp) +int mac_find_mode(struct fb_var_screeninfo *var, struct fb_info *info, + const char *mode_option, unsigned int default_bpp) { const struct fb_videomode *db = NULL; unsigned int dbsize = 0; ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] xilinxfb: Parameterize xilinxfb platform device registration
From: Grant Likely <[EMAIL PROTECTED]> This patch allows multiple xilinxfb devices to be registered and used Signed-off-by: Grant Likely <[EMAIL PROTECTED]> cc: Andrei Konovalov <[EMAIL PROTECTED]> --- arch/ppc/syslib/virtex_devices.c | 38 +- 1 files changed, 25 insertions(+), 13 deletions(-) diff --git a/arch/ppc/syslib/virtex_devices.c b/arch/ppc/syslib/virtex_devices.c index 83f978f..9b473cf 100644 --- a/arch/ppc/syslib/virtex_devices.c +++ b/arch/ppc/syslib/virtex_devices.c @@ -152,6 +152,21 @@ }, \ } +/* + * ML300/ML403 Video Device: shortcut macro for single instance + */ +#define XPAR_TFT(num) { \ + .name = "xilinxfb", \ + .id = num, \ + .num_resources = 1, \ + .resource = (struct resource[]) { \ + { \ + .start = XPAR_TFT_##num##_BASEADDR, \ + .end = XPAR_TFT_##num##_BASEADDR+7, \ + .flags = IORESOURCE_IO, \ + }, \ + }, \ +} /* UART 8250 driver platform data table */ struct plat_serial8250_port virtex_serial_platform_data[] = { @@ -274,20 +289,17 @@ struct platform_device virtex_platform_devices[] = { #endif #endif - /* ML300/403 reference design framebuffer */ #if defined(XPAR_TFT_0_BASEADDR) - { - .name = "xilinxfb", - .id = 0, - .num_resources = 1, - .resource = (struct resource[]) { - { - .start = XPAR_TFT_0_BASEADDR, - .end= XPAR_TFT_0_BASEADDR+7, - .flags = IORESOURCE_IO, - }, - }, - }, + XPAR_TFT(0), +#endif +#if defined(XPAR_TFT_1_BASEADDR) + XPAR_TFT(1), +#endif +#if defined(XPAR_TFT_2_BASEADDR) + XPAR_TFT(2), +#endif +#if defined(XPAR_TFT_3_BASEADDR) + XPAR_TFT(3), #endif }; ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[2.6.22] powerpc: section mismatch for macmodes.c:mac_find_mode()
A vanilla 2.6.22 built for ppc32 and configured with CONFIG_FB_MACMODES=y, CONFIG_HOTPLUG=n, and CONFIG_MODULES=y, triggers the following warning from modpost: WARNING: drivers/built-in.o(__ksymtab+0x3b0): Section mismatch: reference to .init.text:mac_find_mode (between '__ksymtab_mac_find_mode' and '__ksymtab_mac_map_monitor_sense') There's an EXPORT_SYMBOL(mac_find_mode), but mac_find_mode() is __devinit and thus __init in this kernel. /Mikael ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 1/1] libata: pata_pdc2027x PLL input clock fix
(cc:ing linuxppc-dev) On Tue, 26 Jun 2007 13:43:15 +0800, Albert Lee wrote: > Recently the PLL input clock of pata_pdc2027x is sometimes detected > higer than expected (e.g. 20.027 MHz compared to 16.714 MHz). > It seems sometimes the mdelay() function is not as precise as it > used to be. Per Alan's advice, HT or power management might affect > the precision of mdelay(). > > This patch calls gettimeofday() to mesure the time elapsed and > calculate the PLL input clock accordingly. Unfortunately this breaks pata_pdc2027x on my PowerMac G3: --- dmesg-2.6.22-rc52007-06-23 20:45:45.0 +0200 +++ dmesg-2.6.222007-07-10 00:39:51.0 +0200 @@ -1,6 +1,6 @@ Using PowerMac machine description Total memory = 768MB; using 2048kB for hash table (at cfe0) -Linux version 2.6.22-rc5 ([EMAIL PROTECTED]) (gcc version 4.2.0) #1 Sat Jun 23 20:38:48 CEST 2007 +Linux version 2.6.22 ([EMAIL PROTECTED]) (gcc version 4.2.0) #1 Tue Jul 10 00:29:58 CEST 2007 Found a Heathrow mac-io controller, rev: 1, mapped at 0xfdf8 PowerMac motherboard: PowerMac G3 (Gossamer) Entering add_active_range(0, 0, 196608) 0 entries of 256 used @@ -32,7 +32,7 @@ console handover: boot [udbg0] -> real [tty0] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) -Memory: 771456k/786432k available (2344k kernel code, 14560k reserved, 116k data, 94k bss, 148k init) +Memory: 771584k/786432k available (2340k kernel code, 14544k reserved, 116k data, 94k bss, 148k init) Calibrating delay loop... 33.38 BogoMIPS (lpj=166912) Mount-cache hash table entries: 512 device-tree: Duplicate name in /pci/mac-io, renamed to "ide#1" @@ -108,17 +108,15 @@ sda: [mac] sda1 sda2 sda3 sda4 sda5 sda6 sda7 sda8 sda9 sd 0:0:0:0: [sda] Attached SCSI disk pata_pdc2027x :00:0e.0: version 0.9 -pata_pdc2027x :00:0e.0: PLL input clock 16000 kHz +pata_pdc2027x :00:0e.0: PLL input clock 1691742 kHz +pata_pdc2027x: Invalid PLL input clock 1691742kHz, give up! scsi1 : pata_pdc2027x scsi2 : pata_pdc2027x -ata1: PATA max UDMA/133 cmd 0xf10197c0 ctl 0xf1019fda bmdma 0xf1019000 irq 0 -ata2: PATA max UDMA/133 cmd 0xf10195c0 ctl 0xf1019dda bmdma 0xf1019008 irq 0 -ata1.00: ata_hpa_resize 1: sectors = 60036480, hpa_sectors = 60036480 +ata1: PATA max UDMA/133 cmd 0xf10197c0 ctl 0xf1019fda bmdma 0xf1019000 irq 24 +ata2: PATA max UDMA/133 cmd 0xf10195c0 ctl 0xf1019dda bmdma 0xf1019008 irq 24 ata1.00: ATA-5: IBM-DTLA-307030, TX4OA6AA, max UDMA/100 ata1.00: 60036480 sectors, multi 0: LBA -ata1.00: ata_hpa_resize 1: sectors = 60036480, hpa_sectors = 60036480 ata1.00: configured for UDMA/100 -ATA: abnormal status 0x8 on port 0xf10195df scsi 1:0:0:0: Direct-Access ATA IBM-DTLA-307030 TX4O PQ: 0 ANSI: 5 sd 1:0:0:0: [sdb] 60036480 512-byte hardware sectors (30739 MB) sd 1:0:0:0: [sdb] Write Protect is off @@ -128,7 +126,36 @@ sd 1:0:0:0: [sdb] Write Protect is off sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00 sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA - sdb: sdb1 sdb2 sdb3 sdb4 < sdb5 sdb6 sdb7 > + sdb:<3>ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 +ata1.00: (BMDMA stat 0x4) +ata1.00: cmd c8/00:08:00:00:00/00:00:00:00:00/e0 tag 0 cdb 0x0 data 4096 in + res 51/84:00:07:00:00/00:00:00:00:00/e0 Emask 0x10 (ATA bus error) +ata1: soft resetting port +ata1.00: configured for UDMA/100 +ata1: EH complete +ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 +ata1.00: (BMDMA stat 0x4) +ata1.00: cmd c8/00:08:00:00:00/00:00:00:00:00/e0 tag 0 cdb 0x0 data 4096 in + res 51/84:00:07:00:00/00:00:00:00:00/e0 Emask 0x10 (ATA bus error) +ata1: soft resetting port +ata1.00: configured for UDMA/100 +ata1: EH complete +ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 +ata1.00: (BMDMA stat 0x4) +ata1.00: cmd c8/00:08:00:00:00/00:00:00:00:00/e0 tag 0 cdb 0x0 data 4096 in + res 51/84:00:07:00:00/00:00:00:00:00/e0 Emask 0x10 (ATA bus error) +ata1: soft resetting port +ata1.00: configured for UDMA/100 +ata1: EH complete +ata1.00: limiting speed to UDMA/66:PIO4 +ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 +ata1.00: (BMDMA stat 0x4) +ata1.00: cmd c8/00:08:00:00:00/00:00:00:00:00/e0 tag 0 cdb 0x0 data 4096 in + res 51/84:00:07:00:00/00:00:00:00:00/e0 Emask 0x10 (ATA bus error) +ata1: soft resetting port +ata1.00: configured for UDMA/66 +ata1: EH complete + sdb1 sdb2 sdb3 sdb4 < sdb5 sdb6 sdb7 > sd 1:0:0:0: [sdb] Attached SCSI disk mice: PS/2 mouse device common for all mice TCP cubic registered In fairness, this is a slightly non-standard PowerMac G3, in that it has a G4 upgrade processor. The firmware doesn't recognise the CPU and gives some CPU core frequency-related properties too low values. However, the bus frequency property _is_ correct, which is what most or all timing stuff should be based on. Looks like a platform bug. /Mikael _
Re: [PATCH v2][POWERPC] document ipic level/sense info
On 7/9/07, Stuart Yoder <[EMAIL PROTECTED]> wrote: > > document level and sense information for the Freescale > IPIC interrupt controller > > +Sense and level information follows the Linux convention > +(specified in include/linux/interrupt.h) and should be encoded > +as follows: > + > + 2 = high to low edge sensitive type enabled > + 8 = active low level sensitive type enabled > + ... but it is probably worthwhile commentting that sense types 1 & 4 are not supported; just to fill in the obvious gaps. :-) g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. [EMAIL PROTECTED] (403) 399-0195 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH v2][POWERPC] document ipic level/sense info
document level and sense information for the Freescale IPIC interrupt controller Signed-off-by: Stuart Yoder <[EMAIL PROTECTED]> --- Documentation/powerpc/booting-without-of.txt | 18 +- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt index c169299..7ad9e42 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt @@ -50,13 +50,14 @@ Table of Contents g) Freescale SOC SEC Security Engines h) Board Control and Status (BCSR) i) Freescale QUICC Engine module (QE) - g) Flash chip nodes + j) Flash chip nodes VII - Specifying interrupt information for devices 1) interrupts property 2) interrupt-parent property 3) OpenPIC Interrupt Controllers 4) ISA Interrupt Controllers +5) IPIC Interrupt Controllers Appendix A - Sample SOC node for MPC8540 @@ -1878,6 +1879,21 @@ encodings listed below: 2 = high to low edge sensitive type enabled 3 = low to high edge sensitive type enabled +5) Freescale IPIC Interrupt Controllers +--- + +IPIC interrupt controllers are specific to Freescale 83xx +SOCs. Two cells are required to encode interrupt information. +The first cell defines the interrupt number. The second cell +defines the sense and level information. + +Sense and level information follows the Linux convention +(specified in include/linux/interrupt.h) and should be encoded +as follows: + + 2 = high to low edge sensitive type enabled + 8 = active low level sensitive type enabled + Appendix A - Sample SOC node for MPC8540 -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 00/13] IB/ehca: eHCA2 enablement & some fixes
thanks, I applied these for 2.6.23 and fixed a bunch of minor things that scripts/checkpatch.pl complained about (since I was in a mood to do mindless things). In the future please run that yourself and clean up the obvious things. I generally don't worry about the 80 column stuff, but it will catch most whitespace problems and tell you that foo(x,y) should be foo(x, y) etc. So you don't have to completely silence the script but at least take a look at the output. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH v2] Allow exec on 32-bit from readable, non-exec pages, with a warning.
In older versions of glibc (through 2.3), the dynamic linker executes a small amount of code from the data segment, which is not marked as executable. A recent change (commit 9ba4ace39fdfe22268daca9f28c5df384ae462cf) stops this from working; there should be a deprecation period before older glibc versions stop working. The problem has been observed on glibc 2.2. While glibc 2.3 has the same code, I did not see the problem; it may be that it accesses the page in question as data before executing from it, and thus it is already mapped. Note that this only applies to the classic 32-bit PowerPC MMU and the MPC8xx MMU, not Book E, 64-bit, etc. These MMUs do not support per-page no-exec, and thus this patch isn't taking away any effective protection enforcement. Currently, such accesses will fail only if the page in question has not already been faulted on (and thus mapped). Signed-off-by: Scott Wood <[EMAIL PROTECTED]> --- v2: Added to the changelog to explain why this change isn't harmful. arch/powerpc/mm/fault.c | 22 +- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 0ece513..2445512 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -125,6 +125,18 @@ static void do_dabr(struct pt_regs *regs, unsigned long address, } #endif /* !(CONFIG_4xx || CONFIG_BOOKE)*/ +#ifdef CONFIG_PPC32 +static void warn_exec_from_noexec(void) +{ + if (printk_ratelimit()) + printk(KERN_WARNING "Process %s (%d) attempted to execute from " + "a non-executable page.\n" + KERN_WARNING "This may stop working in future kernels. " + "Please upgrade your libc.\n", + current->comm, current->pid); +} +#endif + /* * For 600- and 800-family processors, the error_code parameter is DSISR * for a data fault, SRR1 for an instruction fault. For 400-family processors @@ -283,8 +295,16 @@ good_area: /* protection fault */ if (error_code & DSISR_PROTFAULT) goto bad_area; - if (!(vma->vm_flags & VM_EXEC)) + if (!(vma->vm_flags & VM_EXEC)) { +#ifdef CONFIG_PPC32 + if (vma->vm_flags & VM_READ) + warn_exec_from_noexec(); + else + goto bad_area; +#else goto bad_area; +#endif + } #else pte_t *ptep; pmd_t *pmdp; -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 08/13] IB/ehca: Lock renaming, static initializers
> +DEFINE_SPINLOCK(hcall_lock); This can be static. (I fixed it up when I applied the patch) ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 06/13] IB/ehca: Set SEND_GRH flag for all non-LL UD QPs on eHCA2
Out of curiousity, does this mean that a GRH will be sent on all UD messages (for non-LL QPs)? What decides if a QP is LL or not? - R. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] Allow exec on 32-bit from readable, non-exec pages, with a warning.
On Monday 09 July 2007, Scott Wood wrote: > The hardware in question doesn't support non-executable mappings; > otherwise, it'd never have worked in the first place. Note that this is > only allowed on 32-bit, non-book-E. > > There isn't much value in enforcing non-exec mappings only if it happens > to be the first fault on a given page. Ok, much clearer now. Do you mind adding that explanation to the changelog text? If it's going into the stable kernel update, there may be more people reading this with the same problem understanding the patch. Arnd <>< ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] Allow exec on 32-bit from readable, non-exec pages, with a warning.
Scott Wood wrote: > Arnd Bergmann wrote: >> I may be missing the obvious, but doesn't that defeat the purpose of >> non-executable mappings? > > > The hardware in question doesn't support non-executable mappings; > otherwise, it'd never have worked in the first place. Note that this is > only allowed on 32-bit, non-book-E. To be more precise, the classic MMU does appear to have non-exec functionality, but at the segment level, which is less than useful for implementing vma flags. -Scott ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] Allow exec on 32-bit from readable, non-exec pages, with a warning.
On Mon, Jul 09, 2007 at 04:16:40PM -0500, Scott Wood wrote: > Arnd Bergmann wrote: > > I may be missing the obvious, but doesn't that defeat the purpose of > > non-executable mappings? > > The hardware in question doesn't support non-executable mappings; > otherwise, it'd never have worked in the first place. Note that this is > only allowed on 32-bit, non-book-E. > > There isn't much value in enforcing non-exec mappings only if it happens > to be the first fault on a given page. Thank you. I was reading this thread last week, and scratching my head, thinking wtf ?? --linas ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] Allow exec on 32-bit from readable, non-exec pages, with a warning.
Arnd Bergmann wrote: > On Monday 09 July 2007, Scott Wood wrote: > >>In older versions of glibc (through 2.3), the dynamic linker executes a >>small amount of code from the data segment, which is not marked as >>executable. A recent change (commit 9ba4ace39fdfe22268daca9f28c5df384ae462cf) >>stops this from working; there should be a deprecation period before >>older glibc versions stop working. >> >>The problem has been observed on glibc 2.2. While glibc 2.3 has the same >>code, I did not see the problem; it may be that it accesses the page in >>question as data before executing from it, and thus it is already mapped. > > > I may be missing the obvious, but doesn't that defeat the purpose of > non-executable mappings? The hardware in question doesn't support non-executable mappings; otherwise, it'd never have worked in the first place. Note that this is only allowed on 32-bit, non-book-E. There isn't much value in enforcing non-exec mappings only if it happens to be the first fault on a given page. -Scott ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] Allow exec on 32-bit from readable, non-exec pages, with a warning.
On Monday 09 July 2007, Scott Wood wrote: > In older versions of glibc (through 2.3), the dynamic linker executes a > small amount of code from the data segment, which is not marked as > executable. A recent change (commit 9ba4ace39fdfe22268daca9f28c5df384ae462cf) > stops this from working; there should be a deprecation period before > older glibc versions stop working. > > The problem has been observed on glibc 2.2. While glibc 2.3 has the same > code, I did not see the problem; it may be that it accesses the page in > question as data before executing from it, and thus it is already mapped. I may be missing the obvious, but doesn't that defeat the purpose of non-executable mappings? Arnd <>< ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH][POWERPC] document ipic level/sense info
On Mon, 9 Jul 2007 13:20:45 -0500 Stuart Yoder <[EMAIL PROTECTED]> wrote: > +5) Freescale IPIC Interrupt Controllers > +--- > + > +IPIC interrupt controllers are specific to Freescale 83xx > +SOCs. Two cells are required to encode interrupt information. > +The first cell defines the interrupt number. The second cell > +defines the sense and level information. > + > +Sense and level information follows the Linux convention > +(specified in include/linux/interrupt.h) and should be encoded > +as follows: > + > + 1 = low to high edge sensitive type enabled the IPIC doesn't support this sense type. > + 2 = high to low edge sensitive type enabled > + 4 = active high level sensitive type enabled nor this. i.e, sense types 1 and 4 should not be documented in an IPIC context. Kim ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] Allow exec on 32-bit from readable, non-exec pages, with a warning.
In older versions of glibc (through 2.3), the dynamic linker executes a small amount of code from the data segment, which is not marked as executable. A recent change (commit 9ba4ace39fdfe22268daca9f28c5df384ae462cf) stops this from working; there should be a deprecation period before older glibc versions stop working. The problem has been observed on glibc 2.2. While glibc 2.3 has the same code, I did not see the problem; it may be that it accesses the page in question as data before executing from it, and thus it is already mapped. Signed-off-by: Scott Wood <[EMAIL PROTECTED]> --- Unfortunately, this didn't make it into 2.6.22, but it should probably go into the stable branch... arch/powerpc/mm/fault.c | 22 +- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 0ece513..2445512 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -125,6 +125,18 @@ static void do_dabr(struct pt_regs *regs, unsigned long address, } #endif /* !(CONFIG_4xx || CONFIG_BOOKE)*/ +#ifdef CONFIG_PPC32 +static void warn_exec_from_noexec(void) +{ + if (printk_ratelimit()) + printk(KERN_WARNING "Process %s (%d) attempted to execute from " + "a non-executable page.\n" + KERN_WARNING "This may stop working in future kernels. " + "Please upgrade your libc.\n", + current->comm, current->pid); +} +#endif + /* * For 600- and 800-family processors, the error_code parameter is DSISR * for a data fault, SRR1 for an instruction fault. For 400-family processors @@ -283,8 +295,16 @@ good_area: /* protection fault */ if (error_code & DSISR_PROTFAULT) goto bad_area; - if (!(vma->vm_flags & VM_EXEC)) + if (!(vma->vm_flags & VM_EXEC)) { +#ifdef CONFIG_PPC32 + if (vma->vm_flags & VM_READ) + warn_exec_from_noexec(); + else + goto bad_area; +#else goto bad_area; +#endif + } #else pte_t *ptep; pmd_t *pmdp; -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: 2.4/2.6/ppc/powerpc/8245/8347e
On Mon, Jul 09, 2007 at 05:47:23PM +0200, Marc Leeman wrote: > > Disabling this replaces the advanced SLAB allocator and > kmalloc support with the drastically simpler SLOB allocator. > SLOB is more space efficient but does not scale well and is > more susceptible to fragmentation. > > > I was expecting a lower DMM performance but wasn't expecting such a > drain on kernel/network load. OK, to be clear: you seem to be saying that using the SLOB instead of the SLAB allocator results in such terrible memory fragmentation that network performance is degraded by large factors (2x or 5x or something like that, if I remember your earlier emails). Is that right? I thought I heard about some memory-defrag patches being posted. What happens if these are used together with SLOB? Does one regain the lost performance? Perhaps maybe one gets even better performance? --linas ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] Infinite loop/always true check possible with unsigned counter.
Repost to fix my email id. Fix to correct a possible infinite loop or an always true check when the unsigned long counter "i" is used in lmb_add_region() in the following for loop: for (i = rgn->cnt-1; i >= 0; i--) Signed-off-by: Manish Ahuja <[EMAIL PROTECTED]> --- arch/powerpc/mm/lmb.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: 2.6.22-rc4/arch/powerpc/mm/lmb.c === --- 2.6.22-rc4.orig/arch/powerpc/mm/lmb.c 2007-06-11 21:10:46.0 -0500 +++ 2.6.22-rc4/arch/powerpc/mm/lmb.c2007-07-06 21:47:40.0 -0500 @@ -138,8 +138,8 @@ void __init lmb_analyze(void) static long __init lmb_add_region(struct lmb_region *rgn, unsigned long base, unsigned long size) { - unsigned long i, coalesced = 0; - long adjacent; + unsigned long coalesced = 0; + long adjacent, i; /* First try and coalesce this LMB with another. */ for (i=0; i < rgn->cnt; i++) { ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH][POWERPC] document ipic level/sense info
document level and sense information for the Freescale IPIC interrupt controller Signed-off-by: Stuart Yoder <[EMAIL PROTECTED]> --- Documentation/powerpc/booting-without-of.txt | 20 +++- 1 files changed, 19 insertions(+), 1 deletions(-) diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt index c169299..d26e2bd 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt @@ -50,13 +50,14 @@ Table of Contents g) Freescale SOC SEC Security Engines h) Board Control and Status (BCSR) i) Freescale QUICC Engine module (QE) - g) Flash chip nodes + j) Flash chip nodes VII - Specifying interrupt information for devices 1) interrupts property 2) interrupt-parent property 3) OpenPIC Interrupt Controllers 4) ISA Interrupt Controllers +5) IPIC Interrupt Controllers Appendix A - Sample SOC node for MPC8540 @@ -1878,6 +1879,23 @@ encodings listed below: 2 = high to low edge sensitive type enabled 3 = low to high edge sensitive type enabled +5) Freescale IPIC Interrupt Controllers +--- + +IPIC interrupt controllers are specific to Freescale 83xx +SOCs. Two cells are required to encode interrupt information. +The first cell defines the interrupt number. The second cell +defines the sense and level information. + +Sense and level information follows the Linux convention +(specified in include/linux/interrupt.h) and should be encoded +as follows: + + 1 = low to high edge sensitive type enabled + 2 = high to low edge sensitive type enabled + 4 = active high level sensitive type enabled + 8 = active low level sensitive type enabled + Appendix A - Sample SOC node for MPC8540 -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] [POWERPC] check for NULL ppc_md.init_IRQ() before calling
On Fri, Jul 06, 2007 at 05:16:34AM -0400, Sonny Rao wrote: > On Thu, Jul 05, 2007 at 08:37:34AM -0500, Olof Johansson wrote: > > On Sun, Jul 01, 2007 at 08:49:37PM -0400, Sonny Rao wrote: > > > The pseries platform does not have a default function for init_IRQ and > > > does not install one if it doesn't find or doesn't recognize an > > > interrupt controller in the device tree. Currently, the kernel dies > > > when it tries to call the NULL init_IRQ() function. Clean that up. > > > > Doesn't it make more sense to make init_IRQ() check that the pointer is > > set instead? That'll work for more platforms than just pseries. > > Yeah, that might be the simplest way. The only reason I can think of > to do it this way is that (I think) every single other platform in > arch/powerpc statically initializes init_IRQ, with pseries being the > oddball. It doesn't matter much to me, so I can post another patch in a > bit. Check to make sure ppc_md.init_IRQ exists before calling it. Signed-off-by: Sonny Rao <[EMAIL PROTECTED]> --- linux/arch/powerpc/kernel/irq.c~orig 2007-07-09 12:46:58.0 -0500 +++ linux/arch/powerpc/kernel/irq.c 2007-07-09 12:47:07.0 -0500 @@ -337,8 +337,8 @@ void do_IRQ(struct pt_regs *regs) void __init init_IRQ(void) { - - ppc_md.init_IRQ(); + if (ppc_md.init_IRQ) + ppc_md.init_IRQ(); #ifdef CONFIG_PPC64 irq_ctx_init(); #endif ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] Infinite loop/always true check possible with unsigned counter.
Fix to correct a possible infinite loop or an always true check when the unsigned long counter "i" is used in lmb_add_region() in the following for loop: for (i = rgn->cnt-1; i >= 0; i--) Signed-off-by: Manish Ahuja <[EMAIL PROTECTED]> --- arch/powerpc/mm/lmb.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: 2.6.22-rc4/arch/powerpc/mm/lmb.c === --- 2.6.22-rc4.orig/arch/powerpc/mm/lmb.c 2007-06-11 21:10:46.0 -0500 +++ 2.6.22-rc4/arch/powerpc/mm/lmb.c2007-07-06 21:47:40.0 -0500 @@ -138,8 +138,8 @@ void __init lmb_analyze(void) static long __init lmb_add_region(struct lmb_region *rgn, unsigned long base, unsigned long size) { - unsigned long i, coalesced = 0; - long adjacent; + unsigned long coalesced = 0; + long adjacent, i; /* First try and coalesce this LMB with another. */ for (i=0; i < rgn->cnt; i++) { ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [patch 01/35] pasemi: rename platform
On Mon, Jul 09, 2007 at 12:19:26PM -0500, Olof Johansson wrote: > Yeah sure, but not enough to repost the patch. The only problem it causes > is that a driver introduced a little earlier (but in the same release) > won't probe until this is applied. Well, the SDC drivers are affected too (RNG, cpufreq). Still, there aren't enough mainline users of the platform for it to be a concern at this time. -Olof ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [patch 01/35] pasemi: rename platform
On Mon, Jul 09, 2007 at 05:23:02PM +1000, Stephen Rothwell wrote: > On Sun, 8 Jul 2007 19:18:35 -0500 Olof Johansson <[EMAIL PROTECTED]> wrote: > > > > On Mon, Jul 09, 2007 at 09:52:59AM +1000, Stephen Rothwell wrote: > > > > > > This should also fix a problem further up in that file (in > > > pasemi_publish_devices) where we check for "machine_is(pasemi)". > > > > Yup, that's how I discovered the machine name being less than intuitive. > > So it is worth noting in the chnge log. Yeah sure, but not enough to repost the patch. The only problem it causes is that a driver introduced a little earlier (but in the same release) won't probe until this is applied. -Olof ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: 2.4/2.6/ppc/powerpc/8245/8347e
> More platforms and higher bitrate tests (I've left the previous post in > comment): I finally was able to figure out the culprid: CONFIG_SLOB=y instead of CONFIG_SLAB=y CONFIG_SLAB: Disabling this replaces the advanced SLAB allocator and kmalloc support with the drastically simpler SLOB allocator. SLOB is more space efficient but does not scale well and is more susceptible to fragmentation. I was expecting a lower DMM performance but wasn't expecting such a drain on kernel/network load. The original reason for this change was a fixed flashmap and a increased 2.6 kernel that didn't fit in this region (backwards compatible). -- greetz, marc I feel like I had a spiritual enema. Jool - Losing Time chiana 2.6.18-4-ixp4xx #1 Tue Mar 27 18:01:56 BST 2007 GNU/Linux signature.asc Description: Digital signature ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 2/5] Add legacy devices to mpc8641_hpcn.dts
>>> Yet it's kinda accepted years ago, see: > >>> http://playground.sun.com/1275/proposals/Closed/Accepted/381-it.txt > >> That's not a published recommendation or anything like that. > >There's also this document with a status of "unapproved draft": > > http://playground.sun.com/1275/bindings/devices/html/8042.html > >So, all this never got final approval? Somewhat confusing (well, > what one could expect from OF? :-) I think this 8042 thing became part of the CHRP binding. There never was a (published) x86 binding btw. So for our current purposes (flat device tree) I recommend we just do the minimal sane thing, i.e., no device_type and some good "compatible" entry. Segher ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 13/13] IB/ehca: Improve latency by unlocking the SQ/RQ after triggering the hardware
From: Hoang-Nam Nguyen <[EMAIL PROTECTED]> Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]> --- drivers/infiniband/hw/ehca/ehca_reqs.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c b/drivers/infiniband/hw/ehca/ehca_reqs.c index fd3ba22..61da65e 100644 --- a/drivers/infiniband/hw/ehca/ehca_reqs.c +++ b/drivers/infiniband/hw/ehca/ehca_reqs.c @@ -407,10 +407,9 @@ int ehca_post_send(struct ib_qp *qp, } /* eof for cur_send_wr */ post_send_exit0: - /* UNLOCK the QUEUE */ - spin_unlock_irqrestore(&my_qp->spinlock_s, flags); iosync(); /* serialize GAL register access */ hipz_update_sqa(my_qp, wqe_cnt); + spin_unlock_irqrestore(&my_qp->spinlock_s, flags); return ret; } @@ -473,9 +472,9 @@ static int internal_post_recv(struct ehca_qp *my_qp, } /* eof for cur_recv_wr */ post_recv_exit0: - spin_unlock_irqrestore(&my_qp->spinlock_r, flags); iosync(); /* serialize GAL register access */ hipz_update_rqa(my_qp, wqe_cnt); + spin_unlock_irqrestore(&my_qp->spinlock_r, flags); return ret; } -- 1.5.2 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 12/13] IB/ehca: notify consumers of LID/PKEY/SM changes after nondisruptive events
When firmware reports a nondisruptive port configuration change event, previous versions of the eHCA driver didn't forward the event to consumers like IPoIB. Add code that determines the type of configuration change by comparing old and new port attributes and reports it. Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]> --- drivers/infiniband/hw/ehca/ehca_classes.h |6 ++ drivers/infiniband/hw/ehca/ehca_hca.c | 34 +++ drivers/infiniband/hw/ehca/ehca_irq.c | 89 +++-- drivers/infiniband/hw/ehca/ehca_iverbs.h |3 + 4 files changed, 101 insertions(+), 31 deletions(-) diff --git a/drivers/infiniband/hw/ehca/ehca_classes.h b/drivers/infiniband/hw/ehca/ehca_classes.h index f1e0db2..daf823e 100644 --- a/drivers/infiniband/hw/ehca/ehca_classes.h +++ b/drivers/infiniband/hw/ehca/ehca_classes.h @@ -87,11 +87,17 @@ struct ehca_eq { struct ehca_eqe_cache_entry eqe_cache[EHCA_EQE_CACHE_SIZE]; }; +struct ehca_sma_attr { + u16 lid, lmc, sm_sl, sm_lid; + u16 pkey_tbl_len, pkeys[16]; +}; + struct ehca_sport { struct ib_cq *ibcq_aqp1; struct ib_qp *ibqp_aqp1; enum ib_rate rate; enum ib_port_state port_state; + struct ehca_sma_attr saved_attr; }; struct ehca_shca { diff --git a/drivers/infiniband/hw/ehca/ehca_hca.c b/drivers/infiniband/hw/ehca/ehca_hca.c index b310de5..bbd3c6a 100644 --- a/drivers/infiniband/hw/ehca/ehca_hca.c +++ b/drivers/infiniband/hw/ehca/ehca_hca.c @@ -193,6 +193,40 @@ query_port1: return ret; } +int ehca_query_sma_attr(struct ehca_shca *shca, + u8 port, struct ehca_sma_attr *attr) +{ + int ret = 0; + struct hipz_query_port *rblock; + + rblock = ehca_alloc_fw_ctrlblock(GFP_ATOMIC); + if (!rblock) { + ehca_err(&shca->ib_device, "Can't allocate rblock memory."); + return -ENOMEM; + } + + if (hipz_h_query_port(shca->ipz_hca_handle, port, rblock) != H_SUCCESS) { + ehca_err(&shca->ib_device, "Can't query port properties"); + ret = -EINVAL; + goto query_sma_attr1; + } + + memset(attr, 0, sizeof(struct ehca_sma_attr)); + + attr->lid= rblock->lid; + attr->lmc= rblock->lmc; + attr->sm_sl = rblock->sm_sl; + attr->sm_lid = rblock->sm_lid; + + attr->pkey_tbl_len = rblock->pkey_tbl_len; + memcpy(attr->pkeys, rblock->pkey_entries, sizeof(attr->pkeys)); + +query_sma_attr1: + ehca_free_fw_ctrlblock(rblock); + + return ret; +} + int ehca_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 *pkey) { int ret = 0; diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c index 02b73c8..96eba38 100644 --- a/drivers/infiniband/hw/ehca/ehca_irq.c +++ b/drivers/infiniband/hw/ehca/ehca_irq.c @@ -61,6 +61,7 @@ #define NEQE_EVENT_CODEEHCA_BMASK_IBM(2,7) #define NEQE_PORT_NUMBER EHCA_BMASK_IBM(8,15) #define NEQE_PORT_AVAILABILITY EHCA_BMASK_IBM(16,16) +#define NEQE_DISRUPTIVEEHCA_BMASK_IBM(16,16) #define ERROR_DATA_LENGTH EHCA_BMASK_IBM(52,63) #define ERROR_DATA_TYPEEHCA_BMASK_IBM(0,7) @@ -286,30 +287,61 @@ static void parse_identifier(struct ehca_shca *shca, u64 eqe) return; } -static void parse_ec(struct ehca_shca *shca, u64 eqe) +static void dispatch_port_event(struct ehca_shca *shca, int port_num, + enum ib_event_type type, const char *msg) { struct ib_event event; + + ehca_info(&shca->ib_device, "port %d %s.", port_num, msg); + event.device = &shca->ib_device; + event.event = type; + event.element.port_num = port_num; + ib_dispatch_event(&event); +} + +static void notify_port_conf_change(struct ehca_shca *shca, int port_num) +{ + struct ehca_sma_attr new_attr; + struct ehca_sma_attr *old_attr = &shca->sport[port_num - 1].saved_attr; + + ehca_query_sma_attr(shca, port_num, &new_attr); + + if (new_attr.sm_sl != old_attr->sm_sl || + new_attr.sm_lid != old_attr->sm_lid) + dispatch_port_event(shca, port_num, IB_EVENT_SM_CHANGE, + "SM changed"); + + if (new_attr.lid != old_attr->lid || + new_attr.lmc != old_attr->lmc) + dispatch_port_event(shca, port_num, IB_EVENT_LID_CHANGE, + "LID changed"); + + if (new_attr.pkey_tbl_len != old_attr->pkey_tbl_len || + memcmp(new_attr.pkeys, old_attr->pkeys, + sizeof(u16) * new_attr.pkey_tbl_len)) + dispatch_port_event(shca, port_num, IB_EVENT_PKEY_CHANGE, + "P_Key changed"); + + *old_attr = new_attr; +} + +static void parse_ec(struct ehca_shca *shca, u64 eqe) +{ u8 ec = EHCA_BMASK_GET(NEQE_EVENT_CODE, eqe); u8 port = EHCA_BMASK_GET(NEQE_PORT_NUMBER
[PATCH 11/13] IB/ehca: return QP pointer in poll_cq(), add two unlikely() statements
Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]> --- drivers/infiniband/hw/ehca/ehca_reqs.c | 11 --- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c b/drivers/infiniband/hw/ehca/ehca_reqs.c index 73f0c06..fd3ba22 100644 --- a/drivers/infiniband/hw/ehca/ehca_reqs.c +++ b/drivers/infiniband/hw/ehca/ehca_reqs.c @@ -517,6 +517,7 @@ static inline int ehca_poll_cq_one(struct ib_cq *cq, struct ib_wc *wc) int ret = 0; struct ehca_cq *my_cq = container_of(cq, struct ehca_cq, ib_cq); struct ehca_cqe *cqe; + struct ehca_qp *my_qp; int cqe_count = 0; poll_cq_one_read_cqe: @@ -568,7 +569,7 @@ poll_cq_one_read_cqe: } /* tracing cqe */ - if (ehca_debug_level) { + if (unlikely(ehca_debug_level)) { ehca_dbg(cq->device, "Received COMPLETION ehca_cq=%p cq_num=%x -", my_cq, my_cq->cq_number); @@ -602,7 +603,11 @@ poll_cq_one_read_cqe: } else wc->status = IB_WC_SUCCESS; - wc->qp = NULL; + read_lock(&ehca_qp_idr_lock); + my_qp = idr_find(&ehca_qp_idr, cqe->qp_token); + wc->qp = &my_qp->ib_qp; + read_unlock(&ehca_qp_idr_lock); + wc->byte_len = cqe->nr_bytes_transferred; wc->pkey_index = cqe->pkey_index; wc->slid = cqe->rlid; @@ -612,7 +617,7 @@ poll_cq_one_read_cqe: wc->imm_data = cpu_to_be32(cqe->immediate_data); wc->sl = cqe->service_level; - if (wc->status != IB_WC_SUCCESS) + if (unlikely(wc->status != IB_WC_SUCCESS)) ehca_dbg(cq->device, "ehca_cq=%p cq_num=%x WARNING unsuccessful cqe " "OPType=%x status=%x qp_num=%x src_qp=%x wr_id=%lx " -- 1.5.2 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 10/13] IB/ehca: Change idr spinlocks into rwlocks
This eliminates lock contention among IRQs as well as the need to disable IRQs around idr_find, because there are no IRQ writers. Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]> --- drivers/infiniband/hw/ehca/ehca_classes.h |4 ++-- drivers/infiniband/hw/ehca/ehca_cq.c | 12 ++-- drivers/infiniband/hw/ehca/ehca_irq.c | 19 --- drivers/infiniband/hw/ehca/ehca_main.c|4 ++-- drivers/infiniband/hw/ehca/ehca_qp.c | 12 ++-- drivers/infiniband/hw/ehca/ehca_uverbs.c |9 - 6 files changed, 28 insertions(+), 32 deletions(-) diff --git a/drivers/infiniband/hw/ehca/ehca_classes.h b/drivers/infiniband/hw/ehca/ehca_classes.h index 8580f2a..f1e0db2 100644 --- a/drivers/infiniband/hw/ehca/ehca_classes.h +++ b/drivers/infiniband/hw/ehca/ehca_classes.h @@ -293,8 +293,8 @@ void ehca_cleanup_av_cache(void); int ehca_init_mrmw_cache(void); void ehca_cleanup_mrmw_cache(void); -extern spinlock_t ehca_qp_idr_lock; -extern spinlock_t ehca_cq_idr_lock; +extern rwlock_t ehca_qp_idr_lock; +extern rwlock_t ehca_cq_idr_lock; extern struct idr ehca_qp_idr; extern struct idr ehca_cq_idr; diff --git a/drivers/infiniband/hw/ehca/ehca_cq.c b/drivers/infiniband/hw/ehca/ehca_cq.c index 3729997..01d4a14 100644 --- a/drivers/infiniband/hw/ehca/ehca_cq.c +++ b/drivers/infiniband/hw/ehca/ehca_cq.c @@ -163,9 +163,9 @@ struct ib_cq *ehca_create_cq(struct ib_device *device, int cqe, int comp_vector, goto create_cq_exit1; } - spin_lock_irqsave(&ehca_cq_idr_lock, flags); + write_lock_irqsave(&ehca_cq_idr_lock, flags); ret = idr_get_new(&ehca_cq_idr, my_cq, &my_cq->token); - spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); + write_unlock_irqrestore(&ehca_cq_idr_lock, flags); } while (ret == -EAGAIN); @@ -294,9 +294,9 @@ create_cq_exit3: "cq_num=%x h_ret=%lx", my_cq, my_cq->cq_number, h_ret); create_cq_exit2: - spin_lock_irqsave(&ehca_cq_idr_lock, flags); + write_lock_irqsave(&ehca_cq_idr_lock, flags); idr_remove(&ehca_cq_idr, my_cq->token); - spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); + write_unlock_irqrestore(&ehca_cq_idr_lock, flags); create_cq_exit1: kmem_cache_free(cq_cache, my_cq); @@ -334,9 +334,9 @@ int ehca_destroy_cq(struct ib_cq *cq) * remove the CQ from the idr first to make sure * no more interrupt tasklets will touch this CQ */ - spin_lock_irqsave(&ehca_cq_idr_lock, flags); + write_lock_irqsave(&ehca_cq_idr_lock, flags); idr_remove(&ehca_cq_idr, my_cq->token); - spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); + write_unlock_irqrestore(&ehca_cq_idr_lock, flags); /* now wait until all pending events have completed */ wait_event(my_cq->wait_completion, !atomic_read(&my_cq->nr_events)); diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c index 3e790a3..02b73c8 100644 --- a/drivers/infiniband/hw/ehca/ehca_irq.c +++ b/drivers/infiniband/hw/ehca/ehca_irq.c @@ -180,12 +180,11 @@ static void qp_event_callback(struct ehca_shca *shca, { struct ib_event event; struct ehca_qp *qp; - unsigned long flags; u32 token = EHCA_BMASK_GET(EQE_QP_TOKEN, eqe); - spin_lock_irqsave(&ehca_qp_idr_lock, flags); + read_lock(&ehca_qp_idr_lock); qp = idr_find(&ehca_qp_idr, token); - spin_unlock_irqrestore(&ehca_qp_idr_lock, flags); + read_unlock(&ehca_qp_idr_lock); if (!qp) @@ -209,14 +208,13 @@ static void cq_event_callback(struct ehca_shca *shca, u64 eqe) { struct ehca_cq *cq; - unsigned long flags; u32 token = EHCA_BMASK_GET(EQE_CQ_TOKEN, eqe); - spin_lock_irqsave(&ehca_cq_idr_lock, flags); + read_lock(&ehca_cq_idr_lock); cq = idr_find(&ehca_cq_idr, token); if (cq) atomic_inc(&cq->nr_events); - spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); + read_unlock(&ehca_cq_idr_lock); if (!cq) return; @@ -411,7 +409,6 @@ static inline void process_eqe(struct ehca_shca *shca, struct ehca_eqe *eqe) { u64 eqe_value; u32 token; - unsigned long flags; struct ehca_cq *cq; eqe_value = eqe->entry; @@ -419,11 +416,11 @@ static inline void process_eqe(struct ehca_shca *shca, struct ehca_eqe *eqe) if (EHCA_BMASK_GET(EQE_COMPLETION_EVENT, eqe_value)) { ehca_dbg(&shca->ib_device, "Got completion event"); token = EHCA_BMASK_GET(EQE_CQ_TOKEN, eqe_value); - spin_lock_irqsave(&ehca_cq_idr_lock, flags); + read_lock(&ehca_cq_idr_lock); cq = idr_find(&ehca_cq_idr, token); if (cq) atomic_inc(&cq->nr_events); -
[PATCH 09/13] IB/ehca: Refactor synchronization between completions and destroy_cq using atomic_t
- ehca_cq.nr_events is made an atomic_t, eliminating a lot of locking. - The CQ is removed from the CQ idr first now to make sure no more completions are scheduled on that CQ. The "wait for all completions to end" code becomes much simpler this way. Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]> --- drivers/infiniband/hw/ehca/ehca_classes.h |4 +- drivers/infiniband/hw/ehca/ehca_cq.c | 26 +++- drivers/infiniband/hw/ehca/ehca_irq.c | 36 +--- drivers/infiniband/hw/ehca/ehca_irq.h |1 - drivers/infiniband/hw/ehca/ehca_tools.h |1 + 5 files changed, 29 insertions(+), 39 deletions(-) diff --git a/drivers/infiniband/hw/ehca/ehca_classes.h b/drivers/infiniband/hw/ehca/ehca_classes.h index 3550047..8580f2a 100644 --- a/drivers/infiniband/hw/ehca/ehca_classes.h +++ b/drivers/infiniband/hw/ehca/ehca_classes.h @@ -174,8 +174,8 @@ struct ehca_cq { spinlock_t cb_lock; struct hlist_head qp_hashtab[QP_HASHTAB_LEN]; struct list_head entry; - u32 nr_callbacks; /* #events assigned to cpu by scaling code */ - u32 nr_events;/* #events seen */ + u32 nr_callbacks; /* #events assigned to cpu by scaling code */ + atomic_t nr_events; /* #events seen */ wait_queue_head_t wait_completion; spinlock_t task_lock; u32 ownpid; diff --git a/drivers/infiniband/hw/ehca/ehca_cq.c b/drivers/infiniband/hw/ehca/ehca_cq.c index 94bad27..3729997 100644 --- a/drivers/infiniband/hw/ehca/ehca_cq.c +++ b/drivers/infiniband/hw/ehca/ehca_cq.c @@ -146,6 +146,7 @@ struct ib_cq *ehca_create_cq(struct ib_device *device, int cqe, int comp_vector, spin_lock_init(&my_cq->spinlock); spin_lock_init(&my_cq->cb_lock); spin_lock_init(&my_cq->task_lock); + atomic_set(&my_cq->nr_events, 0); init_waitqueue_head(&my_cq->wait_completion); my_cq->ownpid = current->tgid; @@ -303,16 +304,6 @@ create_cq_exit1: return cq; } -static int get_cq_nr_events(struct ehca_cq *my_cq) -{ - int ret; - unsigned long flags; - spin_lock_irqsave(&ehca_cq_idr_lock, flags); - ret = my_cq->nr_events; - spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); - return ret; -} - int ehca_destroy_cq(struct ib_cq *cq) { u64 h_ret; @@ -339,17 +330,18 @@ int ehca_destroy_cq(struct ib_cq *cq) } } + /* +* remove the CQ from the idr first to make sure +* no more interrupt tasklets will touch this CQ +*/ spin_lock_irqsave(&ehca_cq_idr_lock, flags); - while (my_cq->nr_events) { - spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); - wait_event(my_cq->wait_completion, !get_cq_nr_events(my_cq)); - spin_lock_irqsave(&ehca_cq_idr_lock, flags); - /* recheck nr_events to assure no cqe has just arrived */ - } - idr_remove(&ehca_cq_idr, my_cq->token); spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); + /* now wait until all pending events have completed */ + wait_event(my_cq->wait_completion, !atomic_read(&my_cq->nr_events)); + + /* nobody's using our CQ any longer -- we can destroy it */ h_ret = hipz_h_destroy_cq(adapter_handle, my_cq, 0); if (h_ret == H_R_STATE) { /* cq in err: read err data and destroy it forcibly */ diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c index 100329b..3e790a3 100644 --- a/drivers/infiniband/hw/ehca/ehca_irq.c +++ b/drivers/infiniband/hw/ehca/ehca_irq.c @@ -5,6 +5,8 @@ * * Authors: Heiko J Schick <[EMAIL PROTECTED]> * Khadija Souissi <[EMAIL PROTECTED]> + * Hoang-Nam Nguyen <[EMAIL PROTECTED]> + * Joachim Fenkes <[EMAIL PROTECTED]> * * Copyright (c) 2005 IBM Corporation * @@ -212,6 +214,8 @@ static void cq_event_callback(struct ehca_shca *shca, spin_lock_irqsave(&ehca_cq_idr_lock, flags); cq = idr_find(&ehca_cq_idr, token); + if (cq) + atomic_inc(&cq->nr_events); spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); if (!cq) @@ -219,6 +223,9 @@ static void cq_event_callback(struct ehca_shca *shca, ehca_error_data(shca, cq, cq->ipz_cq_handle.handle); + if (atomic_dec_and_test(&cq->nr_events)) + wake_up(&cq->wait_completion); + return; } @@ -414,25 +421,22 @@ static inline void process_eqe(struct ehca_shca *shca, struct ehca_eqe *eqe) token = EHCA_BMASK_GET(EQE_CQ_TOKEN, eqe_value); spin_lock_irqsave(&ehca_cq_idr_lock, flags); cq = idr_find(&ehca_cq_idr, token); + if (cq) + atomic_inc(&cq->nr_events); + spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); if (cq == NULL) { - spin_unlock_irqrestore(&ehca_cq_idr_lock, flag
[PATCH 08/13] IB/ehca: Lock renaming, static initializers
- Renamed all spinlock flags to "flags", matching the vast majority of kernel code. - Moved hcall_lock into the only module it's used in. - Replaced spin_lock_init() and friends with static initializers for global variables. Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]> --- drivers/infiniband/hw/ehca/ehca_classes.h |1 - drivers/infiniband/hw/ehca/ehca_cq.c | 12 ++-- drivers/infiniband/hw/ehca/ehca_main.c| 18 -- drivers/infiniband/hw/ehca/ehca_qp.c |6 +++--- drivers/infiniband/hw/ehca/ehca_reqs.c| 24 drivers/infiniband/hw/ehca/hcp_if.c |2 ++ 6 files changed, 27 insertions(+), 36 deletions(-) diff --git a/drivers/infiniband/hw/ehca/ehca_classes.h b/drivers/infiniband/hw/ehca/ehca_classes.h index 9d689ae..3550047 100644 --- a/drivers/infiniband/hw/ehca/ehca_classes.h +++ b/drivers/infiniband/hw/ehca/ehca_classes.h @@ -295,7 +295,6 @@ void ehca_cleanup_mrmw_cache(void); extern spinlock_t ehca_qp_idr_lock; extern spinlock_t ehca_cq_idr_lock; -extern spinlock_t hcall_lock; extern struct idr ehca_qp_idr; extern struct idr ehca_cq_idr; diff --git a/drivers/infiniband/hw/ehca/ehca_cq.c b/drivers/infiniband/hw/ehca/ehca_cq.c index 67f0670..94bad27 100644 --- a/drivers/infiniband/hw/ehca/ehca_cq.c +++ b/drivers/infiniband/hw/ehca/ehca_cq.c @@ -56,11 +56,11 @@ int ehca_cq_assign_qp(struct ehca_cq *cq, struct ehca_qp *qp) { unsigned int qp_num = qp->real_qp_num; unsigned int key = qp_num & (QP_HASHTAB_LEN-1); - unsigned long spl_flags; + unsigned long flags; - spin_lock_irqsave(&cq->spinlock, spl_flags); + spin_lock_irqsave(&cq->spinlock, flags); hlist_add_head(&qp->list_entries, &cq->qp_hashtab[key]); - spin_unlock_irqrestore(&cq->spinlock, spl_flags); + spin_unlock_irqrestore(&cq->spinlock, flags); ehca_dbg(cq->ib_cq.device, "cq_num=%x real_qp_num=%x", cq->cq_number, qp_num); @@ -74,9 +74,9 @@ int ehca_cq_unassign_qp(struct ehca_cq *cq, unsigned int real_qp_num) unsigned int key = real_qp_num & (QP_HASHTAB_LEN-1); struct hlist_node *iter; struct ehca_qp *qp; - unsigned long spl_flags; + unsigned long flags; - spin_lock_irqsave(&cq->spinlock, spl_flags); + spin_lock_irqsave(&cq->spinlock, flags); hlist_for_each(iter, &cq->qp_hashtab[key]) { qp = hlist_entry(iter, struct ehca_qp, list_entries); if (qp->real_qp_num == real_qp_num) { @@ -88,7 +88,7 @@ int ehca_cq_unassign_qp(struct ehca_cq *cq, unsigned int real_qp_num) break; } } - spin_unlock_irqrestore(&cq->spinlock, spl_flags); + spin_unlock_irqrestore(&cq->spinlock, flags); if (ret) ehca_err(cq->ib_cq.device, "qp not found cq_num=%x real_qp_num=%x", diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index 9bd749c..77db890 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c @@ -96,15 +96,13 @@ MODULE_PARM_DESC(static_rate, MODULE_PARM_DESC(scaling_code, "set scaling code (0: disabled/default, 1: enabled)"); -spinlock_t ehca_qp_idr_lock; -spinlock_t ehca_cq_idr_lock; -spinlock_t hcall_lock; +DEFINE_SPINLOCK(ehca_qp_idr_lock); +DEFINE_SPINLOCK(ehca_cq_idr_lock); DEFINE_IDR(ehca_qp_idr); DEFINE_IDR(ehca_cq_idr); - -static struct list_head shca_list; /* list of all registered ehcas */ -static spinlock_t shca_list_lock; +static LIST_HEAD(shca_list); /* list of all registered ehcas */ +static DEFINE_SPINLOCK(shca_list_lock); static struct timer_list poll_eqs_timer; @@ -864,14 +862,6 @@ int __init ehca_module_init(void) printk(KERN_INFO "eHCA Infiniband Device Driver " "(Rel.: SVNEHCA_0023)\n"); - idr_init(&ehca_qp_idr); - idr_init(&ehca_cq_idr); - spin_lock_init(&ehca_qp_idr_lock); - spin_lock_init(&ehca_cq_idr_lock); - spin_lock_init(&hcall_lock); - - INIT_LIST_HEAD(&shca_list); - spin_lock_init(&shca_list_lock); if ((ret = ehca_create_comp_pool())) { ehca_gen_err("Cannot create comp pool."); diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c index 989f75e..ac4ff26 100644 --- a/drivers/infiniband/hw/ehca/ehca_qp.c +++ b/drivers/infiniband/hw/ehca/ehca_qp.c @@ -933,7 +933,7 @@ static int internal_modify_qp(struct ib_qp *ibqp, u64 h_ret; int bad_wqe_cnt = 0; int squeue_locked = 0; - unsigned long spl_flags = 0; + unsigned long flags = 0; /* do query_qp to obtain current attr values */ mqpcb = ehca_alloc_fw_ctrlblock(GFP_KERNEL); @@ -1074,7 +1074,7 @@ static int internal_modify_qp(struct ib_qp *ibqp, if (!ibqp->uobject) { struct ehca_wq
[PATCH 07/13] IB/ehca: Report RDMA atomic attributes in query_qp()
From: Hoang-Nam Nguyen <[EMAIL PROTECTED]> Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]> --- drivers/infiniband/hw/ehca/ehca_qp.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c index cbb8b5b..989f75e 100644 --- a/drivers/infiniband/hw/ehca/ehca_qp.c +++ b/drivers/infiniband/hw/ehca/ehca_qp.c @@ -1491,6 +1491,9 @@ int ehca_query_qp(struct ib_qp *qp, qp_attr->alt_port_num = qpcb->alt_phys_port; qp_attr->alt_timeout = qpcb->timeout_al; + qp_attr->max_dest_rd_atomic = qpcb->rdma_nr_atomic_resp_res; + qp_attr->max_rd_atomic = qpcb->rdma_atomic_outst_dest_qp; + /* primary av */ qp_attr->ah_attr.sl = qpcb->service_level; -- 1.5.2 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 06/13] IB/ehca: Set SEND_GRH flag for all non-LL UD QPs on eHCA2
From: Stefan Roscher <[EMAIL PROTECTED]> Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]> --- drivers/infiniband/hw/ehca/ehca_qp.c | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c index ffd1ce9..cbb8b5b 100644 --- a/drivers/infiniband/hw/ehca/ehca_qp.c +++ b/drivers/infiniband/hw/ehca/ehca_qp.c @@ -1054,6 +1054,17 @@ static int internal_modify_qp(struct ib_qp *ibqp, "ehca_qp=%p qp_num=%x qp_state_xsit=%x", my_qp, ibqp->qp_num, statetrans); + /* eHCA2 rev2 and higher require the SEND_GRH_FLAG to be set +* in non-LL UD QPs. +*/ + if ((my_qp->qp_type == IB_QPT_UD) && + (my_qp->ext_type != EQPT_LLQP) && + (statetrans == IB_QPST_INIT2RTR) && + (shca->hw_level >= 0x22)){ + update_mask |= EHCA_BMASK_SET(MQPCB_MASK_SEND_GRH_FLAG, 1); + mqpcb->send_grh_flag = 1; + } + /* sqe -> rts: set purge bit of bad wqe before actual trans */ if ((my_qp->qp_type == IB_QPT_UD || my_qp->qp_type == IB_QPT_GSI || -- 1.5.2 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 05/13] IB/ehca: Support UD low latency QPs
From: Stefan Roscher <[EMAIL PROTECTED]> Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]> --- drivers/infiniband/hw/ehca/ehca_qp.c | 84 +++--- 1 files changed, 57 insertions(+), 27 deletions(-) diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c index 9486a44..ffd1ce9 100644 --- a/drivers/infiniband/hw/ehca/ehca_qp.c +++ b/drivers/infiniband/hw/ehca/ehca_qp.c @@ -275,6 +275,11 @@ static inline void queue2resp(struct ipzu_queue_resp *resp, resp->toggle_state = queue->toggle_state; } +static inline int ll_qp_msg_size(int nr_sge) +{ + return 128 << nr_sge; +} + /* * init_qp_queue initializes/constructs r/squeue and registers queue pages. */ @@ -363,8 +368,6 @@ struct ehca_qp *internal_create_qp(struct ib_pd *pd, struct ib_srq_init_attr *srq_init_attr, struct ib_udata *udata, int is_srq) { - static int da_rc_msg_size[] = { 128, 256, 512, 1024, 2048, 4096 }; - static int da_ud_sq_msg_size[]={ 128, 384, 896, 1920, 3968 }; struct ehca_qp *my_qp; struct ehca_pd *my_pd = container_of(pd, struct ehca_pd, ib_pd); struct ehca_shca *shca = container_of(pd->device, struct ehca_shca, @@ -396,6 +399,7 @@ struct ehca_qp *internal_create_qp(struct ib_pd *pd, parms.ll_comp_flags = qp_type & LLQP_COMP_MASK; } qp_type &= 0x1F; + init_attr->qp_type &= 0x1F; /* handle SRQ base QPs */ if (init_attr->srq) { @@ -435,23 +439,49 @@ struct ehca_qp *internal_create_qp(struct ib_pd *pd, return ERR_PTR(-EINVAL); } - if (is_llqp && (qp_type != IB_QPT_RC && qp_type != IB_QPT_UD)) { - ehca_err(pd->device, "unsupported LL QP Type=%x", qp_type); - return ERR_PTR(-EINVAL); - } else if (is_llqp && qp_type == IB_QPT_RC && - (init_attr->cap.max_send_wr > 255 || - init_attr->cap.max_recv_wr > 255 )) { - ehca_err(pd->device, "Invalid Number of max_sq_wr=%x " -"or max_rq_wr=%x for RC LLQP", -init_attr->cap.max_send_wr, -init_attr->cap.max_recv_wr); - return ERR_PTR(-EINVAL); - } else if (is_llqp && qp_type == IB_QPT_UD && -init_attr->cap.max_send_wr > 255) { - ehca_err(pd->device, -"Invalid Number of max_send_wr=%x for UD QP_TYPE=%x", -init_attr->cap.max_send_wr, qp_type); - return ERR_PTR(-EINVAL); + if (is_llqp) { + switch (qp_type) { + case IB_QPT_RC: + if ((init_attr->cap.max_send_wr > 255) || + (init_attr->cap.max_recv_wr > 255)) { + ehca_err(pd->device, +"Invalid Number of max_sq_wr=%x " +"or max_rq_wr=%x for RC LLQP", +init_attr->cap.max_send_wr, +init_attr->cap.max_recv_wr); + return ERR_PTR(-EINVAL); + } + break; + case IB_QPT_UD: + if (!EHCA_BMASK_GET(HCA_CAP_UD_LL_QP, shca->hca_cap)) { + ehca_err(pd->device, "UD LLQP not supported " +"by this adapter"); + return ERR_PTR(-ENOSYS); + } + if (!(init_attr->cap.max_send_sge <= 5 + && init_attr->cap.max_send_sge >= 1 + && init_attr->cap.max_recv_sge <= 5 + && init_attr->cap.max_recv_sge >= 1)) { + ehca_err(pd->device, +"Invalid Number of max_send_sge=%x " +"or max_recv_sge=%x for UD LLQP", +init_attr->cap.max_send_sge, +init_attr->cap.max_recv_sge); + return ERR_PTR(-EINVAL); + } else if (init_attr->cap.max_send_wr > 255) { + ehca_err(pd->device, +"Invalid Number of " +"ax_send_wr=%x for UD QP_TYPE=%x", +init_attr->cap.max_send_wr, qp_type); + return ERR_PTR(-EINVAL); + } + break; + default: + ehca_err(pd->device, "unsupported LL QP Type=%x", +qp_type); + return ERR_PTR(-EINVAL); + break;
[PATCH 04/13] IB/ehca: add Shared Receive Queue support
Support SRQs on eHCA2. Since an SRQ is a QP for eHCA2, a lot of code (structures, create, destroy, post_recv) can be shared between QP and SRQ. Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]> --- drivers/infiniband/hw/ehca/ehca_classes.h | 26 +- drivers/infiniband/hw/ehca/ehca_classes_pSeries.h |4 +- drivers/infiniband/hw/ehca/ehca_iverbs.h | 15 + drivers/infiniband/hw/ehca/ehca_main.c| 16 +- drivers/infiniband/hw/ehca/ehca_qp.c | 451 + drivers/infiniband/hw/ehca/ehca_reqs.c| 47 ++- drivers/infiniband/hw/ehca/ehca_uverbs.c |4 +- drivers/infiniband/hw/ehca/hcp_if.c | 23 +- drivers/infiniband/hw/ehca/hipz_hw.h |1 + 9 files changed, 480 insertions(+), 107 deletions(-) diff --git a/drivers/infiniband/hw/ehca/ehca_classes.h b/drivers/infiniband/hw/ehca/ehca_classes.h index 6e75db6..9d689ae 100644 --- a/drivers/infiniband/hw/ehca/ehca_classes.h +++ b/drivers/infiniband/hw/ehca/ehca_classes.h @@ -5,6 +5,7 @@ * * Authors: Heiko J Schick <[EMAIL PROTECTED]> * Christoph Raisch <[EMAIL PROTECTED]> + * Joachim Fenkes <[EMAIL PROTECTED]> * * Copyright (c) 2005 IBM Corporation * @@ -117,9 +118,20 @@ struct ehca_pd { u32 ownpid; }; +enum ehca_ext_qp_type { + EQPT_NORMAL= 0, + EQPT_LLQP = 1, + EQPT_SRQBASE = 2, + EQPT_SRQ = 3, +}; + struct ehca_qp { - struct ib_qp ib_qp; + union { + struct ib_qp ib_qp; + struct ib_srq ib_srq; + }; u32 qp_type; + enum ehca_ext_qp_type ext_type; struct ipz_queue ipz_squeue; struct ipz_queue ipz_rqueue; struct h_galpas galpas; @@ -142,6 +154,10 @@ struct ehca_qp { u32 mm_count_galpa; }; +#define IS_SRQ(qp) (qp->ext_type == EQPT_SRQ) +#define HAS_SQ(qp) (qp->ext_type != EQPT_SRQ) +#define HAS_RQ(qp) (qp->ext_type != EQPT_SRQBASE) + /* must be power of 2 */ #define QP_HASHTAB_LEN 8 @@ -307,6 +323,7 @@ struct ehca_create_qp_resp { u32 qp_num; u32 token; u32 qp_type; + u32 ext_type; u32 qkey; /* qp_num assigned by ehca: sqp0/1 may have got different numbers */ u32 real_qp_num; @@ -329,13 +346,6 @@ enum ehca_service_type { ST_UD = 3, }; -enum ehca_ext_qp_type { - EQPT_NORMAL= 0, - EQPT_LLQP = 1, - EQPT_SRQBASE = 2, - EQPT_SRQ = 3, -}; - enum ehca_ll_comp_flags { LLQP_SEND_COMP = 0x20, LLQP_RECV_COMP = 0x40, diff --git a/drivers/infiniband/hw/ehca/ehca_classes_pSeries.h b/drivers/infiniband/hw/ehca/ehca_classes_pSeries.h index 5665f21..fb3df5c 100644 --- a/drivers/infiniband/hw/ehca/ehca_classes_pSeries.h +++ b/drivers/infiniband/hw/ehca/ehca_classes_pSeries.h @@ -228,8 +228,8 @@ struct hcp_modify_qp_control_block { #define MQPCB_QP_NUMBER EHCA_BMASK_IBM(8,31) #define MQPCB_MASK_QP_ENABLEEHCA_BMASK_IBM(48,48) #define MQPCB_QP_ENABLE EHCA_BMASK_IBM(31,31) -#define MQPCB_MASK_CURR_SQR_LIMIT EHCA_BMASK_IBM(49,49) -#define MQPCB_CURR_SQR_LIMITEHCA_BMASK_IBM(15,31) +#define MQPCB_MASK_CURR_SRQ_LIMIT EHCA_BMASK_IBM(49,49) +#define MQPCB_CURR_SRQ_LIMITEHCA_BMASK_IBM(16,31) #define MQPCB_MASK_QP_AFF_ASYN_EV_LOG_REG EHCA_BMASK_IBM(50,50) #define MQPCB_MASK_SHARED_RQ_HNDL EHCA_BMASK_IBM(51,51) diff --git a/drivers/infiniband/hw/ehca/ehca_iverbs.h b/drivers/infiniband/hw/ehca/ehca_iverbs.h index 37e7fe0..fd84a80 100644 --- a/drivers/infiniband/hw/ehca/ehca_iverbs.h +++ b/drivers/infiniband/hw/ehca/ehca_iverbs.h @@ -154,6 +154,21 @@ int ehca_post_send(struct ib_qp *qp, struct ib_send_wr *send_wr, int ehca_post_recv(struct ib_qp *qp, struct ib_recv_wr *recv_wr, struct ib_recv_wr **bad_recv_wr); +int ehca_post_srq_recv(struct ib_srq *srq, + struct ib_recv_wr *recv_wr, + struct ib_recv_wr **bad_recv_wr); + +struct ib_srq *ehca_create_srq(struct ib_pd *pd, + struct ib_srq_init_attr *init_attr, + struct ib_udata *udata); + +int ehca_modify_srq(struct ib_srq *srq, struct ib_srq_attr *attr, + enum ib_srq_attr_mask attr_mask, struct ib_udata *udata); + +int ehca_query_srq(struct ib_srq *srq, struct ib_srq_attr *srq_attr); + +int ehca_destroy_srq(struct ib_srq *srq); + u64 ehca_define_sqp(struct ehca_shca *shca, struct ehca_qp *ibqp, struct ib_qp_init_attr *qp_init_attr); diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index befbb9c..9bd749c 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c @@ -343,7 +343,7 @@ int ehca_init_device(struct ehca_shca *shca)
[PATCH 03/13] IB/ehca: QP code restructuring in preparation for SRQ
- Replace init_qp_queues() by a shorter init_qp_queue(), eliminating duplicate code. - hipz_h_alloc_resource_qp() doesn't need a pointer to struct ehca_qp any longer. All input and output data is transferred through the parms parameter. - Change the interface to also support SRQ. Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]> --- drivers/infiniband/hw/ehca/ehca_classes.h | 46 +- drivers/infiniband/hw/ehca/ehca_qp.c | 254 + drivers/infiniband/hw/ehca/hcp_if.c | 35 ++--- drivers/infiniband/hw/ehca/hcp_if.h |1 - 4 files changed, 166 insertions(+), 170 deletions(-) diff --git a/drivers/infiniband/hw/ehca/ehca_classes.h b/drivers/infiniband/hw/ehca/ehca_classes.h index 35d948f..6e75db6 100644 --- a/drivers/infiniband/hw/ehca/ehca_classes.h +++ b/drivers/infiniband/hw/ehca/ehca_classes.h @@ -322,14 +322,49 @@ struct ehca_alloc_cq_parms { struct ipz_eq_handle eq_handle; }; +enum ehca_service_type { + ST_RC = 0, + ST_UC = 1, + ST_RD = 2, + ST_UD = 3, +}; + +enum ehca_ext_qp_type { + EQPT_NORMAL= 0, + EQPT_LLQP = 1, + EQPT_SRQBASE = 2, + EQPT_SRQ = 3, +}; + +enum ehca_ll_comp_flags { + LLQP_SEND_COMP = 0x20, + LLQP_RECV_COMP = 0x40, + LLQP_COMP_MASK = 0x60, +}; + struct ehca_alloc_qp_parms { - int servicetype; +/* input parameters */ + enum ehca_service_type servicetype; int sigtype; - int daqp_ctrl; - int max_send_sge; - int max_recv_sge; + enum ehca_ext_qp_type ext_type; + enum ehca_ll_comp_flags ll_comp_flags; + + int max_send_wr, max_recv_wr; + int max_send_sge, max_recv_sge; int ud_av_l_key_ctl; + u32 token; + struct ipz_eq_handle eq_handle; + struct ipz_pd pd; + struct ipz_cq_handle send_cq_handle, recv_cq_handle; + + u32 srq_qpn, srq_token, srq_limit; + +/* output parameters */ + u32 real_qp_num; + struct ipz_qp_handle qp_handle; + struct h_galpas galpas; + u16 act_nr_send_wqes; u16 act_nr_recv_wqes; u8 act_nr_recv_sges; @@ -337,9 +372,6 @@ struct ehca_alloc_qp_parms { u32 nr_rq_pages; u32 nr_sq_pages; - - struct ipz_eq_handle ipz_eq_handle; - struct ipz_pd pd; }; int ehca_cq_assign_qp(struct ehca_cq *cq, struct ehca_qp *qp); diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c index b5bc787..ec1d555 100644 --- a/drivers/infiniband/hw/ehca/ehca_qp.c +++ b/drivers/infiniband/hw/ehca/ehca_qp.c @@ -234,13 +234,6 @@ static inline enum ib_qp_statetrans get_modqp_statetrans(int ib_fromstate, return index; } -enum ehca_service_type { - ST_RC = 0, - ST_UC = 1, - ST_RD = 2, - ST_UD = 3 -}; - /* * ibqptype2servicetype returns hcp service type corresponding to given * ib qp type used by create_qp() @@ -268,15 +261,16 @@ static inline int ibqptype2servicetype(enum ib_qp_type ibqptype) } /* - * init_qp_queues initializes/constructs r/squeue and registers queue pages. + * init_qp_queue initializes/constructs r/squeue and registers queue pages. */ -static inline int init_qp_queues(struct ehca_shca *shca, -struct ehca_qp *my_qp, -int nr_sq_pages, -int nr_rq_pages, -int swqe_size, -int rwqe_size, -int nr_send_sges, int nr_receive_sges) +static inline int init_qp_queue(struct ehca_shca *shca, + struct ehca_qp *my_qp, + struct ipz_queue *queue, + int q_type, + u64 expected_hret, + int nr_q_pages, + int wqe_size, + int nr_sges) { int ret, cnt, ipz_rc; void *vpage; @@ -284,104 +278,63 @@ static inline int init_qp_queues(struct ehca_shca *shca, struct ib_device *ib_dev = &shca->ib_device; struct ipz_adapter_handle ipz_hca_handle = shca->ipz_hca_handle; - ipz_rc = ipz_queue_ctor(&my_qp->ipz_squeue, - nr_sq_pages, - EHCA_PAGESIZE, swqe_size, nr_send_sges); + if (!nr_q_pages) + return 0; + + ipz_rc = ipz_queue_ctor(queue, nr_q_pages, EHCA_PAGESIZE, + wqe_size, nr_sges); if (!ipz_rc) { - ehca_err(ib_dev,"Cannot allocate page for squeue. ipz_rc=%x", + ehca_err(ib_dev,"Cannot allocate page for queue. ipz_rc=%x", ipz_rc); return -EBUSY; } - ipz_rc = ipz_queue_ctor(&my_qp->ipz_rqueue, - nr_rq_pages, - EHCA_P
[PATCH 02/13] IB/ehca: HW level, HW caps and MTU autodetection
In preparation for support of new eHCA2 features, change adapter probing: - Hardware level is changed to encode major and minor chip version - Hardware capabilities are queried from the firmware - The maximum MTU is queried from the firmware instead of assuming a fixed value Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]> --- drivers/infiniband/hw/ehca/ehca_av.c |6 ++- drivers/infiniband/hw/ehca/ehca_classes.h |2 + drivers/infiniband/hw/ehca/ehca_hca.c | 27 +++- drivers/infiniband/hw/ehca/ehca_main.c| 62 ++--- drivers/infiniband/hw/ehca/hipz_hw.h | 18 5 files changed, 104 insertions(+), 11 deletions(-) diff --git a/drivers/infiniband/hw/ehca/ehca_av.c b/drivers/infiniband/hw/ehca/ehca_av.c index 0d6e2c4..3cd6bf3 100644 --- a/drivers/infiniband/hw/ehca/ehca_av.c +++ b/drivers/infiniband/hw/ehca/ehca_av.c @@ -118,7 +118,7 @@ struct ib_ah *ehca_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr) } memcpy(&av->av.grh.word_1, &gid, sizeof(gid)); } - av->av.pmtu = EHCA_MAX_MTU; + av->av.pmtu = shca->max_mtu; /* dgid comes in grh.word_3 */ memcpy(&av->av.grh.word_3, &ah_attr->grh.dgid, @@ -137,6 +137,8 @@ int ehca_modify_ah(struct ib_ah *ah, struct ib_ah_attr *ah_attr) struct ehca_av *av; struct ehca_ud_av new_ehca_av; struct ehca_pd *my_pd = container_of(ah->pd, struct ehca_pd, ib_pd); + struct ehca_shca *shca = container_of(ah->pd->device, struct ehca_shca, + ib_device); u32 cur_pid = current->tgid; if (my_pd->ib_pd.uobject && my_pd->ib_pd.uobject->context && @@ -192,7 +194,7 @@ int ehca_modify_ah(struct ib_ah *ah, struct ib_ah_attr *ah_attr) memcpy(&new_ehca_av.grh.word_1, &gid, sizeof(gid)); } - new_ehca_av.pmtu = EHCA_MAX_MTU; + new_ehca_av.pmtu = shca->max_mtu; memcpy(&new_ehca_av.grh.word_3, &ah_attr->grh.dgid, sizeof(ah_attr->grh.dgid)); diff --git a/drivers/infiniband/hw/ehca/ehca_classes.h b/drivers/infiniband/hw/ehca/ehca_classes.h index 1d286d3..35d948f 100644 --- a/drivers/infiniband/hw/ehca/ehca_classes.h +++ b/drivers/infiniband/hw/ehca/ehca_classes.h @@ -107,6 +107,8 @@ struct ehca_shca { struct ehca_pd *pd; struct h_galpas galpas; struct mutex modify_mutex; + u64 hca_cap; + int max_mtu; }; struct ehca_pd { diff --git a/drivers/infiniband/hw/ehca/ehca_hca.c b/drivers/infiniband/hw/ehca/ehca_hca.c index 32b55a4..b310de5 100644 --- a/drivers/infiniband/hw/ehca/ehca_hca.c +++ b/drivers/infiniband/hw/ehca/ehca_hca.c @@ -45,11 +45,25 @@ int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props) { - int ret = 0; + int i, ret = 0; struct ehca_shca *shca = container_of(ibdev, struct ehca_shca, ib_device); struct hipz_query_hca *rblock; + static const u32 cap_mapping[] = { + IB_DEVICE_RESIZE_MAX_WR, HCA_CAP_WQE_RESIZE, + IB_DEVICE_BAD_PKEY_CNTR, HCA_CAP_BAD_P_KEY_CTR, + IB_DEVICE_BAD_QKEY_CNTR, HCA_CAP_Q_KEY_VIOL_CTR, + IB_DEVICE_RAW_MULTI, HCA_CAP_RAW_PACKET_MCAST, + IB_DEVICE_AUTO_PATH_MIG, HCA_CAP_AUTO_PATH_MIG, + IB_DEVICE_CHANGE_PHY_PORT,HCA_CAP_SQD_RTS_PORT_CHANGE, + IB_DEVICE_UD_AV_PORT_ENFORCE, HCA_CAP_AH_PORT_NR_CHECK, + IB_DEVICE_CURR_QP_STATE_MOD, HCA_CAP_CUR_QP_STATE_MOD, + IB_DEVICE_SHUTDOWN_PORT, HCA_CAP_SHUTDOWN_PORT, + IB_DEVICE_INIT_TYPE, HCA_CAP_INIT_TYPE, + IB_DEVICE_PORT_ACTIVE_EVENT, HCA_CAP_PORT_ACTIVE_EVENT, + }; + rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL); if (!rblock) { ehca_err(&shca->ib_device, "Can't allocate rblock memory."); @@ -96,6 +110,13 @@ int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props) props->max_total_mcast_qp_attach = min_t(int, rblock->max_total_mcast_qp_attach, INT_MAX); + /* translate device capabilities */ + props->device_cap_flags = IB_DEVICE_SYS_IMAGE_GUID | + IB_DEVICE_RC_RNR_NAK_GEN | IB_DEVICE_N_NOTIFY_CQ; + for (i = 0; i < ARRAY_SIZE(cap_mapping); i += 2) + if (rblock->hca_cap_indicators & cap_mapping[i + 1]) + props->device_cap_flags |= cap_mapping[i]; + query_device1: ehca_free_fw_ctrlblock(rblock); @@ -261,7 +282,7 @@ int ehca_modify_port(struct ib_device *ibdev, } if (mutex_lock_interruptible(&shca->modify_mutex)) -return -ERESTARTSYS; + return -ERESTARTSYS; rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL); if (!rblock) { @@ -290,7 +311,7 @@ modify_port2:
[PATCH 01/13] IB/ehca: change scaling_code parameter description to match default value
From: Hoang-Nam Nguyen <[EMAIL PROTECTED]> Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]> --- drivers/infiniband/hw/ehca/ehca_main.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index c3f99f3..fea199f 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c @@ -94,7 +94,7 @@ MODULE_PARM_DESC(poll_all_eqs, MODULE_PARM_DESC(static_rate, "set permanent static rate (default: disabled)"); MODULE_PARM_DESC(scaling_code, -"set scaling code (0: disabled, 1: enabled/default)"); +"set scaling code (0: disabled/default, 1: enabled)"); spinlock_t ehca_qp_idr_lock; spinlock_t ehca_cq_idr_lock; -- 1.5.2 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 00/13] IB/ehca: eHCA2 enablement & some fixes
This patch series enables the eHCA device driver to support new functions of the eHCA2 chip. In addition, there are some bug fixes, code optimizations and general new features included. Another set of patches will follow. The patches, in detail, are: [01/13] fixes a wrong parameter description [02/13] adds HW capabilities autodetection [03/13] restructures the QP code, preparing for Share Receive Queues (SRQ) [04/13] adds SRQ support [05/13] adds support for UD low latency QPs [06/13] sets a flag that needs to be set on eHCA2 [07/13] adds RDMA atomic attributes to the data returned by query_qp() [08/13] straightens out lock flag naming and adds static initializers [09/13] refactors synchronization between completions and destroy_cq() [10/13] changes the global idr spinlocks into rwlocks [11/13] returns the QP pointer in poll_cq() instead of NULL [12/13] adds notifications in case the SM LID etc. changes [13/13] adds a slight latency improvement The patches should apply cleanly, in order, against Roland's git. Please review the changes and apply the patches for 2.6.23 if they are okay. Regards, Joachim -- Joachim Fenkes -- eHCA Linux Driver Developer and Hardware Tamer IBM Deutschland Entwicklung GmbH -- Dept. 3627 (I/O Firmware Dev. 2) Schoenaicher Strasse 220 -- 71032 Boeblingen -- Germany eMail: [EMAIL PROTECTED] ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 2/5] Add legacy devices to mpc8641_hpcn.dts
Hello. Segher Boessenkool wrote: > +[EMAIL PROTECTED] { > +device_type = "8042"; >>> Drop the device_type. A number as a name isn't >>> all that great, either. >> Yet it's kinda accepted years ago, see: >> http://playground.sun.com/1275/proposals/Closed/Accepted/381-it.txt > That's not a published recommendation or anything like that. There's also this document with a status of "unapproved draft": http://playground.sun.com/1275/bindings/devices/html/8042.html So, all this never got final approval? Somewhat confusing (well, what one could expect from OF? :-) > Segher WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [patch 01/35] pasemi: rename platform
On Sun, 8 Jul 2007 19:18:35 -0500 Olof Johansson <[EMAIL PROTECTED]> wrote: > > On Mon, Jul 09, 2007 at 09:52:59AM +1000, Stephen Rothwell wrote: > > > > This should also fix a problem further up in that file (in > > pasemi_publish_devices) where we check for "machine_is(pasemi)". > > Yup, that's how I discovered the machine name being less than intuitive. So it is worth noting in the chnge log. -- Cheers, Stephen Rothwell[EMAIL PROTECTED] http://www.canb.auug.org.au/~sfr/ pgpID31bVbIpH.pgp Description: PGP signature ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev