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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2008-02-15 at 10:56 -1000, Joshua Hoblitt wrote:
> 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:
> 

> 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);

GFP_DMA is pretty pointless for a buffer which never actually gets anywhere near a DMA, isn't it?

> +		ver_addr = (unsigned long *)tmp;

No cast needed from void *

> +		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;

Actually, just do ver_addr = kmalloc(...) instead

> +		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;


I can't work out why this was pci_alloc_consistent in the first
place ... it's not used as consistent memory anywhere on the PCI bus


James


-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux