All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Drake <dsd@gentoo.org>
To: Joshua Hoblitt <josh@hoblitt.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
	Kim H?jgaard-Hansen <kimhh@control.aau.dk>,
	erich@areca.com.tw, linux-scsi@vger.kernel.org,
	j_gentoo@hoblitt.com
Subject: Re: arcmsr + archttp64 calls dma_free_coherent() with irqs  disabled - dmesg filled with warnings
Date: Wed, 13 Feb 2008 12:55:03 +0000	[thread overview]
Message-ID: <47B2E8A7.2030200@gentoo.org> (raw)
In-Reply-To: <20080212222109.GC7640@hoblitt.com>

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

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?

Please just try this patch instead, it's what I am planning to submit to 
-stable and add to Gentoo if you report success.

Daniel


[-- Attachment #2: arcmsr-pci-alloc-consistent.patch --]
[-- Type: text/plain, Size: 2108 bytes --]

From: Nick Cheng <nick.cheng@areca.com.tw>

Partial backport of 76d78300 ("arcmsr: updates (1.20.00.15)") by
Daniel Drake <dsd@gentoo.org>. Removes pci_alloc_consistent usage, which
should not be used when IRQs are disabled for portability reasons. Fixes a
spew of dma_alloc_coherent irqs_disabled() warnings.

diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index f4a202e..4f9ff32 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -1380,12 +1388,13 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, \
 
 	case ARCMSR_MESSAGE_READ_RQBUFFER: {
 		unsigned long *ver_addr;
-		dma_addr_t buf_handle;
 		uint8_t *pQbuffer, *ptmpQbuffer;
 		int32_t allxfer_len = 0;
+		void *tmp;
 
-		ver_addr = pci_alloc_consistent(acb->pdev, 1032, &buf_handle);
-		if (!ver_addr) {
+		tmp = kmalloc(1032, GFP_KERNEL|GFP_DMA);
+		ver_addr = (unsigned long *)tmp;
+		if (!tmp) {
 			retvalue = ARCMSR_MESSAGE_FAIL;
 			goto message_out;
 		}
@@ -1421,18 +1430,19 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, \
 		memcpy(pcmdmessagefld->messagedatabuffer, (uint8_t *)ver_addr, allxfer_len);
 		pcmdmessagefld->cmdmessage.Length = allxfer_len;
 		pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_OK;
-		pci_free_consistent(acb->pdev, 1032, ver_addr, buf_handle);
+		kfree(tmp);
 		}
 		break;
 
 	case ARCMSR_MESSAGE_WRITE_WQBUFFER: {
 		unsigned long *ver_addr;
-		dma_addr_t buf_handle;
 		int32_t my_empty_len, user_len, wqbuf_firstindex, wqbuf_lastindex;
 		uint8_t *pQbuffer, *ptmpuserbuffer;
+		void *tmp;
 
-		ver_addr = pci_alloc_consistent(acb->pdev, 1032, &buf_handle);
-		if (!ver_addr) {
+		tmp = kmalloc(1032, GFP_KERNEL|GFP_DMA);
+		ver_addr = (unsigned long *)tmp;
+		if (!tmp) {
 			retvalue = ARCMSR_MESSAGE_FAIL;
 			goto message_out;
 		}
@@ -1482,7 +1492,7 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, \
 				retvalue = ARCMSR_MESSAGE_FAIL;
 			}
 			}
-			pci_free_consistent(acb->pdev, 1032, ver_addr, buf_handle);
+			kfree(tmp);
 		}
 		break;
 

      parent reply	other threads:[~2008-02-13 12:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-09 15:31 arcmsr + archttp64 calls dma_free_coherent() with irqs disabled - dmesg filled with warnings Kim Højgaard-Hansen
2008-02-09 18:01 ` James Bottomley
2008-02-09 19:35   ` Joshua Hoblitt
2008-02-09 19:43     ` James Bottomley
2008-02-12 20:53       ` Joshua Hoblitt
2008-02-12 22:21         ` Joshua Hoblitt
2008-02-12 22:30           ` James Bottomley
2008-02-13  2:08             ` arcmsr + archttp64 calls dma_free_coherent() with irqsdisabled " nickcheng
2008-02-15 20:56             ` arcmsr + archttp64 calls dma_free_coherent() with irqs disabled " Joshua Hoblitt
2008-02-15 21:57               ` James Bottomley
2008-02-15 22:04                 ` James Bottomley
2008-02-16 11:49                   ` Daniel Drake
2008-02-16 14:52                     ` James Bottomley
2008-02-16 23:36                       ` Daniel Drake
2008-02-16 23:37                         ` Daniel Drake
2008-02-17  1:15                           ` Joshua Hoblitt
2008-02-19 20:38                           ` Joshua Hoblitt
2008-02-13 12:55           ` Daniel Drake [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47B2E8A7.2030200@gentoo.org \
    --to=dsd@gentoo.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=erich@areca.com.tw \
    --cc=j_gentoo@hoblitt.com \
    --cc=josh@hoblitt.com \
    --cc=kimhh@control.aau.dk \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.