Re: Problem with PCI bus rescan on 460EX

2010-03-29 Thread Kenji Kaneshige
Yinghai Lu wrote: On Sun, Mar 28, 2010 at 2:13 AM, Felix Radensky fe...@embedded-sol.com wrote: Hello, Kenji-san I've tried Jesse's tree with Yinghai's patches, but they don't seem to help. Memory for bridge is not allocated after insertion of hotplug device and bus rescan. Attached dmesg

Re: Problem with PCI bus rescan on 460EX

2010-03-29 Thread Felix Radensky
Hello Kenji-san, Kenji Kaneshige wrote: Felix, I think assigning hpXXsize at boot time is the simpler solution, if it is acceptable workaround for you. And as Yinghai suggested in the another email, removing slot's parent bridge first should be one of the workaround. But the problem is

Re: Problem with PCI bus rescan on 460EX

2010-03-28 Thread Felix Radensky
Hello, Kenji-san Kenji Kaneshige wrote: Felix Radensky wrote: Hello, Kenji-san Kenji Kaneshige wrote: I misunderstood the problem. My understanding was memory resource was not enabled even though Linux set the Memory Space bit in the command register. But it was not correct. The bridge

Re: Problem with PCI bus rescan on 460EX

2010-03-28 Thread Benjamin Herrenschmidt
On Sun, 2010-03-28 at 12:13 +0300, Felix Radensky wrote: I've tried Jesse's tree with Yinghai's patches, but they don't seem to help. Memory for bridge is not allocated after insertion of hotplug device and bus rescan. Attached dmesg output in case of success and failure. I'd recommend that

Re: Problem with PCI bus rescan on 460EX

2010-03-28 Thread Felix Radensky
Hi Ben, Benjamin Herrenschmidt wrote: On Sun, 2010-03-28 at 12:13 +0300, Felix Radensky wrote: I've tried Jesse's tree with Yinghai's patches, but they don't seem to help. Memory for bridge is not allocated after insertion of hotplug device and bus rescan. Attached dmesg output in case of

Re: Problem with PCI bus rescan on 460EX

2010-03-28 Thread Yinghai Lu
On Sun, Mar 28, 2010 at 2:13 AM, Felix Radensky fe...@embedded-sol.com wrote: Hello, Kenji-san I've tried Jesse's tree with Yinghai's patches, but they don't seem to help. Memory for bridge is not allocated after insertion of hotplug device and bus rescan. Attached dmesg output in case of

Re: Problem with PCI bus rescan on 460EX

2010-03-17 Thread Felix Radensky
Hello Kenj-san Kenji Kaneshige wrote: By the way, I think Yinghai's bridge resource reallocation patch series might help you. It is in Jesse's PCI tree. Please take a look. I've tried Jesse's tree on my custom board and on 460EX evaluation board (Canyonlands). In both cases the kernel

Re: Problem with PCI bus rescan on 460EX

2010-03-17 Thread Benjamin Herrenschmidt
On Wed, 2010-03-17 at 09:38 +0200, Felix Radensky wrote: Hello Kenj-san Kenji Kaneshige wrote: By the way, I think Yinghai's bridge resource reallocation patch series might help you. It is in Jesse's PCI tree. Please take a look. I've tried Jesse's tree on my custom board and on

Re: Problem with PCI bus rescan on 460EX

2010-03-17 Thread Benjamin Herrenschmidt
This is Jesse tree with the default Canyonlands defconfig ? Hrm... I'll have to take a look, somebody mucking with PCI resource allocation is very likely to break something :-) Yep, default Canyonlands defconfig and default DTS. Which branch of Jesse tree btw ? master ?

Re: Problem with PCI bus rescan on 460EX

2010-03-17 Thread Benjamin Herrenschmidt
This is Jesse tree with the default Canyonlands defconfig ? Hrm... I'll have to take a look, somebody mucking with PCI resource allocation is very likely to break something :-) Yep, default Canyonlands defconfig and default DTS. Ok so Jesse is innocent :-) See the patch I just

Re: Problem with PCI bus rescan on 460EX

2010-03-16 Thread Felix Radensky
Hello, Kenji-san Kenji Kaneshige wrote: I misunderstood the problem. My understanding was memory resource was not enabled even though Linux set the Memory Space bit in the command register. But it was not correct. The bridge memory window was marked unused and Linux didn't try to set Memory

Re: Problem with PCI bus rescan on 460EX

2010-03-16 Thread Felix Radensky
Hello, Kenji-san Kenji Kaneshige wrote: I misunderstood the problem. My understanding was memory resource was not enabled even though Linux set the Memory Space bit in the command register. But it was not correct. The bridge memory window was marked unused and Linux didn't try to set Memory

Re: Problem with PCI bus rescan on 460EX

2010-03-16 Thread Kenji Kaneshige
Felix Radensky wrote: Hello, Kenji-san Kenji Kaneshige wrote: I misunderstood the problem. My understanding was memory resource was not enabled even though Linux set the Memory Space bit in the command register. But it was not correct. The bridge memory window was marked unused and Linux

Re: Problem with PCI bus rescan on 460EX

2010-03-15 Thread Felix Radensky
Hello Kenji-san, Kenji Kaneshige wrote: Felix Radensky wrote: Hello Kenji-san, Kenji Kaneshige wrote: I'm not sure, but I guess pci_setup_bridge() didn't update IO base/limit and Mem base/limit of the bridge (:00:02.0) because of the following lines. static void

Re: Problem with PCI bus rescan on 460EX

2010-03-15 Thread Kenji Kaneshige
Felix Radensky wrote: Hello Kenji-san, Kenji Kaneshige wrote: Felix Radensky wrote: Hello Kenji-san, Kenji Kaneshige wrote: I'm not sure, but I guess pci_setup_bridge() didn't update IO base/limit and Mem base/limit of the bridge (:00:02.0) because of the following lines. static void

Re: Problem with PCI bus rescan on 460EX

2010-03-15 Thread Felix Radensky
Hello, Kenji-san I think the device is expected to be ready to work if pci_enable_device() returns without error. So I think pci_enable_device() should return an error if it fails to enable the device (device is not ready to work). In this case, detecting your bridge's failure seems PPC

Re: Problem with PCI bus rescan on 460EX

2010-03-15 Thread Kenji Kaneshige
Felix Radensky wrote: Hello, Kenji-san I think the device is expected to be ready to work if pci_enable_device() returns without error. So I think pci_enable_device() should return an error if it fails to enable the device (device is not ready to work). In this case, detecting your bridge's

Re: Problem with PCI bus rescan on 460EX

2010-03-14 Thread Kenji Kaneshige
Felix Radensky wrote: Hello Kenji-san, Kenji Kaneshige wrote: I'm not sure, but I guess pci_setup_bridge() didn't update IO base/limit and Mem base/limit of the bridge (:00:02.0) because of the following lines. static void pci_setup_bridge(struct pci_bus *bus) { struct pci_dev

Re: Problem with PCI bus rescan on 460EX

2010-03-14 Thread Benjamin Herrenschmidt
On Mon, 2010-03-15 at 14:39 +0900, Kenji Kaneshige wrote: Yes, with these lines removed bridge memory window is properly allocated. These lines are to prevent updating IO or memory windows when there are some devices working behind the bridge. So please note that removing these lines is

Re: Problem with PCI bus rescan on 460EX

2010-03-14 Thread Benjamin Herrenschmidt
On Mon, 2010-03-15 at 16:46 +1100, Benjamin Herrenschmidt wrote: On Mon, 2010-03-15 at 14:39 +0900, Kenji Kaneshige wrote: Yes, with these lines removed bridge memory window is properly allocated. These lines are to prevent updating IO or memory windows when there are some

Re: Problem with PCI bus rescan on 460EX

2010-03-12 Thread Kenji Kaneshige
I'm not sure, but I guess pci_setup_bridge() didn't update IO base/limit and Mem base/limit of the bridge (:00:02.0) because of the following lines. static void pci_setup_bridge(struct pci_bus *bus) { struct pci_dev *bridge = bus-self; struct resource *res; struct

Re: Problem with PCI bus rescan on 460EX

2010-03-12 Thread Felix Radensky
Hello Kenji-san, Kenji Kaneshige wrote: I'm not sure, but I guess pci_setup_bridge() didn't update IO base/limit and Mem base/limit of the bridge (:00:02.0) because of the following lines. static void pci_setup_bridge(struct pci_bus *bus) { struct pci_dev *bridge = bus-self;

Re: Problem with PCI bus rescan on 460EX

2010-03-11 Thread Felix Radensky
Hi Alex, Thanks a lot for replying. Alex Chiang wrote: * Felix Radensky fe...@embedded-sol.com: The problem arises when device is plugged in after boot. After doing echo 1 /sys/bus/pci/rescan the device is identified, but bridge memory window is not allocated, and reads from

Re: Problem with PCI bus rescan on 460EX

2010-03-11 Thread Benjamin Herrenschmidt
On Thu, 2010-03-11 at 09:45 +0200, Felix Radensky wrote: Hi Alex, Thanks a lot for replying. Alex Chiang wrote: * Felix Radensky fe...@embedded-sol.com: The problem arises when device is plugged in after boot. After doing echo 1 /sys/bus/pci/rescan the device is

Re: Problem with PCI bus rescan on 460EX

2010-03-11 Thread Felix Radensky
Hi Ben, Benjamin Herrenschmidt wrote: Yes, we need to do a resource allocation pass, setup DMA, etc... and that is not done in that manual rescan case I suppose. I have to look. Part of the problem is that there is no proper hooks in the generic PCI code that I know of for that, but I'll have

Re: Problem with PCI bus rescan on 460EX

2010-03-11 Thread Benjamin Herrenschmidt
On Thu, 2010-03-11 at 23:41 +0200, Felix Radensky wrote: I'm fine with creating a minimal hotplug driver. The device I'm dealing with partially implements Compact PCI hotplug. It generates ENUM# interrupt, but Hotswap Control register layout does not completely follow the standard. Should

Re: Problem with PCI bus rescan on 460EX

2010-03-10 Thread Felix Radensky
Hi Alex, Resending, previous attempt was erroneously send as HTML. Thanks a lot for replying. Alex Chiang wrote: * Felix Radensky fe...@embedded-sol.com: The problem arises when device is plugged in after boot. After doing echo 1 /sys/bus/pci/rescan the device is identified, but bridge

Problem with PCI bus rescan on 460EX

2010-03-02 Thread Felix Radensky
Hi, I'm running linux-2.6.33 on a custom board based on 460EX. There's a PCI-PCI bridge on this board, PLX 6254, and a single hot-pluggable device behind the bridge. When this device is plugged in before system boots everything works fine: bridge and device are properly recognized by kernel,