Re: arcmsr + archttp64 calls dma_free_coherent() with irqs disabled - dmesg filled with warnings

2008-02-19 Thread Joshua Hoblitt
I have a test machine running:

0001-arcmsr-fix-message-allocation.patch
arcmsr-pci-alloc-consistent.patch
2.6.24-gentoo-r2

The arcmsr driver is loaded and archttp64 is running.  I've been access
archttp64 and there are no warnings in dmesg.  Without the patches this
would have generated 10s of MB of warning messages.  I haven't really
exercised the areca volumes yet but this looks to be both a fix for the
warnings and James' coding issues.  I'd vote for re-diffing and kicking
the patch upstream at this point.

-J

--
On Sat, Feb 16, 2008 at 11:37:41PM +, Daniel Drake wrote:
 Daniel Drake wrote:
 Here is a patch to address your comments.
 Joshua, would you mind testing this before I submit it properly? It will 
 apply cleanly to 2.6.24 on top of the previous patch you tested. I have 
 compile-tested it.

 It would help to include the patch.

 From 0a9cd6133fe4f0c3a8906d6be1b9d1ef083345dc Mon Sep 17 00:00:00 2001
 From: Daniel Drake [EMAIL PROTECTED]
 Date: Sat, 16 Feb 2008 23:25:02 +
 Subject: [PATCH] arcmsr: fix message allocation
 
 ---
  drivers/scsi/arcmsr/arcmsr_hba.c |   26 +++---
  1 files changed, 11 insertions(+), 15 deletions(-)
 
 diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c 
 b/drivers/scsi/arcmsr/arcmsr_hba.c
 index 4f9ff32..f91f79c 100644
 --- a/drivers/scsi/arcmsr/arcmsr_hba.c
 +++ b/drivers/scsi/arcmsr/arcmsr_hba.c
 @@ -1387,18 +1387,16 @@ static int arcmsr_iop_message_xfer(struct 
 AdapterControlBlock *acb, \
   switch(controlcode) {
  
   case ARCMSR_MESSAGE_READ_RQBUFFER: {
 - unsigned long *ver_addr;
 + unsigned char *ver_addr;
   uint8_t *pQbuffer, *ptmpQbuffer;
   int32_t allxfer_len = 0;
 - void *tmp;
  
 - tmp = kmalloc(1032, GFP_KERNEL|GFP_DMA);
 - ver_addr = (unsigned long *)tmp;
 - if (!tmp) {
 + ver_addr = kmalloc(1032, GFP_ATOMIC);
 + if (!ver_addr) {
   retvalue = ARCMSR_MESSAGE_FAIL;
   goto message_out;
   }
 - ptmpQbuffer = (uint8_t *) ver_addr;
 + ptmpQbuffer = ver_addr;
   while ((acb-rqbuf_firstindex != acb-rqbuf_lastindex)
(allxfer_len  1031)) {
   pQbuffer = acb-rqbuffer[acb-rqbuf_firstindex];
 @@ -1427,26 +1425,24 @@ static int arcmsr_iop_message_xfer(struct 
 AdapterControlBlock *acb, \
   }
   arcmsr_iop_message_read(acb);
   }
 - memcpy(pcmdmessagefld-messagedatabuffer, (uint8_t *)ver_addr, 
 allxfer_len);
 + memcpy(pcmdmessagefld-messagedatabuffer, ver_addr, 
 allxfer_len);
   pcmdmessagefld-cmdmessage.Length = allxfer_len;
   pcmdmessagefld-cmdmessage.ReturnCode = 
 ARCMSR_MESSAGE_RETURNCODE_OK;
 - kfree(tmp);
 + kfree(ver_addr);
   }
   break;
  
   case ARCMSR_MESSAGE_WRITE_WQBUFFER: {
 - unsigned long *ver_addr;
 + unsigned char *ver_addr;
   int32_t my_empty_len, user_len, wqbuf_firstindex, 
 wqbuf_lastindex;
   uint8_t *pQbuffer, *ptmpuserbuffer;
 - void *tmp;
  
 - tmp = kmalloc(1032, GFP_KERNEL|GFP_DMA);
 - ver_addr = (unsigned long *)tmp;
 - if (!tmp) {
 + ver_addr = kmalloc(1032, GFP_ATOMIC);
 + if (!ver_addr) {
   retvalue = ARCMSR_MESSAGE_FAIL;
   goto message_out;
   }
 - ptmpuserbuffer = (uint8_t *)ver_addr;
 + ptmpuserbuffer = ver_addr;
   user_len = pcmdmessagefld-cmdmessage.Length;
   memcpy(ptmpuserbuffer, pcmdmessagefld-messagedatabuffer, 
 user_len);
   wqbuf_lastindex = acb-wqbuf_lastindex;
 @@ -1492,7 +1488,7 @@ static int arcmsr_iop_message_xfer(struct 
 AdapterControlBlock *acb, \
   retvalue = ARCMSR_MESSAGE_FAIL;
   }
   }
 - kfree(tmp);
 + kfree(ver_addr);
   }
   break;
  
 -- 
 1.5.4
 

-
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: arcmsr + archttp64 calls dma_free_coherent() with irqs disabled - dmesg filled with warnings

2008-02-16 Thread Joshua Hoblitt
Thanks James.  I'll give a try tonight or tomorrow.

-J

--
On Sat, Feb 16, 2008 at 11:37:41PM +, Daniel Drake wrote:
 Daniel Drake wrote:
 Here is a patch to address your comments.
 Joshua, would you mind testing this before I submit it properly? It will 
 apply cleanly to 2.6.24 on top of the previous patch you tested. I have 
 compile-tested it.

 It would help to include the patch.

 From 0a9cd6133fe4f0c3a8906d6be1b9d1ef083345dc Mon Sep 17 00:00:00 2001
 From: Daniel Drake [EMAIL PROTECTED]
 Date: Sat, 16 Feb 2008 23:25:02 +
 Subject: [PATCH] arcmsr: fix message allocation
 
 ---
  drivers/scsi/arcmsr/arcmsr_hba.c |   26 +++---
  1 files changed, 11 insertions(+), 15 deletions(-)
 
 diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c 
 b/drivers/scsi/arcmsr/arcmsr_hba.c
 index 4f9ff32..f91f79c 100644
 --- a/drivers/scsi/arcmsr/arcmsr_hba.c
 +++ b/drivers/scsi/arcmsr/arcmsr_hba.c
 @@ -1387,18 +1387,16 @@ static int arcmsr_iop_message_xfer(struct 
 AdapterControlBlock *acb, \
   switch(controlcode) {
  
   case ARCMSR_MESSAGE_READ_RQBUFFER: {
 - unsigned long *ver_addr;
 + unsigned char *ver_addr;
   uint8_t *pQbuffer, *ptmpQbuffer;
   int32_t allxfer_len = 0;
 - void *tmp;
  
 - tmp = kmalloc(1032, GFP_KERNEL|GFP_DMA);
 - ver_addr = (unsigned long *)tmp;
 - if (!tmp) {
 + ver_addr = kmalloc(1032, GFP_ATOMIC);
 + if (!ver_addr) {
   retvalue = ARCMSR_MESSAGE_FAIL;
   goto message_out;
   }
 - ptmpQbuffer = (uint8_t *) ver_addr;
 + ptmpQbuffer = ver_addr;
   while ((acb-rqbuf_firstindex != acb-rqbuf_lastindex)
(allxfer_len  1031)) {
   pQbuffer = acb-rqbuffer[acb-rqbuf_firstindex];
 @@ -1427,26 +1425,24 @@ static int arcmsr_iop_message_xfer(struct 
 AdapterControlBlock *acb, \
   }
   arcmsr_iop_message_read(acb);
   }
 - memcpy(pcmdmessagefld-messagedatabuffer, (uint8_t *)ver_addr, 
 allxfer_len);
 + memcpy(pcmdmessagefld-messagedatabuffer, ver_addr, 
 allxfer_len);
   pcmdmessagefld-cmdmessage.Length = allxfer_len;
   pcmdmessagefld-cmdmessage.ReturnCode = 
 ARCMSR_MESSAGE_RETURNCODE_OK;
 - kfree(tmp);
 + kfree(ver_addr);
   }
   break;
  
   case ARCMSR_MESSAGE_WRITE_WQBUFFER: {
 - unsigned long *ver_addr;
 + unsigned char *ver_addr;
   int32_t my_empty_len, user_len, wqbuf_firstindex, 
 wqbuf_lastindex;
   uint8_t *pQbuffer, *ptmpuserbuffer;
 - void *tmp;
  
 - tmp = kmalloc(1032, GFP_KERNEL|GFP_DMA);
 - ver_addr = (unsigned long *)tmp;
 - if (!tmp) {
 + ver_addr = kmalloc(1032, GFP_ATOMIC);
 + if (!ver_addr) {
   retvalue = ARCMSR_MESSAGE_FAIL;
   goto message_out;
   }
 - ptmpuserbuffer = (uint8_t *)ver_addr;
 + ptmpuserbuffer = ver_addr;
   user_len = pcmdmessagefld-cmdmessage.Length;
   memcpy(ptmpuserbuffer, pcmdmessagefld-messagedatabuffer, 
 user_len);
   wqbuf_lastindex = acb-wqbuf_lastindex;
 @@ -1492,7 +1488,7 @@ static int arcmsr_iop_message_xfer(struct 
 AdapterControlBlock *acb, \
   retvalue = ARCMSR_MESSAGE_FAIL;
   }
   }
 - kfree(tmp);
 + kfree(ver_addr);
   }
   break;
  
 -- 
 1.5.4
 

-
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: arcmsr + archttp64 calls dma_free_coherent() with irqs disabled - dmesg filled with warnings

2008-02-15 Thread Joshua Hoblitt
Hi James,

Daniel took the time to patch up the 2.6.24 version.  I've tested it and
the warning messages are gone.  Please take a look at:

http://bugs.gentoo.org/attachment.cgi?id=143585

Thanks,

-J

--
On Tue, Feb 12, 2008 at 04:30:36PM -0600, James Bottomley wrote:
 
 On Tue, 2008-02-12 at 12:21 -1000, Joshua Hoblitt wrote:
  I've got a few compilation errors on head.  Before I try it, is it
  possible to backport the 76d78300a6eb8b7f08e47703b7e68a659ffc2053 change
  to 2.6.24.y?
 
 I don't see any reason why not but I'd have to cherry pick it to see ...
 so you could save me the bother by trying it yourself ...
 
 James
 
 
-
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: arcmsr + archttp64 calls dma_free_coherent() with irqs disabled - dmesg filled with warnings

2008-02-12 Thread Joshua Hoblitt
I've got a few compilation errors on head.  Before I try it, is it
possible to backport the 76d78300a6eb8b7f08e47703b7e68a659ffc2053 change
to 2.6.24.y?

-J

--
On Tue, Feb 12, 2008 at 10:53:45AM -1000, Joshua Hoblitt wrote:
 I tried doing a build from that commit id but I get an oops from an
 unrelated subsystem.  I'll try again from the head of the tree.
 
 -J
 
 --
 On Sat, Feb 09, 2008 at 01:43:39PM -0600, James Bottomley wrote:
  
  On Sat, 2008-02-09 at 09:35 -1000, Joshua Hoblitt wrote:
   Hi James,
   
   I can give it a try.  What commit id do you think fixed it?
  
  commit 76d78300a6eb8b7f08e47703b7e68a659ffc2053
  Author: Nick Cheng [EMAIL PROTECTED]
  Date:   Mon Feb 4 23:53:24 2008 -0800
  
  [SCSI] arcmsr: updates (1.20.00.15)
  
  James
  
  
-
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: arcmsr + archttp64 calls dma_free_coherent() with irqs disabled - dmesg filled with warnings

2008-02-09 Thread Joshua Hoblitt
Hi James,

I can give it a try.  What commit id do you think fixed it?

-J

--
On Sat, Feb 09, 2008 at 12:01:16PM -0600, James Bottomley wrote:
 
 On Sat, 2008-02-09 at 16:31 +0100, Kim H??jgaard-Hansen wrote:
  The following was reported by Joshua Hoblitt on Gentoo bugzilla when
  using the arcmsr driver (see https://bugs.gentoo.org/208493)
  
  When starting up the Areca RAID card http pass through proxy called
  archttp dmesg is completely filled with messages as:
  
  WARNING: at arch/x86/kernel/pci-dma_64.c:169 dma_free_coherent()
  Pid: 8232, comm: archttp64 Not tainted 2.6.24-gentoo #1
 
 Could you check git head, please; I think it's fixed upstream.
 
 James
 
 
-
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: difference between arcmsr (areca) 1.20.0X.13 2.6.20 in tree driver?

2007-04-10 Thread Joshua Hoblitt
The RAID card in question has reported an SPD CheckSum Error (bad
ram?) during system power on so it's looking like this is probably a
hardware or firmware problem and not a driver issue.

-J

--
On Tue, Apr 03, 2007 at 08:45:38AM -0700, Randy Dunlap wrote:
 On Mon, 2 Apr 2007 17:21:35 -1000 Joshua Hoblitt wrote:
 
 [adding linux-scsi]
 
  Has anyone else noticed this regression?
  
  -J
  
  --
  - Forwarded message from Joshua Hoblitt [EMAIL PROTECTED] -
  
  From: Joshua Hoblitt [EMAIL PROTECTED]
  Date: Thu, 29 Mar 2007 16:38:20 -1000
  To: [EMAIL PROTECTED]
  Subject: difference between 1.20.0X.13  2.6.20 in tree driver?
  
  Hello,
  
  I just attempted to upgrade a system from 2.6.17 (gentoo revision 8) w/
  1.20.0X.13 to 2.6.20 (gentoo revision 4) with the in tree arcmsr driver.
  On the 2.6.17 kernel there are 2 ~4TB partitions that are visible on
  the system as /dev/sdb1  /dev/sdc1.  When the system is booted with the
  2.6.20 kernel /dev/sdc1 is gone and /dev/sdb1 is properly reported as a
  4TB EFI partition but fsck rejects the the filesystem as corrupt.  Is
  this a regression or has there been a fundamental change in the way
  arcmsr represents the array to the block layer?
  
  Here is the info on the RAID card:
  
  Controller Name ARC-1170
  Firmware VersionV1.39 2005-12-13
  BOOT ROM VersionV1.39 2005-12-13
  Serial Number   Y605CAAVAR700117
  Unit Serial #
  Main Processor  500MHz IOP331
  CPU ICache Size 32KBytes
  CPU DCache Size 32KBytes / Write Back
  System Memory   256MB / 333MHz
  
  Any idea as to what's going on?
  
  Thanks,
  
  -J
  
  --
  Under 2.6.20:
  
  Mar 29 15:41:05 ipp000 ARECA RAID ADAPTER4: FIRMWARE VERSION V1.39 
  2005-12-13
  Mar 29 15:41:05 ipp000 scsi4 : Areca SATA Host Adapter RAID Controller( 
  RAID6 capable)
  Mar 29 15:41:05 ipp000 Driver Version 1.20.00.13
  Mar 29 15:41:05 ipp000 scsi 4:0:0:0: Direct-Access Areca
  ARC-1170-VOL#00  R001 PQ: 0 ANSI: 3
  Mar 29 15:41:05 ipp000 sdb : very big device. try to use READ CAPACITY(16).
  Mar 29 15:41:05 ipp000 SCSI device sdb: 8595693568 512-byte hdwr sectors 
  (4400995 MB) 
  Mar 29 15:41:05 ipp000 sdb: Write Protect is off
  Mar 29 15:41:05 ipp000 sdb: Mode Sense: cb 00 00 08
  Mar 29 15:41:05 ipp000 SCSI device sdb: write cache: enabled, read cache: 
  enabled, doesn't support DPO or FUA 
  Mar 29 15:41:05 ipp000 sdb : very big device. try to use READ CAPACITY(16). 
  Mar 29 15:41:05 ipp000 SCSI device sdb: 8595693568 512-byte hdwr sectors 
  (4400995 MB)
  Mar 29 15:41:05 ipp000 sdb: Write Protect is off
  Mar 29 15:41:05 ipp000 sdb: Mode Sense: cb 00 00 08
  Mar 29 15:41:05 ipp000 SCSI device sdb: write cache: enabled, read cache: 
  enabled, doesn't support DPO or FUA
  Mar 29 15:41:05 ipp000 sdb: sdb1
  Mar 29 15:41:05 ipp000 sd 4:0:0:0: Attached scsi disk sdb
  Mar 29 15:41:05 ipp000 scsi 4:0:16:0: Processor ArecaRAID 
  controller  R001 PQ: 0 ANSI: 0
  
  Under 2.6.17:
  
  Mar 29 15:45:11 ipp000 ARECA RAID ADAPTER0: 64BITS PCI BUS DMA ADDRESSING 
  SUPPORTED
  Mar 29 15:45:11 ipp000 ARECA RAID ADAPTER0: FIRMWARE VERSION V1.39 
  2005-12-13
  Mar 29 15:45:11 ipp000 scsi4 : Areca SATA Host Adapter RAID Controller( 
  RAID6 capable)
  Mar 29 15:45:11 ipp000 Driver Version 1.20.0X.13
  Mar 29 15:45:11 ipp000 Vendor: Areca Model: ARC-1170-VOL#00   Rev: R001
  Mar 29 15:45:11 ipp000 Type:   Direct-Access  ANSI SCSI 
  revision: 03
  Mar 29 15:45:11 ipp000 sdb : very big device. try to use READ CAPACITY(16).
  Mar 29 15:45:11 ipp000 SCSI device sdb: 8595693568 512-byte hdwr sectors 
  (4400995 MB)
  Mar 29 15:45:11 ipp000 sdb: Write Protect is off
  Mar 29 15:45:11 ipp000 sdb: Mode Sense: cb 00 00 08
  Mar 29 15:45:11 ipp000 SCSI device sdb: drive cache: write back
  Mar 29 15:45:11 ipp000 sdb : very big device. try to use READ CAPACITY(16).
  Mar 29 15:45:11 ipp000 SCSI device sdb: 8595693568 512-byte hdwr sectors 
  (4400995 MB)
  Mar 29 15:45:11 ipp000 sdb: Write Protect is off
  Mar 29 15:45:11 ipp000 sdb: Mode Sense: cb 00 00 08
  Mar 29 15:45:11 ipp000 SCSI device sdb: drive cache: write back
  Mar 29 15:45:11 ipp000 sdb:4Alternate GPT is invalid, using primary GPT.
  Mar 29 15:45:11 ipp000 sdb1
  Mar 29 15:45:11 ipp000 sd 4:0:0:0: Attached scsi disk sdb
  Mar 29 15:45:11 ipp000 sd 4:0:0:0: Attached scsi generic sg1 type 0
  Mar 29 15:45:11 ipp000 Vendor: Areca Model: ARC-1170-VOL#01   Rev: R001
  Mar 29 15:45:11 ipp000 Type:   Direct-Access  ANSI SCSI 
  revision: 03
  Mar 29 15:45:11 ipp000 sdc : very big device. try to use READ CAPACITY(16).
  Mar 29 15:45:11 ipp000 SCSI device sdc: 8595580928 512-byte hdwr sectors 
  (4400937 MB)
  Mar 29 15:45:11 ipp000 sdc: Write Protect is off
  Mar 29 15:45:11 ipp000 sdc: Mode Sense: cb 00 00 08
  Mar 29 15:45:11 ipp000 SCSI device sdc: drive cache: write back
  Mar 29 15:45:11 ipp000 sdc : very big device. try to use READ