linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 07/16] macintosh: use dev_groups and not dev_attrs for bus_type
       [not found] <20170606192221.1617-1-gregkh@linuxfoundation.org>
@ 2017-06-06 19:22 ` Greg Kroah-Hartman
  2017-06-06 19:22 ` [PATCH 08/16] powerpc: ps3: " Greg Kroah-Hartman
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 20+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-06 19:22 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, Benjamin Herrenschmidt, linuxppc-dev

The dev_attrs field has long been "depreciated" and is finally being
removed, so move the driver to use the "correct" dev_groups field
instead for struct bus_type.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: <linuxppc-dev@lists.ozlabs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/macintosh/macio_asic.c  |  4 ++--
 drivers/macintosh/macio_sysfs.c | 29 +++++++++++++++++++++--------
 2 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index f757cef293f8..62f541f968f6 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -133,7 +133,7 @@ static int macio_device_resume(struct device * dev)
 	return 0;
 }
 
-extern struct device_attribute macio_dev_attrs[];
+extern const struct attribute_group *macio_dev_groups[];
 
 struct bus_type macio_bus_type = {
        .name	= "macio",
@@ -144,7 +144,7 @@ struct bus_type macio_bus_type = {
        .shutdown = macio_device_shutdown,
        .suspend	= macio_device_suspend,
        .resume	= macio_device_resume,
-       .dev_attrs = macio_dev_attrs,
+       .dev_groups = macio_dev_groups,
 };
 
 static int __init macio_bus_driver_init(void)
diff --git a/drivers/macintosh/macio_sysfs.c b/drivers/macintosh/macio_sysfs.c
index 0b1f9c76c68d..2445274f7e4b 100644
--- a/drivers/macintosh/macio_sysfs.c
+++ b/drivers/macintosh/macio_sysfs.c
@@ -10,7 +10,8 @@ field##_show (struct device *dev, struct device_attribute *attr,	\
 {									\
 	struct macio_dev *mdev = to_macio_device (dev);			\
 	return sprintf (buf, format_string, mdev->ofdev.dev.of_node->field); \
-}
+}									\
+static DEVICE_ATTR_RO(field);
 
 static ssize_t
 compatible_show (struct device *dev, struct device_attribute *attr, char *buf)
@@ -37,6 +38,7 @@ compatible_show (struct device *dev, struct device_attribute *attr, char *buf)
 
 	return length;
 }
+static DEVICE_ATTR_RO(compatible);
 
 static ssize_t modalias_show (struct device *dev, struct device_attribute *attr,
 			      char *buf)
@@ -52,15 +54,26 @@ static ssize_t devspec_show(struct device *dev,
 	ofdev = to_platform_device(dev);
 	return sprintf(buf, "%s\n", ofdev->dev.of_node->full_name);
 }
+static DEVICE_ATTR_RO(modalias);
+static DEVICE_ATTR_RO(devspec);
 
 macio_config_of_attr (name, "%s\n");
 macio_config_of_attr (type, "%s\n");
 
-struct device_attribute macio_dev_attrs[] = {
-	__ATTR_RO(name),
-	__ATTR_RO(type),
-	__ATTR_RO(compatible),
-	__ATTR_RO(modalias),
-	__ATTR_RO(devspec),
-	__ATTR_NULL
+static struct attribute *macio_dev_attrs[] = {
+	&dev_attr_name.attr,
+	&dev_attr_type.attr,
+	&dev_attr_compatible.attr,
+	&dev_attr_modalias.attr,
+	&dev_attr_devspec.attr,
+	NULL,
+};
+
+static const struct attribute_group macio_dev_group = {
+	.attrs = macio_dev_attrs,
+};
+
+const struct attribute_group *macio_dev_groups[] = {
+	&macio_dev_group,
+	NULL,
 };
-- 
2.13.0

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

* [PATCH 08/16] powerpc: ps3: use dev_groups and not dev_attrs for bus_type
       [not found] <20170606192221.1617-1-gregkh@linuxfoundation.org>
  2017-06-06 19:22 ` [PATCH 07/16] macintosh: use dev_groups and not dev_attrs for bus_type Greg Kroah-Hartman
@ 2017-06-06 19:22 ` Greg Kroah-Hartman
  2017-06-06 21:33   ` Geoff Levand
  2017-06-07 10:17   ` Greg Kroah-Hartman
  2017-06-06 19:22 ` [PATCH 09/16] powerpc: ibmebus: " Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 20+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-06 19:22 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Geoff Levand, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, linuxppc-dev

The dev_attrs field has long been "depreciated" and is finally being
removed, so move the driver to use the "correct" dev_groups field
instead for struct bus_type.

Cc: Geoff Levand <geoff@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: <linuxppc-dev@lists.ozlabs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/powerpc/platforms/ps3/system-bus.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index 2d2e5f80a3d3..3e98b4ea3df9 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -471,11 +471,13 @@ static ssize_t modalias_show(struct device *_dev, struct device_attribute *a,
 
 	return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
 }
+static DEVICE_ATTR_RO(modalias);
 
-static struct device_attribute ps3_system_bus_dev_attrs[] = {
-	__ATTR_RO(modalias),
-	__ATTR_NULL,
+static struct attribute *ps3_system_bus_dev_attrs[] = {
+	&dev_attr_modalias.attr,
+	NULL,
 };
+ATTRIBUTE_GROUPS(ps3_system_bus);
 
 struct bus_type ps3_system_bus_type = {
 	.name = "ps3_system_bus",
@@ -484,7 +486,7 @@ struct bus_type ps3_system_bus_type = {
 	.probe = ps3_system_bus_probe,
 	.remove = ps3_system_bus_remove,
 	.shutdown = ps3_system_bus_shutdown,
-	.dev_attrs = ps3_system_bus_dev_attrs,
+	.dev_groups = ps3_system_bus_dev_groups,
 };
 
 static int __init ps3_system_bus_init(void)
-- 
2.13.0

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

* [PATCH 09/16] powerpc: ibmebus: use dev_groups and not dev_attrs for bus_type
       [not found] <20170606192221.1617-1-gregkh@linuxfoundation.org>
  2017-06-06 19:22 ` [PATCH 07/16] macintosh: use dev_groups and not dev_attrs for bus_type Greg Kroah-Hartman
  2017-06-06 19:22 ` [PATCH 08/16] powerpc: ps3: " Greg Kroah-Hartman
@ 2017-06-06 19:22 ` Greg Kroah-Hartman
  2017-06-06 19:22 ` [PATCH 10/16] powerpc: vio: " Greg Kroah-Hartman
  2017-06-06 19:22 ` [PATCH 11/16] powerpc: vio_cmo: " Greg Kroah-Hartman
  4 siblings, 0 replies; 20+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-06 19:22 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, Bart Van Assche, Johan Hovold, Robin Murphy,
	Rob Herring, Lars-Peter Clausen, linuxppc-dev

The dev_attrs field has long been "depreciated" and is finally being
removed, so move the driver to use the "correct" dev_groups field
instead for struct bus_type.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: <linuxppc-dev@lists.ozlabs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/powerpc/platforms/pseries/ibmebus.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/ibmebus.c b/arch/powerpc/platforms/pseries/ibmebus.c
index b363e439ddb9..52146b1356d2 100644
--- a/arch/powerpc/platforms/pseries/ibmebus.c
+++ b/arch/powerpc/platforms/pseries/ibmebus.c
@@ -397,6 +397,7 @@ static ssize_t devspec_show(struct device *dev,
 	ofdev = to_platform_device(dev);
 	return sprintf(buf, "%s\n", ofdev->dev.of_node->full_name);
 }
+static DEVICE_ATTR_RO(devspec);
 
 static ssize_t name_show(struct device *dev,
 				struct device_attribute *attr, char *buf)
@@ -406,19 +407,22 @@ static ssize_t name_show(struct device *dev,
 	ofdev = to_platform_device(dev);
 	return sprintf(buf, "%s\n", ofdev->dev.of_node->name);
 }
+static DEVICE_ATTR_RO(name);
 
 static ssize_t modalias_show(struct device *dev,
 				struct device_attribute *attr, char *buf)
 {
 	return of_device_modalias(dev, buf, PAGE_SIZE);
 }
+static DEVICE_ATTR_RO(modalias);
 
-static struct device_attribute ibmebus_bus_device_attrs[] = {
-	__ATTR_RO(devspec),
-	__ATTR_RO(name),
-	__ATTR_RO(modalias),
-	__ATTR_NULL
+static struct attribute *ibmebus_bus_device_attrs[] = {
+	&dev_attr_devspec.attr,
+	&dev_attr_name.attr,
+	&dev_attr_modalias.attr,
+	NULL,
 };
+ATTRIBUTE_GROUPS(ibmebus_bus_device);
 
 struct bus_type ibmebus_bus_type = {
 	.name      = "ibmebus",
@@ -428,7 +432,7 @@ struct bus_type ibmebus_bus_type = {
 	.probe     = ibmebus_bus_device_probe,
 	.remove    = ibmebus_bus_device_remove,
 	.shutdown  = ibmebus_bus_device_shutdown,
-	.dev_attrs = ibmebus_bus_device_attrs,
+	.dev_groups = ibmebus_bus_device_groups,
 };
 EXPORT_SYMBOL(ibmebus_bus_type);
 
-- 
2.13.0

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

* [PATCH 10/16] powerpc: vio: use dev_groups and not dev_attrs for bus_type
       [not found] <20170606192221.1617-1-gregkh@linuxfoundation.org>
                   ` (2 preceding siblings ...)
  2017-06-06 19:22 ` [PATCH 09/16] powerpc: ibmebus: " Greg Kroah-Hartman
@ 2017-06-06 19:22 ` Greg Kroah-Hartman
  2017-06-06 19:30   ` Greg Kroah-Hartman
  2017-06-06 19:22 ` [PATCH 11/16] powerpc: vio_cmo: " Greg Kroah-Hartman
  4 siblings, 1 reply; 20+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-06 19:22 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, Vineet Gupta, Bart Van Assche, Robin Murphy,
	Joerg Roedel, Johan Hovold, Alexey Kardashevskiy,
	Krzysztof Kozlowski, linuxppc-dev

The dev_attrs field has long been "depreciated" and is finally being
removed, so move the driver to use the "correct" dev_groups field
instead for struct bus_type.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Johan Hovold <johan@kernel.org>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: <linuxppc-dev@lists.ozlabs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/powerpc/platforms/pseries/vio.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c
index 28b09fd797ec..fd6595598662 100644
--- a/arch/powerpc/platforms/pseries/vio.c
+++ b/arch/powerpc/platforms/pseries/vio.c
@@ -1537,6 +1537,7 @@ static ssize_t name_show(struct device *dev,
 {
 	return sprintf(buf, "%s\n", to_vio_dev(dev)->name);
 }
+static DEVICE_ATTR_RO(name);
 
 static ssize_t devspec_show(struct device *dev,
 		struct device_attribute *attr, char *buf)
@@ -1545,6 +1546,7 @@ static ssize_t devspec_show(struct device *dev,
 
 	return sprintf(buf, "%s\n", of_node_full_name(of_node));
 }
+static DEVICE_ATTR_RO(devspec);
 
 static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
 			     char *buf)
@@ -1566,6 +1568,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
 
 	return sprintf(buf, "vio:T%sS%s\n", vio_dev->type, cp);
 }
+static DEVICE_ATTR_RO(modalias);
 
 static struct device_attribute vio_dev_attrs[] = {
 	__ATTR_RO(name),
@@ -1573,6 +1576,13 @@ static struct device_attribute vio_dev_attrs[] = {
 	__ATTR_RO(modalias),
 	__ATTR_NULL
 };
+static struct attribute *vio_dev_attrs[] = {
+	&dev_attr_name.attr,
+	&dev_attr_devspec.attr,
+	&dev_attr_modalias.attr,
+	NULL,
+};
+ATTRIBUTE_GROUPS(vio_dev);
 
 void vio_unregister_device(struct vio_dev *viodev)
 {
@@ -1608,7 +1618,7 @@ static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env)
 
 struct bus_type vio_bus_type = {
 	.name = "vio",
-	.dev_attrs = vio_dev_attrs,
+	.dev_groups = vio_dev_groups,
 	.uevent = vio_hotplug,
 	.match = vio_bus_match,
 	.probe = vio_bus_probe,
-- 
2.13.0

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

* [PATCH 11/16] powerpc: vio_cmo: use dev_groups and not dev_attrs for bus_type
       [not found] <20170606192221.1617-1-gregkh@linuxfoundation.org>
                   ` (3 preceding siblings ...)
  2017-06-06 19:22 ` [PATCH 10/16] powerpc: vio: " Greg Kroah-Hartman
@ 2017-06-06 19:22 ` Greg Kroah-Hartman
  2017-06-08 13:12   ` Michael Ellerman
  4 siblings, 1 reply; 20+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-06 19:22 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, Vineet Gupta, Bart Van Assche, Robin Murphy,
	Joerg Roedel, Johan Hovold, Alexey Kardashevskiy,
	Krzysztof Kozlowski, linuxppc-dev

The dev_attrs field has long been "depreciated" and is finally being
removed, so move the driver to use the "correct" dev_groups field
instead for struct bus_type.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Johan Hovold <johan@kernel.org>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: <linuxppc-dev@lists.ozlabs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/powerpc/platforms/pseries/vio.c | 37 +++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c
index fd6595598662..176edf422867 100644
--- a/arch/powerpc/platforms/pseries/vio.c
+++ b/arch/powerpc/platforms/pseries/vio.c
@@ -948,7 +948,7 @@ static void vio_cmo_bus_init(void)
 /* sysfs device functions and data structures for CMO */
 
 #define viodev_cmo_rd_attr(name)                                        \
-static ssize_t viodev_cmo_##name##_show(struct device *dev,             \
+static ssize_t cmo_##name##_show(struct device *dev,                    \
                                         struct device_attribute *attr,  \
                                          char *buf)                     \
 {                                                                       \
@@ -962,7 +962,7 @@ static ssize_t viodev_cmo_allocs_failed_show(struct device *dev,
 	return sprintf(buf, "%d\n", atomic_read(&viodev->cmo.allocs_failed));
 }
 
-static ssize_t viodev_cmo_allocs_failed_reset(struct device *dev,
+static ssize_t cmo_allocs_failed_store(struct device *dev,
 		struct device_attribute *attr, const char *buf, size_t count)
 {
 	struct vio_dev *viodev = to_vio_dev(dev);
@@ -970,7 +970,7 @@ static ssize_t viodev_cmo_allocs_failed_reset(struct device *dev,
 	return count;
 }
 
-static ssize_t viodev_cmo_desired_set(struct device *dev,
+static ssize_t cmo_desired_store(struct device *dev,
 		struct device_attribute *attr, const char *buf, size_t count)
 {
 	struct vio_dev *viodev = to_vio_dev(dev);
@@ -993,18 +993,25 @@ static ssize_t name_show(struct device *, struct device_attribute *, char *);
 static ssize_t devspec_show(struct device *, struct device_attribute *, char *);
 static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
 			     char *buf);
-static struct device_attribute vio_cmo_dev_attrs[] = {
-	__ATTR_RO(name),
-	__ATTR_RO(devspec),
-	__ATTR_RO(modalias),
-	__ATTR(cmo_desired,       S_IWUSR|S_IRUSR|S_IWGRP|S_IRGRP|S_IROTH,
-	       viodev_cmo_desired_show, viodev_cmo_desired_set),
-	__ATTR(cmo_entitled,      S_IRUGO, viodev_cmo_entitled_show,      NULL),
-	__ATTR(cmo_allocated,     S_IRUGO, viodev_cmo_allocated_show,     NULL),
-	__ATTR(cmo_allocs_failed, S_IWUSR|S_IRUSR|S_IWGRP|S_IRGRP|S_IROTH,
-	       viodev_cmo_allocs_failed_show, viodev_cmo_allocs_failed_reset),
-	__ATTR_NULL
+static DEVICE_ATTR_RO(name);
+static DEVICE_ATTR_RO(devspec);
+static DEVICE_ATTR_RO(modalias);
+static DEVICE_ATTR_RO(cmo_entitled);
+static DEVICE_ATTR_RO(cmo_allocated);
+static DEVICE_ATTR_RW(cmo_desired);
+static DEVICE_ATTR_RW(cmo_allocs_failed);
+
+static struct attribute *vio_cmo_dev_attrs[] = {
+	&dev_attr_name.attr,
+	&dev_attr_devspec.attr,
+	&dev_attr_modalias.attr,
+	&dev_attr_cmo_entitled.attr,
+	&dev_attr_cmo_allocated.attr,
+	&dev_attr_cmo_desired.attr,
+	&dev_attr_cmo_allocs_failed.attr,
+	NULL,
 };
+ATTRIBUTE_GROUPS(vio_cmo_dev);
 
 /* sysfs bus functions and data structures for CMO */
 
@@ -1066,7 +1073,7 @@ ATTRIBUTE_GROUPS(vio_bus);
 
 static void vio_cmo_sysfs_init(void)
 {
-	vio_bus_type.dev_attrs = vio_cmo_dev_attrs;
+	vio_bus_type.dev_groups = vio_cmo_dev_groups;
 	vio_bus_type.bus_groups = vio_bus_groups;
 }
 #else /* CONFIG_PPC_SMLPAR */
-- 
2.13.0

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

* Re: [PATCH 10/16] powerpc: vio: use dev_groups and not dev_attrs for bus_type
  2017-06-06 19:22 ` [PATCH 10/16] powerpc: vio: " Greg Kroah-Hartman
@ 2017-06-06 19:30   ` Greg Kroah-Hartman
  2017-06-06 23:04     ` Benjamin Herrenschmidt
  2017-06-07  8:58     ` [PATCH 10/16 v2] " Greg Kroah-Hartman
  0 siblings, 2 replies; 20+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-06 19:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Vineet Gupta, Bart Van Assche, Robin Murphy, Joerg Roedel,
	Johan Hovold, Alexey Kardashevskiy, Krzysztof Kozlowski,
	linuxppc-dev

On Tue, Jun 06, 2017 at 09:22:15PM +0200, Greg Kroah-Hartman wrote:
> The dev_attrs field has long been "depreciated" and is finally being
> removed, so move the driver to use the "correct" dev_groups field
> instead for struct bus_type.
> 
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Vineet Gupta <vgupta@synopsys.com>
> Cc: Bart Van Assche <bart.vanassche@sandisk.com>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: Joerg Roedel <jroedel@suse.de>
> Cc: Johan Hovold <johan@kernel.org>
> Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
> Cc: Krzysztof Kozlowski <krzk@kernel.org>
> Cc: <linuxppc-dev@lists.ozlabs.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  arch/powerpc/platforms/pseries/vio.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c
> index 28b09fd797ec..fd6595598662 100644
> --- a/arch/powerpc/platforms/pseries/vio.c
> +++ b/arch/powerpc/platforms/pseries/vio.c
> @@ -1537,6 +1537,7 @@ static ssize_t name_show(struct device *dev,
>  {
>  	return sprintf(buf, "%s\n", to_vio_dev(dev)->name);
>  }
> +static DEVICE_ATTR_RO(name);
>  
>  static ssize_t devspec_show(struct device *dev,
>  		struct device_attribute *attr, char *buf)
> @@ -1545,6 +1546,7 @@ static ssize_t devspec_show(struct device *dev,
>  
>  	return sprintf(buf, "%s\n", of_node_full_name(of_node));
>  }
> +static DEVICE_ATTR_RO(devspec);
>  
>  static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
>  			     char *buf)
> @@ -1566,6 +1568,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
>  
>  	return sprintf(buf, "vio:T%sS%s\n", vio_dev->type, cp);
>  }
> +static DEVICE_ATTR_RO(modalias);
>  
>  static struct device_attribute vio_dev_attrs[] = {
>  	__ATTR_RO(name),
> @@ -1573,6 +1576,13 @@ static struct device_attribute vio_dev_attrs[] = {
>  	__ATTR_RO(modalias),
>  	__ATTR_NULL
>  };
> +static struct attribute *vio_dev_attrs[] = {

Hm, this feels wrong, odd that 0-day passed it.  I should be deleting
the above vio_dev_attrs field as well.  Is powerpc really a dead
platform?  :)

thanks,

greg k-h

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

* Re: [PATCH 08/16] powerpc: ps3: use dev_groups and not dev_attrs for bus_type
  2017-06-06 19:22 ` [PATCH 08/16] powerpc: ps3: " Greg Kroah-Hartman
@ 2017-06-06 21:33   ` Geoff Levand
  2017-06-07 10:17   ` Greg Kroah-Hartman
  1 sibling, 0 replies; 20+ messages in thread
From: Geoff Levand @ 2017-06-06 21:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	linuxppc-dev

On 06/06/2017 12:22 PM, Greg Kroah-Hartman wrote:
> The dev_attrs field has long been "depreciated" and is finally being
> removed, so move the driver to use the "correct" dev_groups field
> instead for struct bus_type.

>  arch/powerpc/platforms/ps3/system-bus.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)

Seems OK.

-Geoff

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

* Re: [PATCH 10/16] powerpc: vio: use dev_groups and not dev_attrs for bus_type
  2017-06-06 19:30   ` Greg Kroah-Hartman
@ 2017-06-06 23:04     ` Benjamin Herrenschmidt
  2017-06-07  5:45       ` Greg Kroah-Hartman
  2017-06-07  8:58     ` [PATCH 10/16 v2] " Greg Kroah-Hartman
  1 sibling, 1 reply; 20+ messages in thread
From: Benjamin Herrenschmidt @ 2017-06-06 23:04 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: Paul Mackerras, Michael Ellerman, Vineet Gupta, Bart Van Assche,
	Robin Murphy, Joerg Roedel, Johan Hovold, Alexey Kardashevskiy,
	Krzysztof Kozlowski, linuxppc-dev

On Tue, 2017-06-06 at 21:30 +0200, Greg Kroah-Hartman wrote:
> >   
> >   static struct device_attribute vio_dev_attrs[] = {
> >        __ATTR_RO(name),
> > @@ -1573,6 +1576,13 @@ static struct device_attribute vio_dev_attrs[] = {
> >        __ATTR_RO(modalias),
> >        __ATTR_NULL
> >   };
> > +static struct attribute *vio_dev_attrs[] = {
> 
> Hm, this feels wrong, odd that 0-day passed it.  I should be deleting
> the above vio_dev_attrs field as well.  Is powerpc really a dead
> platform?  :)

Haha, not yet no, and the above is actually still quite actively
in use as it's part of our hypervisor virtual IO infrastructure.

Cheers,
Ben.

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

* Re: [PATCH 10/16] powerpc: vio: use dev_groups and not dev_attrs for bus_type
  2017-06-06 23:04     ` Benjamin Herrenschmidt
@ 2017-06-07  5:45       ` Greg Kroah-Hartman
  2017-06-07  5:56         ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 20+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-07  5:45 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: linux-kernel, Paul Mackerras, Michael Ellerman, Vineet Gupta,
	Bart Van Assche, Robin Murphy, Joerg Roedel, Johan Hovold,
	Alexey Kardashevskiy, Krzysztof Kozlowski, linuxppc-dev

On Wed, Jun 07, 2017 at 09:04:41AM +1000, Benjamin Herrenschmidt wrote:
> On Tue, 2017-06-06 at 21:30 +0200, Greg Kroah-Hartman wrote:
> > >   
> > >   static struct device_attribute vio_dev_attrs[] = {
> > >        __ATTR_RO(name),
> > > @@ -1573,6 +1576,13 @@ static struct device_attribute vio_dev_attrs[] = {
> > >        __ATTR_RO(modalias),
> > >        __ATTR_NULL
> > >   };
> > > +static struct attribute *vio_dev_attrs[] = {
> > 
> > Hm, this feels wrong, odd that 0-day passed it.  I should be deleting
> > the above vio_dev_attrs field as well.  Is powerpc really a dead
> > platform?  :)
> 
> Haha, not yet no, and the above is actually still quite actively
> in use as it's part of our hypervisor virtual IO infrastructure.

Ok, let me fix this, right after I emailed 0-day sent me the build error :)

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

* Re: [PATCH 10/16] powerpc: vio: use dev_groups and not dev_attrs for bus_type
  2017-06-07  5:45       ` Greg Kroah-Hartman
@ 2017-06-07  5:56         ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 20+ messages in thread
From: Benjamin Herrenschmidt @ 2017-06-07  5:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Paul Mackerras, Michael Ellerman, Vineet Gupta,
	Bart Van Assche, Robin Murphy, Joerg Roedel, Johan Hovold,
	Alexey Kardashevskiy, Krzysztof Kozlowski, linuxppc-dev

On Wed, 2017-06-07 at 07:45 +0200, Greg Kroah-Hartman wrote:
> On Wed, Jun 07, 2017 at 09:04:41AM +1000, Benjamin Herrenschmidt wrote:
> > On Tue, 2017-06-06 at 21:30 +0200, Greg Kroah-Hartman wrote:
> > > >   
> > > >   static struct device_attribute vio_dev_attrs[] = {
> > > >        __ATTR_RO(name),
> > > > @@ -1573,6 +1576,13 @@ static struct device_attribute vio_dev_attrs[] = {
> > > >        __ATTR_RO(modalias),
> > > >        __ATTR_NULL
> > > >   };
> > > > +static struct attribute *vio_dev_attrs[] = {
> > > 
> > > Hm, this feels wrong, odd that 0-day passed it.  I should be deleting
> > > the above vio_dev_attrs field as well.  Is powerpc really a dead
> > > platform?  :)
> > 
> > Haha, not yet no, and the above is actually still quite actively
> > in use as it's part of our hypervisor virtual IO infrastructure.
> 
> Ok, let me fix this, right after I emailed 0-day sent me the build error :)

Thanks !

Cheers,
Ben.

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

* [PATCH 10/16 v2] powerpc: vio: use dev_groups and not dev_attrs for bus_type
  2017-06-06 19:30   ` Greg Kroah-Hartman
  2017-06-06 23:04     ` Benjamin Herrenschmidt
@ 2017-06-07  8:58     ` Greg Kroah-Hartman
  1 sibling, 0 replies; 20+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-07  8:58 UTC (permalink / raw)
  To: linux-kernel
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Vineet Gupta, Bart Van Assche, Robin Murphy, Joerg Roedel,
	Johan Hovold, Alexey Kardashevskiy, Krzysztof Kozlowski,
	linuxppc-dev

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

The dev_attrs field has long been "depreciated" and is finally being
removed, so move the driver to use the "correct" dev_groups field
instead for struct bus_type.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Johan Hovold <johan@kernel.org>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: <linuxppc-dev@lists.ozlabs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---

v2 - actually remove the old attribute list

 arch/powerpc/platforms/pseries/vio.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c
index 28b09fd797ec..b4f679e3ca3a 100644
--- a/arch/powerpc/platforms/pseries/vio.c
+++ b/arch/powerpc/platforms/pseries/vio.c
@@ -1537,6 +1537,7 @@ static ssize_t name_show(struct device *dev,
 {
 	return sprintf(buf, "%s\n", to_vio_dev(dev)->name);
 }
+static DEVICE_ATTR_RO(name);
 
 static ssize_t devspec_show(struct device *dev,
 		struct device_attribute *attr, char *buf)
@@ -1545,6 +1546,7 @@ static ssize_t devspec_show(struct device *dev,
 
 	return sprintf(buf, "%s\n", of_node_full_name(of_node));
 }
+static DEVICE_ATTR_RO(devspec);
 
 static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
 			     char *buf)
@@ -1566,13 +1568,15 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
 
 	return sprintf(buf, "vio:T%sS%s\n", vio_dev->type, cp);
 }
+static DEVICE_ATTR_RO(modalias);
 
-static struct device_attribute vio_dev_attrs[] = {
-	__ATTR_RO(name),
-	__ATTR_RO(devspec),
-	__ATTR_RO(modalias),
-	__ATTR_NULL
+static struct attribute *vio_dev_attrs[] = {
+	&dev_attr_name.attr,
+	&dev_attr_devspec.attr,
+	&dev_attr_modalias.attr,
+	NULL,
 };
+ATTRIBUTE_GROUPS(vio_dev);
 
 void vio_unregister_device(struct vio_dev *viodev)
 {
@@ -1608,7 +1612,7 @@ static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env)
 
 struct bus_type vio_bus_type = {
 	.name = "vio",
-	.dev_attrs = vio_dev_attrs,
+	.dev_groups = vio_dev_groups,
 	.uevent = vio_hotplug,
 	.match = vio_bus_match,
 	.probe = vio_bus_probe,
-- 
2.13.0

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

* Re: [PATCH 08/16] powerpc: ps3: use dev_groups and not dev_attrs for bus_type
  2017-06-06 19:22 ` [PATCH 08/16] powerpc: ps3: " Greg Kroah-Hartman
  2017-06-06 21:33   ` Geoff Levand
@ 2017-06-07 10:17   ` Greg Kroah-Hartman
  1 sibling, 0 replies; 20+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-07 10:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Geoff Levand, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, linuxppc-dev

On Tue, Jun 06, 2017 at 09:22:13PM +0200, Greg Kroah-Hartman wrote:
> The dev_attrs field has long been "depreciated" and is finally being
> removed, so move the driver to use the "correct" dev_groups field
> instead for struct bus_type.
> 
> Cc: Geoff Levand <geoff@infradead.org>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: <linuxppc-dev@lists.ozlabs.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  arch/powerpc/platforms/ps3/system-bus.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
> index 2d2e5f80a3d3..3e98b4ea3df9 100644
> --- a/arch/powerpc/platforms/ps3/system-bus.c
> +++ b/arch/powerpc/platforms/ps3/system-bus.c
> @@ -471,11 +471,13 @@ static ssize_t modalias_show(struct device *_dev, struct device_attribute *a,
>  
>  	return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
>  }
> +static DEVICE_ATTR_RO(modalias);
>  
> -static struct device_attribute ps3_system_bus_dev_attrs[] = {
> -	__ATTR_RO(modalias),
> -	__ATTR_NULL,
> +static struct attribute *ps3_system_bus_dev_attrs[] = {
> +	&dev_attr_modalias.attr,
> +	NULL,
>  };
> +ATTRIBUTE_GROUPS(ps3_system_bus);

This should be:
ATTRIBUTE_GROUPS(ps3_system_bus_dev);

I've fixed it up and am now running it through 0-day.

thanks,

greg k-h

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

* Re: [PATCH 11/16] powerpc: vio_cmo: use dev_groups and not dev_attrs for bus_type
  2017-06-06 19:22 ` [PATCH 11/16] powerpc: vio_cmo: " Greg Kroah-Hartman
@ 2017-06-08 13:12   ` Michael Ellerman
  2017-06-08 13:39     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 20+ messages in thread
From: Michael Ellerman @ 2017-06-08 13:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: Greg Kroah-Hartman, Benjamin Herrenschmidt, Paul Mackerras,
	Vineet Gupta, Bart Van Assche, Robin Murphy, Joerg Roedel,
	Johan Hovold, Alexey Kardashevskiy, Krzysztof Kozlowski,
	linuxppc-dev

Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:

> The dev_attrs field has long been "depreciated" and is finally being
> removed, so move the driver to use the "correct" dev_groups field
> instead for struct bus_type.
>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Vineet Gupta <vgupta@synopsys.com>
> Cc: Bart Van Assche <bart.vanassche@sandisk.com>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: Joerg Roedel <jroedel@suse.de>
> Cc: Johan Hovold <johan@kernel.org>
> Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
> Cc: Krzysztof Kozlowski <krzk@kernel.org>
> Cc: <linuxppc-dev@lists.ozlabs.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  arch/powerpc/platforms/pseries/vio.c | 37 +++++++++++++++++++++---------------
>  1 file changed, 22 insertions(+), 15 deletions(-)

This one needed a bit more work to get building, the incremental diff is
below. We need a forward declaration of name, devspec and modalias,
which is a bit weird, but that's how the code is currently structured.
And there's dev and bus attributes with the same name, so that needed an
added "bus".

I booted v2 of patch 10 and this one and everything looks identical to
upstream.

Acked-by: Michael Ellerman <mpe@ellerman.id.au>

cheers


diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c
index 738196fd7e57..9d5bdb0594ed 100644
--- a/arch/powerpc/platforms/pseries/vio.c
+++ b/arch/powerpc/platforms/pseries/vio.c
@@ -955,7 +955,7 @@ static ssize_t cmo_##name##_show(struct device *dev,                    \
 	return sprintf(buf, "%lu\n", to_vio_dev(dev)->cmo.name);        \
 }
 
-static ssize_t viodev_cmo_allocs_failed_show(struct device *dev,
+static ssize_t cmo_allocs_failed_show(struct device *dev,
 		struct device_attribute *attr, char *buf)
 {
 	struct vio_dev *viodev = to_vio_dev(dev);
@@ -993,9 +993,11 @@ static ssize_t name_show(struct device *, struct device_attribute *, char *);
 static ssize_t devspec_show(struct device *, struct device_attribute *, char *);
 static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
 			     char *buf);
-static DEVICE_ATTR_RO(name);
-static DEVICE_ATTR_RO(devspec);
-static DEVICE_ATTR_RO(modalias);
+
+static struct device_attribute dev_attr_name;
+static struct device_attribute dev_attr_devspec;
+static struct device_attribute dev_attr_modalias;
+
 static DEVICE_ATTR_RO(cmo_entitled);
 static DEVICE_ATTR_RO(cmo_allocated);
 static DEVICE_ATTR_RW(cmo_desired);
@@ -1016,19 +1018,19 @@ ATTRIBUTE_GROUPS(vio_cmo_dev);
 /* sysfs bus functions and data structures for CMO */
 
 #define viobus_cmo_rd_attr(name)                                        \
-static ssize_t cmo_##name##_show(struct bus_type *bt, char *buf)        \
+static ssize_t cmo_bus_##name##_show(struct bus_type *bt, char *buf)    \
 {                                                                       \
 	return sprintf(buf, "%lu\n", vio_cmo.name);                     \
 }                                                                       \
-static BUS_ATTR_RO(cmo_##name)
+static BUS_ATTR_RO(cmo_bus_##name)
 
 #define viobus_cmo_pool_rd_attr(name, var)                              \
 static ssize_t                                                          \
-cmo_##name##_##var##_show(struct bus_type *bt, char *buf)               \
+cmo_bus_##name##_##var##_show(struct bus_type *bt, char *buf)           \
 {                                                                       \
 	return sprintf(buf, "%lu\n", vio_cmo.name.var);                 \
 }                                                                       \
-static BUS_ATTR_RO(cmo_##name##_##var)
+static BUS_ATTR_RO(cmo_bus_##name##_##var)
 
 viobus_cmo_rd_attr(entitled);
 viobus_cmo_rd_attr(spare);
@@ -1039,12 +1041,12 @@ viobus_cmo_pool_rd_attr(reserve, size);
 viobus_cmo_pool_rd_attr(excess, size);
 viobus_cmo_pool_rd_attr(excess, free);
 
-static ssize_t cmo_high_show(struct bus_type *bt, char *buf)
+static ssize_t cmo_bus_high_show(struct bus_type *bt, char *buf)
 {
 	return sprintf(buf, "%lu\n", vio_cmo.high);
 }
 
-static ssize_t cmo_high_store(struct bus_type *bt, const char *buf,
+static ssize_t cmo_bus_high_store(struct bus_type *bt, const char *buf,
 			      size_t count)
 {
 	unsigned long flags;
@@ -1055,18 +1057,18 @@ static ssize_t cmo_high_store(struct bus_type *bt, const char *buf,
 
 	return count;
 }
-static BUS_ATTR_RW(cmo_high);
+static BUS_ATTR_RW(cmo_bus_high);
 
 static struct attribute *vio_bus_attrs[] = {
-	&bus_attr_cmo_entitled.attr,
-	&bus_attr_cmo_spare.attr,
-	&bus_attr_cmo_min.attr,
-	&bus_attr_cmo_desired.attr,
-	&bus_attr_cmo_curr.attr,
-	&bus_attr_cmo_high.attr,
-	&bus_attr_cmo_reserve_size.attr,
-	&bus_attr_cmo_excess_size.attr,
-	&bus_attr_cmo_excess_free.attr,
+	&bus_attr_cmo_bus_entitled.attr,
+	&bus_attr_cmo_bus_spare.attr,
+	&bus_attr_cmo_bus_min.attr,
+	&bus_attr_cmo_bus_desired.attr,
+	&bus_attr_cmo_bus_curr.attr,
+	&bus_attr_cmo_bus_high.attr,
+	&bus_attr_cmo_bus_reserve_size.attr,
+	&bus_attr_cmo_bus_excess_size.attr,
+	&bus_attr_cmo_bus_excess_free.attr,
 	NULL,
 };
 ATTRIBUTE_GROUPS(vio_bus);

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

* Re: [PATCH 11/16] powerpc: vio_cmo: use dev_groups and not dev_attrs for bus_type
  2017-06-08 13:12   ` Michael Ellerman
@ 2017-06-08 13:39     ` Greg Kroah-Hartman
  2017-06-08 22:53       ` Michael Ellerman
  0 siblings, 1 reply; 20+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-08 13:39 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linux-kernel, Benjamin Herrenschmidt, Paul Mackerras,
	Vineet Gupta, Bart Van Assche, Robin Murphy, Joerg Roedel,
	Johan Hovold, Alexey Kardashevskiy, Krzysztof Kozlowski,
	linuxppc-dev

On Thu, Jun 08, 2017 at 11:12:10PM +1000, Michael Ellerman wrote:
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
> 
> > The dev_attrs field has long been "depreciated" and is finally being
> > removed, so move the driver to use the "correct" dev_groups field
> > instead for struct bus_type.
> >
> > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > Cc: Paul Mackerras <paulus@samba.org>
> > Cc: Michael Ellerman <mpe@ellerman.id.au>
> > Cc: Vineet Gupta <vgupta@synopsys.com>
> > Cc: Bart Van Assche <bart.vanassche@sandisk.com>
> > Cc: Robin Murphy <robin.murphy@arm.com>
> > Cc: Joerg Roedel <jroedel@suse.de>
> > Cc: Johan Hovold <johan@kernel.org>
> > Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
> > Cc: Krzysztof Kozlowski <krzk@kernel.org>
> > Cc: <linuxppc-dev@lists.ozlabs.org>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> >  arch/powerpc/platforms/pseries/vio.c | 37 +++++++++++++++++++++---------------
> >  1 file changed, 22 insertions(+), 15 deletions(-)
> 
> This one needed a bit more work to get building, the incremental diff is
> below. We need a forward declaration of name, devspec and modalias,
> which is a bit weird, but that's how the code is currently structured.
> And there's dev and bus attributes with the same name, so that needed an
> added "bus".
> 
> I booted v2 of patch 10 and this one and everything looks identical to
> upstream.

Ah, many thanks, this was on my todo list to fix up today.

But you renamed the sysfs files when you added "bus" to the function
names, are you sure you want to do that?  I don't mind, but if you
happen to have userspace tools that look at those files, they just broke
:(

thanks,

greg k-h

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

* Re: [PATCH 11/16] powerpc: vio_cmo: use dev_groups and not dev_attrs for bus_type
  2017-06-08 13:39     ` Greg Kroah-Hartman
@ 2017-06-08 22:53       ` Michael Ellerman
  2017-06-09  5:44         ` Greg Kroah-Hartman
  0 siblings, 1 reply; 20+ messages in thread
From: Michael Ellerman @ 2017-06-08 22:53 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Benjamin Herrenschmidt, Paul Mackerras,
	Vineet Gupta, Bart Van Assche, Robin Murphy, Joerg Roedel,
	Johan Hovold, Alexey Kardashevskiy, Krzysztof Kozlowski,
	linuxppc-dev

Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:

> On Thu, Jun 08, 2017 at 11:12:10PM +1000, Michael Ellerman wrote:
>> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
>> 
>> > The dev_attrs field has long been "depreciated" and is finally being
>> > removed, so move the driver to use the "correct" dev_groups field
>> > instead for struct bus_type.
>> >
>> > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> > Cc: Paul Mackerras <paulus@samba.org>
>> > Cc: Michael Ellerman <mpe@ellerman.id.au>
>> > Cc: Vineet Gupta <vgupta@synopsys.com>
>> > Cc: Bart Van Assche <bart.vanassche@sandisk.com>
>> > Cc: Robin Murphy <robin.murphy@arm.com>
>> > Cc: Joerg Roedel <jroedel@suse.de>
>> > Cc: Johan Hovold <johan@kernel.org>
>> > Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
>> > Cc: Krzysztof Kozlowski <krzk@kernel.org>
>> > Cc: <linuxppc-dev@lists.ozlabs.org>
>> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> > ---
>> >  arch/powerpc/platforms/pseries/vio.c | 37 +++++++++++++++++++++---------------
>> >  1 file changed, 22 insertions(+), 15 deletions(-)
>> 
>> This one needed a bit more work to get building, the incremental diff is
>> below. We need a forward declaration of name, devspec and modalias,
>> which is a bit weird, but that's how the code is currently structured.
>> And there's dev and bus attributes with the same name, so that needed an
>> added "bus".
>> 
>> I booted v2 of patch 10 and this one and everything looks identical to
>> upstream.
>
> Ah, many thanks, this was on my todo list to fix up today.
>
> But you renamed the sysfs files when you added "bus" to the function
> names, are you sure you want to do that?  I don't mind, but if you
> happen to have userspace tools that look at those files, they just broke
> :(

Ugh crap, no that won't work.

I didn't see it when I tested because my machine doesn't have the CMO
feature enabled.

I guess we have to open code some of the BUS_ATTR_RO() etc. so we can
avoid the name clash.

I'll try and get it fixed later today.

cheers

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

* Re: [PATCH 11/16] powerpc: vio_cmo: use dev_groups and not dev_attrs for bus_type
  2017-06-08 22:53       ` Michael Ellerman
@ 2017-06-09  5:44         ` Greg Kroah-Hartman
  2017-06-09 11:23           ` Michael Ellerman
  0 siblings, 1 reply; 20+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-09  5:44 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linux-kernel, Benjamin Herrenschmidt, Paul Mackerras,
	Vineet Gupta, Bart Van Assche, Robin Murphy, Joerg Roedel,
	Johan Hovold, Alexey Kardashevskiy, Krzysztof Kozlowski,
	linuxppc-dev

On Fri, Jun 09, 2017 at 08:53:22AM +1000, Michael Ellerman wrote:
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
> 
> > On Thu, Jun 08, 2017 at 11:12:10PM +1000, Michael Ellerman wrote:
> >> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
> >> 
> >> > The dev_attrs field has long been "depreciated" and is finally being
> >> > removed, so move the driver to use the "correct" dev_groups field
> >> > instead for struct bus_type.
> >> >
> >> > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> >> > Cc: Paul Mackerras <paulus@samba.org>
> >> > Cc: Michael Ellerman <mpe@ellerman.id.au>
> >> > Cc: Vineet Gupta <vgupta@synopsys.com>
> >> > Cc: Bart Van Assche <bart.vanassche@sandisk.com>
> >> > Cc: Robin Murphy <robin.murphy@arm.com>
> >> > Cc: Joerg Roedel <jroedel@suse.de>
> >> > Cc: Johan Hovold <johan@kernel.org>
> >> > Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
> >> > Cc: Krzysztof Kozlowski <krzk@kernel.org>
> >> > Cc: <linuxppc-dev@lists.ozlabs.org>
> >> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >> > ---
> >> >  arch/powerpc/platforms/pseries/vio.c | 37 +++++++++++++++++++++---------------
> >> >  1 file changed, 22 insertions(+), 15 deletions(-)
> >> 
> >> This one needed a bit more work to get building, the incremental diff is
> >> below. We need a forward declaration of name, devspec and modalias,
> >> which is a bit weird, but that's how the code is currently structured.
> >> And there's dev and bus attributes with the same name, so that needed an
> >> added "bus".
> >> 
> >> I booted v2 of patch 10 and this one and everything looks identical to
> >> upstream.
> >
> > Ah, many thanks, this was on my todo list to fix up today.
> >
> > But you renamed the sysfs files when you added "bus" to the function
> > names, are you sure you want to do that?  I don't mind, but if you
> > happen to have userspace tools that look at those files, they just broke
> > :(
> 
> Ugh crap, no that won't work.
> 
> I didn't see it when I tested because my machine doesn't have the CMO
> feature enabled.
> 
> I guess we have to open code some of the BUS_ATTR_RO() etc. so we can
> avoid the name clash.

Or split it into multiple files, I've solved this that way in the past.
You shouldn't have to "open code" BUS_ATTR_RO().

thanks,

greg k-h

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

* Re: [PATCH 11/16] powerpc: vio_cmo: use dev_groups and not dev_attrs for bus_type
  2017-06-09  5:44         ` Greg Kroah-Hartman
@ 2017-06-09 11:23           ` Michael Ellerman
  2017-06-10 12:48             ` Greg Kroah-Hartman
  2017-06-12  6:58             ` Greg Kroah-Hartman
  0 siblings, 2 replies; 20+ messages in thread
From: Michael Ellerman @ 2017-06-09 11:23 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Benjamin Herrenschmidt, Paul Mackerras,
	Vineet Gupta, Bart Van Assche, Robin Murphy, Joerg Roedel,
	Johan Hovold, Alexey Kardashevskiy, Krzysztof Kozlowski,
	linuxppc-dev

Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:

> On Fri, Jun 09, 2017 at 08:53:22AM +1000, Michael Ellerman wrote:
>> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
>> 
>> > On Thu, Jun 08, 2017 at 11:12:10PM +1000, Michael Ellerman wrote:
>> >> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
>> >> 
>> >> > The dev_attrs field has long been "depreciated" and is finally being
>> >> > removed, so move the driver to use the "correct" dev_groups field
>> >> > instead for struct bus_type.
>> >> >
>> >> > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> >> > Cc: Paul Mackerras <paulus@samba.org>
>> >> > Cc: Michael Ellerman <mpe@ellerman.id.au>
>> >> > Cc: Vineet Gupta <vgupta@synopsys.com>
>> >> > Cc: Bart Van Assche <bart.vanassche@sandisk.com>
>> >> > Cc: Robin Murphy <robin.murphy@arm.com>
>> >> > Cc: Joerg Roedel <jroedel@suse.de>
>> >> > Cc: Johan Hovold <johan@kernel.org>
>> >> > Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
>> >> > Cc: Krzysztof Kozlowski <krzk@kernel.org>
>> >> > Cc: <linuxppc-dev@lists.ozlabs.org>
>> >> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> >> > ---
>> >> >  arch/powerpc/platforms/pseries/vio.c | 37 +++++++++++++++++++++---------------
>> >> >  1 file changed, 22 insertions(+), 15 deletions(-)
>> >> 
>> >> This one needed a bit more work to get building, the incremental diff is
>> >> below. We need a forward declaration of name, devspec and modalias,
>> >> which is a bit weird, but that's how the code is currently structured.
>> >> And there's dev and bus attributes with the same name, so that needed an
>> >> added "bus".
>> >> 
>> >> I booted v2 of patch 10 and this one and everything looks identical to
>> >> upstream.
>> >
>> > Ah, many thanks, this was on my todo list to fix up today.
>> >
>> > But you renamed the sysfs files when you added "bus" to the function
>> > names, are you sure you want to do that?  I don't mind, but if you
>> > happen to have userspace tools that look at those files, they just broke
>> > :(
>> 
>> Ugh crap, no that won't work.
>> 
>> I didn't see it when I tested because my machine doesn't have the CMO
>> feature enabled.
>> 
>> I guess we have to open code some of the BUS_ATTR_RO() etc. so we can
>> avoid the name clash.
>
> Or split it into multiple files, I've solved this that way in the past.
> You shouldn't have to "open code" BUS_ATTR_RO().

It just requires one use of __ATTR(), which seems simpler than splitting
the file in two.

Here's a new incremental diff against your patch.

I confirmed none of the cmo names changed, result after is:

./devices/vio/cmo_desired
./devices/vio/cmo_allocated
./devices/vio/cmo_entitled
./devices/vio/cmo_allocs_failed
./devices/vio/71000000/cmo_desired
./devices/vio/71000000/cmo_allocated
./devices/vio/71000000/cmo_entitled
./devices/vio/71000000/cmo_allocs_failed
./devices/vio/30000000/cmo_desired
./devices/vio/30000000/cmo_allocated
./devices/vio/30000000/cmo_entitled
./devices/vio/30000000/cmo_allocs_failed
./devices/vio/2000/cmo_desired
./devices/vio/2000/cmo_allocated
./devices/vio/2000/cmo_entitled
./devices/vio/2000/cmo_allocs_failed
./bus/vio/cmo_high
./bus/vio/cmo_spare
./bus/vio/cmo_reserve_size
./bus/vio/cmo_desired
./bus/vio/cmo_entitled
./bus/vio/cmo_excess_free
./bus/vio/cmo_excess_size
./bus/vio/cmo_min
./bus/vio/cmo_curr


cheers


diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c
index 738196fd7e57..117beb9e8786 100644
--- a/arch/powerpc/platforms/pseries/vio.c
+++ b/arch/powerpc/platforms/pseries/vio.c
@@ -955,7 +955,7 @@ static ssize_t cmo_##name##_show(struct device *dev,                    \
 	return sprintf(buf, "%lu\n", to_vio_dev(dev)->cmo.name);        \
 }
 
-static ssize_t viodev_cmo_allocs_failed_show(struct device *dev,
+static ssize_t cmo_allocs_failed_show(struct device *dev,
 		struct device_attribute *attr, char *buf)
 {
 	struct vio_dev *viodev = to_vio_dev(dev);
@@ -993,9 +993,11 @@ static ssize_t name_show(struct device *, struct device_attribute *, char *);
 static ssize_t devspec_show(struct device *, struct device_attribute *, char *);
 static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
 			     char *buf);
-static DEVICE_ATTR_RO(name);
-static DEVICE_ATTR_RO(devspec);
-static DEVICE_ATTR_RO(modalias);
+
+static struct device_attribute dev_attr_name;
+static struct device_attribute dev_attr_devspec;
+static struct device_attribute dev_attr_modalias;
+
 static DEVICE_ATTR_RO(cmo_entitled);
 static DEVICE_ATTR_RO(cmo_allocated);
 static DEVICE_ATTR_RW(cmo_desired);
@@ -1016,11 +1018,12 @@ ATTRIBUTE_GROUPS(vio_cmo_dev);
 /* sysfs bus functions and data structures for CMO */
 
 #define viobus_cmo_rd_attr(name)                                        \
-static ssize_t cmo_##name##_show(struct bus_type *bt, char *buf)        \
+static ssize_t cmo_bus_##name##_show(struct bus_type *bt, char *buf)    \
 {                                                                       \
 	return sprintf(buf, "%lu\n", vio_cmo.name);                     \
 }                                                                       \
-static BUS_ATTR_RO(cmo_##name)
+static struct bus_attribute bus_attr_cmo_bus_##name =			\
+	__ATTR(cmo_##name, S_IRUGO, cmo_bus_##name##_show, NULL)
 
 #define viobus_cmo_pool_rd_attr(name, var)                              \
 static ssize_t                                                          \
@@ -1058,11 +1061,11 @@ static ssize_t cmo_high_store(struct bus_type *bt, const char *buf,
 static BUS_ATTR_RW(cmo_high);
 
 static struct attribute *vio_bus_attrs[] = {
-	&bus_attr_cmo_entitled.attr,
-	&bus_attr_cmo_spare.attr,
-	&bus_attr_cmo_min.attr,
-	&bus_attr_cmo_desired.attr,
-	&bus_attr_cmo_curr.attr,
+	&bus_attr_cmo_bus_entitled.attr,
+	&bus_attr_cmo_bus_spare.attr,
+	&bus_attr_cmo_bus_min.attr,
+	&bus_attr_cmo_bus_desired.attr,
+	&bus_attr_cmo_bus_curr.attr,
 	&bus_attr_cmo_high.attr,
 	&bus_attr_cmo_reserve_size.attr,
 	&bus_attr_cmo_excess_size.attr,

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

* Re: [PATCH 11/16] powerpc: vio_cmo: use dev_groups and not dev_attrs for bus_type
  2017-06-09 11:23           ` Michael Ellerman
@ 2017-06-10 12:48             ` Greg Kroah-Hartman
  2017-06-12  6:58             ` Greg Kroah-Hartman
  1 sibling, 0 replies; 20+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-10 12:48 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linux-kernel, Benjamin Herrenschmidt, Paul Mackerras,
	Vineet Gupta, Bart Van Assche, Robin Murphy, Joerg Roedel,
	Johan Hovold, Alexey Kardashevskiy, Krzysztof Kozlowski,
	linuxppc-dev

On Fri, Jun 09, 2017 at 09:23:10PM +1000, Michael Ellerman wrote:
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
> 
> > On Fri, Jun 09, 2017 at 08:53:22AM +1000, Michael Ellerman wrote:
> >> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
> >> 
> >> > On Thu, Jun 08, 2017 at 11:12:10PM +1000, Michael Ellerman wrote:
> >> >> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
> >> >> 
> >> >> > The dev_attrs field has long been "depreciated" and is finally being
> >> >> > removed, so move the driver to use the "correct" dev_groups field
> >> >> > instead for struct bus_type.
> >> >> >
> >> >> > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> >> >> > Cc: Paul Mackerras <paulus@samba.org>
> >> >> > Cc: Michael Ellerman <mpe@ellerman.id.au>
> >> >> > Cc: Vineet Gupta <vgupta@synopsys.com>
> >> >> > Cc: Bart Van Assche <bart.vanassche@sandisk.com>
> >> >> > Cc: Robin Murphy <robin.murphy@arm.com>
> >> >> > Cc: Joerg Roedel <jroedel@suse.de>
> >> >> > Cc: Johan Hovold <johan@kernel.org>
> >> >> > Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
> >> >> > Cc: Krzysztof Kozlowski <krzk@kernel.org>
> >> >> > Cc: <linuxppc-dev@lists.ozlabs.org>
> >> >> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >> >> > ---
> >> >> >  arch/powerpc/platforms/pseries/vio.c | 37 +++++++++++++++++++++---------------
> >> >> >  1 file changed, 22 insertions(+), 15 deletions(-)
> >> >> 
> >> >> This one needed a bit more work to get building, the incremental diff is
> >> >> below. We need a forward declaration of name, devspec and modalias,
> >> >> which is a bit weird, but that's how the code is currently structured.
> >> >> And there's dev and bus attributes with the same name, so that needed an
> >> >> added "bus".
> >> >> 
> >> >> I booted v2 of patch 10 and this one and everything looks identical to
> >> >> upstream.
> >> >
> >> > Ah, many thanks, this was on my todo list to fix up today.
> >> >
> >> > But you renamed the sysfs files when you added "bus" to the function
> >> > names, are you sure you want to do that?  I don't mind, but if you
> >> > happen to have userspace tools that look at those files, they just broke
> >> > :(
> >> 
> >> Ugh crap, no that won't work.
> >> 
> >> I didn't see it when I tested because my machine doesn't have the CMO
> >> feature enabled.
> >> 
> >> I guess we have to open code some of the BUS_ATTR_RO() etc. so we can
> >> avoid the name clash.
> >
> > Or split it into multiple files, I've solved this that way in the past.
> > You shouldn't have to "open code" BUS_ATTR_RO().
> 
> It just requires one use of __ATTR(), which seems simpler than splitting
> the file in two.

Ah, yes, nice work, thanks.  If you wanted to be really "tricky", you
could just use __ATTR_RO() there, but I'll leave it as-is :)

Let's see what 0-day says about this version.

Many thanks for working on this, much appreciated.

greg k-h

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

* Re: [PATCH 11/16] powerpc: vio_cmo: use dev_groups and not dev_attrs for bus_type
  2017-06-09 11:23           ` Michael Ellerman
  2017-06-10 12:48             ` Greg Kroah-Hartman
@ 2017-06-12  6:58             ` Greg Kroah-Hartman
  2017-06-13 10:09               ` Michael Ellerman
  1 sibling, 1 reply; 20+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-12  6:58 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linux-kernel, Benjamin Herrenschmidt, Paul Mackerras,
	Vineet Gupta, Bart Van Assche, Robin Murphy, Joerg Roedel,
	Johan Hovold, Alexey Kardashevskiy, Krzysztof Kozlowski,
	linuxppc-dev

On Fri, Jun 09, 2017 at 09:23:10PM +1000, Michael Ellerman wrote:
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
> 
> > On Fri, Jun 09, 2017 at 08:53:22AM +1000, Michael Ellerman wrote:
> >> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
> >> 
> >> > On Thu, Jun 08, 2017 at 11:12:10PM +1000, Michael Ellerman wrote:
> >> >> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
> >> >> 
> >> >> > The dev_attrs field has long been "depreciated" and is finally being
> >> >> > removed, so move the driver to use the "correct" dev_groups field
> >> >> > instead for struct bus_type.
> >> >> >
> >> >> > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> >> >> > Cc: Paul Mackerras <paulus@samba.org>
> >> >> > Cc: Michael Ellerman <mpe@ellerman.id.au>
> >> >> > Cc: Vineet Gupta <vgupta@synopsys.com>
> >> >> > Cc: Bart Van Assche <bart.vanassche@sandisk.com>
> >> >> > Cc: Robin Murphy <robin.murphy@arm.com>
> >> >> > Cc: Joerg Roedel <jroedel@suse.de>
> >> >> > Cc: Johan Hovold <johan@kernel.org>
> >> >> > Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
> >> >> > Cc: Krzysztof Kozlowski <krzk@kernel.org>
> >> >> > Cc: <linuxppc-dev@lists.ozlabs.org>
> >> >> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >> >> > ---
> >> >> >  arch/powerpc/platforms/pseries/vio.c | 37 +++++++++++++++++++++---------------
> >> >> >  1 file changed, 22 insertions(+), 15 deletions(-)
> >> >> 
> >> >> This one needed a bit more work to get building, the incremental diff is
> >> >> below. We need a forward declaration of name, devspec and modalias,
> >> >> which is a bit weird, but that's how the code is currently structured.
> >> >> And there's dev and bus attributes with the same name, so that needed an
> >> >> added "bus".
> >> >> 
> >> >> I booted v2 of patch 10 and this one and everything looks identical to
> >> >> upstream.
> >> >
> >> > Ah, many thanks, this was on my todo list to fix up today.
> >> >
> >> > But you renamed the sysfs files when you added "bus" to the function
> >> > names, are you sure you want to do that?  I don't mind, but if you
> >> > happen to have userspace tools that look at those files, they just broke
> >> > :(
> >> 
> >> Ugh crap, no that won't work.
> >> 
> >> I didn't see it when I tested because my machine doesn't have the CMO
> >> feature enabled.
> >> 
> >> I guess we have to open code some of the BUS_ATTR_RO() etc. so we can
> >> avoid the name clash.
> >
> > Or split it into multiple files, I've solved this that way in the past.
> > You shouldn't have to "open code" BUS_ATTR_RO().
> 
> It just requires one use of __ATTR(), which seems simpler than splitting
> the file in two.
> 
> Here's a new incremental diff against your patch.
> 
> I confirmed none of the cmo names changed, result after is:
> 
> ./devices/vio/cmo_desired
> ./devices/vio/cmo_allocated
> ./devices/vio/cmo_entitled
> ./devices/vio/cmo_allocs_failed
> ./devices/vio/71000000/cmo_desired
> ./devices/vio/71000000/cmo_allocated
> ./devices/vio/71000000/cmo_entitled
> ./devices/vio/71000000/cmo_allocs_failed
> ./devices/vio/30000000/cmo_desired
> ./devices/vio/30000000/cmo_allocated
> ./devices/vio/30000000/cmo_entitled
> ./devices/vio/30000000/cmo_allocs_failed
> ./devices/vio/2000/cmo_desired
> ./devices/vio/2000/cmo_allocated
> ./devices/vio/2000/cmo_entitled
> ./devices/vio/2000/cmo_allocs_failed
> ./bus/vio/cmo_high
> ./bus/vio/cmo_spare
> ./bus/vio/cmo_reserve_size
> ./bus/vio/cmo_desired
> ./bus/vio/cmo_entitled
> ./bus/vio/cmo_excess_free
> ./bus/vio/cmo_excess_size
> ./bus/vio/cmo_min
> ./bus/vio/cmo_curr

Thanks for this, it seems to have passed all of the 0-day testing.  I'll
go apply it to my "real" tree now, thanks again for the help.

greg k-h

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

* Re: [PATCH 11/16] powerpc: vio_cmo: use dev_groups and not dev_attrs for bus_type
  2017-06-12  6:58             ` Greg Kroah-Hartman
@ 2017-06-13 10:09               ` Michael Ellerman
  0 siblings, 0 replies; 20+ messages in thread
From: Michael Ellerman @ 2017-06-13 10:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Benjamin Herrenschmidt, Paul Mackerras,
	Vineet Gupta, Bart Van Assche, Robin Murphy, Joerg Roedel,
	Johan Hovold, Alexey Kardashevskiy, Krzysztof Kozlowski,
	linuxppc-dev

Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:

> On Fri, Jun 09, 2017 at 09:23:10PM +1000, Michael Ellerman wrote:
>> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
>> 
>> > On Fri, Jun 09, 2017 at 08:53:22AM +1000, Michael Ellerman wrote:
>> >> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
>> >> 
>> >> > On Thu, Jun 08, 2017 at 11:12:10PM +1000, Michael Ellerman wrote:
>> >> >> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
>> >> >> 
>> >> >> > The dev_attrs field has long been "depreciated" and is finally being
>> >> >> > removed, so move the driver to use the "correct" dev_groups field
>> >> >> > instead for struct bus_type.
>> >> >> >
>> >> >> > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> >> >> > Cc: Paul Mackerras <paulus@samba.org>
>> >> >> > Cc: Michael Ellerman <mpe@ellerman.id.au>
>> >> >> > Cc: Vineet Gupta <vgupta@synopsys.com>
>> >> >> > Cc: Bart Van Assche <bart.vanassche@sandisk.com>
>> >> >> > Cc: Robin Murphy <robin.murphy@arm.com>
>> >> >> > Cc: Joerg Roedel <jroedel@suse.de>
>> >> >> > Cc: Johan Hovold <johan@kernel.org>
>> >> >> > Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
>> >> >> > Cc: Krzysztof Kozlowski <krzk@kernel.org>
>> >> >> > Cc: <linuxppc-dev@lists.ozlabs.org>
>> >> >> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> >> >> > ---
>> >> >> >  arch/powerpc/platforms/pseries/vio.c | 37 +++++++++++++++++++++---------------
>> >> >> >  1 file changed, 22 insertions(+), 15 deletions(-)
>> >> >> 
>> >> >> This one needed a bit more work to get building, the incremental diff is
>> >> >> below. We need a forward declaration of name, devspec and modalias,
>> >> >> which is a bit weird, but that's how the code is currently structured.
>> >> >> And there's dev and bus attributes with the same name, so that needed an
>> >> >> added "bus".
>> >> >> 
>> >> >> I booted v2 of patch 10 and this one and everything looks identical to
>> >> >> upstream.
>> >> >
>> >> > Ah, many thanks, this was on my todo list to fix up today.
>> >> >
>> >> > But you renamed the sysfs files when you added "bus" to the function
>> >> > names, are you sure you want to do that?  I don't mind, but if you
>> >> > happen to have userspace tools that look at those files, they just broke
>> >> > :(
>> >> 
>> >> Ugh crap, no that won't work.
>> >> 
>> >> I didn't see it when I tested because my machine doesn't have the CMO
>> >> feature enabled.
>> >> 
>> >> I guess we have to open code some of the BUS_ATTR_RO() etc. so we can
>> >> avoid the name clash.
>> >
>> > Or split it into multiple files, I've solved this that way in the past.
>> > You shouldn't have to "open code" BUS_ATTR_RO().
>> 
>> It just requires one use of __ATTR(), which seems simpler than splitting
>> the file in two.
>> 
>> Here's a new incremental diff against your patch.
>> 
>> I confirmed none of the cmo names changed, result after is:
>> 
>> ./devices/vio/cmo_desired
>> ./devices/vio/cmo_allocated
>> ./devices/vio/cmo_entitled
>> ./devices/vio/cmo_allocs_failed
>> ./devices/vio/71000000/cmo_desired
>> ./devices/vio/71000000/cmo_allocated
>> ./devices/vio/71000000/cmo_entitled
>> ./devices/vio/71000000/cmo_allocs_failed
>> ./devices/vio/30000000/cmo_desired
>> ./devices/vio/30000000/cmo_allocated
>> ./devices/vio/30000000/cmo_entitled
>> ./devices/vio/30000000/cmo_allocs_failed
>> ./devices/vio/2000/cmo_desired
>> ./devices/vio/2000/cmo_allocated
>> ./devices/vio/2000/cmo_entitled
>> ./devices/vio/2000/cmo_allocs_failed
>> ./bus/vio/cmo_high
>> ./bus/vio/cmo_spare
>> ./bus/vio/cmo_reserve_size
>> ./bus/vio/cmo_desired
>> ./bus/vio/cmo_entitled
>> ./bus/vio/cmo_excess_free
>> ./bus/vio/cmo_excess_size
>> ./bus/vio/cmo_min
>> ./bus/vio/cmo_curr
>
> Thanks for this, it seems to have passed all of the 0-day testing.  I'll
> go apply it to my "real" tree now, thanks again for the help.

No worries. It'll get some more build & boot testing from my CI once it's
in linux-next.

cheers

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

end of thread, other threads:[~2017-06-13 10:09 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20170606192221.1617-1-gregkh@linuxfoundation.org>
2017-06-06 19:22 ` [PATCH 07/16] macintosh: use dev_groups and not dev_attrs for bus_type Greg Kroah-Hartman
2017-06-06 19:22 ` [PATCH 08/16] powerpc: ps3: " Greg Kroah-Hartman
2017-06-06 21:33   ` Geoff Levand
2017-06-07 10:17   ` Greg Kroah-Hartman
2017-06-06 19:22 ` [PATCH 09/16] powerpc: ibmebus: " Greg Kroah-Hartman
2017-06-06 19:22 ` [PATCH 10/16] powerpc: vio: " Greg Kroah-Hartman
2017-06-06 19:30   ` Greg Kroah-Hartman
2017-06-06 23:04     ` Benjamin Herrenschmidt
2017-06-07  5:45       ` Greg Kroah-Hartman
2017-06-07  5:56         ` Benjamin Herrenschmidt
2017-06-07  8:58     ` [PATCH 10/16 v2] " Greg Kroah-Hartman
2017-06-06 19:22 ` [PATCH 11/16] powerpc: vio_cmo: " Greg Kroah-Hartman
2017-06-08 13:12   ` Michael Ellerman
2017-06-08 13:39     ` Greg Kroah-Hartman
2017-06-08 22:53       ` Michael Ellerman
2017-06-09  5:44         ` Greg Kroah-Hartman
2017-06-09 11:23           ` Michael Ellerman
2017-06-10 12:48             ` Greg Kroah-Hartman
2017-06-12  6:58             ` Greg Kroah-Hartman
2017-06-13 10:09               ` Michael Ellerman

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