[PATCH 01/27] powerpc/eeh: Move common part to kernel directory
Gavin Shan
shangw at linux.vnet.ibm.com
Tue Jun 18 10:55:45 EST 2013
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
More information about the Linuxppc-dev
mailing list