[PATCH 24/28] 53c700: convert from dma_cache_sync to dma_sync_single_for_device
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>, Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>, "James E.J. Bottomley" <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>, Joonyoung Shim <jy0922.shim@xxxxxxxxxxx>, Seung-Woo Kim <sw0312.kim@xxxxxxxxxxx>, Kyungmin Park <kyungmin.park@xxxxxxxxxxx>, Ben Skeggs <bskeggs@xxxxxxxxxx>, Pawel Osciak <pawel@xxxxxxxxxx>, Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>, Matt Porter <mporter@xxxxxxxxxxxxxxxxxxx>, iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx
- Subject: [PATCH 24/28] 53c700: convert from dma_cache_sync to dma_sync_single_for_device
- From: Christoph Hellwig <hch@xxxxxx>
- Date: Wed, 19 Aug 2020 08:55:51 +0200
- Cc: Tom Lendacky <thomas.lendacky@xxxxxxx>, linux-doc@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-media@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linux-samsung-soc@xxxxxxxxxxxxxxx, nouveau@xxxxxxxxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, linux-nvme@xxxxxxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx, alsa-devel@xxxxxxxxxxxxxxxx
- In-reply-to: <20200819065555.1802761-1-hch@lst.de>
- References: <20200819065555.1802761-1-hch@lst.de>
Use the proper modern API to transfer cache ownership for incoherent DMA.
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
drivers/scsi/53c700.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index 521950d0731e4a..57a08c42d00325 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -269,18 +269,25 @@ NCR_700_get_SXFER(struct scsi_device *SDp)
spi_period(SDp->sdev_target));
}
+static inline dma_addr_t virt_to_dma(struct NCR_700_Host_Parameters *h, void *p)
+{
+ return h->pScript + ((uintptr_t)p - (uintptr_t)h->script);
+}
+
static inline void dma_sync_to_dev(struct NCR_700_Host_Parameters *h,
void *addr, size_t size)
{
if (h->noncoherent)
- dma_cache_sync(h->dev, addr, size, DMA_TO_DEVICE);
+ dma_sync_single_for_device(h->dev, virt_to_dma(h, addr),
+ size, DMA_BIDIRECTIONAL);
}
static inline void dma_sync_from_dev(struct NCR_700_Host_Parameters *h,
void *addr, size_t size)
{
if (h->noncoherent)
- dma_cache_sync(h->dev, addr, size, DMA_FROM_DEVICE);
+ dma_sync_single_for_device(h->dev, virt_to_dma(h, addr), size,
+ DMA_BIDIRECTIONAL);
}
struct Scsi_Host *
--
2.28.0
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]