All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Igor Mitsyanko <i.mitsyanko@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-arm <qemu-arm@nongnu.org>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PATCH 6/6] hw/arm/exynos4210: Connect serial port DMA busy signals with pl330
Date: Fri, 17 Jan 2020 18:44:42 +0000	[thread overview]
Message-ID: <CAFEAcA9zWeW1k-K7qVzCSOA70BmOCa9onT2z_QUQK-=0AJ+NjQ@mail.gmail.com> (raw)
In-Reply-To: <20200117182939.GC13396@roeck-us.net>

On Fri, 17 Jan 2020 at 18:29, Guenter Roeck <linux@roeck-us.net> wrote:
>
> On Fri, Jan 17, 2020 at 01:48:06PM +0000, Peter Maydell wrote:
> > On Fri, 10 Jan 2020 at 20:39, Guenter Roeck <linux@roeck-us.net> wrote:
> > >
> > > The Exynos4210 serial driver uses an interrupt line to signal if receive
> > > data is available. Connect that interrupt with the DMA controller's
> > > 'peripheral busy' gpio pin.

> > Rather than having the uart and pl330 pointers be locals,
> > they should be fields in Exynos4210State. (Otherwise technically
> > we leak them, though this is unnoticeable in practice because there's
> > no way to destroy an Exynos4210State.)
> >
> Out of curiosity: Is that a new leak because they are now tied together,
> or is it an existing leak ? I don't find many DeviceState entries
> in xxxState structures, so find it difficult to determine if/when/why
> there is such a leak.

Yes, it's an existing leak, though it's more of a conceptual leak
than one that valgrind would actually complain about. (The object
isn't totally unreachable because there will be references to it
in the QOM tree. Keeping track of your child objects only becomes
really important if the device is hot-pluggable, because if you
can hot-unplug the device you get a real leak if it hasn't cleaned
up its child objects.)

Aside: I think this code is written this way because although it's
a container device it has been incorrectly written against
the pattern of a board model. Originally board models did not
have any "this is the board" struct that they could keep things
in, so the only way to write board model code that created,
configured and wired up devices was to have it do it in a
way that didn't keep track of the things it created once the
board init function returned. This code is part of an SoC
"container" device, so it does have a state struct that it
could use to hold either embedded device structs or simply
pointers to device objects, but the code is written like the old
board-model code. (These days even board models have a suitable
state struct they can use.)

include/hw/arm/armsse.h is an example of a device state struct
with a lot of embedded device state structs in it. (Not all device
state structs have names ending "State".)

thanks
-- PMM


  reply	other threads:[~2020-01-17 18:51 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-10 20:39 [PATCH 0/6] Fix Exynos4210 DMA support Guenter Roeck
2020-01-10 20:39 ` [PATCH 1/6] dma/pl330: Convert to support tracing Guenter Roeck
2020-01-17 13:23   ` Peter Maydell
2020-01-17 16:46     ` Guenter Roeck
2020-01-17 17:05       ` Peter Maydell
2020-01-17 17:41         ` Guenter Roeck
2020-01-10 20:39 ` [PATCH 2/6] hw/arm/exynos4210: Fix DMA initialization Guenter Roeck
2020-01-17 13:30   ` Peter Maydell
2020-01-17 18:07     ` Guenter Roeck
2020-01-17 18:34       ` Peter Maydell
2020-01-10 20:39 ` [PATCH 3/6] hw/char/exynos4210_uart: Convert to support tracing Guenter Roeck
2020-01-17 13:31   ` Peter Maydell
2020-01-10 20:39 ` [PATCH 4/6] hw/char/exynos4210_uart: Implement receive FIFO Guenter Roeck
2020-01-17 13:42   ` Peter Maydell
2020-01-17 18:21     ` Guenter Roeck
2020-01-17 18:36       ` Peter Maydell
2020-01-10 20:39 ` [PATCH 5/6] hw/char/exynos4210_uart: Add receive DMA support Guenter Roeck
2020-01-17 13:44   ` Peter Maydell
2020-01-10 20:39 ` [PATCH 6/6] hw/arm/exynos4210: Connect serial port DMA busy signals with pl330 Guenter Roeck
2020-01-17 13:48   ` Peter Maydell
2020-01-17 18:29     ` Guenter Roeck
2020-01-17 18:44       ` Peter Maydell [this message]
2020-01-18 15:08         ` Guenter Roeck
2020-01-18 20:02           ` Peter Maydell
2020-01-19  1:52             ` Guenter Roeck
2020-01-19 19:01               ` Peter Maydell
2020-01-19 19:09                 ` Guenter Roeck

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='CAFEAcA9zWeW1k-K7qVzCSOA70BmOCa9onT2z_QUQK-=0AJ+NjQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=i.mitsyanko@gmail.com \
    --cc=linux@roeck-us.net \
    --cc=pbonzini@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.