diff mbox

ide/macio: Fix macio DMA initialisation.

Message ID 1361738771-6265-1-git-send-email-mark.cave-ayland@ilande.co.uk
State New
Headers show

Commit Message

Mark Cave-Ayland Feb. 24, 2013, 8:46 p.m. UTC
Commit 07a7484e5d713f1eb7c1c37b18a8ab0d56d88875 accidentally introduced a bug
in the initialisation of the second macio DMA device which could cause some
DMA operations to segfault QEMU.

CC: Andreas Färber <afaerber@suse.de>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/macio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andreas Färber Feb. 24, 2013, 8:53 p.m. UTC | #1
Am 24.02.2013 21:46, schrieb Mark Cave-Ayland:
> Commit 07a7484e5d713f1eb7c1c37b18a8ab0d56d88875 accidentally introduced a bug
> in the initialisation of the second macio DMA device which could cause some
> DMA operations to segfault QEMU.
> 
> CC: Andreas Färber <afaerber@suse.de>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Acked-by: Andreas Färber <afaerber@suse.de>

Thanks for catching this,

Andreas

> ---
>  hw/macio.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/macio.c b/hw/macio.c
> index 74bdcd1..0c6a6b8 100644
> --- a/hw/macio.c
> +++ b/hw/macio.c
> @@ -188,7 +188,7 @@ static int macio_newworld_initfn(PCIDevice *d)
>      sysbus_dev = SYS_BUS_DEVICE(&ns->ide[1]);
>      sysbus_connect_irq(sysbus_dev, 0, ns->irqs[3]);
>      sysbus_connect_irq(sysbus_dev, 1, ns->irqs[4]);
> -    macio_ide_register_dma(&ns->ide[0], s->dbdma, 0x1a);
> +    macio_ide_register_dma(&ns->ide[1], s->dbdma, 0x1a);
>      ret = qdev_init(DEVICE(&ns->ide[1]));
>      if (ret < 0) {
>          return ret;
Alexander Graf Feb. 25, 2013, 1:44 p.m. UTC | #2
On 24.02.2013, at 21:46, Mark Cave-Ayland wrote:

> Commit 07a7484e5d713f1eb7c1c37b18a8ab0d56d88875 accidentally introduced a bug
> in the initialisation of the second macio DMA device which could cause some
> DMA operations to segfault QEMU.
> 
> CC: Andreas Färber <afaerber@suse.de>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Thanks, applied to ppc-next and added a CC to qemu-stable.


Alex

> ---
> hw/macio.c |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/macio.c b/hw/macio.c
> index 74bdcd1..0c6a6b8 100644
> --- a/hw/macio.c
> +++ b/hw/macio.c
> @@ -188,7 +188,7 @@ static int macio_newworld_initfn(PCIDevice *d)
>     sysbus_dev = SYS_BUS_DEVICE(&ns->ide[1]);
>     sysbus_connect_irq(sysbus_dev, 0, ns->irqs[3]);
>     sysbus_connect_irq(sysbus_dev, 1, ns->irqs[4]);
> -    macio_ide_register_dma(&ns->ide[0], s->dbdma, 0x1a);
> +    macio_ide_register_dma(&ns->ide[1], s->dbdma, 0x1a);
>     ret = qdev_init(DEVICE(&ns->ide[1]));
>     if (ret < 0) {
>         return ret;
> -- 
> 1.7.10.4
> 
>
Stefan Hajnoczi Feb. 25, 2013, 2:28 p.m. UTC | #3
On Sun, Feb 24, 2013 at 08:46:11PM +0000, Mark Cave-Ayland wrote:
> Commit 07a7484e5d713f1eb7c1c37b18a8ab0d56d88875 accidentally introduced a bug
> in the initialisation of the second macio DMA device which could cause some
> DMA operations to segfault QEMU.
> 
> CC: Andreas Färber <afaerber@suse.de>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
>  hw/macio.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan
Zhiyong Wu Feb. 25, 2013, 2:41 p.m. UTC | #4
Why is this patch so hottest? so that both guys would like to apply it?:)

On Mon, Feb 25, 2013 at 4:46 AM, Mark Cave-Ayland
<mark.cave-ayland@ilande.co.uk> wrote:
> Commit 07a7484e5d713f1eb7c1c37b18a8ab0d56d88875 accidentally introduced a bug
> in the initialisation of the second macio DMA device which could cause some
> DMA operations to segfault QEMU.
>
> CC: Andreas Färber <afaerber@suse.de>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
>  hw/macio.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/macio.c b/hw/macio.c
> index 74bdcd1..0c6a6b8 100644
> --- a/hw/macio.c
> +++ b/hw/macio.c
> @@ -188,7 +188,7 @@ static int macio_newworld_initfn(PCIDevice *d)
>      sysbus_dev = SYS_BUS_DEVICE(&ns->ide[1]);
>      sysbus_connect_irq(sysbus_dev, 0, ns->irqs[3]);
>      sysbus_connect_irq(sysbus_dev, 1, ns->irqs[4]);
> -    macio_ide_register_dma(&ns->ide[0], s->dbdma, 0x1a);
> +    macio_ide_register_dma(&ns->ide[1], s->dbdma, 0x1a);
>      ret = qdev_init(DEVICE(&ns->ide[1]));
>      if (ret < 0) {
>          return ret;
> --
> 1.7.10.4
>
>
Andreas Färber Feb. 25, 2013, 3:24 p.m. UTC | #5
Am 25.02.2013 15:41, schrieb Zhi Yong Wu:
> Why is this patch so hottest? so that both guys would like to apply it?:)

Bugs are always bad and should be fixed quickly. ;) But apart from that:

It is a ppc Mac device (-> agraf) that was refactored by me to please
the block guys (e.g., stefanha) wanting to change IDE APIs.

I thus CC'ed them in case any follow-ups of theirs were suffering from
the same bug.

But we're still missing one device for arm (hw/ide/microdrive.c), not
sure if someone is working on that? Maybe you have some spare cycles for
it? Or do I need to break the third device as well? :)

Cheers,
Andreas
diff mbox

Patch

diff --git a/hw/macio.c b/hw/macio.c
index 74bdcd1..0c6a6b8 100644
--- a/hw/macio.c
+++ b/hw/macio.c
@@ -188,7 +188,7 @@  static int macio_newworld_initfn(PCIDevice *d)
     sysbus_dev = SYS_BUS_DEVICE(&ns->ide[1]);
     sysbus_connect_irq(sysbus_dev, 0, ns->irqs[3]);
     sysbus_connect_irq(sysbus_dev, 1, ns->irqs[4]);
-    macio_ide_register_dma(&ns->ide[0], s->dbdma, 0x1a);
+    macio_ide_register_dma(&ns->ide[1], s->dbdma, 0x1a);
     ret = qdev_init(DEVICE(&ns->ide[1]));
     if (ret < 0) {
         return ret;