History

powerpc/eeh: Reduce lines of log dump

The patch prints 4 PCIE or AER config registers each line, which is part of the EEH log so that it looks a bit more compact.

Gavin Shan committed 12 years ago

Commit 0ed352d1 parent dc561fb1 file · +33 −5Browse files

Unified · Split

arch/powerpc/kernel/eeh.c+33−5
@@ -157,12 +157,13 @@ __setup("eeh=", eeh_setup); · 156 unmodified lines
157157 * This routine captures assorted PCI configuration space data,
158158 * and puts them into a buffer for RTAS error logging.
159159 */
160−static size_t eeh_gather_pci_data(struct eeh_dev *edev, char * buf, size_t len)
160+static size_t eeh_gather_pci_data(struct eeh_dev *edev, char *buf, size_t len)
161161 {
162162 struct device_node *dn = eeh_dev_to_of_node(edev);
163163 u32 cfg;
164164 int cap, i;
165− int n = 0;
165+ int n = 0, l = 0;
166+ char buffer[128];
166167
167168 n += scnprintf(buf+n, len-n, "%s\n", dn->full_name);
168169 pr_warn("EEH: of node=%s\n", dn->full_name);
@@ -207,8 +208,22 @@ static size_t eeh_gather_pci_data(struct eeh_dev *edev, char * buf, size_t len) · 38 unmodified lines
207208 for (i=0; i<=8; i++) {
208209 eeh_ops->read_config(dn, cap+4*i, 4, &cfg);
209210 n += scnprintf(buf+n, len-n, "%02x:%x\n", 4*i, cfg);
210− pr_warn("EEH: PCI-E %02x: %08x\n", i, cfg);
211+
212+ if ((i % 4) == 0) {
213+ if (i != 0)
214+ pr_warn("%s\n", buffer);
215+
216+ l = scnprintf(buffer, sizeof(buffer),
217+ "EEH: PCI-E %02x: %08x ",
218+ 4*i, cfg);
219+ } else {
220+ l += scnprintf(buffer+l, sizeof(buffer)-l,
221+ "%08x ", cfg);
222+ }
223+
211224 }
225+
226+ pr_warn("%s\n", buffer);
212227 }
213228
214229 /* If AER capable, dump it */
@@ -217,11 +232,24 @@ static size_t eeh_gather_pci_data(struct eeh_dev *edev, char * buf, size_t len) · 2 unmodified lines
217232 n += scnprintf(buf+n, len-n, "pci-e AER:\n");
218233 pr_warn("EEH: PCI-E AER capability register set follows:\n");
219234
220− for (i=0; i<14; i++) {
235+ for (i=0; i<=13; i++) {
221236 eeh_ops->read_config(dn, cap+4*i, 4, &cfg);
222237 n += scnprintf(buf+n, len-n, "%02x:%x\n", 4*i, cfg);
223− pr_warn("EEH: PCI-E AER %02x: %08x\n", i, cfg);
238+
239+ if ((i % 4) == 0) {
240+ if (i != 0)
241+ pr_warn("%s\n", buffer);
242+
243+ l = scnprintf(buffer, sizeof(buffer),
244+ "EEH: PCI-E AER %02x: %08x ",
245+ 4*i, cfg);
246+ } else {
247+ l += scnprintf(buffer+l, sizeof(buffer)-l,
248+ "%08x ", cfg);
249+ }
224250 }
251+
252+ pr_warn("%s\n", buffer);
225253 }
226254
227255 return n;