Skip to content

Commit

Permalink
mac_dbdma: Remove leftover dma_memory_unmap calls
Browse files Browse the repository at this point in the history
These were passing a NULL buffer pointer unconditionally, which happens
to behave in a mostly benign way (except for the chance of an excess
memory region unref and a bounce buffer leak). Per the function comment,
this was never meant to be accepted though, and triggers an assertion
with the "softmmu: Support concurrent bounce buffers" change.

Given that the code in question never sets up any mappings, just remove
the unnecessary dma_memory_unmap calls along with the DBDMA_io struct
fields that are now entirely unused.

Signed-off-by: Mattias Nissler <[email protected]>
Message-Id: <[email protected]>
Fixes: be1e343 ("macio: switch over to new byte-aligned DMA helpers")
Reviewed-by: Mark Cave-Ayland <[email protected]>
Tested-by: Mark Cave-Ayland <[email protected]>
Signed-off-by: Mark Cave-Ayland <[email protected]>
(cherry picked from commit 2d0a071)
Signed-off-by: Michael Tokarev <[email protected]>
  • Loading branch information
mnissler-rivos authored and Michael Tokarev committed Sep 25, 2024
1 parent 97fa3d7 commit 73f5d5b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
6 changes: 0 additions & 6 deletions hw/ide/macio.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
return;

done:
dma_memory_unmap(&address_space_memory, io->dma_mem, io->dma_len,
io->dir, io->dma_len);

if (ret < 0) {
block_acct_failed(blk_get_stats(s->blk), &s->acct);
} else {
Expand Down Expand Up @@ -202,9 +199,6 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
return;

done:
dma_memory_unmap(&address_space_memory, io->dma_mem, io->dma_len,
io->dir, io->dma_len);

if (s->dma_cmd == IDE_DMA_READ || s->dma_cmd == IDE_DMA_WRITE) {
if (ret < 0) {
block_acct_failed(blk_get_stats(s->blk), &s->acct);
Expand Down
4 changes: 0 additions & 4 deletions include/hw/ppc/mac_dbdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ struct DBDMA_io {
DBDMA_end dma_end;
/* DMA is in progress, don't start another one */
bool processing;
/* DMA request */
void *dma_mem;
dma_addr_t dma_len;
DMADirection dir;
};

/*
Expand Down

0 comments on commit 73f5d5b

Please sign in to comment.