public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Eddie <stunnel@attglobal.net>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: matthew@wil.cx, James.Bottomley@suse.de,
	linux-scsi@vger.kernel.org, bo.yang@lsi.com
Subject: Re: LSI MegaRAID not recognised correctly in 64-bit.  2.6.29.6
Date: Sat, 19 Sep 2009 00:03:48 -0700	[thread overview]
Message-ID: <4AB48254.4000404@attglobal.net> (raw)
In-Reply-To: <20090918231745O.fujita.tomonori@lab.ntt.co.jp>

FUJITA Tomonori wrote:
> On Fri, 18 Sep 2009 08:11:07 -0600
> Matthew Wilcox <matthew@wil.cx> wrote:
>
>   
>> On Fri, Sep 18, 2009 at 10:00:53PM +0900, FUJITA Tomonori wrote:
>>     
>>> Let's confirm that dma_map_sg returns an invalid address.
>>>
>>> Eddie, can you try a kernel with the following patch and send kernel
>>> messages?
>>>
>>> Note that the patch doesn't fix the problem; just print debug
>>> information.
>>>       
>> This is going to be quite noisy,
>>     
>
> Seems that READ_CAPACITY always fails in his environment so it's not
> so noisy. :)
>
>
>   
>> and not give us all that much information.
>> Why not try this patch instead?
>>
>> diff --git a/drivers/scsi/scsi_lib_dma.c b/drivers/scsi/scsi_lib_dma.c
>> index ac6855c..a179ff8 100644
>> --- a/drivers/scsi/scsi_lib_dma.c
>> +++ b/drivers/scsi/scsi_lib_dma.c
>> @@ -20,7 +20,8 @@
>>   */
>>  int scsi_dma_map(struct scsi_cmnd *cmd)
>>  {
>> -	int nseg = 0;
>> +	int i, nseg = 0;
>> +	struct scatterlist *sgl;
>>  
>>  	if (scsi_sg_count(cmd)) {
>>  		struct device *dev = cmd->device->host->shost_gendev.parent;
>> @@ -29,6 +30,11 @@ int scsi_dma_map(struct scsi_cmnd *cmd)
>>  				  cmd->sc_data_direction);
>>  		if (unlikely(!nseg))
>>  			return -ENOMEM;
>> +		scsi_for_each_sg(cmd, sgl, nseg, i) {
>> +			if (sg_dma_address(sgl) > *dev->dma_mask) {
>>     
>
> I think that it should be
>
> if (sg_dma_address(sgl) + sg_dma_len(sgl) > *dev->dma_mask)
>
>   
>> +				printk("IOMMU bug, command %d, dma mask %llx, but returned %lx %u for phys %lx\n", cmd->cmnd[0], *dev->dma_mask, (unsigned long)sg_dma_address(sgl), sg_dma_len(sgl), (unsigned long)sg_phys(sgl));
>> +			}
>> +		}
>>  	}
>>  	return nseg;
>>  }
>>
>>
>>     
>>> diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
>>> index 234f0b7..0d0a02f 100644
>>> --- a/drivers/scsi/megaraid/megaraid_mbox.c
>>> +++ b/drivers/scsi/megaraid/megaraid_mbox.c
>>> @@ -1391,7 +1391,12 @@ megaraid_mbox_mksgl(adapter_t *adapter, scb_t *scb)
>>>  
>>>  	scb->dma_type = MRAID_DMA_WSG;
>>>  
>>> +	printk("%x %lx\n", scp->cmnd[0],
>>> +	       (unsigned long)*(scp->device->host->shost_gendev.parent->dma_mask));
>>> +
>>>  	scsi_for_each_sg(scp, sgl, sgcnt, i) {
>>> +		printk("%lx %u\n", (unsigned long)sg_dma_address(sgl),
>>> +		       sg_dma_len(sgl));
>>>  		ccb->sgl64[i].address	= sg_dma_address(sgl);
>>>  		ccb->sgl64[i].length	= sg_dma_len(sgl);
>>>  	}
>>>
>>>       
OK, there are 2 dmesg outputs stored at ftp://ftp.BogoLinux.net/pub

dmesg.2a contains Fujita's patch and Matthew's

dmesg.2b contains Fujita's patch and his update to Matthew's.

Cheers,
Eddie


  reply	other threads:[~2009-09-19  7:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-16 16:18 LSI MegaRAID not recognised correctly in 64-bit. 2.6.29.6 Eddie
2009-09-16 16:31 ` James Bottomley
2009-09-16 16:54   ` Eddie
2009-09-17  2:58     ` Eddie
2009-09-17  2:59     ` Eddie
2009-09-17 15:59       ` James Bottomley
2009-09-17 16:09         ` Eddie
2009-09-17 18:39           ` James Bottomley
2009-09-17 20:28             ` James Bottomley
2009-09-18 13:00               ` FUJITA Tomonori
2009-09-18 14:11                 ` Matthew Wilcox
2009-09-18 14:18                   ` FUJITA Tomonori
2009-09-19  7:03                     ` Eddie [this message]
2009-09-19  7:55                       ` FUJITA Tomonori
2009-09-19 15:24                         ` Eddie
2009-09-21 13:51                           ` FUJITA Tomonori
2009-09-21 15:34                             ` James Bottomley
2009-09-21 15:37                               ` Yang, Bo

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=4AB48254.4000404@attglobal.net \
    --to=stunnel@attglobal.net \
    --cc=James.Bottomley@suse.de \
    --cc=bo.yang@lsi.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=linux-scsi@vger.kernel.org \
    --cc=matthew@wil.cx \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox