From: Joshua Hoblitt <josh@hoblitt.com>
To: Daniel Drake <dsd@gentoo.org>
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, nick.cheng@areca.com.tw
Subject: Re: arcmsr + archttp64 calls dma_free_coherent() with irqs disabled - dmesg filled with warnings
Date: Tue, 19 Feb 2008 10:38:54 -1000 [thread overview]
Message-ID: <20080219203854.GA22562@hoblitt.com> (raw)
In-Reply-To: <47B773C5.2000905@gentoo.org>
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 +0000, 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 <dsd@gentoo.org>
> Date: Sat, 16 Feb 2008 23:25:02 +0000
> 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
>
next prev parent reply other threads:[~2008-02-19 20:38 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 [this message]
2008-02-13 12:55 ` Daniel Drake
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=20080219203854.GA22562@hoblitt.com \
--to=josh@hoblitt.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=dsd@gentoo.org \
--cc=erich@areca.com.tw \
--cc=j_gentoo@hoblitt.com \
--cc=kimhh@control.aau.dk \
--cc=linux-scsi@vger.kernel.org \
--cc=nick.cheng@areca.com.tw \
/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.