aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2009-03-19 12:46:35 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-03-23 22:47:32 -0400
commit2a7d55fda58eb4e3652252d4f71222bd1ff90c5e (patch)
tree7c6fd2b80064ca8e80b1770034dcdcbb616a3de5 /arch/powerpc/platforms/cell
parent2319f1239592d0de80414ad2338c2bd7384a2a41 (diff)
powerpc/cell: Fix iommu exception reporting
Currently, we will report a page fault as a segment fault, and report a segment fault as both a page and segment fault. Fix the SPF_P definition to be correct according to the iommu docs, and mask before comparing. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/cell')
-rw-r--r--arch/powerpc/platforms/cell/iommu.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index ee5033eddf01..5744527a7f2a 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -74,7 +74,7 @@
74#define IOC_IO_ExcpStat_V 0x8000000000000000ul 74#define IOC_IO_ExcpStat_V 0x8000000000000000ul
75#define IOC_IO_ExcpStat_SPF_Mask 0x6000000000000000ul 75#define IOC_IO_ExcpStat_SPF_Mask 0x6000000000000000ul
76#define IOC_IO_ExcpStat_SPF_S 0x6000000000000000ul 76#define IOC_IO_ExcpStat_SPF_S 0x6000000000000000ul
77#define IOC_IO_ExcpStat_SPF_P 0x4000000000000000ul 77#define IOC_IO_ExcpStat_SPF_P 0x2000000000000000ul
78#define IOC_IO_ExcpStat_ADDR_Mask 0x00000007fffff000ul 78#define IOC_IO_ExcpStat_ADDR_Mask 0x00000007fffff000ul
79#define IOC_IO_ExcpStat_RW_Mask 0x0000000000000800ul 79#define IOC_IO_ExcpStat_RW_Mask 0x0000000000000800ul
80#define IOC_IO_ExcpStat_IOID_Mask 0x00000000000007fful 80#define IOC_IO_ExcpStat_IOID_Mask 0x00000000000007fful
@@ -247,17 +247,18 @@ static void tce_free_cell(struct iommu_table *tbl, long index, long npages)
247 247
248static irqreturn_t ioc_interrupt(int irq, void *data) 248static irqreturn_t ioc_interrupt(int irq, void *data)
249{ 249{
250 unsigned long stat; 250 unsigned long stat, spf;
251 struct cbe_iommu *iommu = data; 251 struct cbe_iommu *iommu = data;
252 252
253 stat = in_be64(iommu->xlate_regs + IOC_IO_ExcpStat); 253 stat = in_be64(iommu->xlate_regs + IOC_IO_ExcpStat);
254 spf = stat & IOC_IO_ExcpStat_SPF_Mask;
254 255
255 /* Might want to rate limit it */ 256 /* Might want to rate limit it */
256 printk(KERN_ERR "iommu: DMA exception 0x%016lx\n", stat); 257 printk(KERN_ERR "iommu: DMA exception 0x%016lx\n", stat);
257 printk(KERN_ERR " V=%d, SPF=[%c%c], RW=%s, IOID=0x%04x\n", 258 printk(KERN_ERR " V=%d, SPF=[%c%c], RW=%s, IOID=0x%04x\n",
258 !!(stat & IOC_IO_ExcpStat_V), 259 !!(stat & IOC_IO_ExcpStat_V),
259 (stat & IOC_IO_ExcpStat_SPF_S) ? 'S' : ' ', 260 (spf == IOC_IO_ExcpStat_SPF_S) ? 'S' : ' ',
260 (stat & IOC_IO_ExcpStat_SPF_P) ? 'P' : ' ', 261 (spf == IOC_IO_ExcpStat_SPF_P) ? 'P' : ' ',
261 (stat & IOC_IO_ExcpStat_RW_Mask) ? "Read" : "Write", 262 (stat & IOC_IO_ExcpStat_RW_Mask) ? "Read" : "Write",
262 (unsigned int)(stat & IOC_IO_ExcpStat_IOID_Mask)); 263 (unsigned int)(stat & IOC_IO_ExcpStat_IOID_Mask));
263 printk(KERN_ERR " page=0x%016lx\n", 264 printk(KERN_ERR " page=0x%016lx\n",