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 06/11] usb xhci: change msi/msix property type
Date: Wed, 01 Jun 2016 10:25:36 +0200 [thread overview]
Message-ID: <87eg8h48ov.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <1464062689-32156-7-git-send-email-caoj.fnst@cn.fujitsu.com> (Cao jin's message of "Tue, 24 May 2016 12:04:44 +0800")
Cao jin <caoj.fnst@cn.fujitsu.com> writes:
>>From bit 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/usb/hcd-xhci.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
> index 43ba615..bbe5cca 100644
> --- a/hw/usb/hcd-xhci.c
> +++ b/hw/usb/hcd-xhci.c
> @@ -461,6 +461,8 @@ struct XHCIState {
> uint32_t numslots;
> uint32_t flags;
> uint32_t max_pstreams_mask;
> + OnOffAuto msi;
> + OnOffAuto msix;
>
> /* Operational Registers */
> uint32_t usbcmd;
> @@ -498,9 +500,7 @@ typedef struct XHCIEvRingSeg {
> } XHCIEvRingSeg;
>
> enum xhci_flags {
> - XHCI_FLAG_USE_MSI = 1,
> - XHCI_FLAG_USE_MSI_X,
> - XHCI_FLAG_SS_FIRST,
> + XHCI_FLAG_SS_FIRST = 1,
> XHCI_FLAG_FORCE_PCIE_ENDCAP,
> XHCI_FLAG_ENABLE_STREAMS,
> };
> @@ -3648,10 +3648,12 @@ static void usb_xhci_realize(struct PCIDevice *dev, Error **errp)
> assert(ret >= 0);
> }
>
> - if (xhci_get_flag(xhci, XHCI_FLAG_USE_MSI)) {
> + if (xhci->msi == ON_OFF_AUTO_ON ||
> + xhci->msi == ON_OFF_AUTO_AUTO) {
Easier:
if (xhci->msi != ON_OFF_AUTO_OFF) {
Hmm, you switch to this simpler conditional in PATCH 11, when you move
this code. I'd use the simpler conditional from the start. Since it
doesn't affect the final state, this is a suggestion, not a demand.
> msi_init(dev, 0x70, xhci->numintrs, true, false);
Shouldn't we check for errors here? Hmm, you do it in PATCH 11. Okay,
but I'd add a /* TODO check for errors */ comment here.
> }
> - if (xhci_get_flag(xhci, XHCI_FLAG_USE_MSI_X)) {
> + if (xhci->msix == ON_OFF_AUTO_ON ||
> + xhci->msix == ON_OFF_AUTO_AUTO) {
Likewise.
> msix_init(dev, xhci->numintrs,
> &xhci->mem, 0, OFF_MSIX_TABLE,
> &xhci->mem, 0, OFF_MSIX_PBA,
Likewise.
> @@ -3872,8 +3874,8 @@ static const VMStateDescription vmstate_xhci = {
> };
>
> static Property xhci_properties[] = {
> - DEFINE_PROP_BIT("msi", XHCIState, flags, XHCI_FLAG_USE_MSI, true),
> - DEFINE_PROP_BIT("msix", XHCIState, flags, XHCI_FLAG_USE_MSI_X, true),
> + DEFINE_PROP_ON_OFF_AUTO("msi", XHCIState, msi, ON_OFF_AUTO_AUTO),
> + DEFINE_PROP_ON_OFF_AUTO("msix", XHCIState, msix, ON_OFF_AUTO_AUTO),
> DEFINE_PROP_BIT("superspeed-ports-first",
> XHCIState, flags, XHCI_FLAG_SS_FIRST, true),
> DEFINE_PROP_BIT("force-pcie-endcap", XHCIState, flags,
next prev parent reply other threads:[~2016-06-01 8:25 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 [this message]
2016-05-24 4:04 ` [Qemu-devel] [PATCH v6 07/11] intel-hda: change msi " Cao jin
2016-06-01 8:39 ` Markus Armbruster
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=87eg8h48ov.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 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).