From: "Michael S. Tsirkin" <mst@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: qemu-devel@nongnu.org, armbru@redhat.com, eblake@redhat.com,
eduardo@habkost.net, berrange@redhat.com, pbonzini@redhat.com,
marcel.apfelbaum@gmail.com, philmd@linaro.org,
den-plotnikov@yandex-team.ru, antonkuchin@yandex-team.ru
Subject: Re: [PATCH v5 13/18] pci: introduce pci_find_the_only_child()
Date: Thu, 2 Mar 2023 04:39:36 -0500 [thread overview]
Message-ID: <20230302043819-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <7458129e-3c23-be27-dcfa-41dca6c731a4@yandex-team.ru>
On Thu, Mar 02, 2023 at 12:35:54PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> On 02.03.23 11:53, Michael S. Tsirkin wrote:
> > On Thu, Mar 02, 2023 at 11:45:00AM +0300, Vladimir Sementsov-Ogievskiy wrote:
> > > On 02.03.23 11:37, Michael S. Tsirkin wrote:
> > > > On Thu, Mar 02, 2023 at 11:28:44AM +0300, Vladimir Sementsov-Ogievskiy wrote:
> > > > > On 02.03.23 00:09, Michael S. Tsirkin wrote:
> > > > > > On Thu, Feb 16, 2023 at 09:03:51PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> > > > > > > To be used in further patch to identify the device hot-plugged into
> > > > > > > pcie-root-port.
> > > > > > >
> > > > > > > Signed-off-by: Vladimir Sementsov-Ogievskiy<vsementsov@yandex-team.ru>
> > > > > > > Reviewed-by: Anton Kuchin<antonkuchin@yandex-team.ru>
> > > > > > Wait a second does this work for multifunction devices correctly?
> > > > > >
> > > > >
> > > > > I thought about that and I'm just lost:)
> > > > >
> > > > > Could several (multifunction?) devices be plugged into one pcie-root-port device?
> > > >
> > > > One device per port but one multifunction device is represented as multiple PCIDevice structures.
> > >
> > > So, it should be OK to send _one_ event for that multifunction device, and the code is shpc_reset() is OK, but reporting "Several child devices found" is bad idea?
> >
> > I don't know about your new event, we are discussing it separately.
> > yes all functions are removed together normally on real hardware.
> >
> > > So, if I change the logic from pci_find_the_only_child() to pci_find_first_child() is it OK?
> >
> > Yes though I don't like this name either - need to make it clear that
> > multifunction is ok, multiple unrelated devices aren't.
>
> Could we check it somehow that all plugged devices represent the one multifunction device?
You can write a function like this, sure.
But really just return a bus+slot pair.
> >
> >
> > > >
> > > > > Same question for SHPC slots. For example, shpc_free_devices_in_slot() looks like we can have several devices in one slot..
> > > > > On the other hand, in shpc_reset() we have construction shpc->sec_bus->devices[PCI_DEVFN(SHPC_IDX_TO_PCI(i), 0)] to access the device in slot. The only one device.
> > > > >
> > > > > --
> > > > > Best regards,
> > > > > Vladimir
> > > >
> > > > Same thing.
> > > >
> > > > ... and let's not get started about sriov and ari ...
> > > >
> > >
> > > --
> > > Best regards,
> > > Vladimir
> >
>
> --
> Best regards,
> Vladimir
next prev parent reply other threads:[~2023-03-02 9:39 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-16 18:03 [PATCH v5 00/18] pci hotplug tracking Vladimir Sementsov-Ogievskiy
2023-02-16 18:03 ` [PATCH v5 01/18] pci/shpc: set attention led to OFF on reset Vladimir Sementsov-Ogievskiy
2023-02-16 18:03 ` [PATCH v5 02/18] pci/shpc: change shpc_get_status() return type to uint8_t Vladimir Sementsov-Ogievskiy
2023-02-16 18:03 ` [PATCH v5 03/18] pci/shpc: shpc_slot_command(): handle PWRONLY -> ENABLED transition Vladimir Sementsov-Ogievskiy
2023-02-16 18:03 ` [PATCH v5 04/18] pci/shpc: more generic handle hot-unplug in shpc_slot_command() Vladimir Sementsov-Ogievskiy
2023-02-16 18:03 ` [PATCH v5 05/18] pci/shpc: pass PCIDevice pointer to shpc_slot_command() Vladimir Sementsov-Ogievskiy
2023-02-16 18:03 ` [PATCH v5 06/18] pci/shpc: refactor shpc_device_plug_common() Vladimir Sementsov-Ogievskiy
2023-02-16 18:03 ` [PATCH v5 07/18] pcie: pcie_cap_slot_write_config(): use correct macro Vladimir Sementsov-Ogievskiy
2023-02-16 18:03 ` [PATCH v5 08/18] pcie_regs: drop duplicated indicator value macros Vladimir Sementsov-Ogievskiy
2023-02-16 18:03 ` [PATCH v5 09/18] pcie: drop unused PCIExpressIndicator Vladimir Sementsov-Ogievskiy
2023-02-16 18:03 ` [PATCH v5 10/18] pcie: pcie_cap_slot_enable_power() use correct helper Vladimir Sementsov-Ogievskiy
2023-02-16 18:03 ` [PATCH v5 11/18] pcie: introduce pcie_sltctl_powered_off() helper Vladimir Sementsov-Ogievskiy
2023-02-16 18:03 ` [PATCH v5 12/18] pcie: set power indicator to off on reset by default Vladimir Sementsov-Ogievskiy
2023-02-16 18:03 ` [PATCH v5 13/18] pci: introduce pci_find_the_only_child() Vladimir Sementsov-Ogievskiy
2023-03-01 21:09 ` Michael S. Tsirkin
2023-03-02 8:28 ` Vladimir Sementsov-Ogievskiy
2023-03-02 8:37 ` Michael S. Tsirkin
2023-03-02 8:45 ` Vladimir Sementsov-Ogievskiy
2023-03-02 8:53 ` Michael S. Tsirkin
2023-03-02 9:35 ` Vladimir Sementsov-Ogievskiy
2023-03-02 9:39 ` Michael S. Tsirkin [this message]
2023-02-16 18:03 ` [PATCH v5 14/18] qapi/qdev.json: unite DEVICE_* event data into single structure Vladimir Sementsov-Ogievskiy
2023-03-01 21:08 ` Michael S. Tsirkin
2023-02-16 18:03 ` [PATCH v5 15/18] qapi: add HOTPLUG_STATE infrastructure Vladimir Sementsov-Ogievskiy
2023-02-16 18:03 ` [PATCH v5 16/18] shpc: implement HOTPLUG_STATE event and query-hotplug Vladimir Sementsov-Ogievskiy
2023-02-16 18:03 ` [PATCH v5 17/18] pcie: " Vladimir Sementsov-Ogievskiy
2023-02-16 18:03 ` [PATCH v5 18/18] qapi: introduce DEVICE_ON event Vladimir Sementsov-Ogievskiy
2023-03-01 21:07 ` Michael S. Tsirkin
2023-03-02 8:39 ` Vladimir Sementsov-Ogievskiy
2023-03-02 8:50 ` Michael S. Tsirkin
2023-03-02 9:16 ` Vladimir Sementsov-Ogievskiy
2023-03-02 9:38 ` Michael S. Tsirkin
2023-03-02 8:44 ` Michael S. Tsirkin
2023-03-02 10:03 ` Vladimir Sementsov-Ogievskiy
2023-03-02 10:05 ` Michael S. Tsirkin
2023-03-01 21:16 ` [PATCH v5 00/18] pci hotplug tracking Michael S. Tsirkin
2023-03-02 8:51 ` Vladimir Sementsov-Ogievskiy
2023-03-01 21:17 ` Michael S. Tsirkin
2023-03-02 9:36 ` Vladimir Sementsov-Ogievskiy
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=20230302043819-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=antonkuchin@yandex-team.ru \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=den-plotnikov@yandex-team.ru \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=marcel.apfelbaum@gmail.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@yandex-team.ru \
/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.