On Mon, Jun 17, 2013 at 11:03:19AM +0800, Mike Qiu wrote: >δΊ 2013/6/15 17:02, Gavin Shan ει:
.../... >>+ >>+ /* Gather bridge-specific registers */ >>+ if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) { >>+ eeh_ops->read_config(dn, PCI_SEC_STATUS, 2, &cfg); >>+ n += scnprintf(buf+n, len-n, "sec stat:%x\n", cfg); >>+ printk(KERN_WARNING "EEH: Bridge secondary status: %04x\n", >>cfg); >>+ >>+ eeh_ops->read_config(dn, PCI_BRIDGE_CONTROL, 2, &cfg); >>+ n += scnprintf(buf+n, len-n, "brdg ctl:%x\n", cfg); >>+ printk(KERN_WARNING "EEH: Bridge control: %04x\n", cfg); >>+ } >>+ >>+ /* Dump out the PCI-X command and status regs */ >>+ cap = pci_find_capability(dev, PCI_CAP_ID_PCIX); >BTW, when move common part , here you could use dev->pcie_cap at your >convenience, and pcie_cap has >been initialized in of_create_pci_dev--->set_pcie_port_type Thanks, Mike. It's not safe enough to use the cached capability offsets, which might be invalid when we running into here. However, we probably use following code in future, but not now :-) It would save some PCI-CFG access. if (dev->pcie_cap) cap = dev->pcie_cap; else cap = pci_find_capability(dev, PCI_CAP_ID_PCIX); Thanks, Gavin _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev