Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360264
b: refs/heads/master
c: e2bea6d
h: refs/heads/master
v: v3
  • Loading branch information
Stephen M. Cameron authored and James Bottomley committed Feb 24, 2013
1 parent 56cdb52 commit c78e4f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a2dac136c40fe07861f8146434917031a8c301b1
refs/heads/master: e2bea6df3261dac1ae400452ddab07babb4fc5f3
14 changes: 12 additions & 2 deletions trunk/drivers/scsi/hpsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ static int hpsa_allocate_sg_chain_blocks(struct ctlr_info *h)
return -ENOMEM;
}

static void hpsa_map_sg_chain_block(struct ctlr_info *h,
static int hpsa_map_sg_chain_block(struct ctlr_info *h,
struct CommandList *c)
{
struct SGDescriptor *chain_sg, *chain_block;
Expand All @@ -1144,8 +1144,15 @@ static void hpsa_map_sg_chain_block(struct ctlr_info *h,
(c->Header.SGTotal - h->max_cmd_sg_entries);
temp64 = pci_map_single(h->pdev, chain_block, chain_sg->Len,
PCI_DMA_TODEVICE);
if (dma_mapping_error(&h->pdev->dev, temp64)) {
/* prevent subsequent unmapping */
chain_sg->Addr.lower = 0;
chain_sg->Addr.upper = 0;
return -1;
}
chain_sg->Addr.lower = (u32) (temp64 & 0x0FFFFFFFFULL);
chain_sg->Addr.upper = (u32) ((temp64 >> 32) & 0x0FFFFFFFFULL);
return 0;
}

static void hpsa_unmap_sg_chain_block(struct ctlr_info *h,
Expand Down Expand Up @@ -2123,7 +2130,10 @@ static int hpsa_scatter_gather(struct ctlr_info *h,
if (chained) {
cp->Header.SGList = h->max_cmd_sg_entries;
cp->Header.SGTotal = (u16) (use_sg + 1);
hpsa_map_sg_chain_block(h, cp);
if (hpsa_map_sg_chain_block(h, cp)) {
scsi_dma_unmap(cmd);
return -1;
}
return 0;
}

Expand Down

0 comments on commit c78e4f8

Please sign in to comment.