Re: Enable module aliases for vio on sparc/sparc64

2016-04-14 Thread David Miller
From: John Paul Adrian Glaubitz 
Date: Thu, 14 Apr 2016 11:00:41 +0200

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



Re: Enable module aliases for vio on sparc/sparc64

2016-04-14 Thread John Paul Adrian Glaubitz
On 04/14/2016 03:30 PM, Sam Ravnborg wrote:
>> 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!

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

Alright, will do.

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

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Re: Enable module aliases for vio on sparc/sparc64

2016-04-14 Thread Sam Ravnborg
Hi Adrian.

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

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

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



Re: Enable module aliases for vio on sparc/sparc64

2016-04-14 Thread John Paul Adrian Glaubitz
Hi Sam!

On 04/14/2016 12:27 PM, Sam Ravnborg wrote:
> Great work - good to see all the progress on sparc64 in debian!

Thanks!

>>> >From b7e3362d71c9d1cb972e5c16e4b9054f8f3de63f Mon Sep 17 00:00:00 2001
>> From: John Paul Adrian Glaubitz 
>> 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.

>> Signed-off-by: John Paul Adrian Glaubitz 
>> ---
>>  arch/sparc/kernel/vio.c | 9 +
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
>> index cb5789c..e7fd1e5 100644
>> --- a/arch/sparc/kernel/vio.c
>> +++ b/arch/sparc/kernel/vio.c
>> @@ -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.

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?

>> +{
>> +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: ...

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

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Re: Enable module aliases for vio on sparc/sparc64

2016-04-14 Thread Sam Ravnborg
Hi Adrian.

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

> >>From b7e3362d71c9d1cb972e5c16e4b9054f8f3de63f Mon Sep 17 00:00:00 2001
> From: John Paul Adrian Glaubitz 
> 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.

> 
> Signed-off-by: John Paul Adrian Glaubitz 
> ---
>  arch/sparc/kernel/vio.c | 9 +
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
> index cb5789c..e7fd1e5 100644
> --- a/arch/sparc/kernel/vio.c
> +++ b/arch/sparc/kernel/vio.c
> @@ -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.

> +{
> + 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



Re: Enable module aliases for vio on sparc/sparc64

2016-04-14 Thread John Paul Adrian Glaubitz
On 04/14/2016 03:53 AM, David Miller wrote:
> 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.

> 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

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-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 
Date: Thu, 14 Apr 2016 01:16:14 +0200
Subject: [PATCH 1/2] sparc: Implement and wire up modalias_show for vio.

Signed-off-by: John Paul Adrian Glaubitz 
---
 arch/sparc/kernel/vio.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
index cb5789c..e7fd1e5 100644
--- a/arch/sparc/kernel/vio.c
+++ b/arch/sparc/kernel/vio.c
@@ -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
 };
 
-- 
2.8.0.rc3

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

Signed-off-by: John Paul Adrian Glaubitz 
---
 arch/sparc/kernel/vio.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
index e7fd1e5..73b33b1 100644
--- a/arch/sparc/kernel/vio.c
+++ b/arch/sparc/kernel/vio.c
@@ -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,
-- 
2.8.0.rc3



Re: Enable module aliases for vio on sparc/sparc64

2016-04-14 Thread John Paul Adrian Glaubitz
On 04/14/2016 03:52 AM, David Miller wrote:
>> 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.
> 
> 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

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Re: Enable module aliases for vio on sparc/sparc64

2016-04-13 Thread David Miller
From: John Paul Adrian Glaubitz 
Date: Thu, 14 Apr 2016 01:22:37 +0200

> From 8d95bce6a35dc037d1e419896af19e12b3cda910 Mon Sep 17 00:00:00 2001
> From: John Paul Adrian Glaubitz 
> Date: Thu, 14 Apr 2016 01:16:14 +0200
> Subject: [PATCH 1/2] sparc/kernel/vio.c: implement modalias_show()
> 
> Signed-off-by: John Paul Adrian Glaubitz 
> ---
>  arch/sparc/kernel/vio.c | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
> index cb5789c..5a9bb9d 100644
> --- a/arch/sparc/kernel/vio.c
> +++ b/arch/sparc/kernel/vio.c
> @@ -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.



Re: Enable module aliases for vio on sparc/sparc64

2016-04-13 Thread David Miller
From: John Paul Adrian Glaubitz 
Date: Thu, 14 Apr 2016 01:22:37 +0200

> From 3515ad550f7b1db467664acc9bf0ed3d2aec9fdd Mon Sep 17 00:00:00 2001
> From: John Paul Adrian Glaubitz 
> 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
> 
> Signed-off-by: John Paul Adrian Glaubitz 
> ---
>  arch/sparc/kernel/vio.c | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
> index 5a9bb9d..59f4b7c 100644
> --- a/arch/sparc/kernel/vio.c
> +++ b/arch/sparc/kernel/vio.c
> @@ -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.



Re: Enable module aliases for vio on sparc/sparc64

2016-04-13 Thread David Miller
From: John Paul Adrian Glaubitz 
Date: Thu, 14 Apr 2016 01:04:17 +0200

> On 04/14/2016 01:01 AM, David Miller wrote:
>> 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.

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

Where are the networking devices?



Re: Enable module aliases for vio on sparc/sparc64

2016-04-13 Thread Patrick Baggett
You guys are my heroes. Keep up the great work!

On Wednesday, April 13, 2016, John Paul Adrian Glaubitz <
glaub...@physik.fu-berlin.de> wrote:

> On 04/14/2016 01:01 AM, David Miller wrote:
> > 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.
>
> --
>  .''`.  John Paul Adrian Glaubitz
> : :' :  Debian Developer - glaub...@debian.org 
> `. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
> 
>   `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
>
>


Re: Enable module aliases for vio on sparc/sparc64

2016-04-13 Thread John Paul Adrian Glaubitz
On 04/14/2016 01:04 AM, John Paul Adrian Glaubitz wrote:
> 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

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-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 
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

Signed-off-by: John Paul Adrian Glaubitz 
---
 arch/sparc/kernel/vio.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
index 5a9bb9d..59f4b7c 100644
--- a/arch/sparc/kernel/vio.c
+++ b/arch/sparc/kernel/vio.c
@@ -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,
-- 
2.8.0.rc3

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

Signed-off-by: John Paul Adrian Glaubitz 
---
 arch/sparc/kernel/vio.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
index cb5789c..5a9bb9d 100644
--- a/arch/sparc/kernel/vio.c
+++ b/arch/sparc/kernel/vio.c
@@ -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),
-- 
2.8.0.rc3



Re: Enable module aliases for vio on sparc/sparc64

2016-04-13 Thread David Miller
From: John Paul Adrian Glaubitz 
Date: Thu, 14 Apr 2016 00:44:19 +0200

> 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?



Re: Enable module aliases for vio on sparc/sparc64

2016-04-13 Thread John Paul Adrian Glaubitz
On 04/14/2016 01:01 AM, David Miller wrote:
> 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.

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Re: Enable module aliases for vio on sparc/sparc64

2016-04-13 Thread David Miller
From: John Paul Adrian Glaubitz 
Date: Thu, 14 Apr 2016 00:35:58 +0200

> On 04/14/2016 12:23 AM, David Miller wrote:
>> 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.



Re: Enable module aliases for vio on sparc/sparc64

2016-04-13 Thread David Miller
From: David Miller 
Date: Wed, 13 Apr 2016 18:23:49 -0400 (EDT)

> From: John Paul Adrian Glaubitz 
> Date: Wed, 13 Apr 2016 17:33:25 +0200
> 
>> On 04/11/2016 09:04 PM, David Miller wrote:
>>> 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.

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.



Re: Enable module aliases for vio on sparc/sparc64

2016-04-13 Thread John Paul Adrian Glaubitz
On 04/14/2016 12:37 AM, David Miller wrote:
> 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

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Re: Enable module aliases for vio on sparc/sparc64

2016-04-13 Thread David Miller
From: John Paul Adrian Glaubitz 
Date: Wed, 13 Apr 2016 17:33:25 +0200

> On 04/11/2016 09:04 PM, David Miller wrote:
>> 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.



Re: Enable module aliases for vio on sparc/sparc64

2016-04-13 Thread John Paul Adrian Glaubitz
On 04/14/2016 12:23 AM, David Miller wrote:
> 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

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Re: Enable module aliases for vio on sparc/sparc64

2016-04-13 Thread John Paul Adrian Glaubitz
On 04/11/2016 09:04 PM, David Miller wrote:
> 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

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Re: Enable module aliases for vio on sparc/sparc64

2016-04-12 Thread John Paul Adrian Glaubitz
Hi!

On 04/11/2016 09:04 PM, David Miller wrote:
> 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.

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

Great, thanks a lot!

Adrian

> [1]
http://sources.debian.net/src/initramfs-tools/0.123/hook-functions/?hl=478#L478

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Re: Enable module aliases for vio on sparc/sparc64

2016-04-11 Thread David Miller
From: John Paul Adrian Glaubitz 
Date: Mon, 11 Apr 2016 09:30:54 +0200

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