linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH slof v2] pci-properties: Remove redundant call to device-type
@ 2015-03-11 13:02 Alexey Kardashevskiy
  2015-03-11 13:14 ` Thomas Huth
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Kardashevskiy @ 2015-03-11 13:02 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: Alexey Kardashevskiy, Thomas Huth, Nikunj A Dadhania,
	David Gibson

At the moment SLOF adds a "device_type" property automatically for
every single PCI device based on its class even if there is no SLOF
driver for such a device. OF1275 says that "device_type" is for
implemented interfaces only. A side effect of this is virtio-balloon
getting device_type=="memory" while it should not have.

This removes automatic call to device-type from the common PCI code.
Since now, we rely on existing SLOF PCI drivers to call device-type if
needed. virtio-blk/net, e1000, ohci/ehci/xhci do this. virtio-scsi
does not create the property for itself but disks on its bus do.
virtio-ballon won't get the device_type property as there is no driver
for it.

While we are here, remove device-type from usb-mouse as well.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
Changes:
v2:
* removed usb mouse as well - slof does not implement it
---
 slof/fs/pci-properties.fs | 2 +-
 slof/fs/usb/dev-mouse.fs  | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/slof/fs/pci-properties.fs b/slof/fs/pci-properties.fs
index a19c651..9efa87e 100644
--- a/slof/fs/pci-properties.fs
+++ b/slof/fs/pci-properties.fs
@@ -565,7 +565,7 @@
 \ ***************************************************************************************
 \ set up common properties for devices and bridges
 : pci-common-props ( addr -- )
-        dup pci-class-name 2dup device-name device-type
+        dup pci-class-name device-name
         dup pci-vendor@    encode-int s" vendor-id"      property
         dup pci-device@    encode-int s" device-id"      property
         dup pci-revision@  encode-int s" revision-id"    property
diff --git a/slof/fs/usb/dev-mouse.fs b/slof/fs/usb/dev-mouse.fs
index 278a7c0..f6acd7e 100644
--- a/slof/fs/usb/dev-mouse.fs
+++ b/slof/fs/usb/dev-mouse.fs
@@ -6,7 +6,6 @@ sudev slof-dev>port l@ dup set-unit encode-phys " reg" property
 sudev slof-dev>udev @ VALUE udev
 
 s" usb-mouse" device-name
-s" mouse" device-type
 
 \ .S cr
 \     dup slof-dev>udev dup . @ . cr
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH slof v2] pci-properties: Remove redundant call to device-type
  2015-03-11 13:02 [PATCH slof v2] pci-properties: Remove redundant call to device-type Alexey Kardashevskiy
@ 2015-03-11 13:14 ` Thomas Huth
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Huth @ 2015-03-11 13:14 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: linuxppc-dev, Nikunj A Dadhania, David Gibson

On Thu, 12 Mar 2015 00:02:02 +1100
Alexey Kardashevskiy <aik@ozlabs.ru> wrote:

> At the moment SLOF adds a "device_type" property automatically for
> every single PCI device based on its class even if there is no SLOF
> driver for such a device. OF1275 says that "device_type" is for
> implemented interfaces only. A side effect of this is virtio-balloon
> getting device_type=="memory" while it should not have.
> 
> This removes automatic call to device-type from the common PCI code.
> Since now, we rely on existing SLOF PCI drivers to call device-type if
> needed. virtio-blk/net, e1000, ohci/ehci/xhci do this. virtio-scsi
> does not create the property for itself but disks on its bus do.
> virtio-ballon won't get the device_type property as there is no driver
> for it.
> 
> While we are here, remove device-type from usb-mouse as well.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> Changes:
> v2:
> * removed usb mouse as well - slof does not implement it
> ---
>  slof/fs/pci-properties.fs | 2 +-
>  slof/fs/usb/dev-mouse.fs  | 1 -
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/slof/fs/pci-properties.fs b/slof/fs/pci-properties.fs
> index a19c651..9efa87e 100644
> --- a/slof/fs/pci-properties.fs
> +++ b/slof/fs/pci-properties.fs
> @@ -565,7 +565,7 @@
>  \ ***************************************************************************************
>  \ set up common properties for devices and bridges
>  : pci-common-props ( addr -- )
> -        dup pci-class-name 2dup device-name device-type
> +        dup pci-class-name device-name
>          dup pci-vendor@    encode-int s" vendor-id"      property
>          dup pci-device@    encode-int s" device-id"      property
>          dup pci-revision@  encode-int s" revision-id"    property
> diff --git a/slof/fs/usb/dev-mouse.fs b/slof/fs/usb/dev-mouse.fs
> index 278a7c0..f6acd7e 100644
> --- a/slof/fs/usb/dev-mouse.fs
> +++ b/slof/fs/usb/dev-mouse.fs
> @@ -6,7 +6,6 @@ sudev slof-dev>port l@ dup set-unit encode-phys " reg" property
>  sudev slof-dev>udev @ VALUE udev
> 
>  s" usb-mouse" device-name
> -s" mouse" device-type
> 
>  \ .S cr
>  \     dup slof-dev>udev dup . @ . cr

Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-11 13:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-11 13:02 [PATCH slof v2] pci-properties: Remove redundant call to device-type Alexey Kardashevskiy
2015-03-11 13:14 ` Thomas Huth

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).