From: Guenter Roeck <linux@roeck-us.net>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Arnd Bergmann <arnd@kernel.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Arnd Bergmann <arnd@arndb.de>,
Jean-Philippe Brucker <jean-philippe@linaro.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org,
devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
Bill Mills <bill.mills@linaro.org>,
"Enrico Weigelt, metux IT consult" <info@metux.net>
Subject: Re: [PATCH] virtio: don't fail on !of_device_is_compatible
Date: Mon, 13 Sep 2021 13:54:29 -0700 [thread overview]
Message-ID: <20210913205429.GA1085962@roeck-us.net> (raw)
In-Reply-To: <20210913162308-mutt-send-email-mst@kernel.org>
On Mon, Sep 13, 2021 at 04:23:57PM -0400, Michael S. Tsirkin wrote:
> On Mon, Sep 13, 2021 at 06:47:52AM -0400, Michael S. Tsirkin wrote:
> > A recent change checking of_device_is_compatible on probe broke some
> > powerpc/pseries setups. Apparently there virtio devices do not have a
> > "compatible" property - they are matched by PCI vendor/device ids.
> >
> > Let's just skip of_node setup but proceed with initialization like we
> > did previously.
> >
> > Fixes: 694a1116b405 ("virtio: Bind virtio device to device-tree node")
> > Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
>
>
> Guenter could you take a look at this patch pls? Does it help?
>
>
I confirmed that this patch fixes the problem. I replied in that thread.
Thanks,
Guenter
>
> > Arnd could you help review this pls? Viresh is on vacation.
> >
> > drivers/virtio/virtio.c | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
> > index c46cc1fbc7ae..19a70a2361b4 100644
> > --- a/drivers/virtio/virtio.c
> > +++ b/drivers/virtio/virtio.c
> > @@ -347,8 +347,13 @@ static int virtio_device_of_init(struct virtio_device *dev)
> > ret = snprintf(compat, sizeof(compat), "virtio,device%x", dev->id.device);
> > BUG_ON(ret >= sizeof(compat));
> >
> > + /*
> > + * On powerpc/pseries virtio devices are PCI devices so PCI
> > + * vendor/device ids play the role of the "compatible" property.
> > + * Simply don't init of_node in this case.
> > + */
> > if (!of_device_is_compatible(np, compat)) {
> > - ret = -EINVAL;
> > + ret = 0;
> > goto out;
> > }
> >
> > --
> > MST
>
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2021-09-13 20:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-13 10:47 [PATCH] virtio: don't fail on !of_device_is_compatible Michael S. Tsirkin
2021-09-13 12:26 ` Viresh Kumar
2021-09-13 20:23 ` Michael S. Tsirkin
2021-09-13 20:54 ` Guenter Roeck [this message]
2021-09-13 20:53 ` Guenter Roeck
2021-09-14 2:50 ` Jason Wang
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=20210913205429.GA1085962@roeck-us.net \
--to=linux@roeck-us.net \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=bill.mills@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=info@metux.net \
--cc=jean-philippe@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=robh+dt@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=virtualization@lists.linux-foundation.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).