Skip to contentSkip to conversation

ide/macio: fix wrong opaque with TRIM support

PATCH In review Aurelien Jarno 3 participants 3 messages May 19, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ide/macio: fix wrong opaque with TRIM support

Commit 215e47b9 enabled TRIM by default, which revealed a bug in TRIM support for the IDE macio emulation driver, introduced in d353fb72.

The call to dma_bdrv_io() is using a wrong opaque of type IDEState instead of DBDMA_io. This patch fixes that.

Fixes LP#1179104

---
 hw/ide/macio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ide/macio.c +1 -1
index bf12a10..e1e4f41 100644
@@ -144,7 +144,7 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
         break;
     case IDE_DMA_TRIM:
         m->aiocb = dma_bdrv_io(s->bs, &s->sg, sector_num,
-                               ide_issue_trim, pmac_ide_transfer_cb, s,
+                               ide_issue_trim, pmac_ide_transfer_cb, io,
                                DMA_DIRECTION_TO_DEVICE);
         break;
     }
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#1 lore raw

Il 19/05/2013 13:27, Aurelien Jarno ha scritto:

Quoted 22 lines

Commit 215e47b9 enabled TRIM by default, which revealed a bug in TRIM support for the IDE macio emulation driver, introduced in d353fb72.

The call to dma_bdrv_io() is using a wrong opaque of type IDEState instead of DBDMA_io. This patch fixes that.

Fixes LP#1179104

---
 hw/ide/macio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ide/macio.c +0 -0
index bf12a10..e1e4f41 100644

hw/ide/macio.c static void pmac_ide_transfer_cb(void *opaque, int ret) · line 150

Quoted 8 lines
hw/ide/macio.c +1 -1
@@ -144,7 +144,7 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
         break;
     case IDE_DMA_TRIM:
         m->aiocb = dma_bdrv_io(s->bs, &s->sg, sector_num,
-                               ide_issue_trim, pmac_ide_transfer_cb, s,
+                               ide_issue_trim, pmac_ide_transfer_cb, io,
                                DMA_DIRECTION_TO_DEVICE);
         break;
     }

Thanks!

Paolo

#2 lore raw
In reply to Aurelien Jarno
Quoted 6 lines · Aurelien Jarno

Commit 215e47b9 enabled TRIM by default, which revealed a bug in TRIM support for the IDE macio emulation driver, introduced in d353fb72.

The call to dma_bdrv_io() is using a wrong opaque of type IDEState instead of DBDMA_io. This patch fixes that.

Quoted 6 lines

Fixes LP#1179104

I can confirm with this patch the ppc testcase works again.

Thanks!

/mjt