From: Markus Armbruster <armbru@redhat.com>
To: Cao jin <caoj.fnst@cn.fujitsu.com>
Cc: qemu-devel@nongnu.org, Marcel Apfelbaum <marcel@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v6 07/11] intel-hda: change msi property type
Date: Wed, 01 Jun 2016 10:39:52 +0200 [thread overview]
Message-ID: <878typ2tgn.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <1464062689-32156-8-git-send-email-caoj.fnst@cn.fujitsu.com> (Cao jin's message of "Tue, 24 May 2016 12:04:45 +0800")
Cao jin <caoj.fnst@cn.fujitsu.com> writes:
>>From uint32 to enum OnOffAuto.
>
> cc: Gerd Hoffmann <kraxel@redhat.com>
> cc: Michael S. Tsirkin <mst@redhat.com>
> cc: Markus Armbruster <armbru@redhat.com>
> cc: Marcel Apfelbaum <marcel@redhat.com>
>
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> ---
> hw/audio/intel-hda.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
> index d372d4a..61362e5 100644
> --- a/hw/audio/intel-hda.c
> +++ b/hw/audio/intel-hda.c
> @@ -187,7 +187,7 @@ struct IntelHDAState {
>
> /* properties */
> uint32_t debug;
> - uint32_t msi;
> + OnOffAuto msi;
I'm going to review all uses of this member.
> bool old_msi_addr;
> };
>
> @@ -1142,7 +1142,8 @@ static void intel_hda_realize(PCIDevice *pci, Error **errp)
> memory_region_init_io(&d->mmio, OBJECT(d), &intel_hda_mmio_ops, d,
> "intel-hda", 0x4000);
> pci_register_bar(&d->pci, 0, 0, &d->mmio);
> - if (d->msi) {
> + if (d->msi == ON_OFF_AUTO_AUTO ||
> + d->msi == ON_OFF_AUTO_ON) {
> msi_init(&d->pci, d->old_msi_addr ? 0x50 : 0x60, 1, true, false);
Same suggestions as for PATCH 06:
* Use the d->msi != ON_OFF_AUTO_OFF
* Add /* TODO check for errors */ now, drop it when you add the check in
PATCH 11.
> }
>
> @@ -1234,7 +1235,7 @@ static const VMStateDescription vmstate_intel_hda = {
>
> static Property intel_hda_properties[] = {
> DEFINE_PROP_UINT32("debug", IntelHDAState, debug, 0),
> - DEFINE_PROP_UINT32("msi", IntelHDAState, msi, 1),
> + DEFINE_PROP_ON_OFF_AUTO("msi", IntelHDAState, msi, ON_OFF_AUTO_AUTO),
> DEFINE_PROP_BOOL("old_msi_addr", IntelHDAState, old_msi_addr, false),
> DEFINE_PROP_END_OF_LIST(),
> };
Not covered:
static void intel_hda_update_irq(IntelHDAState *d)
{
--> int msi = d->msi && msi_enabled(&d->pci);
int level;
intel_hda_update_int_sts(d);
if (d->int_sts & (1U << 31) && d->int_ctl & (1U << 31)) {
level = 1;
} else {
level = 0;
}
dprint(d, 2, "%s: level %d [%s]\n", __FUNCTION__,
level, msi ? "msi" : "intx");
if (msi) {
if (level) {
msi_notify(&d->pci, 0);
}
} else {
pci_set_irq(&d->pci, level);
}
}
This is wrong, because the meaning of the test changes from
(user didn't specify msi=off) && (guest enabled MSI)
to
(user didn't specify msi=on or msi=off) && (guest enabled MSI)
What about:
int msi = msi_enabled(&d->pci);
If I understand it correctly, it can only be true when we added MSI
capability, and we do that only when msi=auto (default) or msi=on.
next prev parent reply other threads:[~2016-06-01 8:40 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-24 4:04 [Qemu-devel] [PATCH v6 00/11] Add param Error ** for msi_init() Cao jin
2016-05-24 4:04 ` [Qemu-devel] [PATCH v6 01/11] pci core: assert ENOSPC when add capability Cao jin
2016-05-24 4:04 ` [Qemu-devel] [PATCH v6 02/11] fix some coding style problems Cao jin
2016-06-01 8:09 ` Markus Armbruster
2016-06-01 8:33 ` Cao jin
2016-05-24 4:04 ` [Qemu-devel] [PATCH v6 03/11] change pvscsi_init_msi() type to void Cao jin
2016-05-24 4:04 ` [Qemu-devel] [PATCH v6 04/11] megasas: Fix Cao jin
2016-06-01 8:10 ` Markus Armbruster
2016-05-24 4:04 ` [Qemu-devel] [PATCH v6 05/11] mptsas: change .realize function name Cao jin
2016-05-24 4:04 ` [Qemu-devel] [PATCH v6 06/11] usb xhci: change msi/msix property type Cao jin
2016-06-01 8:25 ` Markus Armbruster
2016-05-24 4:04 ` [Qemu-devel] [PATCH v6 07/11] intel-hda: change msi " Cao jin
2016-06-01 8:39 ` Markus Armbruster [this message]
2016-06-02 8:42 ` Cao jin
2016-05-24 4:04 ` [Qemu-devel] [PATCH v6 08/11] mptsas: " Cao jin
2016-06-01 8:43 ` Markus Armbruster
2016-05-24 4:04 ` [Qemu-devel] [PATCH v6 09/11] megasas: change msi/msix " Cao jin
2016-06-01 9:14 ` Markus Armbruster
2016-06-02 10:15 ` Cao jin
2016-06-02 13:59 ` Markus Armbruster
2016-05-24 4:04 ` [Qemu-devel] [PATCH v6 10/11] pci bridge dev: change msi " Cao jin
2016-06-01 9:17 ` Markus Armbruster
2016-05-24 4:04 ` [Qemu-devel] [PATCH v6 11/11] pci: Convert msi_init() to Error and fix callers to check it Cao jin
2016-06-01 12:37 ` Markus Armbruster
2016-06-03 8:28 ` Cao jin
2016-06-03 11:30 ` Markus Armbruster
2016-06-01 3:06 ` [Qemu-devel] [PATCH v6 00/11] Add param Error ** for msi_init() Cao jin
2016-06-01 6:59 ` Cao jin
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=878typ2tgn.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=caoj.fnst@cn.fujitsu.com \
--cc=kraxel@redhat.com \
--cc=marcel@redhat.com \
--cc=mst@redhat.com \
--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.