Thread (33 messages) flat view 33 messages, 3 authors, 2013-06-18

Re: [PATCH 01/27] powerpc/eeh: Move common part to kernel directory

From: Gavin Shan <hidden>
Date: 2013-06-18 00:55:59

On Mon, Jun 17, 2013 at 11:03:19AM +0800, Mike Qiu wrote:
=E4=BA=8E 2013/6/15 17:02, Gavin Shan =E5=86=99=E9=81=93:
.../...
quoted
+
+	/* Gather bridge-specific registers */
+	if (dev->class >> 16 =3D=3D PCI_BASE_CLASS_BRIDGE) {
+		eeh_ops->read_config(dn, PCI_SEC_STATUS, 2, &cfg);
+		n +=3D 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 +=3D 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 =3D 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 =3D dev->pcie_cap;
	else
		cap =3D pci_find_capability(dev, PCI_CAP_ID_PCIX);=20

Thanks,
Gavin=20
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help