Skip to contentSkip to conversation

Enable module aliases for vio on sparc/sparc64

PATCH John Paul Adrian Glaubitz 3 participants 22 messages Apr 11, 2016 – Apr 14, 2016 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

Hi Dave!

We have had issues when installing Debian's sparc64 port on SPARC machines with virtualization support. In order to be able to install Linux into an LDOM container, both the modules sunvdc and sunvnet need to be loaded to enable block device and networking support within the virtual machine.

Unfortunately, these modules are never loaded automatically despite being present and the hardware supporting it. After some discussion in Debian's bug tracker [1], Ben Hutchings, Debian's kernel maintainer, mentioned that this is a result of the VIO bus implementation on sparc/sparc64 not supporting module aliases and consequently automatic loading.

Ben has provided a minimal and dirty patch which enables aliases for vio on sparc/sparc64, but he says the better solution would be to merge VIO implementations on both sparc/sparc64 and PowerPC, the latter already supporting module aliases and auto loading.

A quick hotfix as Ben suggested would be great for the time being as it would unbreak the Debian installation within LDOMs, so I was wondering whether you could merge the patch?

Any other suggestion?

Thanks,
Adrian

Quoted 1 line

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815977#40

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

From: Ben Hutchings <[email protected]>
Date: Mon, 11 Apr 2016 00:30:34 +0100
Subject: sparc: vio: Add modalias attribute to support auto-loading drivers
Bug-Debian: https://bugs.debian.org/815977

Add a modalias attribute for vio devices, matching the syntax supported by file2alias and the PowerPC vio implementation.

---

arch/sparc/kernel/vio.c +22 -0
@@ -105,9 +105,31 @@ static ssize_t type_show(struct device *dev,
 	return sprintf(buf, "%s\n", vdev->type);
 }
 
+static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
+			     char *buf)
+{
+	const struct vio_dev *vdev = to_vio_dev(dev);
+	struct device_node *dn;
+	const char *cp;
+
+	dn = dev->of_node;
+	if (!dn) {
+		strcpy(buf, "\n");
+		return strlen(buf);
+	}
+	cp = of_get_property(dn, "compatible", NULL);
+	if (!cp) {
+		strcpy(buf, "\n");
+		return strlen(buf);
+	}
+
+	return sprintf(buf, "vio:T%sS%s\n", vdev->type, cp);
+}
+
 static struct device_attribute vio_dev_attrs[] = {
 	__ATTR_RO(devspec),
 	__ATTR_RO(type),
+	__ATTR_RO(modalias),
 	__ATTR_NULL
 };
 
maintainer
#1 lore raw

From: John Paul Adrian Glaubitz <[email protected]>
Date: Mon, 11 Apr 2016 09:30:54 +0200

Quoted 20 lines

Hi Dave!

We have had issues when installing Debian's sparc64 port on SPARC machines with virtualization support. In order to be able to install Linux into an LDOM container, both the modules sunvdc and sunvnet need to be loaded to enable block device and networking support within the virtual machine.

Unfortunately, these modules are never loaded automatically despite being present and the hardware supporting it. After some discussion in Debian's bug tracker [1], Ben Hutchings, Debian's kernel maintainer, mentioned that this is a result of the VIO bus implementation on sparc/sparc64 not supporting module aliases and consequently automatic loading.

Ben has provided a minimal and dirty patch which enables aliases for vio on sparc/sparc64, but he says the better solution would be to merge VIO implementations on both sparc/sparc64 and PowerPC, the latter already supporting module aliases and auto loading.

Quoted 5 lines

A quick hotfix as Ben suggested would be great for the time being as it would unbreak the Debian installation within LDOMs, so I was wondering whether you could merge the patch?

Any other suggestion?

Thanks for bringing this up.

Although I wonder, I was able to successfully install debian just fine a couple years ago in LDOM guest nodes without any special changes whatsoever. Were there autoload hacks placed in /etc or similar before?

Either way, I'll look at this patch, thanks.

#2 lore raw
In reply to John Paul Adrian Glaubitz

Hi!

Quoted 6 lines · David Miller

Thanks for bringing this up.

Although I wonder, I was able to successfully install debian just fine a couple years ago in LDOM guest nodes without any special changes whatsoever. Were there autoload hacks placed in /etc or similar before?

I'm not sure actually but back then you were definitely installing Debian's sparc port (32-bit userland / 64-bit kernel) which is no longer part of Debian.

We are now working on a new, full 64-bit SPARC port called "sparc64", so many things are actually built from scratch. It's therefore not unlikely that the old installer images contained some work-around to address the problem, at least initramfs-tools contains one [1] which is not used in the installer image, however, and people therefore have to load the modules manually for the installation.

Quoted 1 line

Either way, I'll look at this patch, thanks.

Great, thanks a lot!

Adrian

Quoted 1 line

[1]

http://sources.debian.net/src/initramfs-tools/0.123/hook-functions/?hlG8#L478

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
#3 lore raw
In reply to John Paul Adrian Glaubitz
Quoted 1 line · David Miller

Either way, I'll look at this patch, thanks.

Just as a heads-up:

The suggested patch does not work unfortunately. Modules are not loaded automatically and it seems modaliases are not generated properly.

It seems that the vio implementation for sparc which you adapted from powerpc uses a different name to retrieve the device nodes.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
maintainer
#4 lore raw
In reply to John Paul Adrian Glaubitz

From: John Paul Adrian Glaubitz <[email protected]>
Date: Wed, 13 Apr 2016 17:33:25 +0200

Quoted 11 lines · David Miller
Quoted 1 line

Either way, I'll look at this patch, thanks.

Just as a heads-up:

The suggested patch does not work unfortunately. Modules are not loaded automatically and it seems modaliases are not generated properly.

It seems that the vio implementation for sparc which you adapted from powerpc uses a different name to retrieve the device nodes.

The missing bit is probably having the individual sparc64 VIO drivers define proper module aliases.

#5 lore raw
In reply to John Paul Adrian Glaubitz
Quoted 2 lines · David Miller

The missing bit is probably having the individual sparc64 VIO drivers define proper module aliases.

I'm actually currently working on a patch. The aliases are already working, now it's just the actual hotplug handler which is missing.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
maintainer
#6 lore raw
In reply to John Paul Adrian Glaubitz

From: David Miller <[email protected]>
Date: Wed, 13 Apr 2016 18:23:49 -0400 (EDT)

Quoted 12 lines

From: John Paul Adrian Glaubitz <[email protected]>
Date: Wed, 13 Apr 2016 17:33:25 +0200

Quoted 9 lines · David Miller
Quoted 1 line

Either way, I'll look at this patch, thanks.

Just as a heads-up:

The suggested patch does not work unfortunately. Modules are not loaded automatically and it seems modaliases are not generated properly.

Quoted 5 lines
Quoted 2 lines

It seems that the vio implementation for sparc which you adapted from powerpc uses a different name to retrieve the device nodes.

The missing bit is probably having the individual sparc64 VIO drivers define proper module aliases.

Actually there is another, more fundamental, problem.

The VIO devices on sparc64 are not instantiated from openfirmware device nodes.

They are instead instantiated from nodes in the machine description.

Ben's patch is therefore buggy, he's looking at the of_node but that will never be filled in for a VIO device on sparc64.

That's why I kinda cringed when it was suggested that the PowerPC and Sparc64 VIO stuff should be merged together. They simply can't, as they are instantiating devices from two different sources.

Does Debian's installer have a machine description counterpart to the opernfirmware device probing and discovery? I bet it doesn't, and that seems to be the first piece of infrastructure that needs to be added before any of this can work.

maintainer
#7 lore raw
In reply to John Paul Adrian Glaubitz

From: John Paul Adrian Glaubitz <[email protected]>
Date: Thu, 14 Apr 2016 00:35:58 +0200

Quoted 6 lines · David Miller
Quoted 2 lines

The missing bit is probably having the individual sparc64 VIO drivers define proper module aliases.

I'm actually currently working on a patch. The aliases are already working, now it's just the actual hotplug handler which is missing.

Are you sure? See my other email, VIO devices don't come from the Openfirmware device tree at all.

#8 lore raw
In reply to John Paul Adrian Glaubitz
Quoted 2 lines · David Miller

Are you sure? See my other email, VIO devices don't come from the Openfirmware device tree at all.

Yeah, I modified Ben's patch and it works:

root@deb4g:/sys/devices/channel-devices# cat vdc*/mod*
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
root@deb4g:/sys/devices/channel-devices#

But I need to do some more clean up. Then I'll send you a patch.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
maintainer
#9 lore raw
In reply to John Paul Adrian Glaubitz

From: John Paul Adrian Glaubitz <[email protected]>
Date: Thu, 14 Apr 2016 00:44:19 +0200

Quoted 8 lines

Yeah, I modified Ben's patch and it works:

root@deb4g:/sys/devices/channel-devices# cat vdc*/mod*
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown

Ok those are the block devices, where are the networking interfaces?

#10 lore raw
In reply to John Paul Adrian Glaubitz
Quoted 1 line · David Miller

Ok those are the block devices, where are the networking interfaces?

Whoops, sorry:

root@deb4g:/sys/devices/channel-devices# cat vdc*/mod*
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
root@deb4g:/sys/devices/channel-devices#

Testing a much simpler version now. Second.

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
#11 lore raw
In reply to John Paul Adrian Glaubitz
Quoted 1 line · John Paul Adrian Glaubitz

Testing a much simpler version now. Second.

Attaching two patches which add modalias_show and vio_hotplug. With the patches applied, module autoloading works as expected.

Going to bed now, it's past midnight here.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

From 3515ad550f7b1db467664acc9bf0ed3d2aec9fdd Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <[email protected]>
Date: Thu, 14 Apr 2016 01:19:40 +0200
Subject: [PATCH 2/2] sparc/kernel/vio.c: implement vio_hotplug and add it to
vio_bus_type

---
 arch/sparc/kernel/vio.c | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/sparc/kernel/vio.c +8 -0
index 5a9bb9d..59f4b7c 100644
@@ -45,6 +45,13 @@ static const struct vio_device_id *vio_match_device(
 	return NULL;
 }
 
+static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env)
+{
+	const struct vio_dev *vio_dev = to_vio_dev(dev);
+	add_uevent_var(env, "MODALIAS=vio:T%sS%s", vio_dev->type, vio_dev->compat);
+	 return 0;
+}
+
 static int vio_bus_match(struct device *dev, struct device_driver *drv)
 {
 	struct vio_dev *vio_dev = to_vio_dev(dev);
@@ -121,6 +128,7 @@ static struct device_attribute vio_dev_attrs[] = {
 static struct bus_type vio_bus_type = {
 	.name		= "vio",
 	.dev_attrs	= vio_dev_attrs,
+	.uevent         = vio_hotplug,
 	.match		= vio_bus_match,
 	.probe		= vio_device_probe,
 	.remove		= vio_device_remove,
Signature · 1 line
2.8.0.rc3

From 8d95bce6a35dc037d1e419896af19e12b3cda910 Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <[email protected]>
Date: Thu, 14 Apr 2016 01:16:14 +0200
Subject: [PATCH 1/2] sparc/kernel/vio.c: implement modalias_show()

---
 arch/sparc/kernel/vio.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/sparc/kernel/vio.c +7 -0
index cb5789c..5a9bb9d 100644
@@ -105,6 +105,13 @@ static ssize_t type_show(struct device *dev,
 	return sprintf(buf, "%s\n", vdev->type);
 }
 
+static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
+                             char *buf)
+{
+	const struct vio_dev *vdev = to_vio_dev(dev);
+	return sprintf(buf, "vio:T%sS%s\n", vdev->type, vdev->compat);
+}
+
 static struct device_attribute vio_dev_attrs[] = {
 	__ATTR_RO(devspec),
 	__ATTR_RO(type),
Signature · 1 line
2.8.0.rc3
maintainer
#12 lore raw
In reply to John Paul Adrian Glaubitz

From: John Paul Adrian Glaubitz <[email protected]>
Date: Thu, 14 Apr 2016 01:04:17 +0200

Quoted 13 lines · David Miller
Quoted 1 line

Ok those are the block devices, where are the networking interfaces?

Whoops, sorry:

root@deb4g:/sys/devices/channel-devices# cat vdc*/mod*
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
root@deb4g:/sys/devices/channel-devices#
Quoted 1 line

Testing a much simpler version now. Second.

Those all say "vdc-port", which again is the block device.

Where are the networking devices?

maintainer
#13 lore raw
In reply to John Paul Adrian Glaubitz

From: John Paul Adrian Glaubitz <[email protected]>
Date: Thu, 14 Apr 2016 01:22:37 +0200

Quoted 16 lines

From 3515ad550f7b1db467664acc9bf0ed3d2aec9fdd Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <[email protected]>
Date: Thu, 14 Apr 2016 01:19:40 +0200
Subject: [PATCH 2/2] sparc/kernel/vio.c: implement vio_hotplug and add it to
vio_bus_type

---
 arch/sparc/kernel/vio.c | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/sparc/kernel/vio.c +0 -0
index 5a9bb9d..59f4b7c 100644

arch/sparc/kernel/vio.c static const struct vio_device_id *vio_match_device( · line 52

Quoted 8 lines
arch/sparc/kernel/vio.c +5 -0
@@ -45,6 +45,13 @@ static const struct vio_device_id *vio_match_device(
 	return NULL;
 }
 
+static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env)
+{
+	const struct vio_dev *vio_dev = to_vio_dev(dev);
+	add_uevent_var(env, "MODALIAS=vio:T%sS%s", vio_dev->type, vio_dev->compat);
+	 return 0;

Extra space before "return 0" after the TAB.

Need an empty line after the local variable declarations.

maintainer
#14 lore raw
In reply to John Paul Adrian Glaubitz

From: John Paul Adrian Glaubitz <[email protected]>
Date: Thu, 14 Apr 2016 01:22:37 +0200

Quoted 15 lines

From 8d95bce6a35dc037d1e419896af19e12b3cda910 Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <[email protected]>
Date: Thu, 14 Apr 2016 01:16:14 +0200
Subject: [PATCH 1/2] sparc/kernel/vio.c: implement modalias_show()

---
 arch/sparc/kernel/vio.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/sparc/kernel/vio.c +0 -0
index cb5789c..5a9bb9d 100644

arch/sparc/kernel/vio.c static ssize_t type_show(struct device *dev, · line 114

Quoted 10 lines
arch/sparc/kernel/vio.c +7 -0
@@ -105,6 +105,13 @@ static ssize_t type_show(struct device *dev,
 	return sprintf(buf, "%s\n", vdev->type);
 }
 
+static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
+                             char *buf)
+{
+	const struct vio_dev *vdev = to_vio_dev(dev);
+	return sprintf(buf, "vio:T%sS%s\n", vdev->type, vdev->compat);
+}
+

You're not hooking this function up at all into the operations. Looks like you are mixing this patch up with other local changes.

And again, please, empty line after local variable declarations.

Thanks.

#15 lore raw
In reply to John Paul Adrian Glaubitz
Quoted 8 lines · David Miller
Quoted 8 lines
root@deb4g:/sys/devices/channel-devices# cat vdc*/mod*
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
vio:Tvdc-portSunknown
root@deb4g:/sys/devices/channel-devices#
Quoted 5 lines
Quoted 1 line

Testing a much simpler version now. Second.

Those all say "vdc-port", which again is the block device.

Where are the networking devices?

Sigh, I shouldn't do such things in the middle of the night, sorry:

root@deb4g:/sys/devices/channel-devices# cat v*/mod*
vio:Tvdc-portS
vio:Tvdc-portS
vio:Tvdc-portS
vio:Tvdc-portS
vio:Tvdc-portS
vio:Tvlds-portS
vio:Tvnet-portS
vio:Tvnet-portS
vio:Tvnet-portS
vio:Tvnet-portS
vio:Tvnet-portS
vio:Tvnet-portS
root@deb4g:/sys/devices/channel-devices#

And, thanks for the comments on the patches. Will fix those, too.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
#16 lore raw
In reply to John Paul Adrian Glaubitz
Quoted 2 lines · David Miller

You're not hooking this function up at all into the operations. Looks like you are mixing this patch up with other local changes.

You are right. I was switching over to your tree and the __ATTR_RO somehow fell off while doing that.

Quoted 1 line

And again, please, empty line after local variable declarations.

I have cleaned up the formatting in both patches and edited the commit messages, attaching updated patches.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

From b7e3362d71c9d1cb972e5c16e4b9054f8f3de63f Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <[email protected]>
Date: Thu, 14 Apr 2016 01:16:14 +0200
Subject: [PATCH 1/2] sparc: Implement and wire up modalias_show for vio.

---
 arch/sparc/kernel/vio.c | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/sparc/kernel/vio.c +9 -0
index cb5789c..e7fd1e5 100644
@@ -105,9 +105,18 @@ static ssize_t type_show(struct device *dev,
 	return sprintf(buf, "%s\n", vdev->type);
 }
 
+static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
+                             char *buf)
+{
+	const struct vio_dev *vdev = to_vio_dev(dev);
+
+	return sprintf(buf, "vio:T%sS%s\n", vdev->type, vdev->compat);
+}
+
 static struct device_attribute vio_dev_attrs[] = {
 	__ATTR_RO(devspec),
 	__ATTR_RO(type),
+	__ATTR_RO(modalias),
 	__ATTR_NULL
 };
 
Signature · 1 line
2.8.0.rc3

From 8b42bee34ffadaa1f10d2af6662214fc979fc45d Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <[email protected]>
Date: Thu, 14 Apr 2016 01:19:40 +0200
Subject: [PATCH 2/2] sparc: Implement and wire up vio_hotplug for vio.

---
 arch/sparc/kernel/vio.c | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/sparc/kernel/vio.c +9 -0
index e7fd1e5..73b33b1 100644
@@ -45,6 +45,14 @@ static const struct vio_device_id *vio_match_device(
 	return NULL;
 }
 
+static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env)
+{
+	const struct vio_dev *vio_dev = to_vio_dev(dev);
+
+	add_uevent_var(env, "MODALIAS=vio:T%sS%s", vio_dev->type, vio_dev->compat);
+	return 0;
+}
+
 static int vio_bus_match(struct device *dev, struct device_driver *drv)
 {
 	struct vio_dev *vio_dev = to_vio_dev(dev);
@@ -123,6 +131,7 @@ static struct device_attribute vio_dev_attrs[] = {
 static struct bus_type vio_bus_type = {
 	.name		= "vio",
 	.dev_attrs	= vio_dev_attrs,
+	.uevent         = vio_hotplug,
 	.match		= vio_bus_match,
 	.probe		= vio_device_probe,
 	.remove		= vio_device_remove,
Signature · 1 line
2.8.0.rc3
#17 lore raw
In reply to John Paul Adrian Glaubitz

Hi Adrian.

Great work - good to see all the progress on sparc64 in debian!

Quoted 4 lines
Quoted 1 line
Quoted 1 line

From b7e3362d71c9d1cb972e5c16e4b9054f8f3de63f Mon Sep 17 00:00:00 2001

From: John Paul Adrian Glaubitz <[email protected]>
Date: Thu, 14 Apr 2016 01:16:14 +0200
Subject: [PATCH 1/2] sparc: Implement and wire up modalias_show for vio.

It would be nice if you could add here the effect this patch has - that it fixes the debian installer.

Quoted 11 lines
---
 arch/sparc/kernel/vio.c | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/sparc/kernel/vio.c +0 -0
index cb5789c..e7fd1e5 100644

arch/sparc/kernel/vio.c static ssize_t type_show(struct device *dev, · line 109

Quoted 5 lines
arch/sparc/kernel/vio.c +2 -0
@@ -105,9 +105,18 @@ static ssize_t type_show(struct device *dev,
 	return sprintf(buf, "%s\n", vdev->type);
 }
 
+static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
+                             char *buf)

Please use tabs and the appropriate number of spaces to indent.

arch/sparc/kernel/vio.c static ssize_t type_show(struct device *dev, · line 125

Quoted 6 lines
arch/sparc/kernel/vio.c +6 -0
+{
+	const struct vio_dev *vdev = to_vio_dev(dev);
+
+	return sprintf(buf, "vio:T%sS%s\n", vdev->type, vdev->compat);
+}
+

At sparclinux we usually submit one patch per mail.
And patches which are specific for either sparc32 or sparc64 are prefixed so.

Like this
[PATCH 1/2] sparc64: ...
[PATCH 2/2] sparc64: ...

Sam

#18 lore raw
In reply to John Paul Adrian Glaubitz

Hi Sam!

Quoted 1 line · Sam Ravnborg

Great work - good to see all the progress on sparc64 in debian!

Thanks!

Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line

From b7e3362d71c9d1cb972e5c16e4b9054f8f3de63f Mon Sep 17 00:00:00 2001

From: John Paul Adrian Glaubitz <[email protected]>
Date: Thu, 14 Apr 2016 01:16:14 +0200
Subject: [PATCH 1/2] sparc: Implement and wire up modalias_show for vio.

It would be nice if you could add here the effect this patch has - that it fixes the debian installer.

Hmm, I'm not sure whether this belongs here. I thought it was obvious what these two changes are for due to the canonical function names.

Quoted 13 lines
Quoted 13 lines
---
 arch/sparc/kernel/vio.c | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/sparc/kernel/vio.c +0 -0
index cb5789c..e7fd1e5 100644
@@ -105,9 +105,18 @@ static ssize_t type_show(struct device *dev,
 	return sprintf(buf, "%s\n", vdev->type);
 }
 
Quoted 3 lines

arch/sparc/kernel/vio.c static ssize_t type_show(struct device *dev, · line 109

Quoted 2 lines
arch/sparc/kernel/vio.c +2 -0
+static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
+                             char *buf)

Please use tabs and the appropriate number of spaces to indent.

I used the same indentation that is used for modalias_show in arch/powerpc/kernel/vio.c but I wasn't sure what the proper indentation would be in this case.

Can you suggest the right indentation?

Quoted 10 lines

arch/sparc/kernel/vio.c static ssize_t type_show(struct device *dev, · line 125

Quoted 6 lines
arch/sparc/kernel/vio.c +6 -0
+{
+	const struct vio_dev *vdev = to_vio_dev(dev);
+
+	return sprintf(buf, "vio:T%sS%s\n", vdev->type, vdev->compat);
+}
+

At sparclinux we usually submit one patch per mail.
And patches which are specific for either sparc32 or sparc64 are prefixed so.

Quoted 3 lines

Like this
[PATCH 1/2] sparc64: ...
[PATCH 2/2] sparc64: ...

Yeah, I know. I can re-send them with git send-email if that's desired, I just wanted to avoid cluttering the discussion too much.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
#19 lore raw
In reply to John Paul Adrian Glaubitz

Hi Adrian.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Date: Thu, 14 Apr 2016 01:16:14 +0200
Subject: [PATCH 1/2] sparc: Implement and wire up modalias_show for vio.

It would be nice if you could add here the effect this patch has - that it fixes the debian installer.

Hmm, I'm not sure whether this belongs here. I thought it was obvious what these two changes are for due to the canonical function names.

Just a suggestion - skip it as you prefer.

Quoted 9 lines
Quoted 3 lines

arch/sparc/kernel/vio.c static ssize_t type_show(struct device *dev, · line 109

Quoted 2 lines
arch/sparc/kernel/vio.c +2 -0
+static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
+                             char *buf)

Please use tabs and the appropriate number of spaces to indent.

I used the same indentation that is used for modalias_show in arch/powerpc/kernel/vio.c but I wasn't sure what the proper indentation would be in this case.

Can you suggest the right indentation?

You shall uses tabs and the necessary number of spaces so the arguments are aligned with the first argument.
So the alignment is fine - just replace preceeding spaces with tabs.

Like this:
static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
char *buf)

Three leading tabs, then 5 spaces.

Quoted 10 lines
Quoted 7 lines

At sparclinux we usually submit one patch per mail.
And patches which are specific for either sparc32 or sparc64 are prefixed so.

Like this
[PATCH 1/2] sparc64: ...
[PATCH 2/2] sparc64: ...

Yeah, I know. I can re-send them with git send-email if that's desired, I just wanted to avoid cluttering the discussion too much.

It is my understanding that this is simpler for davem when applying patches. But maybe patchwork makes things easier with respect to attached patches. Anyway - if you follow the normal pattern then everything should just works.

Most important, document what was changed from v1 to v2 - so when davem and other looks at this they know what was changed.

Sam

#20 lore raw
In reply to John Paul Adrian Glaubitz
Quoted 3 lines · Sam Ravnborg
Quoted 2 lines

Hmm, I'm not sure whether this belongs here. I thought it was obvious what these two changes are for due to the canonical function names.

Just a suggestion - skip it as you prefer.

Ok, thanks!

Quoted 9 lines
Quoted 5 lines

I used the same indentation that is used for modalias_show in arch/powerpc/kernel/vio.c but I wasn't sure what the proper indentation would be in this case.

Can you suggest the right indentation?

You shall uses tabs and the necessary number of spaces so the arguments are aligned with the first argument.
So the alignment is fine - just replace preceeding spaces with tabs.

Quoted 5 lines

Like this:
static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
char *buf)

Three leading tabs, then 5 spaces.

Alright, will do.

Quoted 8 lines
Quoted 2 lines

Yeah, I know. I can re-send them with git send-email if that's desired, I just wanted to avoid cluttering the discussion too much.

It is my understanding that this is simpler for davem when applying patches. But maybe patchwork makes things easier with respect to attached patches. Anyway - if you follow the normal pattern then everything should just works.

Most important, document what was changed from v1 to v2 - so when davem and other looks at this they know what was changed.

I'll wait for davem to chime in and then post the patches the way he prefers.

Thanks for the suggestions!

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
maintainer
#21 lore raw
In reply to John Paul Adrian Glaubitz

From: John Paul Adrian Glaubitz <[email protected]>
Date: Thu, 14 Apr 2016 11:00:41 +0200

Quoted 16 lines

Sigh, I shouldn't do such things in the middle of the night, sorry:

root@deb4g:/sys/devices/channel-devices# cat v*/mod*
vio:Tvdc-portS
vio:Tvdc-portS
vio:Tvdc-portS
vio:Tvdc-portS
vio:Tvdc-portS
vio:Tvlds-portS
vio:Tvnet-portS
vio:Tvnet-portS
vio:Tvnet-portS
vio:Tvnet-portS
vio:Tvnet-portS
vio:Tvnet-portS
root@deb4g:/sys/devices/channel-devices#

That looks a lot better.