From: Marcel Apfelbaum <marcel@redhat.com>
To: Cao jin <caoj.fnst@cn.fujitsu.com>, qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>, John Snow <jsnow@redhat.com>,
Dmitry Fleytman <dmitry@daynix.com>,
Jason Wang <jasowang@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Hannes Reinecke <hare@suse.de>,
Paolo Bonzini <pbonzini@redhat.com>,
Alex Williamson <alex.williamson@redhat.com>,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v5 11/11] pci: Convert msi_init() to Error and fix callers to check it
Date: Mon, 23 May 2016 13:06:23 +0300 [thread overview]
Message-ID: <5742D61F.2090602@redhat.com> (raw)
In-Reply-To: <573AEDA9.5080507@cn.fujitsu.com>
On 05/17/2016 01:08 PM, Cao jin wrote:
>
>
> On 05/15/2016 09:41 PM, Marcel Apfelbaum wrote:
>
>>
>>>
>>> diff --git a/hw/pci-bridge/pci_bridge_dev.c
>>> b/hw/pci-bridge/pci_bridge_dev.c
>>> index 9e31f0e..af71c98 100644
>>> --- a/hw/pci-bridge/pci_bridge_dev.c
>>> +++ b/hw/pci-bridge/pci_bridge_dev.c
>>> @@ -53,6 +53,7 @@ static int pci_bridge_dev_initfn(PCIDevice *dev)
>>> PCIBridge *br = PCI_BRIDGE(dev);
>>> PCIBridgeDev *bridge_dev = PCI_BRIDGE_DEV(dev);
>>> int err;
>>> + Error *local_err = NULL;
>>>
>>> pci_bridge_initfn(dev, TYPE_PCI_BUS);
>>>
>>> @@ -74,11 +75,11 @@ static int pci_bridge_dev_initfn(PCIDevice *dev)
>>> goto slotid_error;
>>> }
>>>
>>> - if ((bridge_dev->msi == ON_OFF_AUTO_AUTO ||
>>> - bridge_dev->msi == ON_OFF_AUTO_ON) &&
>>> + if (bridge_dev->msi != ON_OFF_AUTO_OFF &&
>>
>> So we made the msi property OnOffAuto, but we don't make a difference
>> between ON and Auto?
>>
>
> That is why I am not quite sure about this device, msi has a relation with shpc.
>
> From its previous behaviour, it can be seen that it don`t treat 'on' as 'auto'.(I am not sure why it is different with others)
>
> Its previous behaviour treat msi_init`s failure as fatal, and lead to device creation fail. According to Markus`s comments(if I understand him right), this device has no non-msi variants.
Actually it has. The bridge needs msi for the SHPC controller, as you said.
If you look into shpc_interrupt_update function (hw/pci/shpc.c) you can see it can fall
back to legacy interrupts.
The only complication here is that msi is needed only if shpc is present.
So maybe having msi=on/off/auto is OK.
msi=auto => if shpc not present or msi broken results in msi = off, else msi = on
msi=on => fails if shpc present and msi broken
msi=off => use legacy interrupts if shpc is present
Basically the msi flag has no meaning if shpc not present.
Thanks,
Marcel
I think my
> patch follows the previous behaviour.
>
> And also according to function comments:
> /* MSI is not applicable without SHPC */
> which means device either has both, or neither(if I understand it right), so that is why I don`t make a difference
>
>>> msi_nonbroken) {
>>> - err = msi_init(dev, 0, 1, true, true);
>>> + err = msi_init(dev, 0, 1, true, true, &local_err);
>>> if (err < 0) {
>>> + error_report_err(local_err);
>>> goto msi_error;
>>> }
>>> }
>
>
next prev parent reply other threads:[~2016-05-23 10:06 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
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 [this message]
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=5742D61F.2090602@redhat.com \
--to=marcel@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=armbru@redhat.com \
--cc=caoj.fnst@cn.fujitsu.com \
--cc=dmitry@daynix.com \
--cc=hare@suse.de \
--cc=jasowang@redhat.com \
--cc=jsnow@redhat.com \
--cc=kraxel@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@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).