All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] parisc: fix LMMIO mismatch between PAT length and MASK register
@ 2013-06-14  7:11 Helge Deller
  2013-06-14  7:28 ` Matt Turner
                   ` (2 more replies)
  0 siblings, 3 replies; 42+ messages in thread
From: Helge Deller @ 2013-06-14  7:11 UTC (permalink / raw)
  To: linux-parisc, James Bottomley, Thomas Bogendoerfer

From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

The LMMIO length reported by PAT and the length given by the LBA MASK
register are not consistent. This leads e.g. to a non-working ATI FireGL
card with the radeon DRM driver since the memory can't be mapped.

Fix this by correctly adjusting the resource sizes.

Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index 1f05913..7dc0e40 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -994,6 +994,15 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
 		case PAT_LMMIO:
 			/* used to fix up pre-initialized MEM BARs */
 			if (!lba_dev->hba.lmmio_space.flags) {
+				unsigned long lba_len;
+				lba_len = ~READ_REG32(lba_dev->hba.base_addr
+						+ LBA_LMMIO_MASK);
+				if ((p->end - p->start) != lba_len) {
+					pr_warn("PCI%02x LMMIO mismatch between PAT length (0x%lx) and MASK register (0x%lx), fixing.\n",
+					  (int)lba_dev->hba.bus_num.start,
+						p->end - p->start, lba_len);
+					p->end = p->start + lba_len;
+				}
 				sprintf(lba_dev->hba.lmmio_name,
 						"PCI%02x LMMIO",
 						(int)lba_dev->hba.bus_num.start);

^ permalink raw reply related	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2013-09-26  8:39 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-14  7:11 [PATCH] parisc: fix LMMIO mismatch between PAT length and MASK register Helge Deller
2013-06-14  7:28 ` Matt Turner
2013-06-14  7:38   ` Helge Deller
2013-06-14  7:40     ` Helge Deller
2013-06-14  8:38     ` Thomas Bogendoerfer
2013-07-09  5:34     ` Alex Ivanov
2013-07-09 15:18       ` John David Anglin
2013-07-09 19:45         ` Alex Ivanov
2013-07-09 20:59           ` John David Anglin
2013-07-09 23:35             ` John David Anglin
2013-07-10 20:19               ` Alex Ivanov
2013-07-10 20:28                 ` John David Anglin
2013-07-10 21:14                 ` Matt Turner
2013-07-10 21:29                   ` Alex Ivanov
     [not found]                     ` <51DF0B90.3040506@gmx.de>
2013-07-11 19:47                       ` Helge Deller
2013-08-04 11:00                         ` Alex Ivanov
2013-08-04 15:44                           ` John David Anglin
2013-08-04 16:28                             ` Matt Turner
2013-08-10 19:41                           ` John David Anglin
2013-09-09 16:44                           ` drm/radeon: "ring test failed" on PA-RISC Linux Alex Ivanov
2013-09-09 17:43                             ` Alex Deucher
2013-09-10  9:20                               ` Alex Ivanov
2013-09-10 12:37                                 ` Alex Deucher
2013-09-10 13:03                                   ` Hans Verkuil
2013-09-10 13:25                                 ` Konrad Rzeszutek Wilk
2013-09-11 11:11                                   ` Fwd: " Alex Ivanov
2013-09-17  8:13                                     ` Alex Ivanov
2013-09-17  9:23                                   ` Alex Ivanov
2013-09-17 14:24                                     ` Alex Deucher
2013-09-17 19:33                                       ` Alex Ivanov
2013-09-20  6:52                                         ` Alex Ivanov
2013-09-20 21:27                                         ` Alex Deucher
2013-09-21  3:39                                           ` Alex Ivanov
2013-09-23 20:11                                             ` Konrad Rzeszutek Wilk
2013-09-25 16:29                                               ` Alex Ivanov
2013-09-25 17:28                                                 ` Konrad Rzeszutek Wilk
2013-09-25 18:17                                                   ` Alex Deucher
2013-09-25 18:51                                                   ` Alex Ivanov
2013-09-26  8:39                                                     ` Alex Ivanov
2013-09-10 15:45                             ` Michel Dänzer
2013-06-14  8:39 ` [PATCH] parisc: fix LMMIO mismatch between PAT length and MASK register Thomas Bogendoerfer
2013-06-18 21:21 ` Helge Deller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.