All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Garzarella <sgarzare@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	"Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH] pci_dma_rw: return correct value instead of 0
Date: Thu, 30 Jul 2020 12:48:04 +0200	[thread overview]
Message-ID: <20200730104804.apxqhhaszjnef77d@steredhat.lan> (raw)
In-Reply-To: <CAFEAcA9A6_S0NEzjmjvxJofFQVKgZS2U_YjgW7jwEo--irNQyw@mail.gmail.com>

On Thu, Jul 30, 2020 at 09:58:21AM +0100, Peter Maydell wrote:
> On Thu, 30 Jul 2020 at 08:42, Stefano Garzarella <sgarzare@redhat.com> wrote:
> > I agree that it is better to return the dma_memory_rw() return value, but
> > at first look, no one seems to check the return value of pci_dma_rw(),
> > pci_dma_read(), andpci_dma_write().
> >
> > Should we make them void?
> 
> In general code (eg device models) that issues memory transactions
> need to have a mechanism for finding out whether the transaction
> succeeds. Traditionally QEMU didn't have the concept of a
> transaction failing, but we have added it, starting with the
> APIs at the bottom level (the address_space_* ones). We haven't
> always plumbed the error-handling (or the memory-transaction
> input, for that matter) through to some of these other APIs.
> I think for consistency we should do that, and ideally we
> should make all these APIs look the same as the base-level
> address_space* ones, which would mean returning a MemTxError
> rather than a bool.

Yeah, that makes a lot of sense to me.

> 
> We should also figure out why the dma_* functions exist at all:
> they include some calls to dma_barrier(), but not all devices
> do DMA with the dma_* functions, so we have an inconsistency
> that should be sorted out...
> 

I've never looked in detail, but I agree we should have more consistency.

Thanks for the details!
Stefano



  reply	other threads:[~2020-07-30 10:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 22:17 [PATCH] pci_dma_rw: return correct value instead of 0 Emanuele Giuseppe Esposito
2020-07-30  7:41 ` Stefano Garzarella
2020-07-30  8:50   ` Emanuele Giuseppe Esposito
2020-07-30 10:41     ` Stefano Garzarella
2020-07-30  8:58   ` Peter Maydell
2020-07-30 10:48     ` Stefano Garzarella [this message]
2020-07-30  8:48 ` Peter Maydell
2020-08-17  7:04   ` Klaus Jensen

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=20200730104804.apxqhhaszjnef77d@steredhat.lan \
    --to=sgarzare@redhat.com \
    --cc=e.emanuelegiuseppe@gmail.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.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.