virtio: don't fail on !of_device_is_compatible
Michael S. Tsirkin
maintainerPATCH 1/1 virtio: don't fail on !of_device_is_compatible
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.
---
Arnd could you help review this pls? Viresh is on vacation.
drivers/virtio/virtio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/virtio/virtio.c +6 -1
@@ -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; }
Signature · 1 line
MST
Sorry about HTML (From phone)..
Quoted 38 lines · On Mon, 13 Sep 2021, 16:17 Michael S. Tsirkin, <[email protected]> wrote:
A recent change checking
of_device_is_compatibleon 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_nodesetup but proceed with initialization like we did previously.Fixes 694a1116b405 ("virtio: Bind virtio device to device-tree node")Reported-by Alexey Kardashevskiy <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Viresh Kumar <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
Arnd could you help review this pls? Viresh is on vacation.
drivers/virtio/virtio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/virtio/virtio.c +6
-1@@ -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;
Quoted 2 lines
}
Quoted 1 line
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Michael S. Tsirkin
maintainerQuoted 7 lines · Michael S. Tsirkin
A recent change checking
of_device_is_compatibleon 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_nodesetup but proceed with initialization like we did previously.
Quoted 6 lines
Fixes 694a1116b405 ("virtio: Bind virtio device to device-tree node")Reported-by Alexey Kardashevskiy <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Viresh Kumar <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
Guenter could you take a look at this patch pls? Does it help?
Quoted 26 lines
Arnd could you help review this pls? Viresh is on vacation.
drivers/virtio/virtio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/virtio/virtio.c +6
-1@@ -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; }Signature · 1 line
MST
Quoted 16 lines · Michael S. Tsirkin
Quoted 7 lines · Michael S. Tsirkin
A recent change checking
of_device_is_compatibleon 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_nodesetup but proceed with initialization like we did previously.Quoted 6 lines
Fixes 694a1116b405 ("virtio: Bind virtio device to device-tree node")Reported-by Alexey Kardashevskiy <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Viresh Kumar <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
Quoted 3 lines
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
Quoted 28 lines
Quoted 27 lines
Arnd could you help review this pls? Viresh is on vacation.
drivers/virtio/virtio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/virtio/virtio.c +6
-1@@ -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; }Signature · 1 line
MST
Quoted 7 lines · Michael S. Tsirkin
A recent change checking
of_device_is_compatibleon 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_nodesetup but proceed with initialization like we did previously.
Quoted 6 lines
Fixes 694a1116b405 ("virtio: Bind virtio device to device-tree node")Reported-by Alexey Kardashevskiy <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Viresh Kumar <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
This patch also fixes a similar problem seen with sparc64.
Guenter
Quoted 28 lines
Arnd could you help review this pls? Viresh is on vacation.
drivers/virtio/virtio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/virtio/virtio.c +6
-1@@ -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; }Signature · 1 line
MST
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Quoted 28 lines · Michael S. Tsirkin
A recent change checking
of_device_is_compatibleon 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_nodesetup but proceed with initialization like we did previously.Fixes 694a1116b405 ("virtio: Bind virtio device to device-tree node")Reported-by Alexey Kardashevskiy <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Viresh Kumar <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
Arnd could you help review this pls? Viresh is on vacation.
drivers/virtio/virtio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/virtio/virtio.c +0
-0@@ -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));
drivers/virtio/virtio.c static int virtio_device_of_init(struct virtio_device *dev) · line 358
Quoted 10 lines
drivers/virtio/virtio.c +6
-1+/* +* 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; }
Quoted 4 lines
drivers/virtio/virtio.c +0
-1--MST