[SCSI] megaraid_old: fix READ_CAPACITY
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Wed, 3 Oct 2007 00:00:58 +0000 (09:00 +0900)
committerJames Bottomley <jejb@mulgrave.localdomain>
Thu, 4 Oct 2007 16:08:49 +0000 (12:08 -0400)
The bulk transfer mode got eleminated by
3f6270ef76f2ce5c134615a470685d6c2a66c07e.  Unfortunately, this mode is
required for READ_CAPACITY commands on certain cards, so put it back
again.  This fixes a boot failure regression reported by Burton
Windle.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/megaraid.c

index 3907f6718ede11272e797bc7b6f7d7a1bfc34210..da56163c30a8f6404b02c16743595561a7b2a692 100644 (file)
@@ -1753,6 +1753,14 @@ mega_build_sglist(adapter_t *adapter, scb_t *scb, u32 *buf, u32 *len)
 
        *len = 0;
 
+       if (scsi_sg_count(cmd) == 1 && !adapter->has_64bit_addr) {
+               sg = scsi_sglist(cmd);
+               scb->dma_h_bulkdata = sg_dma_address(sg);
+               *buf = (u32)scb->dma_h_bulkdata;
+               *len = sg_dma_len(sg);
+               return 0;
+       }
+
        scsi_for_each_sg(cmd, sg, sgcnt, idx) {
                if (adapter->has_64bit_addr) {
                        scb->sgl64[idx].address = sg_dma_address(sg);