Skip to contentSkip to conversation

SCSI errors on powerpc with 2.6.24-rc6-mm1

DISCUSSION Balbir Singh 3 participants 10 messages Dec 24, 2007 – Dec 31, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi,

I've just seen this on my dmesg, this is new, never seen this before on this box and it happens only with this version of the kernel.

In this configuration, the page size is set to 64K and I've enabled fake NUMA nodes on PowerPC.

tce_buildmulti_pSeriesLP: plpar_tce_put failed. rc=-4

        index   = 0x4000002
        npages  = 0x0
        tce[0] val = 0x15ad0001
Call Trace:
[c00000000ffe74f0] [c0000000000491a4]
.tce_buildmulti_pSeriesLP+0x26c/0x2ac (unreliable)
[c00000000ffe75c0] [c0000000000295e4] .iommu_map_sg+0x1d4/0x418
[c00000000ffe76d0] [c000000000028664] .dma_iommu_map_sg+0x3c/0x50
[c00000000ffe7750] [c0000000003b6c30] .scsi_dma_map+0x70/0x94
[c00000000ffe77d0] [c0000000003dedbc] .ipr_queuecommand+0x300/0x500
[c00000000ffe7880] [c0000000003ae964] .scsi_dispatch_cmd+0x21c/0x2b8
[c00000000ffe7920] [c0000000003b67a0] .scsi_request_fn+0x310/0x460
[c00000000ffe79d0] [c00000000024ab90] .blk_run_queue+0x94/0xec
[c00000000ffe7a70] [c0000000003b3b08] .scsi_run_queue+0x24c/0x27c
[c00000000ffe7b20] [c0000000003b4424] .scsi_next_command+0x48/0x70
[c00000000ffe7bc0] [c0000000003b4b48] .scsi_end_request+0xbc/0xe4
[c00000000ffe7c60] [c0000000003b5294] .scsi_io_completion+0x170/0x3e8
[c00000000ffe7d40] [c0000000003ae0e4] .scsi_finish_command+0xb4/0xd4
[c00000000ffe7dd0] [c0000000003b584c] .scsi_softirq_done+0x114/0x138
[c00000000ffe7e60] [c00000000024af70] .blk_done_softirq+0xa0/0xd0
[c00000000ffe7ef0] [c00000000007a2a0] .__do_softirq+0xa8/0x164
[c00000000ffe7f90] [c000000000027edc] .call_do_softirq+0x14/0x24
[c00000003e183950] [c00000000000bdcc] .do_softirq+0x74/0xc0
[c00000003e1839e0] [c00000000007a450] .irq_exit+0x5c/0xac
[c00000003e183a60] [c00000000000c414] .do_IRQ+0x17c/0x1f4
[c00000003e183b00] [c000000000004c24] hardware_interrupt_entry+0x24/0x28
--- Exception: 501 at .ppc64_runlatch_off+0x28/0x60
    LR = .pseries_dedicated_idle_sleep+0xd8/0x1a4
[c00000003e183df0] [c000000000048494]
.pseries_dedicated_idle_sleep+0x78/0x1a4 (unreliable)
[c00000003e183e80] [c00000000001110c] .cpu_idle+0x10c/0x1e8
[c00000003e183f00] [c00000000002b5b0] .start_secondary+0x1b4/0x1d8
[c00000003e183f90] [c0000000000083c4] .start_secondary_prolog+0xc/0x10

ipr: 0:0:3:0: 8150: PCI bus error
ipr: IOASA Dump:
ipr: 00000000: 04418000 009000D0 0006FFD0 00000000
ipr: 00000010: 00000000 00000000 00000000 00000000
ipr: 00000020: 01060000 D0001814 01062A00 000F531E
ipr: 00000030: 00040000 00000000 303800B6 00000000
ipr: 00000040: 00000000 04060000 00CCDDDD AABBCCCC
ipr: 00000050: 0006FFD0 6800FFD0 7FFF0030 B9000010
ipr: 00000060: 40000000 80000800 08200000 000013FE
ipr: 00000070: 00000000 00000000 8C00000E 00000000
ipr: 00000080: 00000000 00000000 00000000 00000000

Signature · 4 lines
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL
#1 lore raw
Quoted 34 lines · On Mon, 24 Dec 2007 10:18:50 +0530 Balbir Singh <[email protected]>…

Hi,

I've just seen this on my dmesg, this is new, never seen this before on this box and it happens only with this version of the kernel.

In this configuration, the page size is set to 64K and I've enabled fake NUMA nodes on PowerPC.

tce_buildmulti_pSeriesLP: plpar_tce_put failed. rc=-4

        index   = 0x4000002
        npages  = 0x0
        tce[0] val = 0x15ad0001
Call Trace:
[c00000000ffe74f0] [c0000000000491a4]
.tce_buildmulti_pSeriesLP+0x26c/0x2ac (unreliable)
[c00000000ffe75c0] [c0000000000295e4] .iommu_map_sg+0x1d4/0x418
[c00000000ffe76d0] [c000000000028664] .dma_iommu_map_sg+0x3c/0x50
[c00000000ffe7750] [c0000000003b6c30] .scsi_dma_map+0x70/0x94
[c00000000ffe77d0] [c0000000003dedbc] .ipr_queuecommand+0x300/0x500
[c00000000ffe7880] [c0000000003ae964] .scsi_dispatch_cmd+0x21c/0x2b8
[c00000000ffe7920] [c0000000003b67a0] .scsi_request_fn+0x310/0x460
[c00000000ffe79d0] [c00000000024ab90] .blk_run_queue+0x94/0xec
[c00000000ffe7a70] [c0000000003b3b08] .scsi_run_queue+0x24c/0x27c
[c00000000ffe7b20] [c0000000003b4424] .scsi_next_command+0x48/0x70
[c00000000ffe7bc0] [c0000000003b4b48] .scsi_end_request+0xbc/0xe4
[c00000000ffe7c60] [c0000000003b5294] .scsi_io_completion+0x170/0x3e8
[c00000000ffe7d40] [c0000000003ae0e4] .scsi_finish_command+0xb4/0xd4
[c00000000ffe7dd0] [c0000000003b584c] .scsi_softirq_done+0x114/0x138
[c00000000ffe7e60] [c00000000024af70] .blk_done_softirq+0xa0/0xd0
[c00000000ffe7ef0] [c00000000007a2a0] .__do_softirq+0xa8/0x164
[c00000000ffe7f90] [c000000000027edc] .call_do_softirq+0x14/0x24
[c00000003e183950] [c00000000000bdcc] .do_softirq+0x74/0xc0
[c00000003e1839e0] [c00000000007a450] .irq_exit+0x5c/0xac
[c00000003e183a60] [c00000000000c414] .do_IRQ+0x17c/0x1f4
Quoted 8 lines
[c00000003e183b00] [c000000000004c24] hardware_interrupt_entry+0x24/0x28
--- Exception: 501 at .ppc64_runlatch_off+0x28/0x60
    LR = .pseries_dedicated_idle_sleep+0xd8/0x1a4
[c00000003e183df0] [c000000000048494]
.pseries_dedicated_idle_sleep+0x78/0x1a4 (unreliable)
[c00000003e183e80] [c00000000001110c] .cpu_idle+0x10c/0x1e8
[c00000003e183f00] [c00000000002b5b0] .start_secondary+0x1b4/0x1d8
[c00000003e183f90] [c0000000000083c4] .start_secondary_prolog+0xc/0x10

I might break the IOMMU code. Can you reproduce it easily? If so, reverting my IOMMU patches (I've attached a patch to revert them) fix the problem?

Thanks,

arch/powerpc/Kconfig +0 -3
index ff2a62d..59899b2 100644
@@ -244,9 +244,6 @@ config IOMMU_VMERGE
 
 	  Most drivers don't have this problem; it is safe to say Y here.
 
-config IOMMU_HELPER
-	def_bool PPC64
-
 config HOTPLUG_CPU
 	bool "Support for enabling/disabling CPUs"
 	depends on SMP && HOTPLUG && EXPERIMENTAL && (PPC_PSERIES || PPC_PMAC)
arch/powerpc/kernel/dma_64.c +3 -3
index 6fcb7cb..1806d96 100644
@@ -31,8 +31,8 @@ static inline unsigned long device_to_mask(struct device *dev)
 static void *dma_iommu_alloc_coherent(struct device *dev, size_t size,
 				      dma_addr_t *dma_handle, gfp_t flag)
 {
-	return iommu_alloc_coherent(dev, dev->archdata.dma_data, size,
-				    dma_handle, device_to_mask(dev), flag,
+	return iommu_alloc_coherent(dev->archdata.dma_data, size, dma_handle,
+				    device_to_mask(dev), flag,
 				    dev->archdata.numa_node);
 }
 
@@ -52,7 +52,7 @@ static dma_addr_t dma_iommu_map_single(struct device *dev, void *vaddr,
 				       size_t size,
 				       enum dma_data_direction direction)
 {
-	return iommu_map_single(dev, dev->archdata.dma_data, vaddr, size,
+	return iommu_map_single(dev->archdata.dma_data, vaddr, size,
 			        device_to_mask(dev), direction);
 }
 
arch/powerpc/kernel/iommu.c +53 -33

192 lines not on this page · raw message

arch/powerpc/platforms/iseries/iommu.c +2 -2
index 11fa3c7..6a0c6f6 100644
@@ -199,7 +199,7 @@ static struct iommu_table vio_iommu_table;
 
 void *iseries_hv_alloc(size_t size, dma_addr_t *dma_handle, gfp_t flag)
 {
-	return iommu_alloc_coherent(NULL, &vio_iommu_table, size, dma_handle,
+	return iommu_alloc_coherent(&vio_iommu_table, size, dma_handle,
 				DMA_32BIT_MASK, flag, -1);
 }
 EXPORT_SYMBOL_GPL(iseries_hv_alloc);
@@ -213,7 +213,7 @@ EXPORT_SYMBOL_GPL(iseries_hv_free);
 dma_addr_t iseries_hv_map(void *vaddr, size_t size,
 			enum dma_data_direction direction)
 {
-	return iommu_map_single(NULL, &vio_iommu_table, vaddr, size,
+	return iommu_map_single(&vio_iommu_table, vaddr, size,
 				DMA_32BIT_MASK, direction);
 }
 
include/asm-powerpc/iommu.h +5 -5
index 852e15f..a07a67c 100644
@@ -85,13 +85,13 @@ extern int iommu_map_sg(struct device *dev, struct scatterlist *sglist,
 extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist,
 			   int nelems, enum dma_data_direction direction);
 
-extern void *iommu_alloc_coherent(struct device *dev, struct iommu_table *tbl,
-				  size_t size, dma_addr_t *dma_handle,
-				  unsigned long mask, gfp_t flag, int node);
+extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
+				  dma_addr_t *dma_handle, unsigned long mask,
+				  gfp_t flag, int node);
 extern void iommu_free_coherent(struct iommu_table *tbl, size_t size,
 				void *vaddr, dma_addr_t dma_handle);
-extern dma_addr_t iommu_map_single(struct device *dev, struct iommu_table *tbl,
-				   void *vaddr, size_t size, unsigned long mask,
+extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
+				   size_t size, unsigned long mask,
 				   enum dma_data_direction direction);
 extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle,
 			       size_t size, enum dma_data_direction direction);
author Tested-by
#2 lore raw
Quoted 3 lines · FUJITA Tomonori

On Mon, 24 Dec 2007 10:18:50 +0530
Balbir Singh <[email protected]> wrote:

[snip]

Quoted 4 lines

I might break the IOMMU code. Can you reproduce it easily? If so, reverting my IOMMU patches (I've attached a patch to revert them) fix the problem?

[snip]

Yes, this patch fixes the problem for me.

Signature · 4 lines
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL
#3 lore raw
Quoted 7 lines · On Thu, 27 Dec 2007 10:08:25 +0530 Balbir Singh <[email protected]>…
Quoted 3 lines · FUJITA Tomonori

On Mon, 24 Dec 2007 10:18:50 +0530
Balbir Singh <[email protected]> wrote:

[snip]

Quoted 1 line
Quoted 8 lines
Quoted 3 lines

I might break the IOMMU code. Can you reproduce it easily? If so, reverting my IOMMU patches (I've attached a patch to revert them) fix the problem?

[snip]

Yes, this patch fixes the problem for me.

Thanks, so you can reproduce it easily, right?

The problem is that I don't want to revert these changes. I'll see how these changes cause the problem shortly.

#4 lore raw
Quoted 12 lines · FUJITA Tomonori
Quoted 9 lines · On Thu, 27 Dec 2007 10:08:25 +0530 Balbir Singh <[email protected]>…
Quoted 3 lines · FUJITA Tomonori

On Mon, 24 Dec 2007 10:18:50 +0530
Balbir Singh <[email protected]> wrote:

[snip]

Quoted 3 lines

I might break the IOMMU code. Can you reproduce it easily? If so, reverting my IOMMU patches (I've attached a patch to revert them) fix the problem?

Quoted 7 lines
Quoted 4 lines

[snip]

Yes, this patch fixes the problem for me.

Thanks, so you can reproduce it easily, right?

Yes, quite easily

Quoted 2 lines

The problem is that I don't want to revert these changes. I'll see how these changes cause the problem shortly.

I'll try and find some bandwidth to review/test the patches and help you figure out the right solution.

Signature · 4 lines
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL
#5 lore raw
Quoted 21 lines · On Thu, 27 Dec 2007 11:15:37 +0530 Balbir Singh <[email protected]>…
Quoted 12 lines · FUJITA Tomonori
Quoted 9 lines · On Thu, 27 Dec 2007 10:08:25 +0530 Balbir Singh <[email protected]>…
Quoted 3 lines · FUJITA Tomonori

On Mon, 24 Dec 2007 10:18:50 +0530
Balbir Singh <[email protected]> wrote:

[snip]

Quoted 3 lines

I might break the IOMMU code. Can you reproduce it easily? If so, reverting my IOMMU patches (I've attached a patch to revert them) fix the problem?

Quoted 7 lines
Quoted 4 lines

[snip]

Yes, this patch fixes the problem for me.

Thanks, so you can reproduce it easily, right?

Quoted 7 lines

Yes, quite easily

Quoted 2 lines

The problem is that I don't want to revert these changes. I'll see how these changes cause the problem shortly.

I'll try and find some bandwidth to review/test the patches and help you figure out the right solution.

Thanks,

Can you try this?

lib/iommu-helper.c +9 -5
index e7d8544..495575a 100644
@@ -8,15 +8,20 @@
 static unsigned long find_next_zero_area(unsigned long *map,
 					 unsigned long size,
 					 unsigned long start,
-					 unsigned int nr)
+					 unsigned int nr,
+					 unsigned long align_mask)
 {
 	unsigned long index, end, i;
 again:
 	index = find_next_zero_bit(map, size, start);
+
+	/* Align allocation */
+	index = (index + align_mask) & ~align_mask;
+
 	end = index + nr;
-	if (end > size)
+	if (end >= size)
 		return -1;
-	for (i = index + 1; i < end; i++) {
+	for (i = index; i < end; i++) {
 		if (test_bit(i, map)) {
 			start = i+1;
 			goto again;
@@ -50,9 +55,8 @@ unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
 {
 	unsigned long index;
 again:
-	index = find_next_zero_area(map, size, start, nr);
+	index = find_next_zero_area(map, size, start, nr, align_mask);
 	if (index != -1) {
-		index = (index + align_mask) & ~align_mask;
 		if (is_span_boundary(index, nr, shift, boundary_size)) {
 			/* we could do more effectively */
 			start = index + 1;
#6 lore raw

FUJITA Tomonori wrote:
[snip]

Quoted 34 lines

Thanks,

Can you try this?

lib/iommu-helper.c +8 -3
index e7d8544..495575a 100644
@@ -8,15 +8,20 @@
 static unsigned long find_next_zero_area(unsigned long *map,
 					 unsigned long size,
 					 unsigned long start,
-					 unsigned int nr)
+					 unsigned int nr,
+					 unsigned long align_mask)
 {
 	unsigned long index, end, i;
 again:
 	index = find_next_zero_bit(map, size, start);
+
+	/* Align allocation */
+	index = (index + align_mask) & ~align_mask;
+
 	end = index + nr;
-	if (end > size)
+	if (end >= size)
 		return -1;
-	for (i = index + 1; i < end; i++) {
+	for (i = index; i < end; i++) {
 		if (test_bit(i, map)) {
 			start = i+1;
 			goto again;

lib/iommu-helper.c unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, · line 62

Quoted 10 lines
lib/iommu-helper.c +1 -2
@@ -50,9 +55,8 @@ unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
 {
 	unsigned long index;
 again:
-	index = find_next_zero_area(map, size, start, nr);
+	index = find_next_zero_area(map, size, start, nr, align_mask);
 	if (index != -1) {
-		index = (index + align_mask) & ~align_mask;
 		if (is_span_boundary(index, nr, shift, boundary_size)) {
 			/* we could do more effectively */
 			start = index + 1;

This on top of -mm? Or on top of the reverted iommu patch.

Signature · 4 lines
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL
#7 lore raw
Quoted 40 lines · On Fri, 28 Dec 2007 13:05:39 +0530 Balbir Singh <[email protected]>…

FUJITA Tomonori wrote:
[snip]

Quoted 38 lines

Thanks,

Can you try this?

lib/iommu-helper.c +8 -4
index e7d8544..495575a 100644
@@ -8,15 +8,20 @@
 static unsigned long find_next_zero_area(unsigned long *map,
 					 unsigned long size,
 					 unsigned long start,
-					 unsigned int nr)
+					 unsigned int nr,
+					 unsigned long align_mask)
 {
 	unsigned long index, end, i;
 again:
 	index = find_next_zero_bit(map, size, start);
+
+	/* Align allocation */
+	index = (index + align_mask) & ~align_mask;
+
 	end = index + nr;
-	if (end > size)
+	if (end >= size)
 		return -1;
-	for (i = index + 1; i < end; i++) {
+	for (i = index; i < end; i++) {
 		if (test_bit(i, map)) {
 			start = i+1;
 			goto again;
@@ -50,9 +55,8 @@ unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
 {
 	unsigned long index;
 again:
-	index = find_next_zero_area(map, size, start, nr);
Quoted 8 lines

lib/iommu-helper.c unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, · line 62

Quoted 6 lines
lib/iommu-helper.c +1 -1
+	index = find_next_zero_area(map, size, start, nr, align_mask);
 	if (index != -1) {
-		index = (index + align_mask) & ~align_mask;
 		if (is_span_boundary(index, nr, shift, boundary_size)) {
 			/* we could do more effectively */
 			start = index + 1;

This on top of -mm? Or on top of the reverted iommu patch.

Oops, it's for -mm.

Thanks,

author Tested-by
#8 lore raw
Quoted 3 lines · FUJITA Tomonori

Oops, it's for -mm.

Hi,

I just tested this patch and it works fine for me so far.

Signature · 4 lines
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL