From: Auger Eric <eric.auger@redhat.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <damm+renesas@opensource.se>,
QEMU Developers <qemu-devel@nongnu.org>,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Alex Williamson <alex.williamson@redhat.com>,
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
qemu-arm <qemu-arm@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v3 1/4] vfio/platform: Make the vfio-platform device non-abstract
Date: Tue, 7 Aug 2018 17:05:54 +0200 [thread overview]
Message-ID: <303a110d-7cb6-9003-e225-7f9d87d78811@redhat.com> (raw)
In-Reply-To: <CAMuHMdUuWT+-7wGg2SYTvtQV0Cy64N5GYTB0b-3gXPS3KLoO2w@mail.gmail.com>
Hi Geert,
On 08/07/2018 05:00 PM, Geert Uytterhoeven wrote:
> Hi Eric,
>
> On Tue, Aug 7, 2018 at 4:18 PM Auger Eric <eric.auger@redhat.com> wrote:
>> On 07/25/2018 04:34 PM, Geert Uytterhoeven wrote:
>>> From: Auger Eric <eric.auger@redhat.com>
>>>
>>> Up to now the vfio-platform device has been abstract and could not be
>>> instantiated. The integration of a new vfio platform device required
>>> creating a dummy derived device which only set the compatible string.
>>>
>>> Following the few vfio-platform device integrations we have seen the
>>> actual requested adaptation happens on device tree node creation
>>> (sysbus-fdt).
>>>
>>> Hence remove the abstract setting, and read the list of compatible
>>> values from sysfs if not set by a derived device.
>>>
>>> Update the amd-xgbe and calxeda-xgmac drivers to fill in the number of
>>> compatible values, as there can now be more than one.
>>>
>>> Note that sysbus-fdt does not support the instantiation of the
>>> vfio-platform device yet.
>>>
>>> Signed-off-by: Eric Auger <eric.auger@redhat.com>
>>> [geert: Rebase, set user_creatable=true, use compatible values in sysfs
>>> instead of user-supplied manufacturer/model options, reword]
>>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>>> ---
>>> v3:
>>> - Read all compatible values from sysfs instead of using user-supplied
>>> manufacturer and model options,
>>> - Reword patch description,
>>> - Drop RFC state,
>>>
>>> v2:
>>> - No changes,
>>>
>>> v1:
>>> - Rebase, Set user_creatable=true,
>>>
>>> v0:
>>> - Original version from Eric.
>
>>> --- a/hw/vfio/platform.c
>>> +++ b/hw/vfio/platform.c
>>> @@ -655,6 +655,25 @@ static void vfio_platform_realize(DeviceState *dev, Error **errp)
>>> goto out;
>>> }
>>>
>>> + if (!vdev->compat) {
>>> + gchar *contents;
>>> + gsize length;
>>> + char *tmp;
>>> +
>>> + tmp = g_strdup_printf("%s/of_node/compatible", vbasedev->sysfsdev);
>>> + if (!g_file_get_contents(tmp, &contents, &length, NULL)) {
>>> + error_report("failed to load \"%s\"", tmp);
>>> + exit(1);
>> You should set errp instead so that the error gets properly propagated.
>
> Thanks, will do.
>
>>> --- a/include/hw/vfio/vfio-platform.h
>>> +++ b/include/hw/vfio/vfio-platform.h
>>> @@ -54,7 +54,8 @@ typedef struct VFIOPlatformDevice {
>>> QLIST_HEAD(, VFIOINTp) intp_list; /* list of IRQs */
>>> /* queue of pending IRQs */
>>> QSIMPLEQ_HEAD(pending_intp_queue, VFIOINTp) pending_intp_queue;
>>> - char *compat; /* compatibility string */
>>> + char *compat; /* DT compatible values, separated by NUL */
>> by NULL characters?
>
> "NUL" is the character ('\0'), "NULL" is the pointer.
Ah OK ;-)
Thanks
Eric
>
> Gr{oetje,eeting}s,
>
> Geert
>
next prev parent reply other threads:[~2018-08-07 15:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-25 14:34 [Qemu-devel] [PATCH v3 0/4] hw/arm/sysbus-fdt: Generic DT Pass-Through Geert Uytterhoeven
2018-07-25 14:34 ` [Qemu-devel] [PATCH v3 1/4] vfio/platform: Make the vfio-platform device non-abstract Geert Uytterhoeven
2018-08-07 14:18 ` Auger Eric
2018-08-07 15:00 ` Geert Uytterhoeven
2018-08-07 15:05 ` Auger Eric [this message]
2018-07-25 14:34 ` [Qemu-devel] [PATCH v3 2/4] hw/arm/sysbus-fdt: Allow device matching with DT compatible value Geert Uytterhoeven
2018-08-07 14:18 ` Auger Eric
2018-07-25 14:34 ` [Qemu-devel] [PATCH v3 3/4] hw/arm/virt: Allow dynamic sysbus devices again Geert Uytterhoeven
2018-08-07 14:18 ` Auger Eric
2018-07-25 14:34 ` [Qemu-devel] [PATCH v3 4/4] hw/arm/sysbus-fdt: Add support for instantiating generic devices Geert Uytterhoeven
2018-08-07 14:19 ` Auger Eric
2018-08-07 15:32 ` Geert Uytterhoeven
2018-08-07 17:21 ` Auger Eric
2018-08-08 12:59 ` Geert Uytterhoeven
2018-08-08 13:16 ` Auger Eric
2018-08-08 13:45 ` Geert Uytterhoeven
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=303a110d-7cb6-9003-e225-7f9d87d78811@redhat.com \
--to=eric.auger@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=damm+renesas@opensource.se \
--cc=geert+renesas@glider.be \
--cc=geert@linux-m68k.org \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=wsa+renesas@sang-engineering.com \
/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).