* Re: device not available because of BAR 0 collisions
From: Benjamin Herrenschmidt @ 2011-04-26 23:39 UTC (permalink / raw)
To: Steven A. Falco; +Cc: linuxppc-dev
In-Reply-To: <4DB6CAD0.5030102@harris.com>
On Tue, 2011-04-26 at 09:38 -0400, Steven A. Falco wrote:
> On 04/25/2011 08:01 PM, Benjamin Herrenschmidt wrote:
> > On Mon, 2011-04-25 at 16:10 -0400, Steven A. Falco wrote:
> >> I'm getting an error message when trying to talk to some custom
> >> hardware:
> >>
> >> dx83xx 0001:43:00.0: device not available because of BAR 0
> >> [0xa1000000-0xa1ffffff] collisions
> >>
> >> I see in setup-res.c that this message comes out when there is no
> >> parent for
> >> a device resource.
> >
> > .../...
> >
> > It mostly happens in arch/powerpc/kernel/pci-common.c and the generic
> > setup-res.c
> >
> > Try #define DEBUG at the top (before the #includes) of pci-common.c and
> > pci_32.c (remove the exiting #undef in the last one) and send us the
> > full dmesg log, along with the output of cat /proc/iomem
Have you set any specific flags ? IE. Modified the value of
ppc_pci_flags from what the 4xx code sets originally ?
It does look to me like some of your device BARs have been setup already
by the firmware in a way that conflict with the way you configure your
ranges, and the kernel doesn't appear to detect nor try to remap that
which would happen if you have the "probe only" flag set.
IE. On your c0000000 bus, you have memory at 90000000 CPU space mapped
to 80000000 PCI space. However, when probing, the kernel finds:
pci 0001:41:00.0: reg 10 32bit mmio: [0x90000000-0x9001ffff]
IE. A BAR was already set with a value of 90000000 PCI-side which is out
of the bounds you have for your bus.
Maybe you really want to configure that second bus to have CPU 90000000
mapped to 90000000 PCI-side ? (IE. a 1:1 mapping). That would be
something to fix in your "ranges" property.
Cheers,
Ben.
> > Cheers,
> > Ben.
> >
> >
> >
>
> Thanks for the help!
>
> PCIe 0 has an FPGA connected - it is behaving as expected. PCIe 1 has the
> PLX PCIe switch followed by a pair of ASICs - they are the ones generating
> the error.
>
> Here is /proc/iomem:
>
> 90000000-9fffffff : /plb/pciex@0c0000000
> 90000000-93ffffff : PCI Bus 0001:41
> 90000000-93ffffff : PCI Bus 0001:42
> 90000000-91ffffff : PCI Bus 0001:43
> 92000000-93ffffff : PCI Bus 0001:44
> 94000000-940fffff : PCI Bus 0001:41
> 94000000-9401ffff : 0001:41:00.0
> e0000000-e7ffffff : /plb/pciex@0a0000000
> e0000000-e5ffffff : PCI Bus 0000:01
> e0000000-e3ffffff : 0000:01:00.0
> e4000000-e40fffff : 0000:01:00.0
> e4100000-e41fffff : 0000:01:00.0
> ef600200-ef600207 : serial
> ef600300-ef600307 : serial
> ef600600-ef600606 : spi_ppc4xx_of
> ef6c0000-ef6cffff : dwc_otg.0
> ef6c0000-ef6cffff : dwc_otg
> fc000000-ffffffff : fc000000.nor_flash
>
> And here is dmesg, captured after the failed modprobe, so you can see
> those error messages (DEBUG enabled in pci-common.c and pci_32.c):
>
> Using Flex-AM machine description
> Linux version 2.6.30.3-00063-g0af2edc-dirty (sfalco@hw1.cs.myharris.net) (gcc version 4.2.2) #35 Tue Apr 26 09:20:23 EDT 2011
> Found initrd at 0xcfba0000:0xcfea1872
> Found legacy serial port 0 for /plb/opb/serial@ef600200
> mem=ef600200, taddr=ef600200, irq=0, clk=33333333, speed=0
> Found legacy serial port 1 for /plb/opb/serial@ef600300
> mem=ef600300, taddr=ef600300, irq=0, clk=33333333, speed=0
> Top of RAM: 0x10000000, Total RAM: 0x10000000
> Memory hole size: 0MB
> Zone PFN ranges:
> DMA 0x00000000 -> 0x00010000
> Normal 0x00010000 -> 0x00010000
> Movable zone start PFN for each node
> early_node_map[1] active PFN ranges
> 0: 0x00000000 -> 0x00010000
> On node 0 totalpages: 65536
> free_area_init_node: node 0, pgdat c0406bdc, node_mem_map c0443000
> DMA zone: 512 pages used for memmap
> DMA zone: 0 pages reserved
> DMA zone: 65024 pages, LIFO batch:15
> MMU: Allocated 1088 bytes of context maps for 255 contexts
> Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
> Kernel command line: root=/dev/sda2 rw ip=137.237.178.150:137.237.178.9:137.237.178.1:255.255.255.0:flx-am:eth0:off panic=1 console=ttyS1,115200 debug
> NR_IRQS:512
> UIC0 (32 IRQ sources) at DCR 0xc0
> UIC1 (32 IRQ sources) at DCR 0xd0
> irq: irq 30 on host /interrupt-controller mapped to virtual irq 30
> UIC2 (32 IRQ sources) at DCR 0xe0
> irq: irq 28 on host /interrupt-controller mapped to virtual irq 28
> PID hash table entries: 1024 (order: 10, 4096 bytes)
> time_init: decrementer frequency = 400.000000 MHz
> time_init: processor frequency = 400.000000 MHz
> clocksource: timebase mult[a00000] shift[22] registered
> clockevent: decrementer mult[6666] shift[16] cpu[0]
> I-pipe 2.7-02: pipeline enabled.
> Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
> Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
> Memory: 252092k/262144k available (3944k kernel code, 9744k reserved, 184k data, 204k bss, 164k init)
> Kernel virtual memory layout:
> * 0xffffe000..0xfffff000 : fixmap
> * 0xfde00000..0xfe000000 : consistent mem
> * 0xfde00000..0xfde00000 : early ioremap
> * 0xd1000000..0xfde00000 : vmalloc & ioremap
> SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
> Calibrating delay loop... 798.72 BogoMIPS (lpj=1597440)
> Mount-cache hash table entries: 512
> net_namespace: 520 bytes
> NET: Registered protocol family 16
> PCIE0: Checking link...
> PCIE0: Device detected, waiting for link...
> PCIE0: link is up !
> PCI host bridge /plb/pciex@0a0000000 (primary) ranges:
> MEM 0x00000000e0000000..0x00000000e7ffffff -> 0x0000000080000000
> IO 0x00000000e8000000..0x00000000e800ffff -> 0x0000000000000000
> 4xx PCI DMA offset set to 0x00000000
> PCIE0: successfully set as root-complex
> PCIE1: Checking link...
> PCIE1: Device detected, waiting for link...
> PCIE1: link is up !
> PCI host bridge /plb/pciex@0c0000000 (primary) ranges:
> MEM 0x0000000090000000..0x000000009fffffff -> 0x0000000080000000
> IO 0x00000000e8010000..0x00000000e801ffff -> 0x0000000000000000
> 4xx PCI DMA offset set to 0x00000000
> PCIE1: successfully set as root-complex
> PCI: Probing PCI hardware
> PCI: Scanning PHB /plb/pciex@0a0000000
> PCI: PHB IO resource = 00000000fffe0000-00000000fffeffff [100]
> PCI: PHB MEM resource 0 = 00000000e0000000-00000000e7ffffff [200]
> PCI: PHB MEM offset = 0000000060000000
> PCI: PHB IO offset = fffe0000
> pci 0000:00:00.0: reg 10 32bit mmio: [0x000000-0x7fffffff]
> PCI:0000:00:00.0 Resource 0 0000000000000000-000000007fffffff [21208] is unassigned
> PCI: Hiding 4xx host bridge resources 0000:00:00.0
> PCI: Fixup bus devices 0 (PHB)
> pci_busdev_to_OF_node(0,0x0)
> parent is /plb/pciex@0a0000000
> result is <NULL>
> PCI: Try to map irq for 0000:00:00.0...
> pci_busdev_to_OF_node(0,0x0)
> parent is /plb/pciex@0a0000000
> result is <NULL>
> pci 0000:01:00.0: reg 10 32bit mmio: [0x80000000-0x800fffff]
> pci 0000:01:00.0: reg 14 32bit mmio: [0x80100000-0x801fffff]
> pci 0000:01:00.0: reg 18 32bit mmio: [0x84000000-0x87ffffff]
> PCI:0000:01:00.0 Resource 0 0000000080000000-00000000800fffff [20200] fixup...
> PCI:0000:01:00.0 00000000e0000000-00000000e00fffff
> PCI:0000:01:00.0 Resource 1 0000000080100000-00000000801fffff [20200] fixup...
> PCI:0000:01:00.0 00000000e0100000-00000000e01fffff
> PCI:0000:01:00.0 Resource 2 0000000084000000-0000000087ffffff [20200] fixup...
> PCI:0000:01:00.0 00000000e4000000-00000000e7ffffff
> pci 0000:00:00.0: bridge io port: [0x00-0xfff]
> pci 0000:00:00.0: bridge 32bit mmio: [0x80000000-0x87ffffff]
> PCI:0000:00:00.0 Bus rsrc 0 0000000000000000-0000000000000fff [101] fixup...
> PCI:0000:00:00.0 00000000fffe0000-00000000fffe0fff
> PCI:0000:00:00.0 Bus rsrc 1 0000000080000000-0000000087ffffff [200] fixup...
> PCI:0000:00:00.0 00000000e0000000-00000000e7ffffff
> PCI: Fixup bus devices 1 (0000:00:00.0)
> pci_busdev_to_OF_node(1,0x0)
> PCI: Try to map irq for 0000:01:00.0...
> pci_busdev_to_OF_node(1,0x0)
> pci_busdev_to_OF_node(0,0x0)
> parent is /plb/pciex@0a0000000
> result is <NULL>
> Got one, spec 2 cells (0x00000000 0x00000004...) on /interrupt-controller2
> irq: irq 0 on host /interrupt-controller2 mapped to virtual irq 16
> Mapped to linux irq 16
> PCI: Scanning PHB /plb/pciex@0c0000000
> PCI: PHB IO resource = 0000000000000000-000000000000ffff [100]
> PCI: PHB MEM resource 0 = 0000000090000000-000000009fffffff [200]
> PCI: PHB MEM offset = 0000000010000000
> PCI: PHB IO offset = 00000000
> pci 0001:40:00.0: reg 10 32bit mmio: [0x000000-0x7fffffff]
> PCI:0001:40:00.0 Resource 0 0000000000000000-000000007fffffff [21208] is unassigned
> PCI: Hiding 4xx host bridge resources 0001:40:00.0
> PCI: Fixup bus devices 64 (PHB)
> pci_busdev_to_OF_node(64,0x0)
> parent is /plb/pciex@0c0000000
> result is <NULL>
> PCI: Try to map irq for 0001:40:00.0...
> pci_busdev_to_OF_node(64,0x0)
> parent is /plb/pciex@0c0000000
> result is <NULL>
> pci 0001:41:00.0: reg 10 32bit mmio: [0x90000000-0x9001ffff]
> PCI:0001:41:00.0 Resource 0 0000000090000000-000000009001ffff [20200] fixup...
> PCI:0001:41:00.0 00000000a0000000-00000000a001ffff
> pci 0001:41:00.0: PME# supported from D0 D3hot D3cold
> pci 0001:41:00.0: PME# disabled
> pci 0001:40:00.0: bridge io port: [0x00-0xfff]
> pci 0001:40:00.0: bridge 32bit mmio: [0x90000000-0x94ffffff]
> PCI:0001:40:00.0 Bus rsrc 0 0000000000000000-0000000000000fff [101] fixup...
> PCI:0001:40:00.0 0000000000000000-0000000000000fff
> PCI:0001:40:00.0 Bus rsrc 1 0000000090000000-0000000094ffffff [200] fixup...
> PCI:0001:40:00.0 00000000a0000000-00000000a4ffffff
> PCI: Fixup bus devices 65 (0001:40:00.0)
> pci_busdev_to_OF_node(65,0x0)
> PCI: Try to map irq for 0001:41:00.0...
> pci_busdev_to_OF_node(65,0x0)
> pci_busdev_to_OF_node(64,0x0)
> parent is /plb/pciex@0c0000000
> result is <NULL>
> Got one, spec 2 cells (0x0000000b 0x00000004...) on /interrupt-controller2
> irq: irq 11 on host /interrupt-controller2 mapped to virtual irq 17
> Mapped to linux irq 17
> pci 0001:42:01.0: PME# supported from D0 D3hot D3cold
> pci 0001:42:01.0: PME# disabled
> pci 0001:42:02.0: PME# supported from D0 D3hot D3cold
> pci 0001:42:02.0: PME# disabled
> pci 0001:41:00.0: bridge 32bit mmio: [0x90100000-0x94ffffff]
> PCI:0001:41:00.0 Bus rsrc 1 0000000090100000-0000000094ffffff [200] fixup...
> PCI:0001:41:00.0 00000000a0100000-00000000a4ffffff
> PCI: Fixup bus devices 66 (0001:41:00.0)
> pci_busdev_to_OF_node(66,0x8)
> PCI: Try to map irq for 0001:42:01.0...
> pci_busdev_to_OF_node(66,0x8)
> pci_busdev_to_OF_node(65,0x0)
> pci_busdev_to_OF_node(64,0x0)
> parent is /plb/pciex@0c0000000
> result is <NULL>
> Got one, spec 2 cells (0x0000000c 0x00000004...) on /interrupt-controller2
> irq: irq 12 on host /interrupt-controller2 mapped to virtual irq 18
> Mapped to linux irq 18
> pci_busdev_to_OF_node(66,0x10)
> PCI: Try to map irq for 0001:42:02.0...
> pci_busdev_to_OF_node(66,0x10)
> pci_busdev_to_OF_node(65,0x0)
> pci_busdev_to_OF_node(64,0x0)
> parent is /plb/pciex@0c0000000
> result is <NULL>
> Got one, spec 2 cells (0x0000000d 0x00000004...) on /interrupt-controller2
> irq: irq 13 on host /interrupt-controller2 mapped to virtual irq 19
> Mapped to linux irq 19
> pci 0001:43:00.0: reg 10 32bit mmio: [0x91000000-0x91ffffff]
> pci 0001:43:00.0: reg 14 32bit mmio: [0x92000000-0x92ffffff]
> PCI:0001:43:00.0 Resource 0 0000000091000000-0000000091ffffff [21208] fixup...
> PCI:0001:43:00.0 00000000a1000000-00000000a1ffffff
> PCI:0001:43:00.0 Resource 1 0000000092000000-0000000092ffffff [21208] fixup...
> PCI:0001:43:00.0 00000000a2000000-00000000a2ffffff
> pci 0001:42:01.0: bridge 32bit mmio: [0x90100000-0x92ffffff]
> PCI:0001:42:01.0 Bus rsrc 1 0000000090100000-0000000092ffffff [200] fixup...
> PCI:0001:42:01.0 00000000a0100000-00000000a2ffffff
> PCI: Fixup bus devices 67 (0001:42:01.0)
> pci_busdev_to_OF_node(67,0x0)
> PCI: Try to map irq for 0001:43:00.0...
> pci_busdev_to_OF_node(67,0x0)
> pci_busdev_to_OF_node(66,0x8)
> pci_busdev_to_OF_node(65,0x0)
> pci_busdev_to_OF_node(64,0x0)
> parent is /plb/pciex@0c0000000
> result is <NULL>
> Got one, spec 2 cells (0x0000000c 0x00000004...) on /interrupt-controller2
> Mapped to linux irq 18
> pci 0001:44:00.0: reg 10 32bit mmio: [0x93000000-0x93ffffff]
> pci 0001:44:00.0: reg 14 32bit mmio: [0x94000000-0x94ffffff]
> PCI:0001:44:00.0 Resource 0 0000000093000000-0000000093ffffff [21208] fixup...
> PCI:0001:44:00.0 00000000a3000000-00000000a3ffffff
> PCI:0001:44:00.0 Resource 1 0000000094000000-0000000094ffffff [21208] fixup...
> PCI:0001:44:00.0 00000000a4000000-00000000a4ffffff
> pci 0001:42:02.0: bridge 32bit mmio: [0x93000000-0x94ffffff]
> PCI:0001:42:02.0 Bus rsrc 1 0000000093000000-0000000094ffffff [200] fixup...
> PCI:0001:42:02.0 00000000a3000000-00000000a4ffffff
> PCI: Fixup bus devices 68 (0001:42:02.0)
> pci_busdev_to_OF_node(68,0x0)
> PCI: Try to map irq for 0001:44:00.0...
> pci_busdev_to_OF_node(68,0x0)
> pci_busdev_to_OF_node(66,0x10)
> pci_busdev_to_OF_node(65,0x0)
> pci_busdev_to_OF_node(64,0x0)
> parent is /plb/pciex@0c0000000
> result is <NULL>
> Got one, spec 2 cells (0x0000000d 0x00000004...) on /interrupt-controller2
> Mapped to linux irq 19
> PCI: Allocating bus resources for 0000:00...
> PCI: PHB (bus 0) bridge rsrc 0: 00000000fffe0000-00000000fffeffff [0x100], parent c03de440 (PCI IO)
> PCI: PHB (bus 0) bridge rsrc 1: 00000000e0000000-00000000e7ffffff [0x200], parent c03de424 (PCI mem)
> PCI: Allocating bus resources for 0000:01...
> PCI: Allocating bus resources for 0001:40...
> PCI: PHB (bus 64) bridge rsrc 0: 0000000000000000-000000000000ffff [0x100], parent c03de440 (PCI IO)
> PCI: PHB (bus 64) bridge rsrc 1: 0000000090000000-000000009fffffff [0x200], parent c03de424 (PCI mem)
> PCI: Allocating bus resources for 0001:41...
> PCI: Allocating bus resources for 0001:42...
> PCI: Allocating bus resources for 0001:43...
> PCI: Allocating bus resources for 0001:44...
> Reserving legacy ranges for domain 0000
> Candidate legacy IO: [0xfffe0000-0xfffe0fff]
> hose mem offset: 0000000060000000
> hose mem res: [0xe0000000-0xe7ffffff]
> Reserving legacy ranges for domain 0001
> Candidate legacy IO: [0x00-0xfff]
> hose mem offset: 0000000010000000
> hose mem res: [0x90000000-0x9fffffff]
> PCI: Assigning unassigned resources...
> pci 0000:00:00.0: PCI bridge, secondary bus 0000:01
> pci 0000:00:00.0: IO window: disabled
> pci 0000:00:00.0: MEM window: 0x80000000-0x85ffffff
> pci 0000:00:00.0: PREFETCH window: disabled
> pci 0001:42:01.0: PCI bridge, secondary bus 0001:43
> pci 0001:42:01.0: IO window: disabled
> pci 0001:42:01.0: MEM window: disabled
> pci 0001:42:01.0: PREFETCH window: 0x00000080000000-0x00000081ffffff
> pci 0001:42:02.0: PCI bridge, secondary bus 0001:44
> pci 0001:42:02.0: IO window: disabled
> pci 0001:42:02.0: MEM window: disabled
> pci 0001:42:02.0: PREFETCH window: 0x00000082000000-0x00000083ffffff
> pci 0001:41:00.0: PCI bridge, secondary bus 0001:42
> pci 0001:41:00.0: IO window: disabled
> pci 0001:41:00.0: MEM window: disabled
> pci 0001:41:00.0: PREFETCH window: 0x00000080000000-0x00000083ffffff
> pci 0001:40:00.0: PCI bridge, secondary bus 0001:41
> pci 0001:40:00.0: IO window: disabled
> pci 0001:40:00.0: MEM window: 0x84000000-0x840fffff
> pci 0001:40:00.0: PREFETCH window: 0x00000080000000-0x00000083ffffff
> pci_bus 0000:00: resource 0 io: [0xfffe0000-0xfffeffff]
> pci_bus 0000:00: resource 1 mem: [0xe0000000-0xe7ffffff]
> pci_bus 0000:01: resource 0 mem: [0xfffe0000-0xfffe0fff]
> pci_bus 0000:01: resource 1 mem: [0xe0000000-0xe5ffffff]
> pci_bus 0001:40: resource 0 io: [0x00-0xffff]
> pci_bus 0001:40: resource 1 mem: [0x90000000-0x9fffffff]
> pci_bus 0001:41: resource 0 mem: [0x0-0xfff]
> pci_bus 0001:41: resource 1 mem: [0x94000000-0x940fffff]
> pci_bus 0001:41: resource 2 pref mem [0x90000000-0x93ffffff]
> pci_bus 0001:42: resource 1 mem: [0xa0100000-0xa4ffffff]
> pci_bus 0001:42: resource 2 pref mem [0x90000000-0x93ffffff]
> pci_bus 0001:43: resource 1 mem: [0xa0100000-0xa2ffffff]
> pci_bus 0001:43: resource 2 pref mem [0x90000000-0x91ffffff]
> pci_bus 0001:44: resource 1 mem: [0xa3000000-0xa4ffffff]
> pci_bus 0001:44: resource 2 pref mem [0x92000000-0x93ffffff]
> bio: create slab <bio-0> at 0
> SCSI subsystem initialized
> usbcore: registered new interface driver usbfs
> usbcore: registered new interface driver hub
> usbcore: registered new device driver usb
> Switched to high resolution mode on CPU 0
> NET: Registered protocol family 2
> IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
> TCP established hash table entries: 8192 (order: 4, 65536 bytes)
> TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
> TCP: Hash tables configured (established 8192 bind 8192)
> TCP reno registered
> NET: Registered protocol family 1
> Trying to unpack rootfs image as initramfs...
> Freeing initrd memory: 3078k freed
> irq: irq 26 on host /interrupt-controller mapped to virtual irq 26
> irq: irq 1 on host /interrupt-controller mapped to virtual irq 20
> irq: irq 30 on host /interrupt-controller2 mapped to virtual irq 21
> irq: irq 26 on host /interrupt-controller1 mapped to virtual irq 22
> irq: irq 12 on host /interrupt-controller mapped to virtual irq 23
> I-pipe: Domain Xenomai registered.
> Xenomai: hal/powerpc started.
> Xenomai: real-time nucleus v2.4.10 (Flavor Crystal 7) loaded.
> Xenomai: starting native API services.
> Xenomai: starting POSIX services.
> Xenomai: starting RTDM services.
> Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
> fuse init (API version 7.11)
> msgmni has been set to 498
> alg: No test for stdrng (krng)
> io scheduler noop registered
> io scheduler anticipatory registered (default)
> io scheduler deadline registered
> io scheduler cfq registered
> aer 0001:41:00.0:pcie12: service driver aer loaded
> aer 0001:42:01.0:pcie22: service driver aer loaded
> aer 0001:42:02.0:pcie22: service driver aer loaded
> pci_hotplug: PCI Hot Plug PCI Core version: 0.5
> Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
> serial8250.0: ttyS0 at MMIO 0xef600200 (irq = 26) is a 16550A
> serial8250.0: ttyS1 at MMIO 0xef600300 (irq = 20) is a 16550A
> console [ttyS1] enabled
> ef600200.serial: ttyS0 at MMIO 0xef600200 (irq = 26) is a 16550A
> ef600300.serial: ttyS1 at MMIO 0xef600300 (irq = 20) is a 16550A
> brd: module loaded
> Driver 'sd' needs updating - please use bus_type methods
> PPC 4xx OCP EMAC driver, version 3.54
> irq: irq 10 on host /interrupt-controller mapped to virtual irq 24
> irq: irq 11 on host /interrupt-controller mapped to virtual irq 25
> irq: irq 0 on host /interrupt-controller1 mapped to virtual irq 27
> irq: irq 1 on host /interrupt-controller1 mapped to virtual irq 29
> irq: irq 2 on host /interrupt-controller1 mapped to virtual irq 31
> MAL v2 /plb/mcmal, 2 TX channels, 2 RX channels
> RGMII /plb/opb/emac-rgmii@ef600b00 initialized with MDIO support
> irq: irq 24 on host /interrupt-controller mapped to virtual irq 32
> irq: irq 29 on host /interrupt-controller1 mapped to virtual irq 33
> /plb/opb/emac-rgmii@ef600b00: input 0 in RGMII mode
> eth0: EMAC-0 /plb/opb/ethernet@ef600900, MAC 00:90:f9:10:1a:08
> eth0: found Marvell 88E1111 Ethernet PHY (0x04)
> irq: irq 25 on host /interrupt-controller mapped to virtual irq 34
> irq: irq 31 on host /interrupt-controller1 mapped to virtual irq 35
> /plb/opb/emac-rgmii@ef600b00: input 1 in RGMII mode
> eth1: EMAC-1 /plb/opb/ethernet@ef600a00, MAC 00:90:f9:10:1a:09
> eth1: found Marvell 88E1111 Ethernet PHY (0x05)
> fc000000.nor_flash: Found 1 x16 devices at 0x0 in 16-bit bank
> Intel/Sharp Extended Query Table at 0x010A
> Intel/Sharp Extended Query Table at 0x010A
> Intel/Sharp Extended Query Table at 0x010A
> Intel/Sharp Extended Query Table at 0x010A
> Intel/Sharp Extended Query Table at 0x010A
> Using buffer write method
> Using auto-unlock on power-up/resume
> cfi_cmdset_0001: Erase suspend on write enabled
> erase region 0: offset=0x0,size=0x8000,blocks=4
> erase region 1: offset=0x20000,size=0x20000,blocks=511
> RedBoot partition parsing not available
> Creating 7 MTD partitions on "fc000000.nor_flash":
> 0x000000000000-0x000000800000 : "kernel0"
> 0x000000800000-0x000001000000 : "kernel1"
> 0x000001000000-0x000001800000 : "kernel2"
> 0x000001800000-0x000003f40000 : "install"
> 0x000003f40000-0x000003f60000 : "env0"
> 0x000003f60000-0x000003f80000 : "env1"
> 0x000003f80000-0x000004000000 : "u-boot"
> irq: irq 8 on host /interrupt-controller mapped to virtual irq 36
> spi_ppc4xx_of ef600600.spi: driver initialized
> Initializing USB Mass Storage driver...
> usbcore: registered new interface driver usb-storage
> USB Mass Storage support registered.
> dwc_otg: version 2.60a 22-NOV-2006
> dwc_otg: Shared Tx FIFO mode
> dwc_otg: Using DMA mode
> dwc_otg dwc_otg.0: DWC OTG Controller
> dwc_otg dwc_otg.0: new USB bus registered, assigned bus number 1
> dwc_otg dwc_otg.0: irq 21, io mem 0x00000000
> dwc_otg: Init: Port Power? op_state=1
> dwc_otg: Init: Power Port (0)
> usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
> usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
> usb usb1: Product: DWC OTG Controller
> usb usb1: Manufacturer: Linux 2.6.30.3-00063-g0af2edc-dirty dwc_otg_hcd
> usb usb1: SerialNumber: dwc_otg.0
> usb usb1: configuration #1 chosen from 1 choice
> hub 1-0:1.0: USB hub found
> hub 1-0:1.0: 1 port detected
> i2c /dev entries driver
> irq: irq 2 on host /interrupt-controller mapped to virtual irq 37
> ibm-iic ef600400.i2c: using standard (100 kHz) mode
> irq: irq 7 on host /interrupt-controller mapped to virtual irq 38
> ibm-iic ef600500.i2c: using standard (100 kHz) mode
> lm75: probe of 0-0048 failed with error -121
> hwmon-vid: Unknown VRM version of your CPU
> PowerPC Book-E Watchdog Timer Loaded
> TCP cubic registered
> Initializing XFRM netlink socket
> NET: Registered protocol family 17
> NET: Registered protocol family 15
> RPC: Registered udp transport module.
> RPC: Registered tcp transport module.
> 802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
> All bugs added by David S. Miller <davem@redhat.com>
> usb 1-1: new high speed USB device using dwc_otg and address 2
> usb 1-1: New USB device found, idVendor=0634, idProduct=0655
> usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> usb 1-1: Product: Real SSD eUSB 2GB
> usb 1-1: Manufacturer: Micron Technology
> usb 1-1: SerialNumber: 4BF0022700035321
> usb 1-1: configuration #1 chosen from 1 choice
> scsi0 : SCSI emulation for USB Mass Storage devices
> usb-storage: device found at 2
> usb-storage: waiting for device to settle before scanning
> eth0: link is down
> eth0: link is up, 100 HDX
> IP-Config: Complete:
> device=eth0, addr=137.237.178.150, mask=255.255.255.0, gw=137.237.178.1,
> host=flx-am, domain=, nis-domain=(none),
> bootserver=137.237.178.9, rootserver=137.237.178.9, rootpath=
> Freeing unused kernel memory: 164k init
> at24 0-0050: 512 byte 24c04 EEPROM (writable)
> at24 0-0052: 512 byte 24c04 EEPROM (writable)
> scsi 0:0:0:0: Direct-Access MICRON eUSB DISK 1110 PQ: 0 ANSI: 0 CCS
> sd 0:0:0:0: Attached scsi generic sg0 type 0
> usb-storage: device scan complete
> sd 0:0:0:0: [sda] 3964928 512-byte hardware sectors: (2.03 GB/1.89 GiB)
> sd 0:0:0:0: [sda] Write Protect is off
> sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
> sd 0:0:0:0: [sda] Assuming drive cache: write through
> sd 0:0:0:0: [sda] Assuming drive cache: write through
> sda: sda1 sda2 sda3 sda4
> sd 0:0:0:0: [sda] Attached SCSI disk
> kjournald starting. Commit interval 5 seconds
> EXT3 FS on sda2, internal journal
> EXT3-fs: mounted filesystem with journal data mode.
> kjournald starting. Commit interval 5 seconds
> EXT3 FS on sda1, internal journal
> EXT3-fs: mounted filesystem with journal data mode.
> kjournald starting. Commit interval 5 seconds
> EXT3 FS on sda3, internal journal
> EXT3-fs: mounted filesystem with journal data mode.
> kjournald starting. Commit interval 5 seconds
> EXT3 FS on sda4, internal journal
> EXT3-fs: mounted filesystem with journal data mode.
> at24 0-0050: 512 byte 24c04 EEPROM (writable)
> at24 0-0052: 512 byte 24c04 EEPROM (writable)
> dx83xx 0001:43:00.0: device not available because of BAR 0 [0xa1000000-0xa1ffffff] collisions
> dx83xx: probe of 0001:43:00.0 failed with error -22
> dx83xx 0001:44:00.0: device not available because of BAR 0 [0xa3000000-0xa3ffffff] collisions
> dx83xx: probe of 0001:44:00.0 failed with error -22
^ permalink raw reply
* linux-next: ibmveth runtime errors
From: Stephen Rothwell @ 2011-04-27 4:49 UTC (permalink / raw)
To: ppc-dev
Cc: netdev, LKML, "Michał Mirosław", linux-next,
Santiago Leon, David Miller
[-- Attachment #1: Type: text/plain, Size: 579 bytes --]
Hi all,
For the last couple of days, linux-next booting on a few of our Power
partitions (but not all) have produced this error (over and over):
ibmveth 3000000b: eth0: tx: h_send_logical_lan failed with rc=-4
Linus' tree seems to boot fine on these partitions. The only commit
directly affecting ibmveth in linux-next is b9367bf3ee6d ("net: ibmveth:
convert to hw_features") which first appeared in next-20110421 which is
also the first one that failed.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* Re: hvc_console: Don't access hvc_task if not initialised
From: Rusty Russell @ 2011-04-27 5:01 UTC (permalink / raw)
To: Amit Shah, Greg KH; +Cc: linux-kernel, Milton Miller, linuxppc-dev
In-Reply-To: <20110420170610.GA6013@amit-x200.redhat.com>
On Wed, 20 Apr 2011 22:36:10 +0530, Amit Shah <amit.shah@redhat.com> wrote:
> On (Wed) 20 Apr 2011 [07:34:35], Greg KH wrote:
> > Care to either create this patch, or resend your original one, if you
> > want it applied?
>
> Rusty has the other one queued. I pinged him about status.
It's merged, but I don't think it had the requisite cc:stable, did it?
Thanks,
Rusty.
^ permalink raw reply
* [PATCH] powerpc/85xx: add host-pci(e) bridge only for RC
From: Prabhakar Kushwaha @ 2011-04-27 5:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: meet2prabhu, Vivek Mahajan, Prabhakar Kushwaha
FSL PCIe controller can act as agent(EP) or host(RC).
Under Agent(EP) mode they are configured via Host. So it is not required to add
with the PCI(e) sub-system.
Add and configure PCIe controller only for RC mode.
Signed-off-by: Vivek Mahajan <vivek.mahajan@freescale.com>
Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
---
Based upon git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git(branch master)
arch/powerpc/sysdev/fsl_pci.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 68ca929..87ac11b 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -323,6 +323,7 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary)
struct pci_controller *hose;
struct resource rsrc;
const int *bus_range;
+ u8 is_agent;
if (!of_device_is_available(dev)) {
pr_warning("%s: disabled\n", dev->full_name);
@@ -353,6 +354,19 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary)
setup_indirect_pci(hose, rsrc.start, rsrc.start + 0x4,
PPC_INDIRECT_TYPE_BIG_ENDIAN);
+
+ early_read_config_byte(hose, 0, 0, PCI_HEADER_TYPE, &is_agent);
+ if ((is_agent & 0x7f) == PCI_HEADER_TYPE_NORMAL) {
+ u32 temp;
+
+ temp = (u32)hose->cfg_data & ~PAGE_MASK;
+ if (((u32)hose->cfg_data & PAGE_MASK) != (u32)hose->cfg_addr)
+ iounmap(hose->cfg_data - temp);
+ iounmap(hose->cfg_addr);
+ pcibios_free_controller(hose);
+ return 0;
+ }
+
setup_pci_cmd(hose);
/* check PCI express link status */
--
1.7.3
^ permalink raw reply related
* Re: hvc_console: Don't access hvc_task if not initialised
From: Amit Shah @ 2011-04-27 6:31 UTC (permalink / raw)
To: Rusty Russell; +Cc: linuxppc-dev, Greg KH, linux-kernel, Milton Miller
In-Reply-To: <87oc3sl23a.fsf@rustcorp.com.au>
On (Wed) 27 Apr 2011 [14:31:29], Rusty Russell wrote:
> On Wed, 20 Apr 2011 22:36:10 +0530, Amit Shah <amit.shah@redhat.com> wrote:
> > On (Wed) 20 Apr 2011 [07:34:35], Greg KH wrote:
> > > Care to either create this patch, or resend your original one, if you
> > > want it applied?
> >
> > Rusty has the other one queued. I pinged him about status.
>
> It's merged, but I don't think it had the requisite cc:stable, did it?
No, because at the point of submitting I didn't know it would solve
this bug as well. Greg, can you pick
afa2689e19073cd2e762d0f2c1358fab1ab9f18c for stable?
Thanks,
Amit
^ permalink raw reply
* RE: [PATCH V4] POWER: perf_event: Skip updating kernel counters if register value shrinks
From: David Laight @ 2011-04-27 7:40 UTC (permalink / raw)
To: Eric B Munson, benh
Cc: a.p.zijlstra, linux-kernel, paulus, anton, acme, mingo,
linuxppc-dev, stable
In-Reply-To: <1302891150-8121-1-git-send-email-emunson@mgebm.net>
I keep telling Eric that the code below is incorrect
modulo arithimetic...
> +static u64 check_and_compute_delta(u64 prev, u64 val)
> +{
> + u64 delta =3D (val - prev) & 0xfffffffful;
> +
> + /*
> + * POWER7 can roll back counter values, if the new value is
smaller
> + * than the previous value it will cause the delta and the
counter to
> + * have bogus values unless we rolled a counter over. If a
coutner is
> + * rolled back, it will be smaller, but within 256, which is the
maximum
> + * number of events to rollback at once. If we dectect a
rollback
> + * return 0. This can lead to a small lack of precision in the
> + * counters.
> + */
> + if (prev > val && (prev - val) < 256)
> + delta =3D 0;
> +
> + return delta;
The code should detect rollback by looking at the value of 'delta'
otherwise there are horrid end effects near 2^32-1.
For instance:
u32 delta =3D val - prev;
return delta & 0x80000000 ? 0 : delta;
David
^ permalink raw reply
* Re: linux-next: ibmveth runtime errors
From: Michał Mirosław @ 2011-04-27 10:36 UTC (permalink / raw)
To: Stephen Rothwell
Cc: netdev, ppc-dev, LKML, linux-next, Santiago Leon, David Miller
In-Reply-To: <20110427144901.4c3f79b3.sfr@canb.auug.org.au>
On Wed, Apr 27, 2011 at 02:49:01PM +1000, Stephen Rothwell wrote:
> For the last couple of days, linux-next booting on a few of our Power
> partitions (but not all) have produced this error (over and over):
>
> ibmveth 3000000b: eth0: tx: h_send_logical_lan failed with rc=-4
>
> Linus' tree seems to boot fine on these partitions. The only commit
> directly affecting ibmveth in linux-next is b9367bf3ee6d ("net: ibmveth:
> convert to hw_features") which first appeared in next-20110421 which is
> also the first one that failed.
Please test the following patch. It's just a blind guess, as this error
is not descriptive.
Best Regards,
Michał Mirosław
---
net: ibmveth: force reconfiguring checksum settings on startup
Commit b9367bf3ee6d ("net: ibmveth: convert to hw_features") accidentally
removed call to ibmveth_set_csum_offload() in ibmveth_probe(). Put the
call back where it was, but with additional error checking provided
by ibmveth_set_features().
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/net/ibmveth.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index 4855f1f..0d1fea2 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -1397,6 +1397,8 @@ static int __devinit ibmveth_probe(struct vio_dev *dev,
netdev_dbg(netdev, "registering netdev...\n");
+ ibmveth_set_features(dev, dev->features);
+
rc = register_netdev(netdev);
if (rc) {
--
1.7.2.5
^ permalink raw reply related
* Re: [PATCH V4] POWER: perf_event: Skip updating kernel counters if register value shrinks
From: Eric B Munson @ 2011-04-27 12:19 UTC (permalink / raw)
To: David Laight
Cc: a.p.zijlstra, linux-kernel, paulus, anton, acme, mingo,
linuxppc-dev, stable
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6D8ACFA@saturn3.aculab.com>
[-- Attachment #1: Type: text/plain, Size: 1529 bytes --]
On Wed, 27 Apr 2011, David Laight wrote:
> I keep telling Eric that the code below is incorrect
> modulo arithimetic...
But it isn't, and it doesn't have trouble with 2^32 - 1. Here is one done by
hand:
Counter is at 0xffffffff and is rolled over to 0x101 (258 counted items so
that we miss the test for rollback).
0x00000000ffffffff (Remember counters are 32 bit, but we store them in 64)
-0x0000000000000101
=0xffffffff00000102
After the mask we have 0x00000000000102, the actual difference between the
counters.
>
> > +static u64 check_and_compute_delta(u64 prev, u64 val)
> > +{
> > + u64 delta = (val - prev) & 0xfffffffful;
> > +
> > + /*
> > + * POWER7 can roll back counter values, if the new value is
> smaller
> > + * than the previous value it will cause the delta and the
> counter to
> > + * have bogus values unless we rolled a counter over. If a
> coutner is
> > + * rolled back, it will be smaller, but within 256, which is the
> maximum
> > + * number of events to rollback at once. If we dectect a
> rollback
> > + * return 0. This can lead to a small lack of precision in the
> > + * counters.
> > + */
> > + if (prev > val && (prev - val) < 256)
> > + delta = 0;
> > +
> > + return delta;
>
> The code should detect rollback by looking at the value of 'delta'
> otherwise there are horrid end effects near 2^32-1.
>
> For instance:
> u32 delta = val - prev;
> return delta & 0x80000000 ? 0 : delta;
>
>
> David
>
>
>
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* RE: [PATCH V4] POWER: perf_event: Skip updating kernel counters if register value shrinks
From: David Laight @ 2011-04-27 12:34 UTC (permalink / raw)
To: Eric B Munson
Cc: a.p.zijlstra, linux-kernel, paulus, anton, acme, mingo,
linuxppc-dev, stable
In-Reply-To: <20110427121902.GA2936@mgebm.net>
> But it isn't, and it doesn't have trouble with 2^32 - 1. =20
what about:
prev =3D 0x00000001
val =3D 0xffffffff
David
^ permalink raw reply
* RE: [PATCH V4] POWER: perf_event: Skip updating kernel counters if register value shrinks
From: David Laight @ 2011-04-27 12:42 UTC (permalink / raw)
To: Eric B Munson
Cc: a.p.zijlstra, linux-kernel, paulus, anton, acme, mingo,
linuxppc-dev, stable
In-Reply-To: <20110427121902.GA2936@mgebm.net>
=20
> + if (prev > val && (prev - val) < 256)
> + delta =3D 0;
> +
> + return delta;
Also, 'prev' is a true 64bit value, but 'val' is only ever 32bits.
So once the 64bit 'prev' exceeds 2^32+256 both 'prev > val'
and 'prev - val' are true regardless of the value of 'val'.
This will lead to jumps in the value ....
David
^ permalink raw reply
* Re: [PATCH V4] POWER: perf_event: Skip updating kernel counters if register value shrinks
From: Eric B Munson @ 2011-04-27 12:59 UTC (permalink / raw)
To: David Laight
Cc: a.p.zijlstra, linux-kernel, paulus, anton, acme, mingo,
linuxppc-dev, stable
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6D8AD03@saturn3.aculab.com>
[-- Attachment #1: Type: text/plain, Size: 232 bytes --]
On Wed, 27 Apr 2011, David Laight wrote:
> > But it isn't, and it doesn't have trouble with 2^32 - 1.
>
> what about:
> prev = 0x00000001
> val = 0xffffffff
Result is 0xfffffffe and we are fine.
>
> David
>
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* RE: [PATCH V4] POWER: perf_event: Skip updating kernel counters if register value shrinks
From: David Laight @ 2011-04-27 13:04 UTC (permalink / raw)
To: Eric B Munson
Cc: a.p.zijlstra, linux-kernel, paulus, anton, acme, mingo,
linuxppc-dev, stable
In-Reply-To: <20110427125930.GB2936@mgebm.net>
=20
> On Wed, 27 Apr 2011, David Laight wrote:
>=20
> > > But it isn't, and it doesn't have trouble with 2^32 - 1. =20
> >=20
> > what about:
> > prev =3D 0x00000001
> > val =3D 0xffffffff
>=20
> Result is 0xfffffffe and we are fine.
'delta' will be 0xfffffffe, but you need the function to
return zero - since the underlying counter has decremented
by 2. But 'prev > val' is false so the counter will
be increased by 2^32-2.
David
^ permalink raw reply
* Re: [PATCH V4] POWER: perf_event: Skip updating kernel counters if register value shrinks
From: Eric B Munson @ 2011-04-27 13:08 UTC (permalink / raw)
To: David Laight
Cc: a.p.zijlstra, linux-kernel, paulus, anton, acme, mingo,
linuxppc-dev, stable
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6D8AD04@saturn3.aculab.com>
[-- Attachment #1: Type: text/plain, Size: 596 bytes --]
On Wed, 27 Apr 2011, David Laight wrote:
>
> > + if (prev > val && (prev - val) < 256)
> > + delta = 0;
> > +
> > + return delta;
>
> Also, 'prev' is a true 64bit value, but 'val' is only ever 32bits.
> So once the 64bit 'prev' exceeds 2^32+256 both 'prev > val'
> and 'prev - val' are true regardless of the value of 'val'.
> This will lead to jumps in the value ....
prev and val are both 64 bit variables holding 32 bit numbers, we do not
accumulate in either, they are both replaced by values directly from the
registers. So prev > val will not always be true.
Eric
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* RE: [PATCH V4] POWER: perf_event: Skip updating kernel counters if register value shrinks
From: David Laight @ 2011-04-27 13:13 UTC (permalink / raw)
To: Eric B Munson
Cc: a.p.zijlstra, linux-kernel, paulus, anton, acme, mingo,
linuxppc-dev, stable
In-Reply-To: <20110427130822.GC2936@mgebm.net>
=20
> prev and val are both 64 bit variables holding 32 bit numbers, we do
not
> accumulate in either, they are both replaced by values directly from
the
> registers.
> So prev > val will not always be true.
The code seems to be:
prev =3D local64_read(&event->hw.prev_count);
val =3D read_pmc(event->hw.idx);
delta =3D check_and_compute_delta(prev, val);
local64_add(delta, &event->count);
Which looks very much like 'prev' being a 64bit counter generated
from the 32bit pmc register.
David
^ permalink raw reply
* Re: [PATCH V4] POWER: perf_event: Skip updating kernel counters if register value shrinks
From: Eric B Munson @ 2011-04-27 13:20 UTC (permalink / raw)
To: David Laight
Cc: a.p.zijlstra, linux-kernel, paulus, anton, acme, mingo,
linuxppc-dev, stable
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6D8AD06@saturn3.aculab.com>
[-- Attachment #1: Type: text/plain, Size: 663 bytes --]
On Wed, 27 Apr 2011, David Laight wrote:
>
> > prev and val are both 64 bit variables holding 32 bit numbers, we do
> not
> > accumulate in either, they are both replaced by values directly from
> the
> > registers.
> > So prev > val will not always be true.
>
> The code seems to be:
> prev = local64_read(&event->hw.prev_count);
> val = read_pmc(event->hw.idx);
> delta = check_and_compute_delta(prev, val);
> local64_add(delta, &event->count);
> Which looks very much like 'prev' being a 64bit counter generated
> from the 32bit pmc register.
>
Which implies that it will only ever be 32 bits wide, just stored in 64.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* RE: [PATCH V4] POWER: perf_event: Skip updating kernel counters if register value shrinks
From: Benjamin Herrenschmidt @ 2011-04-27 13:26 UTC (permalink / raw)
To: David Laight
Cc: a.p.zijlstra, linux-kernel, paulus, Eric B Munson, acme, mingo,
linuxppc-dev, stable, anton
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6D8ACFA@saturn3.aculab.com>
On Wed, 2011-04-27 at 08:40 +0100, David Laight wrote:
> I keep telling Eric that the code below is incorrect
> modulo arithimetic...
His previous versions were wrong yes. This one should be limping along
afaik. But I tend to agree, testing delta is the way to go.
Eric idea was to not test the sign bit to allow for bigger increments of
the counter, since the rollback is limited to 255... But I agree it's
non obvious.
I've put the patch in for now, we can always followup with something
better.
Cheers,
Ben.
> > +static u64 check_and_compute_delta(u64 prev, u64 val)
> > +{
> > + u64 delta = (val - prev) & 0xfffffffful;
> > +
> > + /*
> > + * POWER7 can roll back counter values, if the new value is
> smaller
> > + * than the previous value it will cause the delta and the
> counter to
> > + * have bogus values unless we rolled a counter over. If a
> coutner is
> > + * rolled back, it will be smaller, but within 256, which is the
> maximum
> > + * number of events to rollback at once. If we dectect a
> rollback
> > + * return 0. This can lead to a small lack of precision in the
> > + * counters.
> > + */
> > + if (prev > val && (prev - val) < 256)
> > + delta = 0;
> > +
> > + return delta;
>
> The code should detect rollback by looking at the value of 'delta'
> otherwise there are horrid end effects near 2^32-1.
>
> For instance:
> u32 delta = val - prev;
> return delta & 0x80000000 ? 0 : delta;
>
>
> David
>
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply
* Re: device not available because of BAR 0 collisions
From: Steven A. Falco @ 2011-04-27 14:22 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1303861178.2513.171.camel@pasglop>
On 04/26/2011 07:39 PM, Benjamin Herrenschmidt wrote:
> On Tue, 2011-04-26 at 09:38 -0400, Steven A. Falco wrote:
>> On 04/25/2011 08:01 PM, Benjamin Herrenschmidt wrote:
>>> On Mon, 2011-04-25 at 16:10 -0400, Steven A. Falco wrote:
>>>> I'm getting an error message when trying to talk to some custom
>>>> hardware:
>>>>
>>>> dx83xx 0001:43:00.0: device not available because of BAR 0
>>>> [0xa1000000-0xa1ffffff] collisions
>>>>
>>>> I see in setup-res.c that this message comes out when there is no
>>>> parent for
>>>> a device resource.
>>>
>>> .../...
>>>
>>> It mostly happens in arch/powerpc/kernel/pci-common.c and the generic
>>> setup-res.c
>>>
>>> Try #define DEBUG at the top (before the #includes) of pci-common.c and
>>> pci_32.c (remove the exiting #undef in the last one) and send us the
>>> full dmesg log, along with the output of cat /proc/iomem
>
> Have you set any specific flags ? IE. Modified the value of
> ppc_pci_flags from what the 4xx code sets originally ?
The only flag that is set is the same as what is in Kilauea:
ppc_pci_set_flags(PPC_PCI_REASSIGN_ALL_RSRC);
> It does look to me like some of your device BARs have been setup already
> by the firmware in a way that conflict with the way you configure your
> ranges, and the kernel doesn't appear to detect nor try to remap that
> which would happen if you have the "probe only" flag set.
That is possible. The PLX PCIe switch chip does use some memory for its
own purposes - namely to expose the PCIe config space in memory. I believe
that is where the extra 128 k bytes are coming from.
Do I need to represent the PCIe switch in the device tree? If so, is
there an example of what it might look like? I took a stab at it, shown
below.
I believe you are correct - that PLX switch's own memory appears to be
confusing the allocation process. Perhaps the allocation code does not
expect bridges/switches to require memory of their own.
> IE. On your c0000000 bus, you have memory at 90000000 CPU space mapped
> to 80000000 PCI space. However, when probing, the kernel finds:
>
> pci 0001:41:00.0: reg 10 32bit mmio: [0x90000000-0x9001ffff]
>
> IE. A BAR was already set with a value of 90000000 PCI-side which is out
> of the bounds you have for your bus.
>
> Maybe you really want to configure that second bus to have CPU 90000000
> mapped to 90000000 PCI-side ? (IE. a 1:1 mapping). That would be
> something to fix in your "ranges" property.
I've taken a shot at representing the PCIe switch in the device tree, and
I've gone to a 1:1 mapping. Here is what the device tree now has:
PCIE1: pciex@0c0000000 {
device_type = "pci";
#interrupt-cells = <1>;
#size-cells = <2>;
#address-cells = <3>;
compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
primary;
port = <0x1>; /* port number */
reg = <0xc0000000 0x20000000 /* Config space access */
0xef001000 0x00001000>; /* Registers */
dcr-reg = <0x060 0x020>;
sdr-base = <0x440>;
ranges = <0x02000000 0x00000000 0x90000000 0x90000000 0x00000000 0x10000000
0x01000000 0x00000000 0x00000000 0xe8010000 0x00000000 0x00010000>;
dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x80000000>;
bus-range = <0x40 0x7f>;
interrupt-map-mask = <0x0 0x0 0x0 0x7>;
interrupt-map = <
0x0 0x0 0x0 0x1 &UIC2 0xb 0x4 /* swizzled int A */
0x0 0x0 0x0 0x2 &UIC2 0xc 0x4 /* swizzled int B */
0x0 0x0 0x0 0x3 &UIC2 0xd 0x4 /* swizzled int C */
0x0 0x0 0x0 0x4 &UIC2 0xe 0x4 /* swizzled int D */>;
/* PLX PCIe switch - no idea if this is correct / necessary yet */
pcie@0 {
#size-cells = <2>;
#address-cells = <3>;
device_type = "pci";
reg = <0 0 0 0 0>;
ranges = <0x02000000 0x00000000 0x90000000 0x02000000 0x00000000 0x90000000 0x00000000 0x10000000
0x01000000 0x00000000 0x00000000 0x01000000 0x00000000 0x00000000 0x00000000 0x00010000>;
};
};
/proc/iomem is unchanged. It looks a bit strange. I see space reserved
for bus 0001:43 and 0001:44, but I don't see the actual device BARs. I.e.
I'd expect to see four extra lines:
90000000-90ffffff : 0001:43.00.0 // ASIC 0 BAR 0
91000000-91ffffff : 0001:43.00.0 // ASIC 0 BAR 1
92000000-92ffffff : 0001:44.00.0 // ASIC 1 BAR 0
93000000-93ffffff : 0001:44.00.0 // ASIC 1 BAR 1
Here is what I do see. Notice that the above lines are missing:
90000000-9fffffff : /plb/pciex@0c0000000
90000000-93ffffff : PCI Bus 0001:41
90000000-93ffffff : PCI Bus 0001:42
90000000-91ffffff : PCI Bus 0001:43 // Bus is shown but no device connected
92000000-93ffffff : PCI Bus 0001:44 // Bus is shown but no device connected
94000000-940fffff : PCI Bus 0001:41
94000000-9401ffff : 0001:41:00.0 // PLX PCIe switch BAR 0 - 128 kB
e0000000-e7ffffff : /plb/pciex@0a0000000
e0000000-e5ffffff : PCI Bus 0000:01
e0000000-e3ffffff : 0000:01:00.0
e4000000-e40fffff : 0000:01:00.0
e4100000-e41fffff : 0000:01:00.0
ef600200-ef600207 : serial
ef600300-ef600307 : serial
ef600600-ef600606 : spi_ppc4xx_of
ef6c0000-ef6cffff : dwc_otg.0
ef6c0000-ef6cffff : dwc_otg
fc000000-ffffffff : fc000000.nor_flash
Here is a new dmesg log. What you will see is that the various fixups
now produce CPU addresses identical to the bus addresses. But the
"order" is messed up. In the /proc/iomem above, the PCIe switch
resources show up as 94000000-9401ffff : 0001:41:00.0, but in the
log below, you will see PCI:0001:41:00.0 Resource 0 0000000090000000-000000009001ffff
So somehow it moved. And that in turn moves the ASICs also.
/proc/iomem has:
90000000-91ffffff : PCI Bus 0001:43
92000000-93ffffff : PCI Bus 0001:44
but the log below has:
pci 0001:43:00.0: reg 10 32bit mmio: [0x91000000-0x91ffffff]
pci 0001:43:00.0: reg 14 32bit mmio: [0x92000000-0x92ffffff]
pci 0001:44:00.0: reg 10 32bit mmio: [0x93000000-0x93ffffff]
pci 0001:44:00.0: reg 14 32bit mmio: [0x94000000-0x94ffffff]
Since this is embedded hardware, I have no objection to completely
specifying things in the dts. My problem is that I have not found any
examples of how I would do this. And my attempts to come up with the
right magic on my own have so far not worked. :-)
Steve
Using Flex-AM machine description
Linux version 2.6.30.3-00063-g0af2edc-dirty (sfalco@hw1.cs.myharris.net) (gcc version 4.2.2) #49 Wed Apr 27 09:32:09 EDT 2011
Found legacy serial port 0 for /plb/opb/serial@ef600200
mem=ef600200, taddr=ef600200, irq=0, clk=33333333, speed=0
Found legacy serial port 1 for /plb/opb/serial@ef600300
mem=ef600300, taddr=ef600300, irq=0, clk=33333333, speed=0
Top of RAM: 0x10000000, Total RAM: 0x10000000
Memory hole size: 0MB
Zone PFN ranges:
DMA 0x00000000 -> 0x00010000
Normal 0x00010000 -> 0x00010000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00000000 -> 0x00010000
On node 0 totalpages: 65536
free_area_init_node: node 0, pgdat c0406bdc, node_mem_map c053b000
DMA zone: 512 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 65024 pages, LIFO batch:15
MMU: Allocated 1088 bytes of context maps for 255 contexts
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
Kernel command line: root=/dev/nfs rw nfsroot=/sandbox/hydra/sfalco/flx-codec/rootfs ip=137.237.178.150:137.237.179.21:137.237.178.1:255.255.255.0:flx-am:eth0:off console=ttyS1,115200 debug
NR_IRQS:512
UIC0 (32 IRQ sources) at DCR 0xc0
UIC1 (32 IRQ sources) at DCR 0xd0
irq: irq 30 on host /interrupt-controller mapped to virtual irq 30
UIC2 (32 IRQ sources) at DCR 0xe0
irq: irq 28 on host /interrupt-controller mapped to virtual irq 28
PID hash table entries: 1024 (order: 10, 4096 bytes)
time_init: decrementer frequency = 400.000000 MHz
time_init: processor frequency = 400.000000 MHz
clocksource: timebase mult[a00000] shift[22] registered
clockevent: decrementer mult[6666] shift[16] cpu[0]
I-pipe 2.7-02: pipeline enabled.
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 254208k/262144k available (3944k kernel code, 7656k reserved, 184k data, 1196k bss, 164k init)
Kernel virtual memory layout:
* 0xffffe000..0xfffff000 : fixmap
* 0xfde00000..0xfe000000 : consistent mem
* 0xfde00000..0xfde00000 : early ioremap
* 0xd1000000..0xfde00000 : vmalloc & ioremap
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 798.72 BogoMIPS (lpj=1597440)
Mount-cache hash table entries: 512
net_namespace: 520 bytes
NET: Registered protocol family 16
PCIE0: Checking link...
PCIE0: Device detected, waiting for link...
PCIE0: link is up !
PCI host bridge /plb/pciex@0a0000000 (primary) ranges:
MEM 0x00000000e0000000..0x00000000e7ffffff -> 0x00000000e0000000
IO 0x00000000e8000000..0x00000000e800ffff -> 0x0000000000000000
4xx PCI DMA offset set to 0x00000000
PCIE0: successfully set as root-complex
PCIE1: Checking link...
PCIE1: Device detected, waiting for link...
PCIE1: link is up !
PCI host bridge /plb/pciex@0c0000000 (primary) ranges:
MEM 0x0000000090000000..0x000000009fffffff -> 0x0000000090000000
IO 0x00000000e8010000..0x00000000e801ffff -> 0x0000000000000000
4xx PCI DMA offset set to 0x00000000
PCIE1: successfully set as root-complex
PCI: Probing PCI hardware
PCI: Scanning PHB /plb/pciex@0a0000000
PCI: PHB IO resource = 00000000fffe0000-00000000fffeffff [100]
PCI: PHB MEM resource 0 = 00000000e0000000-00000000e7ffffff [200]
PCI: PHB MEM offset = 0000000000000000
PCI: PHB IO offset = fffe0000
pci 0000:00:00.0: reg 10 32bit mmio: [0x000000-0x7fffffff]
PCI:0000:00:00.0 Resource 0 0000000000000000-000000007fffffff [21208] is unassigned
PCI: Hiding 4xx host bridge resources 0000:00:00.0
PCI: Fixup bus devices 0 (PHB)
pci_busdev_to_OF_node(0,0x0)
parent is /plb/pciex@0a0000000
result is <NULL>
PCI: Try to map irq for 0000:00:00.0...
pci_busdev_to_OF_node(0,0x0)
parent is /plb/pciex@0a0000000
result is <NULL>
pci 0000:01:00.0: reg 10 32bit mmio: [0x80000000-0x800fffff]
pci 0000:01:00.0: reg 14 32bit mmio: [0x80100000-0x801fffff]
pci 0000:01:00.0: reg 18 32bit mmio: [0x84000000-0x87ffffff]
PCI:0000:01:00.0 Resource 0 0000000080000000-00000000800fffff [20200] fixup...
PCI:0000:01:00.0 0000000080000000-00000000800fffff
PCI:0000:01:00.0 Resource 1 0000000080100000-00000000801fffff [20200] fixup...
PCI:0000:01:00.0 0000000080100000-00000000801fffff
PCI:0000:01:00.0 Resource 2 0000000084000000-0000000087ffffff [20200] fixup...
PCI:0000:01:00.0 0000000084000000-0000000087ffffff
pci 0000:00:00.0: bridge io port: [0x00-0xfff]
pci 0000:00:00.0: bridge 32bit mmio: [0x80000000-0x87ffffff]
PCI:0000:00:00.0 Bus rsrc 0 0000000000000000-0000000000000fff [101] fixup...
PCI:0000:00:00.0 00000000fffe0000-00000000fffe0fff
PCI:0000:00:00.0 Bus rsrc 1 0000000080000000-0000000087ffffff [200] fixup...
PCI:0000:00:00.0 0000000080000000-0000000087ffffff
PCI: Fixup bus devices 1 (0000:00:00.0)
pci_busdev_to_OF_node(1,0x0)
PCI: Try to map irq for 0000:01:00.0...
pci_busdev_to_OF_node(1,0x0)
pci_busdev_to_OF_node(0,0x0)
parent is /plb/pciex@0a0000000
result is <NULL>
Got one, spec 2 cells (0x00000000 0x00000004...) on /interrupt-controller2
irq: irq 0 on host /interrupt-controller2 mapped to virtual irq 16
Mapped to linux irq 16
PCI: Scanning PHB /plb/pciex@0c0000000
PCI: PHB IO resource = 0000000000000000-000000000000ffff [100]
PCI: PHB MEM resource 0 = 0000000090000000-000000009fffffff [200]
PCI: PHB MEM offset = 0000000000000000
PCI: PHB IO offset = 00000000
pci 0001:40:00.0: reg 10 32bit mmio: [0x000000-0x7fffffff]
PCI:0001:40:00.0 Resource 0 0000000000000000-000000007fffffff [21208] is unassigned
PCI: Hiding 4xx host bridge resources 0001:40:00.0
PCI: Fixup bus devices 64 (PHB)
pci_busdev_to_OF_node(64,0x0)
parent is /plb/pciex@0c0000000
result is /plb/pciex@0c0000000/pcie@0
PCI: Try to map irq for 0001:40:00.0...
pci_busdev_to_OF_node(64,0x0)
parent is /plb/pciex@0c0000000
result is /plb/pciex@0c0000000/pcie@0
pci 0001:41:00.0: reg 10 32bit mmio: [0x90000000-0x9001ffff]
PCI:0001:41:00.0 Resource 0 0000000090000000-000000009001ffff [20200] fixup...
PCI:0001:41:00.0 0000000090000000-000000009001ffff
pci 0001:41:00.0: PME# supported from D0 D3hot D3cold
pci 0001:41:00.0: PME# disabled
pci 0001:40:00.0: bridge io port: [0x00-0xfff]
pci 0001:40:00.0: bridge 32bit mmio: [0x90000000-0x94ffffff]
PCI:0001:40:00.0 Bus rsrc 0 0000000000000000-0000000000000fff [101] fixup...
PCI:0001:40:00.0 0000000000000000-0000000000000fff
PCI:0001:40:00.0 Bus rsrc 1 0000000090000000-0000000094ffffff [200] fixup...
PCI:0001:40:00.0 0000000090000000-0000000094ffffff
PCI: Fixup bus devices 65 (0001:40:00.0)
pci_busdev_to_OF_node(65,0x0)
parent is /plb/pciex@0c0000000/pcie@0
result is <NULL>
PCI: Try to map irq for 0001:41:00.0...
pci_busdev_to_OF_node(65,0x0)
parent is /plb/pciex@0c0000000/pcie@0
result is <NULL>
pci_busdev_to_OF_node(64,0x0)
parent is /plb/pciex@0c0000000
result is /plb/pciex@0c0000000/pcie@0
Got one, spec 2 cells (0x0000000b 0x00000004...) on /interrupt-controller2
irq: irq 11 on host /interrupt-controller2 mapped to virtual irq 17
Mapped to linux irq 17
pci 0001:42:01.0: PME# supported from D0 D3hot D3cold
pci 0001:42:01.0: PME# disabled
pci 0001:42:02.0: PME# supported from D0 D3hot D3cold
pci 0001:42:02.0: PME# disabled
pci 0001:41:00.0: bridge 32bit mmio: [0x90100000-0x94ffffff]
PCI:0001:41:00.0 Bus rsrc 1 0000000090100000-0000000094ffffff [200] fixup...
PCI:0001:41:00.0 0000000090100000-0000000094ffffff
PCI: Fixup bus devices 66 (0001:41:00.0)
pci_busdev_to_OF_node(66,0x8)
PCI: Try to map irq for 0001:42:01.0...
pci_busdev_to_OF_node(66,0x8)
pci_busdev_to_OF_node(65,0x0)
parent is /plb/pciex@0c0000000/pcie@0
result is <NULL>
pci_busdev_to_OF_node(64,0x0)
parent is /plb/pciex@0c0000000
result is /plb/pciex@0c0000000/pcie@0
Got one, spec 2 cells (0x0000000c 0x00000004...) on /interrupt-controller2
irq: irq 12 on host /interrupt-controller2 mapped to virtual irq 18
Mapped to linux irq 18
pci_busdev_to_OF_node(66,0x10)
PCI: Try to map irq for 0001:42:02.0...
pci_busdev_to_OF_node(66,0x10)
pci_busdev_to_OF_node(65,0x0)
parent is /plb/pciex@0c0000000/pcie@0
result is <NULL>
pci_busdev_to_OF_node(64,0x0)
parent is /plb/pciex@0c0000000
result is /plb/pciex@0c0000000/pcie@0
Got one, spec 2 cells (0x0000000d 0x00000004...) on /interrupt-controller2
irq: irq 13 on host /interrupt-controller2 mapped to virtual irq 19
Mapped to linux irq 19
pci 0001:43:00.0: reg 10 32bit mmio: [0x91000000-0x91ffffff]
pci 0001:43:00.0: reg 14 32bit mmio: [0x92000000-0x92ffffff]
PCI:0001:43:00.0 Resource 0 0000000091000000-0000000091ffffff [21208] fixup...
PCI:0001:43:00.0 0000000091000000-0000000091ffffff
PCI:0001:43:00.0 Resource 1 0000000092000000-0000000092ffffff [21208] fixup...
PCI:0001:43:00.0 0000000092000000-0000000092ffffff
pci 0001:42:01.0: bridge 32bit mmio: [0x90100000-0x92ffffff]
PCI:0001:42:01.0 Bus rsrc 1 0000000090100000-0000000092ffffff [200] fixup...
PCI:0001:42:01.0 0000000090100000-0000000092ffffff
PCI: Fixup bus devices 67 (0001:42:01.0)
pci_busdev_to_OF_node(67,0x0)
PCI: Try to map irq for 0001:43:00.0...
pci_busdev_to_OF_node(67,0x0)
pci_busdev_to_OF_node(66,0x8)
pci_busdev_to_OF_node(65,0x0)
parent is /plb/pciex@0c0000000/pcie@0
result is <NULL>
pci_busdev_to_OF_node(64,0x0)
parent is /plb/pciex@0c0000000
result is /plb/pciex@0c0000000/pcie@0
Got one, spec 2 cells (0x0000000c 0x00000004...) on /interrupt-controller2
Mapped to linux irq 18
pci 0001:44:00.0: reg 10 32bit mmio: [0x93000000-0x93ffffff]
pci 0001:44:00.0: reg 14 32bit mmio: [0x94000000-0x94ffffff]
PCI:0001:44:00.0 Resource 0 0000000093000000-0000000093ffffff [21208] fixup...
PCI:0001:44:00.0 0000000093000000-0000000093ffffff
PCI:0001:44:00.0 Resource 1 0000000094000000-0000000094ffffff [21208] fixup...
PCI:0001:44:00.0 0000000094000000-0000000094ffffff
pci 0001:42:02.0: bridge 32bit mmio: [0x93000000-0x94ffffff]
PCI:0001:42:02.0 Bus rsrc 1 0000000093000000-0000000094ffffff [200] fixup...
PCI:0001:42:02.0 0000000093000000-0000000094ffffff
PCI: Fixup bus devices 68 (0001:42:02.0)
pci_busdev_to_OF_node(68,0x0)
PCI: Try to map irq for 0001:44:00.0...
pci_busdev_to_OF_node(68,0x0)
pci_busdev_to_OF_node(66,0x10)
pci_busdev_to_OF_node(65,0x0)
parent is /plb/pciex@0c0000000/pcie@0
result is <NULL>
pci_busdev_to_OF_node(64,0x0)
parent is /plb/pciex@0c0000000
result is /plb/pciex@0c0000000/pcie@0
Got one, spec 2 cells (0x0000000d 0x00000004...) on /interrupt-controller2
Mapped to linux irq 19
PCI: Allocating bus resources for 0000:00...
PCI: PHB (bus 0) bridge rsrc 0: 00000000fffe0000-00000000fffeffff [0x100], parent c03de440 (PCI IO)
PCI: PHB (bus 0) bridge rsrc 1: 00000000e0000000-00000000e7ffffff [0x200], parent c03de424 (PCI mem)
PCI: Allocating bus resources for 0000:01...
PCI: Allocating bus resources for 0001:40...
PCI: PHB (bus 64) bridge rsrc 0: 0000000000000000-000000000000ffff [0x100], parent c03de440 (PCI IO)
PCI: PHB (bus 64) bridge rsrc 1: 0000000090000000-000000009fffffff [0x200], parent c03de424 (PCI mem)
PCI: Allocating bus resources for 0001:41...
PCI: Allocating bus resources for 0001:42...
PCI: Allocating bus resources for 0001:43...
PCI: Allocating bus resources for 0001:44...
Reserving legacy ranges for domain 0000
Candidate legacy IO: [0xfffe0000-0xfffe0fff]
hose mem offset: 0000000000000000
hose mem res: [0xe0000000-0xe7ffffff]
Reserving legacy ranges for domain 0001
Candidate legacy IO: [0x00-0xfff]
hose mem offset: 0000000000000000
hose mem res: [0x90000000-0x9fffffff]
PCI: Assigning unassigned resources...
pci 0000:00:00.0: PCI bridge, secondary bus 0000:01
pci 0000:00:00.0: IO window: disabled
pci 0000:00:00.0: MEM window: 0xe0000000-0xe5ffffff
pci 0000:00:00.0: PREFETCH window: disabled
pci 0001:42:01.0: PCI bridge, secondary bus 0001:43
pci 0001:42:01.0: IO window: disabled
pci 0001:42:01.0: MEM window: disabled
pci 0001:42:01.0: PREFETCH window: 0x00000090000000-0x00000091ffffff
pci 0001:42:02.0: PCI bridge, secondary bus 0001:44
pci 0001:42:02.0: IO window: disabled
pci 0001:42:02.0: MEM window: disabled
pci 0001:42:02.0: PREFETCH window: 0x00000092000000-0x00000093ffffff
pci 0001:41:00.0: PCI bridge, secondary bus 0001:42
pci 0001:41:00.0: IO window: disabled
pci 0001:41:00.0: MEM window: disabled
pci 0001:41:00.0: PREFETCH window: 0x00000090000000-0x00000093ffffff
pci 0001:40:00.0: PCI bridge, secondary bus 0001:41
pci 0001:40:00.0: IO window: disabled
pci 0001:40:00.0: MEM window: 0x94000000-0x940fffff
pci 0001:40:00.0: PREFETCH window: 0x00000090000000-0x00000093ffffff
pci_bus 0000:00: resource 0 io: [0xfffe0000-0xfffeffff]
pci_bus 0000:00: resource 1 mem: [0xe0000000-0xe7ffffff]
pci_bus 0000:01: resource 0 mem: [0xfffe0000-0xfffe0fff]
pci_bus 0000:01: resource 1 mem: [0xe0000000-0xe5ffffff]
pci_bus 0001:40: resource 0 io: [0x00-0xffff]
pci_bus 0001:40: resource 1 mem: [0x90000000-0x9fffffff]
pci_bus 0001:41: resource 0 mem: [0x0-0xfff]
pci_bus 0001:41: resource 1 mem: [0x94000000-0x940fffff]
pci_bus 0001:41: resource 2 pref mem [0x90000000-0x93ffffff]
pci_bus 0001:42: resource 1 mem: [0x90100000-0x94ffffff]
pci_bus 0001:42: resource 2 pref mem [0x90000000-0x93ffffff]
pci_bus 0001:43: resource 1 mem: [0x90100000-0x92ffffff]
pci_bus 0001:43: resource 2 pref mem [0x90000000-0x91ffffff]
pci_bus 0001:44: resource 1 mem: [0x93000000-0x94ffffff]
pci_bus 0001:44: resource 2 pref mem [0x92000000-0x93ffffff]
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switched to high resolution mode on CPU 0
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
NET: Registered protocol family 1
irq: irq 26 on host /interrupt-controller mapped to virtual irq 26
irq: irq 1 on host /interrupt-controller mapped to virtual irq 20
irq: irq 30 on host /interrupt-controller2 mapped to virtual irq 21
irq: irq 26 on host /interrupt-controller1 mapped to virtual irq 22
irq: irq 12 on host /interrupt-controller mapped to virtual irq 23
I-pipe: Domain Xenomai registered.
Xenomai: hal/powerpc started.
Xenomai: real-time nucleus v2.4.10 (Flavor Crystal 7) loaded.
Xenomai: starting native API services.
Xenomai: starting POSIX services.
Xenomai: starting RTDM services.
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
fuse init (API version 7.11)
msgmni has been set to 497
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
aer 0001:41:00.0:pcie12: service driver aer loaded
aer 0001:42:01.0:pcie22: service driver aer loaded
aer 0001:42:02.0:pcie22: service driver aer loaded
pci_hotplug: PCI Hot Plug PCI Core version: 0.5
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
serial8250.0: ttyS0 at MMIO 0xef600200 (irq = 26) is a 16550A
serial8250.0: ttyS1 at MMIO 0xef600300 (irq = 20) is a 16550A
console [ttyS1] enabled
ef600200.serial: ttyS0 at MMIO 0xef600200 (irq = 26) is a 16550A
ef600300.serial: ttyS1 at MMIO 0xef600300 (irq = 20) is a 16550A
brd: module loaded
Driver 'sd' needs updating - please use bus_type methods
PPC 4xx OCP EMAC driver, version 3.54
irq: irq 10 on host /interrupt-controller mapped to virtual irq 24
irq: irq 11 on host /interrupt-controller mapped to virtual irq 25
irq: irq 0 on host /interrupt-controller1 mapped to virtual irq 27
irq: irq 1 on host /interrupt-controller1 mapped to virtual irq 29
irq: irq 2 on host /interrupt-controller1 mapped to virtual irq 31
MAL v2 /plb/mcmal, 2 TX channels, 2 RX channels
RGMII /plb/opb/emac-rgmii@ef600b00 initialized with MDIO support
irq: irq 24 on host /interrupt-controller mapped to virtual irq 32
irq: irq 29 on host /interrupt-controller1 mapped to virtual irq 33
/plb/opb/emac-rgmii@ef600b00: input 0 in RGMII mode
eth0: EMAC-0 /plb/opb/ethernet@ef600900, MAC 00:90:f9:10:1a:08
eth0: found Marvell 88E1111 Ethernet PHY (0x04)
irq: irq 25 on host /interrupt-controller mapped to virtual irq 34
irq: irq 31 on host /interrupt-controller1 mapped to virtual irq 35
/plb/opb/emac-rgmii@ef600b00: input 1 in RGMII mode
eth1: EMAC-1 /plb/opb/ethernet@ef600a00, MAC 00:90:f9:10:1a:09
eth1: found Marvell 88E1111 Ethernet PHY (0x05)
fc000000.nor_flash: Found 1 x16 devices at 0x0 in 16-bit bank
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Using buffer write method
Using auto-unlock on power-up/resume
cfi_cmdset_0001: Erase suspend on write enabled
erase region 0: offset=0x0,size=0x8000,blocks=4
erase region 1: offset=0x20000,size=0x20000,blocks=511
RedBoot partition parsing not available
Creating 7 MTD partitions on "fc000000.nor_flash":
0x000000000000-0x000000800000 : "kernel0"
0x000000800000-0x000001000000 : "kernel1"
0x000001000000-0x000001800000 : "kernel2"
0x000001800000-0x000003f40000 : "install"
0x000003f40000-0x000003f60000 : "env0"
0x000003f60000-0x000003f80000 : "env1"
0x000003f80000-0x000004000000 : "u-boot"
irq: irq 8 on host /interrupt-controller mapped to virtual irq 36
spi_ppc4xx_of ef600600.spi: driver initialized
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
dwc_otg: version 2.60a 22-NOV-2006
dwc_otg: Shared Tx FIFO mode
dwc_otg: Using DMA mode
dwc_otg dwc_otg.0: DWC OTG Controller
dwc_otg dwc_otg.0: new USB bus registered, assigned bus number 1
dwc_otg dwc_otg.0: irq 21, io mem 0x00000000
dwc_otg: Init: Port Power? op_state=1
dwc_otg: Init: Power Port (0)
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: DWC OTG Controller
usb usb1: Manufacturer: Linux 2.6.30.3-00063-g0af2edc-dirty dwc_otg_hcd
usb usb1: SerialNumber: dwc_otg.0
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
i2c /dev entries driver
irq: irq 2 on host /interrupt-controller mapped to virtual irq 37
ibm-iic ef600400.i2c: using standard (100 kHz) mode
irq: irq 7 on host /interrupt-controller mapped to virtual irq 38
ibm-iic ef600500.i2c: using standard (100 kHz) mode
lm75: probe of 0-0048 failed with error -121
hwmon-vid: Unknown VRM version of your CPU
PowerPC Book-E Watchdog Timer Loaded
TCP cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 17
NET: Registered protocol family 15
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
usb 1-1: new high speed USB device using dwc_otg and address 2
usb 1-1: New USB device found, idVendor=0634, idProduct=0655
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: Real SSD eUSB 2GB
usb 1-1: Manufacturer: Micron Technology
usb 1-1: SerialNumber: 4BF0022700035321
usb 1-1: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
eth0: link is down
eth0: link is up, 100 HDX
IP-Config: Complete:
device=eth0, addr=137.237.178.150, mask=255.255.255.0, gw=137.237.178.1,
host=flx-am, domain=, nis-domain=(none),
bootserver=137.237.179.21, rootserver=137.237.179.21, rootpath=
Looking up port of RPC 100003/2 on 137.237.179.21
Looking up port of RPC 100005/1 on 137.237.179.21
VFS: Mounted root (nfs filesystem) on device 0:14.
Freeing unused kernel memory: 164k init
INIT: version 2.86 booting
scsi 0:0:0:0: Direct-Access MICRON eUSB DISK 1110 PQ: 0 ANSI: 0 CCS
sd 0:0:0:0: Attached scsi generic sg0 type 0
usb-storage: device scan complete
sd 0:0:0:0: [sda] 3964928 512-byte hardware sectors: (2.03 GB/1.89 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Assuming drive cache: write through
sda: sda1 sda2 sda3 sda4
sd 0:0:0:0: [sda] Attached SCSI disk
Welcome to DENX Embedded Linux Environment
Press 'I' to enter interactive startup.
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.
Setting clock : Wed Dec 31 19:00:10 EST 1969 [ OK ]
Building the cache [ OK ]
Setting hostname flx-am: [ OK ]
Mounting local filesystems: [ OK ]
Enabling /etc/fstab swaps: [ OK ]
INIT: Entering runlevel: 3
Entering non-interactive startup
FATAL: Module ipv6 not found.
Bringing up loopback interface: [ OK ]
FATAL: Module ipv6 not found.
Starting system logger: [ OK ]
Starting kernel logger: [ OK ]
Starting rpcbind: [ OK ]
Mounting NFS filesystems: [ OK ]
Mounting other filesystems: [ OK ]
Starting xinetd: [ OK ]
DENX ELDK version 4.2 build 2008-04-01
Linux 2.6.30.3-00063-g0af2edc-dirty on a ppc
flx-am login: root
Password:
Last login: Wed Dec 31 19:06:54 on console
-bash-3.2# modprobe d7
dx83xx 0001:43:00.0: device not available because of BAR 0 [0x91000000-0x91ffffff] collisions
dx83xx: probe of 0001:43:00.0 failed with error -22
dx83xx 0001:44:00.0: device not available because of BAR 0 [0x93000000-0x93ffffff] collisions
dx83xx: probe of 0001:44:00.0 failed with error -22
-bash-3.2#
>
> Cheers,
> Ben.
>
--
A: Because it makes the logic of the discussion difficult to follow.
Q: Why shouldn't I top post?
A: No.
Q: Should I top post?
^ permalink raw reply
* [PATCH 2/6] hw_breakpoints: Migrate breakpoint conditional build under new config
From: Frederic Weisbecker @ 2011-04-27 16:59 UTC (permalink / raw)
To: LKML
Cc: Peter Zijlstra, Frederic Weisbecker, Will Deacon, LKML,
Paul Mundt, Prasad, Ingo Molnar, LPPC
In-Reply-To: <1303923602-2923-1-git-send-email-fweisbec@gmail.com>
Migrate conditional hw_breakpoint code compilation under
the new config to prepare for letting the user chose whether
or not to build this feature
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Prasad <prasad@linux.vnet.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
---
arch/arm/include/asm/hw_breakpoint.h | 4 ++--
arch/arm/include/asm/processor.h | 2 +-
arch/arm/kernel/Makefile | 2 +-
| 2 +-
arch/arm/kernel/ptrace.c | 4 ++--
arch/powerpc/include/asm/cputable.h | 4 ++--
arch/powerpc/include/asm/hw_breakpoint.h | 6 +++---
arch/powerpc/include/asm/processor.h | 4 ++--
arch/powerpc/kernel/Makefile | 2 +-
arch/powerpc/kernel/process.c | 18 +++++++++---------
arch/powerpc/kernel/ptrace.c | 12 ++++++------
arch/powerpc/lib/Makefile | 2 +-
arch/sh/kernel/Makefile | 2 +-
arch/sh/kernel/cpu/sh4a/Makefile | 2 +-
include/linux/hw_breakpoint.h | 6 +++---
include/linux/perf_event.h | 4 ++--
kernel/Makefile | 2 +-
kernel/perf_event.c | 4 ++--
samples/Kconfig | 2 +-
19 files changed, 42 insertions(+), 42 deletions(-)
diff --git a/arch/arm/include/asm/hw_breakpoint.h b/arch/arm/include/asm/hw_breakpoint.h
index f389b27..fc6ba18 100644
--- a/arch/arm/include/asm/hw_breakpoint.h
+++ b/arch/arm/include/asm/hw_breakpoint.h
@@ -5,7 +5,7 @@
struct task_struct;
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
+#ifdef CONFIG_HW_BREAKPOINT
struct arch_hw_breakpoint_ctrl {
u32 __reserved : 9,
@@ -128,6 +128,6 @@ int hw_breakpoint_slots(int type);
#else
static inline void clear_ptrace_hw_breakpoint(struct task_struct *tsk) {}
-#endif /* CONFIG_HAVE_HW_BREAKPOINT */
+#endif /* CONFIG_HW_BREAKPOINT */
#endif /* __KERNEL__ */
#endif /* _ARM_HW_BREAKPOINT_H */
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h
index b2d9df5..b86d135 100644
--- a/arch/arm/include/asm/processor.h
+++ b/arch/arm/include/asm/processor.h
@@ -30,7 +30,7 @@
#endif
struct debug_info {
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
+#ifdef CONFIG_HW_BREAKPOINT
struct perf_event *hbp[ARM_MAX_HBP_SLOTS];
#endif
};
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 8d95446..e6c4b04 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -47,7 +47,7 @@ obj-$(CONFIG_HAVE_TCM) += tcm.o
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
obj-$(CONFIG_SWP_EMULATE) += swp_emulate.o
CFLAGS_swp_emulate.o := -Wa,-march=armv7-a
-obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
+obj-$(CONFIG_HW_BREAKPOINT) += hw_breakpoint.o
obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o
AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312
--git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
index 051166c..fbc7cc9 100644
--- a/arch/arm/kernel/entry-header.S
+++ b/arch/arm/kernel/entry-header.S
@@ -171,7 +171,7 @@
@ we can access the debug registers safely.
@
.macro debug_entry, fsr
-#if defined(CONFIG_HAVE_HW_BREAKPOINT) && defined(CONFIG_PREEMPT)
+#if defined(CONFIG_HW_BREAKPOINT) && defined(CONFIG_PREEMPT)
ldr r4, =0x40f @ mask out fsr.fs
and r5, r4, \fsr
cmp r5, #2 @ debug exception
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index 2bf27f3..a3f8a0b 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -468,7 +468,7 @@ static int ptrace_setvfpregs(struct task_struct *tsk, void __user *data)
}
#endif
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
+#ifdef CONFIG_HW_BREAKPOINT
/*
* Convert a virtual register number into an index for a thread_info
* breakpoint array. Breakpoints are identified using positive numbers
@@ -765,7 +765,7 @@ long arch_ptrace(struct task_struct *child, long request,
break;
#endif
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
+#ifdef CONFIG_HW_BREAKPOINT
case PTRACE_GETHBPREGS:
ret = ptrace_gethbpregs(child, addr,
(unsigned long __user *)data);
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index 1833d1a..36b5568 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -538,9 +538,9 @@ static inline int cpu_has_feature(unsigned long feature)
& feature);
}
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
+#ifdef CONFIG_HW_BREAKPOINT
#define HBP_NUM 1
-#endif /* CONFIG_HAVE_HW_BREAKPOINT */
+#endif /* CONFIG_HW_BREAKPOINT */
#endif /* !__ASSEMBLY__ */
diff --git a/arch/powerpc/include/asm/hw_breakpoint.h b/arch/powerpc/include/asm/hw_breakpoint.h
index 1c33ec1..6ecd3b6 100644
--- a/arch/powerpc/include/asm/hw_breakpoint.h
+++ b/arch/powerpc/include/asm/hw_breakpoint.h
@@ -24,7 +24,7 @@
#define _PPC_BOOK3S_64_HW_BREAKPOINT_H
#ifdef __KERNEL__
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
+#ifdef CONFIG_HW_BREAKPOINT
struct arch_hw_breakpoint {
bool extraneous_interrupt;
@@ -65,10 +65,10 @@ static inline void hw_breakpoint_disable(void)
}
extern void thread_change_pc(struct task_struct *tsk, struct pt_regs *regs);
-#else /* CONFIG_HAVE_HW_BREAKPOINT */
+#else /* CONFIG_HW_BREAKPOINT */
static inline void hw_breakpoint_disable(void) { }
static inline void thread_change_pc(struct task_struct *tsk,
struct pt_regs *regs) { }
-#endif /* CONFIG_HAVE_HW_BREAKPOINT */
+#endif /* CONFIG_HW_BREAKPOINT */
#endif /* __KERNEL__ */
#endif /* _PPC_BOOK3S_64_HW_BREAKPOINT_H */
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index de1967a..3fe688d 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -207,14 +207,14 @@ struct thread_struct {
#ifdef CONFIG_PPC64
unsigned long start_tb; /* Start purr when proc switched in */
unsigned long accum_tb; /* Total accumilated purr for process */
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
+#ifdef CONFIG_HW_BREAKPOINT
struct perf_event *ptrace_bps[HBP_NUM];
/*
* Helps identify source of single-step exception and subsequent
* hw-breakpoint enablement
*/
struct perf_event *last_hit_ubp;
-#endif /* CONFIG_HAVE_HW_BREAKPOINT */
+#endif /* CONFIG_HW_BREAKPOINT */
#endif
unsigned long dabr; /* Data address breakpoint register */
#ifdef CONFIG_ALTIVEC
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 3bb2a3e..5df8585 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -36,7 +36,7 @@ obj-y := cputable.o ptrace.o syscalls.o \
obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \
signal_64.o ptrace32.o \
paca.o nvram_64.o firmware.o
-obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
+obj-$(CONFIG_HW_BREAKPOINT) += hw_breakpoint.o
obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_ppc970.o cpu_setup_pa6t.o
obj64-$(CONFIG_RELOCATABLE) += reloc_64.o
obj-$(CONFIG_PPC_BOOK3E_64) += exceptions-64e.o idle_book3e.o
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index f74f355..3faf61a 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -353,7 +353,7 @@ static void switch_booke_debug_regs(struct thread_struct *new_thread)
prime_debug_regs(new_thread);
}
#else /* !CONFIG_PPC_ADV_DEBUG_REGS */
-#ifndef CONFIG_HAVE_HW_BREAKPOINT
+#ifndef CONFIG_HW_BREAKPOINT
static void set_debug_reg_defaults(struct thread_struct *thread)
{
if (thread->dabr) {
@@ -361,7 +361,7 @@ static void set_debug_reg_defaults(struct thread_struct *thread)
set_dabr(0);
}
}
-#endif /* !CONFIG_HAVE_HW_BREAKPOINT */
+#endif /* !CONFIG_HW_BREAKPOINT */
#endif /* CONFIG_PPC_ADV_DEBUG_REGS */
int set_dabr(unsigned long dabr)
@@ -469,10 +469,10 @@ struct task_struct *__switch_to(struct task_struct *prev,
* For PPC_BOOK3S_64, we use the hw-breakpoint interfaces that would
* schedule DABR
*/
-#ifndef CONFIG_HAVE_HW_BREAKPOINT
+#ifndef CONFIG_HW_BREAKPOINT
if (unlikely(__get_cpu_var(current_dabr) != new->thread.dabr))
set_dabr(new->thread.dabr);
-#endif /* CONFIG_HAVE_HW_BREAKPOINT */
+#endif /* CONFIG_HW_BREAKPOINT */
#endif
@@ -672,11 +672,11 @@ void flush_thread(void)
{
discard_lazy_cpu_state();
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
+#ifdef CONFIG_HW_BREAKPOINT
flush_ptrace_hw_breakpoint(current);
-#else /* CONFIG_HAVE_HW_BREAKPOINT */
+#else /* CONFIG_HW_BREAKPOINT */
set_debug_reg_defaults(¤t->thread);
-#endif /* CONFIG_HAVE_HW_BREAKPOINT */
+#endif /* CONFIG_HW_BREAKPOINT */
}
void
@@ -694,9 +694,9 @@ void prepare_to_copy(struct task_struct *tsk)
flush_altivec_to_thread(current);
flush_vsx_to_thread(current);
flush_spe_to_thread(current);
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
+#ifdef CONFIG_HW_BREAKPOINT
flush_ptrace_hw_breakpoint(tsk);
-#endif /* CONFIG_HAVE_HW_BREAKPOINT */
+#endif /* CONFIG_HW_BREAKPOINT */
}
/*
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 55613e3..6a3f54e 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -877,7 +877,7 @@ void user_disable_single_step(struct task_struct *task)
clear_tsk_thread_flag(task, TIF_SINGLESTEP);
}
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
+#ifdef CONFIG_HW_BREAKPOINT
void ptrace_triggered(struct perf_event *bp, int nmi,
struct perf_sample_data *data, struct pt_regs *regs)
{
@@ -893,17 +893,17 @@ void ptrace_triggered(struct perf_event *bp, int nmi,
attr.disabled = true;
modify_user_hw_breakpoint(bp, &attr);
}
-#endif /* CONFIG_HAVE_HW_BREAKPOINT */
+#endif /* CONFIG_HW_BREAKPOINT */
int ptrace_set_debugreg(struct task_struct *task, unsigned long addr,
unsigned long data)
{
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
+#ifdef CONFIG_HW_BREAKPOINT
int ret;
struct thread_struct *thread = &(task->thread);
struct perf_event *bp;
struct perf_event_attr attr;
-#endif /* CONFIG_HAVE_HW_BREAKPOINT */
+#endif /* CONFIG_HW_BREAKPOINT */
/* For ppc64 we support one DABR and no IABR's at the moment (ppc64).
* For embedded processors we support one DAC and no IAC's at the
@@ -932,7 +932,7 @@ int ptrace_set_debugreg(struct task_struct *task, unsigned long addr,
/* Ensure breakpoint translation bit is set */
if (data && !(data & DABR_TRANSLATION))
return -EIO;
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
+#ifdef CONFIG_HW_BREAKPOINT
bp = thread->ptrace_bps[0];
if ((!data) || !(data & (DABR_DATA_WRITE | DABR_DATA_READ))) {
if (bp) {
@@ -968,7 +968,7 @@ int ptrace_set_debugreg(struct task_struct *task, unsigned long addr,
return PTR_ERR(bp);
}
-#endif /* CONFIG_HAVE_HW_BREAKPOINT */
+#endif /* CONFIG_HW_BREAKPOINT */
/* Move contents to the DABR register */
task->thread.dabr = data;
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 166a6a0..515d044 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -19,7 +19,7 @@ obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o \
checksum_wrappers_64.o hweight_64.o
obj-$(CONFIG_XMON) += sstep.o ldstfp.o
obj-$(CONFIG_KPROBES) += sstep.o ldstfp.o
-obj-$(CONFIG_HAVE_HW_BREAKPOINT) += sstep.o ldstfp.o
+obj-$(CONFIG_HW_BREAKPOINT) += sstep.o ldstfp.o
ifeq ($(CONFIG_PPC64),y)
obj-$(CONFIG_SMP) += locks.o
diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
index 77f7ae1..9d5075c 100644
--- a/arch/sh/kernel/Makefile
+++ b/arch/sh/kernel/Makefile
@@ -45,7 +45,7 @@ obj-$(CONFIG_HIBERNATION) += swsusp.o
obj-$(CONFIG_DWARF_UNWINDER) += dwarf.o
obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_callchain.o
-obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
+obj-$(CONFIG_HW_BREAKPOINT) += hw_breakpoint.o
obj-$(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) += localtimer.o
ccflags-y := -Werror
diff --git a/arch/sh/kernel/cpu/sh4a/Makefile b/arch/sh/kernel/cpu/sh4a/Makefile
index cc122b1..5bec639 100644
--- a/arch/sh/kernel/cpu/sh4a/Makefile
+++ b/arch/sh/kernel/cpu/sh4a/Makefile
@@ -46,4 +46,4 @@ obj-y += $(clock-y)
obj-$(CONFIG_SMP) += $(smp-y)
obj-$(CONFIG_GENERIC_GPIO) += $(pinmux-y)
obj-$(CONFIG_PERF_EVENTS) += perf_event.o
-obj-$(CONFIG_HAVE_HW_BREAKPOINT) += ubc.o
+obj-$(CONFIG_HW_BREAKPOINT) += ubc.o
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
index d1e55fe..9aad682 100644
--- a/include/linux/hw_breakpoint.h
+++ b/include/linux/hw_breakpoint.h
@@ -31,7 +31,7 @@ enum bp_type_idx {
#include <linux/perf_event.h>
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
+#ifdef CONFIG_HW_BREAKPOINT
extern int __init init_hw_breakpoint(void);
@@ -108,7 +108,7 @@ static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
return &bp->hw.info;
}
-#else /* !CONFIG_HAVE_HW_BREAKPOINT */
+#else /* !CONFIG_HW_BREAKPOINT */
static inline int __init init_hw_breakpoint(void) { return 0; }
@@ -144,7 +144,7 @@ static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
return NULL;
}
-#endif /* CONFIG_HAVE_HW_BREAKPOINT */
+#endif /* CONFIG_HW_BREAKPOINT */
#endif /* __KERNEL__ */
#endif /* _LINUX_HW_BREAKPOINT_H */
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index ee9f1e7..0f0f9bb 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -489,7 +489,7 @@ struct perf_guest_info_callbacks {
unsigned long (*get_guest_ip) (void);
};
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
+#ifdef CONFIG_HW_BREAKPOINT
#include <asm/hw_breakpoint.h>
#endif
@@ -554,7 +554,7 @@ struct hw_perf_event {
struct { /* software */
struct hrtimer hrtimer;
};
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
+#ifdef CONFIG_HW_BREAKPOINT
struct { /* breakpoint */
struct arch_hw_breakpoint info;
struct list_head bp_list;
diff --git a/kernel/Makefile b/kernel/Makefile
index 85cbfb3..c2739c5 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -104,7 +104,7 @@ obj-$(CONFIG_TRACEPOINTS) += trace/
obj-$(CONFIG_SMP) += sched_cpupri.o
obj-$(CONFIG_IRQ_WORK) += irq_work.o
obj-$(CONFIG_PERF_EVENTS) += perf_event.o
-obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
+obj-$(CONFIG_HW_BREAKPOINT) += hw_breakpoint.o
obj-$(CONFIG_USER_RETURN_NOTIFIER) += user-return-notifier.o
obj-$(CONFIG_PADATA) += padata.o
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 8e81a98..cc89f16 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -5616,7 +5616,7 @@ static void perf_event_free_filter(struct perf_event *event)
#endif /* CONFIG_EVENT_TRACING */
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
+#ifdef CONFIG_HW_BREAKPOINT
void perf_bp_event(struct perf_event *bp, void *data)
{
struct perf_sample_data sample;
@@ -6207,7 +6207,7 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
if (task) {
event->attach_state = PERF_ATTACH_TASK;
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
+#ifdef CONFIG_HW_BREAKPOINT
/*
* hw_breakpoint is a bit difficult here..
*/
diff --git a/samples/Kconfig b/samples/Kconfig
index 41063e7..d1e41e9 100644
--- a/samples/Kconfig
+++ b/samples/Kconfig
@@ -40,7 +40,7 @@ config SAMPLE_KRETPROBES
config SAMPLE_HW_BREAKPOINT
tristate "Build kernel hardware breakpoint examples -- loadable module only"
- depends on HAVE_HW_BREAKPOINT && m
+ depends on HW_BREAKPOINT && m
help
This builds kernel hardware breakpoint example modules.
--
1.7.3.2
^ permalink raw reply related
* [PATCH 6/6] hw_breakpoints: Drop remaining misplaced dependency on perf
From: Frederic Weisbecker @ 2011-04-27 17:00 UTC (permalink / raw)
To: LKML
Cc: Peter Zijlstra, Frederic Weisbecker, Will Deacon, LKML,
Paul Mundt, Prasad, Ingo Molnar, LPPC
In-Reply-To: <1303923602-2923-1-git-send-email-fweisbec@gmail.com>
Powerpc and Arm select breakpoint support ability only if
Perf is built. This is not necessary anymore now that we
enable perf once breakpoints support is selected.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Prasad <prasad@linux.vnet.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
---
arch/arm/Kconfig | 2 +-
arch/powerpc/Kconfig | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 377a7a5..1d3a0b4 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -24,7 +24,7 @@ config ARM
select HAVE_PERF_EVENTS
select PERF_USE_VMALLOC
select HAVE_REGS_AND_STACK_ACCESS_API
- select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
+ select HAVE_HW_BREAKPOINT if (CPU_V6 || CPU_V6K || CPU_V7)
select HAVE_C_RECORDMCOUNT
select HAVE_GENERIC_HARDIRQS
select HAVE_SPARSE_IRQ
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 8f4d50b..e944eb8 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -134,7 +134,7 @@ config PPC
select HAVE_IRQ_WORK
select HAVE_PERF_EVENTS
select HAVE_REGS_AND_STACK_ACCESS_API
- select HAVE_HW_BREAKPOINT if PERF_EVENTS && PPC_BOOK3S_64
+ select HAVE_HW_BREAKPOINT if PPC_BOOK3S_64
select HAVE_GENERIC_HARDIRQS
select HAVE_SPARSE_IRQ
select IRQ_PER_CPU
--
1.7.3.2
^ permalink raw reply related
* Re: device not available because of BAR 0 collisions
From: Steven A. Falco @ 2011-04-27 19:51 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1303861178.2513.171.camel@pasglop>
On 04/26/2011 07:39 PM, Benjamin Herrenschmidt wrote:
> On Tue, 2011-04-26 at 09:38 -0400, Steven A. Falco wrote:
>> On 04/25/2011 08:01 PM, Benjamin Herrenschmidt wrote:
>>> On Mon, 2011-04-25 at 16:10 -0400, Steven A. Falco wrote:
>>>> I'm getting an error message when trying to talk to some custom
>>>> hardware:
>>>>
>>>> dx83xx 0001:43:00.0: device not available because of BAR 0
>>>> [0xa1000000-0xa1ffffff] collisions
>>>>
>>>> I see in setup-res.c that this message comes out when there is no
>>>> parent for
>>>> a device resource.
>>>
>>> .../...
>>>
>>> It mostly happens in arch/powerpc/kernel/pci-common.c and the generic
>>> setup-res.c
>>>
>>> Try #define DEBUG at the top (before the #includes) of pci-common.c and
>>> pci_32.c (remove the exiting #undef in the last one) and send us the
>>> full dmesg log, along with the output of cat /proc/iomem
>
> Have you set any specific flags ? IE. Modified the value of
> ppc_pci_flags from what the 4xx code sets originally ?
For fun, I just tried changing:
ppc_pci_set_flags(PPC_PCI_REASSIGN_ALL_RSRC);
to:
ppc_pci_set_flags(PPC_PCI_PROBE_ONLY);
I realize that is the exact opposite of what you were suggesting, but
please bear with me for a bit.
I also changed the PCIE 0 ranges from:
ranges = <0x02000000 0x00000000 0x80000000 0x90000000 0x00000000 0x10000000
0x01000000 0x00000000 0x00000000 0xe8010000 0x00000000 0x00010000>;
ranges = <0x02000000 0x00000000 0x90000000 0x90000000 0x00000000 0x10000000
0x01000000 0x00000000 0x00000000 0xe8010000 0x00000000 0x00010000>;
I changed the ranges not because I wanted a 1:1 map, but because 90000000 is
what U-Boot chooses when it scans PCIe 1.
At this point, everything is working. Here is /proc/iomap:
90000000-9fffffff : /plb/pciex@0c0000000
90000000-94ffffff : PCI Bus 0001:41
90000000-9001ffff : 0001:41:00.0
90100000-94ffffff : PCI Bus 0001:42
90100000-92ffffff : PCI Bus 0001:43
91000000-91ffffff : 0001:43:00.0 //<--- was missing before
92000000-92ffffff : 0001:43:00.0 //<--- was missing before
93000000-94ffffff : PCI Bus 0001:44
93000000-93ffffff : 0001:44:00.0 //<--- was missing before
94000000-94ffffff : 0001:44:00.0 //<--- was missing before
e0000000-e7ffffff : /plb/pciex@0a0000000
e0000000-e7ffffff : PCI Bus 0000:01
e0000000-e00fffff : 0000:01:00.0
e0100000-e01fffff : 0000:01:00.0
e4000000-e7ffffff : 0000:01:00.0
ef600200-ef600207 : serial
ef600300-ef600307 : serial
ef600600-ef600606 : spi_ppc4xx_of
ef6c0000-ef6cffff : dwc_otg.0
ef6c0000-ef6cffff : dwc_otg
fc000000-ffffffff : fc000000.nor_flash
Now I see the bars for the ASICs (flagged above). I could stop here,
and declare success, but I don't really like this solution, because it
requires me to be sure the dts has the same bus addresses that U-Boot
will choose. Seems risky.
Tentative conclusion: Either I still have something set wrong in my dts
or there is a bug in the Linux PCI bus mapping code.
Steve
>
> It does look to me like some of your device BARs have been setup already
> by the firmware in a way that conflict with the way you configure your
> ranges, and the kernel doesn't appear to detect nor try to remap that
> which would happen if you have the "probe only" flag set.
>
> IE. On your c0000000 bus, you have memory at 90000000 CPU space mapped
> to 80000000 PCI space. However, when probing, the kernel finds:
>
> pci 0001:41:00.0: reg 10 32bit mmio: [0x90000000-0x9001ffff]
>
> IE. A BAR was already set with a value of 90000000 PCI-side which is out
> of the bounds you have for your bus.
>
> Maybe you really want to configure that second bus to have CPU 90000000
> mapped to 90000000 PCI-side ? (IE. a 1:1 mapping). That would be
> something to fix in your "ranges" property.
>
> Cheers,
> Ben.
--
A: Because it makes the logic of the discussion difficult to follow.
Q: Why shouldn't I top post?
A: No.
Q: Should I top post?
^ permalink raw reply
* Re: hvc_console: Don't access hvc_task if not initialised
From: Greg KH @ 2011-04-28 0:09 UTC (permalink / raw)
To: Amit Shah; +Cc: Rusty Russell, linux-kernel, Milton Miller, linuxppc-dev
In-Reply-To: <20110427063147.GA28328@amit-x200.redhat.com>
On Wed, Apr 27, 2011 at 12:01:47PM +0530, Amit Shah wrote:
> On (Wed) 27 Apr 2011 [14:31:29], Rusty Russell wrote:
> > On Wed, 20 Apr 2011 22:36:10 +0530, Amit Shah <amit.shah@redhat.com> wrote:
> > > On (Wed) 20 Apr 2011 [07:34:35], Greg KH wrote:
> > > > Care to either create this patch, or resend your original one, if you
> > > > want it applied?
> > >
> > > Rusty has the other one queued. I pinged him about status.
> >
> > It's merged, but I don't think it had the requisite cc:stable, did it?
>
> No, because at the point of submitting I didn't know it would solve
> this bug as well. Greg, can you pick
> afa2689e19073cd2e762d0f2c1358fab1ab9f18c for stable?
Yes, but in the future, this is NOT the way to get patches into the
stable tree. Please read Documentation/stable_kernel_rules.txt for how
to do it properly.
thanks,
greg k-h
^ permalink raw reply
* Re: linux-next: ibmveth runtime errors
From: Stephen Rothwell @ 2011-04-28 2:11 UTC (permalink / raw)
To: Michał Mirosław
Cc: netdev, ppc-dev, LKML, linux-next, Santiago Leon, David Miller
In-Reply-To: <20110427103622.GA22781@rere.qmqm.pl>
Hi Michał,
On Wed, 27 Apr 2011 12:36:22 +0200 Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:
>
> Please test the following patch. It's just a blind guess, as this error
> is not descriptive.
>
> Best Regards,
> Michał Mirosław
>
> ---
>
> net: ibmveth: force reconfiguring checksum settings on startup
>
> Commit b9367bf3ee6d ("net: ibmveth: convert to hw_features") accidentally
> removed call to ibmveth_set_csum_offload() in ibmveth_probe(). Put the
> call back where it was, but with additional error checking provided
> by ibmveth_set_features().
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
>
> ---
> drivers/net/ibmveth.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
> index 4855f1f..0d1fea2 100644
> --- a/drivers/net/ibmveth.c
> +++ b/drivers/net/ibmveth.c
> @@ -1397,6 +1397,8 @@ static int __devinit ibmveth_probe(struct vio_dev *dev,
>
> netdev_dbg(netdev, "registering netdev...\n");
>
> + ibmveth_set_features(dev, dev->features);
> +
> rc = register_netdev(netdev);
>
> if (rc) {
This worked after I changed both "dev"s to "netdev". And the boot
succedded. I will apply this patchg to linux-next today and hopefully
Dave can apply it to the net tree. I have added a copy fo the patch I
used below.
From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= <mirq-linux@rere.qmqm.pl>
Date: Thu, 28 Apr 2011 11:59:15 +1000
Subject: [PATCH] net: ibmveth: force reconfiguring checksum settings on
startup
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Commit b9367bf3ee6d ("net: ibmveth: convert to hw_features") accidentally
removed call to ibmveth_set_csum_offload() in ibmveth_probe(). Put the
call back where it was, but with additional error checking provided
by ibmveth_set_features().
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
[sfr: dev -> netdev]
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/net/ibmveth.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index 4855f1f..be3fe71 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -1397,6 +1397,8 @@ static int __devinit ibmveth_probe(struct vio_dev *dev,
netdev_dbg(netdev, "registering netdev...\n");
+ ibmveth_set_features(netdev, netdev->features);
+
rc = register_netdev(netdev);
if (rc) {
--
1.7.4.4
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* Re: hvc_console: Don't access hvc_task if not initialised
From: Amit Shah @ 2011-04-28 4:00 UTC (permalink / raw)
To: Greg KH; +Cc: Rusty Russell, linux-kernel, Milton Miller, linuxppc-dev
In-Reply-To: <20110428000934.GA14294@kroah.com>
On (Wed) 27 Apr 2011 [17:09:34], Greg KH wrote:
> On Wed, Apr 27, 2011 at 12:01:47PM +0530, Amit Shah wrote:
> > On (Wed) 27 Apr 2011 [14:31:29], Rusty Russell wrote:
> > > On Wed, 20 Apr 2011 22:36:10 +0530, Amit Shah <amit.shah@redhat.com> wrote:
> > > > On (Wed) 20 Apr 2011 [07:34:35], Greg KH wrote:
> > > > > Care to either create this patch, or resend your original one, if you
> > > > > want it applied?
> > > >
> > > > Rusty has the other one queued. I pinged him about status.
> > >
> > > It's merged, but I don't think it had the requisite cc:stable, did it?
> >
> > No, because at the point of submitting I didn't know it would solve
> > this bug as well. Greg, can you pick
> > afa2689e19073cd2e762d0f2c1358fab1ab9f18c for stable?
>
> Yes, but in the future, this is NOT the way to get patches into the
> stable tree. Please read Documentation/stable_kernel_rules.txt for how
> to do it properly.
Got it, thanks!
Amit
^ permalink raw reply
* [PATCH] powerpc/85xx: Save and restore pcie ATMU windows for PM
From: Prabhakar Kushwaha @ 2011-04-28 6:38 UTC (permalink / raw)
To: linuxppc-dev; +Cc: meet2prabhu, Prabhakar Kushwaha, Jiang Yutang
D3-cold state indicates removal of the clock and power. however auxiliary (AUX)
Power may remain available even after the main power rails are powered down.
wakeup from D3-cold state requires full context restore. Other things are taken
care in pci-driver except ATMUs.
ATMU windows needs to be saved and restored during suspend and resume.
Signed-off-by: Jiang Yutang <b14898@freescale.com>
Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
---
Based upon git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git(branch master)
arch/powerpc/sysdev/fsl_pci.c | 116 +++++++++++++++++++++++++++++++++++++++++
arch/powerpc/sysdev/fsl_pci.h | 7 ++-
2 files changed, 121 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index f8f7f28..809fbfe 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -35,6 +35,9 @@
#include <sysdev/fsl_pci.h>
static int fsl_pcie_bus_fixup, is_mpc83xx_pci;
+static int pcie_saved_pow_piw;
+struct pci_outbound_window_regs pcie_saved_pow[PCIE_POW_NUMBER];
+struct pci_inbound_window_regs pcie_saved_piw[PCIE_PIW_NUMBER];
static void __init quirk_fsl_pcie_header(struct pci_dev *dev)
{
@@ -746,3 +749,116 @@ u64 fsl_pci_immrbar_base(struct pci_controller *hose)
return 0;
}
+
+
+static int fsl_pcie_save_pow_piw(struct device_node *np,
+ struct resource *rsrc)
+{
+ struct ccsr_pci __iomem *pci;
+ int start_idx = 1, end_idx = 4;
+ unsigned int i;
+
+ pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1);
+
+ if (!pci) {
+ printk(KERN_WARNING"pcie_pow ioremap error!\n");
+ return -1;
+ }
+
+ if (of_device_is_compatible(np, "fsl,qoriq-pcie-v2.2")) {
+ start_idx = 0;
+ end_idx = 3;
+ }
+
+ for (i = 0; i < PCIE_POW_NUMBER; i++) {
+ pcie_saved_pow[i].potar = in_be32(&pci->pow[i].potar);
+ pcie_saved_pow[i].potear = in_be32(&pci->pow[i].potear);
+ pcie_saved_pow[i].powbar = in_be32(&pci->pow[i].powbar);
+ pcie_saved_pow[i].powar = in_be32(&pci->pow[i].powar);
+ }
+
+ for (i = start_idx; i < end_idx; i++) {
+ pcie_saved_piw[i].pitar = in_be32(&pci->piw[i].pitar);
+ pcie_saved_piw[i].piwbar = in_be32(&pci->piw[i].piwbar);
+ pcie_saved_piw[i].piwbear = in_be32(&pci->piw[i].piwbear);
+ pcie_saved_piw[i].piwar = in_be32(&pci->piw[i].piwar);
+ }
+
+ iounmap(pci);
+ return 0;
+}
+
+static int fsl_pcie_restore_pow_piw(struct device_node *np,
+ struct resource *rsrc)
+{
+ struct ccsr_pci __iomem *pci;
+ int start_idx = 1, end_idx = 4;
+ unsigned int i;
+
+ pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1);
+
+ if (of_device_is_compatible(np, "fsl,qoriq-pcie-v2.2")) {
+ start_idx = 0;
+ end_idx = 3;
+ }
+ if (!pci) {
+ printk(KERN_WARNING"pcie_pow ioremap error!\n");
+ return -1;
+ }
+
+ for (i = 0; i < PCIE_POW_NUMBER; i++) {
+ out_be32(&pci->pow[i].potar, pcie_saved_pow[i].potar);
+ out_be32(&pci->pow[i].potear, pcie_saved_pow[i].potear);
+ out_be32(&pci->pow[i].powbar, pcie_saved_pow[i].powbar);
+ out_be32(&pci->pow[i].powar, pcie_saved_pow[i].powar);
+ }
+
+ for (i = 0; i < PCIE_PIW_NUMBER; i++) {
+ out_be32(&pci->piw[i].pitar, pcie_saved_piw[i].pitar);
+ out_be32(&pci->piw[i].piwbar, pcie_saved_piw[i].piwbar);
+ out_be32(&pci->piw[i].piwbear, pcie_saved_piw[i].piwbear);
+ out_be32(&pci->piw[i].piwar, pcie_saved_piw[i].piwar);
+ }
+
+ iounmap(pci);
+ return 0;
+}
+
+static void fsl_pcie_suspend_save(struct pci_dev *dev)
+{
+ struct device_node *np;
+ struct resource rsrc;
+
+ if (pcie_saved_pow_piw == 1)
+ return;
+
+ for_each_node_by_type(np, "pci") {
+ if (of_device_is_compatible(np, "fsl,p1022-pcie")) {
+ of_address_to_resource(np, 0, &rsrc);
+ fsl_pcie_save_pow_piw(np, &rsrc);
+ }
+ }
+ pcie_saved_pow_piw = 1;
+}
+DECLARE_PCI_FIXUP_SUSPEND(0x1957, PCI_DEVICE_ID_P1022E, fsl_pcie_suspend_save);
+DECLARE_PCI_FIXUP_SUSPEND(0x1957, PCI_DEVICE_ID_P1022, fsl_pcie_suspend_save);
+
+static void fsl_pcie_resume_restore(struct pci_dev *dev)
+{
+ struct device_node *np;
+ struct resource rsrc;
+
+ if (pcie_saved_pow_piw == 0)
+ return;
+
+ for_each_node_by_type(np, "pci") {
+ if (of_device_is_compatible(np, "fsl,p1022-pcie")) {
+ of_address_to_resource(np, 0, &rsrc);
+ fsl_pcie_restore_pow_piw(np, &rsrc);
+ }
+ }
+ pcie_saved_pow_piw = 0;
+}
+DECLARE_PCI_FIXUP_RESUME(0x1957, PCI_DEVICE_ID_P1022E, fsl_pcie_resume_restore);
+DECLARE_PCI_FIXUP_RESUME(0x1957, PCI_DEVICE_ID_P1022, fsl_pcie_resume_restore);
+
diff --git a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h
index a39ed5c..853672f 100644
--- a/arch/powerpc/sysdev/fsl_pci.h
+++ b/arch/powerpc/sysdev/fsl_pci.h
@@ -14,6 +14,9 @@
#ifndef __POWERPC_FSL_PCI_H
#define __POWERPC_FSL_PCI_H
+#define PCIE_POW_NUMBER 5
+#define PCIE_PIW_NUMBER 4
+
#define PCIE_LTSSM 0x0404 /* PCIE Link Training and Status */
#define PCIE_LTSSM_L0 0x16 /* L0 state */
#define PIWAR_EN 0x80000000 /* Enable */
@@ -64,7 +67,7 @@ struct ccsr_pci {
* The default outbound register set is used when a transaction misses
* in all of the other outbound windows.
*/
- struct pci_outbound_window_regs pow[5];
+ struct pci_outbound_window_regs pow[PCIE_POW_NUMBER];
u8 res14[96];
struct pci_inbound_window_regs pmit; /* 0xd00 - 0xd9c Inbound MSI */
u8 res6[96];
@@ -72,7 +75,7 @@ struct ccsr_pci {
* inbound window 1 supports only a 32-bit base address and does not
* define an inbound window base extended address register.
*/
- struct pci_inbound_window_regs piw[4];
+ struct pci_inbound_window_regs piw[PCIE_PIW_NUMBER];
__be32 pex_err_dr; /* 0x.e00 - PCI/PCIE error detect register */
u8 res21[4];
--
1.7.3
^ permalink raw reply related
* [PATCH] powerpc/85xx:Create dts of each core in CAMP mode for P1020RDB
From: Prabhakar Kushwaha @ 2011-04-28 7:00 UTC (permalink / raw)
To: linuxppc-dev, devicetree-discuss; +Cc: meet2prabhu, Prabhakar Kushwaha
Create the dts files for each core and splits the devices between the two cores
for P1020RDB.
Core0 has core0 to have memory, l2, i2c, spi, gpio, tdm, dma, usb, eth1, eth2,
sdhc, crypto, global-util, message, pci0, pci1, msi.
Core1 has l2, eth0, crypto.
MPIC is shared between two cores but each core will protect its interrupts from
other core by using "protected-sources" of mpic.
Fix compatible property for global-util node of P1020si.dtsi.
Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
---
Based upon git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git(branch master)
This patch depends on following patch
"powerpc/85xx: P1020 DTS : re-organize dts files"
arch/powerpc/boot/dts/p1020rdb_camp_core0.dts | 213 +++++++++++++++++++++++++
arch/powerpc/boot/dts/p1020rdb_camp_core1.dts | 148 +++++++++++++++++
arch/powerpc/boot/dts/p1020si.dtsi | 2 +-
3 files changed, 362 insertions(+), 1 deletions(-)
create mode 100644 arch/powerpc/boot/dts/p1020rdb_camp_core0.dts
create mode 100644 arch/powerpc/boot/dts/p1020rdb_camp_core1.dts
diff --git a/arch/powerpc/boot/dts/p1020rdb_camp_core0.dts b/arch/powerpc/boot/dts/p1020rdb_camp_core0.dts
new file mode 100644
index 0000000..f0bf7f4
--- /dev/null
+++ b/arch/powerpc/boot/dts/p1020rdb_camp_core0.dts
@@ -0,0 +1,213 @@
+/*
+ * P1020 RDB Core0 Device Tree Source in CAMP mode.
+ *
+ * In CAMP mode, each core needs to have its own dts. Only mpic and L2 cache
+ * can be shared, all the other devices must be assigned to one core only.
+ * This dts file allows core0 to have memory, l2, i2c, spi, gpio, tdm, dma, usb,
+ * eth1, eth2, sdhc, crypto, global-util, message, pci0, pci1, msi.
+ *
+ * Please note to add "-b 0" for core0's dts compiling.
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+/include/ "p1020si.dtsi"
+
+/ {
+ model = "fsl,P1020RDB";
+ compatible = "fsl,P1020RDB", "fsl,MPC85XXRDB-CAMP";
+
+ aliases {
+ ethernet1 = &enet1;
+ ethernet2 = &enet2;
+ serial0 = &serial0;
+ pci0 = &pci0;
+ pci1 = &pci1;
+ };
+
+ cpus {
+ PowerPC,P1020@1 {
+ status = "disabled";
+ };
+ };
+
+ memory {
+ device_type = "memory";
+ };
+
+ localbus@ffe05000 {
+ status = "disabled";
+ };
+
+ soc@ffe00000 {
+ i2c@3000 {
+ rtc@68 {
+ compatible = "dallas,ds1339";
+ reg = <0x68>;
+ };
+ };
+
+ serial1: serial@4600 {
+ status = "disabled";
+ };
+
+ spi@7000 {
+ fsl_m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "fsl,espi-flash";
+ reg = <0>;
+ linux,modalias = "fsl_m25p80";
+ spi-max-frequency = <40000000>;
+
+ partition@0 {
+ /* 512KB for u-boot Bootloader Image */
+ reg = <0x0 0x00080000>;
+ label = "SPI (RO) U-Boot Image";
+ read-only;
+ };
+
+ partition@80000 {
+ /* 512KB for DTB Image */
+ reg = <0x00080000 0x00080000>;
+ label = "SPI (RO) DTB Image";
+ read-only;
+ };
+
+ partition@100000 {
+ /* 4MB for Linux Kernel Image */
+ reg = <0x00100000 0x00400000>;
+ label = "SPI (RO) Linux Kernel Image";
+ read-only;
+ };
+
+ partition@500000 {
+ /* 4MB for Compressed RFS Image */
+ reg = <0x00500000 0x00400000>;
+ label = "SPI (RO) Compressed RFS Image";
+ read-only;
+ };
+
+ partition@900000 {
+ /* 7MB for JFFS2 based RFS */
+ reg = <0x00900000 0x00700000>;
+ label = "SPI (RW) JFFS2 RFS";
+ };
+ };
+ };
+
+ mdio@24000 {
+ phy0: ethernet-phy@0 {
+ interrupt-parent = <&mpic>;
+ interrupts = <3 1>;
+ reg = <0x0>;
+ };
+ phy1: ethernet-phy@1 {
+ interrupt-parent = <&mpic>;
+ interrupts = <2 1>;
+ reg = <0x1>;
+ };
+ };
+
+ mdio@25000 {
+ tbi0: tbi-phy@11 {
+ reg = <0x11>;
+ device_type = "tbi-phy";
+ };
+ };
+
+ enet0: ethernet@b0000 {
+ status = "disabled";
+ };
+
+ enet1: ethernet@b1000 {
+ phy-handle = <&phy0>;
+ tbi-handle = <&tbi0>;
+ phy-connection-type = "sgmii";
+ };
+
+ enet2: ethernet@b2000 {
+ phy-handle = <&phy1>;
+ phy-connection-type = "rgmii-id";
+ };
+
+ usb@22000 {
+ phy_type = "ulpi";
+ };
+
+ /* USB2 is shared with localbus, so it must be disabled
+ by default. We can't put 'status = "disabled";' here
+ since U-Boot doesn't clear the status property when
+ it enables USB2. OTOH, U-Boot does create a new node
+ when there isn't any. So, just comment it out.
+ usb@23000 {
+ phy_type = "ulpi";
+ };
+ */
+
+ mpic: pic@40000 {
+ protected-sources = <
+ 42 29 30 34 /* serial1, enet0-queue-group0 */
+ 17 18 24 45 /* enet0-queue-group1, crypto */
+ >;
+ };
+
+ };
+
+ pci0: pcie@ffe09000 {
+ ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
+ 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
+ interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
+ interrupt-map = <
+ /* IDSEL 0x0 */
+ 0000 0x0 0x0 0x1 &mpic 0x4 0x1
+ 0000 0x0 0x0 0x2 &mpic 0x5 0x1
+ 0000 0x0 0x0 0x3 &mpic 0x6 0x1
+ 0000 0x0 0x0 0x4 &mpic 0x7 0x1
+ >;
+ pcie@0 {
+ reg = <0x0 0x0 0x0 0x0 0x0>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ device_type = "pci";
+ ranges = <0x2000000 0x0 0xa0000000
+ 0x2000000 0x0 0xa0000000
+ 0x0 0x20000000
+
+ 0x1000000 0x0 0x0
+ 0x1000000 0x0 0x0
+ 0x0 0x100000>;
+ };
+ };
+
+ pci1: pcie@ffe0a000 {
+ ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
+ 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
+ interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
+ interrupt-map = <
+ /* IDSEL 0x0 */
+ 0000 0x0 0x0 0x1 &mpic 0x0 0x1
+ 0000 0x0 0x0 0x2 &mpic 0x1 0x1
+ 0000 0x0 0x0 0x3 &mpic 0x2 0x1
+ 0000 0x0 0x0 0x4 &mpic 0x3 0x1
+ >;
+ pcie@0 {
+ reg = <0x0 0x0 0x0 0x0 0x0>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ device_type = "pci";
+ ranges = <0x2000000 0x0 0x80000000
+ 0x2000000 0x0 0x80000000
+ 0x0 0x20000000
+
+ 0x1000000 0x0 0x0
+ 0x1000000 0x0 0x0
+ 0x0 0x100000>;
+ };
+ };
+};
diff --git a/arch/powerpc/boot/dts/p1020rdb_camp_core1.dts b/arch/powerpc/boot/dts/p1020rdb_camp_core1.dts
new file mode 100644
index 0000000..8498988
--- /dev/null
+++ b/arch/powerpc/boot/dts/p1020rdb_camp_core1.dts
@@ -0,0 +1,148 @@
+/*
+ * P1020 RDB Core1 Device Tree Source in CAMP mode.
+ *
+ * In CAMP mode, each core needs to have its own dts. Only mpic and L2 cache
+ * can be shared, all the other devices must be assigned to one core only.
+ * This dts allows core1 to have l2, eth0, crypto.
+ *
+ * Please note to add "-b 1" for core1's dts compiling.
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+/include/ "p1020si.dtsi"
+
+/ {
+ model = "fsl,P1020RDB";
+ compatible = "fsl,P1020RDB", "fsl,MPC85XXRDB-CAMP";
+
+ aliases {
+ ethernet0 = &enet0;
+ serial0 = &serial1;
+ };
+
+ cpus {
+ PowerPC,P1020@0 {
+ status = "disabled";
+ };
+ };
+
+ memory {
+ device_type = "memory";
+ };
+
+ localbus@ffe05000 {
+ status = "disabled";
+ };
+
+ soc@ffe00000 {
+ ecm-law@0 {
+ status = "disabled";
+ };
+
+ ecm@1000 {
+ status = "disabled";
+ };
+
+ memory-controller@2000 {
+ status = "disabled";
+ };
+
+ i2c@3000 {
+ status = "disabled";
+ };
+
+ i2c@3100 {
+ status = "disabled";
+ };
+
+ serial0: serial@4500 {
+ status = "disabled";
+ };
+
+ spi@7000 {
+ status = "disabled";
+ };
+
+ gpio: gpio-controller@f000 {
+ status = "disabled";
+ };
+
+ dma@21300 {
+ status = "disabled";
+ };
+
+ mdio@24000 {
+ status = "disabled";
+ };
+
+ mdio@25000 {
+ status = "disabled";
+ };
+
+ enet0: ethernet@b0000 {
+ fixed-link = <1 1 1000 0 0>;
+ phy-connection-type = "rgmii-id";
+
+ };
+
+ enet1: ethernet@b1000 {
+ status = "disabled";
+ };
+
+ enet2: ethernet@b2000 {
+ status = "disabled";
+ };
+
+ usb@22000 {
+ status = "disabled";
+ };
+
+ sdhci@2e000 {
+ status = "disabled";
+ };
+
+ mpic: pic@40000 {
+ protected-sources = <
+ 16 /* ecm, mem, L2, pci0, pci1 */
+ 43 42 59 /* i2c, serial0, spi */
+ 47 63 62 /* gpio, tdm */
+ 20 21 22 23 /* dma */
+ 03 02 /* mdio */
+ 35 36 40 /* enet1-queue-group0 */
+ 51 52 67 /* enet1-queue-group1 */
+ 31 32 33 /* enet2-queue-group0 */
+ 25 26 27 /* enet2-queue-group1 */
+ 28 72 58 /* usb, sdhci, crypto */
+ 0xb0 0xb1 0xb2 /* message */
+ 0xb3 0xb4 0xb5
+ 0xb6 0xb7
+ 0xe0 0xe1 0xe2 /* msi */
+ 0xe3 0xe4 0xe5
+ 0xe6 0xe7 /* sdhci, crypto , pci */
+ >;
+ };
+
+ msi@41600 {
+ status = "disabled";
+ };
+
+ global-utilities@e0000 { //global utilities block
+ status = "disabled";
+ };
+
+ };
+
+ pci0: pcie@ffe09000 {
+ status = "disabled";
+ };
+
+ pci1: pcie@ffe0a000 {
+ status = "disabled";
+ };
+};
diff --git a/arch/powerpc/boot/dts/p1020si.dtsi b/arch/powerpc/boot/dts/p1020si.dtsi
index f6f1100..5c5acb6 100644
--- a/arch/powerpc/boot/dts/p1020si.dtsi
+++ b/arch/powerpc/boot/dts/p1020si.dtsi
@@ -343,7 +343,7 @@
};
global-utilities@e0000 { //global utilities block
- compatible = "fsl,p1020-guts";
+ compatible = "fsl,p1020-guts","fsl,p2020-guts";
reg = <0xe0000 0x1000>;
fsl,has-rstcr;
};
--
1.7.3
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox