Re: SCSI errors on powerpc with 2.6.24-rc6-mm1

2007-12-27 Thread FUJITA Tomonori
On Thu, 27 Dec 2007 11:15:37 +0530
Balbir Singh [EMAIL PROTECTED] wrote:

 FUJITA Tomonori wrote:
  On Thu, 27 Dec 2007 10:08:25 +0530
  Balbir Singh [EMAIL PROTECTED] wrote:
  
  FUJITA Tomonori wrote:
  On Mon, 24 Dec 2007 10:18:50 +0530
  Balbir Singh [EMAIL PROTECTED] wrote:
 
  [snip]
 
  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?
  
 
 Yes, quite easily
 
  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?


diff --git a/lib/iommu-helper.c b/lib/iommu-helper.c
index e7d8544..495575a 100644
--- a/lib/iommu-helper.c
+++ b/lib/iommu-helper.c
@@ -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;
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: SCSI errors on powerpc with 2.6.24-rc6-mm1

2007-12-27 Thread FUJITA Tomonori
On Fri, 28 Dec 2007 13:05:39 +0530
Balbir Singh [EMAIL PROTECTED] wrote:

 FUJITA Tomonori wrote:
 [snip]
  Thanks,
  
  Can you try this?
  
  
  diff --git a/lib/iommu-helper.c b/lib/iommu-helper.c
  index e7d8544..495575a 100644
  --- a/lib/iommu-helper.c
  +++ b/lib/iommu-helper.c
  @@ -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;
 
 This on top of -mm? Or on top of the reverted iommu patch.

Oops, it's for -mm.

Thanks,
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: SCSI errors on powerpc with 2.6.24-rc6-mm1

2007-12-26 Thread Balbir Singh
FUJITA Tomonori wrote:
 On Mon, 24 Dec 2007 10:18:50 +0530
 Balbir Singh [EMAIL PROTECTED] wrote:
 
[snip]

 
 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.
Tested-by: Balbir Singh [EMAIL PROTECTED]

-- 
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: SCSI errors on powerpc with 2.6.24-rc6-mm1

2007-12-26 Thread FUJITA Tomonori
On Thu, 27 Dec 2007 10:08:25 +0530
Balbir Singh [EMAIL PROTECTED] wrote:

 FUJITA Tomonori wrote:
  On Mon, 24 Dec 2007 10:18:50 +0530
  Balbir Singh [EMAIL PROTECTED] wrote:
  
 [snip]
 
  
  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.
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


SCSI errors on powerpc with 2.6.24-rc6-mm1

2007-12-23 Thread Balbir Singh
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   = 0x402
npages  = 0x0
tce[0] val = 0x15ad0001
Call Trace:
[cffe74f0] [c00491a4]
.tce_buildmulti_pSeriesLP+0x26c/0x2ac (unreliable)
[cffe75c0] [c00295e4] .iommu_map_sg+0x1d4/0x418
[cffe76d0] [c0028664] .dma_iommu_map_sg+0x3c/0x50
[cffe7750] [c03b6c30] .scsi_dma_map+0x70/0x94
[cffe77d0] [c03dedbc] .ipr_queuecommand+0x300/0x500
[cffe7880] [c03ae964] .scsi_dispatch_cmd+0x21c/0x2b8
[cffe7920] [c03b67a0] .scsi_request_fn+0x310/0x460
[cffe79d0] [c024ab90] .blk_run_queue+0x94/0xec
[cffe7a70] [c03b3b08] .scsi_run_queue+0x24c/0x27c
[cffe7b20] [c03b4424] .scsi_next_command+0x48/0x70
[cffe7bc0] [c03b4b48] .scsi_end_request+0xbc/0xe4
[cffe7c60] [c03b5294] .scsi_io_completion+0x170/0x3e8
[cffe7d40] [c03ae0e4] .scsi_finish_command+0xb4/0xd4
[cffe7dd0] [c03b584c] .scsi_softirq_done+0x114/0x138
[cffe7e60] [c024af70] .blk_done_softirq+0xa0/0xd0
[cffe7ef0] [c007a2a0] .__do_softirq+0xa8/0x164
[cffe7f90] [c0027edc] .call_do_softirq+0x14/0x24
[c0003e183950] [c000bdcc] .do_softirq+0x74/0xc0
[c0003e1839e0] [c007a450] .irq_exit+0x5c/0xac
[c0003e183a60] [c000c414] .do_IRQ+0x17c/0x1f4
[c0003e183b00] [c0004c24] hardware_interrupt_entry+0x24/0x28
--- Exception: 501 at .ppc64_runlatch_off+0x28/0x60
LR = .pseries_dedicated_idle_sleep+0xd8/0x1a4
[c0003e183df0] [c0048494]
.pseries_dedicated_idle_sleep+0x78/0x1a4 (unreliable)
[c0003e183e80] [c001110c] .cpu_idle+0x10c/0x1e8
[c0003e183f00] [c002b5b0] .start_secondary+0x1b4/0x1d8
[c0003e183f90] [c00083c4] .start_secondary_prolog+0xc/0x10
ipr: 0:0:3:0: 8150: PCI bus error
ipr: IOASA Dump:
ipr: : 04418000 009000D0 0006FFD0 
ipr: 0010:    
ipr: 0020: 0106 D0001814 01062A00 000F531E
ipr: 0030: 0004  303800B6 
ipr: 0040:  0406 00CC AABB
ipr: 0050: 0006FFD0 6800FFD0 7FFF0030 B910
ipr: 0060: 4000 8800 0820 13FE
ipr: 0070:   8C0E 
ipr: 0080:    

-- 
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html