[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 09/23] dma: Let pci_dma_rw() take MemTxAttrs argument
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 09/23] dma: Let pci_dma_rw() take MemTxAttrs argument |
Date: |
Thu, 23 Dec 2021 12:55:40 +0100 |
Let devices specify transaction attributes when calling pci_dma_rw().
Keep the default MEMTXATTRS_UNSPECIFIED in the few callers.
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
include/hw/pci/pci.h | 10 ++++++----
hw/audio/intel-hda.c | 3 ++-
hw/scsi/esp-pci.c | 2 +-
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index 1acefc2a4c3..a751ab5a75d 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -806,10 +806,10 @@ static inline AddressSpace
*pci_get_address_space(PCIDevice *dev)
*/
static inline MemTxResult pci_dma_rw(PCIDevice *dev, dma_addr_t addr,
void *buf, dma_addr_t len,
- DMADirection dir)
+ DMADirection dir, MemTxAttrs attrs)
{
return dma_memory_rw(pci_get_address_space(dev), addr, buf, len,
- dir, MEMTXATTRS_UNSPECIFIED);
+ dir, attrs);
}
/**
@@ -827,7 +827,8 @@ static inline MemTxResult pci_dma_rw(PCIDevice *dev,
dma_addr_t addr,
static inline MemTxResult pci_dma_read(PCIDevice *dev, dma_addr_t addr,
void *buf, dma_addr_t len)
{
- return pci_dma_rw(dev, addr, buf, len, DMA_DIRECTION_TO_DEVICE);
+ return pci_dma_rw(dev, addr, buf, len,
+ DMA_DIRECTION_TO_DEVICE, MEMTXATTRS_UNSPECIFIED);
}
/**
@@ -845,7 +846,8 @@ static inline MemTxResult pci_dma_read(PCIDevice *dev,
dma_addr_t addr,
static inline MemTxResult pci_dma_write(PCIDevice *dev, dma_addr_t addr,
const void *buf, dma_addr_t len)
{
- return pci_dma_rw(dev, addr, (void *) buf, len, DMA_DIRECTION_FROM_DEVICE);
+ return pci_dma_rw(dev, addr, (void *) buf, len,
+ DMA_DIRECTION_FROM_DEVICE, MEMTXATTRS_UNSPECIFIED);
}
#define PCI_DMA_DEFINE_LDST(_l, _s, _bits) \
diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
index 8ce9df64e3e..fb3d34a4a0c 100644
--- a/hw/audio/intel-hda.c
+++ b/hw/audio/intel-hda.c
@@ -427,7 +427,8 @@ static bool intel_hda_xfer(HDACodecDevice *dev, uint32_t
stnr, bool output,
dprint(d, 3, "dma: entry %d, pos %d/%d, copy %d\n",
st->be, st->bp, st->bpl[st->be].len, copy);
- pci_dma_rw(&d->pci, st->bpl[st->be].addr + st->bp, buf, copy, !output);
+ pci_dma_rw(&d->pci, st->bpl[st->be].addr + st->bp, buf, copy, !output,
+ MEMTXATTRS_UNSPECIFIED);
st->lpib += copy;
st->bp += copy;
buf += copy;
diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
index dac054aeed4..1792f84cea6 100644
--- a/hw/scsi/esp-pci.c
+++ b/hw/scsi/esp-pci.c
@@ -280,7 +280,7 @@ static void esp_pci_dma_memory_rw(PCIESPState *pci, uint8_t
*buf, int len,
len = pci->dma_regs[DMA_WBC];
}
- pci_dma_rw(PCI_DEVICE(pci), addr, buf, len, dir);
+ pci_dma_rw(PCI_DEVICE(pci), addr, buf, len, dir, MEMTXATTRS_UNSPECIFIED);
/* update status registers */
pci->dma_regs[DMA_WBC] -= len;
--
2.33.1
- [PATCH v2 00/23] hw: Have DMA APIs take MemTxAttrs arg & propagate MemTxResult (full), Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 01/23] dma: Let dma_memory_valid() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 02/23] dma: Let dma_memory_set() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 03/23] dma: Let dma_memory_rw_relaxed() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 04/23] dma: Let dma_memory_rw() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 05/23] dma: Let dma_memory_read/write() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 06/23] dma: Let dma_memory_map() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 07/23] dma: Have dma_buf_rw() take a void pointer, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 08/23] dma: Have dma_buf_read() / dma_buf_write() take a void pointer, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 09/23] dma: Let pci_dma_rw() take MemTxAttrs argument,
Philippe Mathieu-Daudé <=
- [PATCH v2 10/23] dma: Let dma_buf_rw() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 11/23] dma: Let dma_buf_write() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 12/23] dma: Let dma_buf_read() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 13/23] dma: Let dma_buf_rw() propagate MemTxResult, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 14/23] dma: Let dma_buf_read() / dma_buf_write() propagate MemTxResult, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 15/23] dma: Let st*_dma() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 16/23] dma: Let ld*_dma() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 17/23] dma: Let st*_dma() propagate MemTxResult, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 18/23] dma: Let ld*_dma() propagate MemTxResult, Philippe Mathieu-Daudé, 2021/12/23