Mercurial > illumos > illumos-gate
changeset 6157:1c02e3a399c7
6671293 scsi_sync_cache_pkt can be called for packets which have no DMA
author | cth |
---|---|
date | Wed, 05 Mar 2008 10:03:27 -0800 |
parents | 16a6150cda2a |
children | 685e2f65770b |
files | usr/src/uts/common/io/scsi/impl/scsi_resource.c |
diffstat | 1 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/common/io/scsi/impl/scsi_resource.c Wed Mar 05 09:13:22 2008 -0800 +++ b/usr/src/uts/common/io/scsi/impl/scsi_resource.c Wed Mar 05 10:03:27 2008 -0800 @@ -20,7 +20,7 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -693,13 +693,12 @@ void scsi_sync_cache_pkt(struct scsi_address *ap, struct scsi_pkt *pkt) { - if (pkt->pkt_handle) { - ASSERT((pkt->pkt_dma_flags & DDI_DMA_WRITE) || - (pkt->pkt_dma_flags & DDI_DMA_READ)); + if (pkt->pkt_handle && + (pkt->pkt_dma_flags & (DDI_DMA_WRITE | DDI_DMA_READ))) { (void) ddi_dma_sync(pkt->pkt_handle, - pkt->pkt_dma_offset, pkt->pkt_dma_len, - (pkt->pkt_dma_flags & DDI_DMA_WRITE) ? - DDI_DMA_SYNC_FORDEV : DDI_DMA_SYNC_FORCPU); + pkt->pkt_dma_offset, pkt->pkt_dma_len, + (pkt->pkt_dma_flags & DDI_DMA_WRITE) ? + DDI_DMA_SYNC_FORDEV : DDI_DMA_SYNC_FORCPU); } }