diff options
-rw-r--r-- | drivers/scsi/dc395x.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index c8a32cf47d73..cbf825263f3b 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c | |||
@@ -246,6 +246,7 @@ struct ScsiReqBlk { | |||
246 | * total_xfer_length in xferred. These values are restored in | 246 | * total_xfer_length in xferred. These values are restored in |
247 | * pci_unmap_srb_sense. This is the only place xferred is used. | 247 | * pci_unmap_srb_sense. This is the only place xferred is used. |
248 | */ | 248 | */ |
249 | unsigned char *virt_addr_req; /* Saved virtual address of the request buffer */ | ||
249 | u32 xferred; /* Saved copy of total_xfer_length */ | 250 | u32 xferred; /* Saved copy of total_xfer_length */ |
250 | 251 | ||
251 | u16 state; | 252 | u16 state; |
@@ -2017,7 +2018,7 @@ static void sg_update_list(struct ScsiReqBlk *srb, u32 left) | |||
2017 | sg_verify_length(srb); | 2018 | sg_verify_length(srb); |
2018 | 2019 | ||
2019 | /* we need the corresponding virtual address */ | 2020 | /* we need the corresponding virtual address */ |
2020 | if (!segment) { | 2021 | if (!segment || (srb->flag & AUTO_REQSENSE)) { |
2021 | srb->virt_addr += xferred; | 2022 | srb->virt_addr += xferred; |
2022 | return; | 2023 | return; |
2023 | } | 2024 | } |
@@ -3318,6 +3319,7 @@ static void pci_unmap_srb_sense(struct AdapterCtlBlk *acb, | |||
3318 | srb->segment_x[DC395x_MAX_SG_LISTENTRY - 1].address; | 3319 | srb->segment_x[DC395x_MAX_SG_LISTENTRY - 1].address; |
3319 | srb->segment_x[0].length = | 3320 | srb->segment_x[0].length = |
3320 | srb->segment_x[DC395x_MAX_SG_LISTENTRY - 1].length; | 3321 | srb->segment_x[DC395x_MAX_SG_LISTENTRY - 1].length; |
3322 | srb->virt_addr = srb->virt_addr_req; | ||
3321 | } | 3323 | } |
3322 | 3324 | ||
3323 | 3325 | ||
@@ -3711,6 +3713,8 @@ static void request_sense(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, | |||
3711 | srb->xferred = srb->total_xfer_length; | 3713 | srb->xferred = srb->total_xfer_length; |
3712 | /* srb->segment_x : a one entry of S/G list table */ | 3714 | /* srb->segment_x : a one entry of S/G list table */ |
3713 | srb->total_xfer_length = sizeof(cmd->sense_buffer); | 3715 | srb->total_xfer_length = sizeof(cmd->sense_buffer); |
3716 | srb->virt_addr_req = srb->virt_addr; | ||
3717 | srb->virt_addr = cmd->sense_buffer; | ||
3714 | srb->segment_x[0].length = sizeof(cmd->sense_buffer); | 3718 | srb->segment_x[0].length = sizeof(cmd->sense_buffer); |
3715 | /* Map sense buffer */ | 3719 | /* Map sense buffer */ |
3716 | srb->segment_x[0].address = | 3720 | srb->segment_x[0].address = |