qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Yongbok Kim" <yongbok.kim@imgtec.com>,
	"Richard Henderson" <rth@twiddle.net>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"David Gibson" <david@gibson.dropbear.id.au>,
	"Alexander Graf" <agraf@suse.de>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	"Eduardo Otubo" <otubo@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, qemu-trivial@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 38/39] hw/dma/i82374: avoid multiple creations on the same ISA bus
Date: Tue, 17 Oct 2017 08:43:55 +0200	[thread overview]
Message-ID: <f7cc6099-cb42-f3ec-d23f-135111ff306c@redhat.com> (raw)
In-Reply-To: <20171017001209.32276-39-f4bug@amsat.org>

On 17.10.2017 02:12, Philippe Mathieu-Daudé wrote:
> $ ./ppc64-softmmu/qemu-system-ppc64 -S -machine 40p,accel=tcg -device i82374
> qemu-system-ppc64: -device i82374: DMA already initialized on ISA bus
> 
> Reported-by: Eduardo Otubo <otubo@redhat.com>
> Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/dma/i82374.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c
> index 6c0f975df0..280e64f0fa 100644
> --- a/hw/dma/i82374.c
> +++ b/hw/dma/i82374.c
> @@ -23,6 +23,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> +#include "qapi/error.h"
>  #include "hw/isa/isa.h"
>  
>  #define TYPE_I82374 "i82374"
> @@ -117,13 +118,19 @@ static const MemoryRegionPortio i82374_portio_list[] = {
>  static void i82374_realize(DeviceState *dev, Error **errp)
>  {
>      I82374State *s = I82374(dev);
> +    ISABus *isa_bus = isa_bus_from_device(ISA_DEVICE(dev));
> +
> +    if (isa_bus->dma[0] || isa_bus->dma[1]) {
> +        error_setg(errp, "DMA already initialized on ISA bus");
> +        return;
> +    }

I think it'd be somewhat cleaner to do this check within DMA_init() -
and DMA_init() then should be provided with an errp parameter, too.
Since you then have to touch all callers, it would then maybe also make
sense to merge this with the next patch where you've got to touch all
callers due to the renaming of the function anyway.

>      portio_list_init(&s->port_list, OBJECT(s), i82374_portio_list, s,
>                       "i82374");
>      portio_list_add(&s->port_list, isa_address_space_io(&s->parent_obj),
>                      s->iobase);
>  
> -    DMA_init(isa_bus_from_device(ISA_DEVICE(dev)), 1);
> +    DMA_init(isa_bus, 1);
>      memset(s->commands, 0, sizeof(s->commands));
>  }

 Thomas

  reply	other threads:[~2017-10-17  6:44 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17  0:11 [Qemu-devel] [PATCH v2 00/39] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 01/39] MAINTAINERS: add entries for i2c/ppc4xx_i2c Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 02/39] MAINTAINERS: add entries for dma/i82374 Philippe Mathieu-Daudé
2017-10-17  6:59   ` Thomas Huth
2017-10-17 16:30     ` Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 03/39] MAINTAINERS: add an entry for the i82378 (superio) Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 04/39] MAINTAINERS: add an entry for watchdog/wdt_ib700 Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 05/39] MAINTAINERS: add an entry for input/pckbd.c Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 06/39] MAINTAINERS: add entries for timer/m48t59 Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 07/39] MAINTAINERS: add missing entry for include/hw/net/ Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 08/39] hw: use "qemu/osdep.h" as first #include in source files Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 09/39] hw: remove "qemu/osdep.h" from header files Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 10/39] block: remove "qemu/osdep.h" from header file Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 11/39] misc: remove headers implicitly included Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 12/39] misc: remove duplicated includes Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 13/39] ppc: " Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 14/39] i386/hax: " Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 15/39] i386/hax: remove duplicated include Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 16/39] nios2: remove duplicated includes (in code commented out) Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 17/39] misc: avoid "include/" in include path Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 18/39] numa: remove unused #include Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 19/39] hw/ssi/aspeed_smc: " Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 20/39] amd_iommu: avoid needless includes in header file Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 21/39] misc: remove old i386 dependency Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 22/39] hw/ide: " Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 23/39] hw/ipmi: " Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 24/39] hw/i2c: " Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 25/39] hw/tpm: " Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 26/39] hw/virtio-balloon: " Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 27/39] hw/unicore32: restrict hw addr defines to source file Philippe Mathieu-Daudé
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 28/39] hw/acpi: ACPI_PM_* defines are not restricted to i386 arch Philippe Mathieu-Daudé
2017-10-17 11:06   ` Paolo Bonzini
2017-10-17  0:11 ` [Qemu-devel] [PATCH v2 29/39] hw/timer/i8254: rename pit_init() -> i8254_pit_init() Philippe Mathieu-Daudé
2017-10-17  0:12 ` [Qemu-devel] [PATCH v2 30/39] hw/display/vga: remove the old i386/pc dependency Philippe Mathieu-Daudé
2017-10-17  6:06   ` Thomas Huth
2017-10-17 10:49     ` Philippe Mathieu-Daudé
2017-10-17 11:09       ` Thomas Huth
2017-10-17  0:12 ` [Qemu-devel] [PATCH v2 31/39] hw/input/i8042: extract pckbd and vmmouse API from hw/i386/pc.h Philippe Mathieu-Daudé
2017-10-17  0:12 ` [Qemu-devel] [PATCH v2 32/39] hw/timer/mc146818: rename rtc_init() -> mc146818_rtc_init() Philippe Mathieu-Daudé
2017-10-17  0:12 ` [Qemu-devel] [PATCH v2 33/39] hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c Philippe Mathieu-Daudé
2017-10-17  0:20   ` Philippe Mathieu-Daudé
2017-10-17  0:12 ` [Qemu-devel] [PATCH v2 34/39] misc: drop old i386 dependency Philippe Mathieu-Daudé
2017-10-17  0:12 ` [Qemu-devel] [PATCH v2 35/39] i386/pc: move vmport.c from hw/misc/ to hw/i386/ Philippe Mathieu-Daudé
2017-10-17  6:19   ` Thomas Huth
2017-10-17 11:05   ` Paolo Bonzini
2017-10-17  0:12 ` [Qemu-devel] [PATCH v2 36/39] i386/pc: move pvpanic.c " Philippe Mathieu-Daudé
2017-10-17  6:25   ` Thomas Huth
2017-10-17 11:04   ` Paolo Bonzini
2017-10-17 12:31     ` Philippe Mathieu-Daudé
2017-10-17  0:12 ` [Qemu-devel] [PATCH v2 37/39] i386/pc: extract port92 from pc.c Philippe Mathieu-Daudé
2017-10-17  6:30   ` Thomas Huth
2017-10-17 10:03     ` Philippe Mathieu-Daudé
2017-10-17  0:12 ` [Qemu-devel] [PATCH v2 38/39] hw/dma/i82374: avoid multiple creations on the same ISA bus Philippe Mathieu-Daudé
2017-10-17  6:43   ` Thomas Huth [this message]
2017-10-17  0:12 ` [Qemu-devel] [PATCH v2 39/39] hw/dma/i8257: rename DMA_init() to i8257_dma_init() Philippe Mathieu-Daudé
2017-10-17  6:47   ` Thomas Huth
2017-10-17  1:24 ` [Qemu-devel] [PATCH v2 00/39] remove i386/pc dependency from non-PC world (part 1) no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7cc6099-cb42-f3ec-d23f-135111ff306c@redhat.com \
    --to=thuth@redhat.com \
    --cc=agraf@suse.de \
    --cc=armbru@redhat.com \
    --cc=atar4qemu@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=david@gibson.dropbear.id.au \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=hpoussin@reactos.org \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mjt@tls.msk.ru \
    --cc=mst@redhat.com \
    --cc=otubo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=yongbok.kim@imgtec.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).