qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <marcel@redhat.com>
To: Cao jin <caoj.fnst@cn.fujitsu.com>, qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v5 09/11] pci bridge dev: change msi property type
Date: Sun, 15 May 2016 16:25:59 +0300	[thread overview]
Message-ID: <573878E7.7070807@redhat.com> (raw)
In-Reply-To: <1462508442-9407-10-git-send-email-caoj.fnst@cn.fujitsu.com>

On 05/06/2016 07:20 AM, Cao jin wrote:
>  From bit to enum OnOffAuto.
>
> 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>
> ---
>
> Actually, I am not quite sure this device need this change, RFC.
>

Well, it already has the 'msi' property, so we may want to make it standard 'OnOffAuto'.
One problem I can see is the change of semantics. Until now msi=on means 'auto'. From now on
it means 'force msi=on', fail otherwise. If I got this right,  old machines having msi=on
will failed to start on platforms with msibroken=true, right?

Maybe we should preserve the semantics for old machines? (this patch does not actually
affect the semantics, but patch 11/11 should, otherwise why change it to OnOffAuto, right? )

Thanks,
Marcel


>   hw/pci-bridge/pci_bridge_dev.c | 14 ++++++++------
>   1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c
> index 32f4daa..9e31f0e 100644
> --- a/hw/pci-bridge/pci_bridge_dev.c
> +++ b/hw/pci-bridge/pci_bridge_dev.c
> @@ -41,9 +41,10 @@ struct PCIBridgeDev {
>
>       MemoryRegion bar;
>       uint8_t chassis_nr;
> -#define PCI_BRIDGE_DEV_F_MSI_REQ 0
> -#define PCI_BRIDGE_DEV_F_SHPC_REQ 1
> +#define PCI_BRIDGE_DEV_F_SHPC_REQ 0
>       uint32_t flags;
> +
> +    OnOffAuto msi;
>   };
>   typedef struct PCIBridgeDev PCIBridgeDev;
>
> @@ -65,7 +66,7 @@ static int pci_bridge_dev_initfn(PCIDevice *dev)
>           }
>       } else {
>           /* MSI is not applicable without SHPC */
> -        bridge_dev->flags &= ~(1 << PCI_BRIDGE_DEV_F_MSI_REQ);
> +        bridge_dev->msi = ON_OFF_AUTO_OFF;
>       }
>
>       err = slotid_cap_init(dev, 0, bridge_dev->chassis_nr, 0);
> @@ -73,7 +74,8 @@ static int pci_bridge_dev_initfn(PCIDevice *dev)
>           goto slotid_error;
>       }
>
> -    if ((bridge_dev->flags & (1 << PCI_BRIDGE_DEV_F_MSI_REQ)) &&
> +    if ((bridge_dev->msi == ON_OFF_AUTO_AUTO ||
> +                bridge_dev->msi == ON_OFF_AUTO_ON) &&
>           msi_nonbroken) {
>           err = msi_init(dev, 0, 1, true, true);
>           if (err < 0) {
> @@ -146,8 +148,8 @@ static Property pci_bridge_dev_properties[] = {
>                       /* Note: 0 is not a legal chassis number. */
>       DEFINE_PROP_UINT8(PCI_BRIDGE_DEV_PROP_CHASSIS_NR, PCIBridgeDev, chassis_nr,
>                         0),
> -    DEFINE_PROP_BIT(PCI_BRIDGE_DEV_PROP_MSI, PCIBridgeDev, flags,
> -                    PCI_BRIDGE_DEV_F_MSI_REQ, true),
> +    DEFINE_PROP_ON_OFF_AUTO(PCI_BRIDGE_DEV_PROP_MSI, PCIBridgeDev, msi,
> +                            ON_OFF_AUTO_AUTO),
>       DEFINE_PROP_BIT(PCI_BRIDGE_DEV_PROP_SHPC, PCIBridgeDev, flags,
>                       PCI_BRIDGE_DEV_F_SHPC_REQ, true),
>       DEFINE_PROP_END_OF_LIST(),
>

  reply	other threads:[~2016-05-15 13:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06  4:20 [Qemu-devel] [PATCH v5 00/11] Add param Error ** for msi_init() Cao jin
2016-05-06  4:20 ` [Qemu-devel] [PATCH v5 01/11] fix some coding style problems Cao jin
2016-05-15 12:36   ` Marcel Apfelbaum
2016-05-06  4:20 ` [Qemu-devel] [PATCH v5 02/11] change pvscsi_init_msi() type to void Cao jin
2016-05-06  5:48   ` Cao jin
2016-05-06  4:20 ` [Qemu-devel] [PATCH v5 03/11] megasas: Fix Cao jin
2016-05-06  5:43   ` Cao jin
2016-05-15 12:37     ` Marcel Apfelbaum
2016-05-06  4:20 ` [Qemu-devel] [PATCH v5 04/11] mptsas: change .realize function name Cao jin
2016-05-06  5:53   ` Cao jin
2016-05-06  4:20 ` [Qemu-devel] [PATCH v5 05/11] usb xhci: change msi/msix property type Cao jin
2016-05-06  4:20 ` [Qemu-devel] [PATCH v5 06/11] intel-hda: change msi " Cao jin
2016-05-06  4:20 ` [Qemu-devel] [PATCH v5 07/11] mptsas: " Cao jin
2016-05-06  4:20 ` [Qemu-devel] [PATCH v5 08/11] megasas: change msi/msix " Cao jin
2016-05-06  4:20 ` [Qemu-devel] [PATCH v5 09/11] pci bridge dev: change msi " Cao jin
2016-05-15 13:25   ` Marcel Apfelbaum [this message]
2016-05-17  7:39     ` Cao jin
2016-05-17  7:38       ` Michael S. Tsirkin
2016-05-23  2:22         ` Cao jin
2016-05-23  9:55           ` Marcel Apfelbaum
2016-05-06  4:20 ` [Qemu-devel] [PATCH v5 10/11] pci core: assert ENOSPC when add capability Cao jin
2016-05-15 13:10   ` Marcel Apfelbaum
2016-05-17  3:00     ` Cao jin
2016-05-06  4:20 ` [Qemu-devel] [PATCH v5 11/11] pci: Convert msi_init() to Error and fix callers to check it Cao jin
2016-05-15 13:41   ` Marcel Apfelbaum
2016-05-17 10:08     ` Cao jin
2016-05-23 10:06       ` Marcel Apfelbaum
2016-05-23 12:51         ` 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=573878E7.7070807@redhat.com \
    --to=marcel@redhat.com \
    --cc=armbru@redhat.com \
    --cc=caoj.fnst@cn.fujitsu.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).